Browse Source

Cleanup of teleport list

postwipe-guilds
MagicBot 5 months ago
parent
commit
56564f1c3b
  1. 101
      src/engine/objects/City.java

101
src/engine/objects/City.java

@ -303,30 +303,13 @@ public class City extends AbstractWorldObject { @@ -303,30 +303,13 @@ public class City extends AbstractWorldObject {
City city = (City) ago;
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
continue; // cannot teleport to perdition or bastion
if (city.isNoobIsle == 1 && playerCharacter.level <= 20) {
cities.add(city); // everyone can go to noob island if they are under level 20
continue;
}
if (city.cityName.equals("Khan'Ov Srekel")) {
cities.add(city); //everyone anytime can teleport to khan
continue;
}
// Filter Player cities
if (city.isNpc == 1 && city.getGuild().charter.equals(playerCharacter.guild.charter)) {
cities.add(city); // anyone of the same charter can teleport to a safehold of that charter
continue;
}
if (playerCharacter.guild.isEmptyGuild() && city.isNpc == 1 && city.isNoobIsle == 0 && playerCharacter.level >= 20) {
cities.add(city); // Errants can travel everywhere off noob isle.
if (city.parentZone == null)
continue;
}
;
if (city.isOpen() && city.getTOL().rank > 4 && city.getGuild().charter.equals(playerCharacter.guild.charter)) {
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
@ -343,69 +326,37 @@ public class City extends AbstractWorldObject { @@ -343,69 +326,37 @@ public class City extends AbstractWorldObject {
continue;
}
if (city.getTOL().getCondemned().containsKey(playerCharacter.guild.getNation().getObjectUUID()) && city.getTOL().getCondemned().get(playerCharacter.guild.getNation().getObjectUUID()).active)
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) {
// Filter NPC cities
//list NPC cities
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
continue; // cannot teleport to perdition or bastion
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
if (city.isNoobIsle == 1 && playerCharacter.level <= 20) {
cities.add(city); // everyone can go to noob island if they are under level 20
continue;
}
} else if (playerCharacter.getLevel() >= g.getTeleportMin() && playerCharacter.getLevel() <= g.getTeleportMax())
cities.add(city); //verify nation or guild is same
}
if (city.cityName.equals("Khan'Ov Srekel")) {
cities.add(city); //everyone anytime can teleport to khan
continue;
}
if (city.isNpc == 1 && city.getGuild().charter.equals(playerCharacter.guild.charter)) {
cities.add(city); // anyone of the same charter can teleport to a safehold of that charter
continue;
}
if (city.isNpc == 1 && city.isNoobIsle == 0 && playerCharacter.level >= 20)
cities.add(city); // Errants can travel everywhere off noob isle.
}
}
return cities;
}

Loading…
Cancel
Save