• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Box Opening bug fix

Status
Not open for further replies.

Tok124

Respected Member
Hello, Im working as a developer for a server and there is a bug that i cannot fix. Its about and item that is a box
ayn31u.png


So, As you see in the image. The box have stack of 5000. If i right click that box i open all boxes in 1 click but i only get the loot from 1 of the boxes. I know that a simple fix would be to make the item to not stack. But you get maybe 100 boxes from and instance and if you run instance a few times you have almost 1000 boxes and there is not enough bag space for that.

So, We need a way to make it so when you right click item all boxes open and you get loot from all boxes

or to make it so when you right click only 1 box will be opened.

The source is NOT up to date. its an old source.

Anyway. We can pay for a fix because this is a really big problem on the server and it needs to be fixed asap

PS.
Hmm, Maybe i should just "Try" to do a google search next time before posting ^^ I found a fix but im not sure if it will work with our core revision so i let you guys know if it works or not
 
Last edited:

Tommy

Founder
Every "open by right click" item I've seen doesn't stack, therefore if you stack multiple ones it'll open just one of them - since to my knowledge it isn't coded like that. Who knows, I don't remember every lootable item. If you find one that stacks I'd recommend copying it, but as I said I don't think making them stack will work like that.

Why is the drop rate for those boxes so high? Yes, a simple fix would to make them not stack, but that is pointless since if the item drops so many items per kill. Why not lower the drop rate and make them not stack? I'd think for a legendary item it shouldn't be looted every second.
 

Tok124

Respected Member
Every "open by right click" item I've seen doesn't stack, therefore if you stack multiple ones it'll open just one of them - since to my knowledge it isn't coded like that. Who knows, I don't remember every lootable item. If you find one that stacks I'd recommend copying it, but as I said I don't think making them stack will work like that.

Why is the drop rate for those boxes so high? Yes, a simple fix would to make them not stack, but that is pointless since if the item drops so many items per kill. Why not lower the drop rate and make them not stack? I'd think for a legendary item it shouldn't be looted every second.

Yeah, I know. In retail the boxes do never stack. And i dont know why so many boxes drop in instances. The server is made like that and it was not made by me. I just joined them as dev :p But i have seen servers with working box opening in stacks before so i just know its possible. I found a fix for it but im not sure if it will work so right now im just waiting for the owner to come online so we can test. But i let you know if it works or not. And if it does work i post the fix for it to help the others :)
 

EmuNoob

Exalted Member
In Loothandler.cpp look for
void WorldSession::DoLootRelease(ObjectGuid lguid)

later in it find
else
{
// Only delete item if no loot or money (unlooted loot is saved to db) or if it isn't an openable item
if (pItem->loot.isLooted() || !(proto->Flags & ITEM_PROTO_FLAG_OPENABLE))
player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true);
}

and replace with

else
{
pItem->m_lootGenerated = false;
pItem->loot.clear();

uint32 count = pItem->GetCount();
if (count > 1)
count = 1;
//Only delete item if no loot or money (unlooted loot is saved to db) or if it isn't an openable item
if (pItem->loot.isLooted() || !(proto->Flags & ITEM_PROTO_FLAG_OPENABLE))
player->DestroyItemCount(pItem, count, true);
//player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true);
}

Tested and working, not my edit tho
 

Tok124

Respected Member
In Loothandler.cpp look for


later in it find


and replace with



Tested and working, not my edit tho

Yeah. Thanks. Thats the fix i found (made by sofos2 on another forum) but it has not been tested yet. As i said in the main post the source is very old and i dont know if it will work with our revision so we will try when the owner come online
 

Marko

Enthusiast
i would just remake entire instance and content :p it's not so hard to change quests, instances, items, why bother so much with something buggy?
 

Tok124

Respected Member
Alright. We have checked loothandler.cpp now and its not the same as in the guide so i dont know how i should edit that

i think its on line number 384. But it doesnt look same and i dont think it will work so the piece of code that we have from the guide needs to be edited i think
 
Last edited:

sofos

Emulation Addict
I specifically wrote that scipt for your server, since i was a player at the time and gave it to the owner. For some reason it has not been implemented yet, i presume there is a problem. If so please tell me and i will change it or make new one depending on what you want, and post it here.
 

Tok124

Respected Member
I specifically wrote that scipt for your server, since i was a player at the time and gave it to the owner. For some reason it has not been implemented yet, i presume there is a problem. If so please tell me and i will change it or make new one depending on what you want, and post it here.

Hi Sofos. Sorry for a very late reply. Im pretty sure your script works fine for updated cores but our core was many years old. So we needed to do some modifications to it. I got help from treetree on another forum.

So yes this bug has been solved and the thread can be closed

if anyone else use same revision as us you can use the script here
http://pastebin.com/N8VpzH8C
 
Status
Not open for further replies.
Top