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

Trigger.. making a unit have % chance to drop an item?

Status
Not open for further replies.
Level 4
Joined
Sep 27, 2007
Messages
85
could some one please tell me how to make a unit have a % to drop a item with a trigger or is it only able to be done by double clicking on a unit and setting the percent chance to drop items? sorry if this is in the wrong forum im not sure
 
Level 4
Joined
Sep 27, 2007
Messages
85
but what about when the unit dies and then i set it so it makes another troll in that position after a certian amount of time, it wont have any chance to drop an item????!?!?!?
 
Level 4
Joined
Sep 27, 2007
Messages
85
the monsters need to be revived by triggers and i can only do that by using create unit at the point of dying unit right?... or is theere some way i can revive the unit that died?
 
Level 8
Joined
Dec 10, 2006
Messages
544
Create a point variable called, PositionVariable, and a Integer variable called Creep_Drop_Number [Or whatever you want to call them.]

Troll Drops
Events
Unit - A unit Dies
Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Dying unit)) Equal to Troll
Actions
Set Creep_Drop_Number = (Random integer number between 1 and 100)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Creep Drop Number Less than or equal to 15
Then - Actions
Set PositionVariable = (Position of (Dying unit))
Item - Create Item at PositionVariable
Custom script: call RemoveLocation( udg_PositionVariable )
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Creep_Drop_Number Greater than 15
Creep_Drop_Number Less than or equal to 24
Then - Actions
Set PositionVariable = (Position of (Dying unit))
Item - Create Item at PositionVariable
Custom script: call RemoveLocation( udg_PositionVariable )
Else - Actions
Do nothing

This way, The player has a 38% chance to get an item,
but not only that, he has 15% chance to get item 1, 9% chance to get item two. and so on and so forth.
Also this will make every unit of that type have a chance to drop that item.
Cheers. =]
-Calvin
 
Level 4
Joined
Dec 8, 2007
Messages
86
To complicated just do this...
All you need is 2 triggers really simple ones (and 2 variables)

Variables you need:
"Random_Item" = "Item-Type Array (1)" -None-
"Num_Items" = "Integer" 0 (Default)

(this first is if you wan't it to drop a random item)
  • Random Item Drop
  • Events
  • Unit - A unit Dies
  • Conditions
  • Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Random integet number between 1 and 100) Greater than or equal to ##
  • Then - Actions
  • Item - Create Random_Item[(Random integer number between 1 and Num_Items)] at (Position of (Dying Unit)
  • Item Drop Set
  • Events
  • Map initialization
  • Conditions
  • Actions
  • Set Random_Item(1) = Your Item
  • Set Random_Item(2) = Your Item
  • Set Random_Item(3) = Your Item
  • Set Random_Item(4) = Your Item
  • Set Random_Item(5) = Your Item
  • Set Random_Item(6) = Your Item
  • Set Random_Item(7) = Your Item
  • Set Random_Item(8) = Your Item
  • Set Num_Items = 8 (depends on how many items you have above)
If you wan't it to have a % to drop more items (but lower) then use this:
  • Random Item Drop
  • Events
  • Unit - A unit Dies
  • Conditions
  • Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Random integet number between 1 and 100) Greater than or equal to ##
  • Then - Actions
  • Item - Create Random_Item[(Random integer number between 1 and Num_Items)] at (Position of (Dying Unit)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Random integet number between 1 and 100) Greater than or equal to ##
  • Then - Actions
  • Item - Create Random_Item[(Random integer number between 1 and Num_Items)] at (Position of (Dying Unit)
 
Level 4
Joined
Sep 27, 2007
Messages
85
wow thank you so much... i cant believe im still so crap at map making and after like 4-5 years i still can't to anything experty... i really need some help:razz:
 
Level 4
Joined
Sep 27, 2007
Messages
85
THIS IS SO CONFUSING I DONT EVEN KNOW WHERE TO GO TO FIND....
If (All Conditions are True) then do (Then Actions) else do (Else Actions)?:sad:
 
Level 4
Joined
Sep 27, 2007
Messages
85
I DONT understand this.......... could you extend it please? tell me where to go to get to whatever like If (All Conditions are True) then do (Then Actions) else do (Else Actions) what do i do with that and WHERE do i find it????
 
Level 8
Joined
Dec 10, 2006
Messages
544
Don't triple post,
theres an edit button.
I added an attachment on where to find it, if you STILL, can't find it from the screenshot, you need help. Its 10 away from do Nothing.


To complicated just do this...
All you need is 2 triggers really simple ones (and 2 variables)

Variables you need:
"Random_Item" = "Item-Type Array (1)" -None-
"Num_Items" = "Integer" 0 (Default)

Basically what I said except, yours allows for more variety of item drops per %.
Also, Mine wasn't too complicated, and only required 2 variables and 1 simple trigger.
But, I'd choose yours anyways.
Cheers.
-Calvin
 

Attachments

  • If Than Else.jpg
    If Than Else.jpg
    71.7 KB · Views: 169
Status
Not open for further replies.
Top