Moderator
M
Moderator
Light of Dawn v1.5 | Reviewed by Maker | 12th Oct 2013 | ||||
| APPROVED | ||||
|
|
11:59, 3rd Jun 2011 Maker: Causes leaks in the cast trigger, the call RemoveLocation(udg_Set SS_Point2) is in wrong place:
|
Startup

Events


Map initialization

Conditions

Actions


-------- ======================================================================= --------


-------- DON'T TOUCH THIS --------


-------- ======================================================================= --------


Hashtable - Create a hashtable


Set SS_Hashtable = (Last created hashtable)


-------- ======================================================================= --------


-------- Configure this --------


-------- Formula: BaseValue + (BonusValue x Level of ability) = ActualValue --------


-------- ======================================================================= --------


Set SS_CritAmount = 125.00


Set SS_CritAmountSmall = 75.00


Set SS_CritBonus = 50.00


Set SS_HealAmount = 50.00


Set SS_HealAmountBonus = 50.00


Set SS_Range = 150.00


Set SS_RangeBonus = 25.00


Set SS_NrHitUnits = 3


Set SS_NrHitUnitsBonus = 1


Set SS_SmallCritChance = 20


Set SS_SmallCritChanceBonus = 3


Set SS_CritChance = 10


Set SS_CritChanceBonus = 3


Set SS_LightningType = Healing Wave - Secondary


Set SS_LightningHeight = 35.00


Set St_FloatingText = True


-------- Mana cost, Cooldown, Cast Range, levels and Description is changed in Object Editor --------


-------- Trust me, i wish too it could be done in a trigger. --------


-------- ======================================================================= --------
Cast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Light of Dawn

Actions


Set SS_Caster = (Triggering unit)


Set SS_Level = (Level of (Ability being cast) for SS_Caster)


Set SS_Point1 = (Position of SS_Caster)


Set SS_LastHit = (Target unit of ability being cast)


Set SS_LastHitPos = (Position of SS_LastHit)


Set Actual_CritAmount = (SS_CritAmount + (SS_CritBonus x (Real(SS_Level))))


Set Actual_CritAmountSmall = (SS_CritAmountSmall + (SS_CritBonus x (Real(SS_Level))))


Set Actual_CritChance = (SS_CritChance + (SS_CritChanceBonus x SS_Level))


Set Actual_SmallCritChance = (SS_SmallCritChance + (SS_SmallCritChanceBonus x SS_Level))


Set Actual_HealAmount = (SS_HealAmount + (SS_HealAmountBonus x (Real(SS_Level))))


Set Actual_NrHitUnits = (SS_NrHitUnits + (SS_NrHitUnitsBonus x SS_Level))


Set Actual_Range = (SS_Range + (SS_RangeBonus x (Real(SS_Level))))


