Browse Source

logic for wall archers

master
FatBoy-DOTC 2 years ago
parent
commit
0448448263
  1. 63
      src/engine/ai/MobileFSM.java

63
src/engine/ai/MobileFSM.java

@ -502,29 +502,12 @@ public class MobileFSM {
} }
if(mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()){ if(mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()){
//this is a player slotted guard minion //this is a player slotted guard minion
if(mob.despawned){ GuardMinionLogic(mob);
if(System.currentTimeMillis() > mob.deathTime + (mob.spawnTime * 1000)){
if(mob.getEquipmentSetID() != ((Mob)mob.npcOwner).getEquipmentSetID()){
mob.equipmentSetID = ((Mob)mob.npcOwner).getEquipmentSetID();
mob.runAfterLoad();
}
mob.respawn();
}
return; return;
} }
if(mob.isAlive() == false){ if(mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardWallArcher.ordinal()){
CheckForRespawn(mob); //this is a player slotted guard minion
return; GuardWallArcherLogic(mob);
}
CheckToSendMobHome(mob);
if(mob.npcOwner.isAlive() == false){
CheckForPlayerGuardAggro(mob);
return;
}
CheckMobMovement(mob);
if(mob.getCombatTarget() != null){
CheckForAttack(mob);
}
return; return;
} }
if (mob.isPet() == false && mob.isSummonedPet() == false && mob.isNecroPet() == false) { if (mob.isPet() == false && mob.isSummonedPet() == false && mob.isNecroPet() == false) {
@ -783,6 +766,44 @@ public class MobileFSM {
} }
} }
public static void GuardMinionLogic(Mob mob){
if(mob.despawned){
if(System.currentTimeMillis() > mob.deathTime + (mob.spawnTime * 1000)){
if(mob.getEquipmentSetID() != ((Mob)mob.npcOwner).getEquipmentSetID()){
mob.equipmentSetID = ((Mob)mob.npcOwner).getEquipmentSetID();
mob.runAfterLoad();
}
mob.respawn();
}
return;
}
if(mob.isAlive() == false){
CheckForRespawn(mob);
return;
}
CheckToSendMobHome(mob);
if(mob.npcOwner.isAlive() == false){
CheckForPlayerGuardAggro(mob);
return;
}
CheckMobMovement(mob);
if(mob.getCombatTarget() != null){
CheckForAttack(mob);
}
}
public static void GuardWallArcherLogic(Mob mob){
if(mob.isAlive() == false){
CheckForRespawn(mob);
return;
}
if(mob.npcOwner.isAlive() == false){
CheckForPlayerGuardAggro(mob);
return;
}
if(mob.getCombatTarget() != null){
CheckForAttack(mob);
}
}
public static void CheckForPlayerGuardAggro(Mob mob) { public static void CheckForPlayerGuardAggro(Mob mob) {
//looks for and sets mobs combatTarget //looks for and sets mobs combatTarget
if (!mob.isAlive()) { if (!mob.isAlive()) {

Loading…
Cancel
Save