Jump to content

Recommended Posts

  • Active Member

When hovering over a skill, it's recharge duration in tooltip is always the same because it ignores player's casting speed.

 

In PythonSkill.cpp search for :

PyObject * skillGetSkillCoolTime(PyObject * poSelf, PyObject * poArgs)

Replace with:

 

PyObject * skillGetSkillCoolTime(PyObject * poSelf, PyObject * poArgs)
{
	int iSkillIndex;
	if (!PyTuple_GetInteger(poArgs, 0, &iSkillIndex))
		return Py_BadArgument();

	float fSkillPoint;
	if (!PyTuple_GetFloat(poArgs, 1, &fSkillPoint))
		return Py_BadArgument();

	CPythonSkill::SSkillData * c_pSkillData;
	if (!CPythonSkill::Instance().GetSkillData(iSkillIndex, &c_pSkillData))
		return Py_BuildException("skill.GetSkillCoolTime - Failed to find skill by %d", iSkillIndex);

	DWORD dwSkillCoolTime = c_pSkillData->GetSkillCoolTime(fSkillPoint);
	int iCastingSpeed = CPythonPlayer::Instance().GetStatus(POINT_CASTING_SPEED);

	int iSpd = 100 - iCastingSpeed;
	if (iSpd > 0)
		iSpd = 100 + iSpd;
	else if (iSpd < 0)
		iSpd = 10000 / (100 - iSpd);
	else
		iSpd = 100;

	dwSkillCoolTime = dwSkillCoolTime * iSpd / 100;

	return Py_BuildValue("i", dwSkillCoolTime);
}

 

  • Good 1
  • Love 1
  • Love 8
Link to comment
https://metin2.dev/topic/24084-skill-cooltime-tooltip-fix/
Share on other sites

  • Forum Moderator

Thanks for the fix, for those who wondering from where's the formula: void CPythonPlayer::__RunCoolTime(DWORD dwSkillSlotIndex)

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 2
  • Good 1
  • Love 6
Link to comment
https://metin2.dev/topic/24084-skill-cooltime-tooltip-fix/#findComment-129191
Share on other sites

  • 4 months later...
  • Active Member
26 minutes ago, Metin2Place said:

If you spam the same skill right after cooldown, the second time it won't do damage.

Sorry to disappoint you but this has nothing to do with damage of the skill. Your issue lays somewhere else.

  • Lmao 1
Link to comment
https://metin2.dev/topic/24084-skill-cooltime-tooltip-fix/#findComment-132178
Share on other sites

  • Active Member

Function affects only the tooltip part. Skill cooldown is calculated by the following function(I think, haven't done much research):

CPythonPlayer::__RunCoolTime(DWORD dwSkillSlotIndex)

 

Link to comment
https://metin2.dev/topic/24084-skill-cooltime-tooltip-fix/#findComment-132182
Share on other sites

Ty, anyway take a tip:

Spoiler

    int i = int(100 - iCastingSpeed) == 0 ? 100 : int(100 - iCastingSpeed);
    int x = i > 0 ? x = 100 + i : x = 10000 / (100 - i);
    return DWORD(iSkillCoolTime * x / 100);

 

Edited by iMerv3
Link to comment
https://metin2.dev/topic/24084-skill-cooltime-tooltip-fix/#findComment-132184
Share on other sites

  • 2 weeks later...

So i've tested:

  • Before the calculations: With Normal skills cooldown i have no problem doing damage when it finishes casting.

I have Synchronized skilltable.txt with Vegas's release not to worry about it afterwards.

After trying @Sonitex 's version and @iMerv3's   WORKING calculations, a problem occurs:

 

  • I cast a skill, and the very first second when the cooldown is ready and i try to cast it again: i do no damage.

So, i Undo the calculations and left it stock to see if it was actually me. Well, I don't have the problem anymore.

 

If anybody would like to give his fix to the problem, i would appreciate.

Link to comment
https://metin2.dev/topic/24084-skill-cooltime-tooltip-fix/#findComment-132482
Share on other sites

  • Active Member

Soooo.. The issue was inside CPythonPlayer::__RunCoolTime(DWORD dwSkillSlotIndex) which was also using casting speed reduction. 

 

Apologies to everyone ? Added remaining part of the tutorial. 

  • Love 2
Link to comment
https://metin2.dev/topic/24084-skill-cooltime-tooltip-fix/#findComment-132502
Share on other sites

I hope you realize that we have the same problem, still.. 

This is the remaining code in void CPythonPlayer::__RunCoolTime(DWORD dwSkillSlotIndex)

{
    TSkillInstance & rkSkillInst = m_playerStatus.aSkill[dwSkillSlotIndex];

    CPythonSkill::TSkillData * pkSkillData;
    if (!CPythonSkill::Instance().GetSkillData(rkSkillInst.dwIndex, &pkSkillData))
    {
        TraceError("CPythonPlayer::__SendUseSkill(dwSkillSlotIndex=%d) - NOT CHECK", dwSkillSlotIndex);
        return;
    }

    CPythonSkill::TSkillData& rkSkillData=*pkSkillData;

    rkSkillInst.fCoolTime = rkSkillData.GetSkillCoolTime(rkSkillInst.fcurEfficientPercentage);
    rkSkillInst.fLastUsedTime = CTimer::Instance().GetCurrentSecond();

    PyCallClassMemberFunc(m_ppyGameWindow, "RunUseSkillEvent", Py_BuildValue("(if)", dwSkillSlotIndex, rkSkillInst.fCoolTime));
}

And i still don't give damage. Can you pllease check?

 

  • When i don't have casting speed on an item, it is working fine. When i have casting speed, it is not dealing damage anymore if i fastly cast it again..
Edited by Shahin
Link to comment
https://metin2.dev/topic/24084-skill-cooltime-tooltip-fix/#findComment-132574
Share on other sites

  • Active Member

Updated.

 

I assume calculating the duration in the beginning of the function is not the smartest move when dealing with milliseconds. Moved the calculation to skill module's function which is only used at uiToolTip.

 

It works just fine for me now, if further problems arise I will happily fix them ;) 

  • Love 1
Link to comment
https://metin2.dev/topic/24084-skill-cooltime-tooltip-fix/#findComment-132580
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.