Cleanup of teleport list
This commit is contained in:
@@ -303,6 +303,37 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
City city = (City) ago;
|
||||
|
||||
// Filter Player cities
|
||||
|
||||
if (city.parentZone == null)
|
||||
continue;
|
||||
;
|
||||
|
||||
if (city.parentZone.guild_zone && city.isOpen() && city.getTOL().rank > 4 && city.getGuild().charter.equals(playerCharacter.guild.charter)) {
|
||||
|
||||
if (!city.getTOL().reverseKOS) {
|
||||
cities.add(city);//can teleport to any open ToL that shares charter
|
||||
continue;
|
||||
}
|
||||
|
||||
if (city.getTOL().getCondemned().containsKey(playerCharacter.objectUUID) && city.getTOL().getCondemned().get(playerCharacter.objectUUID).active) {
|
||||
cities.add(city);//this player is allowed for the reverse KOS
|
||||
continue;
|
||||
}
|
||||
|
||||
if (city.getTOL().getCondemned().containsKey(playerCharacter.guildUUID) && city.getTOL().getCondemned().get(playerCharacter.guildUUID).active) {
|
||||
cities.add(city);//this guild is allowed for the reverse KOS
|
||||
continue;
|
||||
}
|
||||
|
||||
if (city.getTOL().getCondemned().containsKey(playerCharacter.guild.getNation().getObjectUUID()) && city.getTOL().getCondemned().get(playerCharacter.guild.getNation().getObjectUUID()).active) {
|
||||
cities.add(city);//this nation is allowed for the reverse KOS
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Filter NPC cities
|
||||
|
||||
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
|
||||
continue; // cannot teleport to perdition or bastion
|
||||
|
||||
@@ -321,91 +352,11 @@ public class City extends AbstractWorldObject {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (playerCharacter.guild.isEmptyGuild() && city.isNpc == 1 && city.isNoobIsle == 0 && playerCharacter.level >= 20) {
|
||||
if (city.isNpc == 1 && city.isNoobIsle == 0 && playerCharacter.level >= 20)
|
||||
cities.add(city); // Errants can travel everywhere off noob isle.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (city.isOpen() && city.getTOL().rank > 4 && city.getGuild().charter.equals(playerCharacter.guild.charter)) {
|
||||
|
||||
if (!city.getTOL().reverseKOS) {
|
||||
cities.add(city);//can teleport to any open ToL that shares charter
|
||||
continue;
|
||||
}
|
||||
|
||||
if (city.getTOL().getCondemned().containsKey(playerCharacter.objectUUID) && city.getTOL().getCondemned().get(playerCharacter.objectUUID).active) {
|
||||
cities.add(city);//this player is allowed for the reverse KOS
|
||||
continue;
|
||||
}
|
||||
|
||||
if (city.getTOL().getCondemned().containsKey(playerCharacter.guildUUID) && city.getTOL().getCondemned().get(playerCharacter.guildUUID).active) {
|
||||
cities.add(city);//this guild is allowed for the reverse KOS
|
||||
continue;
|
||||
}
|
||||
|
||||
if (city.getTOL().getCondemned().containsKey(playerCharacter.guild.getNation().getObjectUUID()) && city.getTOL().getCondemned().get(playerCharacter.guild.getNation().getObjectUUID()).active)
|
||||
cities.add(city);//this nation is allowed for the reverse KOS
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return cities;
|
||||
}
|
||||
|
||||
Guild guild = playerCharacter.getGuild();
|
||||
//add npc cities
|
||||
|
||||
for (AbstractGameObject ago : worldCities.values()) {
|
||||
|
||||
if (ago.getObjectType().equals(GameObjectType.City)) {
|
||||
City city = (City) ago;
|
||||
|
||||
if (city.noTeleport)
|
||||
continue;
|
||||
|
||||
if (city.parentZone != null && city.parentZone.guild_zone) {
|
||||
|
||||
if (playerCharacter.getAccount().status.equals(AccountStatus.ADMIN)) {
|
||||
cities.add(city);
|
||||
} else
|
||||
//list Player cities
|
||||
|
||||
//open city, just list
|
||||
|
||||
if (city.open && city.getTOL() != null && city.getTOL().getRank() > 4) {
|
||||
|
||||
if (!BuildingManager.IsPlayerHostile(city.getTOL(), playerCharacter)) {
|
||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||
if (city.getGuild().getGuildType().equals(playerCharacter.guild.getGuildType())) {
|
||||
cities.add(city);
|
||||
}
|
||||
} else {
|
||||
cities.add(city); //verify nation or guild is same
|
||||
}
|
||||
}
|
||||
} else if (Guild.sameNationExcludeErrant(city.getGuild(), guild))
|
||||
cities.add(city);
|
||||
|
||||
|
||||
} else if (city.isNpc == 1) {
|
||||
|
||||
//list NPC cities
|
||||
|
||||
Guild g = city.getGuild();
|
||||
if (g == null) {
|
||||
if (city.isNpc == 1)
|
||||
if (city.isNoobIsle == 1) {
|
||||
if (playerCharacter.getLevel() < 21)
|
||||
cities.add(city); //verify nation or guild is same
|
||||
} else if (playerCharacter.getLevel() > 9)
|
||||
cities.add(city); //verify nation or guild is same
|
||||
|
||||
} else if (playerCharacter.getLevel() >= g.getTeleportMin() && playerCharacter.getLevel() <= g.getTeleportMax())
|
||||
cities.add(city); //verify nation or guild is same
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return cities;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user