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

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 12-19-2011, 05:15 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I think it depends on how you set that up exactly. If all of the defiant gear is in the same loot drop entry, and you have that set to 1%, then the total chance for any defiant piece to drop will be 1%. If you have multiple loot drop ids you are using in the same loot table and each set to 1%, then the total chance for a defiant to drop will be 1 X the number of loot drop ids you have in the loot table.

As far as chance for individual pieces in the same loot drop id goes, the total chance is always 100% no matter how many items there are or what chance you set for them. You could set 3 items all to 100% each and that would give each one a 33.3% chance to drop. You could also set those 3 items to 1% chance each and they would all still have a 33.3% chance to drop. Another example is if you had 3 items and they were set with 10, 15, and 25 chance each. Since the total for them is 50, they would then have 20, 30, and 50 chance to drop respectively.

Basically, it totals up the chances you set it randoms between 0 and the total chance for all items in that loot drop id. If the random is below the chance set for the item being rolled on, then that is added to the loot table and it stops looping to check the other items unless the multiplier is more than 1.

Here is the code from loottables.cpp that deals with adding loot to loot tables:
Code:
        //non-pool based looting

        int32 r;
        int32 totalchance = 0;
        for (r = 0; r < lds->NumEntries; r++) {
                totalchance += lds->Entries[r].chance;
        }
        uint32 thischance = 0;
        unsigned short k;
        bool found = false;

        k = MakeRandomInt(0, lds->NumEntries-1);

        while(!found) {

                if (k > (lds->NumEntries - 1)) {
                        k = 0;
                }

                thischance = lds->Entries[k].chance;
                unsigned int drop_chance = MakeRandomInt(0, totalchance-1);
#if EQDEBUG>=11
                        LogFile->write(EQEMuLog::Debug, "Drop chance for npc: %s, total chance:%i this chance:%i, drop roll:%i", npc->GetName(), totalchance, thischance, drop_chance);
#endif
                if (   totalchance == 0
                        || thischance == 100
                        || thischance == totalchance // only droppable item in loot table
                        || drop_chance < thischance     //can never be true if thischance is 0
                        ) {
                        found = true;
                        int32 itemid = lds->Entries[k].item_id;

                        const Item_Struct* dbitem = GetItem(itemid);
                        npc->AddLootDrop(dbitem, itemlist, lds->Entries[k].item_charges, lds->Entries[k].equip_item, false);

                        break;
                        //continue;
                }       //end if it will drop
                k++;    //Cycle to the next droppable item in the list
        }
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
 


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 07:53 PM.


 

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