• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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?
 
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)
 
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.
Back
Top