@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;
  }
示例#2
0
 @Override
 public boolean onDialogSelect(Player player, int dialogId, int questId, int extendedRewardIndex) {
   int instanceId = getPosition().getInstanceId();
   if (dialogId == DialogAction.SETPRO1.id()) {
     switch (getNpcId()) {
       case 205682:
         TeleportService2.teleportTo(
             player, 300320000, instanceId, 357.10208f, 1662.702f, 95.9803f, (byte) 60);
         break;
       case 205683:
         TeleportService2.teleportTo(
             player, 300320000, instanceId, 1796.5513f, 306.9967f, 469.25f, (byte) 60);
         break;
       case 205684:
         TeleportService2.teleportTo(
             player, 300320000, instanceId, 1324.433f, 1738.2279f, 316.476f, (byte) 70);
         break;
       case 205663:
         TeleportService2.teleportTo(
             player, 300320000, instanceId, 1270.8877f, 237.93307f, 405.38028f, (byte) 60);
         break;
       case 205686:
         TeleportService2.teleportTo(
             player, 300320000, instanceId, 357.98798f, 349.19116f, 96.09108f, (byte) 60);
         break;
       case 205687:
         TeleportService2.teleportTo(
             player, 300320000, instanceId, 1759.5004f, 1273.5414f, 389.11743f, (byte) 10);
         break;
       case 205685:
         TeleportService2.teleportTo(
             player, 300320000, instanceId, 1283.1246f, 791.6683f, 436.6403f, (byte) 60);
         break;
     }
   }
   return true;
 }