package script.conversation; import script.*; import script.base_class.*; import script.combat_engine.*; import java.util.Arrays; import java.util.Hashtable; import java.util.Vector; import script.base_script; import script.library.ai_lib; import script.library.chat; import script.library.conversation; import script.library.groundquests; import script.library.utils; public class wod_gethzerion extends script.base_script { public wod_gethzerion() { } public static String c_stringFile = "conversation/wod_gethzerion"; public boolean wod_gethzerion_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException { return true; } public boolean wod_gethzerion_condition_IsSM(obj_id player, obj_id npc) throws InterruptedException { if (!hasObjVar(player, "wod_prologue_quests")) { return false; } int status = getIntObjVar(player, "wod_prologue_quests"); if (status < 1) { return true; } return false; } public boolean wod_gethzerion_condition_IsIndifferent(obj_id player, obj_id npc) throws InterruptedException { if (!hasObjVar(player, "wod_prologue_quests")) { return false; } int status = getIntObjVar(player, "wod_prologue_quests"); if ((status > 0) && (status < 8)) { return true; } return false; } public boolean wod_gethzerion_condition_hasQuestActive(obj_id player, obj_id npc) throws InterruptedException { return questIsQuestActive(questGetQuestId("quest/wod_themepark_ns_kill_clan"), player) && questIsQuestActive(questGetQuestId("quest/wod_themepark_ns_kill_spiderclan"), player) && (questIsQuestActive(questGetQuestId("quest/wod_themepark_ns_recon"), player) || questIsQuestComplete(questGetQuestId("quest/wod_themepark_ns_recon"), player)); } public boolean wod_gethzerion_condition_hasPreqComplete(obj_id player, obj_id npc) throws InterruptedException { if ((hasObjVar(player, "wod_prologue_quests")) && (groundquests.hasCompletedQuest(player, "wod_rubina_goto_ns"))) { return true; } return false; } public boolean wod_gethzerion_condition_onReturnKillClanNS(obj_id player, obj_id npc) throws InterruptedException { return groundquests.isTaskActive(player, "wod_themepark_ns_kill_clan", "returnNight"); } public boolean wod_gethzerion_condition_onReturnKillSpiderclanNS(obj_id player, obj_id npc) throws InterruptedException { return groundquests.isTaskActive(player, "wod_themepark_ns_kill_spiderclan", "returnNight"); } public boolean wod_gethzerion_condition_onReturnGhostRewardNS(obj_id player, obj_id npc) throws InterruptedException { return groundquests.isTaskActive(player, "wod_ns_ghost_reward", "returnFromRecon"); } public boolean wod_gethzerion_condition_hasFinishedRecon(obj_id player, obj_id npc) throws InterruptedException { int status = getIntObjVar(player, "wod_prologue_quests"); if ((status > 7) && questIsQuestActive(questGetQuestId("quest/wod_rubina_chest"), player)) { return false; } if ((status > 7) && !groundquests.hasCompletedQuest(player, "wod_rubina_chest") && groundquests.hasCompletedQuest(player, "wod_ns_ghost_reward")) { return true; } return false; } public boolean wod_gethzerion_condition_hasNotFinishedRecon(obj_id player, obj_id npc) throws InterruptedException { int status = getIntObjVar(player, "wod_prologue_quests"); if ((status > 7) && questIsQuestActive(questGetQuestId("quest/wod_themepark_ns_recon"), player)) { return false; } if ((status > 7) && !groundquests.hasCompletedQuest(player, "wod_themepark_ns_recon")) { return true; } return false; } public boolean wod_gethzerion_condition_QuestClanAlreadyActive(obj_id player, obj_id npc) throws InterruptedException { return questIsQuestActive(questGetQuestId("quest/wod_themepark_ns_kill_clan"), player); } public boolean wod_gethzerion_condition_QuestSpiderclanAlreadyActive(obj_id player, obj_id npc) throws InterruptedException { return questIsQuestActive(questGetQuestId("quest/wod_themepark_ns_kill_spiderclan"), player); } public void wod_gethzerion_action_sendReturnedSignalGhostRewardNS(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "hasReturnedFromRecon"); } public void wod_gethzerion_action_sendReturnedSignalKillSpiderclanNS(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "hasReturnedNightSpider"); } public void wod_gethzerion_action_sendReturnedSignalKillClanNS(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "hasReturnedNight"); } public void wod_gethzerion_action_grantTPRubinaChestNS(obj_id player, obj_id npc) throws InterruptedException { groundquests.grantQuest(player, "quest/wod_rubina_chest"); } public void wod_gethzerion_action_grantTPReconNS(obj_id player, obj_id npc) throws InterruptedException { groundquests.grantQuest(player, "quest/wod_themepark_ns_recon"); } public void wod_gethzerion_action_grantTPKillSpiderclanNS(obj_id player, obj_id npc) throws InterruptedException { if (groundquests.hasCompletedQuest(player, "wod_themepark_ns_kill_spiderclan")) { groundquests.clearQuest(player, "quest/wod_themepark_ns_kill_spiderclan"); } groundquests.grantQuest(player, "quest/wod_themepark_ns_kill_spiderclan"); } public void wod_gethzerion_action_grantTPKillClanNS(obj_id player, obj_id npc) throws InterruptedException { if (groundquests.hasCompletedQuest(player, "wod_themepark_ns_kill_clan")) { groundquests.clearQuest(player, "quest/wod_themepark_ns_kill_clan"); } groundquests.grantQuest(player, "quest/wod_themepark_ns_kill_clan"); } public int wod_gethzerion_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_56")) { wod_gethzerion_action_sendReturnedSignalKillClanNS(player, npc); if (wod_gethzerion_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_58"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_CONTINUE; } public int wod_gethzerion_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_44")) { wod_gethzerion_action_sendReturnedSignalKillSpiderclanNS(player, npc); if (wod_gethzerion_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_46"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_CONTINUE; } public int wod_gethzerion_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_50")) { wod_gethzerion_action_sendReturnedSignalGhostRewardNS(player, npc); if (wod_gethzerion_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_52"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_CONTINUE; } public int wod_gethzerion_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_20")) { if (wod_gethzerion_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_22"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_24"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_28"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 11); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_30")) { if (wod_gethzerion_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_32"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_34"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_38"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 13); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_40")) { if (wod_gethzerion_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_43"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_47"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_55"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 15); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_67")) { if (wod_gethzerion_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_69"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_71"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 17); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_CONTINUE; } public int wod_gethzerion_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_24")) { if (wod_gethzerion_condition__defaultCondition(player, npc)) { wod_gethzerion_action_grantTPKillClanNS(player, npc); string_id message = new string_id(c_stringFile, "s_26"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } if (response.equals("s_28")) { if (wod_gethzerion_condition_IsSM(player, npc)) { string_id message = new string_id(c_stringFile, "s_5"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_IsIndifferent(player, npc)) { string_id message = new string_id(c_stringFile, "s_16"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_onReturnKillClanNS(player, npc)) { string_id message = new string_id(c_stringFile, "s_54"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_56"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 3); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_onReturnKillSpiderclanNS(player, npc)) { string_id message = new string_id(c_stringFile, "s_42"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_44"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 5); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_onReturnGhostRewardNS(player, npc)) { string_id message = new string_id(c_stringFile, "s_48"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_50"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 7); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_hasQuestActive(player, npc)) { string_id message = new string_id(c_stringFile, "s_66"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_hasPreqComplete(player, npc)) { string_id message = new string_id(c_stringFile, "s_18"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (!wod_gethzerion_condition_QuestClanAlreadyActive(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (!wod_gethzerion_condition_QuestSpiderclanAlreadyActive(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (wod_gethzerion_condition_hasNotFinishedRecon(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } boolean hasResponse3 = false; if (wod_gethzerion_condition_hasFinishedRecon(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse3 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_20"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_30"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_40"); } if (hasResponse3) { responses[responseIndex++] = new string_id(c_stringFile, "s_67"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 10); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_65"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_CONTINUE; } public int wod_gethzerion_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_34")) { if (wod_gethzerion_condition__defaultCondition(player, npc)) { wod_gethzerion_action_grantTPKillSpiderclanNS(player, npc); string_id message = new string_id(c_stringFile, "s_36"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } if (response.equals("s_38")) { if (wod_gethzerion_condition_IsSM(player, npc)) { string_id message = new string_id(c_stringFile, "s_5"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_IsIndifferent(player, npc)) { string_id message = new string_id(c_stringFile, "s_16"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_onReturnKillClanNS(player, npc)) { string_id message = new string_id(c_stringFile, "s_54"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_56"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 3); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_onReturnKillSpiderclanNS(player, npc)) { string_id message = new string_id(c_stringFile, "s_42"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_44"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 5); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_onReturnGhostRewardNS(player, npc)) { string_id message = new string_id(c_stringFile, "s_48"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_50"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 7); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_hasQuestActive(player, npc)) { string_id message = new string_id(c_stringFile, "s_66"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_hasPreqComplete(player, npc)) { string_id message = new string_id(c_stringFile, "s_18"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (!wod_gethzerion_condition_QuestClanAlreadyActive(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (!wod_gethzerion_condition_QuestSpiderclanAlreadyActive(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (wod_gethzerion_condition_hasNotFinishedRecon(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } boolean hasResponse3 = false; if (wod_gethzerion_condition_hasFinishedRecon(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse3 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_20"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_30"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_40"); } if (hasResponse3) { responses[responseIndex++] = new string_id(c_stringFile, "s_67"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 10); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_65"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_CONTINUE; } public int wod_gethzerion_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_47")) { if (wod_gethzerion_condition__defaultCondition(player, npc)) { wod_gethzerion_action_grantTPReconNS(player, npc); string_id message = new string_id(c_stringFile, "s_51"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } if (response.equals("s_55")) { if (wod_gethzerion_condition_IsSM(player, npc)) { string_id message = new string_id(c_stringFile, "s_5"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_IsIndifferent(player, npc)) { string_id message = new string_id(c_stringFile, "s_16"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_onReturnKillClanNS(player, npc)) { string_id message = new string_id(c_stringFile, "s_54"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_56"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 3); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_onReturnKillSpiderclanNS(player, npc)) { string_id message = new string_id(c_stringFile, "s_42"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_44"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 5); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_onReturnGhostRewardNS(player, npc)) { string_id message = new string_id(c_stringFile, "s_48"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_50"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 7); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_hasQuestActive(player, npc)) { string_id message = new string_id(c_stringFile, "s_66"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_hasPreqComplete(player, npc)) { string_id message = new string_id(c_stringFile, "s_18"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (!wod_gethzerion_condition_QuestClanAlreadyActive(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (!wod_gethzerion_condition_QuestSpiderclanAlreadyActive(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (wod_gethzerion_condition_hasNotFinishedRecon(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } boolean hasResponse3 = false; if (wod_gethzerion_condition_hasFinishedRecon(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse3 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_20"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_30"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_40"); } if (hasResponse3) { responses[responseIndex++] = new string_id(c_stringFile, "s_67"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 10); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_65"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_CONTINUE; } public int wod_gethzerion_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_71")) { if (wod_gethzerion_condition__defaultCondition(player, npc)) { wod_gethzerion_action_grantTPRubinaChestNS(player, npc); string_id message = new string_id(c_stringFile, "s_73"); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_CONTINUE; } public int OnInitialize(obj_id self) throws InterruptedException { if ((!isTangible(self)) || (isPlayer(self))) { detachScript(self, "conversation.wod_gethzerion"); } setCondition(self, CONDITION_CONVERSABLE); return SCRIPT_CONTINUE; } public int OnAttach(obj_id self) throws InterruptedException { setCondition(self, CONDITION_CONVERSABLE); return SCRIPT_CONTINUE; } public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException { int menu = menuInfo.addRootMenu(menu_info_types.CONVERSE_START, null); menu_info_data menuInfoData = menuInfo.getMenuItemById(menu); menuInfoData.setServerNotify(false); setCondition(self, CONDITION_CONVERSABLE); return SCRIPT_CONTINUE; } public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException { clearCondition(self, CONDITION_CONVERSABLE); detachScript(self, "conversation.wod_gethzerion"); return SCRIPT_CONTINUE; } public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException { Object[] objects = new Object[responses.length]; System.arraycopy(responses, 0, objects, 0, responses.length); return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); } public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException { obj_id npc = self; if (ai_lib.isInCombat(npc) || ai_lib.isInCombat(player)) { return SCRIPT_OVERRIDE; } if (wod_gethzerion_condition_IsSM(player, npc)) { string_id message = new string_id(c_stringFile, "s_5"); chat.chat(npc, player, message); return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_IsIndifferent(player, npc)) { string_id message = new string_id(c_stringFile, "s_16"); chat.chat(npc, player, message); return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_onReturnKillClanNS(player, npc)) { string_id message = new string_id(c_stringFile, "s_54"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_56"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 3); npcStartConversation(player, npc, "wod_gethzerion", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_onReturnKillSpiderclanNS(player, npc)) { string_id message = new string_id(c_stringFile, "s_42"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_44"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 5); npcStartConversation(player, npc, "wod_gethzerion", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_onReturnGhostRewardNS(player, npc)) { string_id message = new string_id(c_stringFile, "s_48"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (wod_gethzerion_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_50"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 7); npcStartConversation(player, npc, "wod_gethzerion", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_hasQuestActive(player, npc)) { string_id message = new string_id(c_stringFile, "s_66"); chat.chat(npc, player, message); return SCRIPT_CONTINUE; } if (wod_gethzerion_condition_hasPreqComplete(player, npc)) { string_id message = new string_id(c_stringFile, "s_18"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (!wod_gethzerion_condition_QuestClanAlreadyActive(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (!wod_gethzerion_condition_QuestSpiderclanAlreadyActive(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (wod_gethzerion_condition_hasNotFinishedRecon(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } boolean hasResponse3 = false; if (wod_gethzerion_condition_hasFinishedRecon(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse3 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_20"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_30"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_40"); } if (hasResponse3) { responses[responseIndex++] = new string_id(c_stringFile, "s_67"); } utils.setScriptVar(player, "conversation.wod_gethzerion.branchId", 10); npcStartConversation(player, npc, "wod_gethzerion", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (wod_gethzerion_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_65"); chat.chat(npc, player, message); return SCRIPT_CONTINUE; } chat.chat(npc, "Error: All conditions for OnStartNpcConversation were false."); return SCRIPT_CONTINUE; } public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException { if (!conversationId.equals("wod_gethzerion")) { return SCRIPT_CONTINUE; } obj_id npc = self; int branchId = utils.getIntScriptVar(player, "conversation.wod_gethzerion.branchId"); if (branchId == 3 && wod_gethzerion_handleBranch3(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 5 && wod_gethzerion_handleBranch5(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 7 && wod_gethzerion_handleBranch7(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 10 && wod_gethzerion_handleBranch10(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 11 && wod_gethzerion_handleBranch11(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 13 && wod_gethzerion_handleBranch13(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 15 && wod_gethzerion_handleBranch15(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 17 && wod_gethzerion_handleBranch17(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); utils.removeScriptVar(player, "conversation.wod_gethzerion.branchId"); return SCRIPT_CONTINUE; } }