mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 13:30:06 +00:00
Aggro is now affected by level
This commit is contained in:
parent
33a26cda7c
commit
540c37a523
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user