Moderator
M
Moderator
|
Moderator: Maker Date: 3rd Mar 2012 Spell: Lightning Grappler v1.1
|
Spell Description
Active Ability
Spell Type: Point Target
Cast Range: 1500/2000/2500 Range
Storm releases a highly charged energy orb to a target point, dealing 50/100/150 damage to all enemy that the orb comes across. Upon impact, all enemies around the orb will receive 120/240/360 damage and slow by 50% for 3 seconds. The electromotive energy in the orb continues to increase after impact as time passes. After a short duration, due to the potential difference between Storm and the orb, Storm himself will be pulled in acceleration towards the position of the orb, pulling up to 2/3/4 enemies along.
WARNING: This spell requires camera bounds
Map Initialisation

Events


Map initialization

Conditions

Actions


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


-------- ------------------------------------------ Configurable ------------------------------------------------- --------


-------- // the spell that it cast // --------


Set LG_spell = Lightning Grappler


-------- // the boolean whether the enemies are pull along when the caster is pulled towards the dummy // --------


Set LG_pulledEnemiesAlong = True


-------- // the speed of the dummy when charges forward // --------


Set LG_moveSpeed = 35.00


-------- // the acceleration for every 0.03 seconds when the caster is pulled // --------


Set LG_pullAcceleration = 0.50


-------- // the area of effect for the LG_lineDamage in "Lightning Grappler" trigger // --------


Set LG_lineDamageAoE = 180.00


-------- // the area of effect for the LG_landingDamage in "Lightning Grappler" trigger // --------


Set LG_landingDamageAoE = 325.00


-------- // the height of the lightning // --------


Set LG_lightningHeight = 75.00


-------- // the delay of the effects created in order to avoid massive effects // --------


Set LG_effectDelay = 0.30


-------- // the effects created at interval at the position of the dummy // --------


Set LG_dummyEffect = Abilities\Weapons\Bolt\BoltImpact.mdl


-------- // the effects created when the enemies are damaged by the dummy // --------


Set LG_shockedEffect = Abilities\Weapons\Bolt\BoltImpact.mdl


-------- // the effects created when the dummy reached the target point // --------


Set LG_landingEffect = Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl


-------- // the effects created when the enemies are pulled // --------


Set LG_pulledEffect = Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl


-------- --------------------------------------- Configurable End --------------------------------------------- --------


-------- ======================================================== --------
Lightning Grappler

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to LG_spell

Actions


Set tempUnit = (Triggering unit)


Set tempPoint = (Position of tempUnit)


Set tempPoint2 = (Target point of ability being cast)


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



If - Conditions




((Triggering unit) is in LG_castingGroup) Equal to False




(Distance between tempPoint and tempPoint2) Greater than or equal to 150.00




(Terrain pathing at tempPoint2 of type Walkability is off) Equal to False



Then - Actions




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




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





If - Conditions






LG_indexSize Equal to 0





Then - Actions






Trigger - Turn on Lightning Grappler Loop <gen>





Else - Actions




Set LG_indexSize = (LG_indexSize + 1)




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





If - Conditions






LG_indexSize Greater than LG_indexMax





Then - Actions






Set LG_index1[LG_indexSize] = LG_indexSize






Set LG_indexMax = LG_indexSize





Else - Actions




Set LG_index2 = LG_index1[LG_indexSize]




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




Set LG_caster[LG_index2] = tempUnit




Unit Group - Add LG_caster[LG_index2] to LG_castingGroup




Custom script: set udg_LG_damagedGroup[udg_LG_index2] = CreateGroup ()




Custom script: set udg_LG_pulledGroup[udg_LG_index2] = CreateGroup ()




Set LG_isStillMoving[LG_index2] = True




Set LG_dummyReached[LG_index2] = False




Set LG_angleSet[LG_index2] = False




Set LG_spellEnd[LG_index2] = False




Set LG_effectDelayCount[LG_index2] = 0.00




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




