@Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    final QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null) return false;

    int var = qs.getQuestVarById(0);
    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();

    if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 204501) return defaultQuestEndDialog(env);
    } else if (qs.getStatus() != QuestStatus.START) {
      return false;
    }
    if (targetId == 204020) {
      switch (env.getDialogId()) {
        case 25:
          if (var == 0) return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1011);
        case 10000:
          if (var == 0) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(player, qs);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
      }
    } else if (targetId == 204501) {
      switch (env.getDialogId()) {
        case 25:
          if (var == 1) return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1352);
          else if (var == 2)
            return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1693);
        case 33:
          if (QuestService.collectItemCheck(env, true)) {
            qs.setStatus(QuestStatus.REWARD);
            updateQuestStatus(player, qs);
            return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 5);
          } else return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 10001);
        case 1353:
          PacketSendUtility.sendPacket(player, new SM_PLAY_MOVIE(0, 191));
          break;
        case 10001:
          if (var == 1) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(player, qs);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
      }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);

    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();
    if (targetId == 0) {
      if (env.getDialogId() == 1002) {
        QuestService.startQuest(env, QuestStatus.START);
        PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(0, 0));
        return true;
      }
    } else if (targetId == 278039) {
      if (qs != null && qs.getStatus() == QuestStatus.START && qs.getQuestVarById(0) == 0) {
        if (env.getDialogId() == 25)
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1352);
        else if (env.getDialogId() == 10000) {
          qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
          updateQuestStatus(player, qs);
          PacketSendUtility.sendPacket(
              player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
          return true;
        } else return defaultQuestStartDialog(env);
      }
    } else if (targetId == 279027) {
      if (qs != null && qs.getStatus() == QuestStatus.START && qs.getQuestVarById(0) == 1) {
        if (env.getDialogId() == 25)
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1693);
        else if (env.getDialogId() == 10001) {
          qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
          updateQuestStatus(player, qs);
          PacketSendUtility.sendPacket(
              player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
          return true;
        } else return defaultQuestStartDialog(env);
      }
    } else if (targetId == 798317) {
      if (qs != null) {
        if (env.getDialogId() == 25 && qs.getStatus() == QuestStatus.START) {
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2375);
        } else if (env.getDialogId() == 1009) {
          ItemService.removeItemFromInventoryByItemId(player, 182207048);
          qs.setQuestVar(1);
          qs.setStatus(QuestStatus.REWARD);
          updateQuestStatus(player, qs);
          return defaultQuestEndDialog(env);
        } else return defaultQuestEndDialog(env);
      }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (targetId == 798103) {
      if (qs == null || qs.getStatus() == QuestStatus.NONE) {
        if (env.getDialogId() == 25)
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1011);
        else return defaultQuestStartDialog(env);
      } else if (qs.getStatus() == QuestStatus.START) {
        if (env.getDialogId() == 25)
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2375);
        else if (env.getDialogId() == 1009) {
          qs.setQuestVar(3);
          qs.setStatus(QuestStatus.REWARD);
          updateQuestStatus(player, qs);
          return defaultQuestEndDialog(env);
        } else return defaultQuestEndDialog(env);
      } else if (qs.getStatus() == QuestStatus.REWARD) {
        return defaultQuestEndDialog(env);
      }
    } else if (targetId == 798026) {
      if (qs != null && qs.getStatus() == QuestStatus.START && qs.getQuestVarById(0) == 0) {
        if (env.getDialogId() == 25)
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1352);
        else if (env.getDialogId() == 10000) {
          qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
          updateQuestStatus(player, qs);
          PacketSendUtility.sendPacket(
              player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
          return true;
        } else return defaultQuestStartDialog(env);
      }
    } else if (targetId == 798357) {
      if (qs != null && qs.getStatus() == QuestStatus.START && qs.getQuestVarById(0) == 1) {
        if (env.getDialogId() == 25)
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1352);
        else if (env.getDialogId() == 10000) {
          qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
          updateQuestStatus(player, qs);
          PacketSendUtility.sendPacket(
              player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
          return true;
        } else return defaultQuestStartDialog(env);
      }
    }

    return false;
  }
  public boolean onKillEvent(QuestEnv env) {
    /** Checks * */
    Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null) return false;

    int var = qs.getQuestVarById(0);
    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();

    if (qs.getStatus() != QuestStatus.START) return false;

    switch (targetId) {
      case 210715: // Brute
        if (var > 0 && var < 4) // En tuer 4
        {
          qs.setQuestVarById(0, var + 1);
          updateQuestStatus(player, qs);
          return true;
        } else if (var == 4) // Au 4eme REWARD
        {
          qs.setStatus(QuestStatus.REWARD);
          updateQuestStatus(player, qs);
          return true;
        }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) {
      targetId = ((Npc) env.getVisibleObject()).getNpcId();
    }
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (targetId == 204777) {
      if (qs == null || qs.getStatus() == QuestStatus.NONE) {
        if (env.getDialog() == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 1011);
        } else {
          return sendQuestStartDialog(env);
        }
      }
    }
    if (qs == null) {
      return false;
    }

    int var = qs.getQuestVarById(0);
    if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 204777) {
        if (env.getDialog() == DialogAction.USE_OBJECT) {
          return sendQuestDialog(env, 2375);
        } else if (env.getDialogId() == DialogAction.SELECT_QUEST_REWARD.id()) {
          return sendQuestDialog(env, 5);
        } else {
          return sendQuestEndDialog(env);
        }
      }
    } else if (qs.getStatus() != QuestStatus.START) {
      return false;
    }
    if (targetId == 204790) {
      switch (env.getDialog()) {
        case QUEST_SELECT:
          if (var == 0) {
            return sendQuestDialog(env, 1352);
          }
        case SETPRO1:
          if (var == 0) {
            qs.setQuestVarById(0, var + 1);
            qs.setStatus(QuestStatus.REWARD);
            if (!giveQuestItem(env, 182204489, 1)) {
              updateQuestStatus(env);
            }
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
          return false;
      }
    }
    return false;
  }
  @Override
  public boolean onMovieEndEvent(QuestEnv env, int movieId) {
    if (movieId != 361) return false;
    Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null || qs.getStatus() != QuestStatus.START) return false;

    qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
    qs.setStatus(QuestStatus.REWARD);
    updateQuestStatus(env);
    return sendQuestDialog(env, 1353);
  }
 @Override
 public boolean onDialogEvent(QuestEnv env) {
   final Player player = env.getPlayer();
   int targetId = 0;
   if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();
   QuestState qs = player.getQuestStateList().getQuestState(questId);
   if (targetId == 204754) {
     if (qs == null || qs.getStatus() == QuestStatus.NONE) {
       if (env.getDialog() == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 1011);
       else return sendQuestStartDialog(env);
     } else if (qs != null && qs.getStatus() == QuestStatus.START) {
       if (env.getDialog() == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 2375);
       else if (env.getDialogId() == DialogAction.SELECT_QUEST_REWARD.id()) {
         qs.setStatus(QuestStatus.REWARD);
         updateQuestStatus(env);
         PacketSendUtility.sendPacket(
             player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
         return true;
       } else return sendQuestEndDialog(env);
     } else if (qs != null && qs.getStatus() == QuestStatus.REWARD) {
       return sendQuestEndDialog(env);
     }
   } else if (targetId == 204701) {
     if (qs != null && qs.getStatus() == QuestStatus.START && qs.getQuestVarById(0) == 0) {
       if (env.getDialog() == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 1352);
       else if (env.getDialog() == DialogAction.SETPRO1) {
         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 (targetId == 204768) {
     if (qs != null) {
       if (env.getDialog() == DialogAction.QUEST_SELECT && qs.getStatus() == QuestStatus.START)
         return sendQuestDialog(env, 2375);
       else if (env.getDialogId() == DialogAction.SELECT_QUEST_REWARD.id()
           && qs.getStatus() != QuestStatus.COMPLETE
           && qs.getStatus() != QuestStatus.NONE) {
         qs.setQuestVar(3);
         qs.setStatus(QuestStatus.REWARD);
         updateQuestStatus(env);
         return sendQuestEndDialog(env);
       } else return sendQuestEndDialog(env);
     }
   }
   return false;
 }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    final QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null) return false;

    int var = qs.getQuestVarById(0);
    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();
    if (qs.getStatus() == QuestStatus.START) {
      switch (targetId) {
        case 204191:
          {
            switch (env.getDialogId()) {
              case 25:
                if (var == 0)
                  return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1352);
                break;
              case 10000:
                if (var == 0) {
                  qs.setQuestVarById(0, var + 1);
                  updateQuestStatus(player, qs);
                  TeleportService.teleportTo(
                      player, 220030000, player.getInstanceId(), 1748f, 1807f, 255f, 1000);
                  PacketSendUtility.sendPacket(
                      player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 0));
                  return true;
                }
            }
          }
        case 203559:
          switch (env.getDialogId()) {
            case 25:
              if (var == 1) {
                qs.setStatus(QuestStatus.REWARD);
                updateQuestStatus(player, qs);
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2375);
              }
          }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 203559) {
        return defaultQuestEndDialog(env);
      }
    }
    return false;
  }
  public boolean onDialogEvent(QuestEnv env) {
    /** Initialisation de l'event * */
    Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null) return false;

    int var = qs.getQuestVarById(0);
    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();

    /** Si on start la quete * */
    if (qs.getStatus() == QuestStatus.START) {
      if (targetId == 203559) {

        switch (env.getDialogId()) {
          case 25:
            if (var == 0) // Initialisation du dialogue
            return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1011);
            else if (var <= 5) // Rendu de la quete
            {
              return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1352);
            } else if (var >= 5) {
              qs.setStatus(QuestStatus.REWARD);
              updateQuestStatus(player, qs);
            }
          case 10000:
          case 10001:
            if (var == 0 || var == 5) {
              qs.setQuestVarById(0, var + 1);
              updateQuestStatus(player, qs);
              PacketSendUtility.sendPacket(
                  player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
              return true;
            }
        }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 203559) {
        return defaultQuestEndDialog(env);
      }
    }
    return false;
  }
  @Override
  public boolean onKillEvent(final QuestEnv env) {
    final Player player = env.getPlayer();
    final int instanceId = player.getInstanceId();
    final QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null || qs.getStatus() != QuestStatus.START) return false;

    final Npc npc = (Npc) env.getVisibleObject();

    switch (env.getTargetId()) {
      case 216531:
        if (qs.getQuestVarById(0) == 14 || qs.getQuestVarById(0) == 15) {
          QuestService.addNewSpawn(
              300160000, instanceId, 730229, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading());
          qs.setQuestVarById(0, 15);
          updateQuestStatus(env);
          return true;
        }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    final QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null) {
      return false;
    }

    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) {
      targetId = ((Npc) env.getVisibleObject()).getNpcId();
    }
    if (targetId != 278501) {
      return false;
    }
    if (qs.getStatus() == QuestStatus.START) {
      if (env.getDialog() == DialogAction.QUEST_SELECT) {
        return sendQuestDialog(env, 10002);
      } else if (env.getDialogId() == DialogAction.SELECT_QUEST_REWARD.id()) {
        qs.setStatus(QuestStatus.REWARD);
        qs.setQuestVarById(0, 1);
        updateQuestStatus(env);
        return sendQuestDialog(env, 5);
      }
      return false;
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (env.getDialogId() == DialogAction.SELECTED_QUEST_NOREWARD.id()) {
        int[] ids = {1071, 1072, 1073, 1074, 1075, 1076, 1077};
        for (int id : ids) {
          QuestEngine.getInstance()
              .onEnterZoneMissionEnd(
                  new QuestEnv(env.getVisibleObject(), env.getPlayer(), id, env.getDialogId()));
        }
      }
      return sendQuestEndDialog(env);
    }
    return false;
  }
  @Override
  public boolean onKillEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null || qs.getStatus() != QuestStatus.START) {
      return false;
    }

    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) {
      targetId = ((Npc) env.getVisibleObject()).getNpcId();
    }

    if ((targetId == 213044 || targetId == 213045)
        && qs.getQuestVarById(0) > 1
        && qs.getQuestVarById(0) <= 7) {

      qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
      updateQuestStatus(env);
      return true;
    }
    return false;
  }
