- Joined
- Apr 14, 2012
- Messages
- 2,901
Hello;
I'm just going to get straight to the point: I made a spell which does some things, and I made a two triggers for it: one that triggers at cast, and one that does the loop.
The triggers:
and:
What's weird is the first time it is cast, it will always loop the two triggers infinitely.
Help?
I'm just going to get straight to the point: I made a spell which does some things, and I made a two triggers for it: one that triggers at cast, and one that does the loop.
The triggers:
-
ER Cast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Earth's Rampage
-
Actions
- Set ER_Caster[1] = (Triggering unit)
- Set ER_TempPlayer = (Owner of ER_Caster[1])
- Selection - Remove ER_Caster[1] from selection for ER_TempPlayer
- Unit - Pause ER_Caster[1]
- Unit - Make ER_Caster[1] Invulnerable
- Set ER_StartPoint = (Position of ER_Caster[1])
-
For each (Integer ER_TempInteger) from 1 to 7, do (Actions)
-
Loop - Actions
- Set ER_TempReal = (ER_TempReal + 200.00)
- Set ER_TempPoint = (ER_StartPoint offset by ER_TempReal towards (Facing of ER_Caster[1]) degrees)
- Unit - Create 1 ER_Dummy for ER_TempPlayer at ER_TempPoint facing Default building facing degrees
- Set ER_AoE = 250.00
- Set ER_Dummy[ER_TempInteger] = (Last created unit)
- Set ER_DummyPoint = (Position of ER_Dummy[ER_TempInteger])
- Set ER_DumymGroup = (Units within ER_AoE of ER_DummyPoint matching (((Matching unit) belongs to an enemy of ER_TempPlayer) Equal to True))
- Unit Group - Add ER_Dummy[ER_TempInteger] to ER_DumymGroup
-
Unit Group - Pick every unit in ER_DumymGroup and do (Actions)
-
Loop - Actions
- Unit - Cause ER_Dummy[ER_TempInteger] to damage (Picked unit), dealing 300.00 damage of attack type Chaos and damage type Divine
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of Dummy Impale for ER_Dummy[ER_TempInteger]) Equal to 0
-
Then - Actions
- Unit - Add Dummy Impale to ER_Dummy[ER_TempInteger]
- Unit - Order ER_Dummy[ER_TempInteger] to Undead Crypt Lord - Impale ER_DummyPoint
- Unit - Remove Dummy Impale from ER_Dummy[ER_TempInteger]
- Else - Actions
-
If - Conditions
-
Loop - Actions
- Set ER_Wait[1] = 1.00
- Unit - Add a ER_Wait[1] second Generic expiration timer to ER_Dummy[ER_TempInteger]
- Wait ER_Wait[1] seconds
-
Loop - Actions
-
For each (Integer ER_TempInteger) from 1 to 7, do (Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in ER_DumymGroup and do (Actions)
-
Loop - Actions
- Unit Group - Remove (Picked unit) from ER_DumymGroup
-
Loop - Actions
- Custom script: set udg_ER_Dummy[udg_ER_TempInteger] = null
-
Unit Group - Pick every unit in ER_DumymGroup and do (Actions)
-
Loop - Actions
- Custom script: call RemoveLocation(udg_ER_TempPoint)
- Countdown Timer - Start ER_Timer as a One-shot timer that will expire in ER_Wait[1] seconds
- Trigger - Turn on ER Loop <gen>
-
Events
and:
-
ER Loop
-
Events
- Time - ER_Timer expires
- Conditions
-
Actions
-
For each (Integer ER_TempInteger) from 1 to 10, do (Actions)
-
Loop - Actions
- Set ER_TempReal = (Random real number between 1.00 and 360.00)
- Set ER_TempPoint = (ER_StartPoint offset by 200.00 towards ER_TempReal degrees)
- Unit - Create 1 ER_Dummy for ER_TempPlayer at ER_TempPoint facing Default building facing degrees
- Set ER_Dummy[ER_TempInteger] = (Last created unit)
- Set ER_DummyPoint = (Position of ER_Dummy[ER_TempInteger])
- Set ER_DumymGroup = (Units within ER_AoE of ER_DummyPoint matching (((Matching unit) belongs to an enemy of ER_TempPlayer) Equal to True))
- Unit Group - Add ER_Dummy[ER_TempInteger] to ER_DumymGroup
-
Unit Group - Pick every unit in ER_DumymGroup and do (Actions)
-
Loop - Actions
- Unit - Cause ER_Dummy[ER_TempInteger] to damage (Picked unit), dealing 300.00 damage of attack type Chaos and damage type Divine
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of Dummy Impale for ER_Dummy[ER_TempInteger]) Equal to 0
-
Then - Actions
- Unit - Add Dummy Impale to ER_Dummy[ER_TempInteger]
- Unit - Order ER_Dummy[ER_TempInteger] to Undead Crypt Lord - Impale ER_DummyPoint
- Unit - Remove Dummy Impale from ER_Dummy[ER_TempInteger]
- Else - Actions
-
If - Conditions
-
Loop - Actions
- Set ER_Wait[1] = 1.00
- Unit - Add a ER_Wait[1] second Generic expiration timer to ER_Dummy[ER_TempInteger]
- Wait ER_Wait[1] seconds
-
Loop - Actions
- Selection - Add ER_Caster[1] to selection for ER_TempPlayer
- Unit - Unpause ER_Caster[1]
- Unit - Make ER_Caster[1] Vulnerable
- Trigger - Turn off (This trigger)
-
For each (Integer ER_TempInteger) from 1 to 10, do (Actions)
-
Events
What's weird is the first time it is cast, it will always loop the two triggers infinitely.
Help?