forked from MagicBane/Server
Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| da0510d2bc | |||
| 1f732a8ca9 | |||
| 0d24789a93 | |||
| 35427cfb4a | |||
| 695a78b1e2 | |||
| 9f6710ccb9 | |||
| fff1e80f61 | |||
| 141af19daa | |||
| 630748541f | |||
| d32818f351 | |||
| d6f94bd0e7 | |||
| db6a4e471d | |||
| a24c611bac | |||
| 3926160ab1 | |||
| 4a7013de61 | |||
| 56564f1c3b | |||
| 8a3e39e97d | |||
| 5224c79441 | |||
| ede016a93d | |||
| cc1825dec9 | |||
| d257ce50cf | |||
| 5b246211e1 | |||
| 33c923b0de | |||
| 02d524663a | |||
| 5bd85addb7 |
@@ -136,6 +136,12 @@ public class dbWarehouseHandler extends dbHandlerBase {
|
||||
int cityUID = rs.getInt("cityUUID");
|
||||
JSONObject jsonObject = new JSONObject(rs.getString("warehouse"));
|
||||
City city = City.getCity(cityUID);
|
||||
|
||||
if (city == null) {
|
||||
Logger.error("No city " + cityUID + " for warehouse");
|
||||
continue;
|
||||
}
|
||||
|
||||
city.warehouse = new Warehouse(jsonObject);
|
||||
city.warehouse.city = city;
|
||||
|
||||
|
||||
@@ -463,26 +463,8 @@ public enum BuildingManager {
|
||||
return GuildStatusController.isGuildLeader(player.getGuildStatus()) || GuildStatusController.isInnerCouncil(player.getGuildStatus());
|
||||
}
|
||||
|
||||
public static int GetAvailableGold(Building building) {
|
||||
|
||||
if (building.getStrongboxValue() == 0)
|
||||
return 0;
|
||||
|
||||
if (building.getStrongboxValue() < building.reserve)
|
||||
return 0;
|
||||
|
||||
return building.getStrongboxValue() - building.reserve;
|
||||
}
|
||||
|
||||
public static boolean IsPlayerHostile(Building building, PlayerCharacter player) {
|
||||
|
||||
//Nation Members and Guild members are not hostile.
|
||||
// if (building.getGuild() != null){
|
||||
// if (pc.getGuild() != null)
|
||||
// if (building.getGuild().getObjectUUID() == pc.getGuildUUID()
|
||||
// || pc.getGuild().getNation().getObjectUUID() == building.getGuild().getNation().getObjectUUID())
|
||||
// return false;
|
||||
// }
|
||||
if (Guild.sameNationExcludeErrant(building.getGuild(), player.getGuild()))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import engine.net.client.msg.UpdateStateMsg;
|
||||
import engine.objects.*;
|
||||
import engine.powers.DamageShield;
|
||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||
import engine.powers.effectmodifiers.WeaponProcEffectModifier;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -196,6 +197,8 @@ public enum CombatManager {
|
||||
}
|
||||
}
|
||||
|
||||
checkForProc(attacker,target,weapon);
|
||||
|
||||
//get delay for the auto attack job
|
||||
long delay = 5000;
|
||||
|
||||
@@ -651,4 +654,20 @@ public enum CombatManager {
|
||||
int masteryLevel = 0;
|
||||
return max * (pow(0.0124 * primary + 0.118 * (primary - 0.75), 0.5) + pow(0.0022 * secondary + 0.028 * (secondary - 0.75), 0.5) + 0.0075 * (focusLevel + masteryLevel));
|
||||
}
|
||||
|
||||
public static void checkForProc(AbstractCharacter attacker, AbstractWorldObject target, Item weapon){
|
||||
|
||||
if(weapon == null) // cant proc without a weapon
|
||||
return;
|
||||
|
||||
for(Effect eff : weapon.effects.values()){
|
||||
for(AbstractEffectModifier mod : eff.getEffectsBase().getModifiers()){
|
||||
if(mod.modType.equals(mbEnums.ModType.WeaponProc))
|
||||
if(ThreadLocalRandom.current().nextInt(0,101) < 6)
|
||||
((WeaponProcEffectModifier)mod).applyProc(attacker,target);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -176,12 +176,29 @@ public enum PowersManager {
|
||||
PowersBase pb = PowersManager.powersBaseByToken.get(msg.getPowerUsedID());
|
||||
PlayerCharacter caster = origin.getPlayerCharacter();
|
||||
PlayerCharacter target = PlayerCharacter.getFromCache(msg.getTargetID());
|
||||
if (pb != null && pb.isHarmful == false) {
|
||||
if (pb != null && pb.enforceLore()) {
|
||||
//if (caster.guild.equals(Guild.getErrantGuild()))
|
||||
// return;
|
||||
|
||||
if (target != null && caster.guild.getGuildType().equals(target.guild.getGuildType()) == false && target.getObjectType().equals(GameObjectType.Building) == false)
|
||||
if (target != null && caster.guild.getGuildType().equals(target.guild.getGuildType()) == false && target.getObjectType().equals(GameObjectType.Building) == false) {
|
||||
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID());
|
||||
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), recyclePowerMsg);
|
||||
DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
|
||||
|
||||
// Send Fail to cast message
|
||||
PlayerCharacter pc = SessionManager
|
||||
.getPlayerCharacter(origin);
|
||||
|
||||
if (pc != null) {
|
||||
sendPowerMsg(pc, 2, msg);
|
||||
if (pc.isCasting()) {
|
||||
pc.update();
|
||||
}
|
||||
|
||||
pc.setIsCasting(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -908,9 +925,20 @@ public enum PowersManager {
|
||||
if (pb.isHarmful())
|
||||
mobTarget.handleDirectAggro(playerCharacter);
|
||||
}
|
||||
//Power is aiding a target, handle aggro if combat target is a Mob.
|
||||
if (!pb.isHarmful() && target.getObjectType() == GameObjectType.PlayerCharacter) {
|
||||
|
||||
//Check for immunities
|
||||
if (target.getObjectType() == GameObjectType.PlayerCharacter) {
|
||||
PlayerCharacter pcTarget = (PlayerCharacter) target;
|
||||
PlayerBonuses tarBonus = pcTarget.getBonuses();
|
||||
SourceType source = SourceType.GetSourceType(pb.category);
|
||||
boolean immune = tarBonus.getBool(ModType.ImmuneTo, source);
|
||||
if(!immune){
|
||||
DamageType damageType = DamageType.getDamageType(pb.category);
|
||||
immune = pcTarget.getResists().immuneTo(damageType);
|
||||
}
|
||||
if(immune){
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// update target of used power timer
|
||||
|
||||
@@ -248,7 +248,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
|
||||
City targetCity = null;
|
||||
|
||||
if (isTeleport)
|
||||
cities = City.getCitiesToTeleportTo(player);
|
||||
cities = City.getCitiesToTeleportTo(player, false);
|
||||
else
|
||||
cities = City.getCitiesToRepledgeTo(player);
|
||||
for (City city : cities) {
|
||||
|
||||
@@ -264,8 +264,9 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
|
||||
player.cancelOnSpell();
|
||||
break;
|
||||
case RUNE:
|
||||
ApplyRuneMsg.applyRune(uuid, origin, player);
|
||||
itemMan.consume(item);
|
||||
if(ApplyRuneMsg.applyRune(uuid, origin, player)) {
|
||||
itemMan.consume(item);
|
||||
}
|
||||
break;
|
||||
default: //shouldn't be here, consume item
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
|
||||
@@ -59,7 +59,7 @@ public class SendOwnPlayerMsg extends ClientNetMsg {
|
||||
@Override
|
||||
protected int getPowerOfTwoBufferSize() {
|
||||
//Larger size for historically larger opcodes
|
||||
return (17); // 2^17 == 131,072
|
||||
return (18); // 2^17 == 131,072
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -73,10 +73,8 @@ public class TeleportRepledgeListMsg extends ClientNetMsg {
|
||||
|
||||
public void configure() {
|
||||
|
||||
if (isTeleport)
|
||||
cities = City.getCitiesToTeleportTo(player);
|
||||
else
|
||||
cities = City.getCitiesToRepledgeTo(player);
|
||||
cities = City.getCitiesToTeleportTo(player, !isTeleport);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+122
-133
@@ -120,9 +120,7 @@ public class City extends AbstractWorldObject {
|
||||
this.treeOfLifeID = rs.getInt("treeOfLifeUUID");
|
||||
this.bindX = rs.getFloat("bindX");
|
||||
this.bindZ = rs.getFloat("bindZ");
|
||||
this.bindLoc = new Vector3fImmutable(this.location.getX() + this.bindX,
|
||||
this.location.getY(),
|
||||
this.location.getZ() + this.bindZ);
|
||||
this.bindLoc = new Vector3fImmutable(this.location.getX() + this.bindX, this.location.getY(), this.location.getZ() + this.bindZ);
|
||||
this.radiusType = rs.getInt("radiusType");
|
||||
|
||||
float bindradiustemp = rs.getFloat("bindRadius");
|
||||
@@ -288,106 +286,121 @@ public class City extends AbstractWorldObject {
|
||||
return city.getBindLoc();
|
||||
}
|
||||
|
||||
public static ArrayList<City> getCitiesToTeleportTo(PlayerCharacter pc) {
|
||||
public static ArrayList<City> getCitiesToTeleportTo(PlayerCharacter playerCharacter, boolean repledge) {
|
||||
|
||||
ArrayList<City> cities = new ArrayList<>();
|
||||
|
||||
if (pc == null)
|
||||
if (playerCharacter == null)
|
||||
return cities;
|
||||
|
||||
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(mbEnums.GameObjectType.City);
|
||||
|
||||
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()) {
|
||||
City city = (City) ago;
|
||||
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
|
||||
continue; // cannot teleport to perdition or bastion
|
||||
if (city.isNpc == 1 && city.getGuild().charter.equals(pc.guild.charter)) {
|
||||
cities.add(city); // anyone of the same charter can teleport to a safehold of that charter
|
||||
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;
|
||||
}
|
||||
}
|
||||
if (city.getGuild().getNation().equals(pc.guild.getNation())) {
|
||||
cities.add(city);//can always teleport inside your own nation
|
||||
}
|
||||
//handle compiling of cities able to be teleported to for lore rule-set
|
||||
|
||||
for (AbstractGameObject ago : worldCities.values()) {
|
||||
|
||||
City city = (City) ago;
|
||||
|
||||
// Filter Player cities
|
||||
|
||||
if (city.parentZone == null)
|
||||
continue;
|
||||
|
||||
if(repledge && city.getGuild().equals(playerCharacter.guild)){
|
||||
//can't repledge to a guild you're already part of
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
|
||||
Guild pcG = pc.getGuild();
|
||||
//add npc cities
|
||||
|
||||
for (AbstractGameObject ago : worldCities.values()) {
|
||||
|
||||
if (ago.getObjectType().equals(GameObjectType.City)) {
|
||||
City city = (City) ago;
|
||||
|
||||
if (city.noTeleport)
|
||||
continue;
|
||||
|
||||
if (city.parentZone != null && city.parentZone.guild_zone) {
|
||||
|
||||
if (pc.getAccount().status.equals(AccountStatus.ADMIN)) {
|
||||
cities.add(city);
|
||||
} else
|
||||
//list Player cities
|
||||
|
||||
//open city, just list
|
||||
|
||||
if (city.open && city.getTOL() != null && city.getTOL().getRank() > 4) {
|
||||
|
||||
if (!BuildingManager.IsPlayerHostile(city.getTOL(), pc)) {
|
||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||
if (city.getGuild().getGuildType().equals(pc.guild.getGuildType())) {
|
||||
cities.add(city);
|
||||
}
|
||||
} else {
|
||||
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 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
|
||||
}
|
||||
if (city.parentZone.guild_zone) {
|
||||
|
||||
if(city.getGuild().getNation().equals(playerCharacter.guild.getNation())){
|
||||
//players can all port and repledge inside their own nation
|
||||
cities.add(city);
|
||||
continue;
|
||||
}
|
||||
if (city.isOpen() && city.getTOL().rank > 4) {
|
||||
|
||||
// Filter Lore cities
|
||||
|
||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||
|
||||
if (!repledge)
|
||||
if (!city.getGuild().charter.equals(playerCharacter.guild.charter))
|
||||
continue;
|
||||
else if (!city.getGuild().charter.canJoin(playerCharacter))
|
||||
continue;
|
||||
}
|
||||
Integer playerUUID = playerCharacter.objectUUID;
|
||||
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;
|
||||
//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) {
|
||||
cities.add(city);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// Filter NPC cities
|
||||
|
||||
if (city.isNoobIsle == 1) {
|
||||
|
||||
if (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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return cities;
|
||||
@@ -586,7 +599,7 @@ public class City extends AbstractWorldObject {
|
||||
if (this.siegesWithstood == siegesWithstood)
|
||||
return;
|
||||
|
||||
if (DbManager.CityQueries.updateSiegesWithstood(this, siegesWithstood) == true)
|
||||
if (DbManager.CityQueries.updateSiegesWithstood(this, siegesWithstood))
|
||||
this.siegesWithstood = siegesWithstood;
|
||||
else
|
||||
Logger.error("Error when writing to database for cityUUID: " + this.getObjectUUID());
|
||||
@@ -640,19 +653,12 @@ public class City extends AbstractWorldObject {
|
||||
public Guild getGuild() {
|
||||
|
||||
if (this.getTOL() == null)
|
||||
return null;
|
||||
return Guild.getErrantGuild();
|
||||
|
||||
if (this.isNpc == 1) {
|
||||
if (this.getTOL().getOwner() == null)
|
||||
return Guild.getErrantGuild();
|
||||
|
||||
if (this.getTOL().getOwner() == null)
|
||||
return null;
|
||||
return this.getTOL().getOwner().getGuild();
|
||||
} else {
|
||||
|
||||
if (this.getTOL().getOwner() == null)
|
||||
return null;
|
||||
return this.getTOL().getOwner().getGuild();
|
||||
}
|
||||
return this.getTOL().getOwner().getGuild();
|
||||
}
|
||||
|
||||
public boolean openCity(boolean open) {
|
||||
@@ -731,7 +737,7 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
for (AbstractCharacter npc : getTOL().getHirelings().keySet()) {
|
||||
if (npc.getObjectType() == GameObjectType.NPC)
|
||||
if (((NPC) npc).getContract().isRuneMaster() == true)
|
||||
if (((NPC) npc).getContract().isRuneMaster())
|
||||
outNPC = (NPC) npc;
|
||||
}
|
||||
|
||||
@@ -764,16 +770,13 @@ public class City extends AbstractWorldObject {
|
||||
// Set location for this city
|
||||
|
||||
this.location = new Vector3fImmutable(this.parentZone.absX, this.parentZone.absY, this.parentZone.absZ);
|
||||
this.bindLoc = new Vector3fImmutable(this.location.x + this.bindX,
|
||||
this.location.y,
|
||||
this.location.z + this.bindZ);
|
||||
this.bindLoc = new Vector3fImmutable(this.location.x + this.bindX, this.location.y, this.location.z + this.bindZ);
|
||||
|
||||
// set city bounds
|
||||
|
||||
Bounds cityBounds = Bounds.borrow();
|
||||
cityBounds.setBounds(new Vector2f(this.location.x + 64, this.location.z + 64), // location x and z are offset by 64 from the center of the city.
|
||||
new Vector2f(mbEnums.CityBoundsType.GRID.halfExtents, mbEnums.CityBoundsType.GRID.halfExtents),
|
||||
0.0f);
|
||||
new Vector2f(mbEnums.CityBoundsType.GRID.halfExtents, mbEnums.CityBoundsType.GRID.halfExtents), 0.0f);
|
||||
this.setBounds(cityBounds);
|
||||
|
||||
// Sanity check; no tol
|
||||
@@ -781,8 +784,7 @@ public class City extends AbstractWorldObject {
|
||||
if (BuildingManager.getBuilding(this.treeOfLifeID) == null)
|
||||
Logger.info("City UID " + this.getObjectUUID() + " Failed to Load Tree of Life with ID " + this.treeOfLifeID);
|
||||
|
||||
if ((ConfigManager.serverType.equals(ServerType.WORLDSERVER))
|
||||
&& (this.isNpc == (byte) 0)) {
|
||||
if ((ConfigManager.serverType.equals(ServerType.WORLDSERVER)) && (this.isNpc == (byte) 0)) {
|
||||
|
||||
this.realm = RealmMap.getRealmAtLocation(this.getLoc());
|
||||
|
||||
@@ -802,8 +804,7 @@ public class City extends AbstractWorldObject {
|
||||
if (this.getGuild().getGuildState() == GuildState.Nation)
|
||||
for (Guild sub : this.getGuild().getSubGuildList()) {
|
||||
|
||||
if ((sub.getGuildState() == GuildState.Protectorate) ||
|
||||
(sub.getGuildState() == GuildState.Province)) {
|
||||
if ((sub.getGuildState() == GuildState.Protectorate) || (sub.getGuildState() == GuildState.Province)) {
|
||||
this.isCapital = 1;
|
||||
break;
|
||||
}
|
||||
@@ -828,7 +829,7 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
this.setHash();
|
||||
|
||||
if (DataWarehouse.recordExists(mbEnums.DataRecordType.CITY, this.getObjectUUID()) == false) {
|
||||
if (!DataWarehouse.recordExists(DataRecordType.CITY, this.getObjectUUID())) {
|
||||
CityRecord cityRecord = CityRecord.borrow(this, mbEnums.RecordEventType.CREATE);
|
||||
DataWarehouse.pushToWarehouse(cityRecord);
|
||||
}
|
||||
@@ -853,9 +854,7 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
for (Building building : this.parentZone.zoneBuildingSet) {
|
||||
|
||||
if (building.getBlueprint() != null &&
|
||||
building.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE &&
|
||||
building.getBlueprint().getBuildingGroup() != BuildingGroup.TOL) {
|
||||
if (building.getBlueprint() != null && building.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE && building.getBlueprint().getBuildingGroup() != BuildingGroup.TOL) {
|
||||
|
||||
building.healthMax += (building.healthMax * Realm.getRealmHealthMod(this));
|
||||
|
||||
@@ -937,7 +936,7 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
// Reapply effect with timeout?
|
||||
|
||||
if (refreshEffect == true)
|
||||
if (refreshEffect)
|
||||
player.addCityEffect(Integer.toString(effectBase.getUUID()), effectBase, rank, MBServerStatics.FOURTYFIVE_SECONDS, false, this);
|
||||
|
||||
}
|
||||
@@ -1193,18 +1192,13 @@ public class City extends AbstractWorldObject {
|
||||
// All protection contracts are void upon transfer of a city
|
||||
//Dont forget to not Flip protection on Banestones and siege Equipment... Noob.
|
||||
|
||||
if (cityBuilding.getBlueprint() != null && !cityBuilding.getBlueprint().isSiegeEquip()
|
||||
&& cityBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE)
|
||||
if (cityBuilding.getBlueprint() != null && !cityBuilding.getBlueprint().isSiegeEquip() && cityBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE)
|
||||
cityBuilding.setProtectionState(ProtectionState.NONE);
|
||||
|
||||
// Transfer ownership of valid city assets
|
||||
// these assets are autoprotected.
|
||||
|
||||
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL)
|
||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE)
|
||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK)
|
||||
|| (cityBuilding.getBlueprint().isWallPiece())
|
||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)) {
|
||||
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK) || (cityBuilding.getBlueprint().isWallPiece()) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)) {
|
||||
|
||||
cityBuilding.claim(sourcePlayer);
|
||||
cityBuilding.setProtectionState(ProtectionState.PROTECTED);
|
||||
@@ -1245,12 +1239,7 @@ public class City extends AbstractWorldObject {
|
||||
// Transfer ownership of valid city assets
|
||||
// these assets are autoprotected.
|
||||
|
||||
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL)
|
||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE)
|
||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK)
|
||||
|| (cityBuilding.getBlueprint().isWallPiece())
|
||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)
|
||||
) {
|
||||
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK) || (cityBuilding.getBlueprint().isWallPiece()) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)) {
|
||||
|
||||
cityBuilding.claim(sourcePlayer);
|
||||
cityBuilding.setProtectionState(ProtectionState.PROTECTED);
|
||||
|
||||
@@ -193,12 +193,16 @@ public class Guild extends AbstractWorldObject {
|
||||
}
|
||||
|
||||
public static boolean sameNationExcludeErrant(Guild a, Guild b) {
|
||||
|
||||
if (a == null || b == null)
|
||||
return false;
|
||||
|
||||
if (a.getObjectUUID() == b.getObjectUUID())
|
||||
return true;
|
||||
|
||||
if (a.nation == null || b.nation == null)
|
||||
return false;
|
||||
|
||||
return a.nation.getObjectUUID() == b.nation.getObjectUUID() && !a.nation.isEmptyGuild();
|
||||
}
|
||||
|
||||
|
||||
@@ -429,7 +429,7 @@ public class Warehouse {
|
||||
return false;
|
||||
|
||||
if (addToInventory)
|
||||
if (!itemMan.hasRoomInventory(template.item_wt * amount)) {
|
||||
if (!itemMan.hasRoomInventory(template.item_wt)) {
|
||||
ChatManager.chatSystemInfo(playerCharacter, "You can not carry any more of that item.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -633,4 +633,8 @@ public class PowersBase {
|
||||
return description;
|
||||
}
|
||||
|
||||
public boolean enforceLore(){
|
||||
return this.powerCategory.equals(PowerCategoryType.SUMMON) || this.powerCategory.equals(PowerCategoryType.HEAL)|| this.powerCategory.equals(PowerCategoryType.BUFF);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -125,6 +125,13 @@ public class DestroyCityThread implements Runnable {
|
||||
|
||||
cityBuilding.setProtectionState(mbEnums.ProtectionState.NONE);
|
||||
|
||||
// Remove warehouse entry if one exists.
|
||||
|
||||
if (cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.WAREHOUSE) {
|
||||
DbManager.WarehouseQueries.DELETE_WAREHOUSE(city.warehouse);
|
||||
city.warehouse = null;
|
||||
}
|
||||
|
||||
// Destroy all remaining city assets
|
||||
|
||||
if ((cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.BARRACK)
|
||||
|
||||
Reference in New Issue
Block a user