@Override
  public boolean onDialogEvent(QuestEnv env) {
    Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    DialogAction dialog = env.getDialog();
    int targetId = env.getTargetId();

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 798225) {
        if (dialog == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 1011);
        } else {
          return sendQuestStartDialog(env);
        }
      }
    } else if (qs.getStatus() == QuestStatus.START) {
      if (targetId == 798226) {
        if (dialog == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 2375);
        } else if (dialog == DialogAction.SELECT_QUEST_REWARD) {
          return defaultCloseDialog(env, 0, 1, true, true);
        }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 798226) {
        if (dialog == DialogAction.USE_OBJECT) {
          return sendQuestDialog(env, 5);
        }
        return sendQuestEndDialog(env);
      }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);

    int targetId = env.getTargetId();

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 801547) {
        switch (env.getDialog()) {
          case QUEST_SELECT:
            return sendQuestDialog(env, 4762);
          case QUEST_ACCEPT_SIMPLE:
            return sendQuestStartDialog(env);
          case QUEST_REFUSE_SIMPLE:
            return sendQuestEndDialog(env);
        }
      }
    } else if (qs != null && qs.getStatus() == QuestStatus.REWARD) {
      if (env.getDialog() == DialogAction.USE_OBJECT) return sendQuestDialog(env, 10002);
      else if (env.getDialogId() == DialogAction.SELECT_QUEST_REWARD.id())
        return sendQuestDialog(env, 5);
      else return sendQuestEndDialog(env);
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    int targetId = env.getTargetId();

    if (!butlers.contains(targetId)) return false;

    House house = player.getActiveHouse();
    if (house == null || house.getButler() == null || house.getButler().getNpcId() != targetId)
      return false;

    DialogAction dialog = env.getDialog();
    QuestState qs = player.getQuestStateList().getQuestState(questId);

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      switch (dialog) {
        case QUEST_SELECT:
          return sendQuestDialog(env, 1011);
        case QUEST_ACCEPT_1:
        case QUEST_ACCEPT_SIMPLE:
          return sendQuestStartDialog(env, 182213191, 1);
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      switch (dialog) {
        case USE_OBJECT:
          return sendQuestDialog(env, 2375);
        case SELECT_QUEST_REWARD:
          removeQuestItem(env, 182213191, 1);
        case SELECTED_QUEST_NOREWARD:
          sendQuestEndDialog(env);
          return true;
      }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    DialogAction dialog = env.getDialog();
    int targetId = env.getTargetId();

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 204339) {
        if (dialog == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 4762);
        } else {
          return sendQuestStartDialog(env);
        }
      }
    } else if (qs.getStatus() == QuestStatus.START) {
      if (targetId == 204339) {
        if (dialog == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 1003);
        } else if (dialog == DialogAction.SELECT_ACTION_1012) {
          giveQuestItem(env, 182204147, 1);
          return sendQuestDialog(env, 1012);
        } else if (dialog == DialogAction.SELECT_ACTION_1097) {
          giveQuestItem(env, 182204147, 1);
          return sendQuestDialog(env, 1097);
        } else if (dialog == DialogAction.SETPRO10) {
          changeQuestStep(env, 0, 10, false);
          qs.setStatus(QuestStatus.REWARD);
          updateQuestStatus(env);
          return closeDialogWindow(env);
        } else if (dialog == DialogAction.SETPRO20) {
          rewardIndex = 1;
          changeQuestStep(env, 0, 20, false);
          qs.setStatus(QuestStatus.REWARD);
          updateQuestStatus(env);
          return closeDialogWindow(env);
        }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 798079) {
        if (dialog == DialogAction.USE_OBJECT) {
          return sendQuestDialog(env, 1352);
        }
      } else if (targetId == 798080) {
        if (dialog == DialogAction.USE_OBJECT) {
          return sendQuestDialog(env, 1693);
        }
      }
      return sendQuestEndDialog(env, rewardIndex);
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    int targetId = env.getTargetId();
    DialogAction dialog = env.getDialog();
    QuestState qs = player.getQuestStateList().getQuestState(questId);

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 830211) {
        switch (dialog) {
          case QUEST_SELECT:
            return sendQuestDialog(env, 1011);
          case QUEST_ACCEPT_1:
          case QUEST_ACCEPT_SIMPLE:
            return sendQuestStartDialog(env);
        }
      }
    } else if (qs.getStatus() == QuestStatus.START) {
      switch (targetId) {
        case 730524:
          {
            switch (dialog) {
              case QUEST_SELECT:
                return sendQuestDialog(env, 1352);
              case SELECT_ACTION_1353:
                return sendQuestDialog(env, 1353);
              case SETPRO1:
                return defaultCloseDialog(env, 0, 1);
            }
            break;
          }
        case 830211:
          {
            switch (dialog) {
              case QUEST_SELECT:
                {
                  return sendQuestDialog(env, 2375);
                }
              case SELECT_QUEST_REWARD:
                changeQuestStep(env, 1, 1, true);
                return sendQuestDialog(env, 5);
            }
          }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 830211) {
        return sendQuestEndDialog(env);
      }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    DialogAction dialog = env.getDialog();
    int targetId = env.getTargetId();

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 204261) {
        if (dialog == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 4762);
        } else {
          return sendQuestStartDialog(env);
        }
      }
    } else if (qs.getStatus() == QuestStatus.START) {
      if (targetId == 204261) {
        if (dialog == DialogAction.QUEST_SELECT) {
          if (qs.getQuestVarById(0) == 0) return sendQuestDialog(env, 1003);
        } else if (dialog == DialogAction.SELECT_ACTION_1012) {
          return sendQuestDialog(env, 1012);
        } else if (dialog == DialogAction.SELECT_ACTION_1097) {
          return sendQuestDialog(env, 1097);
        } else if (dialog == DialogAction.SETPRO10) {
          qs.setQuestVar(10);
          return defaultCloseDialog(env, 10, 10, true, false);
        } else if (dialog == DialogAction.SETPRO20) {
          qs.setQuestVar(20);
          return defaultCloseDialog(env, 20, 20, true, false);
        }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 798058 && qs.getQuestVarById(0) == 10) {
        if (dialog == DialogAction.USE_OBJECT) {
          return sendQuestDialog(env, 1352);
        }
        return sendQuestEndDialog(env);
      } else if (targetId == 204108 && qs.getQuestVarById(0) == 20) {
        if (dialog == DialogAction.USE_OBJECT) {
          return sendQuestDialog(env, 1693);
        }
        return sendQuestEndDialog(env, 1);
      }
    }
    return false;
  }
