Can you guys help me find whats wrong? my spell is supposed to stun (2sec) and reduce armor of every unit within range by 3/6/9/12 (6sec) but after the 6 seconds timer SOME of the affected unit still retains their armor penalty,
Base Spell : Silence
Range : 300 AOE
heres the code
Thank you in advance
Base Spell : Silence
Range : 300 AOE
heres the code
-
Collapse Init
-
Events
- Map initialization
- Conditions
-
Actions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Loop - Actions
- Player - Disable SC - Spell Book for (Player((Integer A)))
-
Loop - Actions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Events
-
Collapse Cast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Collapse
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Collapse_Has[Collapse_LastRecycled] Equal to True
-
Then - Actions
- Set Collapse_Max = (Collapse_Max + 1)
- Set Collapse_Index = Collapse_Max
-
Else - Actions
- Set Collapse_Index = Collapse_LastRecycled
- Set Collapse_LastRecycled = Collapse_RecycledList[Collapse_LastRecycled]
-
If - Conditions
- -------- ----------------------------------- --------
- -------- ----------------------------------- --------
- Set Collapse_Caster[Collapse_Index] = (Triggering unit)
- Set Collapse_Point[Collapse_Index] = (Target point of ability being cast)
- -------- ----------------------------------- --------
- -------- ----------------------------------- --------
- Set Collapse_Dummy[Collapse_Index] = Caster Dummy
- Set Collapse_DSpell = Stun Dummy
- -------- ----------------------------------- --------
- -------- ----------------------------------- --------
- Set Collapse_Group = (Units within 300.00 of Collapse_Point[Collapse_Index] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) belongs to an enem
- -------- ----------------------------------- --------
- -------- --------
- Unit - Create 1 SFX Dummy for (Owner of Collapse_Caster[Collapse_Index]) at Collapse_Point[Collapse_Index] facing Collapse_Point[Collapse_Index]
- Animation - Play (Last created unit)'s birth animation
- Animation - Change (Last created unit)'s animation speed to 100.00% of its original speed
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- -------- --------
-
Unit Group - Pick every unit in Collapse_Group and do (Actions)
-
Loop - Actions
- Set Collapse_Picked[Collapse_Index] = (Picked unit)
- -------- --------
- Unit - Create 1 Collapse_Dummy[Collapse_Index] for (Owner of Collapse_Caster[Collapse_Index]) at (Position of Collapse_Picked[Collapse_Index]) facing (Position of Collapse_Picked[Collapse_Index])
- -------- --------
- Unit - Add SC - Spell Book to Collapse_Picked[Collapse_Index] <<Armor Penalty
- Unit - Set level of SC - Spell Book for Collapse_Picked[Collapse_Index] to (Level of Collapse for Collapse_Caster[Collapse_Index])
- -------- --------
- Special Effect - Create a special effect attached to the origin of Collapse_Picked[Collapse_Index] using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
- -------- --------
- Unit - Add Collapse_DSpell to (Last created unit)
- Unit - Set level of Collapse_DSpell for (Last created unit) to (Level of M - 1 - Spacial Collapse (Manifold Paradox) for Collapse_Caster[Collapse_Index])
- Unit - Order (Last created unit) to Mountain King - Storm Bolt Collapse_Picked[Collapse_Index]
- Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
- -------- --------
- Special Effect - Destroy (Last created special effect)
- -------- --------
-
Loop - Actions
- Custom script: call DestroyGroup(udg_Collapse_Group)
- Custom script: call RemoveLocation(udg_Collapse_Point[udg_Collapse_Index])
- -------- ----------------------------------- --------
- Set Collapse_Has[Collapse_Index] = True
- Set Collapse_Count = (Collapse_Count + 1)
- Set Collapse_Timer[Collapse_Index] = 6.00
- -------- ----------------------------------- --------
- -------- ----------------------------------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Collapse Loop <gen> is on) Equal to False
-
Then - Actions
- Trigger - Turn on Collapse Loop <gen>
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
- [/COLOR]
-
Collapse Loop
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
For each (Integer Collapse_Integer) from 0 to Collapse_Max, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Collapse_Has[Collapse_Integer] Equal to True
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Collapse_Timer[Collapse_Integer] Greater than 0.00
-
Then - Actions
- Set Collapse_Timer[Collapse_Integer] = (Collapse_Timer[Collapse_Integer] - 0.03)
-
Else - Actions
- Unit - Remove SC - Spell Book from Collapse_Picked[Collapse_Integer]
- -------- ----------------------------------- --------
- Set Collapse_Count = (Collapse_Count - 1)
- Set Collapse_Has[Collapse_Integer] = False
- Set Collapse_RecycledList[Collapse_Integer] = Collapse_LastRecycled
- Set Collapse_LastRecycled = Collapse_Integer
- -------- ----------------------------------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Collapse_Count Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- For each (Integer A) from 0 to Collapse_Max, do (Set Collapse_RecycledList[(Integer A)] = 0)
- Set Collapse_LastRecycled = 0
- Set Collapse_Max = 0
- Else - Actions
-
If - Conditions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer Collapse_Integer) from 0 to Collapse_Max, do (Actions)
-
Events
- [COLOR=#ffffff]
Thank you in advance