| 05-19-2004, 01:23 AM | #1 |
Can somebody help me with a trigger to create random items ! Lets say it is an Aos based map so units are created by using a trigger to create them I would like to create a trigger that can randomly drop items on the death of random units. Any one have an idea msg me pls ! |
| 05-19-2004, 08:38 AM | #2 |
Make the two following triggers: Code:
Events:
Map initialisation
Conditions:
Actions:
Set random_item[1]=Potion of healing
Set random_item[1]=Potion of mana
Set random_item[1]=Potion of restorationCode:
Events:
A unit dies
Conditions:
Actions:
Set random_number=random number between 1 and 100
If random_numer is greater then 61
Then actions
Create 1 random item[random number between 1 and 3] at position of dying unit.
Else actions
Do nothing
I hope you will understand the triggers. |
| 05-19-2004, 09:04 AM | #3 | |
Quote:
just a slight correct, set random_item should go 1, 2, 3...N not 1,1,1, heh |
| 05-19-2004, 11:02 AM | #4 |
Thanks man, just one more thing if I add the condition - Unit type of dying unit ARCHER then only archers will drop the specified item ? and so on for footman etc ? But thanks for the random item trigger been trying forever to get it right, never thought of joining a forum before ! Duh ! Thanks Again |
| 05-19-2004, 12:31 PM | #5 | |
Quote:
That's correct. Rather than make 80 triggers for this, though, it might be better to combine it and have the trigger be: if type of unit is footman -drop item -skip remaining actions else if type of unit is archer -drop item -skip remaining actions end etc. |
