Metin2 Systems [C++] Drop Yang directly into Inventory

Collect all yang in inventory automatically, without having a "third hand".
Yang will no longer drop on the ground.

It is a very good QoL update, as players no longer have to spam the pickup button.

You will also get rid of lag, as yang will no longer drop on the ground.
:)


*Download link / Code:

Search in char_battle.cpp :
Code:
void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
{

Below you will find this part of the code:

Code:
    if (GetMobRank() >= MOB_RANK_BOSS && !IsStone() && GetMobTable().dwGoldMax != 0)
    {
        if (1 == number(1, iGold10DropPct))
            iGoldMultipler *= 10;

        int iSplitCount = number(25, 35);

        for (int i = 0; i < iSplitCount; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;
            if (test_server)
                sys_log(0, "iGold %d", iGold);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
                continue;


{...}{...}{...}
{...}{...}{...}
{...}{...}{...}
{...}{...}{...}

    DBManager::instance().SendMoneyLog(MONEY_LOG_MONSTER, GetRaceNum(), iTotalGold);
}
Replace with:
Code:
    if (GetMobRank() >= MOB_RANK_BOSS && !IsStone() && GetMobTable().dwGoldMax != 0)
    {
        if (1 == number(1, iGold10DropPct))
            iGoldMultipler *= 10;

        int iSplitCount = number(25, 35);
        int iTotalGoldAmount = 0;

        for (int i = 1; i <= iSplitCount; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
                continue;

            iTotalGoldAmount += iGold;
        }

        if (iTotalGoldAmount > 0)
        {
            pkAttacker->GiveGold(iTotalGoldAmount);
            iTotalGold += iTotalGoldAmount;
        }
    }
    else if (1 == number(1, iGold10DropPct))
    {
        int iTotalGoldAmount = 0;

        for (int i = 0; i < 10; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
                continue;

            iTotalGoldAmount += iGold;
        }

        if (iTotalGoldAmount > 0)
        {
            pkAttacker->GiveGold(iTotalGoldAmount);
            iTotalGold += iTotalGoldAmount;
        }
    }
    else
    {
        int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
        iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
        iGold *= iGoldMultipler;

        int iSplitCount;

        if (iGold >= 3)
            iSplitCount = number(1, 3);
        else if (GetMobRank() >= MOB_RANK_BOSS)
        {
            iSplitCount = number(3, 10);

            if ((iGold / iSplitCount) == 0)
                iSplitCount = 1;
        }
        else
            iSplitCount = 1;

        if (iGold != 0)
        {
            pkAttacker->GiveGold(iGold);
            iTotalGold += iGold;
        }
    }

    DBManager::instance().SendMoneyLog(MONEY_LOG_MONSTER, GetRaceNum(), iTotalGold);
}
 

Funky Robot

New member
Funkymmo Bot
Joined
Jan 14, 2025
Messages
510
Reaction score
3
Points
1
Collect all yang in inventory automatically, without having a "third hand".
Yang will no longer drop on the ground.

It is a very good QoL update, as players no longer have to spam the pickup button.

You will also get rid of lag, as yang will no longer drop on the ground.
:)


*Download link / Code:

Search in char_battle.cpp :
Code:
void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
{

Below you will find this part of the code:

Code:
    if (GetMobRank() >= MOB_RANK_BOSS && !IsStone() && GetMobTable().dwGoldMax != 0)
    {
        if (1 == number(1, iGold10DropPct))
            iGoldMultipler *= 10;

        int iSplitCount = number(25, 35);

        for (int i = 0; i < iSplitCount; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;
            if (test_server)
                sys_log(0, "iGold %d", iGold);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
                continue;


{...}{...}{...}
{...}{...}{...}
{...}{...}{...}
{...}{...}{...}

    DBManager::instance().SendMoneyLog(MONEY_LOG_MONSTER, GetRaceNum(), iTotalGold);
}
Replace with:
Code:
    if (GetMobRank() >= MOB_RANK_BOSS && !IsStone() && GetMobTable().dwGoldMax != 0)
    {
        if (1 == number(1, iGold10DropPct))
            iGoldMultipler *= 10;

        int iSplitCount = number(25, 35);
        int iTotalGoldAmount = 0;

        for (int i = 1; i <= iSplitCount; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
                continue;

            iTotalGoldAmount += iGold;
        }

        if (iTotalGoldAmount > 0)
        {
            pkAttacker->GiveGold(iTotalGoldAmount);
            iTotalGold += iTotalGoldAmount;
        }
    }
    else if (1 == number(1, iGold10DropPct))
    {
        int iTotalGoldAmount = 0;

        for (int i = 0; i < 10; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
                continue;

            iTotalGoldAmount += iGold;
        }

        if (iTotalGoldAmount > 0)
        {
            pkAttacker->GiveGold(iTotalGoldAmount);
            iTotalGold += iTotalGoldAmount;
        }
    }
    else
    {
        int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
        iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
        iGold *= iGoldMultipler;

        int iSplitCount;

        if (iGold >= 3)
            iSplitCount = number(1, 3);
        else if (GetMobRank() >= MOB_RANK_BOSS)
        {
            iSplitCount = number(3, 10);

            if ((iGold / iSplitCount) == 0)
                iSplitCount = 1;
        }
        else
            iSplitCount = 1;

        if (iGold != 0)
        {
            pkAttacker->GiveGold(iGold);
            iTotalGold += iGold;
        }
    }

    DBManager::instance().SendMoneyLog(MONEY_LOG_MONSTER, GetRaceNum(), iTotalGold);
}

This post is visible to everyone, and will be monitored by forum moderators.

Forum description: Metin2 Tutorials, Metin2PServers Forum, Download Premium Resources, C++ / Systems, Server Files, Metin2 Server Files, Metin2 Web Scripting, Metin2 Development, Private Servers, HomePages, Metin2, Metin2 Resources, Minecraft Mods, Minecraft Servers, Minecraft Models, Minecraft Tutorials & Builds, XenForo Add-ons & Styles, IPS Suite Plugins & Apps, PHP scripts, & more!
 

Premium Resources

521Threads
779Messages
189Members
feroooLatest member
Back
Top