Browse Source

More logic work

postwipe-guilds
MagicBot 5 months ago
parent
commit
fff1e80f61
  1. 103
      src/engine/objects/City.java

103
src/engine/objects/City.java

@ -295,80 +295,85 @@ public class City extends AbstractWorldObject { @@ -295,80 +295,85 @@ public class City extends AbstractWorldObject {
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(mbEnums.GameObjectType.City);
//handle compiling of cities able to be teleported to for lore rule-set
//handle compiling of cities able to be teleported to for lore rule-set
for (AbstractGameObject ago : worldCities.values()) {
City city = (City) ago;
for (AbstractGameObject ago : worldCities.values()) {
// Filter Player cities
City city = (City) ago;
if (city.parentZone == null)
continue;
// Filter Player cities
if (city.parentZone.guild_zone && city.isOpen() && city.getTOL().rank > 4 && city.getGuild().charter.equals(playerCharacter.guild.charter)) {
// Filter Lore cities
if (city.parentZone == null)
continue;
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
if (city.parentZone.guild_zone && city.isOpen() && city.getTOL().rank > 4 && city.getGuild().charter.equals(playerCharacter.guild.charter)) {
if (!repledge)
if (!city.getGuild().charter.equals(playerCharacter.guild.charter))
continue;
// Filter Lore cities
if (repledge)
if (!city.getGuild().charter.canJoin(playerCharacter))
continue;
}
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
if (!city.getTOL().reverseKOS) {
cities.add(city);//can teleport to any open ToL that shares charter
continue;
}
if (!repledge)
if (!city.getGuild().charter.equals(playerCharacter.guild.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 (repledge)
if (!city.getGuild().charter.canJoin(playerCharacter))
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().reverseKOS) {
cities.add(city);//can teleport to any open ToL that shares charter
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;
}
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;
}
// Filter NPC cities
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.isNoobIsle == 1 && playerCharacter.level <= 20) {
cities.add(city); // everyone can go to noob island if they are under level 20
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;
}
}
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
continue; // cannot teleport to perdition or bastion
// Filter NPC cities
// Filter Lore cities
if (city.isNoobIsle == 1 && playerCharacter.level < 20) {
cities.add(city); // everyone can go to noob island if they are under level 20
continue;
}
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
// Players cannot teleport to perdition or bastion
if (!repledge)
if (!city.getGuild().charter.equals(playerCharacter.guild.charter))
continue;
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
continue;
if (repledge)
if (!city.getGuild().charter.canJoin(playerCharacter))
continue;
}
// These cities are available for anyone off noob island
if (city.isNpc == 1)
if (playerCharacter.level >= 20 && (city.cityName.equals("Sea Dog's Rest") || city.cityName.equals("Khan'Ov Srekel") || city.cityName.equals("City of Khar Th'Sekt"))) {
cities.add(city);
continue;
}
// Add Lore cities
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
if (repledge) {
if (city.getGuild().charter.canJoin(playerCharacter))
cities.add(city);
} else if (city.getGuild().charter.equals(playerCharacter.guild.charter))
cities.add(city);
}
}
return cities;
}

Loading…
Cancel
Save