• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Resurrection Problem

Status
Not open for further replies.
Level 6
Joined
Aug 12, 2007
Messages
133
I am trying to make a temporary resurrection spell. If the target dies within the effect of the spell, it gets resurrected. The problem is, it won't remove the ability upon death. What's wrong?
  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
    • (Ability being cast) Equal to Life Ward
  • Actions
    • Player Group - Pick every player in (All players) and do (Player - Disable Life Ward Spell Book for (Picked player))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Ward1 Equal to No unit
      • Then - Actions
        • Set Ward1 = (Target unit of ability being cast)
        • Unit - Add Life Ward Spell Book to Ward1
        • Wait 20.00 seconds
        • Unit - Remove Life Ward Spell Book from Ward1
        • Set Ward1 = No unit
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Ward1_Copy Equal to No unit
          • Then - Actions
            • Set Ward1_Copy = (Target unit of ability being cast)
            • Unit - Add Life Ward Spell Book to Ward1_Copy
            • Wait 20.00 seconds
            • Unit - Remove Life Ward Spell Book from Ward1_Copy
            • Set Ward1_Copy = No unit
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Ward1_Copy_2 Equal to No unit
              • Then - Actions
                • Set Ward1_Copy_2 = (Target unit of ability being cast)
                • Unit - Add Life Ward Spell Book to Ward1_Copy_2
                • Wait 20.00 seconds
                • Unit - Remove Life Ward Spell Book from Ward1_Copy_2
                • Set Ward1_Copy_2 = No unit
              • Else - Actions
                • Set Ward1_Copy_3 = (Target unit of ability being cast)
                • Unit - Add Life Ward Spell Book to Ward1_Copy_3
                • Wait 20.00 seconds
                • Unit - Remove Life Ward Spell Book from Ward1_Copy_3
                • Set Ward1_Copy_3 = No unit
  • Events
    • Unit - A unit Dies
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Dying unit) Equal to Ward1
      • Then - Actions
        • Unit - Remove Life Ward Spell Book from Ward1
        • Set Ward1 = No unit
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Dying unit) Equal to Ward1_Copy
          • Then - Actions
            • Unit - Remove Life Ward Spell Book from Ward1_Copy
            • Set Ward1_Copy = No unit
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Dying unit) Equal to Ward1_Copy_2
              • Then - Actions
                • Unit - Remove Life Ward Spell Book from Ward1_Copy_2
                • Set Ward1_Copy_2 = No unit
              • Else - Actions
                • Unit - Remove Life Ward Spell Book from Ward1_Copy_3
                • Set Ward1_Copy_3 = No unit
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
I don't recommend using waits.

You can test the IF/THEN/ELSES with Game - Display text, enter some message and see if it pops up.

Does the spell work for one unit? Don't cast it on others. It doesn't work correctly if you cast it on more than one unit during that 20 seconds.
 
Status
Not open for further replies.
Top