Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[How To] Make Cheer Affect Upgrade Chance

Initiate Mage
Joined
Feb 28, 2022
Messages
39
Reaction score
10
This isn't much but hopefully it helps some of you.

credits to Kiasti on GitHub for the original idea.

First, open up your versionCommon.h in Nuez and WorldServer OR your kCommon.h and add #define __CHEER_UPGRADE somewhere.

UPDATE: also, if you would like, add
#define __CHEER_UPGRADE_RATE 0.05f; // This lets you define the % of extra chance without changing all instances each time you change it.
If you add this, instead of the 0.05f you see lower in the code snippets, put __CHEER_UPGRADE_RATE

Next, open up ItemUpgrade.cpp


STEP ONE
Find the CItemUpgrade::SmeltSafetyGeneral method.

find int nPercent = GetGeneralEnchantProb( pItemMain->GetAbilityOption() );

Under that, add
Code:
#ifdef __CHEER_UPGRADE
    if (pUser->HasBuff(BUFF_ITEM, II_CHEERUP))
    {
        float temp = static_cast<int>(nPercent * 0.05f);

        if (temp < 1000)
            nPercent += temp; // add 5% of original roll
    }
#endif

STEP TWO
Find the CItemUpgrade::SmeltSafetyAccessory method.

find DWORD dwProbability = CAccessoryProperty::GetInstance()->GetProbability( pItemMain->GetAbilityOption() );

Under that, add
Code:
#ifdef __CHEER_UPGRADE
    if (pUser->HasBuff(BUFF_ITEM, II_CHEERUP))
    {
        float temp = static_cast<int>(dwProbability * 0.05f);

        if (temp < 1000)
            dwProbability += temp; // add 5% of original roll
    }
#endif

STEP THREE
Find the CItemUpgrade::SmeltSafetyPiercingSize method

find int nPercent = GetSizeProb( pItemMain );

Under that, add
Code:
#ifdef __CHEER_UPGRADE
    if (pUser->HasBuff(BUFF_ITEM, II_CHEERUP))
    {
        float temp = static_cast<int>(nPercent * 0.05f);

        if (temp < 1000)
            nPercent += temp; // add 5% of original roll
    }
#endif

STEP FOUR
Find the CItemUpgrade::RefineAccessory method.

find DWORD dwProbability = CAccessoryProperty::GetInstance()->GetProbability( pItemMain->GetAbilityOption() );

Under that, add
Code:
#ifdef __CHEER_UPGRADE
    if (pUser->HasBuff(BUFF_ITEM, II_CHEERUP))
    {
        float temp = static_cast<int>(dwProbability * 0.05f);

        if (temp < 1000)
            dwProbability += temp; // add 5% of original roll
    }
#endif

STEP FIVE
Find the CItemUpgrade::RefineCollector method

find int nProb = pProperty->GetEnchantProbability( pItemMain->GetAbilityOption() );

Under that, add
Code:
#ifdef __CHEER_UPGRADE
    if (pUser->HasBuff(BUFF_ITEM, II_CHEERUP))
    {
        float temp = static_cast<int>(nProb * 0.05f);

        if (temp < 1000)
            nProb += temp; // add 5% of original roll
    }
#endif

STEP SIX (FINAL STEP)
Find the CItemUpgrade::SmeltSafetyAttribute method

find int nPercent = GetAttributeEnchantProb( pItemMain->m_nResistAbilityOption );

Under that, add
Code:
#ifdef __CHEER_UPGRADE
    if (pUser->HasBuff(BUFF_ITEM, II_CHEERUP))
    {
        float temp = static_cast<int>(nPercent * 0.05f);

        if (temp < 1000)
            nPercent += temp; // add 5% of original roll
    }
#endif
 
Last edited:
Junior Spellweaver
Joined
Feb 27, 2021
Messages
106
Reaction score
9
This isn't much but hopefully it helps some of you.

credits to Kiasti on GitHub for the original idea.

First, open up your versionCommon.h in Nuez and WorldServer OR your kCommon.h and add #define __CHEER_UPGRADE somewhere.

UPDATE: also, if you would like, add
#define __CHEER_UPGRADE_RATE 0.05f; // This lets you define the % of extra chance without changing all instances each time you change it.
If you add this, instead of the 0.05f you see lower in the code snippets, put __CHEER_UPGRADE_RATE

Next, open up ItemUpgrade.cpp


STEP ONE
Find the CItemUpgrade::SmeltSafetyGeneral method.

find int nPercent = GetGeneralEnchantProb( pItemMain->GetAbilityOption() );

Under that, add
Code:
#ifdef __CHEER_UPGRADE
    if (pUser->HasBuff(BUFF_ITEM, II_CHEERUP))
    {
        float temp = static_cast<int>(nPercent * 0.05f);

        if (temp < 1000)
            nPercent += temp; // add 5% of original roll
    }
#endif

STEP TWO
Find the CItemUpgrade::SmeltSafetyAccessory method.

find DWORD dwProbability = CAccessoryProperty::GetInstance()->GetProbability( pItemMain->GetAbilityOption() );

Under that, add
Code:
#ifdef __CHEER_UPGRADE
    if (pUser->HasBuff(BUFF_ITEM, II_CHEERUP))
    {
        float temp = static_cast<int>(dwProbability * 0.05f);

        if (temp < 1000)
            dwProbability += temp; // add 5% of original roll
    }
#endif

STEP THREE
Find the CItemUpgrade::SmeltSafetyPiercingSize method

find int nPercent = GetSizeProb( pItemMain );

Under that, add
Code:
#ifdef __CHEER_UPGRADE
    if (pUser->HasBuff(BUFF_ITEM, II_CHEERUP))
    {
        float temp = static_cast<int>(nPercent * 0.05f);

        if (temp < 1000)
            nPercent += temp; // add 5% of original roll
    }
#endif

STEP FOUR
Find the CItemUpgrade::RefineAccessory method.

find DWORD dwProbability = CAccessoryProperty::GetInstance()->GetProbability( pItemMain->GetAbilityOption() );

Under that, add
Code:
#ifdef __CHEER_UPGRADE
    if (pUser->HasBuff(BUFF_ITEM, II_CHEERUP))
    {
        float temp = static_cast<int>(dwProbability * 0.05f);

        if (temp < 1000)
            dwProbability += temp; // add 5% of original roll
    }
#endif

STEP FIVE
Find the CItemUpgrade::RefineCollector method

find int nProb = pProperty->GetEnchantProbability( pItemMain->GetAbilityOption() );

Under that, add
Code:
#ifdef __CHEER_UPGRADE
    if (pUser->HasBuff(BUFF_ITEM, II_CHEERUP))
    {
        float temp = static_cast<int>(nProb * 0.05f);

        if (temp < 1000)
            nProb += temp; // add 5% of original roll
    }
#endif

STEP SIX (FINAL STEP)
Find the CItemUpgrade::SmeltSafetyAttribute method

find int nPercent = GetAttributeEnchantProb( pItemMain->m_nResistAbilityOption );

Under that, add
Code:
#ifdef __CHEER_UPGRADE
    if (pUser->HasBuff(BUFF_ITEM, II_CHEERUP))
    {
        float temp = static_cast<int>(nPercent * 0.05f);

        if (temp < 1000)
            nPercent += temp; // add 5% of original roll
    }
#endif

Hello ! would you have an overview of what it gives ? or explain what it is used for
 
Back
Top