diff --git a/scripts/commands/setspeed.py b/scripts/commands/setspeed.py index e5929c25..c73266de 100644 --- a/scripts/commands/setspeed.py +++ b/scripts/commands/setspeed.py @@ -5,6 +5,5 @@ def setup(): def run(core, actor, target, commandString): actor.setSpeedMultiplierBase(float(commandString)) - core.buffService.addBuffToCreature(actor, 'bh_prescience') return \ No newline at end of file diff --git a/src/services/command/CommandService.java b/src/services/command/CommandService.java index a215c548..e18b9535 100644 --- a/src/services/command/CommandService.java +++ b/src/services/command/CommandService.java @@ -76,7 +76,7 @@ public class CommandService implements INetworkDispatch { return false; } - if (command.getCharacterAbility().length() > 0 && !actor.hasAbility(command.getCharacterAbility()) && command.getGodLevel() < 1) { + if (command.getCharacterAbility().length() > 0 && !actor.hasAbility(command.getCharacterAbility()) && !command.getCharacterAbility().equals("admin")) { return false; } @@ -200,7 +200,7 @@ public class CommandService implements INetworkDispatch { default: break; } - + if (command.shouldCallOnTarget()) { if (target == null || !(target instanceof CreatureObject)) { return false; @@ -211,10 +211,12 @@ public class CommandService implements INetworkDispatch { long warmupTime = (long) (command.getWarmupTime() * 1000F); - try { - Thread.sleep(warmupTime); - } catch (InterruptedException e) { - e.printStackTrace(); + if(warmupTime > 0) { + try { + Thread.sleep(warmupTime); + } catch (InterruptedException e) { + e.printStackTrace(); + } } processCommand(actor, target, command, actionCounter, commandArgs); @@ -316,7 +318,7 @@ public class CommandService implements INetworkDispatch { sub += 5; } - if (hasCharacterAbility || isCombatCommand(commandName)) { + if (/*hasCharacterAbility ||*/ isCombatCommand(commandName)) { CombatCommand command = new CombatCommand(commandName); commandLookup.add(command); return command; @@ -353,15 +355,16 @@ public class CommandService implements INetworkDispatch { } public void processCommand(CreatureObject actor, SWGObject target, BaseSWGCommand command, int actionCounter, String commandArgs) { - actor.addCooldown(command.getCooldownGroup(), command.getCooldown()); - + if(command.getCooldown() > 0) + actor.addCooldown(command.getCooldownGroup(), command.getCooldown()); + if (command instanceof CombatCommand) { processCombatCommand(actor, target, (CombatCommand) command, actionCounter, commandArgs); } else { - if (FileUtilities.doesFileExist("scripts/commands/" + command.getCommandName() + ".py")) { - core.scriptService.callScript("scripts/commands/", command.getCommandName(), "run", core, actor, target, commandArgs); - } else if (FileUtilities.doesFileExist("scripts/commands/combat/" + command.getCommandName() + ".py")) { - core.scriptService.callScript("scripts/commands/combat/", command.getCommandName(), "run", core, actor, target, commandArgs); + if (FileUtilities.doesFileExist("scripts/commands/" + command.getCommandName().toLowerCase() + ".py")) { + core.scriptService.callScript("scripts/commands/", command.getCommandName().toLowerCase(), "run", core, actor, target, commandArgs); + } else if (FileUtilities.doesFileExist("scripts/commands/combat/" + command.getCommandName().toLowerCase() + ".py")) { + core.scriptService.callScript("scripts/commands/combat/", command.getCommandName().toLowerCase(), "run", core, actor, target, commandArgs); } } }