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

Item Trigger

Status
Not open for further replies.
Level 3
Joined
Mar 2, 2006
Messages
40
Warlic said:
How do I have a trigger set so that when an item is picked up by a certain hero, it sets that hero as a variable?
If the item is unique (only 1 on the whole map) no problem :
Code:
Unique Item
    Events
        Unit - A unit Acquires an item
    Conditions
        (Item being manipulated) Equal to Celestial Orb of Souls 0050 <gen>
    Actions
        Set Owner = (Hero manipulating item)
Change Celestial Orb to whatever item you want and Oner to some variable of type Unit.
If there has to many items of this type, a single variable will not work. If you want finding which heroes actually have the item, use :
Code:
Unit Group - Pick every unit in (Units in (Playable map area)(((Matching unit) has an item of type Celestial Orb of Souls) Equal to True)) and do (Actions)
    Loop - Actions
If you want to use this variable for finding which hero casted the spell of an item, than there's no need of it. Simply use :
Code:
Events
    Unit - A unit Uses an item
Then to refer to the unit that used the item use Event Responce - Hero Manipulating Item .[/code]
 
Status
Not open for further replies.
Top