Merge branch 'magicbox1.5' into feature-guard-patrol

This commit is contained in:
2023-05-09 18:40:04 -05:00
10 changed files with 48 additions and 100 deletions
+2 -3
View File
@@ -135,15 +135,14 @@ public final class Bane {
return false;
}
// Cannot place banestones underwater;
// Cannot place banestone underwater;
if (HeightMap.isLocUnderwater(player.getLoc())) {
PlaceAssetMsg.sendPlaceAssetError(origin, 6, ""); // Cannot place underwater
return false;
}
// figure out which city we're standing on
// must be within a city's seige Bounds
// figure out which city zone we are standing on.
targetCity = ZoneManager.getCityAtLocation(player.getLoc());
+2 -2
View File
@@ -276,14 +276,14 @@ public class Building extends AbstractWorldObject {
if (this.getBlueprint() != null && this.getBlueprint().isSiegeEquip() && this.protectionState.equals(ProtectionState.PROTECTED)){
if (this.getGuild() != null){
if (this.getGuild().getOwnedCity() != null){
if (this.getLoc().isInsideCircle(this.getGuild().getOwnedCity().getLoc(), Enum.CityBoundsType.SIEGE.extents))
if (this.getLoc().isInsideCircle(this.getGuild().getOwnedCity().getLoc(), CityBoundsType.ZONE.extents))
return this.getGuild().getOwnedCity();
}else{
Bane bane = Bane.getBaneByAttackerGuild(this.getGuild());
if (bane != null){
if (bane.getCity() != null){
if (this.getLoc().isInsideCircle(bane.getCity().getLoc(), Enum.CityBoundsType.SIEGE.extents))
if (this.getLoc().isInsideCircle(bane.getCity().getLoc(), CityBoundsType.ZONE.extents))
return bane.getCity();
}
}
+3 -3
View File
@@ -943,7 +943,7 @@ public class City extends AbstractWorldObject {
public boolean isLocationWithinSiegeBounds(Vector3fImmutable insideLoc) {
return insideLoc.isInsideCircle(this.getLoc(), CityBoundsType.SIEGE.extents);
return insideLoc.isInsideCircle(this.getLoc(), CityBoundsType.ZONE.extents);
}
@@ -1001,9 +1001,9 @@ public class City extends AbstractWorldObject {
HashSet<Integer> currentMemory;
PlayerCharacter player;
// Gather current list of players within a distance defined by the seige bounds
// Gather current list of players within the zone bounds
currentPlayers = WorldGrid.getObjectsInRangePartial(this.location, CityBoundsType.SIEGE.extents, MBServerStatics.MASK_PLAYER);
currentPlayers = WorldGrid.getObjectsInRangePartial(this.location, CityBoundsType.ZONE.extents, MBServerStatics.MASK_PLAYER);
currentMemory = new HashSet<>();
for (AbstractWorldObject playerObject : currentPlayers) {
+9 -6
View File
@@ -184,9 +184,12 @@ public class NPC extends AbstractCharacter {
if (this.contract != null)
this.loadID = this.contract.getMobbaseID();
else
this.loadID = 2011; //default to human
this.loadID = rs.getInt("npc_raceID");
this.loadID = rs.getInt("npc_raceID");
// Default to human male
if (loadID == 0)
loadID = 2100;
this.mobBase = MobBase.getMobBase(this.loadID);
this.level = rs.getByte("npc_level");
@@ -242,11 +245,11 @@ public class NPC extends AbstractCharacter {
this.name = rs.getString("npc_name");
// Name override for player owned npcs
// Name override for npc
// with an owner.
if (this.building != null &&
this.building.getOwner() != null &&
this.building.getOwner().getObjectType().equals(GameObjectType.PlayerCharacter))
if (this.guild != null &&
!this.guild.isEmptyGuild())
this.name += " the " + this.contract.getName();
}catch(Exception e){
+8 -1
View File
@@ -26,13 +26,20 @@ public class Portal {
private long lastActive = 0;
public Portal(Building sourceGate, PortalType portalType, Building targetGate) {
Vector3fImmutable tmpLocation;
this.active = false;
this.sourceGate = sourceGate;
this.targetGate = targetGate;
this.portalType = portalType;
this.portalLocation = sourceGate.getLoc().add(new Vector3fImmutable(portalType.offset.x, 6, portalType.offset.y));
tmpLocation = sourceGate.getLoc().add(new Vector3fImmutable(portalType.offset.x, 6, portalType.offset.y));
// Rotate portal by gate rotation
tmpLocation = Vector3fImmutable.rotateAroundPoint(sourceGate.getLoc(), tmpLocation, sourceGate.getBounds().getQuaternion().angleY);
this.portalLocation = tmpLocation;
}
public boolean isActive() {