Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-04-2011, 03:26 PM
Wolfling
Fire Beetle
 
Join Date: Sep 2010
Posts: 21
Default

1. 2885
50 means its a 50% chance it will be picked, if it does, then it looks in the loot entries which on mine has a 5or6% chance to drop one of the rusty weapons,

90097 is 100, so will always get selected, and one of the two rings will get selected, as they are set 50/50 - so you will always get one of them
if you changes the multiplier to 2, then you always get 2 rings

2. you could, just give it low odds, 5% probability of being picked 5% chance of dropping the item ( that isn't the math, play around with it )

3. as explained above, and no, chance dosn't have to =100 that is why sometimes you will get nothing from that loot entry
Reply With Quote
  #2  
Old 06-06-2011, 05:22 AM
Zothen
Hill Giant
 
Join Date: Apr 2011
Location: Germany
Posts: 163
Default

Thank you very much!
Reply With Quote
  #3  
Old 06-06-2011, 06:21 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Maybe I am misunderstanding the explanation above, but this is how it works:

The chance field of the lootdrop_entries table does not have to equal 100. No matter what the total is for all entries in that lootdrop_id, the chance is basically a percentage of the total of the entries.

Here are some examples:

1. If there is only 1 lootdrop entry, the chance is 100% no matter if you set it to 1 or to 100.

2. If there are 3 loot drop entries that you want to all have equal drop chances, you can set each to 33, or you can set each to 100 or any other equal value and the chance will be divided equally.

3. If you have 3 entries and 1 is 100 and the other 2 are 50, then 1 of them will have 50% chance while the other 2 have 25% chance each.

Basically, it just totals up the chances and randoms and sees if the random outcome is less than the chance of the entry it is checking.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 06-06-2011, 10:34 AM
Zothen
Hill Giant
 
Join Date: Apr 2011
Location: Germany
Posts: 163
Default

And the chance column works the same way as the probability column?

If thats really the way it works, then do I really always get 2 items of one lootdrop when the multiplier is set to 2? Wouldnt it be more random if I can get 0-2 items of a lootdrop, setting the multplier to 2 and the lootdrop entries to a max total chance of 50? Or is THAT handled with probability?
Reply With Quote
  #5  
Old 06-06-2011, 10:46 AM
image
Demi-God
 
Join Date: Jan 2002
Posts: 1,290
Default

for (int32 i=0; i<lts->NumEntries; i++) {
for (int32 k = 1; k <= lts->Entries[i].multiplier; k++) {
if ( MakeRandomInt(0,99) < lts->Entries[i].probability) {
AddLootDropToNPC(npc,lts->Entries[i].lootdrop_id, itemlist);
}
}

pretty much:
- For each lootdrop entry that exists on the mob we iterate (tied to whatever x loottable).
- Then inside each lootdrop, we iterate x times (multiplier).
- Inside the nested for loop we use a random 0-99, if the value is less than the probability you set, we attempt to spawn an item from that lootdrop.

In AddLootDropToNPC (determine the actual item):
- We add up the all the 'chance' values into totalchance (of each item in lootdrop_entries).
- To hit a good chance (its a RandomInt 0-totalchance). The random value must be chance=0 OR chance=100 OR this is the only item in the table (totalchance=itemchance) OR finally the random value is less than the current item chance. The first item that hits one of these conditions is your result. These should order as they are in the DB (so the first lootdrop_entries entry for this lootdrop in the db is the first item entry we check).
__________________
www.eq2emu.com
EQ2Emu Developer
Former EQEMu Developer / GuildWars / Zek Seasons Servers
Member of the "I hate devn00b" club.
Reply With Quote
  #6  
Old 06-06-2011, 11:11 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Yeah, that explanation pretty much covers it all. The only correction I would make is about this:

Quote:
Originally Posted by image View Post
These should order as they are in the DB (so the first lootdrop_entries entry for this lootdrop in the db is the first item entry we check).
To help decrease favoritism for items earlier in the DB order, we instead pick a random point in the total list to start at and then iterate until we get a successful roll. So, if we have 10 items in the same lootdrop_id, we would random 1 to 10 and (or 0 to 9 whatever) and start at the random spot that was picked, then continue to the next and so on.

On the question of multiple drops; that is set in the lootable_entries table with the multiplier and probability fields. So, if you want 0 to 2 possible drops from your lootdrop_id, you can set the multiplier to 2, then the probability to anything from 1 to 99 depending on how often you want 1 or 2 to drop. The multiplier is the max possible items from the lootdrop_id that can be dropped, and the probability is the chance for each multiplier to drop. If you set the multiplier to 10 and the probability to 10%, you would probably average about 1 drop per kill (in theory anyway), but could be anywhere from 0 to 10 at any time.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 06-06-2011 at 11:18 PM..
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:51 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3