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
  • Good 2
  • Love 3
  • Love 2
Link to comment
Share on other sites

Announcements



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