Moderator
M
Moderator
19:05, 12th Jul 2010
TriggerHappy:
Leakless and MUI.
TriggerHappy:
Leakless and MUI.
Incinerate Cast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Incinerate

Actions


-------- Stores Caster and Target into variables --------


Set Caster = (Triggering unit)


Set Target = (Target unit of ability being cast)


-------- Finds the Point of ignition --------


Set Points[1] = (Position of Target)


-------- Sets the duration of the spell --------


-------- NOTE 1: Set your duration here. --------


Set Real[1] = 1.50


-------- Counts X and Y coordinates of the Point of Ignition to make it easier to transport through Hashtable --------


Set Real[2] = (X of Points[1])


Set Real[3] = (Y of Points[1])


-------- Counts the Escape Range --------


-------- NOTE 2: Modify your range of Escape here --------


Set Real[4] = (150.00 + (50.00 x (Real((Level of Incinerate for Caster)))))


-------- Here counts the TOTAL DoT --------


-------- NOTE 3: Modify your total DoT here --------


Set Real[5] = (20.00 + (20.00 x (Real((Level of Incinerate for Caster)))))


-------- Counts the Explosion damage --------


-------- NOTE 4: Change your explosion damage here --------


Set Real[6] = (Real[5] x 3.00)


-------- Counts how much damage will the DoT deal once per loop --------


-------- NOTE 5: DON'T touch these countings! --------


Set Real[5] = (Real[5] / Real[1])


Set Real[5] = (Real[5] x 0.05)


-------- Plays the SFX of impact ignition and instantly destroys it, fixing the SFX leak --------


-------- NOTE 6: Change your Impact Ignition SFX here. You don't want an Icy spell with Fiery SFXes, do you? --------


Special Effect - Create a special effect attached to the chest of Target using Abilities\Weapons\RedDragonBreath\RedDragonMissile.mdl


Special Effect - Destroy (Last created special effect)


-------- Creates Floating text, saying how much does target has to run to escape the Explosion --------


Floating Text - Create floating text that reads (String((Integer(Real[4])))) above Target with Z offset 0.00, using font size 15.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency


Floating Text - Change (Last created floating text): Disable permanence


Set FloatingText = (Last created floating text)


-------- Creates a dummy unit --------


Unit - Create 1 Dummy Unit for (Owner of Caster) at Points[1] facing Default building facing degrees


-------- Stores all the information needed to the Hashtable --------


-------- NOTE 7: All the information is attached to the Dummy unit, making it infinitely Multi-Target per Unit instancable --------


Hashtable - Save Handle OfTarget as 0 of (Key (Last created unit)) in Hashtable


Hashtable - Save Handle OfCaster as 1 of (Key (Last created unit)) in Hashtable


Hashtable - Save Real[1] as 2 of (Key (Last created unit)) in Hashtable


Hashtable - Save Real[2] as 3 of (Key (Last created unit)) in Hashtable


Hashtable - Save Real[3] as 4 of (Key (Last created unit)) in Hashtable


Hashtable - Save Real[4] as 5 of (Key (Last created unit)) in Hashtable


Hashtable - Save Real[5] as 6 of (Key (Last created unit)) in Hashtable


Hashtable - Save Real[6] as 7 of (Key (Last created unit)) in Hashtable


-------- Creates a SFX to mark the Point of Ignition and stores it in the Hashtable --------


-------- NOTE 8: Change your Marking SFX here. As I already said, you don't want an Icy spell with Fiery SFXes, do you? --------


Special Effect - Create a special effect at Points[1] using Doodads\Cinematic\FirePillarMedium\FirePillarMedium.mdl


Hashtable - Save Handle Of(Last created special effect) as 8 of (Key (Last created unit)) in Hashtable


-------- Creates a SFX of the Ignition Buff and stores it in the Hashtable --------


-------- NOTE 8: Change your Buff SFX here. As I already said, you don't want an Icy spell with Fiery SFXes, do you? --------


Special Effect - Create a special effect attached to the origin of Target using Environment\NightElfBuildingFire\ElfLargeBuildingFire1.mdl


Hashtable - Save Handle Of(Last created special effect) as 9 of (Key (Last created unit)) in Hashtable


Hashtable - Save Handle OfFloatingText as 10 of (Key (Last created unit)) in Hashtable


-------- Checks if there is any instance of spell already in effect --------


-------- If not, then turns the Timer trigger on --------


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



If - Conditions




(Incinerateds is empty) Equal to True



Then - Actions




Trigger - Turn on Incinerate Timer <gen>



Else - Actions


-------- Adds the Dummy unit to the Dummies' group --------


Unit Group - Add (Last created unit) to Incinerateds


-------- Clears the Leak --------


Custom script: call RemoveLocation(udg_Points[1])
Incinerate Timer

Events


Time - Every 0.05 seconds of game time

Conditions

Actions


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



Loop - Actions




-------- Loads Caster and Target --------




Set Target = (Load 0 of (Key (Picked unit)) in Hashtable)




Set Caster = (Load 1 of (Key (Picked unit)) in Hashtable)




-------- Loads the Coordinates of the Point of Ignition --------




Set Real[1] = (Load 3 of (Key (Picked unit)) from Hashtable)




Set Real[2] = (Load 4 of (Key (Picked unit)) from Hashtable)




-------- Finds the Location of Target and Point of Ignition --------




Set Points[1] = (Position of Target)




