@Override public boolean onKillEvent(QuestCookie 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 216592: if (qs.getQuestVarById(0) == 8) { @SuppressWarnings("unused") final int instanceId = player.getInstanceId(); QuestService.addNewSpawn( 300150000, player.getInstanceId(), 799341, (float) 561.8763, (float) 192.25128, (float) 135.88919, (byte) 30, true); qs.setQuestVarById(0, qs.getQuestVarById(0) + 1); updateQuestStatus(env); return true; } } return false; }
@Override public boolean onMovieEndEvent(QuestCookie env, int movieId) { if (movieId != 442) return false; Player player = env.getPlayer(); QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs == null || qs.getStatus() != QuestStatus.START || qs.getQuestVars().getQuestVars() != 8) return false; QuestService.addNewSpawn( 300150000, player.getInstanceId(), 216592, (float) 561.8763, (float) 192.25128, (float) 135.88919, (byte) 30, true); return true; }
@Override public boolean onDialogEvent(QuestCookie 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 == 798946) { if (qs == null || qs.getStatus() == QuestStatus.NONE) { if (env.getDialogId() == 26) return sendQuestDialog(env, 4762); else return defaultQuestStartDialog(env); } else if (qs != null && qs.getStatus() == QuestStatus.REWARD) { if (env.getDialogId() == -1) return sendQuestDialog(env, 10002); else if (env.getDialogId() == 1009) return sendQuestDialog(env, 5); else return defaultQuestEndDialog(env); } } else if (targetId == 799521) { if (qs != null && qs.getStatus() == QuestStatus.START && qs.getQuestVarById(0) == 0) { if (env.getDialogId() == 26) return sendQuestDialog(env, 1011); else if (env.getDialogId() == 10000) { qs.setQuestVarById(0, qs.getQuestVarById(0) + 1); updateQuestStatus(env); PacketSendUtility.sendPacket( player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); QuestService.questTimerStart(env, 300); @SuppressWarnings("unused") final int instanceId = player.getInstanceId(); QuestService.addNewSpawn( 300170000, player.getInstanceId(), 216590, (float) 938.3348, (float) 240.31474, (float) 227.6818, (byte) 28, true); return true; } else return defaultQuestStartDialog(env); } } return false; }