Silver Sonitex 1437 Posted June 9, 2020 Silver Share Posted June 9, 2020 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); } 1 1 8 Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10259 Posted June 9, 2020 Forum Moderator Share Posted June 9, 2020 (edited) Thanks for the fix, for those who wondering from where's the formula: void CPythonPlayer::__RunCoolTime(DWORD dwSkillSlotIndex) Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal 2 1 6 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Metin2Place 30 Posted October 19, 2020 Share Posted October 19, 2020 If you spam the same skill right after cooldown, the second time it won't do damage. Link to comment Share on other sites More sharing options...
Silver Sonitex 1437 Posted October 19, 2020 Author Silver Share Posted October 19, 2020 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. 1 Link to comment Share on other sites More sharing options...
Metin2Place 30 Posted October 19, 2020 Share Posted October 19, 2020 The skill cooldown finishes too early and doesn't do damage if is cast instantly after cooldown. Link to comment Share on other sites More sharing options...
Silver Sonitex 1437 Posted October 19, 2020 Author Silver Share Posted October 19, 2020 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 Share on other sites More sharing options...
Premium ragem0re 155 Posted October 19, 2020 Premium Share Posted October 19, 2020 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 comment Share on other sites More sharing options...
Active Member iMerv3 767 Posted October 19, 2020 Active Member Share Posted October 19, 2020 (edited) 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 October 19, 2020 by iMerv3 Link to comment Share on other sites More sharing options...
ManiacRobert 427 Posted October 19, 2020 Share Posted October 19, 2020 Idk Rick, looks kinda steal from evion source, where is the credit? Link to comment Share on other sites More sharing options...
PeaceMaker 121 Posted October 19, 2020 Share Posted October 19, 2020 4 hours ago, Metin2Place said: The skill cooldown finishes too early and doesn't do damage if is cast instantly after cooldown. Sync your server/client skill_proto Link to comment Share on other sites More sharing options...
Shahin 223 Posted October 31, 2020 Share Posted October 31, 2020 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 More sharing options...
Silver Sonitex 1437 Posted November 1, 2020 Author Silver Share Posted November 1, 2020 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. 2 Link to comment Share on other sites More sharing options...
Shahin 223 Posted November 2, 2020 Share Posted November 2, 2020 (edited) 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 November 2, 2020 by Shahin Link to comment Share on other sites More sharing options...
Silver Sonitex 1437 Posted November 2, 2020 Author Silver Share Posted November 2, 2020 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 1 Link to comment Share on other sites More sharing options...
Recommended Posts