| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -94,42 +94,26 @@ public class Zone extends AbstractWorldObject { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this.icon3 = rs.getString("icon3"); | 
					 | 
					 | 
					 | 
					            this.icon3 = rs.getString("icon3"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this.min_level = rs.getInt("min_level"); | 
					 | 
					 | 
					 | 
					            this.min_level = rs.getInt("min_level"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this.max_level = rs.getInt("max_level"); | 
					 | 
					 | 
					 | 
					            this.max_level = rs.getInt("max_level"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this.major_radius = rs.getFloat("major_radius"); | 
					 | 
					 | 
					 | 
					        this.major_radius = rs.getFloat("major_radius"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this.minor_radius = rs.getFloat("minor_radius"); | 
					 | 
					 | 
					 | 
					        this.minor_radius = rs.getFloat("minor_radius"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this.min_blend = rs.getFloat("min_blend"); | 
					 | 
					 | 
					 | 
					        this.min_blend = rs.getFloat("min_blend"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this.max_blend = rs.getFloat("max_blend"); | 
					 | 
					 | 
					 | 
					        this.max_blend = rs.getFloat("max_blend"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this.sea_level_type = rs.getString("sea_level_type"); | 
					 | 
					 | 
					 | 
					        this.sea_level_type = rs.getString("sea_level_type"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this.sea_level_offset = rs.getFloat("sea_level"); | 
					 | 
					 | 
					 | 
					        this.sea_level_offset = rs.getFloat("sea_level"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this.terrain_type = rs.getString("terrain_type"); | 
					 | 
					 | 
					 | 
					        this.terrain_type = rs.getString("terrain_type"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this.terrain_max_y = rs.getFloat("terrain_max_y"); | 
					 | 
					 | 
					 | 
					        this.terrain_max_y = rs.getFloat("terrain_max_y"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this.terrain_image = rs.getInt("terrain_image"); | 
					 | 
					 | 
					 | 
					        this.terrain_image = rs.getInt("terrain_image"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (this.guild_zone) { | 
					 | 
					 | 
					 | 
					        // Configuration for player cities
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                this.max_blend = 128; | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                this.min_blend = 128; | 
					 | 
					 | 
					 | 
					        if (this.guild_zone) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                this.terrain_max_y = 5; | 
					 | 
					 | 
					 | 
					            this.max_blend = 128; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                this.major_radius = (int) Enum.CityBoundsType.ZONE.halfExtents; | 
					 | 
					 | 
					 | 
					            this.min_blend = 128; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                this.minor_radius = (int) Enum.CityBoundsType.ZONE.halfExtents; | 
					 | 
					 | 
					 | 
					            this.terrain_max_y = 5; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                this.terrain_type = "PLANAR"; | 
					 | 
					 | 
					 | 
					            this.major_radius = (int) Enum.CityBoundsType.ZONE.halfExtents; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            this.minor_radius = (int) Enum.CityBoundsType.ZONE.halfExtents; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					            this.terrain_type = "PLANAR"; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (this.terrain_type.equals("NONE")) | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                this.terrain = null; | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            else | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                this.terrain = new Terrain(this); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            //this needs to be here specifically for new zones created after server boot (e.g. player city zones)
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            Zone parentZone = ZoneManager.getZoneByUUID(parentZoneID); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this.setParent(parentZone); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (this.min_level == 0 && parentZone != null) { | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                this.min_level = parentZone.min_level; | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                this.max_level = parentZone.max_level; | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (parentZone != null) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            parentZone.addNode(this); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // If zone doesn't yet hava a hash then write it back to the zone table
 | 
					 | 
					 | 
					 | 
					        // If zone doesn't yet hava a hash then write it back to the zone table
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -141,6 +125,31 @@ public class Zone extends AbstractWorldObject { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    @Override | 
					 | 
					 | 
					 | 
					    @Override | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    public void runAfterLoad() { | 
					 | 
					 | 
					 | 
					    public void runAfterLoad() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        // First zone is always the seafloor
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (ZoneManager.seaFloor == null) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            ZoneManager.seaFloor = this; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (this.terrain_type.equals("NONE")) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            this.terrain = null; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        else | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            this.terrain = new Terrain(this); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        //this needs to be here specifically for new zones created after server boot (e.g. player city zones)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        Zone parentZone = ZoneManager.getZoneByUUID(parentZoneID); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        this.setParent(parentZone); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (this.min_level == 0 && parentZone != null) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            this.min_level = parentZone.min_level; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            this.max_level = parentZone.max_level; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (parentZone != null) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            parentZone.addNode(this); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        ZoneManager.populateZoneCollections(this); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    public static void serializeForClientMsg(Zone zone, ByteBufferWriter writer) { | 
					 | 
					 | 
					 | 
					    public static void serializeForClientMsg(Zone zone, ByteBufferWriter writer) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |