diff options
| author | darkstalker <darkstalker@getmangos.com> | 2011-02-22 17:02:47 +0600 |
|---|---|---|
| committer | Azazel <azazel.kon@gmail.com> | 2011-02-22 17:02:47 +0600 |
| commit | 1646f9d91c70263c9af3a154b59d3e43c9d3a5a8 (patch) | |
| tree | c41632f6733fa584b95e624cb257691fa24ee6b4 /src/server/game/Entities/Creature | |
| parent | 401ec2180f06e3b7ad33345f256e19b80d1f5571 (diff) | |
Core/Spell Mechanics: introduce global cooldown manager for server-side checks for GCD (ported from mangos)
Diffstat (limited to 'src/server/game/Entities/Creature')
| -rwxr-xr-x | src/server/game/Entities/Creature/Creature.cpp | 12 | ||||
| -rwxr-xr-x | src/server/game/Entities/Creature/Creature.h | 3 |
2 files changed, 0 insertions, 15 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 0fd48f47ae6..53370170c9e 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -154,7 +154,6 @@ m_formation(NULL) m_CreatureSpellCooldowns.clear(); m_CreatureCategoryCooldowns.clear(); - m_GlobalCooldown = 0; DisableReputationGain = false; //m_unit_movement_flags = MONSTER_MOVE_WALK; @@ -430,11 +429,6 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data) void Creature::Update(uint32 diff) { - if (m_GlobalCooldown <= diff) - m_GlobalCooldown = 0; - else - m_GlobalCooldown -= diff; - if (IsAIEnabled && TriggerJustRespawned) { TriggerJustRespawned = false; @@ -2185,8 +2179,6 @@ void Creature::AddCreatureSpellCooldown(uint32 spellid) if (spellInfo->Category) _AddCreatureCategoryCooldown(spellInfo->Category, time(NULL)); - - m_GlobalCooldown = spellInfo->StartRecoveryTime; } bool Creature::HasCategoryCooldown(uint32 spell_id) const @@ -2195,10 +2187,6 @@ bool Creature::HasCategoryCooldown(uint32 spell_id) const if (!spellInfo) return false; - // check global cooldown if spell affected by it - if (spellInfo->StartRecoveryCategory > 0 && m_GlobalCooldown > 0) - return true; - CreatureSpellCooldowns::const_iterator itr = m_CreatureCategoryCooldowns.find(spellInfo->Category); return(itr != m_CreatureCategoryCooldowns.end() && time_t(itr->second + (spellInfo->CategoryRecoveryTime / IN_MILLISECONDS)) > time(NULL)); } diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 43ff73df08c..4933428bf4e 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -577,7 +577,6 @@ class Creature : public Unit, public GridObject<Creature> uint32 m_spells[CREATURE_MAX_SPELLS]; CreatureSpellCooldowns m_CreatureSpellCooldowns; CreatureSpellCooldowns m_CreatureCategoryCooldowns; - uint32 m_GlobalCooldown; bool canStartAttack(Unit const* u, bool force) const; float GetAttackDistance(Unit const* pl) const; @@ -646,8 +645,6 @@ class Creature : public Unit, public GridObject<Creature> void GetHomePosition(float &x, float &y, float &z, float &ori) { m_homePosition.GetPosition(x, y, z, ori); } Position GetHomePosition() { return m_homePosition; } - uint32 GetGlobalCooldown() const { return m_GlobalCooldown; } - uint32 GetWaypointPath(){return m_path_id;} void LoadPath(uint32 pathid) { m_path_id = pathid; } |