Beispiel #13
0
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    int targetId = 0;
    final QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();

    if (targetId == 0) {
      if (qs == null || qs.getStatus() == QuestStatus.NONE) {
        if (env.getDialogId() == 1002) {
          questService.startQuest(env, QuestStatus.START);
          if (!itemService.addItems(
              player, Collections.singletonList(new QuestItems(182200226, 1)))) ;
          player.getInventory().removeFromBagByItemId(182200214, 1);
          PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(0, 0));
          return true;
        } else PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(0, 0));
      }
    }

    if (qs == null) return false;

    int var = qs.getQuestVarById(0);

    if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 203075 && var == 4) {
        if (env.getDialogId() == -1)
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2375);
        else if (env.getDialogId() == 1009)
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 6);
        else return defaultQuestEndDialog(env);
      } else if (targetId == 203058 && var == 3) return defaultQuestEndDialog(env);
    } else if (qs.getStatus() != QuestStatus.START) return false;

    if (targetId == 203075) {
      switch (env.getDialogId()) {
        case 25:
          if (var == 0) return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1011);
          else if (var == 2)
            return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1693);
          else if (var == 3)
            return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2375);

        case 1009:
          if (var == 2) {
            qs.setQuestVarById(0, var + 2);
            qs.setStatus(QuestStatus.REWARD);
            updateQuestStatus(player, qs);
            player.getInventory().removeFromBagByItemId(182200217, 1);
            return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 6);
          }
          if (var == 3) {
            qs.setQuestVarById(0, var + 1);
            qs.setStatus(QuestStatus.REWARD);
            updateQuestStatus(player, qs);
            player.getInventory().removeFromBagByItemId(182200217, 1);
            return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 6);
          }
        case 10000:
          if (var == 0) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(player, qs);
            player.getInventory().removeFromBagByItemId(182200226, 1);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
        case 10001:
          if (var == 2) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(player, qs);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
      }
    } else if (targetId == 700008) {
      switch (env.getDialogId()) {
        case -1:
          if (var == 1) {
            // final Npc npc = (Npc)env.getVisibleObject();
            final int targetObjectId = env.getVisibleObject().getObjectId();
            PacketSendUtility.sendPacket(
                player, new SM_USE_OBJECT(player.getObjectId(), targetObjectId, 3000, 1));
            PacketSendUtility.broadcastPacket(
                player, new SM_EMOTION(player, 37, 0, targetObjectId), true);
            ThreadPoolManager.getInstance()
                .schedule(
                    new Runnable() {
                      @Override
                      public void run() {
                        PacketSendUtility.sendPacket(
                            player,
                            new SM_USE_OBJECT(player.getObjectId(), targetObjectId, 3000, 0));
                        PacketSendUtility.broadcastPacket(
                            player, new SM_EMOTION(player, 38, 0, targetObjectId), true);
                        for (VisibleObject obj : player.getKnownList()) {
                          if (!(obj instanceof Npc)) continue;
                          if (((Npc) obj).getNpcId() != 203175) continue;
                          if (((Npc) obj).getNpcId() != 203175) return;
                          ((Npc) obj).getAggroList().addDamage(player, 50);
                        }
                        if (!itemService.addItems(
                            player, Collections.singletonList(new QuestItems(182200217, 1)))) ;
                        qs.setQuestVarById(0, 2);
                        updateQuestStatus(player, qs);
                      }
                    },
                    3000);
          }
          return true;
      }
    }
    if (targetId == 203058) {
      switch (env.getDialogId()) {
        case 25:
          if (var == 3) return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2034);
        case 10002:
          if (var == 3) {
            qs.setStatus(QuestStatus.REWARD);
            updateQuestStatus(player, qs);
            player.getInventory().removeFromBagByItemId(182200217, 1);
            return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 5);
          }
        case 10001:
          if (var == 3) {
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
      }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    final QuestState qs = player.getQuestStateList().getQuestState(questId);

    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 204547) {
        if (env.getDialogId() == 25) {
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 4762);
        } else return defaultQuestStartDialog(env);
      }
    }

    if (qs == null) return false;

    if (qs.getStatus() == QuestStatus.START) {
      switch (targetId) {
        case 204547:
          {
            switch (env.getDialogId()) {
              case 25:
                {
                  long itemCount1 = player.getInventory().getItemCountByItemId(182201760);
                  if (qs.getQuestVarById(0) == 0 && itemCount1 >= 3) {
                    return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1011);
                  }
                }
              case 4763:
                {
                  qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
                  updateQuestStatus(player, qs);
                  PacketSendUtility.sendPacket(
                      player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 0));
                  return true;
                }
            }
          }
        case 204540:
          {
            switch (env.getDialogId()) {
              case 25:
                {
                  return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1693);
                }
              case 1694:
                {
                  qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
                  player.getInventory().removeFromBagByItemId(182201760, 1);
                  updateQuestStatus(player, qs);
                  PacketSendUtility.sendPacket(
                      player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 0));
                  return true;
                }
            }
          }
        case 790018:
          {
            switch (env.getDialogId()) {
              case 25:
                {
                  return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2034);
                }
              case 2035:
                {
                  qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
                  player.getInventory().removeFromBagByItemId(182201760, 1);
                  qs.setStatus(QuestStatus.REWARD);
                  updateQuestStatus(player, qs);
                  PacketSendUtility.sendPacket(
                      player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 0));
                  return true;
                }
            }
          }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 204541) {
        switch (env.getDialogId()) {
          case 25:
            {
              return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2375);
            }
          case 1009:
            {
              return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 5);
            }
          case 17:
            {
              player.getInventory().removeFromBagByItemId(182201760, 1);
            }
          default:
            return defaultQuestEndDialog(env);
        }
      }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    final QuestState qs = player.getQuestStateList().getQuestState(questId);

    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) {
      targetId = ((Npc) env.getVisibleObject()).getNpcId();
    }

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 798132) {
        switch (env.getDialog()) {
          case QUEST_SELECT:
            {
              return sendQuestDialog(env, 4762);
            }
          default:
            return sendQuestStartDialog(env);
        }
      }
    }

    if (qs == null) {
      return false;
    }

    if (qs.getStatus() == QuestStatus.START) {
      switch (targetId) {
        case 798132:
          {
            switch (env.getDialog()) {
              case QUEST_SELECT:
                {
                  if (qs.getQuestVarById(0) == 0) {
                    long itemCount = player.getInventory().getItemCountByItemId(182208008);
                    if (itemCount >= 1) {
                      return sendQuestDialog(env, 1011);
                    } else {
                      return sendQuestDialog(env, 10001);
                    }
                  }
                }
              case CHECK_USER_HAS_QUEST_ITEM:
                {
                  removeQuestItem(env, 182208008, 1);
                  qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
                  updateQuestStatus(env);
                  PacketSendUtility.sendPacket(
                      player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                  return true;
                }
            }
          }
        case 798146:
          {
            switch (env.getDialog()) {
              case QUEST_SELECT:
                {
                  if (qs.getQuestVarById(0) == 1) {
                    return sendQuestDialog(env, 1352);
                  }
                }
              case SET_SUCCEED:
                {
                  updateQuestStatus(env);
                  qs.setStatus(QuestStatus.REWARD);
                  PacketSendUtility.sendPacket(
                      player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                  return true;
                }
            }
          }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 798146) {
        switch (env.getDialog()) {
          case QUEST_SELECT:
            {
              return sendQuestDialog(env, 10002);
            }
          case SELECT_QUEST_REWARD:
            {
              return sendQuestDialog(env, 5);
            }
          default:
            return sendQuestEndDialog(env);
        }
      }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    final QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null) return false;

    int var = qs.getQuestVarById(0);
    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();

    if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 204501) return defaultQuestEndDialog(env);
    } else if (qs.getStatus() != QuestStatus.START) {
      return false;
    }
    if (targetId == 204501) {
      switch (env.getDialogId()) {
        case 25:
          if (var == 0) return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1011);
          else if (var == 4)
            return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2375);
          return false;
        case 10000:
          if (var == 0) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(player, qs);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
        case 10004:
          if (var == 4) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(player, qs);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
          return false;
      }
    } else if (targetId == 204582) {
      switch (env.getDialogId()) {
        case 25:
          if (var == 1) return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1352);
          else if (var == 3)
            return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2034);
          return false;
        case 10001:
          if (var == 1) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(player, qs);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
        case 10003:
          if (var == 3) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(player, qs);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            ItemService.decreaseItemCountByItemId(player, 182201601, 1);
            return true;
          }
          return false;
      }
    } else if (targetId == 203882) {
      switch (env.getDialogId()) {
        case 25:
          if (var == 5) return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2716);
        case 10005:
          if (var == 5) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(player, qs);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
          return false;
      }
    } else if (targetId == 278503) {
      switch (env.getDialogId()) {
        case 25:
          if (var == 6) return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 3057);
          else if (var == 7)
            return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 3398);
        case 33:
          if (QuestService.collectItemCheck(env, true)) {
            qs.setQuestVarById(0, var + 1);
            qs.setStatus(QuestStatus.REWARD);
            updateQuestStatus(player, qs);
            return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 10000);
          } else return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 10001);
        case 10006:
          if (var == 6) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(player, qs);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
        case 10007:
          if (var == 7) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(player, qs);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
          return false;
      }
    } else if (targetId == 700217 && qs.getQuestVarById(0) == 2) {
      if (env.getDialogId() == -1) {
        final int targetObjectId = env.getVisibleObject().getObjectId();
        PacketSendUtility.sendPacket(
            player, new SM_USE_OBJECT(player.getObjectId(), targetObjectId, 3000, 1));
        PacketSendUtility.broadcastPacket(
            player, new SM_EMOTION(player, EmotionType.NEUTRALMODE2, 0, targetObjectId), true);
        ThreadPoolManager.getInstance()
            .schedule(
                new Runnable() {
                  @Override
                  public void run() {
                    PacketSendUtility.sendPacket(
                        player, new SM_USE_OBJECT(player.getObjectId(), targetObjectId, 3000, 0));
                    PacketSendUtility.broadcastPacket(
                        player,
                        new SM_EMOTION(player, EmotionType.START_LOOT, 0, targetObjectId),
                        true);
                    sendQuestDialog(player, targetObjectId, 1693);
                  }
                },
                3000);
      } else if (qs.getQuestVarById(0) == 2 && env.getDialogId() == 10002) {
        PacketSendUtility.sendPacket(
            player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 0));
        ItemService.addItems(player, Collections.singletonList(new QuestItems(182201601, 1)));
        qs.setQuestVarById(0, 3);
        updateQuestStatus(player, qs);
        return true;
      }
    } else if (targetId == 700303 && qs.getQuestVarById(0) == 7) {
      if (env.getDialogId() == -1) {
        final int targetObjectId = env.getVisibleObject().getObjectId();
        PacketSendUtility.sendPacket(
            player, new SM_USE_OBJECT(player.getObjectId(), targetObjectId, 3000, 1));
        PacketSendUtility.broadcastPacket(
            player, new SM_EMOTION(player, EmotionType.NEUTRALMODE2, 0, targetObjectId), true);
        ThreadPoolManager.getInstance()
            .schedule(
                new Runnable() {
                  @Override
                  public void run() {
                    PacketSendUtility.sendPacket(
                        player, new SM_USE_OBJECT(player.getObjectId(), targetObjectId, 3000, 0));
                    PacketSendUtility.broadcastPacket(
                        player,
                        new SM_EMOTION(player, EmotionType.START_LOOT, 0, targetObjectId),
                        true);
                    ItemService.addItems(
                        player, Collections.singletonList(new QuestItems(182201602, 1)));
                  }
                },
                3000);
      }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    // Instanceof
    final Player player = env.getPlayer();
    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();
    QuestState qs = player.getQuestStateList().getQuestState(questId);

    // ------------------------------------------------------------
    // NPC Quest :
    // 0 - Start to Lavirintos
    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 203701) {
        // Get HACTION_QUEST_SELECT in the eddit-HyperLinks.xml
        if (env.getDialogId() == 25)
          // Send select_none to eddit-HtmlPages.xml
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 4762);
        else return defaultQuestStartDialog(env);
      }
    }

    if (qs == null) return false;

    int var = qs.getQuestVarById(0);

    if (qs.getStatus() == QuestStatus.START) {

      switch (targetId) {
          // 1 - Talk with Nianalo
        case 798359:
          switch (env.getDialogId()) {
              // Get HACTION_QUEST_SELECT in the eddit-HyperLinks.xml
            case 25:
              // Send select1 to eddit-HtmlPages.xml
              return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1011);
              // Get HACTION_SETPRO1 in the eddit-HyperLinks.xml
            case 10000:
              qs.setQuestVarById(0, var + 1);
              updateQuestStatus(player, qs);
              PacketSendUtility.sendPacket(
                  player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
              return true;
          }
          break;
          // 2 - Talk with Navid
        case 798360:
          if (var == 1) {
            switch (env.getDialogId()) {
                // Get HACTION_QUEST_SELECT in the eddit-HyperLinks.xml
              case 25:
                // Send select2 to eddit-HtmlPages.xml
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1352);
                // Get HACTION_SETPRO2 in the eddit-HyperLinks.xml
              case 10001:
                qs.setQuestVarById(0, var + 1);
                updateQuestStatus(player, qs);
                PacketSendUtility.sendPacket(
                    player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                return true;
            }
          }
          break;
          // 3 - Talk with Pavel
        case 798361:
          if (var == 2) {
            switch (env.getDialogId()) {
                // Get HACTION_QUEST_SELECT in the eddit-HyperLinks.xml
              case 25:
                // Send select3 to eddit-HtmlPages.xml
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1693);
                // Get HACTION_SETPRO3 in the eddit-HyperLinks.xml
              case 10002:
                qs.setQuestVarById(0, var + 1);
                updateQuestStatus(player, qs);
                PacketSendUtility.sendPacket(
                    player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                return true;
            }
          }
          break;
          // 4 - Talk with Pendaon
        case 798362:
          if (var == 3) {
            switch (env.getDialogId()) {
                // Get HACTION_QUEST_SELECT in the eddit-HyperLinks.xml
              case 25:
                // Send select4 to eddit-HtmlPages.xml
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2034);
                // Get HACTION_SETPRO4 in the eddit-HyperLinks.xml
              case 10003:
                qs.setQuestVarById(0, var + 1);
                updateQuestStatus(player, qs);
                PacketSendUtility.sendPacket(
                    player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                return true;
            }
          }
          break;
          // 5 - Talk with Poevius
        case 798363:
          if (var == 4) {
            switch (env.getDialogId()) {
                // Get HACTION_QUEST_SELECT in the eddit-HyperLinks.xml
              case 25:
                // Send select5 to eddit-HtmlPages.xml
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2375);
                // Get HACTION_SETPRO5 in the eddit-HyperLinks.xml
              case 10004:
                qs.setQuestVarById(0, var + 1);
                updateQuestStatus(player, qs);
                PacketSendUtility.sendPacket(
                    player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                return true;
            }
          }
          break;
          // 6 - Talk with Belicanon
        case 798364:
          if (var == 5) {
            switch (env.getDialogId()) {
                // Get HACTION_QUEST_SELECT in the eddit-HyperLinks.xml
              case 25:
                // Send select6 to eddit-HtmlPages.xml
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2716);
                // Get HACTION_SETPRO6 in the eddit-HyperLinks.xml
              case 10005:
                qs.setQuestVarById(0, var + 1);
                updateQuestStatus(player, qs);
                PacketSendUtility.sendPacket(
                    player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                return true;
            }
          }
          break;
          // 7 - Talk with Mahelnu
        case 798365:
          if (var == 6) {
            switch (env.getDialogId()) {
                // Get HACTION_QUEST_SELECT in the eddit-HyperLinks.xml
              case 25:
                // Send select7 to eddit-HtmlPages.xml
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 3057);
                // Get HACTION_SETPRO7 in the eddit-HyperLinks.xml
              case 10006:
                qs.setQuestVarById(0, var + 1);
                updateQuestStatus(player, qs);
                PacketSendUtility.sendPacket(
                    player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                return true;
            }
          }
          break;
          // 8 - Talk with Pater
        case 798366:
          if (var == 7) {
            switch (env.getDialogId()) {
                // Get HACTION_QUEST_SELECT in the eddit-HyperLinks.xml
              case 25:
                // Send select8 to eddit-HtmlPages.xml
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 3398);
                // Get HACTION_SETPRO8 in the eddit-HyperLinks.xml
              case 10007:
                qs.setQuestVarById(0, var + 1);
                updateQuestStatus(player, qs);
                PacketSendUtility.sendPacket(
                    player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                return true;
            }
          }
          break;
          // 9 - Report the result to Jucleas with the Oath Stone
        case 203752:
          if (var == 8) {
            switch (env.getDialogId()) {
                // Get HACTION_QUEST_SELECT in the eddit-HyperLinks.xml
              case 25:
                if (player.getInventory().getItemCountByItemId(186000080) >= 1)
                  // Send select9 to eddit-HtmlPages.xml
                  return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 3739);
                else
                  // Send select9_2 to eddit-HtmlPages.xml
                  return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 3825);
                // Get HACTION_SET_SUCCEED in the eddit-HyperLinks.xml
              case 10255:
                // Send select_success to eddit-HtmlPages.xml
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 10002);
                // Get HACTION_SELECT_QUEST_REWARD in the
                // eddit-HyperLinks.xml
              case 1009:
                ItemService.removeItemFromInventoryByItemId(player, 186000080);
                qs.setStatus(QuestStatus.REWARD);
                updateQuestStatus(player, qs);
                // Send select_quest_reward1 to eddit-HtmlPages.xml
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 5);
            }
          }
          break;
          // No match
        default:
          return defaultQuestStartDialog(env);
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 203701) return defaultQuestEndDialog(env);
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    if (sendQuestNoneDialog(env, 798959, 4762)) {
      return true;
    }

    final Player player = env.getPlayer();

    QuestState qs = env.getPlayer().getQuestStateList().getQuestState(questId);
    if (qs == null) {
      return false;
    }
    int var = qs.getQuestVarById(0);
    if (qs.getStatus() == QuestStatus.REWARD) {
      if (env.getTargetId() == 798959) {
        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;
    }
    if (qs.getStatus() == QuestStatus.START) {
      switch (env.getTargetId()) {
        case 798959:
          switch (env.getDialog()) {
            case QUEST_SELECT:
              if (var == 0) {
                return sendQuestDialog(env, 1011);
              } else if (var == 1) {
                return sendQuestDialog(env, 1352);
              }
            case CHECK_USER_HAS_QUEST_ITEM:
              if (var == 0) {
                if (QuestService.collectItemCheck(env, true)) {
                  qs.setQuestVarById(0, var + 1);
                  updateQuestStatus(env);
                  PacketSendUtility.sendPacket(
                      player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                  return true;
                } else {
                  return sendQuestDialog(env, 10001);
                }
              }
            case SETPRO2:
              if (var == 1) {
                if (!giveQuestItem(env, 182206726, 1)) {
                  return true;
                }
                qs.setQuestVarById(0, var + 1);
                updateQuestStatus(env);
              }
              return true;
          }
      }
    }
    return false;
  }
Beispiel #19
0
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    final int instanceId = player.getInstanceId();
    final QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null) return false;

    int var = qs.getQuestVars().getQuestVars();
    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();

    if (qs.getStatus() == QuestStatus.START) {
      if (targetId == 790001) {
        switch (env.getDialogId()) {
          case 25:
            if (var == 0)
              return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1011);
            else if (var == 3)
              return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1693);
            else if (var == 5)
              return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2034);
          case 10000:
            if (var == 0) {
              if (player.getInventory().getItemCountByItemId(182200007) == 0)
                if (!itemService.addItems(
                    player, Collections.singletonList(new QuestItems(182200007, 1)))) return true;
              qs.setQuestVarById(0, var + 1);
              updateQuestStatus(player, qs);
              PacketSendUtility.sendPacket(
                  player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
              return true;
            }
          case 10002:
            if (var == 3) {
              player.getInventory().removeFromBagByItemId(182200009, 1);
              qs.setQuestVar(99);
              updateQuestStatus(player, qs);
              PacketSendUtility.sendPacket(
                  player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 0));
              WorldMapInstance newInstance = instanceService.getNextAvailableInstance(310010000);
              instanceService.registerPlayerWithInstance(newInstance, player);
              teleportService.teleportTo(
                  player, 310010000, newInstance.getInstanceId(), 52, 174, 229, 0);
              return true;
            }
          case 10003:
            if (var == 5) {
              PlayerClass playerClass = player.getCommonData().getPlayerClass();
              if (playerClass == PlayerClass.WARRIOR)
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2375);
              else if (playerClass == PlayerClass.SCOUT)
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2716);
              else if (playerClass == PlayerClass.MAGE)
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 3057);
              else if (playerClass == PlayerClass.PRIEST)
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 3398);
            }
          case 10004:
            if (var == 5) return setPlayerClass(env, qs, PlayerClass.GLADIATOR);
          case 10005:
            if (var == 5) return setPlayerClass(env, qs, PlayerClass.TEMPLAR);
          case 10006:
            if (var == 5) return setPlayerClass(env, qs, PlayerClass.ASSASSIN);
          case 10007:
            if (var == 5) return setPlayerClass(env, qs, PlayerClass.RANGER);
          case 10008:
            if (var == 5) return setPlayerClass(env, qs, PlayerClass.SORCERER);
          case 10009:
            if (var == 5) return setPlayerClass(env, qs, PlayerClass.SPIRIT_MASTER);
          case 10010:
            if (var == 5) return setPlayerClass(env, qs, PlayerClass.CLERIC);
          case 10011:
            if (var == 5) return setPlayerClass(env, qs, PlayerClass.CHANTER);
        }
      } else if (targetId == 730008) {
        switch (env.getDialogId()) {
          case 25:
            if (var == 2) {
              if (player.getInventory().getItemCountByItemId(182200008) != 0)
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1352);
              else return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1354);
            }
          case 1353:
            if (var == 2) {
              PacketSendUtility.sendPacket(player, new SM_PLAY_MOVIE(0, 14));
              player.getInventory().removeFromBagByItemId(182200008, 1);
              itemService.addItems(player, Collections.singletonList(new QuestItems(182200009, 1)));
            }
            return false;
          case 10001:
            if (var == 2) {
              qs.setQuestVarById(0, var + 1);
              updateQuestStatus(player, qs);
              PacketSendUtility.sendPacket(
                  player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
              return true;
            }
        }
      } else if (targetId == 205000) {
        switch (env.getDialogId()) {
          case 25:
            if (var == 99) {
              PacketSendUtility.sendPacket(player, new SM_EMOTION(player, 6, 1001, 0));
              qs.setQuestVar(50);
              updateQuestStatus(player, qs);
              ThreadPoolManager.getInstance()
                  .schedule(
                      new Runnable() {
                        @Override
                        public void run() {
                          qs.setQuestVar(51);
                          updateQuestStatus(player, qs);
                          List<Npc> mobs = new ArrayList<Npc>();
                          mobs.add(
                              (Npc)
                                  questService.addNewSpawn(
                                      310010000,
                                      instanceId,
                                      211042,
                                      (float) 224.073,
                                      (float) 239.1,
                                      (float) 206.7,
                                      (byte) 0,
                                      true));
                          mobs.add(
                              (Npc)
                                  questService.addNewSpawn(
                                      310010000,
                                      instanceId,
                                      211042,
                                      (float) 233.5,
                                      (float) 241.04,
                                      (float) 206.365,
                                      (byte) 0,
                                      true));
                          mobs.add(
                              (Npc)
                                  questService.addNewSpawn(
                                      310010000,
                                      instanceId,
                                      211042,
                                      (float) 229.6,
                                      (float) 265.7,
                                      (float) 205.7,
                                      (byte) 0,
                                      true));
                          mobs.add(
                              (Npc)
                                  questService.addNewSpawn(
                                      310010000,
                                      instanceId,
                                      211042,
                                      (float) 222.8,
                                      (float) 262.5,
                                      (float) 205.7,
                                      (byte) 0,
                                      true));
                          for (Npc mob : mobs) {
                            // TODO: Tempt decrease P attack.
                            mob.getGameStats()
                                .setStat(
                                    StatEnum.MAIN_HAND_POWER,
                                    mob.getGameStats().getCurrentStat(StatEnum.MAIN_HAND_POWER)
                                        / 3);
                            mob.getGameStats().setStat(StatEnum.PHYSICAL_DEFENSE, 0);
                            mob.getAggroList().addDamage(player, 1000);
                          }
                        }
                      },
                      43000);
              return true;
            }
            return false;
          default:
            return false;
        }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 790001) {
        return defaultQuestEndDialog(env);
      }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    int targetId = 0;
    final QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (env.getVisibleObject() instanceof Npc) {
      targetId = ((Npc) env.getVisibleObject()).getNpcId();
    }
    if (targetId == 0) {
      if (env.getDialogId() == DialogAction.QUEST_ACCEPT_1.id()) {
        QuestService.startQuest(env);
        PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(0, 0));
        return true;
      }
    } else if (targetId == 700513) {
      if (qs == null || qs.getStatus() == QuestStatus.NONE) {
        switch (env.getDialog()) {
          case USE_OBJECT:
            {
              if (player.getInventory().getItemCountByItemId(182201823) == 0) {
                return giveQuestItem(env, 182201823, 1);
              }
            }
        }
      }
    }
    if (qs == null) {
      return false;
    }

    int var = qs.getQuestVarById(0);
    if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 798072) {
        if (env.getDialog() == DialogAction.USE_OBJECT) {
          return sendQuestDialog(env, 2375);
        } else if (env.getDialogId() == DialogAction.SELECT_QUEST_REWARD.id()) {
          return sendQuestDialog(env, 5);
        } else {
          return sendQuestEndDialog(env);
        }
      }
    } else if (qs.getStatus() != QuestStatus.START) {
      return false;
    }
    if (targetId == 798072) {
      switch (env.getDialog()) {
        case QUEST_SELECT:
          if (var == 0) {
            return sendQuestDialog(env, 1352);
          }
        case SETPRO1:
          if (var == 0) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(env);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
          return false;
      }
    } else if (targetId == 204571) {
      switch (env.getDialog()) {
        case QUEST_SELECT:
          if (var == 1) {
            return sendQuestDialog(env, 1693);
          }
        case SETPRO2:
          if (var == 1) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(env);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
          return false;
      }
    } else if (targetId == 798013) {
      switch (env.getDialog()) {
        case QUEST_SELECT:
          if (var == 2) {
            return sendQuestDialog(env, 2034);
          }
        case SETPRO3:
          if (var == 2) {
            {
              qs.setQuestVarById(0, var + 1);
              qs.setStatus(QuestStatus.REWARD);
              updateQuestStatus(env);
              if (giveQuestItem(env, 182201824, 1)) ;
              PacketSendUtility.sendPacket(
                  player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
              return true;
            }
          }
          return false;
      }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);

    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 203792) {
        if (env.getDialog() == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 4762);
        else return sendQuestStartDialog(env);
      }
    }

    if (qs == null) return false;

    if (qs != null && qs.getStatus() == QuestStatus.START) {
      switch (targetId) {
        case 798013:
          switch (env.getDialog()) {
            case QUEST_SELECT:
              return sendQuestDialog(env, 1011);
            case SETPRO10:
              if (!giveQuestItem(env, 152202049, 1)) return true;
              if (!giveQuestItem(env, 152020249, 1)) return true;
              qs.setQuestVarById(0, 1);
              updateQuestStatus(env);
              PacketSendUtility.sendPacket(
                  player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
              return true;
            case SETPRO20:
              if (!giveQuestItem(env, 152202050, 1)) return true;
              if (!giveQuestItem(env, 152020249, 1)) return true;
              qs.setQuestVarById(0, 1);
              updateQuestStatus(env);
              PacketSendUtility.sendPacket(
                  player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
              return true;
          }
        case 203792:
          switch (env.getDialog()) {
            case QUEST_SELECT:
              long itemCount1 = player.getInventory().getItemCountByItemId(182206767);
              if (itemCount1 > 0) {
                removeQuestItem(env, 182206767, 1);
                qs.setStatus(QuestStatus.REWARD);
                updateQuestStatus(env);
                return sendQuestDialog(env, 1352);
              } else return sendQuestDialog(env, 10001);
          }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 203792) {
        if (env.getDialogId() == DialogAction.CHECK_USER_HAS_QUEST_ITEM.id())
          return sendQuestDialog(env, 5);
        else return sendQuestEndDialog(env);
      }
    }
    return false;
  }
Beispiel #22
0
  @Override
  public boolean onDialogEvent(final QuestEnv env) {
    final Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null) return false;

    int var = qs.getQuestVarById(0);
    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();

    if (qs.getStatus() == QuestStatus.START) {
      if (targetId == 203067) {
        switch (env.getDialog()) {
          case QUEST_SELECT:
            if (var == 0) return sendQuestDialog(env, 1011);
          case SETPRO1:
            if (var == 0) {
              qs.setQuestVarById(0, var + 1);
              updateQuestStatus(env);
              sendQuestSelectionDialog(env);
              return true;
            }
        }
      } else if (targetId == 203081) {
        switch (env.getDialog()) {
          case QUEST_SELECT:
            if (var == 1) return sendQuestDialog(env, 1352);
          case SETPRO2:
            if (var == 1) {
              qs.setQuestVarById(0, var + 1);
              updateQuestStatus(env);
              sendQuestSelectionDialog(env);
              return true;
            }
        }
      } else if (targetId == 790001) {
        switch (env.getDialog()) {
          case QUEST_SELECT:
            if (var == 2) return sendQuestDialog(env, 1693);
          case SETPRO3:
            if (var == 2) {
              qs.setQuestVarById(0, var + 1);
              updateQuestStatus(env);
              sendQuestSelectionDialog(env);
              return true;
            }
        }
      } else if (targetId == 203085) {
        switch (env.getDialog()) {
          case QUEST_SELECT:
            if (var == 3) return sendQuestDialog(env, 2034);
          case SETPRO4:
            if (var == 3) {
              qs.setQuestVarById(0, var + 1);
              updateQuestStatus(env);
              sendQuestSelectionDialog(env);
              return true;
            }
        }
      } else if (targetId == 203086) {
        switch (env.getDialog()) {
          case QUEST_SELECT:
            if (var == 4) return sendQuestDialog(env, 2375);
          case SETPRO5:
            if (var == 4) {
              qs.setQuestVarById(0, var + 1);
              updateQuestStatus(env);
              sendQuestSelectionDialog(env);
              return true;
            }
        }
      } else if (targetId == 700081) {
        if (var == 5) {
          destroy(6, env);
          return false;
        }
      } else if (targetId == 700082) {
        if (var == 6) {
          destroy(7, env);
          return false;
        }
      } else if (targetId == 700083) {
        if (var == 7) {
          destroy(8, env);
          return false;
        }
      } else if (targetId == 700080) {
        if (var == 8) {
          destroy(-1, env);
          return false;
        }
      }

    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 203067) {
        if (env.getDialog() == DialogAction.USE_OBJECT) return sendQuestDialog(env, 2716);
        return sendQuestEndDialog(env);
      }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    final QuestState qs = player.getQuestStateList().getQuestState(questId);

    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 798132) {
        switch (env.getDialog()) {
          case QUEST_SELECT:
            {
              return sendQuestDialog(env, 1011);
            }
          default:
            return sendQuestStartDialog(env);
        }
      }
    }

    if (qs == null) return false;

    if (qs.getStatus() == QuestStatus.START) {
      switch (targetId) {
        case 798146:
          {
            switch (env.getDialog()) {
              case QUEST_SELECT:
                {
                  if (qs.getQuestVarById(0) == 0) {
                    return sendQuestDialog(env, 1352);
                  }
                }
              case SETPRO1:
                {
                  qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
                  updateQuestStatus(env);
                  PacketSendUtility.sendPacket(
                      player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                  return true;
                }
            }
          }
        case 700339:
          {
            switch (env.getDialog()) {
              case USE_OBJECT:
                {
                  if (qs.getQuestVarById(0) == 1) {
                    return sendQuestDialog(env, 1693);
                  }
                }
              case SELECT_ACTION_1694:
                {
                  if (qs.getQuestVarById(0) == 1) {
                    playQuestMovie(env, 361);
                    return true;
                  }
                }
            }
          }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 798132) {
        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();
    final QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null) {
      return false;
    }

    int var = qs.getQuestVarById(0);
    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) {
      targetId = ((Npc) env.getVisibleObject()).getNpcId();
    }

    if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 204715) {
        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;
    } else if (qs.getStatus() != QuestStatus.START) {
      return false;
    }
    if (targetId == 204715) {
      switch (env.getDialog()) {
        case QUEST_SELECT:
          if (var == 0) {
            return sendQuestDialog(env, 1011);
          }
        case SETPRO1:
          if (var == 0) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(env);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
        default:
          break;
      }
    } else if (targetId == 204801) {
      switch (env.getDialog()) {
        case QUEST_SELECT:
          if (var == 1) {
            return sendQuestDialog(env, 1352);
          } else if (var == 7) {
            return sendQuestDialog(env, 1693);
          }
        case SETPRO2:
          if (var == 1) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(env);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
        case SETPRO3:
          if (var == 7) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(env);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
        default:
          break;
      }
    } else if (targetId == 204805) {
      switch (env.getDialog()) {
        case QUEST_SELECT:
          if (var == 8) {
            return sendQuestDialog(env, 2034);
          }
          if (var == 9) {
            return sendQuestDialog(env, 2375);
          }
        case CHECK_USER_HAS_QUEST_ITEM:
          if (QuestService.collectItemCheck(env, true)) {
            if (!giveQuestItem(env, 182204304, 1)) {
              return true;
            }
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(env);
            return sendQuestDialog(env, 10000);
          } else {
            return sendQuestDialog(env, 10001);
          }
        case SETPRO4:
          if (var == 8) {
            qs.setQuestVarById(0, var + 1);
            updateQuestStatus(env);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
        default:
          break;
      }
    }
    return false;
  }
 @Override
 public boolean onDialogEvent(QuestEnv env) {
   final Player player = env.getPlayer();
   QuestState qs = player.getQuestStateList().getQuestState(questId);
   int targetId = 0;
   if (env.getVisibleObject() instanceof Npc) {
     targetId = ((Npc) env.getVisibleObject()).getNpcId();
   }
   if (qs == null || qs.getStatus() == QuestStatus.NONE) {
     if (targetId == 800529) { // Vard.
       if (env.getDialog() == DialogAction.QUEST_SELECT) {
         return sendQuestDialog(env, 1011);
       } else {
         return sendQuestStartDialog(env);
       }
     }
   }
   if (qs == null) {
     return false;
   }
   if (qs.getStatus() == QuestStatus.START) {
     switch (targetId) {
       case 800531:
         { // Bilveo.
           switch (env.getDialog()) {
             case QUEST_SELECT:
               {
                 return sendQuestDialog(env, 1352);
               }
             case SETPRO1:
               {
                 qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
                 updateQuestStatus(env);
                 PacketSendUtility.sendPacket(
                     player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                 return true;
               }
             default:
               break;
           }
         }
       case 800529:
         { // Vard.
           switch (env.getDialog()) {
             case QUEST_SELECT:
               {
                 return sendQuestDialog(env, 2375);
               }
             case SELECT_QUEST_REWARD:
               {
                 qs.setQuestVar(3);
                 qs.setStatus(QuestStatus.REWARD);
                 updateQuestStatus(env);
                 return sendQuestEndDialog(env);
               }
             default:
               return sendQuestEndDialog(env);
           }
         }
     }
   } else if (qs.getStatus() == QuestStatus.REWARD) {
     if (targetId == 800529) { // Tirins.
       switch (env.getDialog()) {
         case SELECT_QUEST_REWARD:
           {
             return sendQuestDialog(env, 5);
           }
         default:
           return sendQuestEndDialog(env);
       }
     }
   }
   return false;
 }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null) return false;

    int var = qs.getQuestVarById(0);
    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();

    if (qs.getStatus() == QuestStatus.START) {
      switch (targetId) {
        case 203516:
          switch (env.getDialogId()) {
            case 25:
              if (var == 0)
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1011);
            case 10000:
              if (var == 0) {
                qs.setQuestVarById(0, var + 1);
                updateQuestStatus(player, qs);
                PacketSendUtility.sendPacket(
                    player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                return true;
              }
          }
          break;
        case 203519:
          switch (env.getDialogId()) {
            case 25:
              if (var == 1)
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1352);
            case 10001:
              if (var == 1) {
                qs.setQuestVarById(0, var + 1);
                updateQuestStatus(player, qs);
                PacketSendUtility.sendPacket(
                    player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                return true;
              }
          }
          break;
        case 203539:
          switch (env.getDialogId()) {
            case 25:
              if (var == 2)
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1693);
            case 1694:
              PacketSendUtility.sendPacket(player, new SM_PLAY_MOVIE(0, 55));
              break;
            case 10002:
              if (var == 2) {
                qs.setQuestVarById(0, var + 1);
                updateQuestStatus(player, qs);
                PacketSendUtility.sendPacket(
                    player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                return true;
              }
          }
          break;
        case 203552:
          switch (env.getDialogId()) {
            case 25:
              if (var == 3)
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2034);
            case 10003:
              if (var == 3) {
                qs.setQuestVarById(0, var + 1);
                updateQuestStatus(player, qs);
                PacketSendUtility.sendPacket(
                    player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                return true;
              }
          }
          break;
        case 203554:
          switch (env.getDialogId()) {
            case 25:
              if (var == 4)
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2375);
              else if (var == 8)
                return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2716);
            case 10004:
              if (var == 4) {
                qs.setQuestVarById(0, var + 1);
                updateQuestStatus(player, qs);
                PacketSendUtility.sendPacket(
                    player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                return true;
              }
              break;
            case 10005:
              if (var == 8) {
                qs.setStatus(QuestStatus.REWARD);
                updateQuestStatus(player, qs);
                PacketSendUtility.sendPacket(
                    player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                return true;
              }
          }
          break;
        case 700081:
          if (var == 5) {
            destroy(6, env);
            return false;
          }
          break;
        case 700082:
          if (var == 6) {
            destroy(7, env);
            return false;
          }
          break;
        case 700083:
          if (var == 7) {
            destroy(-1, env);
            return false;
          }
          break;
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 203516) {
        if (env.getDialogId() == -1) {
          PacketSendUtility.sendPacket(player, new SM_PLAY_MOVIE(0, 58));
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 3057);
        } else return defaultQuestEndDialog(env);
      }
    }
    return false;
  }
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);

    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 203919) {
        if (env.getDialog() == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 4762);
        } else return sendQuestStartDialog(env);
      }
    }
    if (qs == null) return false;

    if (qs.getStatus() == QuestStatus.START) {
      switch (targetId) {
        case 203337:
          {
            switch (env.getDialog()) {
              case QUEST_SELECT:
                {
                  switch (qs.getQuestVarById(0)) {
                    case 0:
                      {
                        return sendQuestDialog(env, 1011);
                      }
                    case 1:
                      {
                        long itemCount1 = player.getInventory().getItemCountByItemId(182201399);
                        if (itemCount1 >= 3) {
                          qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
                          updateQuestStatus(env);
                          return sendQuestDialog(env, 1352);
                        } else return sendQuestDialog(env, 10001);
                      }
                    case 2:
                      {
                        return sendQuestDialog(env, 1693);
                      }
                    case 3:
                      {
                        return sendQuestDialog(env, 10002);
                      }
                  }
                }
              case SETPRO1:
                {
                  qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
                  updateQuestStatus(env);
                  PacketSendUtility.sendPacket(
                      player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
                  return true;
                }
              case SETPRO3:
                {
                  qs.setQuestVar(3);
                  qs.setStatus(QuestStatus.REWARD);
                  updateQuestStatus(env);
                  TeleportService2.teleportTo(player, 220020000, 1, 638, 2337, 425, (byte) 20);
                  return true;
                }
              default:
                return sendQuestStartDialog(env);
            }
          }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 203337) {
        if (env.getDialogId() == DialogAction.SELECT_QUEST_REWARD.id())
          return sendQuestDialog(env, 5);
        else return sendQuestEndDialog(env);
      }
    }
    return false;
  }