@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 onKillEvent(QuestEnv env) { Player player = env.getPlayer(); QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs == null || qs.getStatus() != QuestStatus.START) return false; int var = qs.getQuestVarById(0); int targetId = 0; if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId(); switch (targetId) { case 217249: if (qs.getQuestVarById(0) == 1) { Npc npc = (Npc) env.getVisibleObject(); qs.setQuestVarById(0, var + 1); updateQuestStatus(env); QuestService.addNewSpawn( player.getWorldId(), player.getInstanceId(), 282204, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading()); } } 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 onKillEvent(QuestEnv env) { 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(); switch (targetId) { case 213109: if (qs.getQuestVarById(1) < 5 && qs.getQuestVarById(0) == 1) { qs.setQuestVarById(1, qs.getQuestVarById(1) + 1); updateQuestStatus(env); return true; } break; case 213111: if (qs.getQuestVarById(2) < 5 && qs.getQuestVarById(0) == 1) { qs.setQuestVarById(2, qs.getQuestVarById(2) + 1); updateQuestStatus(env); return true; } } return false; }
@Override public boolean onDialogEvent(QuestEnv env) { final Player player = env.getPlayer(); int targetId = 0; DialogAction dialog = env.getDialog(); if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId(); QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs == null || qs.getStatus() == QuestStatus.NONE) { if (targetId == 204006) { // Demokritos if (dialog == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 1011); else return sendQuestStartDialog(env); } } else if (qs.getStatus() == QuestStatus.START) { int var = qs.getQuestVarById(0); if (targetId == 203765) { // Kreon switch (dialog) { case QUEST_SELECT: if (var == 0) return sendQuestDialog(env, 1352); case SETPRO1: if (var == 0) return defaultCloseDialog(env, 0, 1); } } } else if (qs.getStatus() == QuestStatus.REWARD) { if (targetId == 204006) 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 HandlerResult onItemUseEvent(final QuestEnv env, Item item) { Player player = env.getPlayer(); QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs != null && qs.getStatus() == QuestStatus.START) { if (player.isInsideZone(ZoneName.get("LC1_ITEMUSEAREA_Q1345"))) return HandlerResult.fromBoolean(useQuestItem(env, item, 1, 2, true, 0, 0, 0)); } return HandlerResult.SUCCESS; // ?? }
@Override public boolean onEnterZoneEvent(QuestEnv env, ZoneName zoneName) { Player player = env.getPlayer(); if (player == null) return false; QuestState qs = player.getQuestStateList().getQuestState(questId); if (zoneName != ZoneName.get("DRANA_PRODUCTION_LAB_300250000")) return false; if (qs == null || qs.getQuestVars().getQuestVars() != 1) return false; if (qs.getStatus() != QuestStatus.START) return false; qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); return true; }
@Override public boolean onAtDistanceEvent(QuestEnv env) { Player player = env.getPlayer(); QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs != null && qs.getStatus() == QuestStatus.START) { if (qs.getQuestVars().getQuestVars() == 0) { qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); return true; } } return false; }
@Override public boolean onDieEvent(QuestEnv env) { Player player = env.getPlayer(); QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs == null || qs.getStatus() != QuestStatus.START) return false; int var = qs.getQuestVarById(0); if (var == 5) { qs.setQuestVarById(0, 3); // 3 updateQuestStatus(env); return true; } 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 onLeaveZoneEvent(QuestEnv env, ZoneName zoneName) { Player player = env.getPlayer(); QuestState qs = player.getQuestStateList().getQuestState(env.getQuestId()); if (qs != null && qs.getStatus() == QuestStatus.START) { int var = qs.getQuestVarById(0); if (zoneName == ZoneName.get("BALTASAR_HILL_VILLAGE_220050000") && var == 1) { giveQuestItem(env, 182205502, 1); changeQuestStep(env, 1, 2, false); // 2 return true; } } return false; }
@Override public HandlerResult onItemUseEvent(QuestEnv env, Item item) { final Player player = env.getPlayer(); final int id = item.getItemTemplate().getTemplateId(); if (id == 182213191) { QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs != null && qs.getStatus() == QuestStatus.START) { qs.setQuestVar(1); qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); } } return HandlerResult.UNKNOWN; }
@Override public boolean onLogOutEvent(QuestEnv env) { Player player = env.getPlayer(); QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs != null && qs.getStatus() == QuestStatus.START) { int var = qs.getQuestVarById(0); if (var >= 0) { qs.setStatus(QuestStatus.NONE); qs.setQuestVar(0); updateQuestStatus(env); return true; } } return false; }
@Override public boolean onEnterZoneEvent(QuestEnv env, ZoneName zoneName) { if (zoneName == ZoneName.get("LDF5_UNDER_SENSORYAREA_Q16920_206325_1_600070000")) { Player player = env.getPlayer(); if (player == null) return false; QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs != null && qs.getStatus() == QuestStatus.START) { int var = qs.getQuestVarById(0); if (var == 0) { changeQuestStep(env, 0, 1, true); return true; } } } return false; }
@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; }
@Override public boolean onDieEvent(QuestEnv env) { Player player = env.getPlayer(); QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs != null && qs.getStatus() == QuestStatus.START) { int var = qs.getQuestVarById(0); if (var >= 0) { qs.setStatus(QuestStatus.NONE); qs.setQuestVar(0); updateQuestStatus(env); PacketSendUtility.sendPacket( player, new SM_SYSTEM_MESSAGE( SystemMessageId.QUEST_FAILED_$1, DataManager.QUEST_DATA.getQuestById(questId).getName())); 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 == 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; }
@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 == 203782) { 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 203783: { switch (env.getDialog()) { case QUEST_SELECT: return sendQuestDialog(env, 1011); case SETPRO1: if (!giveQuestItem(env, 122001251, 1)) return true; qs.setQuestVarById(0, 1); updateQuestStatus(env); PacketSendUtility.sendPacket( player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); return true; } } case 203782: { switch (env.getDialog()) { case QUEST_SELECT: { long itemCount1 = player.getInventory().getItemCountByItemId(152003007); long itemCount2 = player.getInventory().getItemCountByItemId(152003008); if (itemCount1 > 0 && itemCount2 > 0) { removeQuestItem(env, 152003007, 1); removeQuestItem(env, 152003008, 1); qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); return sendQuestDialog(env, 1352); } else return sendQuestDialog(env, 10001); } } } } } else if (qs.getStatus() == QuestStatus.REWARD) { if (targetId == 203782) { if (env.getDialogId() == DialogAction.CHECK_USER_HAS_QUEST_ITEM.id()) return sendQuestDialog(env, 5); else return sendQuestEndDialog(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 == 799070) { if (qs == null || qs.getStatus() == QuestStatus.NONE) { if (env.getDialog() == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 1011); else if (env.getDialogId() == DialogAction.QUEST_ACCEPT_1.id()) { if (giveQuestItem(env, 182209503, 1)) return sendQuestStartDialog(env); else return true; } else return sendQuestStartDialog(env); } } if (qs == null) return false; int var = qs.getQuestVarById(0); if (qs.getStatus() == QuestStatus.REWARD) { if (targetId == 798946) { 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 == 798933) { switch (env.getDialog()) { case QUEST_SELECT: if (var == 0) return sendQuestDialog(env, 1352); case SETPRO1: if (var == 0) { removeQuestItem(env, 182209503, 1); if (giveQuestItem(env, 182209504, 1)) qs.setQuestVarById(0, var + 1); qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); PacketSendUtility.sendPacket( player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); return true; } return false; } } 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; }
private void checkDialog(Player player) { int npcId = getNpcId(); List<Integer> relatedQuests = QuestEngine.getInstance().getQuestNpc(npcId).getOnTalkEvent(); boolean playerHasQuest = false; boolean playerCanStartQuest = false; if (!relatedQuests.isEmpty()) { for (int questId : relatedQuests) { QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs != null && (qs.getStatus() == QuestStatus.START || qs.getStatus() == QuestStatus.REWARD)) { playerHasQuest = true; break; } else if (qs == null || qs.getStatus() == QuestStatus.NONE || qs.canRepeat()) { if (QuestService.checkStartConditions( new QuestEnv(getOwner(), player, questId, 0), true)) { playerCanStartQuest = true; continue; } } } } if (playerHasQuest) { boolean isRewardStep = false; for (int questId : relatedQuests) { QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs != null && qs.getStatus() == QuestStatus.REWARD) { PacketSendUtility.sendPacket( player, new SM_DIALOG_WINDOW(getObjectId(), rewardDialogId, questId)); isRewardStep = true; break; } } if (!isRewardStep) { PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(getObjectId(), questDialogId)); } } else if (playerCanStartQuest) { PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(getObjectId(), startingDialogId)); } else { PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(getObjectId(), 1011, 0)); } }
@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) { 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.getDialog()) { case QUEST_SELECT: if (var == 0) return sendQuestDialog(env, 1352); break; case SETPRO1: if (var == 0) { qs.setQuestVarById(0, var + 1); updateQuestStatus(env); TeleportService2.teleportTo( player, 220030000, player.getInstanceId(), 1748f, 1807f, 255f); PacketSendUtility.sendPacket( player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 0)); return true; } } } case 203559: switch (env.getDialog()) { case QUEST_SELECT: if (var == 1) { qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); return sendQuestDialog(env, 2375); } } } } else if (qs.getStatus() == QuestStatus.REWARD) { if (targetId == 203559) { return sendQuestEndDialog(env); } } return false; }
@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(final 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); DialogAction dialog = env.getDialog(); if (qs == null || qs.getStatus() == QuestStatus.NONE) { if (targetId == 204787) { // Chieftain Akagitan if (dialog == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 4762); else if (dialog == DialogAction.QUEST_ACCEPT_1) { if (!giveQuestItem(env, 182204498, 1)) return true; return sendQuestStartDialog(env); } else return sendQuestStartDialog(env); } } else if (qs.getStatus() == QuestStatus.START) { int var = qs.getQuestVarById(0); if (targetId == 204824) { switch (dialog) { case QUEST_SELECT: if (var == 0) return sendQuestDialog(env, 1011); case SETPRO1: if (var == 0) { qs.setQuestVarById(0, qs.getQuestVarById(0) + 1); updateQuestStatus(env); PacketSendUtility.sendPacket( player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); final Npc npc = (Npc) env.getVisibleObject(); ThreadPoolManager.getInstance() .schedule( new Runnable() { @Override public void run() { npc.getController().onDelete(); } }, 40000); return true; } } } if (targetId == 700323) { // Hugh mamut skull switch (dialog) { case USE_OBJECT: if (var == 0) { 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() { @SuppressWarnings("unused") final QuestState qs = player.getQuestStateList().getQuestState(questId); removeQuestItem(env, 182204498, 1); if (player.getTarget() == null || player.getTarget().getObjectId() != targetObjectId) return; 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); QuestService.addNewSpawn( 220040000, 1, 204824, (float) 2851.698, (float) 160.88698, (float) 301.78537, (byte) 93); } }, 3000); } } } if (targetId == 204787) { // Chieftain Akagitan switch (dialog) { case USE_OBJECT: qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); return sendQuestDialog(env, 10002); case SELECT_QUEST_REWARD: return sendQuestDialog(env, 5); } } } else if (qs.getStatus() == QuestStatus.REWARD) { if (targetId == 204787) return sendQuestEndDialog(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(); final QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs == null || qs.getStatus() == QuestStatus.NONE) { if (targetId == 204326) { if (env.getDialog() == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 4762); else return sendQuestStartDialog(env); } } else if (qs.getStatus() == QuestStatus.START) { switch (targetId) { case 204375: { switch (env.getDialog()) { case QUEST_SELECT: { if (qs.getQuestVarById(0) == 0) return sendQuestDialog(env, 1011); else if (qs.getQuestVarById(0) == 1) return sendQuestDialog(env, 1352); else if (qs.getQuestVarById(0) == 2) return sendQuestDialog(env, 1693); } case CHECK_USER_HAS_QUEST_ITEM: { return checkQuestItems(env, 1, 2, false, 10000, 10001); } case SETPRO3: { TeleportService2.teleportTo( player, 210020000, 1, 370.13f, 2682.59f, 171, (byte) 30, TeleportAnimation.BEAM_ANIMATION); qs.setQuestVar(3); return defaultCloseDialog(env, 3, 3, true, false); } case SELECT_ACTION_1779: { return sendQuestDialog(env, 1779); } case SETPRO1: { TeleportService2.teleportTo( player, 210020000, 1, 370.13f, 2682.59f, 171, (byte) 30, TeleportAnimation.BEAM_ANIMATION); return defaultCloseDialog(env, 0, 1); } } } } } else if (qs.getStatus() == QuestStatus.REWARD) { if (targetId == 204375) { if (env.getDialog() == DialogAction.USE_OBJECT) { return sendQuestDialog(env, 10002); } 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) { 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 (qs == null || qs.getStatus() == QuestStatus.NONE) { if (env.getDialogId() == DialogAction.QUEST_ACCEPT_1.id()) { QuestService.startQuest(env); PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(0, 0)); return true; } else PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(0, 0)); } else if (qs.getStatus() == QuestStatus.START) { if (targetId == 278592) { 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 if (targetId == 203933) { if (env.getDialog() == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 1693); else if (env.getDialog() == DialogAction.SETPRO2) { qs.setQuestVarById(0, qs.getQuestVarById(0) + 1); updateQuestStatus(env); PacketSendUtility.sendPacket( player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); return true; } } else if (targetId == 203991) { if (env.getDialog() == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 2375); else if (env.getDialogId() == DialogAction.SELECT_QUEST_REWARD.id()) { qs.setQuestVarById(0, qs.getQuestVarById(0) + 1); qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); PacketSendUtility.sendPacket( player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); return sendQuestEndDialog(env); } } } else if (qs.getStatus() == QuestStatus.REWARD && targetId == 203991) { return sendQuestEndDialog(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); DialogAction dialog = env.getDialog(); if (qs == null || qs.getStatus() == QuestStatus.NONE) { if (targetId == 204817) { if (dialog == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 1011); else return sendQuestStartDialog(env); } } else if (qs.getStatus() == QuestStatus.START) { int var = qs.getQuestVarById(0); if (targetId == 204817) { switch (dialog) { case QUEST_SELECT: if (var == 3) { qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); return sendQuestDialog(env, 2375); } case SELECT_QUEST_REWARD: if (var == 3) return sendQuestDialog(env, 5); } } if (targetId == 204777) { switch (dialog) { case QUEST_SELECT: if (var == 0) return sendQuestDialog(env, 1352); case SETPRO1: if (var == 0) { if (!giveQuestItem(env, 182204515, 1)) return true; if (!giveQuestItem(env, 182204516, 1)) return true; qs.setQuestVarById(0, qs.getQuestVarById(0) + 1); updateQuestStatus(env); PacketSendUtility.sendPacket( player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); return true; } } } if (targetId == 204700) { switch (dialog) { case QUEST_SELECT: if (var == 1) return sendQuestDialog(env, 1693); case SETPRO2: if (var == 1) { removeQuestItem(env, 182204515, 1); qs.setQuestVarById(0, qs.getQuestVarById(0) + 1); updateQuestStatus(env); PacketSendUtility.sendPacket( player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); return true; } } } if (targetId == 204702) { switch (dialog) { case QUEST_SELECT: if (var == 2) return sendQuestDialog(env, 2034); case SETPRO3: if (var == 2) { removeQuestItem(env, 182204516, 1); qs.setQuestVarById(0, qs.getQuestVarById(0) + 1); updateQuestStatus(env); PacketSendUtility.sendPacket( player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); return true; } } } } else if (qs.getStatus() == QuestStatus.REWARD) { if (targetId == 204817) { return sendQuestEndDialog(env); } } return false; }