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

Why doesn't this trigger work?

Status
Not open for further replies.
Level 8
Joined
Jun 13, 2010
Messages
344
It is supposed to heal allies for 50% intelligence of the casting hero, and deal 50% intelligence as damage to enemies. But it has no effect. What is wrong? Do I have to use variables? Or do I have to replace casting unit with triggering unit?

  • Natures Balance
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Druid (Nature's Balance)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is A structure) Not equal to True
          • ((Target unit of ability being cast) is Magic Immune) Not equal to True
          • ((Target unit of ability being cast) is dead) Not equal to True
          • ((Target unit of ability being cast) belongs to an enemy of (Owner of (Casting unit))) Equal to True
          • (Target unit of ability being cast) Not equal to (Casting unit)
        • Then - Actions
          • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing ((Real((Intelligence of (Casting unit) (Include bonuses)))) x 0.50) damage of attack type Spells and damage type Normal
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Target unit of ability being cast) is A structure) Not equal to True
              • ((Target unit of ability being cast) is Magic Immune) Not equal to True
              • ((Target unit of ability being cast) is dead) Not equal to True
              • ((Target unit of ability being cast) belongs to an ally of (Owner of (Casting unit))) Equal to True
            • Then - Actions
              • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing ((Real((Intelligence of (Casting unit) (Include bonuses)))) x -0.50) damage of attack type Spells and damage type Normal
            • Else - Actions
              • Do nothing
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Minor imrpovements:
1. If you use ANYTHING more than once, store it into a variable. Which means "Target unit of ability being cast" should definitely be a variable.
2. use triggering unit instead of casting unit, it's slightly faster
3. remove the "Do nothing" and leave it blank/empty instead.
4. check if the target is magic immune and so on, then have a secon if/then/else inside the first one where you check if the target is an allly or an enemy.

Do that and I will have a second look.

edit:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to yourAbility
    • Actions
      • Set target = (Target unit of ability being cast)
      • Set caster = (Triggering unit)
      • Set owner = (Owner of caster)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (target is A structure) Equal to False
          • (target is Magic Immune) Equal to False
          • (target is dead) Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (target belongs to an ally of owner) Equal to True
            • Then - Actions
              • -------- Target is an ally. --------
            • Else - Actions
              • -------- Target is not an ally. --------
        • Else - Actions
edit2: actually.. it's possible that you can't deal negative damage. You can try the "set life" action instead.
 
Last edited:
Level 8
Joined
Jun 13, 2010
Messages
344
Minor imrpovements:
1. If you use ANYTHING more than once, store it into a variable. Which means "Target unit of ability being cast" should definitely be a variable.

But if it is just a single target ability that repeats.. Is a variable then rly necessary?
 
Level 8
Joined
Jun 13, 2010
Messages
344
edit2: actually.. it's possible that you can't deal negative damage. You can try the "set life" action instead.

Strange. I did it with this trigger.

  • Replenishing Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shaman Replenishing Strike
    • Actions
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (1.25 x (Real((Intelligence of (Triggering unit) (Include bonuses))))) damage of attack type Spells and damage type Normal
      • Unit - Cause (Triggering unit) to damage (Triggering unit), dealing (-0.50 x (Real((Intelligence of (Triggering unit) (Include bonuses))))) damage of attack type Spells and damage type Normal
And here it actually heals the caster. But with the first trigger i linked, it does not work, if targeting the caster himself or another ally. Why? xD
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,190
Healing is not damage. Healing is direct health modification. Damage can incorrectly trigger some on damage effects which is not intended when a unit is healed.

And here it actually heals the caster. But with the first trigger i linked, it does not work, if targeting the caster himself or another ally. Why? xD
Maybe he is not an ally with himself? Or at least as far as the test is concerned.
 
Status
Not open for further replies.
Top