| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -96,7 +96,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                return; | 
					 | 
					 | 
					 | 
					                return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.BehaviourType.callsForHelp) | 
					 | 
					 | 
					 | 
					            if (mob.behaviourType.callsForHelp) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                MobCallForHelp(mob); | 
					 | 
					 | 
					 | 
					                MobCallForHelp(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (!MovementUtilities.inRangeDropAggro(mob, target)) { | 
					 | 
					 | 
					 | 
					            if (!MovementUtilities.inRangeDropAggro(mob, target)) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -155,7 +155,9 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    public static void AttackBuilding(Mob mob, Building target) { | 
					 | 
					 | 
					 | 
					    public static void AttackBuilding(Mob mob, Building target) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        try { | 
					 | 
					 | 
					 | 
					        try { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					            if(target == null){ | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (target.getRank() == -1 || !target.isVulnerable() || BuildingManager.getBuildingFromCache(target.getObjectUUID()) == null) { | 
					 | 
					 | 
					 | 
					            if (target.getRank() == -1 || !target.isVulnerable() || BuildingManager.getBuildingFromCache(target.getObjectUUID()) == null) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                mob.setCombatTarget(null); | 
					 | 
					 | 
					 | 
					                mob.setCombatTarget(null); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                return; | 
					 | 
					 | 
					 | 
					                return; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -165,7 +167,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (playercity != null) | 
					 | 
					 | 
					 | 
					            if (playercity != null) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                for (Mob guard : playercity.getParent().zoneMobSet) | 
					 | 
					 | 
					 | 
					                for (Mob guard : playercity.getParent().zoneMobSet) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if (guard.BehaviourType != null && guard.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardCaptain.ordinal()) | 
					 | 
					 | 
					 | 
					                    if (guard.behaviourType != null && guard.behaviourType.equals(Enum.MobBehaviourType.GuardCaptain)) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        if (guard.getCombatTarget() == null && !guard.getGuild().equals(mob.getGuild())) | 
					 | 
					 | 
					 | 
					                        if (guard.getCombatTarget() == null && !guard.getGuild().equals(mob.getGuild())) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                            guard.setCombatTarget(mob); | 
					 | 
					 | 
					 | 
					                            guard.setCombatTarget(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -202,6 +204,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } catch (Exception e) { | 
					 | 
					 | 
					 | 
					        } catch (Exception e) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            mob.setCombatTarget(null); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: AttackBuilding" + " " + e.getMessage()); | 
					 | 
					 | 
					 | 
					            Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: AttackBuilding" + " " + e.getMessage()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -260,7 +263,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            //guard captains inherit barracks patrol points dynamically
 | 
					 | 
					 | 
					 | 
					            //guard captains inherit barracks patrol points dynamically
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardCaptain.ordinal()) { | 
					 | 
					 | 
					 | 
					            if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardCaptain)) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                Building barracks = mob.building; | 
					 | 
					 | 
					 | 
					                Building barracks = mob.building; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -280,7 +283,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            MovementUtilities.aiMove(mob, mob.destination, true); | 
					 | 
					 | 
					 | 
					            MovementUtilities.aiMove(mob, mob.destination, true); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.BehaviourType.equals(Enum.MobBehaviourType.GuardCaptain)) | 
					 | 
					 | 
					 | 
					            if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardCaptain)) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                for (Entry<Mob, Integer> minion : mob.siegeMinionMap.entrySet()) | 
					 | 
					 | 
					 | 
					                for (Entry<Mob, Integer> minion : mob.siegeMinionMap.entrySet()) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    //make sure mob is out of combat stance
 | 
					 | 
					 | 
					 | 
					                    //make sure mob is out of combat stance
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -312,9 +315,9 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                int contractID; | 
					 | 
					 | 
					 | 
					                int contractID; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if(mob.BehaviourType.equals(Enum.MobBehaviourType.GuardMinion)) | 
					 | 
					 | 
					 | 
					                if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardMinion)) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    contractID = mob.npcOwner.contract.getContractID(); | 
					 | 
					 | 
					 | 
					                    contractID = mob.guardCaptain.contract.getContractID(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                 else | 
					 | 
					 | 
					 | 
					                else | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    contractID = mob.contract.getContractID(); | 
					 | 
					 | 
					 | 
					                    contractID = mob.contract.getContractID(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if(Enum.MinionType.ContractToMinionMap.get(contractID).isMage() == false) | 
					 | 
					 | 
					 | 
					                if(Enum.MinionType.ContractToMinionMap.get(contractID).isMage() == false) | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -350,7 +353,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            ArrayList<Integer> purgeTokens; | 
					 | 
					 | 
					 | 
					            ArrayList<Integer> purgeTokens; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            AbstractCharacter target = (AbstractCharacter) mob.getCombatTarget(); | 
					 | 
					 | 
					 | 
					            AbstractCharacter target = (AbstractCharacter) mob.getCombatTarget(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.BehaviourType.callsForHelp) | 
					 | 
					 | 
					 | 
					            if (mob.behaviourType.callsForHelp) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                MobCallForHelp(mob); | 
					 | 
					 | 
					 | 
					                MobCallForHelp(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            // Generate a list of tokens from the mob powers for this mobile.
 | 
					 | 
					 | 
					 | 
					            // Generate a list of tokens from the mob powers for this mobile.
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -433,7 +436,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            ArrayList<Integer> purgeTokens; | 
					 | 
					 | 
					 | 
					            ArrayList<Integer> purgeTokens; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            AbstractCharacter target = (AbstractCharacter) mob.getCombatTarget(); | 
					 | 
					 | 
					 | 
					            AbstractCharacter target = (AbstractCharacter) mob.getCombatTarget(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.BehaviourType.callsForHelp) | 
					 | 
					 | 
					 | 
					            if (mob.behaviourType.callsForHelp) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                MobCallForHelp(mob); | 
					 | 
					 | 
					 | 
					                MobCallForHelp(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            // Generate a list of tokens from the mob powers for this mobile.
 | 
					 | 
					 | 
					 | 
					            // Generate a list of tokens from the mob powers for this mobile.
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -564,7 +567,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            Zone mobCamp = mob.getParentZone(); | 
					 | 
					 | 
					 | 
					            Zone mobCamp = mob.getParentZone(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            for (Mob helper : mobCamp.zoneMobSet) { | 
					 | 
					 | 
					 | 
					            for (Mob helper : mobCamp.zoneMobSet) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (helper.BehaviourType.respondsToCallForHelp && helper.BehaviourType.BehaviourHelperType.equals(mob.BehaviourType)) { | 
					 | 
					 | 
					 | 
					                if (helper.behaviourType.respondsToCallForHelp && helper.behaviourType.BehaviourHelperType.equals(mob.behaviourType)) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    helper.setCombatTarget(mob.getCombatTarget()); | 
					 | 
					 | 
					 | 
					                    helper.setCombatTarget(mob.getCombatTarget()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    callGotResponse = true; | 
					 | 
					 | 
					 | 
					                    callGotResponse = true; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                } | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -608,8 +611,8 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.despawned && mob.isPlayerGuard) { | 
					 | 
					 | 
					 | 
					            if (mob.despawned && mob.isPlayerGuard) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()) { | 
					 | 
					 | 
					 | 
					                if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardMinion)) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if (mob.npcOwner.isAlive() == false || ((Mob) mob.npcOwner).despawned == true) { | 
					 | 
					 | 
					 | 
					                    if (mob.guardCaptain.isAlive() == false || ((Mob) mob.guardCaptain).despawned == true) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        //minions don't respawn while guard captain is dead
 | 
					 | 
					 | 
					 | 
					                        //minions don't respawn while guard captain is dead
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -625,7 +628,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                //check to send mob home for player guards to prevent exploit of dragging guards away and then teleporting
 | 
					 | 
					 | 
					 | 
					                //check to send mob home for player guards to prevent exploit of dragging guards away and then teleporting
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (mob.BehaviourType.ordinal() != Enum.MobBehaviourType.Pet1.ordinal()) | 
					 | 
					 | 
					 | 
					                if (mob.behaviourType.equals(Enum.MobBehaviourType.Pet1) == false) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    CheckToSendMobHome(mob); | 
					 | 
					 | 
					 | 
					                    CheckToSendMobHome(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                return; | 
					 | 
					 | 
					 | 
					                return; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -646,7 +649,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                return; | 
					 | 
					 | 
					 | 
					                return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.BehaviourType.ordinal() != Enum.MobBehaviourType.Pet1.ordinal()) | 
					 | 
					 | 
					 | 
					            if (mob.behaviourType.equals(Enum.MobBehaviourType.Pet1) == false) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                CheckToSendMobHome(mob); | 
					 | 
					 | 
					 | 
					                CheckToSendMobHome(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.getCombatTarget() != null) { | 
					 | 
					 | 
					 | 
					            if (mob.getCombatTarget() != null) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -673,7 +676,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                } | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            switch (mob.BehaviourType) { | 
					 | 
					 | 
					 | 
					            switch (mob.behaviourType) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                case GuardCaptain: | 
					 | 
					 | 
					 | 
					                case GuardCaptain: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    GuardCaptainLogic(mob); | 
					 | 
					 | 
					 | 
					                    GuardCaptainLogic(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    break; | 
					 | 
					 | 
					 | 
					                    break; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -684,6 +687,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    GuardWallArcherLogic(mob); | 
					 | 
					 | 
					 | 
					                    GuardWallArcherLogic(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    break; | 
					 | 
					 | 
					 | 
					                    break; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                case Pet1: | 
					 | 
					 | 
					 | 
					                case Pet1: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                case SiegeEngine: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    PetLogic(mob); | 
					 | 
					 | 
					 | 
					                    PetLogic(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    break; | 
					 | 
					 | 
					 | 
					                    break; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                case HamletGuard: | 
					 | 
					 | 
					 | 
					                case HamletGuard: | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -693,8 +697,6 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    DefaultLogic(mob); | 
					 | 
					 | 
					 | 
					                    DefaultLogic(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    break; | 
					 | 
					 | 
					 | 
					                    break; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if(mob.isAlive()) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                RecoverHealth(mob); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } catch (Exception e) { | 
					 | 
					 | 
					 | 
					        } catch (Exception e) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: DetermineAction" + " " + e.getMessage()); | 
					 | 
					 | 
					 | 
					            Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: DetermineAction" + " " + e.getMessage()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -709,7 +711,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (!aiAgent.isAlive()) | 
					 | 
					 | 
					 | 
					            if (!aiAgent.isAlive()) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                return; | 
					 | 
					 | 
					 | 
					                return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            ConcurrentHashMap<Integer, Boolean> loadedPlayers = aiAgent.playerAgroMap; | 
					 | 
					 | 
					 | 
					            ConcurrentHashMap<Integer, Float> loadedPlayers = aiAgent.playerAgroMap; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            for (Entry playerEntry : loadedPlayers.entrySet()) { | 
					 | 
					 | 
					 | 
					            for (Entry playerEntry : loadedPlayers.entrySet()) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -784,33 +786,39 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            mob.updateLocation(); | 
					 | 
					 | 
					 | 
					            mob.updateLocation(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            switch (mob.BehaviourType) { | 
					 | 
					 | 
					 | 
					            switch (mob.behaviourType) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                case Pet1: | 
					 | 
					 | 
					 | 
					                case Pet1: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if (mob.getOwner() == null) | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    if ((PlayerCharacter) mob.guardCaptain == null) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        return; | 
					 | 
					 | 
					 | 
					                        return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if (!mob.playerAgroMap.containsKey(mob.getOwner().getObjectUUID())) { | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    if (!mob.playerAgroMap.containsKey(((PlayerCharacter) mob.guardCaptain).getObjectUUID())) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        //mob no longer has its owner loaded, translocate pet to owner
 | 
					 | 
					 | 
					 | 
					                        //mob no longer has its owner loaded, translocate pet to owner
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        MovementManager.translocate(mob, mob.getOwner().getLoc(), null); | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                        MovementManager.translocate(mob, ((PlayerCharacter) mob.guardCaptain).getLoc(), null); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        return; | 
					 | 
					 | 
					 | 
					                        return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    } | 
					 | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if (mob.getCombatTarget() == null) { | 
					 | 
					 | 
					 | 
					                    if (mob.getCombatTarget() == null) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        //move back to owner
 | 
					 | 
					 | 
					 | 
					                        //move back to owner
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        if (CombatUtilities.inRange2D(mob, mob.getOwner(), 6)) | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                        if (CombatUtilities.inRange2D(mob, (PlayerCharacter) mob.guardCaptain, 6)) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                            return; | 
					 | 
					 | 
					 | 
					                            return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        mob.destination = mob.getOwner().getLoc(); | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                        mob.destination = ((PlayerCharacter) mob.guardCaptain).getLoc(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        MovementUtilities.moveToLocation(mob, mob.destination, 5); | 
					 | 
					 | 
					 | 
					                        MovementUtilities.moveToLocation(mob, mob.destination, 5); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    } else | 
					 | 
					 | 
					 | 
					                    } else | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        chaseTarget(mob); | 
					 | 
					 | 
					 | 
					                        chaseTarget(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    break; | 
					 | 
					 | 
					 | 
					                    break; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                case GuardMinion: | 
					 | 
					 | 
					 | 
					                case GuardMinion: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if (!mob.npcOwner.isAlive() && mob.getCombatTarget() == null) | 
					 | 
					 | 
					 | 
					                    if (!mob.guardCaptain.isAlive() || ((Mob) mob.guardCaptain).despawned) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        randomGuardPatrolPoint(mob); | 
					 | 
					 | 
					 | 
					                        randomGuardPatrolPoint(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    else { | 
					 | 
					 | 
					 | 
					                    else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        if (mob.getCombatTarget() != null) { | 
					 | 
					 | 
					 | 
					                        if (mob.getCombatTarget() != null) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -829,7 +837,6 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        chaseTarget(mob); | 
					 | 
					 | 
					 | 
					                        chaseTarget(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    } | 
					 | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    break; | 
					 | 
					 | 
					 | 
					                    break; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } catch (Exception e) { | 
					 | 
					 | 
					 | 
					        } catch (Exception e) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: CheckMobMovement" + " " + e.getMessage()); | 
					 | 
					 | 
					 | 
					            Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: CheckMobMovement" + " " + e.getMessage()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -896,7 +903,8 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.getCombatTarget() == null) | 
					 | 
					 | 
					 | 
					            if (mob.getCombatTarget() == null) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                return; | 
					 | 
					 | 
					 | 
					                return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.getCombatTarget().getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && MovementUtilities.inRangeDropAggro(mob, (PlayerCharacter) mob.getCombatTarget()) == false && mob.BehaviourType.ordinal() != Enum.MobBehaviourType.Pet1.ordinal()) { | 
					 | 
					 | 
					 | 
					            if (mob.getCombatTarget().getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && MovementUtilities.inRangeDropAggro(mob, (PlayerCharacter) mob.getCombatTarget()) == false && | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    mob.behaviourType.equals(Enum.MobBehaviourType.Pet1) == false) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                mob.setCombatTarget(null); | 
					 | 
					 | 
					 | 
					                mob.setCombatTarget(null); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                return; | 
					 | 
					 | 
					 | 
					                return; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -912,10 +920,10 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private static void CheckToSendMobHome(Mob mob) { | 
					 | 
					 | 
					 | 
					    private static void CheckToSendMobHome(Mob mob) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        try { | 
					 | 
					 | 
					 | 
					        try { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.BehaviourType.isAgressive) { | 
					 | 
					 | 
					 | 
					            if (mob.behaviourType.isAgressive) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (mob.isPlayerGuard()) { | 
					 | 
					 | 
					 | 
					                if (mob.isPlayerGuard()) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardCaptain.ordinal()) | 
					 | 
					 | 
					 | 
					                    if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardCaptain)) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        CheckForPlayerGuardAggro(mob); | 
					 | 
					 | 
					 | 
					                        CheckForPlayerGuardAggro(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                } else { | 
					 | 
					 | 
					 | 
					                } else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    CheckForAggro(mob); | 
					 | 
					 | 
					 | 
					                    CheckForAggro(mob); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -935,7 +943,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    PowersManager.useMobPower(mob, mob, recall, 40); | 
					 | 
					 | 
					 | 
					                    PowersManager.useMobPower(mob, mob, recall, 40); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    mob.setCombatTarget(null); | 
					 | 
					 | 
					 | 
					                    mob.setCombatTarget(null); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardCaptain.ordinal() && mob.isAlive()) { | 
					 | 
					 | 
					 | 
					                    if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardCaptain) && mob.isAlive()) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        //guard captain pulls his minions home with him
 | 
					 | 
					 | 
					 | 
					                        //guard captain pulls his minions home with him
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -951,8 +959,8 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                PowersManager.useMobPower(mob, mob, recall, 40); | 
					 | 
					 | 
					 | 
					                PowersManager.useMobPower(mob, mob, recall, 40); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                mob.setCombatTarget(null); | 
					 | 
					 | 
					 | 
					                mob.setCombatTarget(null); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                for (Entry playerEntry : mob.playerAgroMap.entrySet()) | 
					 | 
					 | 
					 | 
					                for (Integer playerEntry : mob.playerAgroMap.keySet()) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    PlayerCharacter.getFromCache((int) playerEntry.getKey()).setHateValue(0); | 
					 | 
					 | 
					 | 
					                    mob.playerAgroMap.put(playerEntry,0f); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } catch (Exception e) { | 
					 | 
					 | 
					 | 
					        } catch (Exception e) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: CheckToSendMobHome" + " " + e.getMessage()); | 
					 | 
					 | 
					 | 
					            Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: CheckToSendMobHome" + " " + e.getMessage()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -1016,7 +1024,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if ((aggroMob.agentType.equals(Enum.AIAgentType.GUARD))) | 
					 | 
					 | 
					 | 
					                if ((aggroMob.agentType.equals(Enum.AIAgentType.GUARD))) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    continue; | 
					 | 
					 | 
					 | 
					                    continue; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if(aggroMob.BehaviourType.equals(Enum.MobBehaviourType.Pet1)) | 
					 | 
					 | 
					 | 
					                if (aggroMob.behaviourType.equals(Enum.MobBehaviourType.Pet1)) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    continue; | 
					 | 
					 | 
					 | 
					                    continue; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (mob.getLoc().distanceSquared2D(aggroMob.getLoc()) > sqr(50)) | 
					 | 
					 | 
					 | 
					                if (mob.getLoc().distanceSquared2D(aggroMob.getLoc()) > sqr(50)) | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -1046,6 +1054,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    mob.setCombatTarget(newTarget); | 
					 | 
					 | 
					 | 
					                    mob.setCombatTarget(newTarget); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            CheckMobMovement(mob); | 
					 | 
					 | 
					 | 
					            CheckMobMovement(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            CheckForAttack(mob); | 
					 | 
					 | 
					 | 
					            CheckForAttack(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } catch (Exception e) { | 
					 | 
					 | 
					 | 
					        } catch (Exception e) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -1056,15 +1065,29 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    public static void GuardMinionLogic(Mob mob) { | 
					 | 
					 | 
					 | 
					    public static void GuardMinionLogic(Mob mob) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        try { | 
					 | 
					 | 
					 | 
					        try { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            boolean isComanded = mob.npcOwner.isAlive(); | 
					 | 
					 | 
					 | 
					            if (!mob.guardCaptain.isAlive()) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (!isComanded) { | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                GuardCaptainLogic(mob); | 
					 | 
					 | 
					 | 
					                if (mob.getCombatTarget() == null) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    CheckForPlayerGuardAggro(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                } else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    AbstractWorldObject newTarget = ChangeTargetFromHateValue(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    if (newTarget != null) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                        if (newTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                            if (GuardCanAggro(mob, (PlayerCharacter) newTarget)) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                                mob.setCombatTarget(newTarget); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                        } else | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                            mob.setCombatTarget(newTarget); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            }else { | 
					 | 
					 | 
					 | 
					            }else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (mob.npcOwner.getCombatTarget() != null) | 
					 | 
					 | 
					 | 
					                if (mob.guardCaptain.getCombatTarget() != null) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    mob.setCombatTarget(mob.npcOwner.getCombatTarget()); | 
					 | 
					 | 
					 | 
					                    mob.setCombatTarget(mob.guardCaptain.getCombatTarget()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                else | 
					 | 
					 | 
					 | 
					                else if (mob.getCombatTarget() != null) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if (mob.getCombatTarget() != null) | 
					 | 
					 | 
					 | 
					                    mob.setCombatTarget(null); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        mob.setCombatTarget(null); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            CheckMobMovement(mob); | 
					 | 
					 | 
					 | 
					            CheckMobMovement(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            CheckForAttack(mob); | 
					 | 
					 | 
					 | 
					            CheckForAttack(mob); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -1089,14 +1112,31 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        try { | 
					 | 
					 | 
					 | 
					        try { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.getOwner() == null && mob.isNecroPet() == false && mob.isSiege() == false) | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (mob.guardCaptain == null && mob.isNecroPet() == false && mob.isSiege() == false) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (ZoneManager.getSeaFloor().zoneMobSet.contains(mob)) | 
					 | 
					 | 
					 | 
					                if (ZoneManager.getSeaFloor().zoneMobSet.contains(mob)) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    mob.killCharacter("no owner"); | 
					 | 
					 | 
					 | 
					                    mob.killCharacter("no owner"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (MovementUtilities.canMove(mob) && mob.BehaviourType.canRoam) | 
					 | 
					 | 
					 | 
					            if (MovementUtilities.canMove(mob) && mob.behaviourType.canRoam) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                CheckMobMovement(mob); | 
					 | 
					 | 
					 | 
					                CheckMobMovement(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            CheckForAttack(mob); | 
					 | 
					 | 
					 | 
					            CheckForAttack(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //recover health
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (mob.getTimestamps().containsKey("HEALTHRECOVERED") == false) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (mob.isSit() && mob.getTimeStamp("HEALTHRECOVERED") < System.currentTimeMillis() + 3000) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                if (mob.getHealth() < mob.getHealthMax()) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    float recoveredHealth = mob.getHealthMax() * ((1 + mob.getBonuses().getFloatPercentAll(Enum.ModType.HealthRecoverRate, Enum.SourceType.None)) * 0.01f); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    mob.setHealth(mob.getHealth() + recoveredHealth); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    if (mob.getHealth() > mob.getHealthMax()) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                        mob.setHealth(mob.getHealthMax()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } catch (Exception e) { | 
					 | 
					 | 
					 | 
					        } catch (Exception e) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: PetLogic" + " " + e.getMessage()); | 
					 | 
					 | 
					 | 
					            Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: PetLogic" + " " + e.getMessage()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -1127,7 +1167,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.getCombatTarget() != null && mob.playerAgroMap.containsKey(mob.getCombatTarget().getObjectUUID()) == false) | 
					 | 
					 | 
					 | 
					            if (mob.getCombatTarget() != null && mob.playerAgroMap.containsKey(mob.getCombatTarget().getObjectUUID()) == false) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                mob.setCombatTarget(null); | 
					 | 
					 | 
					 | 
					                mob.setCombatTarget(null); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.BehaviourType.isAgressive) { | 
					 | 
					 | 
					 | 
					            if (mob.behaviourType.isAgressive) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                AbstractWorldObject newTarget = ChangeTargetFromHateValue(mob); | 
					 | 
					 | 
					 | 
					                AbstractWorldObject newTarget = ChangeTargetFromHateValue(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -1135,7 +1175,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    mob.setCombatTarget(newTarget); | 
					 | 
					 | 
					 | 
					                    mob.setCombatTarget(newTarget); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                else { | 
					 | 
					 | 
					 | 
					                else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if (mob.getCombatTarget() == null) { | 
					 | 
					 | 
					 | 
					                    if (mob.getCombatTarget() == null) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        if (mob.BehaviourType == Enum.MobBehaviourType.HamletGuard) | 
					 | 
					 | 
					 | 
					                        if (mob.behaviourType == Enum.MobBehaviourType.HamletGuard) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                            SafeGuardAggro(mob);  //safehold guard
 | 
					 | 
					 | 
					 | 
					                            SafeGuardAggro(mob);  //safehold guard
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        else | 
					 | 
					 | 
					 | 
					                        else | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                            CheckForAggro(mob);   //normal aggro
 | 
					 | 
					 | 
					 | 
					                            CheckForAggro(mob);   //normal aggro
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -1145,12 +1185,12 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            //check if mob can move for patrol or moving to target
 | 
					 | 
					 | 
					 | 
					            //check if mob can move for patrol or moving to target
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.BehaviourType.canRoam) | 
					 | 
					 | 
					 | 
					            if (mob.behaviourType.canRoam) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                CheckMobMovement(mob); | 
					 | 
					 | 
					 | 
					                CheckMobMovement(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            //check if mob can attack if it isn't wimpy
 | 
					 | 
					 | 
					 | 
					            //check if mob can attack if it isn't wimpy
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (!mob.BehaviourType.isWimpy && mob.getCombatTarget() != null) | 
					 | 
					 | 
					 | 
					            if (!mob.behaviourType.isWimpy && mob.getCombatTarget() != null) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                CheckForAttack(mob); | 
					 | 
					 | 
					 | 
					                CheckForAttack(mob); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } catch (Exception e) { | 
					 | 
					 | 
					 | 
					        } catch (Exception e) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -1167,7 +1207,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (!mob.isAlive()) | 
					 | 
					 | 
					 | 
					            if (!mob.isAlive()) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                return; | 
					 | 
					 | 
					 | 
					                return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            ConcurrentHashMap<Integer, Boolean> loadedPlayers = mob.playerAgroMap; | 
					 | 
					 | 
					 | 
					            ConcurrentHashMap<Integer, Float> loadedPlayers = mob.playerAgroMap; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            for (Entry playerEntry : loadedPlayers.entrySet()) { | 
					 | 
					 | 
					 | 
					            for (Entry playerEntry : loadedPlayers.entrySet()) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -1215,8 +1255,8 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.getGuild().getNation().equals(target.getGuild().getNation())) | 
					 | 
					 | 
					 | 
					            if (mob.getGuild().getNation().equals(target.getGuild().getNation())) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                return false; | 
					 | 
					 | 
					 | 
					                return false; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()) { | 
					 | 
					 | 
					 | 
					            if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardMinion)) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (((Mob) mob.npcOwner).building.getCity().cityOutlaws.contains(target.getObjectUUID()) == true) { | 
					 | 
					 | 
					 | 
					                if (((Mob) mob.guardCaptain).building.getCity().cityOutlaws.contains(target.getObjectUUID()) == true) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    return true; | 
					 | 
					 | 
					 | 
					                    return true; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                } | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } else if (mob.building.getCity().cityOutlaws.contains(target.getObjectUUID()) == true) { | 
					 | 
					 | 
					 | 
					            } else if (mob.building.getCity().cityOutlaws.contains(target.getObjectUUID()) == true) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -1300,7 +1340,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            MovementUtilities.aiMove(mob, mob.destination, true); | 
					 | 
					 | 
					 | 
					            MovementUtilities.aiMove(mob, mob.destination, true); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardCaptain.ordinal()) { | 
					 | 
					 | 
					 | 
					            if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardCaptain)) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                for (Entry<Mob, Integer> minion : mob.siegeMinionMap.entrySet()) { | 
					 | 
					 | 
					 | 
					                for (Entry<Mob, Integer> minion : mob.siegeMinionMap.entrySet()) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    //make sure mob is out of combat stance
 | 
					 | 
					 | 
					 | 
					                    //make sure mob is out of combat stance
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -1327,7 +1367,7 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            float CurrentHateValue = 0; | 
					 | 
					 | 
					 | 
					            float CurrentHateValue = 0; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.getCombatTarget() != null && mob.getCombatTarget().getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) | 
					 | 
					 | 
					 | 
					            if (mob.getCombatTarget() != null && mob.getCombatTarget().getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                CurrentHateValue = ((PlayerCharacter) mob.getCombatTarget()).getHateValue(); | 
					 | 
					 | 
					 | 
					                CurrentHateValue = mob.playerAgroMap.get(mob.combatTarget.getObjectUUID()).floatValue(); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            AbstractWorldObject mostHatedTarget = null; | 
					 | 
					 | 
					 | 
					            AbstractWorldObject mostHatedTarget = null; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -1338,8 +1378,8 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (potentialTarget.equals(mob.getCombatTarget())) | 
					 | 
					 | 
					 | 
					                if (potentialTarget.equals(mob.getCombatTarget())) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    continue; | 
					 | 
					 | 
					 | 
					                    continue; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (potentialTarget != null && potentialTarget.getHateValue() > CurrentHateValue && MovementUtilities.inRangeToAggro(mob, potentialTarget)) { | 
					 | 
					 | 
					 | 
					                if (potentialTarget != null && mob.playerAgroMap.get(potentialTarget.getObjectUUID()).floatValue() > CurrentHateValue && MovementUtilities.inRangeToAggro(mob, potentialTarget)) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    CurrentHateValue = potentialTarget.getHateValue(); | 
					 | 
					 | 
					 | 
					                    CurrentHateValue = mob.playerAgroMap.get(potentialTarget.getObjectUUID()).floatValue(); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    mostHatedTarget = potentialTarget; | 
					 | 
					 | 
					 | 
					                    mostHatedTarget = potentialTarget; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                } | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -1350,22 +1390,4 @@ public class MobAI { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return null; | 
					 | 
					 | 
					 | 
					        return null; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    public static void RecoverHealth(Mob mob){ | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        //recover health
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (mob.getTimestamps().containsKey("HEALTHRECOVERED") == false) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis()); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (mob.isSit() && mob.getTimeStamp("HEALTHRECOVERED") < System.currentTimeMillis() + 3000) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (mob.getHealth() < mob.getHealthMax()) { | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                float recoveredHealth = mob.getHealthMax() * ((1 + mob.getBonuses().getFloatPercentAll(Enum.ModType.HealthRecoverRate, Enum.SourceType.None)) * 0.01f); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                mob.setHealth(mob.getHealth() + recoveredHealth); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis()); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (mob.getHealth() > mob.getHealthMax()) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    mob.setHealth(mob.getHealthMax()); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} |