From 540c37a52350695526abbb559b90a6b4abbd6f26 Mon Sep 17 00:00:00 2001 From: Jade Date: Sat, 9 Jan 2021 15:09:04 +0000 Subject: [PATCH] Aggro is now affected by level --- src/MobManager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/MobManager.cpp b/src/MobManager.cpp index fb162f7..b35ba14 100644 --- a/src/MobManager.cpp +++ b/src/MobManager.cpp @@ -1228,6 +1228,14 @@ bool MobManager::aggroCheck(Mob *mob, time_t currTime) { || RacingManager::EPRaces.find(s) != RacingManager::EPRaces.end()) mobRange /= 3; + // 0.33x - 1.66x the range + int levelDifference = plr->level - mob->level; + if (levelDifference > -10) + mobRange = levelDifference < 10 ? mobRange - (levelDifference * mobRange / 15) : mobRange / 3; + + if (mob->state != MobState::ROAMING && plr->inCombat) // freshly out of aggro mobs + mobRange = mob->sightRange * 2; // should not be impacted by the above + if (plr->iSpecialState & (CN_SPECIAL_STATE_FLAG__INVISIBLE|CN_SPECIAL_STATE_FLAG__INVULNERABLE)) mobRange = -1;