Set SS_FirstGroup = (Units within Actual_Range of SS_LastHitPos matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an ally of (Triggering player)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((Percentage life of (


Set SS_LightningGroup = (Random (Actual_NrHitUnits - 1) units from SS_FirstGroup)


Unit Group - Add SS_LastHit to SS_LightningGroup


Set SS_Group_Integer = (SS_Group_Integer + 1)


Custom script: set udg_x1 = GetLocationX(udg_SS_Point1)


Custom script: set udg_y1 = GetLocationY(udg_SS_Point1)


Custom script: set udg_z1 = GetLocationZ(udg_SS_Point1) + (GetUnitFlyHeight(udg_SS_Caster) + udg_SS_LightningHeight)


Trigger - Turn on Lightning Clear <gen>


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



Loop - Actions




Set SS_RandomInteger = (Random integer number between 1 and 100)




Set SS_RandomUnit = (Picked unit)




Set SS_Point2 = (Position of SS_RandomUnit)




Set SS_Life = (Life of SS_RandomUnit)




Custom script: set udg_x2 = GetLocationX(udg_SS_Point2)




Custom script: set udg_y2 = GetLocationY(udg_SS_Point2)




Custom script: set udg_z2 = GetLocationZ(udg_SS_Point2) + (GetUnitFlyHeight(udg_SS_RandomUnit) + udg_SS_LightningHeight)




Unit - Create 1 Dummy for Neutral Passive at SS_LastHitPos facing Default building facing degrees




Set SS_Dummy = (Last created unit)




Unit - Add a 0.70 second Generic expiration timer to SS_Dummy




Unit - Make SS_Dummy Explode on death




Unit Group - Add SS_Dummy to SS_RemoveLightningGroup




Custom script: set bj_lastCreatedLightning = AddLightningEx(udg_SS_LightningType,true,udg_x1,udg_y1,udg_z1,udg_x2,udg_y2,udg_z2)




Hashtable - Save Handle Of(Last created lightning effect) as 0 of (Key (Last created unit)) in SS_Hashtable




Special Effect - Create a special effect attached to the origin of SS_RandomUnit using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl




Special Effect - Destroy (Last created special effect)




Custom script: call RemoveLocation(udg_SS_Point2)




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





If - Conditions






SS_RandomInteger Less than or equal to Actual_CritChance





Then - Actions






Unit - Set life of SS_RandomUnit to ((Life of SS_RandomUnit) + Actual_CritAmount)






Set SS_AfterLife = (Life of SS_RandomUnit)






Set SS_HealText = (+ + (String(((Integer(SS_AfterLife)) - (Integer(SS_Life))))))






Set SS_HealTextSize = 20.00





Else - Actions






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







If - Conditions








SS_RandomInteger Less than or equal to Actual_SmallCritChance







Then - Actions








Unit - Set life of SS_RandomUnit to ((Life of SS_RandomUnit) + Actual_CritAmountSmall)








Set SS_AfterLife = (Life of SS_RandomUnit)








Set SS_HealText = (+ + (String(((Integer(SS_AfterLife)) - (Integer(SS_Life))))))








Set SS_HealTextSize = 15.00







Else - Actions








Unit - Set life of SS_RandomUnit to ((Life of SS_RandomUnit) + Actual_HealAmount)








Set SS_AfterLife = (Life of SS_RandomUnit)








Set SS_HealText = (+ + (String(((Integer(SS_AfterLife)) - (Integer(SS_Life))))))








Set SS_HealTextSize = 10.00




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





If - Conditions






St_FloatingText Equal to True





Then - Actions






Set SS_ShowGroup = (Player group((Triggering player)))






Floating Text - Create floating text that reads (String(SS_HealText) as Upper case) above SS_RandomUnit with Z offset 0.00, using font size SS_HealTextSize, color (0.00%, 100.00%, 0.00%), and 0.00% transparency






Set SS_TextTag = (Last created floating text)






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






Floating Text - Hide SS_TextTag for (All players)






Floating Text - Show SS_TextTag for SS_ShowGroup






Floating Text - Change SS_TextTag: Disable permanence






Floating Text - Change the fading age of SS_TextTag to 1.20 seconds






Floating Text - Change the lifespan of SS_TextTag to 2.00 seconds





Else - Actions




Unit Group - Remove SS_RandomUnit from SS_LightningGroup


Custom script: call RemoveLocation(udg_SS_Point1)


Custom script: call RemoveLocation(udg_SS_LastHitPos)


Custom script: call DestroyGroup(udg_SS_LightningGroup)


Custom script: call DestroyGroup(udg_SS_FirstGroup)


Custom script: call DestroyForce(udg_SS_ShowGroup)
Lightning Clear

Events


Unit - A unit Dies

Conditions


((Triggering unit) is in SS_RemoveLightningGroup) Equal to True

Actions


Unit Group - Remove (Triggering unit) from SS_RemoveLightningGroup


Lightning - Destroy (Load 0 of (Key (Triggering unit)) in SS_Hashtable)


Set SS_Group_Integer = (SS_Group_Integer - 1)


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


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



If - Conditions




SS_Group_Integer Equal to 0



Then - Actions




Trigger - Turn off (This trigger)



Else - Actions