[10453] Fix disease consume part of 49020 and ranks

This commit is contained in:
Laise 2010-09-08 10:47:05 +03:00
parent 812383ac8c
commit 0cb6f7be0c
5 changed files with 22 additions and 4 deletions

View file

@ -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'),

View file

@ -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;
}
}

View file

@ -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<<spell->Dispel) & dispelMask )
if( ((1<<spell->Dispel) & dispelMask) && (!casterGUID || casterGUID == itr->second->GetCasterGUID()))
{
// Dispel aura
RemoveAurasDueToSpell(spell->Id);

View file

@ -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();

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10452"
#define REVISION_NR "10453"
#endif // __REVISION_NR_H__