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 {
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(mbEnums.GameObjectType.City); 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()) { for (AbstractGameObject ago : worldCities.values()) {
City city = (City) ago;
// Filter Player cities City city = (City) ago;
if (city.parentZone == null) // Filter Player cities
continue;
if (city.parentZone.guild_zone && city.isOpen() && city.getTOL().rank > 4 && city.getGuild().charter.equals(playerCharacter.guild.charter)) { if (city.parentZone == null)
continue;
// Filter Lore cities
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) // Filter Lore cities
if (!city.getGuild().charter.equals(playerCharacter.guild.charter))
continue;
if (repledge) if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
if (!city.getGuild().charter.canJoin(playerCharacter))
continue;
}
if (!city.getTOL().reverseKOS) { if (!repledge)
cities.add(city);//can teleport to any open ToL that shares charter if (!city.getGuild().charter.equals(playerCharacter.guild.charter))
continue; continue;
}
if (city.getTOL().getCondemned().containsKey(playerCharacter.objectUUID) && city.getTOL().getCondemned().get(playerCharacter.objectUUID).active) { if (repledge)
cities.add(city);//this player is allowed for the reverse KOS if (!city.getGuild().charter.canJoin(playerCharacter))
continue; continue;
} }
if (city.getTOL().getCondemned().containsKey(playerCharacter.guildUUID) && city.getTOL().getCondemned().get(playerCharacter.guildUUID).active) { if (!city.getTOL().reverseKOS) {
cities.add(city);//this guild is allowed for the reverse KOS cities.add(city);//can teleport to any open ToL that shares charter
continue; 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.objectUUID) && city.getTOL().getCondemned().get(playerCharacter.objectUUID).active) {
cities.add(city);//this nation is allowed for the reverse KOS cities.add(city);//this player is allowed for the reverse KOS
continue; 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) { if (city.getTOL().getCondemned().containsKey(playerCharacter.guild.getNation().getObjectUUID()) && city.getTOL().getCondemned().get(playerCharacter.guild.getNation().getObjectUUID()).active) {
cities.add(city); // everyone can go to noob island if they are under level 20 cities.add(city);//this nation is allowed for the reverse KOS
continue; continue;
} }
}
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion")) // Filter NPC cities
continue; // cannot teleport to perdition or bastion
// 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.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
if (!city.getGuild().charter.equals(playerCharacter.guild.charter)) continue;
continue;
if (repledge) // These cities are available for anyone off noob island
if (!city.getGuild().charter.canJoin(playerCharacter))
continue;
}
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); cities.add(city);
} }
}
return cities; return cities;
} }

Loading…
Cancel
Save