Moderator
M
Moderator
17:32, 30th Nov 2009
TriggerHappy:
Coding is good. Effect is decent. Approved.
TriggerHappy:
Coding is good. Effect is decent. Approved.
Sphere | Spell Init

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Chaotic Sphere

Actions


Set Sloc[1] = (Position of (Triggering unit))


Set Sloc[2] = (Position of (Target unit of ability being cast))


Set SphereValue[1] = ((Integer((Distance between Sloc[1] and Sloc[2]))) + 300)


Set SphereValue[2] = ((Level of Chaotic Sphere for (Triggering unit)) x (Intelligence of (Triggering unit) (Include bonuses)))


Set SphereValue[3] = ((20 + (10 x (Level of Chaotic Sphere for (Triggering unit)))) + ((Intelligence of (Triggering unit) (Include bonuses)) x 2))


Set SphereValue[4] = ((((Level of Chaotic Sphere for (Triggering unit)) x 25) / 3) + ((Intelligence of (Triggering unit) (Include bonuses)) / 2))


Set SphereValue[5] = (1 + (Level of Chaotic Sphere for (Triggering unit)))


Unit - Create 1 Sphere Missile 1 for (Owner of (Triggering unit)) at Sloc[1] facing (Angle from Sloc[1] to Sloc[2]) degrees


Unit Group - Add (Last created unit) to MissileGroup1


Unit Group - Remove all units from SphereDamage


Unit Group - Add (Triggering unit) to SphereDamage


Hashtable - Save SphereValue[1] as 0 of (Key (Triggering unit)) in SphereTable


Hashtable - Save SphereValue[2] as 1 of (Key (Triggering unit)) in SphereTable


Hashtable - Save SphereValue[3] as 2 of (Key (Triggering unit)) in SphereTable


Hashtable - Save SphereValue[4] as 3 of (Key (Triggering unit)) in SphereTable


Hashtable - Save SphereValue[5] as 4 of (Key (Triggering unit)) in SphereTable


Hashtable - Save 0 as 5 of (Key (Triggering unit)) in SphereTable


Hashtable - Save Handle Of(Triggering unit) as 6 of (Key (Last created unit)) in SphereTable


Hashtable - Save Handle OfSphereDamage as 7 of (Key (Last created unit)) in SphereTable


Hashtable - Save Handle Of(Target unit of ability being cast) as 8 of (Key (Triggering unit)) in SphereTable


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



If - Conditions




(Number of units in MissileGroup1) Equal to 1



Then - Actions




Trigger - Turn on Sphere I Move 1 <gen>



Else - Actions


Custom script: call RemoveLocation(udg_Sloc[1])


Custom script: call RemoveLocation(udg_Sloc[2])
Sphere | Move 1

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


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



Loop - Actions




Set SphereValue[1] = (Load 0 of (Key (Load 6 of (Key (Picked unit)) in SphereTable)) from SphereTable)




Set SphereValue[2] = (Load 1 of (Key (Load 6 of (Key (Picked unit)) in SphereTable)) from SphereTable)




Set SphereValue[3] = (Load 2 of (Key (Load 6 of (Key (Picked unit)) in SphereTable)) from SphereTable)




Set SphereValue[6] = (Load 5 of (Key (Load 6 of (Key (Picked unit)) in SphereTable)) from SphereTable)




Set SphereCaster = (Load 6 of (Key (Picked unit)) in SphereTable)




Set SphereDamage = (Load 7 of (Key (Picked unit)) in SphereTable)




Set Sloc[1] = (Position of (Picked unit))




Set Sloc[2] = (Sloc[1] offset by 35.00 towards (Facing of (Picked unit)) degrees)




Unit - Move (Picked unit) instantly to Sloc[2]




Special Effect - Create a special effect at Sloc[2] using Abilities\Weapons\GargoyleMissile\GargoyleMissile.mdl




Special Effect - Destroy (Last created special effect)




Set SphereGroup = (Units within 150.00 of Sloc[2] matching (((Matching unit) is in SphereDamage) Equal to False))




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





Loop - Actions






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






Unit Group - Add (Picked unit) to SphereDamage




Custom script: call DestroyGroup(udg_SphereGroup)




Hashtable - Save (SphereValue[6] + 35) as 5 of (Key (Load 6 of (Key (Picked unit)) in SphereTable)) in SphereTable




Hashtable - Save Handle OfSphereDamage as 7 of (Key (Picked unit)) in SphereTable




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





If - Conditions






SphereValue[6] Greater than or equal to SphereValue[1]





Then - Actions






Set SphereValue[5] = (Load 4 of (Key (Load 6 of (Key (Picked unit)) in SphereTable)) from SphereTable)






Set Sloc[3] = (Position of (Load 8 of (Key (Load 6 of (Key (Picked unit)) in SphereTable)) in SphereTable))






Set SphereGroup = (Units within 250.00 of Sloc[1] matching (((Matching unit) belongs to an enemy of (Owner of SphereCaster)) Equal to True))






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







Loop - Actions








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






Custom script: call DestroyGroup(udg_SphereGroup)






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







If - Conditions








(Number of units in MissileGroup2) Equal to 0







Then - Actions








Trigger - Turn on Sphere I Move 2 <gen>







Else - Actions






For each (Integer SphereInt) from 1 to SphereValue[5], do (Actions)







Loop - Actions








Unit - Create 1 Sphere Missile 2 for (Owner of SphereCaster) at Sloc[1] facing Default building facing degrees








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









If - Conditions










(SphereValue[5] mod 2) Equal to 0









Then - Actions










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











If - Conditions












