Black Wolfs Den
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Keywords

eluna  

Latest topics
» Were Back Baby \o/
TrinityCore 2 Gold Max Work-Around Icon_minitime1Fri Nov 15, 2019 8:00 pm by Grumbo

» TrinityCore 2 Gold Max Work-Around
TrinityCore 2 Gold Max Work-Around Icon_minitime1Tue Mar 21, 2017 9:14 pm by Grumbo

» [CPP][Conv] Dedicated World Chat Channel
TrinityCore 2 Gold Max Work-Around Icon_minitime1Tue Mar 21, 2017 8:56 pm by Grumbo

» Cool [CPP] Grumbo'z VIP System
TrinityCore 2 Gold Max Work-Around Icon_minitime1Tue Mar 21, 2017 8:03 pm by Grumbo

» [CPP] EmuDevs Premium System
TrinityCore 2 Gold Max Work-Around Icon_minitime1Tue Mar 21, 2017 7:18 pm by Grumbo

» [TC]255 server stats edit! By Frost - Thanx
TrinityCore 2 Gold Max Work-Around Icon_minitime1Tue Mar 21, 2017 6:27 pm by Grumbo

» [Eluna] Grumbo`z VIP System
TrinityCore 2 Gold Max Work-Around Icon_minitime1Tue Mar 21, 2017 6:20 pm by Grumbo

» [CPP] Grumbo'z Capture the Flag System
TrinityCore 2 Gold Max Work-Around Icon_minitime1Tue Mar 21, 2017 5:14 pm by Grumbo

» Black Wolfs Den
TrinityCore 2 Gold Max Work-Around Icon_minitime1Mon Mar 20, 2017 10:07 pm by Grumbo

March 2024
MonTueWedThuFriSatSun
    123
45678910
11121314151617
18192021222324
25262728293031

Calendar Calendar

Affiliates

free forum

Forumotion on Facebook Forumotion on Twitter Forumotion on YouTube Forumotion on Google+

Similar topics

    TrinityCore 2 Gold Max Work-Around

    Go down

    TrinityCore 2 Gold Max Work-Around Empty TrinityCore 2 Gold Max Work-Around

    Post by Grumbo Tue Mar 21, 2017 9:14 pm

    How to Bypass the gold cap. TrinityCore2 with Boost
    thanks to all those who posted the fix as the core changes @AlexeWarr , @darksoke and more , this is just another update to the work-a-round for players gold cap. this is just a more in-depth work-around with help from @Rochet2 .

    go to \src\server\game\Entities\Player and open player.cpp.
    search for this block around line 22744 :



    Code:
    bool Player::ModifyMoney(int32 amount, bool sendError /*= true*/)
    {
        if (!amount)
            return true;

         sScriptMgr->OnPlayerMoneyChanged(this, amount);

        if (amount < 0)
            SetMoney (GetMoney() > uint32(-amount) ? GetMoney() + amount : 0);
        else
        {
            if (GetMoney() < MAX_MONEY_AMOUNT - static_cast<uint32>(amount))
                SetMoney(GetMoney() + amount);
            else
            {
                sScriptMgr->OnPlayerMoneyLimit(this, amount);

                if (sendError)

                    SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, NULL
               return false;
            }
        }

        return true;
    }


    go to 'if (sendError)' 

    and remove these 3 consecutive lines:




    Code:
               sScriptMgr->OnPlayerMoneyLimit(this, amount);

                if (sendError)

                    SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, NULL
               return false;






    and add these lines within the `{}` brackets:



    Code:
                static const uint32 item_ID = ITEM_SQL_ID; // the id of your item worth 50k gold buy/sell
                const ItemTemplate* currency = sObjectMgr->GetItemTemplate(item_ID);

                        if(!currency)
                            {
                                sScriptMgr->OnPlayerMoneyLimit(this, amount);

                                    if (sendError)
                                        SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, NULL);
                                    return false;
                            }

                        uint16 Pamount = (GetMoney() / 500000000); // int16 since the answer shouldnt be large or somethings wrong
                        uint16 Namount = (amount / 500000000);
                        uint16 Icount = Pamount + Namount;
                        uint64 Ptotal = GetMoney() + amount;

                        if(!AddItem(item_ID,  Icount))
                            return false;

                        SetMoney(Ptotal - (Icount * 500000000));
                        ChatHandler(GetSession()).PSendSysMessage("|cFFFFCC00You have reached the gold limit and have been compensated with %u Gold Bar's|r!", Icount);
                        return true;



    the block should look like this now:



    Code:
    bool Player::ModifyMoney(int32 amount, bool sendError /*= true*/)
    {
        if (!amount)
            return true;

         sScriptMgr->OnPlayerMoneyChanged(this, amount);

        if (amount < 0)
            SetMoney (GetMoney() > uint32(-amount) ? GetMoney() + amount : 0);
        else
        {
            if (GetMoney() < MAX_MONEY_AMOUNT - static_cast<uint32>(amount))
                SetMoney(GetMoney() + amount);
            else
            {
                static const uint32 item_ID = ITEM_SQL_ID; // the id of your item worth 50k gold buy/sell
                const ItemTemplate* currency = sObjectMgr->GetItemTemplate(item_ID);

                        if(!currency)
                            {
                                sScriptMgr->OnPlayerMoneyLimit(this, amount);

                                    if (sendError)
                                        SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, NULL);
                                    return false;
                            }

                        uint16 Pamount = (GetMoney() / 500000000); // int16 since the answer shouldnt be large or somethings wrong
                        uint16 Namount = (amount / 500000000);
                        uint16 Icount = Pamount + Namount;
                        uint64 Ptotal = GetMoney() + amount;

                        if(!AddItem(item_ID,  Icount))
                            return false;

                        SetMoney(Ptotal - (Icount * 500000000));
                        ChatHandler(GetSession()).PSendSysMessage("|cFFFFCC00You have reached the gold limit and have been compensated with %u Gold Bar's|r!", Icount);
                        return true;
            }
        }

        return true;
    }


    edit item_ID to the sql id of an item you chose with a buy/sell value of 50k gold (500000000)
    basically when a player loots or receives gold that max's there amount, this will remove 200k gold and give 4 items worth 50k gold each allowing the gold/silver/copper currently attempting to add to be added.
    this award for amounts over 50k gold for players current gold count and reward for players amounts over 50k gold of current loot.
    should work as a good catch-22
    Grumbo
    Grumbo
    Admin
    Admin

    Posts : 95
    Points : 234
    Join date : 2014-08-21
    Location : Pocatello Idaho

    http://blackwolfsden.dnsdynamic.net/

    Back to top Go down

    Back to top

    - Similar topics

     
    Permissions in this forum:
    You cannot reply to topics in this forum