From 0cb6f7be0c9187516d0c0f6321389db53771ff65 Mon Sep 17 00:00:00 2001 From: Laise Date: Wed, 8 Sep 2010 10:47:05 +0300 Subject: [PATCH] [10453] Fix disease consume part of 49020 and ranks --- sql/mangos_spell_check.sql | 3 +++ src/game/SpellEffects.cpp | 15 +++++++++++++++ src/game/Unit.cpp | 4 ++-- src/game/Unit.h | 2 +- src/shared/revision_nr.h | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/sql/mangos_spell_check.sql b/sql/mangos_spell_check.sql index af393daa6..37fceff9f 100644 --- a/sql/mangos_spell_check.sql +++ b/sql/mangos_spell_check.sql @@ -614,6 +614,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas /* sorted by spell names */ /*id fm familyMaskA fmMaskB icon vis cat eff aur ef name code */ +( 0,15, -1, -1,2710, -1, -1, -1, 4,-1,'Annihilation', 'Spell::EffectDummy'), ( 0, 3,0x0000000020000000,0x00000000, -1, -1, -1, 2, -1,-1,'Arcane Blast', 'Spell::EffectSchoolDMG'), ( 0, 3,0x0000000000200080,0x00000000, -1, -1, -1, -1, -1,-1,'Arcane Missles / Blizzard', 'Spell::prepareDataForTriggerSystem'), ( 0, 9,0x0000000000000800,0x00000000, -1, -1, -1, 2, -1,-1,'Arcane Shot', 'Spell::EffectSchoolDMG'), @@ -688,6 +689,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas ( 0, 6,0x0000000000002000,0x00000000, -1, -1, -1, 2, -1,-1,'Mind Blast', 'Spell::EffectSchoolDMG'), ( 0, 9,0x0000000000000002,0x00000000, -1, 342, -1, 2, -1,-1,'Mongoose Bite', 'Spell::EffectSchoolDMG'), ( 0, 8,0x0020000000000000,0x00000000, -1, -1, -1, -1, -1,-1,'Mutilate', 'Spell::CheckCast'), +( 0,15,0x0002000000000000,0x00000000, -1, -1, -1, 3, -1,-1,'Obliterate', 'Spell::EffectDummy'), ( 0, 6,0x0080000000000000,0x00000000, -1, -1, -1, 3, -1,-1,'Penance', 'Spell::EffectDummy'), ( 0, 6,0x0001800000800000,0x00000040, -1, -1, -1, -1, -1,-1,'Penance,Mind Sear,Mind Flay', 'Spell::prepareDataForTriggerSystem'), ( 0,15,0x0000000000000001,0x00000000, -1, -1, -1, 31, -1,-1,'Plague Strike', 'Spell::EffectWeaponDmg'), @@ -724,6 +726,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas ( 0, 9,0x0000000100000000,0x00000000, -1, -1, -1, 2, -1,-1,'Steady Shot', 'Spell::EffectSchoolDMG'), ( 0, 9,0x0000000100000000,0x00000000, -1, -1, -1, 3, -1,-1,'Steady Shot', 'Spell::EffectDummy'), ( 0,-1, -1, -1,1989, -1, -1, -1, 42, 0,'Sudden Death', 'Spell::EffectDummy'), +( 0, 7, -1, -1, 961, -1, -1, -1,137,-1,'Survival of the Fittest', 'Aura::HandleShapeshiftBoosts'), ( 0, 7,0x0010000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Swipe', 'Spell::EffectSchoolDMG'), ( 0, 4,0x0000000000000080,0x00000000, -1, -1, -1, 2, -1,-1,'Thunder Clap', 'Spell::EffectSchoolDMG'), ( 0,11,0x0000000004000000,0x00000000, -1, -1, -1, -1, -1,-1,'Totem of Wrath', 'Spell::cast'), diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index aa0c16238..c8dec8eb3 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2546,6 +2546,21 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) m_caster->CastCustomSpell(m_caster, 45470, &bp, NULL, NULL, true); return; } + // Obliterate + else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0002000000000000)) + { + // search for Annihilation + Unit::AuraList const& dummyList = m_caster->GetAurasByType(SPELL_AURA_DUMMY); + for (Unit::AuraList::const_iterator itr = dummyList.begin(); itr != dummyList.end(); ++itr) + { + if ((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && (*itr)->GetSpellProto()->SpellIconID == 2710) + if (roll_chance_i((*itr)->GetModifier()->m_amount)) // don't consume if found + return; + } + + // consume diseases + unitTarget->RemoveAurasWithDispelType(DISPEL_DISEASE, m_caster->GetGUID()); + } break; } } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 84b6c0de0..8428cf225 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4387,7 +4387,7 @@ void Unit::RemoveAurasDueToSpellByCancel(uint32 spellId) } } -void Unit::RemoveAurasWithDispelType( DispelType type ) +void Unit::RemoveAurasWithDispelType( DispelType type, uint64 casterGUID ) { // Create dispel mask by dispel type uint32 dispelMask = GetDispellMask(type); @@ -4396,7 +4396,7 @@ void Unit::RemoveAurasWithDispelType( DispelType type ) for(SpellAuraHolderMap::iterator itr = auras.begin(); itr != auras.end(); ) { SpellEntry const* spell = itr->second->GetSpellProto(); - if( (1<Dispel) & dispelMask ) + if( ((1<Dispel) & dispelMask) && (!casterGUID || casterGUID == itr->second->GetCasterGUID())) { // Dispel aura RemoveAurasDueToSpell(spell->Id); diff --git a/src/game/Unit.h b/src/game/Unit.h index a04a3a9e1..828b37bde 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1542,7 +1542,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject bool RemoveNoStackAurasDueToAuraHolder(SpellAuraHolder *holder); void RemoveAurasWithInterruptFlags(uint32 flags); void RemoveAurasWithAttribute(uint32 flags); - void RemoveAurasWithDispelType( DispelType type ); + void RemoveAurasWithDispelType( DispelType type, uint64 casterGUID = 0 ); void RemoveAllAuras(AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT); void RemoveArenaAuras(bool onleave = false); void RemoveAllAurasOnDeath(); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 59e5fef3c..81d53dea8 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 "10452" + #define REVISION_NR "10453" #endif // __REVISION_NR_H__