| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -89,7 +89,6 @@ public class NPC extends AbstractCharacter { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						private int parentZoneID; | 
					 | 
					 | 
					 | 
						private int parentZoneID; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						public ArrayList<ProducedItem> forgedItems = new ArrayList<>(); | 
					 | 
					 | 
					 | 
						public ArrayList<ProducedItem> forgedItems = new ArrayList<>(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						private int fidalityID; | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						private int buildingLevel; | 
					 | 
					 | 
					 | 
						private int buildingLevel; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						private int buildingFloor; | 
					 | 
					 | 
					 | 
						private int buildingFloor; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						public HashMap<Integer, MobEquipment> equip = null; | 
					 | 
					 | 
					 | 
						public HashMap<Integer, MobEquipment> equip = null; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -188,7 +187,6 @@ public class NPC extends AbstractCharacter { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								this.gridObjectType = GridObjectType.STATIC; | 
					 | 
					 | 
					 | 
								this.gridObjectType = GridObjectType.STATIC; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								this.contract = DbManager.ContractQueries.GET_CONTRACT(contractID); | 
					 | 
					 | 
					 | 
								this.contract = DbManager.ContractQueries.GET_CONTRACT(contractID); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								this.fidalityID = (rs.getInt("fidalityID")); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								this.equipmentSetID = rs.getInt("equipmentSet"); | 
					 | 
					 | 
					 | 
								this.equipmentSetID = rs.getInt("equipmentSet"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								this.runeSetID = rs.getInt("runeSet"); | 
					 | 
					 | 
					 | 
								this.runeSetID = rs.getInt("runeSet"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -202,8 +200,7 @@ public class NPC extends AbstractCharacter { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								int mobBaseOverride = rs.getInt("npc_raceID"); | 
					 | 
					 | 
					 | 
								int mobBaseOverride = rs.getInt("npc_raceID"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if ((this.fidalityID != 0) || (mobBaseOverride != 0)) | 
					 | 
					 | 
					 | 
								this.loadID = mobBaseOverride; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									this.loadID = mobBaseOverride; | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								this.mobBase = MobBase.getMobBase(this.loadID); | 
					 | 
					 | 
					 | 
								this.mobBase = MobBase.getMobBase(this.loadID); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								this.level = rs.getByte("npc_level"); | 
					 | 
					 | 
					 | 
								this.level = rs.getByte("npc_level"); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -253,12 +250,6 @@ public class NPC extends AbstractCharacter { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								int guildID = rs.getInt("npc_guildID"); | 
					 | 
					 | 
					 | 
								int guildID = rs.getInt("npc_guildID"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (this.fidalityID != 0){ | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									if (this.building != null) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										this.guild = this.building.getGuild(); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									else | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										this.guild = Guild.getGuild(guildID); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								}else | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									if (this.building != null) | 
					 | 
					 | 
					 | 
									if (this.building != null) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										this.guild = this.building.getGuild(); | 
					 | 
					 | 
					 | 
										this.guild = this.building.getGuild(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									else | 
					 | 
					 | 
					 | 
									else | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -266,9 +257,8 @@ public class NPC extends AbstractCharacter { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (guildID != 0 && (this.guild == null || this.guild.isEmptyGuild())) | 
					 | 
					 | 
					 | 
								if (guildID != 0 && (this.guild == null || this.guild.isEmptyGuild())) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									NPC.Oprhans.add(currentID); | 
					 | 
					 | 
					 | 
									NPC.Oprhans.add(currentID); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								else if(this.building == null && buildingID > 0) { | 
					 | 
					 | 
					 | 
								else if(this.building == null && buildingID > 0) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									NPC.Oprhans.add(currentID); | 
					 | 
					 | 
					 | 
									NPC.Oprhans.add(currentID); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								} | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (this.guild == null) | 
					 | 
					 | 
					 | 
								if (this.guild == null) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									this.guild = Guild.getErrantGuild(); | 
					 | 
					 | 
					 | 
									this.guild = Guild.getErrantGuild(); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -292,8 +282,8 @@ public class NPC extends AbstractCharacter { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								this.setParentZone(ZoneManager.getZoneByUUID(this.parentZoneID)); | 
					 | 
					 | 
					 | 
								this.setParentZone(ZoneManager.getZoneByUUID(this.parentZoneID)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (this.fidalityID != 0) | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									this.nameOverride = rs.getString("npc_name"); | 
					 | 
					 | 
					 | 
								this.nameOverride = rs.getString("npc_name"); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}catch(Exception e){ | 
					 | 
					 | 
					 | 
							}catch(Exception e){ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								Logger.error(e); | 
					 | 
					 | 
					 | 
								Logger.error(e); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -367,7 +357,7 @@ public class NPC extends AbstractCharacter { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							//add this npc to building
 | 
					 | 
					 | 
					 | 
							//add this npc to building
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (this.building != null && this.loadID != 0 && this.fidalityID == 0) { | 
					 | 
					 | 
					 | 
							if (this.building != null && this.loadID != 0) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (building.getBlueprint() != null){ | 
					 | 
					 | 
					 | 
								if (building.getBlueprint() != null){ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -1175,9 +1165,6 @@ public class NPC extends AbstractCharacter { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (ConfigManager.serverType.equals(ServerType.LOGINSERVER)) | 
					 | 
					 | 
					 | 
							if (ConfigManager.serverType.equals(ServerType.LOGINSERVER)) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return; | 
					 | 
					 | 
					 | 
								return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (this.fidalityID != 0) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								DbManager.NPCQueries.LOAD_RUNES_FOR_FIDELITY_NPC(this); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							try{ | 
					 | 
					 | 
					 | 
							try{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								this.equip = loadEquipmentSet(this.equipmentSetID); | 
					 | 
					 | 
					 | 
								this.equip = loadEquipmentSet(this.equipmentSetID); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -1621,10 +1608,6 @@ public class NPC extends AbstractCharacter { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return true; | 
					 | 
					 | 
					 | 
							return true; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						public int getFidalityID() { | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return fidalityID; | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						public int getBuildingLevel() { | 
					 | 
					 | 
					 | 
						public int getBuildingLevel() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return buildingLevel; | 
					 | 
					 | 
					 | 
							return buildingLevel; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -1650,21 +1633,12 @@ public class NPC extends AbstractCharacter { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (buildingModel == null) | 
					 | 
					 | 
					 | 
							if (buildingModel == null) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return -1; | 
					 | 
					 | 
					 | 
								return -1; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (npc.fidalityID != 0){ | 
					 | 
					 | 
					 | 
							if (npc.building.getHirelings().containsKey(npc)) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
								slot =  (npc.building.getHirelings().get(npc)); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (npc.building.fidelityNpcs.get(npc.currentID) != null){ | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									slot = npc.building.fidelityNpcs.get(npc.currentID); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								} | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} else{ | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (npc.building.getHirelings().containsKey(npc)) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									slot =  (npc.building.getHirelings().get(npc)); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (buildingModel.getNPCLocation(slot) == null) | 
					 | 
					 | 
					 | 
							if (buildingModel.getNPCLocation(slot) == null) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return -1; | 
					 | 
					 | 
					 | 
								return -1; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return slot; | 
					 | 
					 | 
					 | 
							return slot; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |