@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; if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId(); QuestState qs = player.getQuestStateList().getQuestState(questId); if (targetId == 278003) { if (qs == null || qs.getStatus() == QuestStatus.NONE) { if (env.getDialog() == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 1011); else return sendQuestStartDialog(env); } } else if (targetId == 278000) { 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 == 278013) { if (qs != null && qs.getStatus() == QuestStatus.START && qs.getQuestVarById(0) == 1) { 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 == 278102) { 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.START) { qs.setQuestVar(2); 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(); 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 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(); 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 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 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 = 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) { 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 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(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(); 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; }
@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() == DialogAction.QUEST_ACCEPT_1.id()) { QuestService.startQuest(env); PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(0, 0)); return true; } } else if (targetId == 798190) { 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 == 798191) { if (qs != null && qs.getStatus() == QuestStatus.START && qs.getQuestVarById(0) == 1) { 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 return sendQuestStartDialog(env); } } else if (targetId == 798192) { if (qs != null && qs.getStatus() == QuestStatus.START && qs.getQuestVarById(0) == 2) { if (env.getDialog() == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 2034); else if (env.getDialog() == DialogAction.SETPRO3) { 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 == 798193) { 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) { removeQuestItem(env, 182208043, 1); qs.setQuestVar(1); 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); int targetId = 0; if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId(); if (qs == null || qs.getStatus() == QuestStatus.NONE) { if (targetId == 203711) // Miriya { if (env.getDialog() == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 4762); else return sendQuestStartDialog(env); } return false; } int var = qs.getQuestVarById(0); if (qs.getStatus() == QuestStatus.REWARD) { if (targetId == 203711 && player.getInventory().getItemCountByItemId(182206081) == 1) // Miriya { 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) { if (targetId == 798321) // Koruchinerk { switch (env.getDialog()) { case QUEST_SELECT: if (var == 0) return sendQuestDialog(env, 1011); if (var == 1) return sendQuestDialog(env, 1352); case CHECK_USER_HAS_QUEST_ITEM: if (var == 1) { if (QuestService.collectItemCheck(env, true)) { if (!giveQuestItem(env, 182206080, 1)) return true; qs.setQuestVarById(0, var + 1); updateQuestStatus(env); return sendQuestDialog(env, 10000); } else return sendQuestDialog(env, 10001); } 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 == 279005 && player.getInventory().getItemCountByItemId(182206080) == 1) // Kohrunerk { switch (env.getDialog()) { case QUEST_SELECT: if (var == 2) return sendQuestDialog(env, 1693); case SET_SUCCEED: if (var == 2) removeQuestItem(env, 182206080, 1); if (!giveQuestItem(env, 182206081, 1)) return true; PacketSendUtility.sendPacket( player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); return true; } } return false; } return false; }