diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SharedDefines.h | 1 | ||||
-rw-r--r-- | src/game/Spell.cpp | 9 | ||||
-rw-r--r-- | src/game/Unit.cpp | 7 |
3 files changed, 8 insertions, 9 deletions
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 441234eed73..0c928361d85 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -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)); diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 047a8d98872..21d7cf0250e 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -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) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index bc43eefbb36..5c666f3778f 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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; } |