-------- ------------------------------------------ Configurable ------------------------------------------------- --------




Set tempReal = (Real((Level of Lightning Grappler for LG_caster[LG_index2])))




-------- // the damage dealt when the dummy charges through // --------




Set LG_lineDamage[LG_index2] = (50.00 x tempReal)




-------- // the damage dealt when the dummy reaches the target point // --------




Set LG_landingDamage[LG_index2] = (120.00 x tempReal)




-------- // the delay (in seconds) before the caster is pulled // --------




Set LG_pullDelay[LG_index2] = (2.25 - (0.25 x tempReal))




-------- // the speed of the pull when the caster is pulled // --------




Set LG_pullSpeed[LG_index2] = 30.00




-------- // the number of enemies pulled along when the caster is pulled // --------




Set LG_pulledEnemies[LG_index2] = (1 + (Level of LG_spell for LG_caster[LG_index2]))




-------- --------------------------------------- Configurable End --------------------------------------------- --------




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




Set LG_angle[LG_index2] = (Angle from tempPoint to tempPoint2)




Set LG_targetRect[LG_index2] = (Region centered at tempPoint2 with size (50.00, 50.00))




Set tempPoint3 = (tempPoint offset by 110.00 towards LG_angle[LG_index2] degrees)




Unit - Create 1 Lightning Grappler (dummy) for (Owner of LG_caster[LG_index2]) at tempPoint3 facing LG_angle[LG_index2] degrees




Set LG_dummy[LG_index2] = (Last created unit)




Lightning - Create a Chain Lightning - Secondary lightning effect from source tempPoint to target tempPoint3




Set LG_lightning[LG_index2] = (Last created lightning effect)




Custom script: call RemoveLocation (udg_tempPoint3)



Else - Actions




Set tempPlayerGroup = (Player group((Owner of tempUnit)))




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





If - Conditions






(Distance between tempPoint and tempPoint2) Less than 150.00





Then - Actions






Game - Display to tempPlayerGroup the text: ...





Else - Actions






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







If - Conditions








(Terrain pathing at tempPoint2 of type Walkability is off) Equal to True







Then - Actions








Game - Display to tempPlayerGroup the text: ...







Else - Actions




Set tempReal = 0.00




Set tempInteger = (Level of LG_spell for tempUnit)




Unit - Remove LG_spell from tempUnit




Unit - Add LG_spell to tempUnit




Unit - Set level of LG_spell for tempUnit to tempInteger




Unit - Set mana of tempUnit to ((Mana of tempUnit) + tempReal)




Custom script: call DestroyForce (udg_tempPlayerGroup)


Custom script: call RemoveLocation (udg_tempPoint2)


Custom script: call RemoveLocation (udg_tempPoint)
Lightning Grappler Loop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


For each (Integer LG_index3) from 1 to LG_indexSize, do (Actions)



Loop - Actions




Set LG_index2 = LG_index1[LG_index3]




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





If - Conditions






(LG_caster[LG_index2] is alive) Equal to True






LG_spellEnd[LG_index2] Equal to False





Then - Actions






Set LG_casterPoint = (Position of LG_caster[LG_index2])






Set tempPoint = (Position of LG_dummy[LG_index2])






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







If - Conditions








LG_effectDelayCount[LG_index2] Less than LG_effectDelay







Then - Actions








Set LG_effectDelayCount[LG_index2] = (LG_effectDelayCount[LG_index2] + 0.03)







Else - Actions








Special Effect - Create a special effect at tempPoint using LG_dummyEffect








Special Effect - Destroy (Last created special effect)








Set LG_effectDelayCount[LG_index2] = 0.00






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







If - Conditions








LG_isStillMoving[LG_index2] Equal to True







Then - Actions








Set tempPoint2 = (tempPoint offset by LG_moveSpeed towards LG_angle[LG_index2] degrees)








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









If - Conditions










