Making Random Item Drops

Status
Not open for further replies.
Level 4
Joined
Jul 9, 2004
Messages
81
I was wondering if there would be a way to make a trigger that monsters will randomly drop items on death...I mean monsters that haven't been made yet? Would i have to use variables or intergers 1-10?? Or is their a way to use an custom item table? Some1 plz help! :D
 
What? I have no clue what your talking about. Do you mean when u click on a unit? Because I want to make it happend from triggers :? :? :? :?
 
If you just want unit to drop random item on death, do following:

Create a array of item-type (Ctrl+B in Trigger Editor, create new variable of item-type and mark it as an array), and add this to initialization trigger (with Map Initialization event):

Events
Map Initialization
Conditions
Actions
Set xxx[1] = Gold Coins
Set xxx[2] = Scroll of Town Portal

...
[xxx is a name of your item-type array, create as much elements as you wish]

Create new trigger:

Events
Unit - A unit dies
Conditions
(Owner of (Dying unit)) = (Neutral Hostile)
Actions
Item - Create 1 xxx[(Random integer between 1 and x)] at (Position of (Dying unit))

xxx is your item-type array and x is count of its elements.
 
I see what you are saying but...it still doesn't make too much sense to me! Do I use both triggers or one? And I want to make an random item drop for each DIFFERANT kind of monster (ex. footman,peasent,knight,ect.) Would i have to make both of those 2 triggers just to make 1 random item drop from a certain monster? Do you think you could make a test map showing this plz?
 
i think there is a hero function that tells the unit to drop an item in a certain slot. what i would do, is just have a random integer indicate which slot to be droppped. Then, you could use a boolean to check and make sure the slot isn't empty.
 
Status
Not open for further replies.
Back
Top