|
|
|
@ -428,22 +428,30 @@ public class MobAI {
@@ -428,22 +428,30 @@ public class MobAI {
|
|
|
|
|
mob.updateLocation(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
boolean combatState = mob.isCombat(); |
|
|
|
|
mob.setCombat(mob.combatTarget != null); |
|
|
|
|
if(combatState != mob.isCombat()){ |
|
|
|
|
//send message to update combat state
|
|
|
|
|
UpdateStateMsg rwss = new UpdateStateMsg(); |
|
|
|
|
rwss.setPlayer(mob); |
|
|
|
|
DispatchMessage.sendToAllInRange(mob, rwss); |
|
|
|
|
} |
|
|
|
|
if(!mob.isPet()) { |
|
|
|
|
boolean combatState = mob.isCombat(); |
|
|
|
|
mob.setCombat(mob.combatTarget != null); |
|
|
|
|
if (combatState != mob.isCombat()) { |
|
|
|
|
//send message to update combat state
|
|
|
|
|
UpdateStateMsg rwss = new UpdateStateMsg(); |
|
|
|
|
rwss.setPlayer(mob); |
|
|
|
|
DispatchMessage.sendToAllInRange(mob, rwss); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
boolean walking = mob.isWalk(); |
|
|
|
|
mob.setWalkMode(mob.combatTarget == null); |
|
|
|
|
if(walking != mob.isWalk()){ |
|
|
|
|
//send message to update run/walk state
|
|
|
|
|
MovementManager.sendRWSSMsg(mob); |
|
|
|
|
boolean walking = mob.isWalk(); |
|
|
|
|
mob.setWalkMode(mob.combatTarget == null); |
|
|
|
|
if (walking != mob.isWalk()) { |
|
|
|
|
//send message to update run/walk state
|
|
|
|
|
MovementManager.sendRWSSMsg(mob); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
boolean walking = mob.isWalk(); |
|
|
|
|
mob.setWalkMode(mob.guardCaptain.isWalk()); |
|
|
|
|
if (walking != mob.isWalk()) { |
|
|
|
|
//send message to update run/walk state
|
|
|
|
|
MovementManager.sendRWSSMsg(mob); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
switch (mob.behaviourType) { |
|
|
|
|
case GuardCaptain: |
|
|
|
|
GuardCaptainLogic(mob); |
|
|
|
|