PROXiCiDE

Unique List

May 10th, 2014
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. ScriptName RandomScript Extends Quest
  2.  
  3. ;---------------------------------------------------------------------------------[Author Information]
  4. ;PROXiCide aka Taewon
  5. ;Steam: http://steamcommunity.com/id/PROXiCiDE
  6. ;Nexus: http://skyrim.nexusmods.com/users/3018315
  7. ;Bethesda: http://forums.bethsoft.com/user/425376-taewon/
  8. ;CreationKit: http://www.creationkit.com/User:PROXiCiDE
  9. ;---------------------------------------------------------------------------------
  10.  
  11. Form Function UniqueList_RandomForm(FormList akList)
  12. If akList == None
  13. Return None
  14. EndIf
  15.  
  16. Int iLen = akList.GetSize() - 1
  17. Int iIndex = 0
  18. If iLen>=1
  19. iIndex = Utility.RandomInt(0,iLen)
  20. EndIf
  21. Return akList.GetAt(iIndex)
  22. EndFunction
  23.  
  24. Bool Function UniqueList_Add(Form akForm, FormList akList)
  25. If akList.HasForm(akForm)
  26. Return False
  27. EndIf
  28.  
  29. akList.AddForm(akForm)
  30. Return True
  31. EndFunction
Advertisement
Add Comment
Please, Sign In to add comment