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