|
|
@ -63,7 +63,6 @@ public class City extends AbstractWorldObject { |
|
|
|
private int isNoobIsle; //1: noob, 0: not noob: -1: not noob, no teleport
|
|
|
|
private int isNoobIsle; //1: noob, 0: not noob: -1: not noob, no teleport
|
|
|
|
private int population = 0; |
|
|
|
private int population = 0; |
|
|
|
private int siegesWithstood = 0; |
|
|
|
private int siegesWithstood = 0; |
|
|
|
private int realmID; |
|
|
|
|
|
|
|
private int radiusType; |
|
|
|
private int radiusType; |
|
|
|
private float bindRadius; |
|
|
|
private float bindRadius; |
|
|
|
private float bindX; |
|
|
|
private float bindX; |
|
|
@ -81,6 +80,7 @@ public class City extends AbstractWorldObject { |
|
|
|
private boolean open = false; |
|
|
|
private boolean open = false; |
|
|
|
private String hash; |
|
|
|
private String hash; |
|
|
|
public Warehouse warehouse; |
|
|
|
public Warehouse warehouse; |
|
|
|
|
|
|
|
public Realm realm; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* ResultSet Constructor |
|
|
|
* ResultSet Constructor |
|
|
@ -138,8 +138,6 @@ public class City extends AbstractWorldObject { |
|
|
|
|
|
|
|
|
|
|
|
this.hash = rs.getString("hash"); |
|
|
|
this.hash = rs.getString("hash"); |
|
|
|
|
|
|
|
|
|
|
|
this.realmID = rs.getInt("realmID"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
Logger.error(e); |
|
|
|
Logger.error(e); |
|
|
|
} |
|
|
|
} |
|
|
@ -734,12 +732,12 @@ public class City extends AbstractWorldObject { |
|
|
|
if ((ConfigManager.serverType.equals(ServerType.WORLDSERVER)) |
|
|
|
if ((ConfigManager.serverType.equals(ServerType.WORLDSERVER)) |
|
|
|
&& (this.isNpc == (byte) 0)) { |
|
|
|
&& (this.isNpc == (byte) 0)) { |
|
|
|
|
|
|
|
|
|
|
|
Realm wsr = Realm.getRealm(this.realmID); |
|
|
|
this.realm = RealmMap.getRealmAtLocation(this.getLoc()); |
|
|
|
|
|
|
|
|
|
|
|
if (wsr != null) |
|
|
|
if (realm != null) |
|
|
|
wsr.addCity(this.getObjectUUID()); |
|
|
|
realm.addCity(this.getObjectUUID()); |
|
|
|
else |
|
|
|
else |
|
|
|
Logger.error("Unable to find realm of ID " + realmID + " for city " + this.getObjectUUID()); |
|
|
|
Logger.error("Unable to find realm for city " + this.getObjectUUID()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Set city motto to current guild motto
|
|
|
|
// Set city motto to current guild motto
|
|
|
@ -893,12 +891,6 @@ public class City extends AbstractWorldObject { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Realm getRealm() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Realm.getRealm(this.realmID); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isLocationOnCityGrid(Vector3fImmutable insideLoc) { |
|
|
|
public boolean isLocationOnCityGrid(Vector3fImmutable insideLoc) { |
|
|
|
|
|
|
|
|
|
|
|
Bounds newBounds = Bounds.borrow(); |
|
|
|
Bounds newBounds = Bounds.borrow(); |
|
|
@ -1300,7 +1292,7 @@ public class City extends AbstractWorldObject { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (playerGuild.getOwnedCity().getRealm() == null) { |
|
|
|
if (RealmMap.getRealmIDAtLocation(playerGuild.getOwnedCity().getLoc()) == 0) { |
|
|
|
ErrorPopupMsg.sendErrorMsg(player, "Cannot find realm for your city!"); |
|
|
|
ErrorPopupMsg.sendErrorMsg(player, "Cannot find realm for your city!"); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
@ -1388,4 +1380,5 @@ public class City extends AbstractWorldObject { |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|