Jump to content

change casting speed bonus formula / add cooldown reduction bonus


Recommended Posts

Version of Files XXX

[[ Hi / Hello / Hey... ]]

[[ It is a template to help you with your problem... ]]

 

1. Description of the problem / Question :

Does anyone know where I can find the formula for the casting speed bonus? I want to change it(if possible) so it reduces the cooldown of skills by that percentage. Or, if I can't change it, does anyone know how I can add a new bonus that does that?

 

 

 

Thanks, Sincerly,
[[ Username ]]

 

Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

54 minutes ago, WeedHex said:

Utils.cpp


int CalculateDuration(int iSpd, int iDur)

 

I found it

Quote

int CalculateDuration(int iSpd, int iDur)
{
    int i = 100 - iSpd;

    if (i > 0)
        i = 100 + i;
    else if (i < 0)
        i = 10000 / (100 - i);
    else
        i = 100;

    return iDur * i / 100;

}

edit Realised I shouldn't modify CalculateDuration because it is used for calculating more things, not only the cooldown of skills, so I should instead modify ComputeCooltime

 

So, in order for it to work like cooldown reduction (as in, you have +60% casting speed, skill cooldown is reduced by 60%), I think I should modify it like this

Quote

int CHARACTER::ComputeCooltime(int time)
{
    if(GetPoint(POINT_CASTING_SPEED) - 100 <= 100) // subtracting 100 from casting speed because the base amount is 100(or I think it is), and I only want the leftover from item bonus
        return time * (100 - (GetPoint(POINT_CASTING_SPEED) - 100)) / 100; 
    else
        return time; // just in case it somehow got above 100% which shouldn't happen
}

Do you think it is fine? Sorry for spamming questions, but I'm beginner at both metin and coding and I doubt it is this easy to do, and 99% there is something I didn't consider

Edited by semoka10
Link to comment
Share on other sites

56 minutes ago, WeedHex said:

What you need to do? Reduce/remove the POINT_CASTING_SPEED from the skill ComputeCooltime formulation?

No, I want it to work differently. Now, if you have +100% casting speed, cooldown goes down by 50%, if you have +400% casting speed, cooldown goes down by 80% etc. I want to change it so that if you have +40% casting speed, cooldown is reduced by 40%, or if you have +70% casting speed, cooldown is reduced by 70% (obviously, it should never reach 100%). I changed the formula but no changes happened in game after compiling

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.