From 39c16a851062c5d4dc1085d3d4eb64c70f3a4d51 Mon Sep 17 00:00:00 2001 From: laise Date: Thu, 10 Dec 2009 00:45:41 +0300 Subject: [PATCH] [8959] Implement talent 15318 and ranks and move talent 44745 and ranks code. Signed-off-by: VladimirMangos --- src/game/SpellAuras.cpp | 99 ++++++++++++++++++++++++++++------------ src/shared/revision_nr.h | 2 +- 2 files changed, 72 insertions(+), 29 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 1eae7fe10..715eff697 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -5897,7 +5897,7 @@ void Aura::HandleShapeshiftBoosts(bool apply) void Aura::HandleSpellSpecificBoosts(bool apply) { - bool at_remove = false; // if spell must be casted at aura remove + bool cast_at_remove = false; // if spell must be casted at aura remove uint32 spellId1 = 0; uint32 spellId2 = 0; uint32 spellId3 = 0; @@ -5905,6 +5905,33 @@ void Aura::HandleSpellSpecificBoosts(bool apply) switch(GetSpellProto()->SpellFamilyName) { + case SPELLFAMILY_MAGE: + { + // Ice Barrier + if (m_spellProto->SpellIconID == 32) + { + if (!apply && (m_removeMode == AURA_REMOVE_BY_DISPEL || (m_removeMode == AURA_REMOVE_BY_DEFAULT && !GetModifier()->m_amount))) + { + Unit::AuraList const& dummyAuras = m_target->GetAurasByType(SPELL_AURA_DUMMY); + for(Unit::AuraList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr) + { + // Shattered Barrier + if ((*itr)->GetSpellProto()->SpellIconID == 2945) + { + cast_at_remove = true; + // first rank have 50% chance + if ((*itr)->GetId() != 44745 || roll_chance_i(50)) + spellId1 = 55080; + break; + } + } + } + else + return; + } + else + return; + } case SPELLFAMILY_WARRIOR: { if(!apply) @@ -5927,10 +5954,10 @@ void Aura::HandleSpellSpecificBoosts(bool apply) break; } case SPELLFAMILY_WARLOCK: - if(!apply) + // Fear + if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000040000000000)) { - // Fear - if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000040000000000)) + if(!apply) { Unit* caster = GetCaster(); if(!caster) @@ -5943,7 +5970,7 @@ void Aura::HandleSpellSpecificBoosts(bool apply) // Improved Fear if (dummyEntry->SpellFamilyName == SPELLFAMILY_WARLOCK && dummyEntry->SpellIconID == 98) { - at_remove = true; + cast_at_remove = true; switch((*itr)->GetModifier()->m_amount) { // Rank 1 @@ -5955,16 +5982,43 @@ void Aura::HandleSpellSpecificBoosts(bool apply) } } } + else + return; } + else + return; break; case SPELLFAMILY_PRIEST: + { + // Shadow Word: Pain (need visual check fro skip improvement talent) or Vampiric Touch + if (m_spellProto->SpellIconID == 234 && m_spellProto->SpellVisual[0] || m_spellProto->SpellIconID == 2213) + { + if (!apply && m_removeMode == AURA_REMOVE_BY_DISPEL) + { + Unit* caster = GetCaster(); + if(!caster) + return; + + Unit::AuraList const& dummyAuras = caster->GetAurasByType(SPELL_AURA_DUMMY); + for(Unit::AuraList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr) + { + // Shadow Affinity + if ((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_PRIEST + && (*itr)->GetSpellProto()->SpellIconID == 178) + { + // custom cast code + int32 basepoints0 = (*itr)->GetModifier()->m_amount * caster->GetCreateMana() / 100; + caster->CastCustomSpell(caster, 64103, &basepoints0, NULL, NULL, true, NULL, this); + return; + } + } + } + else + return; + } + switch(GetId()) { - // Dispersion mana reg and immunity - case 47585: - spellId1 = 60069; // Dispersion - spellId2 = 63230; // Dispersion - break; // Abolish Disease (remove 1 more poison effect with Body and Soul) case 552: { @@ -5991,10 +6045,16 @@ void Aura::HandleSpellSpecificBoosts(bool apply) spellId1 = 64134; // Body and Soul (periodic dispel effect) break; } + // Dispersion mana reg and immunity + case 47585: + spellId1 = 60069; // Dispersion + spellId2 = 63230; // Dispersion + break; default: return; } break; + } case SPELLFAMILY_ROGUE: // Sprint (skip non player casted spells by category) if (GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000040) && GetSpellProto()->Category == 44) @@ -6103,7 +6163,7 @@ void Aura::HandleSpellSpecificBoosts(bool apply) // prevent aura deletion, specially in multi-boost case SetInUse(true); - if (apply || at_remove) + if (apply || cast_at_remove) { if (spellId1) m_target->CastSpell(m_target, spellId1, true, NULL, this); @@ -6403,23 +6463,6 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real) } else { - // Ice Barrier (remove effect from Shattered Barrier) - if (m_spellProto->SpellIconID == 32 && m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE) - { - if (!((m_removeMode == AURA_REMOVE_BY_DEFAULT && !m_modifier.m_amount) || m_removeMode == AURA_REMOVE_BY_DISPEL)) - return; - - if (m_target->HasAura(44745,0)) // Shattered Barrier, rank 1 - { - if(roll_chance_i(50)) - m_target->CastSpell(m_target, 55080, true, NULL, this); - } - else if (m_target->HasAura(54787,0)) // Shattered Barrier, rank 2 - { - m_target->CastSpell(m_target, 55080, true, NULL, this); - } - } - if (caster && // Power Word: Shield m_spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && m_spellProto->Mechanic == MECHANIC_SHIELD && diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 8905631fa..59fcd9997 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8958" + #define REVISION_NR "8959" #endif // __REVISION_NR_H__