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

Monsters with a chance to drop item(s)

Status
Not open for further replies.
Level 4
Joined
Jul 18, 2008
Messages
76
Hey guys, I've got an small problem that has to be fixed.
I have got 10 kobolds that spawns in an region every 30 seconds..

What I want is that all those kobolds will have a 5% drop chance of "gold coins"

Hopefully it is a simple question, so please answer me quick! :ugly:
 
Level 20
Joined
Oct 21, 2006
Messages
3,230
  • Gold Drop
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Kobold
    • Actions
      • Set Point1 = (Position of (Dying unit))
      • Set Gold = (Random integer number between 1 and 100)
      • If (Gold Greater than or equal to 5) then do (Item - Create Gold Coins at Point1) else do (Do nothing)
      • Custom script: call RemoveLocation(udg_Point1)
Variable types:
Point1 = Point
Gold = Integer

Point1 and custom script is only used to remove memory leak. You can learn about memory leaks in there and there.
 
Level 7
Joined
Jul 20, 2008
Messages
377
Sheep, that gives you a 95% chance to drop gold. Change it to Less than or Equal to 5. :p
 
Status
Not open for further replies.
Top