Jump to content

Fix New Waithack Method


Recommended Posts

  • Premium

Hey guys,

maybe you heard already about a new waithack method with poisonous cloud and some other stuff.
i don´t want to go into details and just share a potential fix for that 🙂
(i could not test it completly so some feedback is appreciated)

 

in char.h

// below bool bUsed;

    bool    bSkillCD;
    DWORD   dwHitCount;

// add after bUsed(false),

bSkillCD(false), dwHitCount(0),

// below bool HitOnce(DWORD dwVnum = 0);

    bool    IsSkillCooldown(DWORD dwVnum, float fSkillPower);

// above void ResetSkill();

        bool                IsSkillCooldown(DWORD dwVnum, float fSkillPower) { return m_SkillUseInfo[dwVnum].IsSkillCooldown(dwVnum, fSkillPower) ? true : false; }

 

in char_skill.cpp

// above bool TSkillUseInfo::UseSkill(bool isGrandMaster, DWORD vid, DWORD dwCooltime, int splashcount, int hitcount, int range)

bool TSkillUseInfo::IsSkillCooldown(DWORD dwVnum, float fSkillPower)
{
    DWORD maxHitCount = 0;
    if (dwVnum == SKILL_KWANKYEOK || dwVnum == SKILL_HORSE_WILDATTACK_RANGE)
    {
        if (dwVnum == SKILL_KWANKYEOK)
            maxHitCount = static_cast<DWORD>(2 + floor(6 * fSkillPower));
        else if (dwVnum == SKILL_HORSE_WILDATTACK_RANGE)
            maxHitCount = 5;

        dwHitCount++;

        if (dwHitCount > maxHitCount)
            return true;
        return false;
    }

    if (!bSkillCD)
        return true;

    bSkillCD = false;
    return bSkillCD;
}

// below bUsed = true;

    bSkillCD = true;
    dwHitCount = 0;

 

in char_battle.cpp

// above LPITEM pkBow, pkArrow;

            if (m_bType > 0 && m_me->IsSkillCooldown(m_bType, static_cast<float> (m_me->GetSkillPower(m_bType) / 100.0f)))
                return;

 

Edited by .colossus.
  • Metin2 Dev 1
  • Love 2
  • Love 3
  • Good 2
Link to comment
Share on other sites

  • Premium
41 minutes ago, flexio said:

good idea but you forgot to archer skills with multiple hits. Example Arrow Shower will shot only once

yeah you´re right.

i had this case not in my mind. i will adapt it in next days when i have some free time.

Link to comment
Share on other sites

  • Premium

#update

SKILL_KWANKYEOK and SKILL_HORSE_WILDATTACK_RANGE are sending more than one packet.

maximum of possible packets which are computed is now calculated properly.

and yeah it could probably be solved better without using bSkillCD

Edited by .colossus.
  • Metin2 Dev 1
  • Love 3
  • Love 1
Link to comment
Share on other sites



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