Browse Source

reverse KOS function completed

postwipe-teleporting
FatBoy-DOTC 6 months ago
parent
commit
0d24789a93
  1. 140
      src/engine/objects/City.java

140
src/engine/objects/City.java

@ -306,91 +306,103 @@ public class City extends AbstractWorldObject {
if (city.parentZone == null) if (city.parentZone == null)
continue; continue;
if (city.parentZone.guild_zone && city.isOpen() && city.getTOL().rank > 4) { if(repledge && city.getGuild().equals(playerCharacter.guild)){
//can't repledge to a guild you're already part of
// Filter Lore cities continue;
}
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) { if (city.parentZone.guild_zone) {
if (!repledge) if(city.getGuild().getNation().equals(playerCharacter.guild.getNation())){
if (!city.getGuild().charter.equals(playerCharacter.guild.charter)) //players can all port and repledge inside their own nation
continue; cities.add(city);
else continue;
if (!city.getGuild().charter.canJoin(playerCharacter))
continue;
} }
Integer playerUUID = playerCharacter.objectUUID; if (city.isOpen() && city.getTOL().rank > 4) {
Integer guildUUID = playerCharacter.guildUUID;
Integer nationUUID = playerCharacter.guild.getNation().getObjectUUID(); // Filter Lore cities
boolean allowed = false;
if (city.getTOL().reverseKOS) { if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
//reverse KOS, specific values are allowed
if (city.getTOL().getCondemned().contains(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) { if (!repledge)
//individual is cleared for teleport/repledge if (!city.getGuild().charter.equals(playerCharacter.guild.charter))
allowed = true; continue;
} else if (city.getTOL().getCondemned().contains(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) { else if (!city.getGuild().charter.canJoin(playerCharacter))
//player guild is cleared for teleport/repledge continue;
allowed = true; }
} else if (city.getTOL().getCondemned().contains(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active) { Integer playerUUID = playerCharacter.objectUUID;
//player nation is cleared for teleport/repledge Integer guildUUID = playerCharacter.guildUUID;
Integer nationUUID = playerCharacter.guild.getNation().getObjectUUID();
boolean allowed = false;
if (city.getTOL().reverseKOS) {
//reverse KOS, specific values are allowed
if (city.getTOL().getCondemned().contains(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) {
//individual is cleared for teleport/repledge
allowed = true;
} else if (city.getTOL().getCondemned().contains(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) {
//player guild is cleared for teleport/repledge
allowed = true;
} else if (city.getTOL().getCondemned().contains(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active) {
//player nation is cleared for teleport/repledge
allowed = true;
}
} else {
//not reverse KOS, everyone is allowed by default
allowed = true; allowed = true;
//specific values are not allowed
if (city.getTOL().getCondemned().contains(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) {
//individual is cleared for teleport/repledge
allowed = false;
} else if (city.getTOL().getCondemned().contains(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) {
//player guild is cleared for teleport/repledge
allowed = false;
} else if (city.getTOL().getCondemned().contains(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active) {
//player nation is cleared for teleport/repledge
allowed = false;
}
} }
} else { if (allowed) {
//not reverse KOS, everyone is allowed by default cities.add(city);
allowed = true; continue;
//specific values are not allowed
if (city.getTOL().getCondemned().contains(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) {
//individual is cleared for teleport/repledge
allowed = false;
} else if (city.getTOL().getCondemned().contains(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) {
//player guild is cleared for teleport/repledge
allowed = false;
} else if (city.getTOL().getCondemned().contains(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active) {
//player nation is cleared for teleport/repledge
allowed = false;
} }
} }
if (allowed) { } else {
cities.add(city);
continue;
}
}
// Filter NPC cities // Filter NPC cities
if (city.isNoobIsle == 1) { if (city.isNoobIsle == 1) {
if (playerCharacter.level < 20) if (playerCharacter.level < 20)
cities.add(city); // everyone can go to noob island if they are under level 20 cities.add(city); // everyone can go to noob island if they are under level 20
continue; continue;
} }
// Players cannot teleport to perdition or bastion // Players cannot teleport to perdition or bastion
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion")) if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
continue; continue;
// These cities are available for anyone off noob island // 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"))) { 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); cities.add(city);
continue; continue;
} }
// Add Lore cities // Add Lore cities
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) { if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
if (repledge) { if (repledge) {
if (city.getGuild().charter.canJoin(playerCharacter)) if (city.getGuild().charter.canJoin(playerCharacter))
cities.add(city);
} else if (city.getGuild().charter.equals(playerCharacter.guild.charter))
cities.add(city); cities.add(city);
} else if (city.getGuild().charter.equals(playerCharacter.guild.charter)) }
cities.add(city);
}
}
} }
return cities; return cities;
} }

Loading…
Cancel
Save