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

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