- Joined
- Jun 11, 2018
- Messages
- 270
Hello. This is driving me insane. I'm setting up a spell called Sand Attack that applies 'Drunken Haze' on targets. Each time you hit enemies with Sand Attack, a stronger version of 'Drunken Haze' is applied to the target. To achieve this, I made six 'Drunken Haze' buffs and each time you hit the enemies, it replaces the current 'Drunken Haze' buff with a stronger one.
It works as intended for the first cast. It applies 'Drunken Haze' buff level 1 on the target. However, when I cast Sand Attack on the enemy again, the level 1 'Drunken Haze' gets replaced by a level 2 'Drunken Haze' buff (as intended) HOWEVER it also adds an extra level 1 'Drunken Haze' buff. And it keeps repeating - meaning that each time I cast Sand Attack on the enemies, their 'Drunken Haze' buff does get replaced with a stronger one each time (as intended) but it also keeps adding this extra level 1 'Drunken Haze' buff.
I just can not fathom how to get this system to stop applying the level 1 buff in addition to the intended one.
I hope I managed to explain this properly.
It works as intended for the first cast. It applies 'Drunken Haze' buff level 1 on the target. However, when I cast Sand Attack on the enemy again, the level 1 'Drunken Haze' gets replaced by a level 2 'Drunken Haze' buff (as intended) HOWEVER it also adds an extra level 1 'Drunken Haze' buff. And it keeps repeating - meaning that each time I cast Sand Attack on the enemies, their 'Drunken Haze' buff does get replaced with a stronger one each time (as intended) but it also keeps adding this extra level 1 'Drunken Haze' buff.
I just can not fathom how to get this system to stop applying the level 1 buff in addition to the intended one.
I hope I managed to explain this properly.
-
SandAttack
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


Or - Any (Conditions) are true
-



Conditions
-




(Ability being cast) Equal to Flamethrower Q
-
-
-
-

Actions
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




SandAttack_Integer[1] Equal to 0
-
-



Then - Actions
-




Trigger - Turn on SandAttackRoll <gen>
-
-



Else - Actions
-
-


Set VariableSet SandAttack_Integer[1] = (SandAttack_Integer[1] + 1)
-


Set VariableSet SandAttack_Integer[2] = (SandAttack_Integer[2] + 1)
-


Set VariableSet SandAttack_Caster[SandAttack_Integer[2]] = (Triggering unit)
-


Set VariableSet SandAttack_Location[SandAttack_Integer[2]] = (Position of SandAttack_Caster[SandAttack_Integer[2]])
-


Set VariableSet SandAttack_Location2[SandAttack_Integer[2]] = (Target point of ability being cast)
-


Set VariableSet SandAttack_Angle[SandAttack_Integer[2]] = (Angle from SandAttack_Location[SandAttack_Integer[2]] to SandAttack_Location2[SandAttack_Integer[2]])
-


Set VariableSet SandAttack_Muzzle[SandAttack_Integer[2]] = (SandAttack_Location[SandAttack_Integer[2]] offset by 100.00 towards SandAttack_Angle[SandAttack_Integer[2]] degrees.)
-


Set VariableSet SandAttack_Tick[SandAttack_Integer[2]] = 15
-


Unit Group - Remove all units from SandAttack_DummyGroup[SandAttack_Integer[2]].
-


Unit - Create 1 Wave Spell Dummy for (Owner of SandAttack_Caster[SandAttack_Integer[2]]) at SandAttack_Muzzle[SandAttack_Integer[2]] facing Default building facing degrees
-


Unit - Hide (Last created unit)
-


Set VariableSet SandAttack_Dummy[SandAttack_Integer[2]] = (Last created unit)
-


Unit Group - Add (Last created unit) to SandAttack_DummyGroup[SandAttack_Integer[2]]
-


Custom script: call RemoveLocation(udg_SandAttack_Location[udg_SandAttack_Integer[2]])
-


