Port commit 56186319bdd41dd26b6cc14f84e6e41eef5d953b (6.x branch)

Core/Spells: Cooldown updates

Updates #14418
This commit is contained in:
ariel- committed 2015-04-13 12:13:46 -03:00
1 parent 61aa5ec412
commit e707905764
35 files changed
+1043 -1093

No files matched your search

+7 -6
View File
@@ -48,6 +48,7 @@
#include "GridNotifiers.h"
#include "Formulas.h"
#include "ScriptMgr.h"
#include "SpellHistory.h"
#include "GameObjectAI.h"
#include "AccountMgr.h"
#include "InstanceScript.h"
@@ -769,8 +770,8 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
return;
// Reset cooldown on stealth if needed
if (unitTarget->ToPlayer()->HasSpellCooldown(1784))
unitTarget->ToPlayer()->RemoveSpellCooldown(1784);
if (unitTarget->GetSpellHistory()->HasCooldown(1784))
unitTarget->GetSpellHistory()->ResetCooldown(1784);
unitTarget->CastSpell(unitTarget, 1784, true);
return;
@@ -879,7 +880,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
// Remove spell cooldown (not category) if spell triggering spell with cooldown and same category
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->CategoryRecoveryTime && spellInfo->CategoryRecoveryTime
&& m_spellInfo->GetCategory() == spellInfo->GetCategory())
m_caster->ToPlayer()->RemoveSpellCooldown(spellInfo->Id);
m_caster->GetSpellHistory()->ResetCooldown(spellInfo->Id);
// original caster guid only for GO cast
m_caster->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK, NULL, NULL, m_originalCasterGUID);
@@ -932,7 +933,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex)
// Remove spell cooldown (not category) if spell triggering spell with cooldown and same category
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->CategoryRecoveryTime && spellInfo->CategoryRecoveryTime
&& m_spellInfo->GetCategory() == spellInfo->GetCategory())
m_caster->ToPlayer()->RemoveSpellCooldown(spellInfo->Id);
m_caster->GetSpellHistory()->ResetCooldown(spellInfo->Id);
// original caster guid only for GO cast
m_caster->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK, NULL, NULL, m_originalCasterGUID);
@@ -3472,7 +3473,7 @@ void Spell::EffectInterruptCast(SpellEffIndex effIndex)
if (m_originalCaster)
{
int32 duration = m_spellInfo->GetDuration();
unitTarget->ProhibitSpellSchool(curSpellInfo->GetSchoolMask(), unitTarget->ModSpellDuration(m_spellInfo, unitTarget, duration, false, 1 << effIndex));
unitTarget->GetSpellHistory()->LockSpellSchool(curSpellInfo->GetSchoolMask(), unitTarget->ModSpellDuration(m_spellInfo, unitTarget, duration, false, 1 << effIndex));
}
ExecuteLogEffectInterruptCast(effIndex, unitTarget, curSpellInfo->Id);
unitTarget->InterruptSpell(CurrentSpellTypes(i), false);
@@ -5839,7 +5840,7 @@ void Spell::EffectCastButtons(SpellEffIndex effIndex)
if (!spellInfo)
continue;
if (!p_caster->HasSpell(spell_id) || p_caster->HasSpellCooldown(spell_id))
if (!p_caster->HasSpell(spell_id) || p_caster->GetSpellHistory()->HasCooldown(spell_id))
continue;
if (!spellInfo->HasAttribute(SPELL_ATTR7_SUMMON_PLAYER_TOTEM))