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

Bind item to player trigger

Status
Not open for further replies.
Level 3
Joined
Sep 30, 2008
Messages
21
Hi i need a trigger for locking an item to the player that picks it up^^

For example player 2 picks up a Dagger and then drops, then only player 2 can pick it up again and no one else^^

And this is the last trigger im gonna need before i release my map as a beta :p
 
Level 11
Joined
Dec 31, 2007
Messages
780
mmm...

i think that you should add every item dropped by a hero into an item array (1 array per player)
when a unit acquires an item you check if the item is in any of those arrays if so drop the item and print a message

thats what came to my mind right now... but i think somebody might have a better idea or later i may think of something :p
 
Level 11
Joined
Oct 20, 2007
Messages
342
Make trigger like,
  • Pick
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Item - Set the custom value of (Item being manipulated) to (Player number of (Owner of (Triggering unit)))
and
  • Drop
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Custom value of (Item being manipulated)) Not equal to 0
          • (Custom value of (Item being manipulated)) Not equal to (Player number of (Owner of (Triggering unit)))
    • Actions
      • Unit - Order (Triggering unit) to drop (Item being manipulated) at (Position of (Triggering unit))
 
Status
Not open for further replies.
Top