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

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