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

How to make loot table for unit that is not in the map in the editor?

Status
Not open for further replies.
Level 7
Joined
Dec 5, 2013
Messages
280
Loot tables can be created when right clicked the unit in map, but if the unit is not in the map then how to give loot for unit?
 
Level 25
Joined
May 11, 2007
Messages
4,650
He asks for how to make units drop items, this can be done for preplaced units by setting their item table. This will give them a white circle around them.

To make your units drop items, you will have to do it with triggers.
I don't have the editor close but it's something like this:
  • Events: A unit dies
  • Conditions: Unit-type of triggering unit equal to (YOUR UNIT) = true
  • Actions:
  • set variable tempPoint1 = Position of triggering unit.
  • Create 1 item(YOUR ITEM) at tempPoint1.
  • Custom script: call RemoveLocation(udg_tempPoint1)
 
Level 17
Joined
Mar 21, 2011
Messages
1,611
to create a random item you have to use arrays.
Put that into the initialization
Item[0] = Blades of Attack
Item[1] = Ring of Protection
Item[2] = Mask of Death
Item[3] = Belt of giant Strength

And now you create a trigger like LorDz said, just add some things.
Event - A unit dies
Condition - Unit-type of triggering unit equal to (your unit) == true
Action -
Set TempPoint = Position of (triggering unit)
Set TempInt = Random integer number between (0 and 3)
Create 1 Item[TempInt] at TempPoint
Custom script: call RemoveLocation (udg_TempPoint)

EDIT:
To have a different drop chance for each item, just change this in the initialization trigger:

Item[0] = Blades of Attack
Item[1] = Blades of Attack
Item[2] = Mask of Death
Item[3] = Belt of giant Strength

now - cause there are 2 blades of attack - it has a 50% chance to drop while the other items have a 25% chance
 
Status
Not open for further replies.
Top