Jump to content
  • 0

change casting speed bonus formula / add cooldown reduction bonus


semoka10

Question

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 post

9 answers to this question

Recommended Posts

  • 0
49 minutes ago, WeedHex said:

char_skill.cpp

 

int CHARACTER::ComputeCooltime(int time)
{
    return CalculateDuration(GetPoint(POINT_CASTING_SPEED), time);
}

 

I can't seem to find what ComputeCooltime does, only its declaration. Can you please tell me where I can find its definition so I can change it?

Link to post
  • 0
  • VIP
15 minutes ago, semoka10 said:

I can't seem to find what ComputeCooltime does, only its declaration. Can you please tell me where I can find its definition so I can change it?

Utils.cpp

int CalculateDuration(int iSpd, int iDur)

 

Link to post
  • 0
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 (see edit history)
Link to post
  • 0
On 6/4/2020 at 1:02 AM, WeedHex said:

Utils.cpp

int CalculateDuration(int iSpd, int iDur)

 

I tried changing the ComputeCooltime function but nothing happens in game, it is the same as before. Any idea why?

Link to post
  • 0
  • VIP
36 minutes ago, semoka10 said:

I tried changing the ComputeCooltime function but nothing happens in game, it is the same as before. Any idea why?

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

Link to post
  • 0
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 post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • 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.