My place holder is being added into DOL shortly and will take it's place in GameNPC.cs FollowTimerCallback method.
- Code: Select all
//if the npc hasn't hit or been hit in a while, stop following and return home
StandardMobBrain brain = this.Brain as StandardMobBrain;
if (AttackState && brain != null)
{
int seconds = 10 + ((brain.GetAggroAmountForLiving(followTarget) / MaxHealth + 1) * 100);
int lastattacked = m_lastAttackTick;
int lasthit = m_lastAttackedByEnemyTick;
if (CurrentRegion.Time - lastattacked > seconds * 1000 && CurrentRegion.Time - lasthit > seconds * 1000)
{
StopFollow();
Notify(GameNPCEvent.FollowLostTarget, this, new FollowLostTargetEventArgs(followTarget));
this.WalkToSpawn();
return 0;
}
}
Any thoughts about this formula?
if a mob has 100 health, all damages can be converted into %
doing 10% damage of the max health will make it give up after 19 seconds of not being able to hit you
doing 50% damage of the max health will make it give up after 59 seconds
doing 90% damageof the max health will make it give up after 99 seconds