enderalse/source/scripts/_00e_a1_flashpowderexpsc.psc

74 lines
2.4 KiB
Plaintext
Raw Normal View History

Scriptname _00E_A1_FlashpowderExpSC extends activemagiceffect
Import _00E_TalentLibrary
Import Utility
Event OnEffectStart(Actor akTarget, Actor akCaster)
If !akTarget.HasSpell(_00E_AbBleedoutSP)
AliasFound = False
Victim = akTarget
PutIntoAlias(Victim)
akTarget.SetGhost(true)
Wait(GetWaitDuration())
iAliasToFill.Clear()
_00E_A2_FlashpowderGlobal.SetValueInt(0)
akTarget.SetGhost(false)
akTarget.StopCombatAlarm()
Victim.EvaluatePackage()
EndIf
EndEvent
;=====================================================================================
; FUNCTIONS
;=====================================================================================
Function PutIntoAlias(Actor iActor)
if !AliasFound && !iActor.HasSpell(_00E_AbBleedoutSP)
int iAliasIndex = A1_Flashpowder_VictimArray.Length - 1
while (!AliasFound && iAliasIndex >= 0) && !(iActor.HasSpell(_00E_AbBleedoutSP))
iAliasToFill = A1_Flashpowder_VictimArray[iAliasIndex]
If iAliasToFill.ForceRefIfEmpty(iActor)
AliasFound = True
Else
iAliasIndex -= 1
EndIf
EndWhile
EndIf
EndFunction
float Function GetWaitDuration()
int iDurationIndex = GetPlayerTalentLevel(_00E_Class_Manipulation_P05_Talent_Rift, _00E_Class_Manipulation_P05_Talent_Rift2, _00E_Class_Manipulation_P05_Talent_Rift3) - 1
Float iWaitDuration = _00E_A1_FlashpowderSP.GetNthEffectDuration(iDurationIndex)
Return iWaitDuration
EndFunction
;=====================================================================================
; PROPERTIES
;=====================================================================================
Actor Victim
bool AliasFound
ReferenceAlias iAliasToFill
Spell Property _00E_A1_FlashpowderSP Auto
Spell Property _00E_AbBleedoutSP Auto
GlobalVariable Property _00E_A2_FlashpowderGlobal Auto
Perk Property _00E_Class_Manipulation_P05_Talent_Rift Auto
Perk Property _00E_Class_Manipulation_P05_Talent_Rift2 Auto
Perk Property _00E_Class_Manipulation_P05_Talent_Rift3 Auto
ReferenceAlias[] Property A1_Flashpowder_VictimArray Auto