HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Creeps Drop Items

03-30-2010, 05:24 AM#1
BuRnInSpartan
Ok so I set up a trigger that works very well for percentage based drops but it doesn't seem to work for more than one drop. What did I do wrong? I get an item to drop once. But only once. I want it to be a consistent percent per death.

Trigger:
Forest Trolls
Collapse Events
Unit - A unit owned by Neutral Hostile Dies
Collapse Conditions
(Unit-type of (Dying unit)) Equal to Troll
Collapse Actions
Collapse For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Random integer number between 1 and 10) Equal to 1
Collapse Then - Actions
Item - Create Health Potion at (Position of (Dying unit))
Collapse Else - Actions
Do nothing
03-30-2010, 05:28 AM#2
DioD
place code INSIDE loop block, currently its outside.
03-30-2010, 05:32 AM#3
BuRnInSpartan
um... no its not. i see it perfectly.
03-30-2010, 05:51 AM#4
Fledermaus
Quote:
Originally Posted by DioD
place code INSIDE loop block, currently its outside.

Trigger:
Forest Trolls
Collapse Events
Unit - A unit owned by Neutral Hostile Dies
Collapse Conditions
(Unit-type of (Dying unit)) Equal to Troll
Collapse Actions
Collapse For each (Integer A) from 1 to 10, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Random integer number between 1 and 10) Equal to 1
Collapse Then - Actions
Item - Create Health Potion at (Position of (Dying unit))
Else - Actions
03-30-2010, 05:58 AM#5
BuRnInSpartan
ok cool that worked. thanks.
03-30-2010, 06:14 AM#6
Veev
Anytime you want something in an If/Then/Else to do "Do nothing" just put nothing in there. "Do Nothing" is a useless function call.
03-30-2010, 04:56 PM#7
BuRnInSpartan
ok my newest problem with this trigger is i added a new situation under the same trigger in which there is supposed to be a 1 in 50 chance to drop some gold but for some reason when i add that bit 2 or 3 potions will begin to drop off of the trolls.
Trigger:
Forest Trolls
Collapse Events
Unit - A unit owned by Neutral Hostile Dies
Collapse Conditions
(Unit-type of (Dying unit)) Equal to Troll
Collapse Actions
Collapse For each (Integer A) from 1 to 20, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Random integer number between 1 and 20) Equal to 1
Collapse Then - Actions
Item - Create Health Potion at (Position of (Dying unit))
Else - Actions
Collapse For each (Integer A) from 1 to 50, do (Actions)
Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Random integer number between 1 and 50) Equal to 25
Collapse Then - Actions
Item - Create Gold Coins at (Position of (Dying unit))
Else - Actions
03-30-2010, 08:27 PM#8
Fledermaus
Well since you have the Potion dropping in a For loop that runs 20 times, there are 20 1 in 20 chances to drop a Potion.

If you only want 1 1 in 20 chance to drop a Potion (and 1 1 in 50 chance to drop Coins) why on earth are you using For loops at all?

Also your Coin drops are not in the For loop (like your Potion drop originally wasn't either) but if ^ is the case, you don't want either in a for loop.
03-31-2010, 04:29 AM#9
BuRnInSpartan
so you're saying leave the trigger as is but not in the for loop?
03-31-2010, 05:11 AM#10
Ammorth
What your trigger says right now is this:

Code:
Do this 20 times:
    1 in 20 chance to drop a potion

Therefore you have 20, 1 in 20 chances to get a potion. If you only want 1, 1 in 20 chance to drop a potion, just get rid of your loop (which causes the inside to run 20 times).
04-04-2010, 10:09 PM#11
BuRnInSpartan
so how would the trigger look?
04-09-2010, 04:15 AM#12
[VDM]Amn
wow, wait a sec, this drop system sucks
this is the non-gay way for a %30 chance

Trigger:
Forest Trolls
Collapse Events
Unit - A unit dies
Collapse Conditions
(Unit-type of (Dying unit)) Equal to your_unit_type
Integer - (random value between 1 and 10) is equal or less than 3
Collapse Actions
Item - Create your_item at (Position of (Dying unit))

if u want the unit to drop more items, copy-paste the trigger and alter it at will

good luck