- Joined
- May 11, 2012
- Messages
- 2,103
Hello. I have this simple spell, which bugs out for the reason unknown to me.
Can someone take a look at what could be malfunctioning? I suspect For Each loop screws everything up because first loop always runs.
Can someone take a look at what could be malfunctioning? I suspect For Each loop screws everything up because first loop always runs.
-
Mega Blast
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Mega Blast
-
-
Actions
-
-------- ================================================ --------
-
Set TempTrigUnit = (Triggering unit)
-
Set TempPoint = (Position of TempTrigUnit)
-
Set TempPoint2 = (Target point of ability being cast)
-
-------- ================================================ --------
-
For each (Integer MegaBlast_Loop) from 1 to 5, do (Actions)
-
Loop - Actions
-
-------- ================================================ --------
-
Set TempPoint3 = (TempPoint offset by (300.00 x (Real(MegaBlast_Loop))) towards (Angle from TempPoint to TempPoint2) degrees)
-
Set TempUnitGroup = (Units within 300.00 of TempPoint3)
-
-------- ================================================ --------
-
Unit - Create 1 Dummy Caster for (Triggering player) at TempPoint3 facing Default building facing degrees
-
Set TempDummyUnit = (Last created unit)
-
-------- ================================================ --------
-
Unit - Add a 0.50 second Generic expiration timer to TempDummyUnit
-
Unit - Add Dummy Mega Blast to TempDummyUnit
-
Unit - Set level of Dummy Mega Blast for TempDummyUnit to (Level of Mega Blast for TempTrigUnit)
-
Unit - Order TempDummyUnit to Orc Tauren Chieftain - War Stomp
-
-------- ================================================ --------
-
Unit Group - Pick every unit in TempUnitGroup and do (Actions)
-
Loop - Actions
-
-------- ================================================ --------
-
Set TempUnit = (Picked unit)
-
-------- ================================================ --------
-
If (((TempUnit is A structure) Not equal to True) and (((TempUnit is dead) Not equal to True) and (((TempUnit belongs to an enemy of (Triggering player)) Equal to True) and ((Level of Mega Blast for TempTrigUnit) Equal to 1)))) then do (Unit - Cause TempTrigUnit to damage TempUnit, dealing ((Real((Agility of TempTrigUnit (Include bonuses)))) / 2.00) damage of attack type Spells and damage type Normal) else do (Do nothing)
-
-------- ================================================ --------
-
If (((TempUnit is A structure) Not equal to True) and (((TempUnit is dead) Not equal to True) and (((TempUnit belongs to an enemy of (Triggering player)) Equal to True) and ((Level of Mega Blast for TempTrigUnit) Equal to 2)))) then do (Unit - Cause TempTrigUnit to damage TempUnit, dealing (Real((Agility of TempTrigUnit (Include bonuses)))) damage of attack type Spells and damage type Normal) else do (Do nothing)
-
-
-
-------- ================================================ --------
-
Special Effect - Create a special effect at TempPoint3 using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
-
Special Effect - Destroy (Last created special effect)
-
-------- ================================================ --------
-
Custom script: call RemoveLocation(udg_TempPoint3)
-
-
-
Custom script: call RemoveLocation(udg_TempPoint)
-
Custom script: call RemoveLocation(udg_TempPoint2)
-
Custom script: set udg_TempPoint = null
-
Custom script: set udg_TempPoint2 = null
-
Custom script: set udg_TempPoint3 = null
-
Custom script: set udg_TempTrigUnit = null
-
Custom script: set udg_TempDummyUnit = null
-
-