示例#7
0
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    Player player = env.getPlayer();
    int targetId = env.getTargetId();
    QuestState qs = player.getQuestStateList().getQuestState(questId);

    if (targetId == 805272 || targetId == 805273 || targetId == 805274) {
      if (qs == null || qs.getStatus() == QuestStatus.NONE || qs.canRepeat()) {
        if (env.getDialogId() == DialogAction.QUEST_SELECT.id()) return sendQuestDialog(env, 4762);
        else return sendQuestStartDialog(env);
      } else if (qs != null && qs.getStatus() == QuestStatus.REWARD) {
        if (env.getDialogId() == DialogAction.USE_OBJECT.id()) return sendQuestDialog(env, 10002);
        else if (env.getDialogId() == DialogAction.SELECT_QUEST_REWARD.id())
          return sendQuestDialog(env, 5);
        else return sendQuestEndDialog(env);
      }
    }
    return false;
  }
示例#8
0
  @Override
  public boolean onKillEvent(QuestEnv env) {
    Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null || qs.getStatus() != QuestStatus.START) return false;

    int targetId = env.getTargetId();

    switch (targetId) {
      case 235356:
        if (qs.getQuestVarById(1) != 4) {
          qs.setQuestVarById(1, qs.getQuestVarById(1) + 1);
          updateQuestStatus(env);
        } else {
          qs.setQuestVarById(1, 5);
          qs.setStatus(QuestStatus.REWARD);
          updateQuestStatus(env);
        }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    Player player = env.getPlayer();
    int targetId = env.getTargetId();
    QuestState qs = player.getQuestStateList().getQuestState(questId);

    if (targetId == 799584) {
      if (qs == null || qs.getStatus() == QuestStatus.NONE) {
        if (env.getDialogId() == DialogAction.QUEST_SELECT.id()) return sendQuestDialog(env, 4762);
        else return sendQuestStartDialog(env);
      }
    } else if (targetId == 799563) {
      if (qs != null && qs.getStatus() == QuestStatus.START && qs.getQuestVarById(0) == 0) {
        if (env.getDialogId() == DialogAction.QUEST_SELECT.id()) return sendQuestDialog(env, 1011);
        else if (env.getDialogId() == DialogAction.SETPRO1.id()) {
          qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
          updateQuestStatus(env);
          PacketSendUtility.sendPacket(
              player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
          return true;
        } else return sendQuestStartDialog(env);
      } else if (qs != null && qs.getStatus() == QuestStatus.REWARD) {
        if (env.getDialogId() == DialogAction.USE_OBJECT.id()) return sendQuestDialog(env, 10002);
        else if (env.getDialogId() == DialogAction.SELECT_QUEST_REWARD.id())
          return sendQuestDialog(env, 5);
        else return sendQuestEndDialog(env);
      }
    } else if (targetId == 799553) {
      if (qs != null && qs.getStatus() == QuestStatus.REWARD) {
        if (env.getDialogId() == DialogAction.USE_OBJECT.id()) return sendQuestDialog(env, 10002);
        else if (env.getDialogId() == DialogAction.SELECT_QUEST_REWARD.id())
          return sendQuestDialog(env, 5);
        else return sendQuestEndDialog(env);
      }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    DialogAction dialog = env.getDialog();
    int targetId = env.getTargetId();

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 205492) {
        if (dialog == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 4762);
        else return sendQuestStartDialog(env);
      }
    } else if (qs.getStatus() == QuestStatus.START) {
      int var = qs.getQuestVarById(0);
      switch (targetId) {
        case 282203:
          {
            switch (dialog) {
              case QUEST_SELECT:
                {
                  if (var == 0) return sendQuestDialog(env, 1011);
                }
              case SETPRO1:
                {
                  final Npc npc = (Npc) env.getVisibleObject();
                  npc.getController().scheduleRespawn();
                  npc.getController().onDelete();
                  QuestService.addNewSpawn(
                      player.getWorldId(),
                      player.getInstanceId(),
                      217249,
                      npc.getX(),
                      npc.getY(),
                      npc.getZ(),
                      npc.getHeading());
                  return defaultCloseDialog(env, 0, 1);
                }
            }
          }

        case 282204:
          {
            switch (dialog) {
              case QUEST_SELECT:
                {
                  if (var == 2) return sendQuestDialog(env, 1693);
                }
              case SET_SUCCEED:
                {
                  qs.setStatus(QuestStatus.REWARD);
                  updateQuestStatus(env);
                  return closeDialogWindow(env);
                }
            }
          }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 205492)
        switch (dialog) {
          case USE_OBJECT:
            {
              return sendQuestDialog(env, 10002);
            }
          default:
            {
              return sendQuestEndDialog(env);
            }
        }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    DialogAction dialog = env.getDialog();
    int targetId = env.getTargetId();

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 205579) {
        if (dialog == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 4762);
        } else if (dialog == DialogAction.QUEST_ACCEPT_SIMPLE) {
          QuestService.questTimerStart(env, 780);
          return sendQuestStartDialog(env);
        } else {
          return sendQuestStartDialog(env);
        }
      }
    } else if (qs != null && qs.getStatus() == QuestStatus.START) {
      int var = qs.getQuestVarById(0);
      if (targetId == 205798) {
        if (dialog == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 1011);
        } else if (dialog == DialogAction.SETPRO1) {
          return defaultCloseDialog(env, 0, 1);
        }
      }
      if (targetId == 205799 && var == 1) {
        if (dialog == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 1352);
        } else if (dialog == DialogAction.SETPRO2) {
          return defaultCloseDialog(env, 1, 2);
        }
      }
      if (targetId == 205800 && var == 2) {
        if (dialog == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 1693);
        } else if (dialog == DialogAction.SETPRO3) {
          return defaultCloseDialog(env, 2, 3);
        }
      }
      if (targetId == 205801 && var == 3) {
        if (dialog == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 2034);
        } else if (dialog == DialogAction.SETPRO4) {
          return defaultCloseDialog(env, 3, 4);
        }
      }
      if (targetId == 205579 && var == 4) {
        if (dialog == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 2375);
        } else if (dialog == DialogAction.SETPRO5) {
          return defaultCloseDialog(env, 4, 5);
        }
      }
      if (targetId == 205579 && var == 5) {
        if (dialog == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 2716);
        } else if (dialog == DialogAction.CHECK_USER_HAS_QUEST_ITEM_SIMPLE) {
          return checkQuestItems(env, 5, 6, true, 10002, 10001);
        }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 205579) {
        if (dialog == DialogAction.SELECT_QUEST_REWARD) {
          QuestService.questTimerEnd(env);
          return sendQuestDialog(env, 5);
        } else {
          return sendQuestEndDialog(env);
        }
      }
    }
    return false;
  }