Jump to content

[SURA NERF] Finding a calculation to nerf MANASHIELD skill


Go to solution Solved by Sonitex,

Recommended Posts

  • Premium

Do you want to help me and who'll need of this??  Follow me.

 

I'm speaking about skill: "79    Èæ½Å¼öÈ£"

File char_battle.cpp

Function: bool CHARACTER::Damage(LPCHARACTER pAttacker, int dam, EDamageType type)

 

MANASHIELD ACTION:

Spoiler

 

    if (IsAffectFlag(AFF_MANASHIELD))
    {
        // POINT_MANASHIELD
        int iDamageSPPart = dam / 3;
        int iDamageToSP = iDamageSPPart * GetPoint(POINT_MANASHIELD) / 100;
        int iSP = GetSP();

        // SP
        if (iDamageToSP <= iSP)
        {
            PointChange(POINT_SP, -iDamageToSP);
            dam -= iDamageSPPart;
        }
        else
        {
            PointChange(POINT_SP, -GetSP());
            dam -= iSP * 100 / MAX(GetPoint(POINT_MANASHIELD), 1);
        }
    }

 

 

As you can see from here, the manashield does a particular calculation to change the damage using SP point.

 

Have you any idea to applicate a % of nerf so the sura will suffer more damages. 

I'm asking for a %, so everyone can change the nerf as prefer.

 

Let the mathematicians go wild!

 

NERF DONE 31% INSTEAD OF 33%:

Spoiler

 

    if (IsAffectFlag(AFF_MANASHIELD))
    {
        // POINT_MANASHIELD
#ifdef NERF_MANASHIELD
        const int iPrctMana = 31;
        int iDamageSPPart = (dam / 100) *iPrctMana;
#else
        int iDamageSPPart = dam / 3;
#endif
        int iDamageToSP = iDamageSPPart * GetPoint(POINT_MANASHIELD) / 100;
        int iSP = GetSP();

        // SP
        if (iDamageToSP <= iSP)
        {
            PointChange(POINT_SP, -iDamageToSP);
            dam -= iDamageSPPart;
        }
        else
        {
            PointChange(POINT_SP, -GetSP());
            dam -= iSP * 100 / MAX(GetPoint(POINT_MANASHIELD), 1);
        }
    }

 

 

Link to comment
Share on other sites

  • Premium

int iDamageSPPart = dam / 3;

 

This means a Sura with protection will only suffer 66.6% of damages. Because it mitigates 33.3% of them.

 

Indeed, two thirds of the actual damage that the attack / skill would have inflicted on the character (after defenses calculations) are deducted from his HP, the remaining third is transferred to the MPs;

So, after knowing this, what do you need?

 

  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Premium
51 minutes ago, Syreldar said:

int iDamageSPPart = dam / 3;

 

This means a Sura with protection will only suffer 66.6% of damages. Because it mitigates 33.3% of them.

So, after knowing this, what do you need?

 

 

I'm asking to make a new variable to nerf the 33.3%. I hate think on this weird calculation i need help for this.

Kinda to let it become 30% 32%, you can do examples on code if you can.

Link to comment
Share on other sites

  • Premium
Just now, WeedHex said:

 

I'm asking to applicate a new variable to nerf the 33.3%. I hate think on this weird calculation i need help for this.

Kinda to let it begin 30% 32%, you can do examples on code if you can.

o.O

Sorry but i don't understand that question, just change that variable.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Premium

You could've asked to make a const var for the perc, i didn't understand at first.

  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Forum Moderator
7 hours ago, WeedHex said:

(Better to use a const int for the %)

Better to use for both of them since you don't change anything and also cast the (dam/100), the result can be floating point data type,  since you want a integer, is a good practice to do it.

const uint8_t iPrctMana = 31;
const int32_t iDamageSPPart = static_cast<int32_t>(dam / 100) * iPrctMana;

 

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.