HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need Help with a Trigger PLS !

05-19-2004, 01:23 AM#1
DarkMinnion
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
Kamux
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 restoration

Code:
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
DaKaN
Quote:
Originally Posted by Kamux
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 restoration


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
DarkMinnion
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
slunk731
Quote:
Originally Posted by DarkMinnion
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 ?

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.