Advertisement
ThoraldGM

Fallout 4: Cloak Script

Oct 22nd, 2017
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.78 KB | None | 0 0
  1. Scriptname DCS_MonitorScript extends ActiveMagicEffect
  2. { It just works. }
  3.  
  4. ; ------------------------------------------------------------------------------------------------------------
  5. ; PROPERTIES
  6. ; ------------------------------------------------------------------------------------------------------------
  7.  
  8. Outfit Property pDCS_Outfit_Default Auto Const Mandatory ; Default Diamond City SWAT outfit
  9. FormList Property pDCS_Flst_Outfits_Allowed Auto ; Multi-array holds outfits selected by player
  10. FormList Property pDCS_Flst_Outfits_Nested00 Auto ; The first nested formlist to check
  11.  
  12. ; ------------------------------------------------------------------------------------------------------------
  13. ; EVENT: ON EFFECT START
  14. ; ------------------------------------------------------------------------------------------------------------
  15.  
  16. Event OnEffectStart(Actor akTarget, Actor akCaster)
  17.  
  18. ; ********************************************************************************************************
  19. ; Select a random outfit from the multi-array of player approved outfits (X: Faction, Y: Outfits)
  20. ; ********************************************************************************************************
  21.  
  22. Outfit SelectedOutfit = pDCS_Outfit_Default ; default outfit
  23.  
  24. FormList ApprovedList = pDCS_Flst_Outfits_Allowed ; start with multi-array
  25.  
  26. Int NestedSize = pDCS_Flst_Outfits_Nested00.GetSize() ; Check the first nested formlist
  27.  
  28. If NestedSize > 0 ; If the multi-array is not empty
  29.  
  30. Int RandMax = ApprovedList.GetSize() - 1 ; set upper bound
  31. Int RandIndex = Utility.RandomInt(0, RandMax) ; roll random index
  32.  
  33. FormList RandNested = ApprovedList.GetAt(RandIndex) as FormList ; get random formlist from multi-array
  34.  
  35. RandMax = RandNested.GetSize() - 1 ; set upper bound of nested list
  36. RandIndex = Utility.RandomInt(0, RandMax) ; roll random index
  37.  
  38. SelectedOutfit = RandNested.GetAt(RandIndex) as Outfit ; get random outfit from selected formlist
  39.  
  40. EndIf
  41.  
  42. ; ********************************************************************************************************
  43. ; Replace target's current outfit with the selected outfit.
  44. ; ********************************************************************************************************
  45.  
  46. akTarget.SetOutfit(SelectedOutfit)
  47.  
  48. Debug.Notification("DCS: GUARD CLOAKED!!!")
  49.  
  50. EndEvent
  51.  
  52. ; ------------------------------------------------------------------------------------------------------------
  53. ; EVENT: ON EFFECT FINISH
  54. ; ------------------------------------------------------------------------------------------------------------
  55.  
  56. Event OnEffectFinish(Actor akTarget, Actor akCaster)
  57. ; Debug.Trace("Magic effect fades from " + akTarget)
  58. EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement