|
|
@ -869,13 +869,8 @@ public class Building extends AbstractWorldObject { |
|
|
|
DispatchMessage.sendToAllInRange(this, applyBuildingEffectMsg); |
|
|
|
DispatchMessage.sendToAllInRange(this, applyBuildingEffectMsg); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* Utils |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void removeEffectBit(int bit) { |
|
|
|
public void removeEffectBit(int bit) { |
|
|
|
this.effectFlags &= (~bit); |
|
|
|
this.effectFlags &= (~bit); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -892,11 +887,6 @@ public class Building extends AbstractWorldObject { |
|
|
|
this.updateName(); |
|
|
|
this.updateName(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* Serializing |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public final AbstractCharacter getOwner() { |
|
|
|
public final AbstractCharacter getOwner() { |
|
|
|
|
|
|
|
|
|
|
|
if (this.ownerUUID == 0) |
|
|
|
if (this.ownerUUID == 0) |
|
|
@ -908,10 +898,6 @@ public class Building extends AbstractWorldObject { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* Database |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public final String getOwnerName() { |
|
|
|
public final String getOwnerName() { |
|
|
|
AbstractCharacter owner = this.getOwner(); |
|
|
|
AbstractCharacter owner = this.getOwner(); |
|
|
|
if (owner != null) |
|
|
|
if (owner != null) |
|
|
@ -972,8 +958,6 @@ public class Building extends AbstractWorldObject { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// *** Refactor: Can't we just use setRank() for this?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public final void rebuildMine() { |
|
|
|
public final void rebuildMine() { |
|
|
|
this.setRank(1); |
|
|
|
this.setRank(1); |
|
|
|
this.meshUUID = this.getBlueprint().getMeshForRank(this.rank); |
|
|
|
this.meshUUID = this.getBlueprint().getMeshForRank(this.rank); |
|
|
@ -996,8 +980,6 @@ public class Building extends AbstractWorldObject { |
|
|
|
return maxGold; |
|
|
|
return maxGold; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//This returns if a player is allowed access to control the building
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void runAfterLoad() { |
|
|
|
public void runAfterLoad() { |
|
|
|
|
|
|
|
|
|
|
@ -1184,7 +1166,6 @@ public class Building extends AbstractWorldObject { |
|
|
|
this.ownerIsNPC = (newOwner.getObjectType() == GameObjectType.NPC); |
|
|
|
this.ownerIsNPC = (newOwner.getObjectType() == GameObjectType.NPC); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set new guild for hirelings and refresh all clients
|
|
|
|
// Set new guild for hirelings and refresh all clients
|
|
|
|
|
|
|
|
|
|
|
|
this.refreshGuild(); |
|
|
|
this.refreshGuild(); |
|
|
@ -1304,7 +1285,7 @@ public class Building extends AbstractWorldObject { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Save to database ?
|
|
|
|
// Save to database ?
|
|
|
|
if (updateRecord == true) |
|
|
|
if (updateRecord) |
|
|
|
return DbManager.BuildingQueries.UPDATE_DOOR_LOCK(this.getObjectUUID(), this.doorState); |
|
|
|
return DbManager.BuildingQueries.UPDATE_DOOR_LOCK(this.getObjectUUID(), this.doorState); |
|
|
|
else |
|
|
|
else |
|
|
|
return true; |
|
|
|
return true; |
|
|
@ -1340,7 +1321,6 @@ public class Building extends AbstractWorldObject { |
|
|
|
this.spireIsActive = true; |
|
|
|
this.spireIsActive = true; |
|
|
|
this.updateEffects(); |
|
|
|
this.updateEffects(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public final void disableSpire(boolean refreshEffect) { |
|
|
|
public final void disableSpire(boolean refreshEffect) { |
|
|
@ -1629,18 +1609,10 @@ public class Building extends AbstractWorldObject { |
|
|
|
return patrolPoints; |
|
|
|
return patrolPoints; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setPatrolPoints(ArrayList<Vector3fImmutable> patrolPoints) { |
|
|
|
|
|
|
|
this.patrolPoints = patrolPoints; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ArrayList<Vector3fImmutable> getSentryPoints() { |
|
|
|
public ArrayList<Vector3fImmutable> getSentryPoints() { |
|
|
|
return sentryPoints; |
|
|
|
return sentryPoints; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setSentryPoints(ArrayList<Vector3fImmutable> sentryPoints) { |
|
|
|
|
|
|
|
this.sentryPoints = sentryPoints; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public synchronized boolean addProtectionTax(Building building, PlayerCharacter pc, final TaxType taxType, int amount, boolean enforceKOS) { |
|
|
|
public synchronized boolean addProtectionTax(Building building, PlayerCharacter pc, final TaxType taxType, int amount, boolean enforceKOS) { |
|
|
|
if (building == null) |
|
|
|
if (building == null) |
|
|
|
return false; |
|
|
|
return false; |
|
|
@ -1665,14 +1637,6 @@ public class Building extends AbstractWorldObject { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public synchronized boolean declineTaxOffer() { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public synchronized boolean acceptTaxOffer() { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public synchronized boolean acceptTaxes() { |
|
|
|
public synchronized boolean acceptTaxes() { |
|
|
|
|
|
|
|
|
|
|
|
if (!DbManager.BuildingQueries.acceptTaxes(this)) |
|
|
|
if (!DbManager.BuildingQueries.acceptTaxes(this)) |
|
|
@ -1697,14 +1661,6 @@ public class Building extends AbstractWorldObject { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isTaxed() { |
|
|
|
|
|
|
|
if (this.taxType == TaxType.NONE) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
if (this.taxAmount == 0) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
return this.taxDateTime != null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void AddToBarracksList() { |
|
|
|
public void AddToBarracksList() { |
|
|
|
City playerCity = ZoneManager.getCityAtLocation(this.loc); |
|
|
|
City playerCity = ZoneManager.getCityAtLocation(this.loc); |
|
|
|
if (playerCity != null) { |
|
|
|
if (playerCity != null) { |
|
|
|