示例#1
0
  public void processCommand(
      CreatureObject actor,
      SWGObject target,
      BaseSWGCommand command,
      int actionCounter,
      String commandArgs) {
    if (command.getCooldown() > 0f) {
      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().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);
      }
    }
  }