Fixing stackable item container bug menu

User Tag List

Results 1 to 2 of 2
  1. #1
    sofos2's Avatar Private
    Reputation
    11
    Join Date
    Jan 2015
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Fixing stackable item container bug

    What is this bug?
    Well basically if you have an item container such as a box of supplies or any other stackable item container for that matter, and you edit your database to make it stackable, a bug occurs.

    For the sake of the guide i will be calling item container -> box

    So when you stack a box in your bag and try to open it you will see that you only receive the contents of 1 box rather than the number of boxes you had stacked.

    How to fix it

    Basically find loothandler.cpp in Trinitycore/src/server/game/Handlers/loothandler.cpp and open it up with a text editor and find the method:
    Code:
    void WorldSession::DoLootRelease(ObjectGuid lguid)
    below this at the end of the method there is:
    Code:
    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);
    }
    Now change the above with:
    Code:
    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);
    }
    Explanation
    Code:
    pItem->m_lootGenerated = false;
    Sets the bool loot generated to false meaning that once you have opened one box it will not stop generating loot for the rest of the boxes in the stack.
    Code:
    uint32 count = pItem->GetCount();
    This saves how many boxes in variable count, followed by this we check to see if count is > 1 if it is we set it to 1 then after the next if condition is satisfied and we have looted it we then do this:
    Code:
    player->DestroyItemCount(pItem, count, true);
    In order to delete only the amount of boxes that count specifies, so only 1 instead of deleting the whole stack which is what happend in the commented out method.

    Recompile for changes to take effect and you're done.

    NOTE: I have only tested this briefly so please if you encounter a problem dont hesitate to reply, i will try and help.
    Last edited by sofos2; 01-11-2015 at 01:32 PM.

    Fixing stackable item container bug
  2. #2
    sofos2's Avatar Private
    Reputation
    11
    Join Date
    Jan 2015
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Btw dont spam the shit out of the boxes without expecting to miss a few. I tried spamming really fast and missed around 1 out of 10

Similar Threads

  1. Is there a way to dupe stackable Items??
    By MisterEMU in forum WoW EMU Exploits & Bugs
    Replies: 4
    Last Post: 04-01-2008, 09:10 PM
  2. [Request] How to fix hunter att. range bug?
    By sonnyd666 in forum WoW EMU Exploits & Bugs
    Replies: 2
    Last Post: 03-27-2008, 08:15 AM
  3. How can i fix the infamus Graveyard bug ?
    By Wheeze201 in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 03-15-2008, 05:10 PM
  4. item destroy bug
    By Ubercatch22 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 12-02-2007, 11:07 PM
  5. [FIX] Tier Item Vendors
    By cylas in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 11-19-2007, 05:16 AM
All times are GMT -5. The time now is 12:12 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search