Lore Teleport list and repledge list construction
This commit is contained in:
+129
-95
@@ -289,84 +289,102 @@ public class City extends AbstractWorldObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static ArrayList<City> getCitiesToTeleportTo(PlayerCharacter pc) {
|
public static ArrayList<City> getCitiesToTeleportTo(PlayerCharacter pc) {
|
||||||
|
|
||||||
ArrayList<City> cities = new ArrayList<>();
|
ArrayList<City> cities = new ArrayList<>();
|
||||||
|
|
||||||
if (pc == null)
|
if (pc == null)
|
||||||
return cities;
|
return cities;
|
||||||
|
|
||||||
Guild pcG = pc.getGuild();
|
|
||||||
|
|
||||||
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(mbEnums.GameObjectType.City);
|
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(mbEnums.GameObjectType.City);
|
||||||
|
|
||||||
//add npc cities
|
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||||
|
//handle compiling of cities able to be teleported to for lore rule-set
|
||||||
for (AbstractGameObject ago : worldCities.values()) {
|
for (AbstractGameObject ago : worldCities.values()) {
|
||||||
|
|
||||||
if (ago.getObjectType().equals(GameObjectType.City)) {
|
|
||||||
City city = (City) ago;
|
City city = (City) ago;
|
||||||
|
if (city.isNpc == 1 && city.getGuild().charter.equals(pc.guild.charter)) {
|
||||||
if (city.noTeleport)
|
cities.add(city); // anyone of the same charter can teleport to a safehold of that charter
|
||||||
continue;
|
continue;
|
||||||
|
} else if (city.isNoobIsle == 1 && pc.level <= 20) {
|
||||||
|
cities.add(city); // everyone can go to noob island if they are under level 20
|
||||||
|
continue;
|
||||||
|
} else if (city.cityName.equals("Khan'Ov Srekel")) {
|
||||||
|
cities.add(city); //everyone anytime can teleport to khan
|
||||||
|
continue;
|
||||||
|
} else if (city.isOpen() && city.getTOL().rank > 4 && city.getGuild().charter.equals(pc.guild.charter))
|
||||||
|
if (!city.getTOL().reverseKOS) {
|
||||||
|
cities.add(city);//can teleport to any open ToL that shares charter
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
if (city.getTOL().getCondemned().contains(pc.objectUUID) && city.getTOL().getCondemned().get(pc.objectUUID).active) {
|
||||||
|
cities.add(city);//this player is allowed for the reverse KOS
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (city.getTOL().getCondemned().contains(pc.guildUUID) && city.getTOL().getCondemned().get(pc.guildUUID).active) {
|
||||||
|
cities.add(city);//this guild is allowed for the reverse KOS
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (city.getTOL().getCondemned().contains(pc.guild.getNation().getObjectUUID()) && city.getTOL().getCondemned().get(pc.guild.getNation().getObjectUUID()).active) {
|
||||||
|
cities.add(city);//this nation is allowed for the reverse KOS
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
if (city.parentZone != null && city.parentZone.guild_zone) {
|
Guild pcG = pc.getGuild();
|
||||||
|
//add npc cities
|
||||||
|
|
||||||
if (pc.getAccount().status.equals(AccountStatus.ADMIN)) {
|
for (AbstractGameObject ago : worldCities.values()) {
|
||||||
cities.add(city);
|
|
||||||
} else
|
|
||||||
//list Player cities
|
|
||||||
|
|
||||||
//open city, just list
|
if (ago.getObjectType().equals(GameObjectType.City)) {
|
||||||
|
City city = (City) ago;
|
||||||
|
|
||||||
if (city.open && city.getTOL() != null && city.getTOL().getRank() > 4) {
|
if (city.noTeleport)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!BuildingManager.IsPlayerHostile(city.getTOL(), pc)) {
|
if (city.parentZone != null && city.parentZone.guild_zone) {
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
|
||||||
if (city.getGuild().getGuildType().equals(pc.guild.getGuildType())) {
|
if (pc.getAccount().status.equals(AccountStatus.ADMIN)) {
|
||||||
cities.add(city);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
cities.add(city); //verify nation or guild is same
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (Guild.sameNationExcludeErrant(city.getGuild(), pcG))
|
|
||||||
cities.add(city);
|
cities.add(city);
|
||||||
|
} else
|
||||||
|
//list Player cities
|
||||||
|
|
||||||
|
//open city, just list
|
||||||
|
|
||||||
} else if (city.isNpc == 1) {
|
if (city.open && city.getTOL() != null && city.getTOL().getRank() > 4) {
|
||||||
|
|
||||||
//list NPC cities
|
if (!BuildingManager.IsPlayerHostile(city.getTOL(), pc)) {
|
||||||
|
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||||
Guild g = city.getGuild();
|
if (city.getGuild().getGuildType().equals(pc.guild.getGuildType())) {
|
||||||
if (g == null) {
|
cities.add(city);
|
||||||
if (city.isNpc == 1)
|
}
|
||||||
if (city.isNoobIsle == 1) {
|
|
||||||
if (pc.getLevel() < 21)
|
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE") && city.getGuild().getGuildType().canJoin(pc)) {
|
|
||||||
cities.add(city);
|
|
||||||
} else {
|
} else {
|
||||||
cities.add(city); //verify nation or guild is same
|
cities.add(city); //verify nation or guild is same
|
||||||
}
|
}
|
||||||
} else if (pc.getLevel() > 9)
|
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE") && city.getGuild().getGuildType().canJoin(pc)) {
|
|
||||||
cities.add(city);
|
|
||||||
} else {
|
|
||||||
cities.add(city); //verify nation or guild is same
|
|
||||||
}
|
}
|
||||||
|
} else if (Guild.sameNationExcludeErrant(city.getGuild(), pcG))
|
||||||
} else if (pc.getLevel() >= g.getTeleportMin() && pc.getLevel() <= g.getTeleportMax())
|
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
|
||||||
if (city.getGuild().getGuildType().canJoin(pc)) {
|
|
||||||
cities.add(city);
|
cities.add(city);
|
||||||
}
|
|
||||||
} else {
|
|
||||||
cities.add(city); //verify nation or guild is same
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
} else if (city.isNpc == 1) {
|
||||||
|
|
||||||
|
//list NPC cities
|
||||||
|
|
||||||
|
Guild g = city.getGuild();
|
||||||
|
if (g == null) {
|
||||||
|
if (city.isNpc == 1)
|
||||||
|
if (city.isNoobIsle == 1) {
|
||||||
|
if (pc.getLevel() < 21)
|
||||||
|
cities.add(city); //verify nation or guild is same
|
||||||
|
} else if (pc.getLevel() > 9)
|
||||||
|
cities.add(city); //verify nation or guild is same
|
||||||
|
|
||||||
|
} else if (pc.getLevel() >= g.getTeleportMin() && pc.getLevel() <= g.getTeleportMax())
|
||||||
|
cities.add(city); //verify nation or guild is same
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return cities;
|
return cities;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,60 +398,76 @@ public class City extends AbstractWorldObject {
|
|||||||
Guild pcG = playerCharacter.getGuild();
|
Guild pcG = playerCharacter.getGuild();
|
||||||
|
|
||||||
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(mbEnums.GameObjectType.City);
|
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(mbEnums.GameObjectType.City);
|
||||||
|
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||||
//add npc cities
|
//handle compiling of cities able to be teleported to for lore rule-set
|
||||||
|
for (AbstractGameObject ago : worldCities.values()) {
|
||||||
for (AbstractGameObject ago : worldCities.values()) {
|
|
||||||
if (ago.getObjectType().equals(GameObjectType.City)) {
|
|
||||||
|
|
||||||
City city = (City) ago;
|
City city = (City) ago;
|
||||||
|
if (city.isNpc == 1 && city.getGuild().charter.equals(playerCharacter.guild.charter)) {
|
||||||
if (city.noRepledge)
|
cities.add(city); // anyone of the same charter can teleport to a safehold of that charter
|
||||||
continue;
|
continue;
|
||||||
|
} else if (city.isNoobIsle == 1 && playerCharacter.level <= 20) {
|
||||||
|
cities.add(city); // everyone can go to noob island if they are under level 20
|
||||||
|
continue;
|
||||||
|
} else if (city.cityName.equals("Khan'Ov Srekel")) {
|
||||||
|
cities.add(city); //everyone anytime can teleport to khan
|
||||||
|
continue;
|
||||||
|
} else if (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;
|
||||||
|
} else {
|
||||||
|
if (city.getTOL().getCondemned().contains(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().contains(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().contains(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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//add npc cities
|
||||||
|
|
||||||
if (city.parentZone != null && city.parentZone.guild_zone) {
|
for (AbstractGameObject ago : worldCities.values()) {
|
||||||
|
if (ago.getObjectType().equals(GameObjectType.City)) {
|
||||||
|
|
||||||
//list Player cities
|
City city = (City) ago;
|
||||||
//open city, just list
|
|
||||||
|
|
||||||
if (playerCharacter.getAccount().status.equals(AccountStatus.ADMIN)) {
|
if (city.noRepledge)
|
||||||
cities.add(city);
|
continue;
|
||||||
} else if (city.open && city.getTOL() != null && city.getTOL().getRank() > 4) {
|
|
||||||
|
|
||||||
if (!BuildingManager.IsPlayerHostile(city.getTOL(), playerCharacter))
|
if (city.parentZone != null && city.parentZone.guild_zone) {
|
||||||
cities.add(city); //verify nation or guild is same
|
|
||||||
} else if (Guild.sameNationExcludeErrant(city.getGuild(), pcG))
|
|
||||||
cities.add(city);
|
|
||||||
|
|
||||||
} else if (city.isNpc == 1) {
|
//list Player cities
|
||||||
//list NPC cities
|
//open city, just list
|
||||||
|
|
||||||
Guild guild = city.getGuild();
|
if (playerCharacter.getAccount().status.equals(AccountStatus.ADMIN)) {
|
||||||
|
cities.add(city);
|
||||||
|
} else if (city.open && city.getTOL() != null && city.getTOL().getRank() > 4) {
|
||||||
|
|
||||||
if (guild == null) {
|
if (!BuildingManager.IsPlayerHostile(city.getTOL(), playerCharacter))
|
||||||
if (city.isNpc == 1)
|
cities.add(city); //verify nation or guild is same
|
||||||
if (city.isNoobIsle == 1) {
|
} else if (Guild.sameNationExcludeErrant(city.getGuild(), pcG))
|
||||||
if (playerCharacter.getLevel() < 21)
|
cities.add(city);
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE") && city.getGuild().getGuildType().canJoin(playerCharacter)) {
|
|
||||||
cities.add(city);
|
} else if (city.isNpc == 1) {
|
||||||
} else {
|
//list NPC cities
|
||||||
|
|
||||||
|
Guild guild = city.getGuild();
|
||||||
|
|
||||||
|
if (guild == null) {
|
||||||
|
if (city.isNpc == 1)
|
||||||
|
if (city.isNoobIsle == 1) {
|
||||||
|
if (playerCharacter.getLevel() < 21)
|
||||||
cities.add(city); //verify nation or guild is same
|
cities.add(city); //verify nation or guild is same
|
||||||
}
|
} else if (playerCharacter.getLevel() > 9)
|
||||||
} else if (playerCharacter.getLevel() > 9)
|
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
|
||||||
if (city.getGuild().getGuildType().canJoin(playerCharacter)) {
|
|
||||||
cities.add(city);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
cities.add(city); //verify nation or guild is same
|
cities.add(city); //verify nation or guild is same
|
||||||
}
|
} else if (playerCharacter.getLevel() >= guild.getRepledgeMin() && playerCharacter.getLevel() <= guild.getRepledgeMax()) {
|
||||||
} else if (playerCharacter.getLevel() >= guild.getRepledgeMin() && playerCharacter.getLevel() <= guild.getRepledgeMax()) {
|
|
||||||
|
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
|
||||||
if (city.getGuild().getGuildType().canJoin(playerCharacter)) {
|
|
||||||
cities.add(city);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
cities.add(city); //verify nation or guild is same
|
cities.add(city); //verify nation or guild is same
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user