Browse Source

Rearrange logic

postwipe-guilds
MagicBot 6 months ago
parent
commit
d32818f351
  1. 39
      src/engine/objects/City.java

39
src/engine/objects/City.java

@ -301,6 +301,13 @@ public class City extends AbstractWorldObject { @@ -301,6 +301,13 @@ 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)) {
// Filter Lore cities
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
@ -313,13 +320,6 @@ public class City extends AbstractWorldObject { @@ -313,13 +320,6 @@ public class City extends AbstractWorldObject {
continue;
}
// 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;
@ -343,26 +343,33 @@ public class City extends AbstractWorldObject { @@ -343,26 +343,33 @@ public class City extends AbstractWorldObject {
// Filter NPC cities
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
if (city.isNpc == 1 && city.isNoobIsle == 0 && playerCharacter.level >= 20) {
cities.add(city); // Errants can travel everywhere off noob isle.
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
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
continue; // cannot teleport to perdition or bastion
// Filter Lore cities
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
if (!repledge)
if (!city.getGuild().charter.equals(playerCharacter.guild.charter))
continue;
if (!city.getGuild().charter.canJoin(playerCharacter))
continue;
}
if (city.isNpc == 1 && city.isNoobIsle == 0 && playerCharacter.level >= 20)
cities.add(city); // Errants can travel everywhere off noob isle.
if (city.isNpc == 1)
cities.add(city);
}
return cities;

Loading…
Cancel
Save