Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scriptname DCS_MonitorScript extends ActiveMagicEffect
- { It just works. }
- ; ------------------------------------------------------------------------------------------------------------
- ; PROPERTIES
- ; ------------------------------------------------------------------------------------------------------------
- Outfit Property pDCS_Outfit_Default Auto Const Mandatory ; Default Diamond City SWAT outfit
- FormList Property pDCS_Flst_Outfits_Allowed Auto ; Multi-array holds outfits selected by player
- FormList Property pDCS_Flst_Outfits_Nested00 Auto ; The first nested formlist to check
- ; ------------------------------------------------------------------------------------------------------------
- ; EVENT: ON EFFECT START
- ; ------------------------------------------------------------------------------------------------------------
- Event OnEffectStart(Actor akTarget, Actor akCaster)
- ; ********************************************************************************************************
- ; Select a random outfit from the multi-array of player approved outfits (X: Faction, Y: Outfits)
- ; ********************************************************************************************************
- Outfit SelectedOutfit = pDCS_Outfit_Default ; default outfit
- FormList ApprovedList = pDCS_Flst_Outfits_Allowed ; start with multi-array
- Int NestedSize = pDCS_Flst_Outfits_Nested00.GetSize() ; Check the first nested formlist
- If NestedSize > 0 ; If the multi-array is not empty
- Int RandMax = ApprovedList.GetSize() - 1 ; set upper bound
- Int RandIndex = Utility.RandomInt(0, RandMax) ; roll random index
- FormList RandNested = ApprovedList.GetAt(RandIndex) as FormList ; get random formlist from multi-array
- RandMax = RandNested.GetSize() - 1 ; set upper bound of nested list
- RandIndex = Utility.RandomInt(0, RandMax) ; roll random index
- SelectedOutfit = RandNested.GetAt(RandIndex) as Outfit ; get random outfit from selected formlist
- EndIf
- ; ********************************************************************************************************
- ; Replace target's current outfit with the selected outfit.
- ; ********************************************************************************************************
- akTarget.SetOutfit(SelectedOutfit)
- Debug.Notification("DCS: GUARD CLOAKED!!!")
- EndEvent
- ; ------------------------------------------------------------------------------------------------------------
- ; EVENT: ON EFFECT FINISH
- ; ------------------------------------------------------------------------------------------------------------
- Event OnEffectFinish(Actor akTarget, Actor akCaster)
- ; Debug.Trace("Magic effect fades from " + akTarget)
- EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement