From 87f25be0aa7945bef09299d308c4bf92ea2f8180 Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 1 Aug 2016 03:20:49 -0300 Subject: [PATCH] Core/Spells: build fixes --- src/server/game/Miscellaneous/SharedDefines.h | 9 +++++---- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 ++-- src/server/game/Spells/Spell.cpp | 7 ++----- src/server/game/Spells/SpellHistory.cpp | 6 ------ 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index d57cb6c2372..f75ef1b25b4 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1677,10 +1677,11 @@ enum SpellDmgClass enum SpellPreventionType { - SPELL_PREVENTION_TYPE_NONE = 0, - SPELL_PREVENTION_TYPE_SILENCE = 1, - SPELL_PREVENTION_TYPE_PACIFY = 2, - SPELL_PREVENTION_TYPE_UNK = 3 // Only a few spells have this, but most of the should be interruptable. + SPELL_PREVENTION_TYPE_NONE = 0, + SPELL_PREVENTION_TYPE_SILENCE = 1, + SPELL_PREVENTION_TYPE_PACIFY = 2, + SPELL_PREVENTION_TYPE_UNK = 3, // Only a few spells have this, but most of the should be interruptable. + SPELL_PREVENTION_TYPE_NO_ACTIONS = 4 }; enum GameobjectTypes diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 14ada9e4a61..5c5557aaaa4 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2419,13 +2419,13 @@ void AuraEffect::HandleAuraModNoActions(AuraApplication const* aurApp, uint8 mod // Stop cast only spells vs PreventionType & SPELL_PREVENTION_TYPE_SILENCE for (uint32 i = CURRENT_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i) if (Spell* spell = target->GetCurrentSpell(CurrentSpellTypes(i))) - if (spell->m_spellInfo->PreventionType & SPELL_PREVENTION_TYPE_NO_ACTIONS) + if (spell->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_NO_ACTIONS) // Stop spells on prepare or casting state target->InterruptSpell(CurrentSpellTypes(i), false); } else { - // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit + // do not remove unit flag if there are more than this auraEffect of that kind on unit if (target->HasAuraType(SPELL_AURA_MOD_NO_ACTIONS)) return; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index c3125dac5d5..a415000015c 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5780,7 +5780,7 @@ SpellCastResult Spell::CheckCasterAuras() const prevented_reason = SPELL_FAILED_SILENCED; else if (unitflag & UNIT_FLAG_PACIFIED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY) prevented_reason = SPELL_FAILED_PACIFIED; - else if (m_caster->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_NO_ACTIONS) && m_spellInfo->PreventionType & SPELL_PREVENTION_TYPE_NO_ACTIONS) + else if (m_caster->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_NO_ACTIONS) && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_NO_ACTIONS) prevented_reason = SPELL_FAILED_NO_ACTIONS; // Attr must make flag drop spell totally immune from all effects @@ -7502,11 +7502,8 @@ void Spell::TriggerGlobalCooldown() m_spellInfo->HasAttribute(SPELL_ATTR0_ABILITY); // Apply haste rating - if (gcd > MIN_GCD && ((m_spellInfo->StartRecoveryCategory == 133 && !isMeleeOrRangedSpell) || m_caster->HasAuraTypeWithAffectMask(SPELL_AURA_MOD_GLOBAL_COOLDOWN_BY_HASTE, m_spellInfo))) + if (gcd > MIN_GCD && ((m_spellInfo->StartRecoveryCategory == 133 && !isMeleeOrRangedSpell))) gcd = std::min(std::max(int32(float(gcd) * m_caster->GetFloatValue(UNIT_MOD_CAST_HASTE)), MIN_GCD), MAX_GCD); - - if (gcd > MIN_GCD && m_caster->HasAuraTypeWithAffectMask(SPELL_AURA_MOD_GLOBAL_COOLDOWN_BY_HASTE_REGEN, m_spellInfo)) - gcd = std::min(std::max(int32(float(gcd) * m_caster->GetFloatValue(UNIT_FIELD_MOD_HASTE_REGEN)), MIN_GCD), MAX_GCD); } m_caster->GetSpellHistory()->AddGlobalCooldown(m_spellInfo, gcd); diff --git a/src/server/game/Spells/SpellHistory.cpp b/src/server/game/Spells/SpellHistory.cpp index 03cff5b6925..38574fdeff8 100644 --- a/src/server/game/Spells/SpellHistory.cpp +++ b/src/server/game/Spells/SpellHistory.cpp @@ -317,12 +317,6 @@ void SpellHistory::StartCooldown(SpellInfo const* spellInfo, uint32 itemId, Spel categoryCooldown = int32(categoryCooldown * _owner->GetFloatValue(UNIT_MOD_CAST_HASTE)); } - if (_owner->HasAuraTypeWithAffectMask(SPELL_AURA_MOD_COOLDOWN_BY_HASTE_REGEN, spellInfo)) - { - cooldown = int32(cooldown * _owner->GetFloatValue(UNIT_FIELD_MOD_HASTE_REGEN)); - categoryCooldown = int32(categoryCooldown * _owner->GetFloatValue(UNIT_FIELD_MOD_HASTE_REGEN)); - } - if (int32 cooldownMod = _owner->GetTotalAuraModifier(SPELL_AURA_MOD_COOLDOWN)) { // Apply SPELL_AURA_MOD_COOLDOWN only to own spells