|
|
@ -56,7 +56,7 @@ public class MobileFSM { |
|
|
|
SpellAggroGrouperWimpy(Spell, true, false, true, false, false), |
|
|
|
SpellAggroGrouperWimpy(Spell, true, false, true, false, false), |
|
|
|
//Independent Types
|
|
|
|
//Independent Types
|
|
|
|
SimpleStandingGuard(null, false, false, false, false, false), |
|
|
|
SimpleStandingGuard(null, false, false, false, false, false), |
|
|
|
Pet1(null, false, false, false, false, false), |
|
|
|
Pet1(null, false, false, true, false, false), |
|
|
|
Simple(null, false, false, true, false, false), |
|
|
|
Simple(null, false, false, true, false, false), |
|
|
|
Helpee(null, false, true, true, false, true), |
|
|
|
Helpee(null, false, true, true, false, true), |
|
|
|
HelpeeWimpy(null, true, false, true, false, false), |
|
|
|
HelpeeWimpy(null, true, false, true, false, false), |
|
|
@ -566,7 +566,11 @@ public class MobileFSM { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
public static void run(Mob mob) { |
|
|
|
public static void run(Mob mob) { |
|
|
|
if (mob == null || mob.BehaviourType == MobBehaviourType.None) { |
|
|
|
if (mob == null) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (mob.isPet() == false && mob.isSummonedPet() == false && mob.isNecroPet() == false) { |
|
|
|
|
|
|
|
if (mob.BehaviourType != null && mob.BehaviourType == MobBehaviourType.None) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (mob.isAlive() == false) { |
|
|
|
if (mob.isAlive() == false) { |
|
|
@ -593,7 +597,12 @@ public class MobileFSM { |
|
|
|
if (!mob.BehaviourType.isWimpy && !mob.isMoving() && mob.combatTarget != null) { |
|
|
|
if (!mob.BehaviourType.isWimpy && !mob.isMoving() && mob.combatTarget != null) { |
|
|
|
CheckForAttack(mob); |
|
|
|
CheckForAttack(mob); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
CheckMobMovement(mob); |
|
|
|
|
|
|
|
CheckForAttack(mob); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void CheckForAggro(Mob aiAgent) { |
|
|
|
private static void CheckForAggro(Mob aiAgent) { |
|
|
|
//looks for and sets mobs combatTarget
|
|
|
|
//looks for and sets mobs combatTarget
|
|
|
|
if (!aiAgent.isAlive()) { |
|
|
|
if (!aiAgent.isAlive()) { |
|
|
@ -629,6 +638,7 @@ public class MobileFSM { |
|
|
|
} |
|
|
|
} |
|
|
|
private static void CheckMobMovement(Mob mob) { |
|
|
|
private static void CheckMobMovement(Mob mob) { |
|
|
|
mob.updateLocation(); |
|
|
|
mob.updateLocation(); |
|
|
|
|
|
|
|
if (mob.isPet() == false && mob.isSummonedPet() == false && mob.isNecroPet() == false) { |
|
|
|
if (mob.getCombatTarget() == null) { |
|
|
|
if (mob.getCombatTarget() == null) { |
|
|
|
//patrol
|
|
|
|
//patrol
|
|
|
|
int patrolRandom = ThreadLocalRandom.current().nextInt(1000); |
|
|
|
int patrolRandom = ThreadLocalRandom.current().nextInt(1000); |
|
|
@ -662,6 +672,28 @@ public class MobileFSM { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else{ |
|
|
|
|
|
|
|
//pet logic
|
|
|
|
|
|
|
|
if (mob.getCombatTarget() == null || mob.combatTarget.isAlive() == false) { |
|
|
|
|
|
|
|
//move back to owner
|
|
|
|
|
|
|
|
if (CombatUtilities.inRange2D(mob, mob.getOwner(), 5) == false) { |
|
|
|
|
|
|
|
mob.destination = mob.getOwner().getLoc(); |
|
|
|
|
|
|
|
MovementUtilities.moveToLocation(mob, mob.destination, 5); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
//chase target
|
|
|
|
|
|
|
|
mob.updateMovementState(); |
|
|
|
|
|
|
|
if (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mob.getRange()) == false) { |
|
|
|
|
|
|
|
if (mob.getRange() > 15) { |
|
|
|
|
|
|
|
mob.destination = mob.getCombatTarget().getLoc(); |
|
|
|
|
|
|
|
MovementUtilities.moveToLocation(mob, mob.destination, 0); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
mob.destination = MovementUtilities.GetDestinationToCharacter(mob, (AbstractCharacter) mob.getCombatTarget()); |
|
|
|
|
|
|
|
MovementUtilities.moveToLocation(mob, mob.destination, mob.getRange()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
private static void CheckForRespawn(Mob aiAgent) { |
|
|
|
private static void CheckForRespawn(Mob aiAgent) { |
|
|
|
//handles checking for respawn of dead mobs even when no players have mob loaded
|
|
|
|
//handles checking for respawn of dead mobs even when no players have mob loaded
|
|
|
|