HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Item Drop System

04-09-2005, 03:28 PM#1
Zero
Ok, so I allready have a set system that looks like this:

Event:
Unit - A unit owned by Neutral Hostile Dies
Actions:
-----Gold-----
If - Conditions:
If random integer number between 1 and 100 greater than or equal to 80
Then - Actions:
For each Integer A from 1 to 55, do if unit-type of dying unit equal to lv01_02Monsters[Interger A] then do item - create 50 gold coins at position of dying unit else do nothing.

This repeats for other level monsters.

-----Normal Items-----
If - Conditions
If random integer number between 1 and 100 greater than or equal to 85
Then - Actions:
-----Melee-----
For each Integer A from 1 to 14, do if unit-type of dying unit equal to lv01_02Monsters[Interger A] then do item - create items_lv01 (random interger between 1 and 2) at position of dying unit else do nothing.
-----Ranged-----
For each Integer A from 15 to 21, do if unit-type of dying unit equal to lv01_02Monsters[Interger A] then do item - create items_lv01 (random interger between 3 and 4) at position of dying unit else do nothing.
-----Magic-----
For each Integer A from 22 to 27, do if unit-type of dying unit equal to lv01_02Monsters[Interger A] then do item - create items_lv01 (random interger between 5 and 6) at position of dying unit else do nothing.

This repeats for other level monsters as well.

-----Enhanced Items-----
If - Conditions
If random integer number between 1 and 100 greater than or equal to 89
Then - Actions:
For each Integer A from 1 to 73, do if unit-type of dying unit equal to lv03_04Monsters[Interger A] then do item - create items_AllEnhanced (random interger between 1 and 7) at position of dying unit else do nothing.

OK, what this does is give a drop ratio of:

15% Chance to get a Normal type item. [Text Color: White]
11% Chance to get a Enhanced type item. [Text Color: Green]
07% Chance to get a Rare item. [Text Color: Yellow]
03% Chance to get a Unique item. [Text Color: Brown]

The system works flawlessly, the only thing I don't like is, if you kill one monster, you have a chance to get all 3 items.

How do I make it so that this is all combined down into one trigger, so then, you only have a chance to get one item instead of a chance to get 3.

I initially thought of doing an "and" trigger, but I don't think that would work, due to wouldn't it pick a new number between 1 and 100 for each condtion?

Any help would be greatly appriciated
04-09-2005, 04:14 PM#2
Zero
Ok, I figured it out. I basically put a interger variable and used that. Disregard this thread :P
04-09-2005, 04:59 PM#3
johnfn
I dont see why you people dont use item drop tables.
04-09-2005, 05:01 PM#4
Raptor--
Quote:
Originally Posted by johnfn
I dont see why you people dont use item drop tables.

i don't cause then i have infinitely more control over it... such as running triggers on the items to set up their states as they are created which i have to do on my map
04-09-2005, 05:49 PM#5
johnfn
That is an excellent point but for something like this its rather basic and doesnt need that much extended functionality.
04-09-2005, 09:37 PM#6
Raptor--
Quote:
Originally Posted by johnfn
That is an excellent point but for something like this its rather basic and doesnt need that much extended functionality.

well, u never know, maybe he'll want to expand its functionality in the future :p
04-09-2005, 11:04 PM#7
Vexorian
Probably because the creeps are created with triggers. Though in that case it would be better to use the native item pools interface
04-10-2005, 07:40 AM#8
Zero
ok.. Having some more issues with the drop system. I changed it the trigger so it looks like this:

Same as above trigger with these changes:

Actions:
Set Loot (variable) to random number between 1-100

Then I set up the if triggers like this:

If loot is greater than or equal to 80 and if loot is less than or equal to 84
then drop items.

Well, this obviously is done wrong, seeing as how that only gives a 5% chance to get that item..

This is the ratio I am trying to use:

20% Chance to get Gold.
15% Chance to get a Normal type item. [Text Color: White]
11% Chance to get a Enhanced type item. [Text Color: Green]
07% Chance to get a Rare item. [Text Color: Yellow]
03% Chance to get a Unique item. [Text Color: Brown]

I did the other triggers like this:

If loot is greater than or equal to 85 and if loot is less than or equal to 88
then drop items.

If loot is greater than or equal to 89 and if loot is less than or equal to 92
then drop items.

If loot is greater than or equal to 93 and if loot is less than or equal to 96
then drop items.

If loot is greater than or equal to 97 and if loot is less than or equal to 100
then drop items.

It looks like it would work right, but it dosen't seem to be firing right.

Anyone know what's goin on?
04-10-2005, 11:51 AM#9
Zero
God, I am retarded. Ok, I changed it so the numbers are like:

20% chance - so do greater than or equal to 80 and less than or equal to 100
15% chance - so do greater than or equal to 65 and less than or equal to 79
11% chance - so do greater than or equal to 54 and less than or equal to 64
07% chance - so do greater than or equal to 47 and less than or equal to 53
03% chance - so do greater than or equal to 44 and less than or equal to 46

It seems to be working flawlessly now :)