• 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.

[Trigger] Starting items

Status
Not open for further replies.
Level 4
Joined
Aug 4, 2010
Messages
62
Hey!

I want a hero bought from a tavern to get a start item. How do I do this with triggers? Im not very good with triggers as you can imagine but the only thing I have manage to do is to give item to units trained. But that is not what I need...

Please show me how to do it by posting the trigger that gives an item to a hero who is bought from a tavern. Thanks! :thumbs_up:
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
shouldnt be that hard, hopefully you understand it:

  • ghxdfgh
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Selling unit)) Equal to Tavern
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Dark Ranger
        • Then - Actions
          • Hero - Create Mask of Death and give it to (Sold unit)
        • Else - Actions
you can either nest the ifs for efficiency, or just go down and down and down for readability

when you buy Dark ranger from the tavern, it will spawn with mask of death
 
Level 7
Joined
Sep 9, 2007
Messages
253
Trigger looks like it should work nicely for the OPs needs.

I believe that in this case the "selling unit" is the same unit as the "triggering unit". I have been told that "triggering unit" is a more efficient function and so should be used where possible.

eg:
for event "a unit dies" you could use triggering unit instead of dying unit.
for event "a unit is attacked" you could use triggering unit instead of attacked unit.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
Trigger looks like it should work nicely for the OPs needs.

I believe that in this case the "selling unit" is the same unit as the "triggering unit". I have been told that "triggering unit" is a more efficient function and so should be used where possible.

eg:
for event "a unit dies" you could use triggering unit instead of dying unit.
for event "a unit is attacked" you could use triggering unit instead of attacked unit.

i know that, but well, it was 1 am and I didnt really feel like thinking anymore :D

this is not so optimized, but it is more explicit and gives better idea of what is done with who for new people that dont have so deep understanding of the way those callbacks work
 
Status
Not open for further replies.
Top