SphereInt Less than or equal to (SphereValue[5] / 2)











Then - Actions












Set SReal[1] = ((Angle from Sloc[1] to Sloc[3]) + (80.00 - ((160.00 / (Real(SphereValue[5]))) x ((Real(SphereInt)) - 1.00))))











Else - Actions












Set SReal[1] = ((Angle from Sloc[1] to Sloc[3]) + (80.00 - ((160.00 / (Real(SphereValue[5]))) x (Real(SphereInt)))))









Else - Actions










Set SReal[1] = ((Angle from Sloc[1] to Sloc[3]) + (80.00 - ((160.00 / ((Real(SphereValue[5])) - 1.00)) x ((Real(SphereInt)) - 1.00))))








Set SReal[2] = (SReal[1] - (Angle from Sloc[1] to Sloc[3]))








Hashtable - Save SReal[1] as 0 of (Key (Last created unit)) in SphereTable








Hashtable - Save (Distance between Sloc[1] and Sloc[3]) as 1 of (Key (Last created unit)) in SphereTable








Hashtable - Save 0.00 as 2 of (Key (Last created unit)) in SphereTable








Hashtable - Save (SReal[2] / 12.00) as 3 of (Key (Last created unit)) in SphereTable








Hashtable - Save SReal[2] as 4 of (Key (Last created unit)) in SphereTable








Hashtable - Save 65.00 as 6 of (Key (Last created unit)) in SphereTable








Hashtable - Save (Load 3 of (Key (Load 6 of (Key (Picked unit)) in SphereTable)) from SphereTable) as 7 of (Key (Last created unit)) in SphereTable








Hashtable - Save Handle OfSphereCaster as 5 of (Key (Last created unit)) in SphereTable








Unit Group - Add (Last created unit) to MissileGroup2






Custom script: call RemoveLocation(udg_Sloc[3])






Set SphereInt = 0






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







If - Conditions








(Number of units in MissileGroup2) Equal to (Load 4 of (Key (Load 6 of (Key (Picked unit)) in SphereTable)) from SphereTable)







Then - Actions








Trigger - Turn on Sphere I Move 2 <gen>







Else - Actions






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






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






Special Effect - Create a special effect at Sloc[1] using Abilities\Spells\Undead\Unsummon\UnsummonTarget.mdl






Special Effect - Destroy (Last created special effect)






Unit Group - Remove (Picked unit) from MissileGroup1






Unit - Remove (Picked unit) from the game






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







If - Conditions








(Number of units in MissileGroup1) Equal to 0







Then - Actions








Trigger - Turn off (This trigger)







Else - Actions





Else - Actions




Custom script: call RemoveLocation(udg_Sloc[1])




Custom script: call RemoveLocation(udg_Sloc[2])
Sphere | Move 2

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


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



Loop - Actions




Set SReal[1] = (Load 0 of (Key (Picked unit)) from SphereTable)




Set SReal[2] = (Load 1 of (Key (Picked unit)) from SphereTable)




Set SReal[3] = (Load 2 of (Key (Picked unit)) from SphereTable)




Set SReal[4] = (Load 3 of (Key (Picked unit)) from SphereTable)




Set SReal[5] = (Load 4 of (Key (Picked unit)) from SphereTable)




Set SReal[6] = (Load 6 of (Key (Picked unit)) from SphereTable)




Set Sloc[1] = (Position of (Picked unit))




Set Sloc[2] = (Sloc[1] offset by (12.00 / (Cos(SReal[5]))) towards SReal[1] degrees)




Animation - Change (Picked unit) flying height to ((Current flying height of (Picked unit)) + ((Tan(SReal[6])) x 12.00)) at 0.00




Unit - Move (Picked unit) instantly to Sloc[2]




Custom script: call RemoveLocation(udg_Sloc[1])




Set SReal[1] = (SReal[1] - SReal[4])




Set SReal[3] = (SReal[3] + 12.00)




Set SReal[5] = (SReal[5] - SReal[4])




Set SReal[6] = (SReal[6] - 6.00)




Hashtable - Save SReal[1] as 0 of (Key (Picked unit)) in SphereTable




Hashtable - Save SReal[3] as 2 of (Key (Picked unit)) in SphereTable




Hashtable - Save SReal[5] as 4 of (Key (Picked unit)) in SphereTable




Hashtable - Save SReal[6] as 6 of (Key (Picked unit)) in SphereTable




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





If - Conditions






SReal[3] Greater than or equal to 300.00





Then - Actions






Set SphereCaster = (Load 5 of (Key (Picked unit)) in SphereTable)






Set SReal[7] = (Real((Load 7 of (Key (Picked unit)) from SphereTable)))






Set Sloc[1] = (Position of (Picked unit))






Set SphereGroup = (Units within 100.00 of Sloc[1] matching (((Matching unit) belongs to an enemy of (Owner of SphereCaster)) Equal to True))






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







Loop - Actions








Unit - Cause SphereCaster to damage (Picked unit), dealing SReal[7] damage of attack type Spells and damage type Normal






Custom script: call DestroyGroup(udg_SphereGroup)






Custom script: call RemoveLocation(udg_Sloc[1])






Unit Group - Remove (Picked unit) from MissileGroup2






Unit - Remove (Picked unit) from the game






Special Effect - Create a special effect at Sloc[2] using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl






Special Effect - Destroy (Last created special effect)






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






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







If - Conditions








(Number of units in MissileGroup2) Equal to 0







Then - Actions








Trigger - Turn off (This trigger)







Else - Actions





Else - Actions




Custom script: call RemoveLocation(udg_Sloc[2])