Caster travels with a lightning speed towards a target point. While in effect, it will store energy and release it
onto enemy units that are nearby. Damage, Area of effect and Speed increase with level.
Configurables:
Range
Speed
Damage
Area of Effect
Targets
SFXs
Pathability
Triggers
LS Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Lightning Speed
Actions
-------- Starting spell -------- -------- Checking for open instance -------- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MUI_1 Equal to 0
Then - Actions
Trigger - Turn on LS Loop <gen>
Else - Actions
-------- Setting up current instance configurations -------- Set MUI_1 = (MUI_1 + 1) Set MUI_2 = (MUI_2 + 1) -------- Unit that will move -------- -------- Also some unit-related stuff -------- Set cUnit[MUI_2] = (Triggering unit) Unit - Make cUnit[MUI_2] Invulnerable Unit - Turn collision for cUnit[MUI_2] Off Animation - Change cUnit[MUI_2]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency Set cPoint[MUI_2] = (Position of cUnit[MUI_2]) Set tPoint = (Target point of ability being cast) -------- Overall configurations -------- Set Range[MUI_2] = (50.00 + (50.00 + (Real((Level of Lightning Speed for cUnit[MUI_2]))))) Set Angle[MUI_2] = (Angle from cPoint[MUI_2] to tPoint) Set MaxDistance[MUI_2] = (Distance between cPoint[MUI_2] and tPoint) Set Speed[MUI_2] = (20.00 x (Real((Level of Lightning Speed for cUnit[MUI_2])))) Set Distance[MUI_2] = 0.00 -------- Clearing leaks -------- Custom script: call RemoveLocation (udg_tPoint)
LS Loop
Events
Time - Every 0.03 seconds of game time
Conditions Actions
-------- Looping thru all indexes with third index -------- -------- Using MUI_3 as a current index -------- For each (Integer MUI_3) from 1 to MUI_2, do (Actions)
Loop - Actions
-------- Position of unit with position where to move it -------- Set bPoint[MUI_3] = (Position of cUnit[MUI_3]) Set mPoint[MUI_3] = (bPoint[MUI_3] offset by Speed[MUI_3] towards Angle[MUI_3] degrees) If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Playable map area) contains cUnit[MUI_3]) Equal to True
Then - Actions
Unit - Move cUnit[MUI_3] instantly to mPoint[MUI_3]
Else - Actions
-------- Moving it with some SFX -------- Special Effect - Create a special effect attached to the chest of cUnit[MUI_3] using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl Special Effect - Destroy (Last created special effect) -------- Saving distance -------- Set Distance[MUI_3] = (Distance between mPoint[MUI_3] and cPoint[MUI_3]) -------- Units around which will be damaged -------- Set gDamage = (Units within Range[MUI_3] of bPoint[MUI_3] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of cUnit[MUI_3])) Equal to True)))) Unit Group - Pick every unit in gDamage and do (Actions)
Loop - Actions
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Weapons\Bolt\BoltImpact.mdl Special Effect - Destroy (Last created special effect) Set Damage = (((5.00 x (Real((Level of Lightning Speed for cUnit[MUI_3])))) + Distance[MUI_3]) / 10.00) Unit - Cause cUnit[MUI_3] to damage (Picked unit), dealing Damage damage of attack type Spells and damage type Unknown
-------- Destructables around which will be destroyed (trees, barrels, etc) -------- -------- Note the AOE is a constant, otherwise it will destroy too many trees as passing by only one -------- Destructible - Pick every destructible within 150.00 of mPoint[MUI_3] and do (Actions)
Loop - Actions
Destructible - Kill (Picked destructible)
-------- Clearing leaks (for current instance) -------- -------- Checking if final point is reached or the point of moving is unpathable (preventing going out of map or cliff blockage) -------- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Terrain pathing at mPoint[MUI_3] of type Walkability is off) Equal to True Distance[MUI_3] Greater than or equal to MaxDistance[MUI_3]
Then - Actions
Special Effect - Create a special effect attached to the origin of cUnit[MUI_3] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl Special Effect - Destroy (Last created special effect) -------- If so, restoring units' settings -------- Unit - Make cUnit[MUI_3] Vulnerable Animation - Change cUnit[MUI_3]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency Unit - Turn collision for cUnit[MUI_3] On -------- Claering leaks in the current instance -------- Custom script: call RemoveLocation (udg_cPoint[udg_MUI_3]) Set cUnit[MUI_3] = No unit -------- Clearing its index -------- Set MUI_1 = (MUI_1 - 1)
-------- When the loop ends, checking if all indexes are empty -------- -------- If so, turning off trigger (preventing lag) and setting the index back to 0 -------- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MUI_1 Equal to 0
Then - Actions
Set MUI_2 = 0 Trigger - Turn off (This trigger)
Else - Actions
You can check the spell in the testmap, which also comes with an "Read Me" for how to import it.
Changelog
Changelog ~ v1.0
- initial release
- fixed pathability
- you no longer can leave map boundary (playable map area)
- some documentation changes
- array variable is removed
Thanks to Pharaoh_ for helping me with the pathability.
Feel free to edit and use as long as you give credits
MortAr-
Rating - 5.00 (2 votes)
(Hover and click)
Moderator Comments
Recommended
14:06, 25th Jul 2010
hvo-busterkomo: The coding is pretty good overall, but please do not use an array just to have access to a large number of variables. Use an array when the index is being used meaningfully. In other words, MUI[1], MUI[2], and MUI[3] should all be separate variables.
I don't see any more problems with the coding, and the spell seems to work and looks fine visually.
Good spell but the caster can travel outside map and the AOE when the damage is dealth, both when traveled and impact, is to small. Also, you should meaby recycle this. But i am just 50 - 50 about that. Try to recycle and then try the spell again, but with all three. If you find it less laggy and no changes, then you should save the recycle in the triggers.
__________________
Send me a PM if you want any GUI spell/System done. I'm pretty good at it.
Give +Rep to those who help you or create something to you because thats just to kind.
Good spell but the caster can travel outside map and the AOE when the damage is dealth, both when traveled and impact, is to small.
That's why they are both configurables, so you can set it to whatever value you want, I just find smaller ones best, otherwise the damage is really big if you travel ~1000 units.
Quote:
just try using serpent ward as its base ability, it should prevent you from going to a unwanted terrains...
I already have an solution to the problem, thank you anyway.
Quote:
Try to recycle and then try the spell again, but with all three. If you find it less laggy and no changes, then you should save the recycle in the triggers.
The whole thing recycles when all instances of the spell ends, meaning, it's already lagless. I don't quite understand what you are trying to say here.
Quote:
Sadly , we can go outside of the map ( the black tileset around the map ), maybe you should fix
__________________
I am the bone of my map..
Terrain is my body,JASS is my blood..
I have created over a thousand maps,
Unknown to death,nor known to live,
Have withstood pain to create many maps,
Yet, those hands will never hold any Reps,
So as I pray..Unlimited Map Works!..