MorbazanRhot
New Member
- Reaction score
- 7
So for a boss fight in a map I'm working on, I'm trying to give the boss an ability that makes it so that if he attacks the same unit 4 times in a row, that unit gets Entangling Rooted. I have a working dummy unit and a working dummy spell based off of Entangling Roots so that it has the right order string (and I'm pretty positive they're both functioning because I've actually seen the ability go off twice total in the few times I've tested him). However, the ability never really seems to go off despite the same unit getting attacked many times, the boss switching targets occasionally, and still the same unit getting attacked many times in a row again.
This is the trigger I made for the ability. The idea was that if the Gnoll Chieftan attacks something it checks to see if the unit attacked is equal to the unit variable for this ability. If the unit is not, it sets the variable to the attacked unit and sets another variable, this one an integer, to 0. If the attacked unit is already the variable unit for the ability then it means the Gnoll Chieftan must have attacked him previously, and the integer variable is increased by one. Once the integer variable hits 3, it gives the Roots ability to the dummy and orders the dummy to cast it. At least that's all what's supposed to happen .
So can anyone tell me what I'm doing wrong? Thanks!
This is the trigger I made for the ability. The idea was that if the Gnoll Chieftan attacks something it checks to see if the unit attacked is equal to the unit variable for this ability. If the unit is not, it sets the variable to the attacked unit and sets another variable, this one an integer, to 0. If the attacked unit is already the variable unit for the ability then it means the Gnoll Chieftan must have attacked him previously, and the integer variable is increased by one. Once the integer variable hits 3, it gives the Roots ability to the dummy and orders the dummy to cast it. At least that's all what's supposed to happen .
So can anyone tell me what I'm doing wrong? Thanks!
Code:
Growing Roots
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Attacking unit)) Equal to Gnoll Chieftan
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Attacked unit) Equal to GrowingRootsUnit
Then - Actions
Set GrowingRootsCounter = (GrowingRootsCounter + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GrowingRootsCounter Equal to 3
Then - Actions
Unit - Add Entangling Roots Gnoll dummy to HoggerDummy
Unit - Order HoggerDummy to Night Elf Keeper Of The Grove - Entangling Roots GrowingRootsUnit
Wait until ((Current order of HoggerDummy) Equal to (Order(none))), checking every 0.10 seconds
Unit - Remove Entangling Roots Gnoll dummy from HoggerDummy
Set GrowingRootsCounter = 0
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Attacked unit) Not equal to GrowingRootsUnit
Then - Actions
Set GrowingRootsUnit = (Attacked unit)
Set GrowingRootsCounter = 0
Else - Actions