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.groundquests; import script.library.utils; public class tatooine_entha_draknus extends script.base_script { public tatooine_entha_draknus() { } public static String c_stringFile = "conversation/tatooine_entha_draknus"; public boolean tatooine_entha_draknus_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException { return true; } public boolean tatooine_entha_draknus_condition_onTalkedAnKwee(obj_id player, obj_id npc) throws InterruptedException { return groundquests.isTaskActive(player, "tatooine_espa_pod_retrieval_v2", "tat_espa_pod_retrieval_e2"); } public boolean tatooine_entha_draknus_condition_completedQuest(obj_id player, obj_id npc) throws InterruptedException { return groundquests.hasCompletedQuest(player, "talus_nashal_rescue_operation"); } public boolean tatooine_entha_draknus_condition_onRace1(obj_id player, obj_id npc) throws InterruptedException { return groundquests.isQuestActive(player, "tatooine_entha_podracers_race1"); } public boolean tatooine_entha_draknus_condition_completedRace1(obj_id player, obj_id npc) throws InterruptedException { return groundquests.hasCompletedQuest(player, "tatooine_entha_podracers_race1"); } public boolean tatooine_entha_draknus_condition_completedRace2(obj_id player, obj_id npc) throws InterruptedException { return groundquests.hasCompletedQuest(player, "tatooine_entha_podracers_race2"); } public boolean tatooine_entha_draknus_condition_completedRace3(obj_id player, obj_id npc) throws InterruptedException { return groundquests.hasCompletedQuest(player, "tatooine_entha_podracers_race3"); } public boolean tatooine_entha_draknus_condition_onRace2(obj_id player, obj_id npc) throws InterruptedException { return groundquests.isQuestActive(player, "tatooine_entha_podracers_race2"); } public boolean tatooine_entha_draknus_condition_onRace3(obj_id player, obj_id npc) throws InterruptedException { return groundquests.isQuestActive(player, "tatooine_entha_podracers_race3"); } public boolean tatooine_entha_draknus_condition_completedPod(obj_id player, obj_id npc) throws InterruptedException { return groundquests.hasCompletedQuest(player, "tatooine_espa_pod_retrieval_v2"); } public boolean tatooine_entha_draknus_condition_skip3(obj_id player, obj_id npc) throws InterruptedException { return false; } public boolean tatooine_entha_draknus_condition_skip2(obj_id player, obj_id npc) throws InterruptedException { return false; } public boolean tatooine_entha_draknus_condition_skip1(obj_id player, obj_id npc) throws InterruptedException { return false; } public void tatooine_entha_draknus_action_grantRace1(obj_id player, obj_id npc) throws InterruptedException { groundquests.grantQuest(player, "tatooine_entha_podracers_race1"); } public void tatooine_entha_draknus_action_grantRace2(obj_id player, obj_id npc) throws InterruptedException { groundquests.grantQuest(player, "tatooine_entha_podracers_race2"); } public void tatooine_entha_draknus_action_grantRace3(obj_id player, obj_id npc) throws InterruptedException { groundquests.grantQuest(player, "tatooine_entha_podracers_race3"); } public void tatooine_entha_draknus_action_clearRace1(obj_id player, obj_id npc) throws InterruptedException { groundquests.clearQuest(player, "tatooine_entha_podracers_race1"); } public void tatooine_entha_draknus_action_clearRace2(obj_id player, obj_id npc) throws InterruptedException { groundquests.clearQuest(player, "tatooine_entha_podracers_race2"); } public void tatooine_entha_draknus_action_clearRace3(obj_id player, obj_id npc) throws InterruptedException { groundquests.clearQuest(player, "tatooine_entha_podracers_race3"); } public void tatooine_entha_draknus_action_signalGotoDraknus(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "tat_entha_goto_draknus_e1"); } public void tatooine_entha_draknus_action_signalReturnDraknus(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "tatooine_entha_return_draknus_e1"); } public int tatooine_entha_draknus_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_71")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_72"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_73"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 2); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_73")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_74"); utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_75")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_76"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_77"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 5); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcSpeak(player, pp); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcEndConversationWithMessage(player, pp); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_77")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_78"); utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_81")) { tatooine_entha_draknus_action_clearRace3(player, npc); if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { tatooine_entha_draknus_action_grantRace3(player, npc); string_id message = new string_id(c_stringFile, "s_82"); utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcEndConversationWithMessage(player, pp); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_83")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_84"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_85"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 10); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_85")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { tatooine_entha_draknus_action_grantRace3(player, npc); string_id message = new string_id(c_stringFile, "s_86"); utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_91")) { tatooine_entha_draknus_action_clearRace2(player, npc); if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { tatooine_entha_draknus_action_grantRace2(player, npc); string_id message = new string_id(c_stringFile, "s_92"); utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcEndConversationWithMessage(player, pp); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_42")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_44"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_46"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 15); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_46")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { tatooine_entha_draknus_action_grantRace2(player, npc); string_id message = new string_id(c_stringFile, "s_48"); utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_62")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { tatooine_entha_draknus_action_clearRace1(player, npc); string_id message = new string_id(c_stringFile, "s_64"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_66"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 18); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcSpeak(player, pp); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcEndConversationWithMessage(player, pp); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_66")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { tatooine_entha_draknus_action_grantRace1(player, npc); string_id message = new string_id(c_stringFile, "s_68"); utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcEndConversationWithMessage(player, pp); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_94")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_96"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_98"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 21); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_102")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_104"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_106"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 23); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_98")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { tatooine_entha_draknus_action_grantRace1(player, npc); string_id message = new string_id(c_stringFile, "s_100"); utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcEndConversationWithMessage(player, pp); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_106")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_108"); utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcEndConversationWithMessage(player, pp); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_112")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_114"); utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_79")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_80"); utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_87")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_88"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_89"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 30); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcSpeak(player, pp); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcEndConversationWithMessage(player, pp); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch30(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_89")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_93"); utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_101")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_105"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_109"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 33); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_entha_draknus_handleBranch33(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_109")) { if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_113"); utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int OnInitialize(obj_id self) throws InterruptedException { if ((!isTangible(self)) || (isPlayer(self))) { detachScript(self, "conversation.tatooine_entha_draknus"); } 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.tatooine_entha_draknus"); 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 (tatooine_entha_draknus_condition_completedPod(player, npc)) { string_id message = new string_id(c_stringFile, "s_4"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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.tatooine_entha_draknus.branchId", 1); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcStartConversation(player, npc, "tatooine_entha_draknus", null, pp, responses); } else { prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); chat.chat(npc, player, null, null, pp); } return SCRIPT_CONTINUE; } if (tatooine_entha_draknus_condition_completedRace3(player, npc)) { tatooine_entha_draknus_action_signalReturnDraknus(player, npc); string_id message = new string_id(c_stringFile, "s_10"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_75"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 4); npcStartConversation(player, npc, "tatooine_entha_draknus", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (tatooine_entha_draknus_condition_onRace3(player, npc)) { string_id message = new string_id(c_stringFile, "s_20"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_81"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 7); npcStartConversation(player, npc, "tatooine_entha_draknus", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (tatooine_entha_draknus_condition_completedRace2(player, npc)) { tatooine_entha_draknus_action_signalReturnDraknus(player, npc); string_id message = new string_id(c_stringFile, "s_24"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_83"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 9); npcStartConversation(player, npc, "tatooine_entha_draknus", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (tatooine_entha_draknus_condition_onRace2(player, npc)) { string_id message = new string_id(c_stringFile, "s_36"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_91"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 12); npcStartConversation(player, npc, "tatooine_entha_draknus", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (tatooine_entha_draknus_condition_completedRace1(player, npc)) { tatooine_entha_draknus_action_signalReturnDraknus(player, npc); string_id message = new string_id(c_stringFile, "s_40"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_42"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 14); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcStartConversation(player, npc, "tatooine_entha_draknus", null, pp, responses); } else { prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); chat.chat(npc, player, null, null, pp); } return SCRIPT_CONTINUE; } if (tatooine_entha_draknus_condition_onRace1(player, npc)) { string_id message = new string_id(c_stringFile, "s_60"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_62"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 17); npcStartConversation(player, npc, "tatooine_entha_draknus", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (tatooine_entha_draknus_condition_onTalkedAnKwee(player, npc)) { doAnimationAction(npc, "explain"); tatooine_entha_draknus_action_signalGotoDraknus(player, npc); string_id message = new string_id(c_stringFile, "s_70"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (tatooine_entha_draknus_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_94"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_102"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 20); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcStartConversation(player, npc, "tatooine_entha_draknus", null, pp, responses); } else { prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); chat.chat(npc, player, null, null, pp); } return SCRIPT_CONTINUE; } if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_110"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_112"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 25); npcStartConversation(player, npc, "tatooine_entha_draknus", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_57"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_79"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 27); npcStartConversation(player, npc, "tatooine_entha_draknus", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_63"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_87"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 29); npcStartConversation(player, npc, "tatooine_entha_draknus", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (tatooine_entha_draknus_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_97"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_entha_draknus_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_101"); } utils.setScriptVar(player, "conversation.tatooine_entha_draknus.branchId", 32); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcStartConversation(player, npc, "tatooine_entha_draknus", null, pp, responses); } else { prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); chat.chat(npc, player, null, null, pp); } 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("tatooine_entha_draknus")) { return SCRIPT_CONTINUE; } obj_id npc = self; int branchId = utils.getIntScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); if (branchId == 1 && tatooine_entha_draknus_handleBranch1(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 2 && tatooine_entha_draknus_handleBranch2(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 4 && tatooine_entha_draknus_handleBranch4(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 5 && tatooine_entha_draknus_handleBranch5(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 7 && tatooine_entha_draknus_handleBranch7(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 9 && tatooine_entha_draknus_handleBranch9(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 10 && tatooine_entha_draknus_handleBranch10(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 12 && tatooine_entha_draknus_handleBranch12(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 14 && tatooine_entha_draknus_handleBranch14(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 15 && tatooine_entha_draknus_handleBranch15(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 17 && tatooine_entha_draknus_handleBranch17(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 18 && tatooine_entha_draknus_handleBranch18(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 20 && tatooine_entha_draknus_handleBranch20(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 21 && tatooine_entha_draknus_handleBranch21(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 23 && tatooine_entha_draknus_handleBranch23(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 25 && tatooine_entha_draknus_handleBranch25(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 27 && tatooine_entha_draknus_handleBranch27(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 29 && tatooine_entha_draknus_handleBranch29(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 30 && tatooine_entha_draknus_handleBranch30(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 32 && tatooine_entha_draknus_handleBranch32(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 33 && tatooine_entha_draknus_handleBranch33(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); utils.removeScriptVar(player, "conversation.tatooine_entha_draknus.branchId"); return SCRIPT_CONTINUE; } }