Jump to content

Skill Cooltime ToolTIP Fix


Recommended Posts

  • VIP

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);
}

 

  • Love 8
Link to post
  • 4 months later...
  • VIP
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 post
  • VIP

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 post
  • VIP
18 minutes ago, Metin2Place said:

The skill cooldown finishes too early and doesn't do damage if is cast instantly after cooldown.

 

Make sure the skill cooldown matches both client and server

 

Link to post

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 (see edit history)
Link to post
  • 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 post
  • VIP

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 post

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 (see edit history)
Link to post
  • VIP

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 post
  • ASIKOO changed the title to Skill Cooltime ToolTIP Fix

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

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.