*Check category instead of flags for some spells. Author: VladimirMangos

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-07 14:40:37 -05:00
parent fe3ba612d9
commit 3549c0bddd
3 changed files with 8 additions and 9 deletions

View File

@@ -1850,6 +1850,7 @@ enum CreatureType
CREATURE_TYPE_GAS_CLOUD = 13
};
uint32 const CREATURE_TYPEMASK_DEMON_OR_UNDEAD = (1 << (CREATURE_TYPE_DEMON-1)) | (1 << (CREATURE_TYPE_UNDEAD-1));
uint32 const CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD = (1 << (CREATURE_TYPE_HUMANOID-1)) | (1 << (CREATURE_TYPE_UNDEAD-1));
uint32 const CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL = (1 << (CREATURE_TYPE_MECHANICAL-1)) | (1 << (CREATURE_TYPE_ELEMENTAL-1));

View File

@@ -6011,11 +6011,10 @@ bool Spell::CheckTargetCreatureType(Unit* target) const
{
uint32 spellCreatureTargetMask = m_spellInfo->TargetCreatureType;
// Curse of Doom or Exorcism
// These spells cannot be cast on players, however there is no clientside check for them
// so there is no attribute flag in dbcs which would mark these spells - we need to check them by spellfamily
if(m_spellInfo->SpellFamilyName==SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags.IsEqual(0,0x02,0)
|| m_spellInfo->SpellFamilyName==SPELLFAMILY_PALADIN && m_spellInfo->SpellFamilyFlags.IsEqual(0,0x2,0))
// Curse of Doom & Exorcism: not find another way to fix spell target check :/
if (m_spellInfo->SpellFamilyName==SPELLFAMILY_WARLOCK && m_spellInfo->Category == 1179 ||
// TODO: will be removed in 3.2.x
m_spellInfo->SpellFamilyName==SPELLFAMILY_PALADIN && m_spellInfo->Category == 19)
{
// not allow cast at player
if(target->GetTypeId()==TYPEID_PLAYER)

View File

@@ -9806,11 +9806,10 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
crit_chance+=aura->GetAmount();
break;
}
// Exorcism - "If the target is Undead or Demon, it will always critically hit"
else if(spellProto->SpellFamilyFlags[1]&0x2)
// Exorcism
else if (spellProto->Category == 19)
{
if(pVictim->GetCreatureType() == CREATURE_TYPE_DEMON
|| pVictim->GetCreatureType() == CREATURE_TYPE_UNDEAD)
if (pVictim->GetCreatureTypeMask() & CREATURE_TYPEMASK_DEMON_OR_UNDEAD)
return true;
break;
}