Custom script: call RemoveLocation(udg_SandAttack_Location2[udg_SandAttack_Integer[2]])
-


Custom script: call RemoveLocation(udg_SandAttack_Muzzle[udg_SandAttack_Integer[2]])
-


Set VariableSet SandAttack_Location2[SandAttack_Integer[2]] = (Target point of ability being cast)
-


-------- Floating Text --------
-


Floating Text - Create floating text that reads Sand Attack above SandAttack_Caster[SandAttack_Integer[3]] with Z offset 0.00, using font size 10.00, color (88.00%, 45.00%, 20.00%), and 0.00% transparency
-


Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
-


Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
-


Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
-


Floating Text - Change (Last created floating text): Disable permanence
-
-
-
SandAttackRoll
-

Events
-


Time - Every 0.03 seconds of game time
-
-

Conditions
-

Actions
-


For each (Integer SandAttack_Integer[3]) from 1 to SandAttack_Integer[2], do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






SandAttack_Tick[SandAttack_Integer[3]] Greater than 0
-
-





Then - Actions
-






Set VariableSet SandAttack_DummyPoint[SandAttack_Integer[3]] = (Position of SandAttack_Dummy[SandAttack_Integer[3]])
-






Set VariableSet SandAttack_Location2[SandAttack_Integer[3]] = (SandAttack_DummyPoint[SandAttack_Integer[3]] offset by 45.00 towards SandAttack_Angle[SandAttack_Integer[3]] degrees.)
-






For each (Integer A) from 4 to 5, do (Actions)
-







Loop - Actions
-








Special Effect - Create a special effect at SandAttack_DummyPoint[SandAttack_Integer[3]] using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
-








Custom script: call BlzSetSpecialEffectHeight(bj_lastCreatedEffect, 10.0)
-








Custom script: call BlzSetSpecialEffectScale(bj_lastCreatedEffect, 0.9)
-








Special Effect - Destroy (Last created special effect)
-
-
-






Unit - Move SandAttack_Dummy[SandAttack_Integer[3]] instantly to SandAttack_Location2[SandAttack_Integer[3]]
-






-------- Strike Check --------
-






