Nenad
~Choco Coronet~ Omnomnom
- Reaction score
- 137
I made a spell that deals damage over time to a unit (based on unholy frenzy). If a unit dies while having this spell (or rather the buff) it should create a dummy unit that will cast the same ability. I made 5 different buffs (for each level of the spell) so that i can check which buff the unit has and set the dummy unit ability level. Here's the trigger:
However, nothing happens ( i added the game message to see if the if/then/else trigger fires, but it doesn't). Is this because the unit dies so it no longer has the buff? Or am i doing something wrong? Any suggestions on making the spell work?
Edit: It's a bit messy cause i was changing stuff just for level 1, so ignore the level 2 3 4 5 for now
Trigger:
- Writihing Pain Chain
- Events
- Unit - A unit Dies
- Conditions
- Actions
- Set TempUnit = (Dying unit)
- Set TempPoint2 = (Position of (Dying unit))
- Set TempGroup2 = (Units within 400.00 of TempPoint2 matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True)))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (TempUnit has buff |cffff0000Writhing Pain|r (1)) Equal to True
- Then - Actions
- Game - Display to (All players) the text: a
- Unit - Create 1 Dummy for Player 1 (Red) at TempPoint facing Default building facing degrees
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Unit - Add Writhing Pain (dummy) to (Last created unit)
- Unit - Set level of Writhing Pain (dummy) for (Last created unit) to 1
- Unit - Order (Last created unit) to Undead Necromancer - Unholy Frenzy (Random unit from TempGroup2)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Dying unit) has buff |cffff0000Writhing Pain|r (2)) Equal to True
- Then - Actions
- Unit - Create 1 Dummy for Player 1 (Red) at TempPoint facing Default building facing degrees
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Unit - Add Writhing Pain (dummy) to (Last created unit)
- Unit - Set level of Writhing Pain (dummy) for (Last created unit) to 2
- Unit - Order (Last created unit) to Undead Necromancer - Unholy Frenzy (Random unit from TempGroup)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Dying unit) has buff |cffff0000Writhing Pain|r (3)) Equal to True
- Then - Actions
- Unit - Create 1 Dummy for Player 1 (Red) at TempPoint facing Default building facing degrees
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Unit - Add Writhing Pain (dummy) to (Last created unit)
- Unit - Set level of Writhing Pain (dummy) for (Last created unit) to 3
- Unit - Order (Last created unit) to Undead Necromancer - Unholy Frenzy (Random unit from TempGroup)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Dying unit) has buff |cffff0000Writhing Pain|r (4)) Equal to True
- Then - Actions
- Unit - Create 1 Dummy for Player 1 (Red) at TempPoint facing Default building facing degrees
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Unit - Add Writhing Pain (dummy) to (Last created unit)
- Unit - Set level of Writhing Pain (dummy) for (Last created unit) to 4
- Unit - Order (Last created unit) to Undead Necromancer - Unholy Frenzy (Random unit from TempGroup)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Dying unit) has buff |cffff0000Writhing Pain|r (5)) Equal to True
- Then - Actions
- Unit - Create 1 Dummy for Player 1 (Red) at TempPoint facing Default building facing degrees
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Unit - Add Writhing Pain (dummy) to (Last created unit)
- Unit - Set level of Writhing Pain (dummy) for (Last created unit) to 5
- Unit - Order (Last created unit) to Undead Necromancer - Unholy Frenzy (Random unit from TempGroup)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Events
However, nothing happens ( i added the game message to see if the if/then/else trigger fires, but it doesn't). Is this because the unit dies so it no longer has the buff? Or am i doing something wrong? Any suggestions on making the spell work?
Edit: It's a bit messy cause i was changing stuff just for level 1, so ignore the level 2 3 4 5 for now