Set Points[2] = (Point(Real[1], Real[2]))




-------- Loads the Time left and reduces it by the loop interval of this trigger --------




Set Real[1] = (Load 2 of (Key (Picked unit)) from Hashtable)




Set Real[1] = (Real[1] - 0.05)




-------- Loads the escaping range --------




Set Real[2] = (Load 5 of (Key (Picked unit)) from Hashtable)




-------- Loads the Floating Text to update it --------




Set FloatingText = (Load 10 of (Key (Picked unit)) in HashtableIf the label is not found, this function returns NULL.)




-------- Loads the part of DoT to deal --------




Set Real[3] = (Load 6 of (Key (Picked unit)) from Hashtable)




-------- Causes Caster do Damage Target, dealing Part of DoT --------




Unit - Cause Caster to damage Target, dealing Real[3] damage of attack type Spells and damage type Normal




-------- The Greater ITE part --------




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





If - Conditions






Or - Any (Conditions) are true







Conditions








(Distance between Points[1] and Points[2]) Greater than Real[2]








(Target is dead) Equal to True





Then - Actions






-------- If range between the Target and Point of Ignition is greater than Escape range or Target is dead, then.. --------






-------- Destroys SFXes made before --------






Special Effect - Destroy (Load 8 of (Key (Picked unit)) in Hashtable)






Special Effect - Destroy (Load 9 of (Key (Picked unit)) in Hashtable)






-------- Clears the Floating Text --------






If ((Target is dead) Equal to True) then do (Set Real[4] = (Real[2] - (Distance between Points[1] and Points[2]))) else do (Set Real[4] = 0.00)






Floating Text - Destroy FloatingText






Floating Text - Create floating text that reads (String((Integer(Real[4])))) above Target with Z offset 0.00, using font size 15.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency






Floating Text - Change (Last created floating text): Disable permanence






Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees






Floating Text - Change the lifespan of (Last created floating text) to 2.50 seconds






-------- Clears the Hashtable --------






Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hashtable






-------- Removes Dummy unit from Dummies' group and then removes it from game --------






Unit Group - Remove (Picked unit) from Incinerateds






Unit - Remove (Picked unit) from the game





Else - Actions






-------- If target is alive and the distance between the Target and Point of Ignition is smaller than range of Escaping, then... --------






-------- Checks if it is time to do the Explosing --------






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







If - Conditions








Real[1] Greater than 0.00







Then - Actions








-------- If timer is not expired yet, then updates time left --------








Hashtable - Save Real[1] as 2 of (Key (Picked unit)) in Hashtable








-------- Updates Floating Text --------








Floating Text - Destroy FloatingText








Floating Text - Create floating text that reads (String((Integer((Real[2] - (Distance between Points[1] and Points[2])))))) above Target with Z offset 0.00, using font size 15.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency








Set FloatingText = (Last created floating text)








Hashtable - Save Handle OfFloatingText as 10 of (Key (Picked unit)) in Hashtable







Else - Actions








-------- If timer is expired, then... --------








-------- Creates the Explosion SFX --------








-------- NOTE 1: Change your Explosion SFX here. As I already said, you don't want an Icy spell with Fiery SFXes, do you? --------








Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl








-------- Destroys Explosion, Marking and Buff SFXes --------








Special Effect - Destroy (Last created special effect)








Special Effect - Destroy (Load 8 of (Key (Picked unit)) in Hashtable)








Special Effect - Destroy (Load 9 of (Key (Picked unit)) in Hashtable)








-------- Clears the Floating Text --------








Floating Text - Change FloatingText: Disable permanence








Floating Text - Set the velocity of FloatingText to 64.00 towards 90.00 degrees








Floating Text - Change the lifespan of FloatingText to 2.50 seconds








-------- Enumerates nearby enemies of Caster to damage them --------








-------- NOTE 2: Change your explosion AoE here --------








Set Enemies = (Units within 250.00 of Points[1] matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is Mechanical) Not equal to True) and ((((Matching unit) is Magic Immune) Not equal to True) and ((((Matching unit) is dead) Not equal to T








-------- Loads the Explosion damage --------








Set Real[1] = (Load 7 of (Key (Picked unit)) from Hashtable)








-------- Does the Damaging --------








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









Loop - Actions










-------- Plays a Damage SFX --------










-------- NOTE 3: Change your Damage SFX here. As I already said, you don't want an Icy spell with Fiery SFXes, do you? --------










Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\RedDragonBreath\RedDragonMissile.mdl










Special Effect - Destroy (Last created special effect)










-------- Causes Caster to damage enemies, dealing Explosion damage counted in Cast trigger --------










Unit - Cause Caster to damage (Picked unit), dealing Real[1] damage of attack type Spells and damage type Normal








-------- Destroys the Group of the Explosion damage targets --------








Custom script: call DestroyGroup(udg_Enemies)








-------- Clears the Hashtable --------








Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hashtable








-------- Removes dummy unit from Dummies' group and then removes it from Game --------








Unit Group - Remove (Picked unit) from Incinerateds








Unit - Remove (Picked unit) from the game




-------- Clears the Leaks --------




Custom script: call RemoveLocation(udg_Points[1])




Custom script: call RemoveLocation(udg_Points[2])


-------- Checks if there is any instance of spell left after this loop --------


-------- If not, then turns this trigger off --------


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



If - Conditions




(Incinerateds is empty) Equal to True



Then - Actions




Trigger - Turn off (This trigger)



Else - Actions