From 4d8cb339c3ac04d5eb44b8d00dd948437859769b Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 5 May 2024 20:26:45 -0500 Subject: [PATCH] errant characters recall to SDR --- .../poweractions/RecallPowerAction.java | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/src/engine/powers/poweractions/RecallPowerAction.java b/src/engine/powers/poweractions/RecallPowerAction.java index c0ffb409..aaa945c2 100644 --- a/src/engine/powers/poweractions/RecallPowerAction.java +++ b/src/engine/powers/poweractions/RecallPowerAction.java @@ -11,22 +11,22 @@ package engine.powers.poweractions; import engine.Enum.GameObjectType; import engine.InterestManagement.WorldGrid; +import engine.gameManager.DbManager; import engine.gameManager.MovementManager; +import engine.gameManager.ZoneManager; import engine.math.Vector3fImmutable; import engine.net.Dispatch; import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.PromptRecallMsg; -import engine.objects.AbstractCharacter; -import engine.objects.AbstractWorldObject; -import engine.objects.Mob; -import engine.objects.PlayerCharacter; +import engine.objects.*; import engine.powers.ActionsBase; import engine.powers.PowersBase; import engine.server.MBServerStatics; import java.sql.ResultSet; import java.sql.SQLException; +import java.util.concurrent.ThreadLocalRandom; public class RecallPowerAction extends AbstractPowerAction { @@ -48,8 +48,6 @@ public class RecallPowerAction extends AbstractPowerAction { if (pc.hasBoon()) return; - ClientConnection cc = pc.getClientConnection(); - if (source.getObjectUUID() != pc.getObjectUUID()) { pc.setTimeStampNow("PromptRecall"); pc.setTimeStamp("LastRecallType", 1); //recall to bind @@ -58,7 +56,28 @@ public class RecallPowerAction extends AbstractPowerAction { DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY); } else { - MovementManager.translocate(awoac, awoac.getBindLoc(), null); + if(pc.guild.equals(Guild.getErrantGuild()) || pc.guild.getNation().equals(Guild.getErrantGuild())){ + Vector3fImmutable loc; + for (AbstractGameObject cityAgo : DbManager.getList(GameObjectType.City)) { + City city = (City) cityAgo; + if (city == null) + continue; + if (!city.getCityName().equalsIgnoreCase("sea dog's rest")) + continue; + Zone zone = city.getParent(); + if (zone != null) { + if (zone.isNPCCity() || zone.isPlayerCity()) + loc = Vector3fImmutable.getRandomPointOnCircle(zone.getLoc(), MBServerStatics.TREE_TELEPORT_RADIUS); + else + loc = zone.getLoc(); + + MovementManager.translocate(awoac, loc, null); + break; + } + } + } else { + MovementManager.translocate(awoac, awoac.getBindLoc(), null); + } } } else { Vector3fImmutable bindloc = awoac.getBindLoc();