More logic work
This commit is contained in:
@@ -295,62 +295,18 @@ 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;
|
City city = (City) ago;
|
||||||
|
|
||||||
// Filter Player cities
|
// Filter Player cities
|
||||||
|
|
||||||
if (city.parentZone == null)
|
if (city.parentZone == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (city.parentZone.guild_zone && 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)) {
|
||||||
|
|
||||||
// Filter Lore cities
|
|
||||||
|
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
|
||||||
|
|
||||||
if (!repledge)
|
|
||||||
if (!city.getGuild().charter.equals(playerCharacter.guild.charter))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (repledge)
|
|
||||||
if (!city.getGuild().charter.canJoin(playerCharacter))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
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.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("Perdition") || city.cityName.equals("Bastion"))
|
|
||||||
continue; // cannot teleport to perdition or bastion
|
|
||||||
|
|
||||||
// Filter Lore cities
|
// Filter Lore cities
|
||||||
|
|
||||||
@@ -365,10 +321,59 @@ public class City extends AbstractWorldObject {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (city.isNpc == 1)
|
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.isNoobIsle == 1 && playerCharacter.level < 20) {
|
||||||
|
cities.add(city); // everyone can go to noob island if they are under level 20
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Players cannot teleport to perdition or bastion
|
||||||
|
|
||||||
|
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// These cities are available for anyone off noob island
|
||||||
|
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user