Set VariableSet SandAttack_Strike[SandAttack_Integer[3]] = (Units within 180.00 of SandAttack_DummyPoint[SandAttack_Integer[3]] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) belongs to an ally of (Owner of SandAttack_Caster[S
-






Unit Group - Pick every unit in SandAttack_Strike[SandAttack_Integer[3]] and do (Actions)
-







Loop - Actions
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










((Picked unit) is in SandAttack_NonStrike[SandAttack_Integer[3]].) Equal to False
-
-









Then - Actions
-










Set VariableSet Current_Level = 0
-










If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-











If - Conditions
-












((Picked unit) has buff Lowered Accuracy 6 ) Equal to True
-
-











Then - Actions
-












Set VariableSet Current_Level = 6
-
-











Else - Actions
-












If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-













If - Conditions
-














((Picked unit) has buff Lowered Accuracy 5 ) Equal to True
-
-













Then - Actions
-














Set VariableSet Current_Level = 5
-
-













Else - Actions
-














If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-















If - Conditions
-
















((Picked unit) has buff Lowered Accuracy 4 ) Equal to True
-
-















Then - Actions
-
















Set VariableSet Current_Level = 4
-
-















Else - Actions
-
















If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-

















If - Conditions
-


















((Picked unit) has buff Lowered Accuracy 3 ) Equal to True
-
-

















Then - Actions
-


















Set VariableSet Current_Level = 3
-
-

















Else - Actions
-


















If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



















If - Conditions
-




















((Picked unit) has buff Lowered Accuracy 2 ) Equal to True
-
-



















Then - Actions
-




















Set VariableSet Current_Level = 2
-
-



















Else - Actions
-




















If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





















If - Conditions
-






















((Picked unit) has buff Lowered Accuracy 1 ) Equal to True
-
-





















Then - Actions
-






















Set VariableSet Current_Level = 1
-
-





















Else - Actions
-
-
-
-
-
-
-
-
-
-
-
-










Unit - Remove Lowered Accuracy 1 buff from (Picked unit)
-










Unit - Remove Lowered Accuracy 2 buff from (Picked unit)
-










Unit - Remove Lowered Accuracy 3 buff from (Picked unit)
-










Unit - Remove Lowered Accuracy 4 buff from (Picked unit)
-










Unit - Remove Lowered Accuracy 5 buff from (Picked unit)
-










Unit - Remove Lowered Accuracy 6 buff from (Picked unit)
-










Unit - Create 1 Dummy (Casts stat debuff) for (Owner of SandAttack_Caster[SandAttack_Integer[3]]) at SandAttack_DummyPoint[SandAttack_Integer[3]] facing Default building facing degrees
-










Unit - Add Lowered Accuracy (Drunken Haze) to (Last created unit)
-










Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
-










If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-











If - Conditions
-












Current_Level Less than 6
-
-











Then - Actions
-












Unit - Set level of Lowered Accuracy (Drunken Haze) for (Last created unit) to (Current_Level + 1)
-
-











Else - Actions
-












Unit - Set level of Lowered Accuracy (Drunken Haze) for (Last created unit) to 6
-
-
-










Unit - Order (Last created unit) to Neutral Brewmaster - Drunken Haze (Picked unit)
-










Unit Group - Add (Picked unit) to SandAttack_NonStrike[SandAttack_Integer[3]]
-
-









Else - Actions
-
-
-
-






Custom script: call RemoveLocation(udg_SandAttack_DummyPoint[udg_SandAttack_Integer[3]])
-






Custom script: call RemoveLocation(udg_SandAttack_Location2[udg_SandAttack_Integer[3]])
-






Custom script: call DestroyGroup(udg_SandAttack_Strike[udg_SandAttack_Integer[3]])
-






Set VariableSet SandAttack_Tick[SandAttack_Integer[3]] = (SandAttack_Tick[SandAttack_Integer[3]] - 1)
-
-





Else - Actions
-






Unit - Kill SandAttack_Dummy[SandAttack_Integer[3]]
-






Custom script: call DestroyGroup(udg_SandAttack_NonStrike[udg_SandAttack_Integer[3]])
-






Set VariableSet SandAttack_Caster[SandAttack_Integer[3]] = SandAttack_Caster[SandAttack_Integer[2]]
-






Set VariableSet SandAttack_Dummy[SandAttack_Integer[3]] = SandAttack_Dummy[SandAttack_Integer[2]]
-






Set VariableSet SandAttack_NonStrike[SandAttack_Integer[3]] = SandAttack_NonStrike[SandAttack_Integer[2]]
-






Set VariableSet SandAttack_DummyGroup[SandAttack_Integer[3]] = SandAttack_DummyGroup[SandAttack_Integer[2]]
-






Set VariableSet SandAttack_Tick[SandAttack_Integer[3]] = SandAttack_Tick[SandAttack_Integer[2]]
-






Set VariableSet SandAttack_Angle[SandAttack_Integer[3]] = SandAttack_Angle[SandAttack_Integer[2]]
-






-------- Cleaning --------
-






Unit Group - Remove all units from SandAttack_NonStrike[SandAttack_Integer[2]].
-






Unit Group - Remove all units from SandAttack_DummyGroup[SandAttack_Integer[2]].
-






-------- Subtracting counters --------
-






Set VariableSet SandAttack_Integer[2] = (SandAttack_Integer[2] - 1)
-






Set VariableSet SandAttack_Integer[3] = (SandAttack_Integer[3] - 1)
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








SandAttack_Integer[2] Equal to 0
-
-







Then - Actions
-








Set VariableSet SandAttack_Integer[1] = 0
-








Trigger - Turn off (This trigger)
-
-







Else - Actions
-
-
-
-
-
-
-