View Single Post
  #1  
Old 12-02-2008, 02:21 PM
cybernine186
Sarnak
 
Join Date: Feb 2008
Posts: 87
Default

Well your wish is my command......Here is the code that keeps items from duping when looting a corpse.

What happens is when a player goes to loot there corpse they right click really fast on each item, if they do it fast enough the item in the 8th inventory slot in the 8th bag slot will duplicate. Once it does they quit looting the corpse and transfer that item off there character to someone else and then continue looting there corpse.

PlayerCorpse.cpp

place the code some where around line 887
Code:
	// Prevent Item Duplication When Looting Corpse
	if (((item_data->equipSlot >= 251) && (item_data->equipSlot <= 330)) && ((charid == client->CharacterID()) && (IsPlayerCorpse()))) {
		char* itemdupemsg = NULL;
		sprintf(itemdupemsg, "Loot Item Duplication {%i}", item);
		database.SetMQDetectionFlag(client->AccountName(), client->GetName(), itemdupemsg, zone->GetShortName());
		return ;
	}

Place the code above right before this code
Code:
	if (item != 0)
	{
		if(item_data)
			inst = database.CreateItem(item, item_data?item_data->charges:0, item_data->aug1, item_data->aug2, item_data->aug3, item_data->aug4, item_data->aug5);
		else
			inst = database.CreateItem(item);

		if(inst->IsStackable()) {
			if(item_data) 
				//Restore charges from the original item.
				inst->SetCharges(item_data->charges);
			else
				inst->SetCharges(1);
		} else {
Reply With Quote