package script.conversation; import script.library.ai_lib; import script.library.chat; import script.library.groundquests; import script.library.utils; import script.*; public class legacy_head_malakili extends script.base_script { public legacy_head_malakili() { } public static String c_stringFile = "conversation/legacy_head_malakili"; public boolean legacy_head_malakili_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException { return true; } public boolean legacy_head_malakili_condition_onRod(obj_id player, obj_id npc) throws InterruptedException { int questId1 = questGetQuestId("quest/legacy_head_rod"); boolean OnTask = (questIsQuestActive(questId1, player)); return OnTask; } public boolean legacy_head_malakili_condition_onThreeTasks(obj_id player, obj_id npc) throws InterruptedException { int questId1 = questGetQuestId("quest/legacy_head_rod"); int ground = groundquests.getTaskId(questId1, "legacy_head_rod_e2"); boolean onTask = (questIsTaskActive(questId1, ground, player)); return onTask; } public boolean legacy_head_malakili_condition_abandoned(obj_id player, obj_id npc) throws InterruptedException { int questId1 = questGetQuestId("quest/legacy_head_start"); int questId2 = questGetQuestId("quest/legacy_head_rod"); boolean OnTask = (questIsQuestComplete(questId1, player)) && (!(questIsQuestActive(questId2, player))) && (!(questIsQuestComplete(questId2, player))); return OnTask; } public boolean legacy_head_malakili_condition_rodCompleted(obj_id player, obj_id npc) throws InterruptedException { int questId1 = questGetQuestId("quest/legacy_head_rod"); boolean OnTask = (questIsQuestComplete(questId1, player)); return OnTask; } public void legacy_head_malakili_action_facePlayer(obj_id player, obj_id npc) throws InterruptedException { faceTo(npc, player); } public void legacy_head_malakili_action_grantRod(obj_id player, obj_id npc) throws InterruptedException { groundquests.grantQuest(player, "legacy_head_rod"); } public void legacy_head_malakili_action_signalQuest(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "legacy_head_rod_launch_e2"); } public int legacy_head_malakili_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_45")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { legacy_head_malakili_action_grantRod(player, npc); string_id message = new string_id(c_stringFile, "s_46"); utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int legacy_head_malakili_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_11")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_13"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_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_15"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_32"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 6); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_86")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_30"); utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int legacy_head_malakili_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_15")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_17"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_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_19"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 7); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_32")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_34"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_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_36"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_38"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 11); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int legacy_head_malakili_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_19")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_21"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_23"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_41"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_28"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 8); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int legacy_head_malakili_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_23")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { legacy_head_malakili_action_signalQuest(player, npc); string_id message = new string_id(c_stringFile, "s_25"); utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } if (response.equals("s_41")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_90"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } boolean hasResponse3 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse3 = true; } boolean hasResponse4 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse4 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_121"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_92"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_102"); } if (hasResponse3) { responses[responseIndex++] = new string_id(c_stringFile, "s_112"); } if (hasResponse4) { responses[responseIndex++] = new string_id(c_stringFile, "s_123"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 14); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_28")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_30"); utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int legacy_head_malakili_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_36")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_21"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_23"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_41"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_28"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 8); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_38")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_40"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_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_47"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 12); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int legacy_head_malakili_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_47")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_50"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_52"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_89"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_84"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 13); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int legacy_head_malakili_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_52")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_21"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_23"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_41"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_28"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 8); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_89")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_90"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } boolean hasResponse3 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse3 = true; } boolean hasResponse4 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse4 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_121"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_92"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_102"); } if (hasResponse3) { responses[responseIndex++] = new string_id(c_stringFile, "s_112"); } if (hasResponse4) { responses[responseIndex++] = new string_id(c_stringFile, "s_123"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 14); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_84")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_30"); utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int legacy_head_malakili_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_121")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_21"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_23"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_41"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_28"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 8); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_92")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_94"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_96"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_98"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_100"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 15); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_102")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_104"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_106"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_108"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_110"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 16); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_112")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_114"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_116"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_118"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_120"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 17); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_123")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_30"); utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int legacy_head_malakili_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_96")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_21"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_23"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_41"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_28"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 8); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_98")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_90"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } boolean hasResponse3 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse3 = true; } boolean hasResponse4 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse4 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_121"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_92"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_102"); } if (hasResponse3) { responses[responseIndex++] = new string_id(c_stringFile, "s_112"); } if (hasResponse4) { responses[responseIndex++] = new string_id(c_stringFile, "s_123"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 14); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_100")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_30"); utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int legacy_head_malakili_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_106")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_21"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_23"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_41"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_28"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 8); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_108")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_90"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } boolean hasResponse3 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse3 = true; } boolean hasResponse4 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse4 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_121"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_92"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_102"); } if (hasResponse3) { responses[responseIndex++] = new string_id(c_stringFile, "s_112"); } if (hasResponse4) { responses[responseIndex++] = new string_id(c_stringFile, "s_123"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 14); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_110")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_30"); utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int legacy_head_malakili_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_116")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_21"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_23"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_41"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_28"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 8); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_118")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_90"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } boolean hasResponse3 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse3 = true; } boolean hasResponse4 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse4 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_121"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_92"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_102"); } if (hasResponse3) { responses[responseIndex++] = new string_id(c_stringFile, "s_112"); } if (hasResponse4) { responses[responseIndex++] = new string_id(c_stringFile, "s_123"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 14); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_120")) { if (legacy_head_malakili_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_30"); utils.removeScriptVar(player, "conversation.legacy_head_malakili.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int OnInitialize(obj_id self) throws InterruptedException { if ((!isMob(self)) || (isPlayer(self))) { detachScript(self, "conversation.legacy_head_malakili"); } setCondition(self, CONDITION_CONVERSABLE); setCondition(self, CONDITION_INTERESTING); setInvulnerable(self, true); setName(self, "Malakili"); ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL); return SCRIPT_CONTINUE; } public int OnAttach(obj_id self) throws InterruptedException { setCondition(self, CONDITION_CONVERSABLE); setCondition(self, CONDITION_INTERESTING); setInvulnerable(self, true); setName(self, "Malakili"); ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL); 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.legacy_head_malakili"); 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 (legacy_head_malakili_condition_abandoned(player, npc)) { legacy_head_malakili_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_44"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_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_45"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 1); npcStartConversation(player, npc, "legacy_head_malakili", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (legacy_head_malakili_condition_rodCompleted(player, npc)) { legacy_head_malakili_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_49"); chat.chat(npc, player, message); return SCRIPT_CONTINUE; } if (legacy_head_malakili_condition_onThreeTasks(player, npc)) { legacy_head_malakili_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_42"); chat.chat(npc, player, message); return SCRIPT_CONTINUE; } if (legacy_head_malakili_condition_onRod(player, npc)) { legacy_head_malakili_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_9"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (legacy_head_malakili_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (legacy_head_malakili_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_11"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_86"); } utils.setScriptVar(player, "conversation.legacy_head_malakili.branchId", 5); npcStartConversation(player, npc, "legacy_head_malakili", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (legacy_head_malakili_condition__defaultCondition(player, npc)) { legacy_head_malakili_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_88"); 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("legacy_head_malakili")) { return SCRIPT_CONTINUE; } obj_id npc = self; int branchId = utils.getIntScriptVar(player, "conversation.legacy_head_malakili.branchId"); if (branchId == 1 && legacy_head_malakili_handleBranch1(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 5 && legacy_head_malakili_handleBranch5(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 6 && legacy_head_malakili_handleBranch6(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 7 && legacy_head_malakili_handleBranch7(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 8 && legacy_head_malakili_handleBranch8(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 11 && legacy_head_malakili_handleBranch11(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 12 && legacy_head_malakili_handleBranch12(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 13 && legacy_head_malakili_handleBranch13(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 14 && legacy_head_malakili_handleBranch14(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 15 && legacy_head_malakili_handleBranch15(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 16 && legacy_head_malakili_handleBranch16(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 17 && legacy_head_malakili_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.legacy_head_malakili.branchId"); return SCRIPT_CONTINUE; } }