• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Drop item upon death

Status
Not open for further replies.
Level 9
Joined
Oct 17, 2007
Messages
547
Whats the best action to make the dying hero drop a random item from its inventory? Doing it in object editor won't work the way i want it to.

How can I take one item from the dying hero and give it to the killing hero, the action that doesnt require the unit to run cuase it's already dead at that point.
 
Level 2
Joined
Aug 12, 2006
Messages
10
The way I'd do dropping the random item on death would be to add a line to whatever primary death trigger you have:

  • Hero - Drop the item from slot (Random integer number between 1 and 6) of (Dying unit)
As for automatically giving it to the killing Hero, we can expand that same section (the variable used is simply an 'item' variable):

  • Hero - Drop the item from slot (Random integer number between 1 and 6) of (Dying unit)
  • Set DroppedItem = (Last dropped item)
  • Hero - Give DroppedItem to (Killing unit)
  • Set DroppedItem = No item
Hope that helps!
 
Status
Not open for further replies.
Top