diff --git a/src/engine/devcmd/cmds/PrintEffectsCmd.java b/src/engine/devcmd/cmds/PrintEffectsCmd.java new file mode 100644 index 00000000..bbb08e68 --- /dev/null +++ b/src/engine/devcmd/cmds/PrintEffectsCmd.java @@ -0,0 +1,72 @@ +// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . +// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· +// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ +// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ +// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ +// Magicbane Emulator Project © 2013 - 2022 +// www.magicbane.com + + +package engine.devcmd.cmds; + +import engine.Enum; +import engine.Enum.BuildingGroup; +import engine.Enum.GameObjectType; +import engine.Enum.TargetColor; +import engine.devcmd.AbstractDevCmd; +import engine.gameManager.BuildingManager; +import engine.gameManager.PowersManager; +import engine.gameManager.SessionManager; +import engine.math.Vector3fImmutable; +import engine.objects.*; +import engine.powers.EffectsBase; +import engine.server.MBServerStatics; +import engine.util.StringUtils; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.concurrent.ConcurrentHashMap; + + +/** + * @author + */ +public class PrintEffectsCmd extends AbstractDevCmd { + + public PrintEffectsCmd() { + super("printeffects"); + } + + @Override + protected void _doCmd(PlayerCharacter pc, String[] words, + AbstractGameObject target) { + + if(!target.getObjectType().equals(GameObjectType.PlayerCharacter)) { + throwbackInfo(pc, "Target Must PlayerCharacter"); + return; + } + String newline = "\r\n "; + String output = "Effects for Player:" + newline; + + AbstractCharacter absTar = (AbstractCharacter) target; + for(Effect eff : absTar.effects.values()){ + if(eff.getJobContainer() != null) { + output += eff.getName() + " (" + eff.getTrains() + ") " + eff.getJobContainer().timeToExecutionLeft() + newline; + }else{ + output += eff.getName() + " (" + eff.getTrains() + ") " + "PERMANENT" + newline; + } + } + throwbackInfo(pc, output); + } + + @Override + protected String _getHelpString() { + return "Gets information on an Object."; + } + + @Override + protected String _getUsageString() { + return "' /info targetID'"; + } + +} diff --git a/src/engine/gameManager/DevCmdManager.java b/src/engine/gameManager/DevCmdManager.java index ed1cc819..939422fc 100644 --- a/src/engine/gameManager/DevCmdManager.java +++ b/src/engine/gameManager/DevCmdManager.java @@ -56,6 +56,7 @@ public enum DevCmdManager { DevCmdManager.registerDevCmd(new PrintResistsCmd()); DevCmdManager.registerDevCmd(new PrintLocationCmd()); DevCmdManager.registerDevCmd(new InfoCmd()); + DevCmdManager.registerDevCmd(new PrintEffectsCmd()); DevCmdManager.registerDevCmd(new aiInfoCmd()); DevCmdManager.registerDevCmd(new SimulateBootyCmd()); DevCmdManager.registerDevCmd(new GetHeightCmd()); diff --git a/src/engine/gameManager/PowersManager.java b/src/engine/gameManager/PowersManager.java index ae87a568..a03f7a27 100644 --- a/src/engine/gameManager/PowersManager.java +++ b/src/engine/gameManager/PowersManager.java @@ -846,6 +846,11 @@ public enum PowersManager { // called when a spell finishes casting. perform actions public static void finishUsePower(final PerformActionMsg msg, PlayerCharacter playerCharacter, int casterLiveCounter, int targetLiveCounter) { + if(true) { + newFinishCast(msg); + return; + } + PerformActionMsg performActionMsg; Dispatch dispatch; @@ -1198,10 +1203,6 @@ public enum PowersManager { public static void finishUseMobPower(PerformActionMsg msg, Mob caster, int casterLiveCounter, int targetLiveCounter) { - if(true) { - newFinishCast(msg); - return; - } if (caster == null || msg == null) return; @@ -3130,8 +3131,14 @@ public enum PowersManager { if(source.getPowers().containsKey(msg.getPowerUsedID())){ trains = source.getPowers().get(msg.getPowerUsedID()).getTrains(); } + + if(powerBase.targetSelf) { + msg.setTargetID(source.getObjectUUID()); + msg.setTargetType(GameObjectType.PlayerCharacter.ordinal()); + } AbstractWorldObject target = getTarget(msg); + if(target == null) return; @@ -3154,8 +3161,15 @@ public enum PowersManager { } } } - action.getPowerAction().startAction(source,target,target.loc,trains,action,powerBase); - } + int duration = action.getDuration(trains); + runPowerAction(source,target,target.loc,action,trains,powerBase,duration); + //action.getPowerAction().startAction(source,target,target.loc,trains,action,powerBase); + } + source.setIsCasting(false); + PerformActionMsg castMsg = new PerformActionMsg(msg); + castMsg.setNumTrains(9999); + castMsg.setUnknown04(2); + DispatchMessage.dispatchMsgToInterestArea(source, castMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); } }