• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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 13
Joined
Nov 4, 2006
Messages
1,239
  • 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