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!
Item - Create Gold Coins at (Position of (Dying unit))
If you do not want this created at just any unit's death, then use a condition.
If you have several types of units that drop different things then you would use the If/Then/Else function as an action where you can use different conditions for different unit types or owners and drop different items.
Item Drop
Events
Unit - A unit Dies
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Dying unit) is A Hero) Equal to True
Then - Actions
Item - Create Gold Coins at (Position of (Dying unit))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Dying unit)) Equal to Footman
Then - Actions
Item - Create Replenishment Potion at (Position of (Dying unit))
Else - Actions
If you have a lot of units that will die and want a bit of randomness with how often that object drops a one trigger method of adding "randomness" to how often the dropping takes place would be:
Gold Drop
Events
Unit - A unit Dies
Conditions
Actions
Item - Create Gold Coins at (Position of (Dying unit))
Wait 0.10 seconds
Trigger - Turn off (This trigger)
Wait (Random real number between 15.00 and 90.00) seconds
In case you want a random system for a huge number of items, you would like to set all your drop items to a variable harray and then use loops to make it, like the example below
Unknown
Events
Time - Elapsed game time is 0.00 seconds
Conditions
Actions
Set Item[1] = Claws of Attack +15
Set Item[2] = Thunder Phoenix Egg
Set Item[3] = Amulet of the Wild
Set Item[4] = Potion of Omniscience
Set Item[5] = Sun Key
Unknown2
Events
Unit - A unit Dies
Conditions
Conditions
Actions
Set Integer = (Random integer number between 1 and 5)
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Integer Equal to (Integer A)
Then - Actions
Set Point = (Position of (Triggering unit))
Item - Create Item[(Integer A)] at Point
Custom script: call RemoveLocation(udg_Point)
Else - Actions
You could change chances of drop by changing numbers, for example setting a normal items with 1 number beetwin each one (num1=1, num2=2 etc.) and rare items with bigger diffrence in numbers (num5=10, num6=20, num7=50 etc.).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.