[11623] Implement ClassFamilyMask as wrapper for uint64+uint32 spell family masks

Inspired by patch suggested by darkstalker

Also
* Remove existed enums for family masks as contra-productive for developement.
* Drop one from horrible hack checks in SpellMgr::IsNoStackSpellDueToSpell
  (spells for any fimilies with exactly 0x800 mask) I fail find useful cases
  for current spell data with this check. All cases expected work correct without it.
  If will some problems detected with this please report for fix in less strange way.
This commit is contained in:
VladimirMangos 2011-06-11 20:16:44 +04:00
parent 20e9484e74
commit c686697c2d
12 changed files with 117 additions and 127 deletions

View file

@ -6061,7 +6061,7 @@ void Spell::EffectWeaponDmg(SpellEffectIndex eff_idx)
((Player*)m_caster)->AddComboPoints(unitTarget, 1);
}
// Mangle (Cat): CP
else if (m_spellInfo->SpellFamilyName==SPELLFAMILY_DRUID && (m_spellInfo->SpellFamilyFlags==UI64LIT(0x0000040000000000)))
else if (m_spellInfo->IsFitToFamily(SPELLFAMILY_DRUID, UI64LIT(0x0000040000000000)))
{
if(m_caster->GetTypeId()==TYPEID_PLAYER)
((Player*)m_caster)->AddComboPoints(unitTarget, 1);
@ -7494,8 +7494,8 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
continue;
// Search only Serpent Sting, Viper Sting, Scorpid Sting auras
uint64 familyFlag = holder->GetSpellProto()->SpellFamilyFlags;
if (!(familyFlag & UI64LIT(0x000000800000C000)))
ClassFamilyMask const& familyFlag = holder->GetSpellProto()->SpellFamilyFlags;
if (!familyFlag.IsFitToFamilyMask(UI64LIT(0x000000800000C000)))
continue;
// Refresh aura duration
@ -7507,7 +7507,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
continue;
// Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting.
if ((familyFlag & UI64LIT(0x0000000000004000)))
if (familyFlag.IsFitToFamilyMask(UI64LIT(0x0000000000004000)))
{
// m_amount already include RAP bonus
basePoint = aura->GetModifier()->m_amount * aura->GetAuraMaxTicks() * 40 / 100;
@ -7515,7 +7515,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
}
// Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
if ((familyFlag & UI64LIT(0x0000008000000000)))
if (familyFlag.IsFitToFamilyMask(UI64LIT(0x0000008000000000)))
{
uint32 target_max_mana = unitTarget->GetMaxPower(POWER_MANA);
if (!target_max_mana)
@ -7538,7 +7538,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
}
// Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute.
if (familyFlag & UI64LIT(0x0000000000008000))
if (familyFlag.IsFitToFamilyMask(UI64LIT(0x0000000000008000)))
spellId = 53359; // Chimera Shot - Scorpid
// ?? nothing say in spell desc (possibly need addition check)
//if ((familyFlag & UI64LIT(0x0000010000000000)) || // dot
@ -7743,11 +7743,10 @@ void Spell::EffectSanctuary(SpellEffectIndex /*eff_idx*/)
unitTarget->CombatStop();
unitTarget->getHostileRefManager().deleteReferences(); // stop all fighting
// Vanish allows to remove all threat and cast regular stealth so other spells can be used
if(m_spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && (m_spellInfo->SpellFamilyFlags & SPELLFAMILYFLAG_ROGUE_VANISH))
{
if (m_spellInfo->IsFitToFamily(SPELLFAMILY_ROGUE, UI64LIT(0x0000000000000800)))
((Player *)m_caster)->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT);
}
}
void Spell::EffectAddComboPoints(SpellEffectIndex /*eff_idx*/)