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

Droping trigger

Status
Not open for further replies.
Level 3
Joined
Jun 18, 2008
Messages
43
How do i make it so that a unit has a chance to drop an item when it dies? Like in my map i have a police cheif.. i want a 25% chance to drop his rifle, 25% chance to drop a deputy badge, and a 25% chance to drop a sack of bullets (all custom items)
 
Level 14
Joined
Nov 4, 2006
Messages
1,241
  • Events
    • Unit - A Unit dies
  • Conditions
    • triggering unit unit-type = police chief
  • Actions
    • set temppoint = position of triggering Unit
    • set integer gleich random number between 1 and 4
    • if integer equal to 1 then do create 1 rifle at temppoint
    • if integer equal to 2 then do create 1 deputy badge at temppoint
    • if integer equal to 3 then do create 1 sack of bullets at temppoint
    • Custom script: call RemoveLocation(udg_TempPoint)
integer is an integer variable
temppoint is a pointvariable
 
Level 6
Joined
Jul 22, 2008
Messages
243
The integer returns a random number between 1 and 4 --> 25% chance for either one of em :D
 
Level 3
Joined
Jun 18, 2008
Messages
43
i cant find the "if integer = 1/2/3/4 then..

i found

If ((integer A) Equal to 1) then do (item - create Police Chief's Rifle at PoliceChief) else do (do nothing)

PoliceChief = my set temp point..
 
Last edited:
Status
Not open for further replies.
Top