Jump to content

GCD cheat


Guest tehmarto

Recommended Posts

What up,

Well for now the best thing I come up against it is this

diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 8456e39..825a304 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -464,10 +469,12 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa

    // group is initialized in the reference constructor
    SetGroupInvite(NULL);
    m_groupUpdateMask = 0;
    m_auraUpdateMask = 0;
+    
+    GlobalCDEnd = 0;

    duel = NULL;

    m_GuildIdInvited = 0;
    m_ArenaTeamIdInvited = 0;
@@ -18785,10 +18856,13 @@ void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 it
        cat = spellInfo->Category;
        rec = spellInfo->RecoveryTime;
        catrec = spellInfo->CategoryRecoveryTime;
    }

+    if(spellInfo->StartRecoveryTime)
+        SetGlobalCD(clock()+spellInfo->StartRecoveryTime);
+
    time_t curTime = time(NULL);

    time_t catrecTime;
    time_t recTime;

diff --git a/src/game/Player.h b/src/game/Player.h
index 8456e39..825a304 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -1662,10 +1666,12 @@ class MANGOS_DLL_SPEC Player : public Unit

        PlayerSpellMap const& GetSpellMap() const { return m_spells; }
        PlayerSpellMap      & GetSpellMap()       { return m_spells; }

        SpellCooldowns const& GetSpellCooldownMap() const { return m_spellCooldowns; }
+        void SetGlobalCD(clock_t newCD) {GlobalCDEnd = newCD;}
+        bool HasGlobalCD() {return GlobalCDEnd > clock();}

        PlayerTalent const* GetKnownTalentById(int32 talentId) const;
        SpellEntry const* GetKnownTalentRankById(int32 talentId) const;

        void AddSpellMod(SpellModifier* mod, bool apply);
@@ -2485,10 +2504,11 @@ class MANGOS_DLL_SPEC Player : public Unit

        PlayerMails m_mail;
        PlayerSpellMap m_spells;
        PlayerTalentMap m_talents[MAX_TALENT_SPEC_COUNT];
        SpellCooldowns m_spellCooldowns;
+        clock_t GlobalCDEnd;
        uint32 m_lastPotionId;                              // last used health/mana potion in combat, that block next potion use

        uint8 m_activeSpec;
        uint8 m_specsCount;

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index c1723f7..1cf75b4 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -4221,10 +4277,14 @@ SpellCastResult Spell::CheckCast(bool strict)
        }
        else if(m_caster->HasAura(m_spellInfo->excludeCasterAuraSpell))
            return SPELL_FAILED_CASTER_AURASTATE;
    }

+    if( m_caster->GetTypeId()==TYPEID_PLAYER && !m_triggeredByAuraSpell && m_spellInfo->StartRecoveryTime &&
+        ((Player*)m_caster)->HasGlobalCD())
+        return SPELL_FAILED_NOT_READY;
+
    // cancel autorepeat spells if cast start when moving
    // (not wand currently autorepeat cast delayed to moving stop anyway in spell update code)
    if( m_caster->GetTypeId() == TYPEID_PLAYER && ((Player*)m_caster)->isMoving() )
    {
        // skip stuck spell to allow use it in falling case and apply spell limitations at movement

But, some spells have global cd and some don't, some spells are affected by global cd and some are not. Global cd are on client side only right now and that allow cheating. What I am wondering about is, how client decides what spells are affected by global cd and whitch are not affected, for example gift of the naaru don't put global cd but is affected by global cd and it has 0 on StartRecoveryTime. I didn't find an attribute that defines the spell to not be affected by the global cd. So anyone got idea how the client checks if it should put a global cd on a spell or not so we can make the same check on client-side to prevent cheating? :)

Thanks.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

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. Privacy Policy Terms of Use