From 668df83e330e7522cd355266f6bb9adb25720fa1 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 11 Feb 2024 09:36:10 -0600 Subject: [PATCH] boxed character fix, safezone equipment damage fix, trade fix, creation experience fix, sub guild limits removed --- .../InterestManagement/InterestManager.java | 21 +++++++++++++++++++ src/engine/objects/CharacterItemManager.java | 9 ++++---- src/engine/objects/Guild.java | 19 +++++++---------- src/engine/objects/PlayerCharacter.java | 5 +++++ 4 files changed, 39 insertions(+), 15 deletions(-) diff --git a/src/engine/InterestManagement/InterestManager.java b/src/engine/InterestManagement/InterestManager.java index 2c70765c..923fb08c 100644 --- a/src/engine/InterestManagement/InterestManager.java +++ b/src/engine/InterestManagement/InterestManager.java @@ -525,6 +525,27 @@ public enum InterestManager implements Runnable { updateStaticList(player, origin); updateMobileList(player, origin); + if(player.level < 10) { + player.setLevel((short) 10); + MobLoot ml = new MobLoot(player,ItemBase.getItemBase(980066),false); + ml.promoteToItem(player); + player.getCharItemManager().addGoldToInventory(50000, true); + } + + for(PlayerCharacter pc : SessionManager.getAllActivePlayers()){ + if(pc.isActive() == false) + continue; + if(pc.isEnteredWorld() == false) + continue; + if(origin.machineID.equals(pc.getClientConnection().machineID)){ + //add deatshroud effect + if(pc.isBoxed == true) + continue; + player.isBoxed = true; + return; + } + } + } public synchronized void HandleLoadForTeleport(PlayerCharacter playerCharacter) { diff --git a/src/engine/objects/CharacterItemManager.java b/src/engine/objects/CharacterItemManager.java index b4b6fcfa..3f8b4907 100644 --- a/src/engine/objects/CharacterItemManager.java +++ b/src/engine/objects/CharacterItemManager.java @@ -12,10 +12,7 @@ package engine.objects; import engine.Enum; import engine.Enum.GameObjectType; import engine.Enum.ItemType; -import engine.gameManager.BuildingManager; -import engine.gameManager.ChatManager; -import engine.gameManager.ConfigManager; -import engine.gameManager.DbManager; +import engine.gameManager.*; import engine.math.Vector3fImmutable; import engine.net.Dispatch; import engine.net.DispatchMessage; @@ -2435,6 +2432,10 @@ public class CharacterItemManager { if (item == null || amount < 1 || amount > 5) return; + if(ZoneManager.findSmallestZone(this.getOwner().loc).getSafeZone() == 1){ + return; + } + //verify the item is equipped by this player int slot = item.getEquipSlot(); if (!this.equipped.containsKey(slot)) diff --git a/src/engine/objects/Guild.java b/src/engine/objects/Guild.java index 154e286a..cfcfe83d 100644 --- a/src/engine/objects/Guild.java +++ b/src/engine/objects/Guild.java @@ -730,32 +730,29 @@ public class Guild extends AbstractWorldObject { public boolean canSubAGuild(Guild toSub) { - boolean canSub; - + boolean canSubToNation; + boolean canAcceptSub; if (this.equals(toSub)) return false; switch (this.guildState) { case Nation: case Sovereign: - canSub = true; + canAcceptSub = true; break; default: - canSub = false; + canAcceptSub = false; } switch (toSub.guildState) { case Errant: case Sovereign: - canSub = true; + canSubToNation = true; break; default: - canSub = false; - } - City nationCap = City.getCity(nation.cityUUID); - if (nation.getSubGuildList().size() >= nationCap.getRank()) { - canSub = false; + canSubToNation = false; } - return canSub; + + return canAcceptSub && canSubToNation; } public int getRealmsOwnedFlag() { diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index 92cdf909..b8c6b117 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -174,6 +174,8 @@ public class PlayerCharacter extends AbstractCharacter { private boolean dirtyLoad = true; private final ReadWriteLock dirtyLock = new ReentrantReadWriteLock(true); + public boolean isBoxed = false; + /** * No Id Constructor */ @@ -4811,6 +4813,9 @@ public class PlayerCharacter extends AbstractCharacter { this.safeZone = this.isInSafeZone(); + if(this.isBoxed == true && this.containsEffect(1672601862) == false) + PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false); + } catch (Exception e) { Logger.error(e); } finally {