From cacd6292cf937945e455fe0757b40d21ad07f226 Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Tue, 12 Aug 2014 10:05:10 +0200 Subject: [PATCH] Added specialLine scripts This will greatly reduce the amount of duplicate combat command scripts. --- src/services/command/CommandService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/services/command/CommandService.java b/src/services/command/CommandService.java index 2f9962cd..404c09e4 100644 --- a/src/services/command/CommandService.java +++ b/src/services/command/CommandService.java @@ -750,9 +750,12 @@ public class CommandService implements INetworkDispatch { } public void processCombatCommand(CreatureObject attacker, SWGObject target, CombatCommand command, int actionCounter, String commandArgs) { - if (FileUtilities.doesFileExist("scripts/commands/combat/" + command.getCommandName().toLowerCase() + ".py")) { + if (FileUtilities.doesFileExist("scripts/commands/combat/specialline/" + command.getSpecialLine().toLowerCase() + ".py")) + core.scriptService.callScript("scripts/commands/combat/specialline/", command.getSpecialLine().toLowerCase(), "setup", core, attacker, target, command); + + if (FileUtilities.doesFileExist("scripts/commands/combat/" + command.getCommandName().toLowerCase() + ".py")) core.scriptService.callScript("scripts/commands/combat/", command.getCommandName().toLowerCase(), "setup", core, attacker, target, command); - } else { + else { if (FileUtilities.doesFileExist("scripts/commands/" + command.getCommandName().toLowerCase() + ".py")) { System.err.print("Command " + command.getCommandName() + " is considered a combat command by the client but has a regular command script!"); core.scriptService.callScript("scripts/commands/", command.getCommandName().toLowerCase(), "run", core, attacker, target, "");