((Playable map area) contains tempPoint2) Equal to True









Then - Actions










Unit - Move LG_dummy[LG_index2] instantly to tempPoint2










Custom script: set bj_wantDestroyGroup = true










Custom script: call MoveLightningEx (udg_LG_lightning[udg_LG_index2], true, GetLocationX(udg_LG_casterPoint), GetLocationY(udg_LG_casterPoint), udg_LG_lightningHeight, GetLocationX(udg_tempPoint2), GetLocationY(udg_tempPoint2), udg_LG_lightningHeight)










Unit Group - Pick every unit in (Units within LG_lineDamageAoE of tempPoint2 matching (((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) is in LG_damagedGroup and do (Actions)











Loop - Actions












Set tempUnit = (Picked unit)












Unit Group - Add tempUnit to LG_damagedGroup[LG_index2]












Set tempPoint3 = (Position of tempUnit)












Unit - Cause LG_caster[LG_index2] to damage tempUnit, dealing LG_lineDamage[LG_index2] damage of attack type Spells and damage type Normal












Special Effect - Create a special effect at tempPoint3 using LG_shockedEffect












Special Effect - Destroy (Last created special effect)












Custom script: call RemoveLocation (udg_tempPoint3)










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











If - Conditions












(LG_targetRect[LG_index2] contains LG_dummy[LG_index2]) Equal to True











Then - Actions












Set LG_isStillMoving[LG_index2] = False











Else - Actions










Lightning - Move LG_lightning[LG_index2] to source LG_casterPoint and target tempPoint2









Else - Actions










Set LG_isStillMoving[LG_index2] = False










Set LG_targetRect[LG_index2] = (Region centered at tempPoint with size (50.00, 50.00))








Custom script: call RemoveLocation (udg_tempPoint2)







Else - Actions








Custom script: call MoveLightningEx (udg_LG_lightning[udg_LG_index2], true, GetLocationX(udg_tempPoint), GetLocationY(udg_tempPoint), udg_LG_lightningHeight, GetLocationX(udg_LG_casterPoint), GetLocationY(udg_LG_casterPoint), udg_LG_lightningHeight)








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









If - Conditions










LG_dummyReached[LG_index2] Equal to False









Then - Actions










Custom script: set bj_wantDestroyGroup = true










Unit Group - Pick every unit in (Units within LG_landingDamageAoE of tempPoint matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is Magic Immune) Equal to False)) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (O and do (Actions)











Loop - Actions












Set tempUnit = (Picked unit)












Set tempPoint2 = (Position of tempUnit)












Unit - Cause LG_caster[LG_index2] to damage tempUnit, dealing LG_landingDamage[LG_index2] damage of attack type Spells and damage type Normal












Unit - Create 1 dummyUnit for (Owner of LG_caster[LG_index2]) at tempPoint2 facing Default building facing degrees












Unit - Add Lightning Grappler (dummy) to (Last created unit)












Unit - Order (Last created unit) to Human Sorceress - Slow tempUnit












Custom script: call RemoveLocation (udg_tempPoint2)










Special Effect - Create a special effect at tempPoint using LG_landingEffect










Special Effect - Destroy (Last created special effect)










Custom script: call DestroyGroup (udg_LG_damagedGroup[udg_LG_index2])










Set LG_dummyReached[LG_index2] = True









Else - Actions








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









If - Conditions










LG_pullDelay[LG_index2] Greater than 0.00









Then - Actions










Set LG_pullDelay[LG_index2] = (LG_pullDelay[LG_index2] - 0.03)









Else - Actions










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











If - Conditions












(LG_targetRect[LG_index2] contains LG_caster[LG_index2]) Equal to False











Then - Actions












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













If - Conditions














LG_angleSet[LG_index2] Equal to False













Then - Actions














Unit - Turn collision for LG_caster[LG_index2] Off














Set LG_angle[LG_index2] = (Angle from LG_casterPoint to tempPoint)














Set LG_angleSet[LG_index2] = True













Else - Actions











Else - Actions












Set LG_spellEnd[LG_index2] = True










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











If - Conditions












LG_pullSpeed[LG_index2] Less than 45.00











Then - Actions












Set LG_pullSpeed[LG_index2] = (LG_pullSpeed[LG_index2] + LG_pullAcceleration)











Else - Actions










Set tempPoint2 = (LG_casterPoint offset by LG_pullSpeed[LG_index2] towards LG_angle[LG_index2] degrees)










Unit - Move LG_caster[LG_index2] instantly to tempPoint2, facing LG_angle[LG_index2] degrees










Custom script: set bj_wantDestroyGroup = true










Unit Group - Pick every unit in (Units within 200.00 of tempPoint2 matching (((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) is in LG_pulledGroup[LG_index2] and do (Actions)











Loop - Actions












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













If - Conditions














LG_pulledEnemiesAlong Equal to True














LG_pulledEnemies[LG_index2] Greater than 0













Then - Actions














Set LG_pulledEnemies[LG_index2] = (LG_pulledEnemies[LG_index2] - 1)














Unit - Turn collision for (Picked unit) Off














Unit Group - Add (Picked unit) to LG_pulledGroup[LG_index2]













Else - Actions










Unit Group - Pick every unit in LG_pulledGroup[LG_index2] and do (Actions)











Loop - Actions












Set tempUnit = (Picked unit)












Set tempPoint3 = (Position of tempUnit)












Unit - Move tempUnit instantly to tempPoint2












Special Effect - Create a special effect at tempPoint3 using LG_pulledEffect












Special Effect - Destroy (Last created special effect)












Custom script: call RemoveLocation (udg_tempPoint3)










Custom script: call RemoveLocation (udg_tempPoint2)






Custom script: call RemoveLocation (udg_tempPoint)






Custom script: call RemoveLocation (udg_LG_casterPoint)





Else - Actions






Unit Group - Pick every unit in LG_pulledGroup[LG_index2] and do (Actions)







Loop - Actions








Unit - Turn collision for (Picked unit) On






Unit - Turn collision for LG_caster[LG_index2] On






Unit Group - Remove LG_caster[LG_index2] from LG_castingGroup






Unit - Explode LG_dummy[LG_index2]






Lightning - Destroy LG_lightning[LG_index2]






Custom script: call DestroyGroup (udg_LG_pulledGroup[udg_LG_index2])






Custom script: call RemoveRect (udg_LG_targetRect[udg_LG_index2])






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






Set LG_index1[LG_index3] = LG_index1[LG_indexSize]






Set LG_index1[LG_indexSize] = LG_index2






Set LG_indexSize = (LG_indexSize - 1)






Set LG_index3 = (LG_index3 - 1)






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







If - Conditions








LG_indexSize Equal to 0







Then - Actions








Trigger - Turn off (This trigger)







Else - Actions
Changelog
v1.2b
- added a height to the lightning
v1.2
- created a variable named "LG_spell" for spell reference
- made the area of effect for the damage dealt configurable
- removedv1.1
Custom script: call RemoveLocation (udg_tempPoint)
- fixed a part so it doesn't consume cooldown if the target point is invalid
- turned off the collision of the enemies that pulled along when pulled
- added the trigger to restore the mana if the target point is invalid
- added "How to Import" instructions
v1.0c
- fixed a minor mistake
v1.0b
- fixed a leak group
- added the below trigger to avoid mana cost and cooldown
v1.0
Unit - Order tempUnit to Stop
- spell released
Credits
Thanks to Tank-Commander for teaching me how to use the MoveLightningEx native
Thanks to Maker for helping me with the updates
Thanks to Frankster for the model of the dummy: Orb of Lightning
Thanks to Hanky for his dynamic indexing system: [GUI] Dynamic Indexing Template