Browse Source

no more skating rink

master
FatBoy-DOTC 2 years ago
parent
commit
90ae798bb8
  1. 7
      src/engine/ai/MobileFSM.java

7
src/engine/ai/MobileFSM.java

@ -226,9 +226,6 @@ public class MobileFSM {
return false; return false;
if (mob.mobPowers.isEmpty()) if (mob.mobPowers.isEmpty())
return false; return false;
//added in cast chance for mobs, editable by MBServerStatics.AI_POWER_CHANCE
if(ThreadLocalRandom.current().nextInt(100) > MBServerStatics.AI_POWER_CHANCE)
return false;
if (mob.nextCastTime == 0) if (mob.nextCastTime == 0)
mob.nextCastTime = System.currentTimeMillis(); mob.nextCastTime = System.currentTimeMillis();
return mob.nextCastTime <= System.currentTimeMillis(); return mob.nextCastTime <= System.currentTimeMillis();
@ -422,6 +419,8 @@ public class MobileFSM {
if (mob.getCombatTarget() == null) { if (mob.getCombatTarget() == null) {
if(!mob.isMoving()) { if(!mob.isMoving()) {
Patrol(mob); Patrol(mob);
} else{
mob.stopPatrolTime = System.currentTimeMillis();
} }
}else { }else {
chaseTarget(mob); chaseTarget(mob);
@ -466,7 +465,7 @@ public class MobileFSM {
//checks if mob can attack based on attack timer and range //checks if mob can attack based on attack timer and range
if (mob.isAlive() == false) if (mob.isAlive() == false)
return; return;
if (MovementUtilities.inRangeDropAggro(mob, (AbstractCharacter)mob.getCombatTarget()) == false) { if (mob.getCombatTarget().getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && MovementUtilities.inRangeDropAggro(mob, (PlayerCharacter)mob.getCombatTarget()) == false) {
mob.setCombatTarget(null); mob.setCombatTarget(null);
if (mob.isCombat()) { if (mob.isCombat()) {
mob.setCombat(false); mob.setCombat(false);

Loading…
Cancel
Save