• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen 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