Core/Spells: Use spellLevel for miss chance calculations if caster is a trigger NPC and its level is lower than spell

This commit is contained in:
Shauren
2011-05-16 13:22:13 +02:00
parent a2ee751a6c
commit 243daed3a0

View File

@@ -2473,7 +2473,10 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell)
SpellSchoolMask schoolMask = GetSpellSchoolMask(spell);
// PvP - PvE spell misschances per leveldif > 2
int32 lchance = pVictim->GetTypeId() == TYPEID_PLAYER ? 7 : 11;
int32 leveldif = int32(pVictim->getLevelForTarget(this)) - int32(getLevelForTarget(pVictim));
int32 thisLevel = getLevelForTarget(pVictim);
if (GetTypeId() == TYPEID_UNIT && ToCreature()->isTrigger())
thisLevel = std::max<int32>(thisLevel, spell->spellLevel);
int32 leveldif = int32(pVictim->getLevelForTarget(this)) - thisLevel;
// Base hit chance from attacker and victim levels
int32 modHitChance;