Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2009, 12:20 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

Let me see if I understand this. A character dies, the item does correctly go to thier corpse with the correct charges, but a duplicate item with no charges stays with them including items normally with unlimited charges but they can loot multiple dupes off the corpse because '...do not delete off of player corpses'?

Can you tell me which item this is or is it any item with charges? I'll change my server rules to have corpses with items and check it out.
Reply With Quote
  #2  
Old 01-13-2009, 12:30 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

That's correct. It's only been proven using items with unlimited charges. However, I would assume limited charged items also suffer from the same bug. Here are the items that were used:

http://lucy.allakhazam.com/item.html?id=26606
http://lucy.allakhazam.com/item.html?id=1113
http://lucy.allakhazam.com/item.html?id=28994
Reply With Quote
  #3  
Old 01-13-2009, 01:28 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

OK, I just tried it out and here is what I came up with:

I died with Aegis of Life (1 charge) being the only worn clicky item in my possession. I used the charge. When I zoned back in, the item was missing from my inventory, however the item on the corpse had gotten its charge back.

I died with Talisman of the Burrower (unlimited charges) being the only worn clicky item in my possession. When I zoned back in, the item was both in my inventory and my corpse (duplicated.) However, both items worked normally, so at least that part of the above report was incorrect.

I died with Aegis of Life (1 charge) and Talisman of the Burrower (unlimited charges) being the only worn clicky items in my possession. I used the charge on Aegis. When I zoned back in, BOTH items were duplicated on my corpse and inventory. Aegis of Life in my inventory still showed as the charge being used, however the one on the corpse once again had the charge replenished.

I hope this helps some!

Also, the Wee Harvester http://lucy.allakhazam.com/item.html?id=13980 is an example of a worn clicky with 20 charges that still deletes when the last charge is used, I remember from Live it should not do so.
Reply With Quote
  #4  
Old 01-15-2009, 10:11 AM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

here's the fix for the charged item duping:

in PlayerCorpse.cpp find method: void Corpse::MoveItemToCorpse(Client *client, ItemInst *item, sint16 equipslot)
then find:
Code:
client->DeleteItemInInventory(interior_slot, interior_item->GetCharges(), false);
and delete the last 2 args so it looks like:
Code:
client->DeleteItemInInventory(interior_slot);
and the same for the one a couple of lines below it find:
Code:
client->DeleteItemInInventory(equipslot, item->GetCharges(), false);
change to:
Code:
client->DeleteItemInInventory(equipslot);
Reply With Quote
  #5  
Old 01-16-2009, 12:24 AM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

I tested the recent changes briefly on my test server and all looked well. It'll go Live on PEQ with the reboot in the morning. Thanks for perfecting this! If all goes well tomorrow, might as well commit to SVN.
Reply With Quote
  #6  
Old 01-16-2009, 01:21 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

This fixes the Wee Harvester from poofing when the last charge is used:
Inventory.cpp find method: void Client::DeleteItemInInventory(sint16 slot_id, sint8 quantity, bool client_update) then find:
Code:
	if(m_inv[slot_id]->GetItem()->Click.Type == ET_EquipClick) {
and replace with:
Code:
	if((m_inv[slot_id]->GetItem()->Click.Type == ET_EquipClick) || (m_inv[slot_id]->IsWeapon())) {

and this fixes the items that are getting recharged when looting from your corpse:
PlayerCorpse.cpp find method: void Corpse::LootItem(Client* client, const EQApplicationPacket* app) then find:
Code:
		if(inst->IsStackable()) {
			if(item_data) 
				//Restore charges from the original item.
				inst->SetCharges(item_data->charges);
			else
				inst->SetCharges(1);
		} else {
			//default changes
			if(item->MaxCharges == -1)
				inst->SetCharges(1);
			else
				inst->SetCharges(item->MaxCharges);
		}
and replace with:
Code:
		if(inst->IsStackable()) {
			if(item_data) 
				//Restore charges from the original item.
				inst->SetCharges(item_data->charges);
			else
				inst->SetCharges(1);
		} else {
			//default changes
			if(item->MaxCharges == -1)
				inst->SetCharges(1);
			else {
				if(item_data) {
					//Restore charges from the original item.
					inst->SetCharges(item_data->charges);
				}
				else {
					inst->SetCharges(item->MaxCharges);
				}
			}
		}
Reply With Quote
  #7  
Old 01-19-2009, 12:31 AM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

This has been on PEQ for a bit now with no ill effects reported. It works like a charm. I say commit it.
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:57 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