Jump to content

Skill Cooltime ToolTIP Fix


Recommended Posts

  • Premium

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
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
Share on other sites

  • 4 months later...
  • Active Member

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
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
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
Share on other sites

  • Premium

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
Share on other sites

Announcements



  • Similar Content

  • Similar Content

  • Similar Content

  • Tags

  • Activity

    1. 5

      Effect weapons

    2. 3

      Crystal Metinstone

    3. 3

      Feeding game source to LLM

    4. 113

      Ulthar SF V2 (TMP4 Base)

    5. 3

      Feeding game source to LLM

    6. 0

      Target Information System

    7. 3

      Feeding game source to LLM

    8. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.