Moderator
M
Moderator
|
Chain frost stats

Events


Map initialization

Conditions

Actions


-------- Set the spell --------


Set ChainFrost = Chain Frost


-------- Set the base damage of the spell --------


Set rDamage = 150.00


-------- Set the damage per level of the ability --------


Set rLvlDamage = 100.00


-------- Choose how many times it should bounce --------


Set iJumps = 7


-------- Number of jumps increased per level --------


Set iLvlJumps = 1


-------- 128 units = 1 tile in length --------


-------- 1 rSpeed = 33 units p/sec --------


Set rSpeed = 14.00


-------- Effect on impact --------


Set sChainFrostE = Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
Chain frost spell

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to ChainFrost

Actions


If (iChainFrostIndex Equal to 0) then do (Trigger - Turn on Chain frost loop <gen>) else do (-------- begin --------)


Set iChainFrostIndex = (iChainFrostIndex + 1)


Set uChainFrostC[iChainFrostIndex] = (Triggering unit)


Set uChainFrostT[iChainFrostIndex] = (Target unit of ability being cast)


Set Temp_Point = (Position of uChainFrostC[iChainFrostIndex])


Unit - Create 1 Chain frost for Neutral Passive at Temp_Point facing Default building facing degrees


Set uChainFrostD[iChainFrostIndex] = (Last created unit)


Set Temp_Int = (Level of ChainFrost for uChainFrostC[iChainFrostIndex])


Set iChainFrostJumps[iChainFrostIndex] = (iJumps + (Temp_Int x iLevelJumps))


Set rFinalDamage[iChainFrostIndex] = (rDamage + ((Real(Temp_Int)) x rLvlDamage))


Custom script: call RemoveLocation(udg_Temp_Point)
Chain frost loop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


For each (Integer Temp_Int) from 1 to iChainFrostIndex, do (Actions)



Loop - Actions




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





If - Conditions






(uChainFrostD[Temp_Int] is paused) Equal to False





Then - Actions






-------- Get the location of the effect and target --------






Set Temp_Point = (Position of uChainFrostD[Temp_Int])






Set Temp_Point2 = (Position of uChainFrostT[Temp_Int])






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







If - Conditions








(Distance between Temp_Point and Temp_Point2) Greater than (2.00 x rSpeed)







Then - Actions








-------- Move effect towards target --------








Set Temp_Point3 = (Temp_Point offset by rSpeed towards (Angle from Temp_Point to Temp_Point2) degrees)








Unit - Move uChainFrostD[Temp_Int] instantly to Temp_Point3








Custom script: call RemoveLocation(udg_Temp_Point3)







Else - Actions








-------- Finally damage the target --------








Set Temp_Point3 = (Position of uChainFrostT[Temp_Int])








Unit - Move uChainFrostT[Temp_Int] instantly to Temp_Point3








Unit - Cause uChainFrostC[Temp_Int] to damage uChainFrostT[Temp_Int], dealing rFinalDamage[Temp_Int] damage of attack type Spells and damage type Cold








Custom script: call DestroyEffect(AddSpecialEffectLoc(udg_sChainFrostE,udg_Temp_Point3))








Set iChainFrostJumps[Temp_Int] = (iChainFrostJumps[Temp_Int] - 1)








-------- Pick the next target --------








Set Temp_Group = (Units within 500.00 of Temp_Point3)








Custom script: call RemoveLocation(udg_Temp_Point3)








-------- Remove invalid targets --------








Unit Group - Remove uChainFrostT[Temp_Int] from Temp_Group








Unit Group - Pick every unit in Temp_Group and do (Actions)









Loop - Actions










Set Temp_unit = (Picked unit)










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











If - Conditions












Or - Any (Conditions) are true













Conditions














(Temp_unit is A structure) Equal to True














(Temp_unit is A flying unit) Equal to True














((Owner of Temp_unit) is an enemy of (Owner of uChainFrostC[Temp_Int])) Equal to False














(Life of Temp_unit) Less than 0.41











Then - Actions












Unit Group - Remove Temp_unit from Temp_Group











Else - Actions








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









If - Conditions










iChainFrostJumps[Temp_Int] Greater than 0










(Temp_Group is empty) Equal to False









Then - Actions










Set uChainFrostT[Temp_Int] = (Random unit from Temp_Group)









Else - Actions










-------- Chain Frost is done, clean up --------










Set uChainFrostC[Temp_Int] = uChainFrostC[iChainFrostIndex]










Set uChainFrostC[iChainFrostIndex] = No unit










Set uChainFrostT[Temp_Int] = uChainFrostT[iChainFrostIndex]










Set uChainFrostT[iChainFrostIndex] = No unit










Unit - Remove uChainFrostD[Temp_Int] from the game










Set uChainFrostD[Temp_Int] = uChainFrostD[iChainFrostIndex]










Set uChainFrostD[iChainFrostIndex] = No unit










Set iChainFrostJumps[Temp_Int] = iChainFrostJumps[iChainFrostIndex]










Set iChainFrostJumps[iChainFrostIndex] = 0










Set rFinalDamage[Temp_Int] = rFinalDamage[iChainFrostIndex]










Set rFinalDamage[iChainFrostIndex] = 0.00










Set iChainFrostIndex = (iChainFrostIndex - 1)










Set Temp_Int = (Temp_Int - 1)










If (iChainFrostIndex Equal to 0) then do (Trigger - Turn off (This trigger)) else do (-------- finish --------)








Custom script: call DestroyGroup(udg_Temp_Group)






Custom script: call RemoveLocation(udg_Temp_Point)






Custom script: call RemoveLocation(udg_Temp_Point2)





Else - Actions