Moderator
M
Moderator
20:39, 22nd Nov 2013
Maker: The system is useful and it works
Maker: The system is useful and it works
Defend

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Defend Custom (hero)

Actions


Set Defend_MaxIndex = (Defend_MaxIndex + 1)


Set Defend_Caster[Defend_MaxIndex] = (Triggering unit)


Set Defend_Counter[Defend_MaxIndex] = (4.00 + (Real((Level of Defend Custom (hero) for Defend_Caster[Defend_MaxIndex]))))


Animation - Add the defend animation tag to Defend_Caster[Defend_MaxIndex]


Unit - Add Spell Book, Defend to Defend_Caster[Defend_MaxIndex]


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




Defend_MaxIndex Equal to 1



Then - Actions




Trigger - Turn on DefendLoop <gen>



Else - Actions
DefendLoop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


For each (Integer Defend_CurrentIndex) from 1 to Defend_MaxIndex, do (Actions)



Loop - Actions




Set Defend_Counter[Defend_CurrentIndex] = (Defend_Counter[Defend_CurrentIndex] - 0.03)




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






Defend_Counter[Defend_CurrentIndex] Less than or equal to 0.00





Then - Actions






Animation - Remove the defend animation tag to Defend_Caster[Defend_CurrentIndex]






Unit - Remove Spell Book, Defend from Defend_Caster[Defend_CurrentIndex]






Set Defend_Caster[Defend_CurrentIndex] = Defend_Caster[Defend_MaxIndex]






Set Defend_Counter[Defend_CurrentIndex] = Defend_Counter[Defend_MaxIndex]






Set Defend_MaxIndex = (Defend_MaxIndex - 1)






Set Defend_CurrentIndex = (Defend_CurrentIndex - 1)






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








Defend_MaxIndex Equal to 0







Then - Actions








Trigger - Turn off (This trigger)







Else - Actions





Else - Actions