- Joined
- Jul 22, 2015
- Messages
- 3,485
I'm making this spell as a request for someone, and for some reason it gets really buggy when the caster casts it on another group of units while the other is still running. The way the spell works is almost like the default Disease Cloud except its a point-target spell to get it started versus just walking next to them. I've been working on a bunch of other things so I'm a little tired... I may have missed something really obvious.
EDIT: Thank you to purge for the insight on unit group arrays
-
SP Init
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Cripple
-
-
Actions
-
Set SP_Target = (Target unit of ability being cast)
-
Set SP_MaxIndex = (SP_MaxIndex + 1)
-
Set SP_Caster[SP_MaxIndex] = (Triggering unit)
-
Set SP_Counter[SP_MaxIndex] = 0.00
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(SP_Target is in SP_BurnGroup[SP_MaxIndex]) Equal to False
-
-
Then - Actions
-
Unit Group - Add SP_Target to SP_BurnGroup[SP_MaxIndex]
-
Special Effect - Create a special effect attached to the overhead of SP_Target using Units\Undead\PlagueCloud\PlagueCloudtarget.mdl
-
Animation - Change SP_Target's vertex coloring to (65.00%, 100.00%, 65.00%) with 0.00% transparency
-
Set SP_SFXTarget[SP_MaxIndex] = (Last created special effect)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SP_MaxIndex Equal to 1
-
-
Then - Actions
-
Trigger - Turn on SP Loop <gen>
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
-
SP Loop
-
Events
-
Time - Every 0.50 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer SP_CurrentIndex) from 1 to SP_MaxIndex, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SP_Counter[SP_CurrentIndex] Less than 6.00
-
-
Then - Actions
-
Unit Group - Pick every unit in SP_BurnGroup[SP_CurrentIndex] and do (Actions)
-
Loop - Actions
-
Set SP_PickedUnitBG = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(SP_PickedUnitBG is dead) Equal to True
-
-
Then - Actions
-
Unit Group - Remove SP_PickedUnitBG from SP_BurnGroup[SP_CurrentIndex]
-
Special Effect - Destroy SP_SFXTarget[SP_CurrentIndex]
-
-
Else - Actions
-
Set SP_CheckGroup[SP_CurrentIndex] = (Units within 100.00 of (Position of SP_PickedUnitBG))
-
Unit Group - Pick every unit in SP_CheckGroup[SP_CurrentIndex] and do (Actions)
-
Loop - Actions
-
Set SP_PickedUnitCG = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(SP_PickedUnitCG is A structure) Equal to False
-
(SP_PickedUnitCG is in SP_BurnGroup[SP_CurrentIndex]) Equal to False
-
-
Then - Actions
-
Unit Group - Add SP_PickedUnitCG to SP_BurnGroup[SP_CurrentIndex]
-
Animation - Change SP_PickedUnitCG's vertex coloring to (65.00%, 100.00%, 65.00%) with 0.00% transparency
-
Special Effect - Create a special effect attached to the origin of SP_PickedUnitCG using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
-
Special Effect - Destroy (Last created special effect)
-
-
Else - Actions
-
-
-
-
Custom script: call DestroyGroup (udg_SP_CheckGroup[udg_SP_CurrentIndex])
-
-
-
-
-
Set SP_Counter[SP_CurrentIndex] = (SP_Counter[SP_CurrentIndex] + 0.50)
-
-
Else - Actions
-
Special Effect - Destroy SP_SFXTarget[SP_CurrentIndex]
-
Unit Group - Pick every unit in SP_BurnGroup[SP_CurrentIndex] and do (Actions)
-
Loop - Actions
-
Set SP_PickedUnitBG = (Picked unit)
-
Animation - Change SP_PickedUnitBG's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
-
Unit - Cause SP_Caster[SP_CurrentIndex] to damage SP_PickedUnitBG, dealing 10.00 damage of attack type Spells and damage type Normal
-
-
-
Custom script: call DestroyGroup (udg_SP_BurnGroup[udg_SP_CurrentIndex])
-
Set SP_Caster[SP_CurrentIndex] = SP_Caster[SP_MaxIndex]
-
Set SP_SFXTarget[SP_CurrentIndex] = SP_SFXTarget[SP_MaxIndex]
-
Set SP_Counter[SP_CurrentIndex] = SP_Counter[SP_MaxIndex]
-
Set SP_MaxIndex = (SP_MaxIndex - 1)
-
Set SP_CurrentIndex = (SP_CurrentIndex - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SP_MaxIndex Equal to 0
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
-
-
-
-
-
SP Init
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Cripple
-
-
Actions
-
Set SP_Target = (Target unit of ability being cast)
-
Set SP_MaxIndex = (SP_MaxIndex + 1)
-
Set SP_Caster[SP_MaxIndex] = (Triggering unit)
-
Set SP_Counter[SP_MaxIndex] = 0.00
-
Custom script: if udg_SP_BurnGroup[udg_SP_MaxIndex] == null then
-
Custom script: set udg_SP_BurnGroup[udg_SP_MaxIndex] = CreateGroup()
-
Custom script: endif
-
Unit Group - Add SP_Target to SP_BurnGroup[SP_MaxIndex]
-
Special Effect - Create a special effect attached to the overhead of SP_Target using Units\Undead\PlagueCloud\PlagueCloudtarget.mdl
-
Animation - Change SP_Target's vertex coloring to (65.00%, 100.00%, 65.00%) with 0.00% transparency
-
Set SP_SFXTarget[SP_MaxIndex] = (Last created special effect)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SP_MaxIndex Equal to 1
-
-
Then - Actions
-
Trigger - Turn on SP Loop <gen>
-
-
Else - Actions
-
-
-
-
SP Loop
-
Events
-
Time - Every 0.50 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer SP_CurrentIndex) from 1 to SP_MaxIndex, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SP_Counter[SP_CurrentIndex] Less than 6.00
-
-
Then - Actions
-
Unit Group - Pick every unit in SP_BurnGroup[SP_CurrentIndex] and do (Actions)
-
Loop - Actions
-
Set SP_PickedUnitBG = (Picked unit)
-
Set SP_PickedUnitBGLoc = (Position of SP_PickedUnitBG)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(SP_PickedUnitBG is dead) Equal to True
-
-
Then - Actions
-
Unit Group - Remove SP_PickedUnitBG from SP_BurnGroup[SP_CurrentIndex]
-
Special Effect - Destroy SP_SFXTarget[SP_CurrentIndex]
-
-
Else - Actions
-
Set SP_CheckGroup[SP_CurrentIndex] = (Units within 100.00 of SP_PickedUnitBGLoc)
-
Unit Group - Pick every unit in SP_CheckGroup[SP_CurrentIndex] and do (Actions)
-
Loop - Actions
-
Set SP_PickedUnitCG = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(SP_PickedUnitCG is A structure) Equal to False
-
(SP_PickedUnitCG is in SP_BurnGroup[SP_CurrentIndex]) Equal to False
-
-
Then - Actions
-
Unit Group - Add SP_PickedUnitCG to SP_BurnGroup[SP_CurrentIndex]
-
Animation - Change SP_PickedUnitCG's vertex coloring to (65.00%, 100.00%, 65.00%) with 0.00% transparency
-
Special Effect - Create a special effect attached to the origin of SP_PickedUnitCG using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
-
Special Effect - Destroy (Last created special effect)
-
-
Else - Actions
-
-
-
-
Custom script: call RemoveLocation (udg_SP_PickedUnitBGLoc)
-
Custom script: call DestroyGroup (udg_SP_CheckGroup[udg_SP_CurrentIndex])
-
-
-
-
-
Set SP_Counter[SP_CurrentIndex] = (SP_Counter[SP_CurrentIndex] + 0.50)
-
-
Else - Actions
-
Special Effect - Destroy SP_SFXTarget[SP_CurrentIndex]
-
Unit Group - Pick every unit in SP_BurnGroup[SP_CurrentIndex] and do (Actions)
-
Loop - Actions
-
Set SP_PickedUnitBG = (Picked unit)
-
Animation - Change SP_PickedUnitBG's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
-
Unit - Cause SP_Caster[SP_CurrentIndex] to damage SP_PickedUnitBG, dealing 10.00 damage of attack type Spells and damage type Normal
-
-
-
Custom script: call DestroyGroup (udg_SP_BurnGroup[udg_SP_CurrentIndex])
-
Custom script: set udg_SP_BurnGroup[udg_SP_CurrentIndex] = null
-
Set SP_Caster[SP_CurrentIndex] = SP_Caster[SP_MaxIndex]
-
Set SP_SFXTarget[SP_CurrentIndex] = SP_SFXTarget[SP_MaxIndex]
-
Set SP_Counter[SP_CurrentIndex] = SP_Counter[SP_MaxIndex]
-
Set SP_MaxIndex = (SP_MaxIndex - 1)
-
Set SP_CurrentIndex = (SP_CurrentIndex - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SP_MaxIndex Equal to 0
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
-
-
-
-
Last edited: