mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 13:09:50 -04:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user