diff options
author | Shauren <shauren.trinity@gmail.com> | 2011-05-16 13:22:13 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2011-05-16 13:22:13 +0200 |
commit | 243daed3a093da53b9f3b8a5837dffd87de04d4b (patch) | |
tree | 97debb70f7dc87e7fa72f6dd958ca6f162862279 /src | |
parent | a2ee751a6cc607adde02dd3dac9ce93190e2dee9 (diff) |
Core/Spells: Use spellLevel for miss chance calculations if caster is a trigger NPC and its level is lower than spell
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5bc39f39514..fc0696db0a1 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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; |