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

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

Reply
 
Thread Tools Display Modes
  #1  
Old 02-07-2015, 11:09 PM
vacare
Fire Beetle
 
Join Date: Jan 2015
Posts: 20
Default Loot drop modifications

Hello,

So I am playing around with various settings, and I've bumped into the first one that has stumped me. It is the loottable/lootdrop system. (Using Cavemandude's 8-15-14 PEQ files and the EqEmu source from about a week ago)

Just for some background, I have read this (which seems to be the most recent forum update on the topic) thread:

http://www.eqemulator.org/forums/showthread.php?t=35770

And I have read the EqEmu/Server source code in loottables.cpp

However, when I change the values, the loot doesn't behave as I would expect, given the code and the description. I will use an example to illustrate what I'm doing, and what I expect, to hopefully make it easier for someone to tell me what I'm doing wrong:

Let's take the "a_large_skeleton" spawns in "najena" zone. They conveniently spawn right inside the front door, and they conveniently all use the same loottable, id=10813.

Now, I have tried many approaches, but the one that I am using now has modified loottable 10813 to have a droplimit=0, mindrop=0, multiplier=1, and probability=100 for all three entries.

Inside the AddLootTableToNPC method:

Code:
	for (uint32 i=0; i<lts->NumEntries; i++) {
		for (uint32 k = 1; k <= lts->Entries[i].multiplier; k++) {
			uint8 droplimit = lts->Entries[i].droplimit;
			uint8 mindrop = lts->Entries[i].mindrop;

			//LootTable Entry probability
			float ltchance = 0.0f;
			ltchance = lts->Entries[i].probability;

			float drop_chance = 0.0f;
			if(ltchance > 0.0 && ltchance < 100.0) {
				drop_chance = (float)zone->random.Real(0.0, 100.0);
			}

			if (ltchance != 0.0 && (ltchance == 100.0 || drop_chance <= ltchance)) {
				AddLootDropToNPC(npc, lts->Entries[i].lootdrop_id, itemlist, droplimit, mindrop);
			}
		}
	}
It looks like every lootdrop entry in the loottable_entries should get added, since every ltchance will be equal to 100 (probability column), and we'll pass a 0 for both droplimit and mindrop to AddLootDropToNPC.

So now let's look at my lootdrop values. Loottable 10813 has three lootdrop entries: 17698, 150473, and 150474.

I have set all (57) of those lootdrop entries to have an itemcharges=1, chance=100, disabled_chance=0, minlevel=0, maxlevel=127, and multiplier=1 values.

Now, taking that inside AddLootDdropToNPC, I would expect this loop to be hit since droplimit and mindrop are both set to 0 for all entries:

Code:
	if(droplimit == 0 && mindrop == 0) {
		for(uint32 i = 0; i < lds->NumEntries; ++i) {
			int charges = lds->Entries[i].multiplier;
			for(int j = 0; j < charges; ++j) {
				if(zone->random.Real(0.0, 100.0) <= lds->Entries[i].chance) {
					const Item_Struct* dbitem = GetItem(lds->Entries[i].item_id);
					npc->AddLootDrop(dbitem, itemlist, lds->Entries[i].item_charges, lds->Entries[i].minlevel, 
									lds->Entries[i].maxlevel, lds->Entries[i].equip_item > 0 ? true : false, false);
				}
			}
		}
		return;
	}
So this looks like it should loop through every item in the loopdrop entry, and have a 100% chance (since all chance values are 100) to add 1 (the charges) of that item to the NPC's item list (inside AddLootDrop).

But when I stop and restart the world and eqlaunch, log into Najena, and kill a large skeleton, I am getting fairly normal looking drops - for example, sometimes they drop nothing, usually they drop only one thing.

What I would expect, given these values and the code, would be to have 57 items on the skeleton (equal to the number of items on the lootdrop entries) when it dies.

Can someone tell me what I am missing?

Thanks for any help!
Reply With Quote
  #2  
Old 02-07-2015, 11:28 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Did you re-run shared_mem.exe?
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #3  
Old 02-07-2015, 11:41 PM
vacare
Fire Beetle
 
Join Date: Jan 2015
Posts: 20
Default

I had not! I knew it was likely a cache issue, but I wasn't sure where the cache was or how to reset it! I now remember shared_memory.exe ... thank you so much! That did the trick, and now it works like a charm!

And let me just say, you people reading the support forums are awesome

Thanks again!
Reply With Quote
Reply


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 09:18 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3