aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-04-14 23:09:54 -0300
committerariel- <ariel-@users.noreply.github.com>2017-04-14 23:38:54 -0300
commit2a04599ed8f471e584b3e3f72b210a67a4f1ab1c (patch)
tree0f7c125744f6c3c8c7506538042c0c9944d20572 /src
parent9414f50f5c60b03871b4bd8d147786f77476ea04 (diff)
Core/Unit: implement miss chance reduction for low level mobs
Source: http://wow.gamepedia.com/index.php?title=Miss&oldid=1980141 > Level is not a factor except when attacking a mob level 9 or lower. Miss chance against a low-level mob is a percentage of normal equal to the mob’s level divided by 10.
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 6f0c4873f33..6a4e5a9dbca 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -13033,7 +13033,12 @@ float Unit::MeleeSpellMissChance(Unit const* victim, WeaponAttackType attType, i
if (victim->GetTypeId() == TYPEID_PLAYER)
missChance += diff > 0 ? diff * 0.04f : diff * 0.02f;
else
+ {
missChance += diff > 10 ? 1 + (diff - 10) * 0.4f : diff * 0.1f;
+ float levelFactor = victim->getLevelForTarget(this);
+ if (levelFactor < 10.f)
+ missChance *= (levelFactor / 10.f);
+ }
// Spellmod from SPELLMOD_RESIST_MISS_CHANCE
float resistMissChance = 100.0f;