• 🏆 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!

Healing Trigger

Status
Not open for further replies.
Level 9
Joined
Aug 1, 2008
Messages
453
Im am making a shield ability that absorbs 5 attacks and i was wondering why the healing in this trigger isnt working.. Heres the setup trigger
  • Shadow Shield TURN ON
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Shadow Shield (Neutral Hostile)
    • Actions
      • Set Set_Unit = (Casting unit)
      • Set Shadow_Shield_HP[(Player number of (Owner of Set_Unit))] = (Life of (Casting unit))
      • Set Shadow_INT[(Player number of (Owner of Set_Unit))] = 1




  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ((Attacked unit) has buff Mana Shield 1 ) Equal to True
      • Shadow_INT[(Player number of (Owner of (Triggering unit)))] Greater than or equal to 1
      • Shadow_INT[(Player number of (Owner of (Triggering unit)))] Less than 5
    • Then - Actions
      • Set Shadow_INT[(Player number of (Owner of (Triggering unit)))] = (Shadow_INT[(Player number of (Owner of (Triggering unit)))] + 1)
      • Unit - Set life of (Triggering unit) to Shadow_Shield_HP[(Player number of (Owner of (Triggering unit)))]
    • Else - Actions
      • Set Shadow_INT[(Player number of (Owner of (Triggering unit)))] = 0
      • Unit - Remove Mana Shield 1 buff from (Triggering unit)
 
Level 8
Joined
Aug 3, 2008
Messages
391
Im am making a shield ability that absorbs 5 attacks and i was wondering why the healing in this trigger isnt working.. Heres the setup trigger
  • Shadow Shield TURN ON
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Shadow Shield (Neutral Hostile)
    • Actions
      • Set Set_Unit = (Casting unit)
      • Set Shadow_Shield_HP[(Player number of (Owner of Set_Unit))] = (Life of (Casting unit))
      • Set Shadow_INT[(Player number of (Owner of Set_Unit))] = 1




  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ((Attacked unit) has buff Mana Shield 1 ) Equal to True
      • Shadow_INT[(Player number of (Owner of (Triggering unit)))] Greater than or equal to 1
      • Shadow_INT[(Player number of (Owner of (Triggering unit)))] Less than 5
    • Then - Actions
      • Set Shadow_INT[(Player number of (Owner of (Triggering unit)))] = (Shadow_INT[(Player number of (Owner of (Triggering unit)))] + 1)
      • Unit - Set life of (Triggering unit) to Shadow_Shield_HP[(Player number of (Owner of (Triggering unit)))]
    • Else - Actions
      • Set Shadow_INT[(Player number of (Owner of (Triggering unit)))] = 0
      • Unit - Remove Mana Shield 1 buff from (Triggering unit)

I see a few problems:

With the Shadow_Shield_HP which as far as I can see stores the health of the unit at the time the unit casts the spell. So it won't work. If the unit has 300 health at the time when casting the spell, his health will be returned to 300 health when attacked.

And secondly, in your second trigger, Triggering unit does not refer to the unit being attacked. Attacked unit does. Triggering unit in this case refers to the attacking unit.

Cheers.
 
Status
Not open for further replies.
Top