• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Triggering unit Attacking Triggerin Unit

Status
Not open for further replies.
Level 2
Joined
Jul 13, 2007
Messages
6
trainingbaumph1.png


Can someone help me? i'm trying to make tree if an unit attack this tree by every hit this unit do he gets exp. I'm a little noob in triggers so please help me :)

Edit: and i have another question to this. Can i do a trigger like if hero attack triggering unit, attacking unit get 100% exp from the damage the attacking unit do. How does this work?
 
Last edited:
Level 9
Joined
Jun 26, 2007
Messages
659
trigger are cut in 3 part: Ereignisse, Bedingungen and Aktionen
You can traduce a trigger like this:
when one of the Ereignisse append, if all Bedingungen are true, the Aktionen are done

So this is your trigger:
  • Training Baum
    • Events
      • Unit - A unit is attacked
    • Conditions
      • (Attacked unit) equal to Trainings Baumstamm 0073 <gen>
      • ((Attacking unit) is a hero) Equal to TRUE
    • Action
      • Hero - Add 50 experience to (Attacking unit), Showing level-up graphics
Or also
  • Training Baum
    • Events
      • Unit - Trainings Baumstamm 0073 <gen> is attacked
    • Conditions
      • ((Attacking unit) is a hero) Equal to TRUE
    • Action
      • Hero - Add 50 experience to (Attacking unit), Showing level-up graphics
_
And sorry, but i don't understand "hero attack triggering attacking triggerin unit"
maybe you simply want something like this:
  • Training Baum
    • Events
      • Unit - Trainings Baumstamm 0073 <gen> is attacked
    • Conditions
      • ((Attacking unit) is a hero) Equal to TRUE
    • Action
      • Hero - Add (Integer((Damage taken))) experience to (Attacking unit), Showing level-up graphics
 
Last edited:
Level 2
Joined
Jul 13, 2007
Messages
6
Thx it the first thing works :)

By the second thing I mean if hero attack this tree and he do 100 damage to this tree he gets 100 Exp, if hero do 150 damage he get 150 exp... I want to know if this is possible and how i can do this. i hope you understand this.

Sry for my bad english :sad:
 
Level 9
Joined
Jun 26, 2007
Messages
659
hmm i dont think your 3rd trigger works
I've tested it before post it, and it works :p
(the trigger is ran for each hit, "unit is attacked" means "unit takes damage", that's not clear, but that's it)

Bonus
  • Generic Training Baum (works for all training baum)
    • Events
      • Unit - A unit is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Training Baum
      • ((Attacking unit) is a hero) Equal to TRUE
    • Action
      • Hero - Add (Integer((Damage taken))) experience to (Attacking unit), Showing level-up graphics
 
Status
Not open for further replies.
Top