mirror of
https://github.com/moparisthebest/MoparClassic
synced 2025-02-28 16:31:45 -05:00
Update GameServer/src/org/moparscape/msc/gs/model/Npc.java
Check if Npc is about to start chasing player so it doesn't do a random walking path.
This commit is contained in:
parent
96ea6cc2d6
commit
05277352b5
@ -578,13 +578,18 @@ public class Npc extends Mob {
|
||||
Instance.getDelayedEventHandler().add(fighting);
|
||||
}
|
||||
|
||||
if (now - lastMovement > 2200) {
|
||||
lastMovement = now;
|
||||
int rand = DataConversions.random(0, 1);
|
||||
if (!isBusy() && finishedPath() && rand == 1 && !this.isRemoved()) {
|
||||
int newX = DataConversions.random(loc.minX(), loc.maxX());
|
||||
int newY = DataConversions.random(loc.minY(), loc.maxY());
|
||||
super.setPath(new Path(getX(), getY(), newX, newY));
|
||||
if (now - lastMovement > 1800) {
|
||||
if (now - getCombatTimer() < (getCombatState() ==
|
||||
CombatState.WAITING ? 5000 : 500)) {
|
||||
}
|
||||
else {
|
||||
lastMovement = now;
|
||||
int rand = DataConversions.random(0, 1);
|
||||
if (!isBusy() && finishedPath() && rand == 1 && !this.isRemoved()) {
|
||||
int newX = DataConversions.random(loc.minX(), loc.maxX());
|
||||
int newY = DataConversions.random(loc.minY(), loc.maxY());
|
||||
super.setPath(new Path(getX(), getY(), newX, newY));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user