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

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