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_eisley_begol extends script.base_script { public tatooine_eisley_begol() { } public static String c_stringFile = "conversation/tatooine_eisley_begol"; public boolean tatooine_eisley_begol_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException { return true; } public boolean tatooine_eisley_begol_condition_sodOnTask(obj_id player, obj_id npc) throws InterruptedException { int questId1 = questGetQuestId("quest/tatooine_eisley_spice_of_death"); int tat_eisley_nikos_coins_e1 = groundquests.getTaskId(questId1, "tat_eisley_death_spice_e1"); boolean onTask = questIsTaskActive(questId1, tat_eisley_nikos_coins_e1, player); return onTask; } public boolean tatooine_eisley_begol_condition_sodQuestComplete(obj_id player, obj_id npc) throws InterruptedException { int questId1 = questGetQuestId("quest/tatooine_eisley_spice_of_death"); boolean OnTask = (questIsQuestComplete(questId1, player)); return OnTask; } public boolean tatooine_eisley_begol_condition_blocker(obj_id player, obj_id npc) throws InterruptedException { return groundquests.isQuestDisabled("tatooine_eisley_spice_of_death"); } public boolean tatooine_eisley_begol_condition_tdcQuestComplete(obj_id player, obj_id npc) throws InterruptedException { int questId1 = questGetQuestId("quest/tatooine_eisley_tdc"); boolean OnTask = (questIsQuestComplete(questId1, player)); return OnTask; } public void tatooine_eisley_begol_action_facePlayer(obj_id player, obj_id npc) throws InterruptedException { faceTo(npc, player); } public void tatooine_eisley_begol_action_grantSODQuest(obj_id player, obj_id npc) throws InterruptedException { int questId = questGetQuestId("quest/tatooine_eisley_spice_of_death"); groundquests.grantQuest(questId, player, npc, true); } public int tatooine_eisley_begol_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_66")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_67"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_eisley_begol.branchId", 3); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_85")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_86"); utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_78")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_79"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_eisley_begol.branchId", 6); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_83")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_84"); utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_60")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_61"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_eisley_begol.branchId", 9); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_62")) { if (tatooine_eisley_begol_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_eisley_begol_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_64"); } utils.setScriptVar(player, "conversation.tatooine_eisley_begol.branchId", 10); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_64")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { tatooine_eisley_begol_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_24"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_26"); } utils.setScriptVar(player, "conversation.tatooine_eisley_begol.branchId", 12); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_22")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { tatooine_eisley_begol_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_24"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_26"); } utils.setScriptVar(player, "conversation.tatooine_eisley_begol.branchId", 12); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_26")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "weeping"); string_id message = new string_id(c_stringFile, "s_28"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_30"); } utils.setScriptVar(player, "conversation.tatooine_eisley_begol.branchId", 13); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_30")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_32"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (tatooine_eisley_begol_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_48"); } utils.setScriptVar(player, "conversation.tatooine_eisley_begol.branchId", 14); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_34")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_36"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_38"); } utils.setScriptVar(player, "conversation.tatooine_eisley_begol.branchId", 15); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_48")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_50"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_52"); } utils.setScriptVar(player, "conversation.tatooine_eisley_begol.branchId", 18); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_38")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_40"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_eisley_begol.branchId", 16); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_42")) { if (tatooine_eisley_begol_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_eisley_begol_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_eisley_begol.branchId", 17); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_46")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_58"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_69"); } utils.setScriptVar(player, "conversation.tatooine_eisley_begol.branchId", 20); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_52")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_54"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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.tatooine_eisley_begol.branchId", 19); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_56")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_58"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_69"); } utils.setScriptVar(player, "conversation.tatooine_eisley_begol.branchId", 20); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_69")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_71"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_eisley_begol.branchId", 21); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_73")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_75"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_80"); } utils.setScriptVar(player, "conversation.tatooine_eisley_begol.branchId", 22); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_80")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_82"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_88"); } utils.setScriptVar(player, "conversation.tatooine_eisley_begol.branchId", 23); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int tatooine_eisley_begol_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_88")) { if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { tatooine_eisley_begol_action_grantSODQuest(player, npc); string_id message = new string_id(c_stringFile, "s_90"); utils.removeScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int OnInitialize(obj_id self) throws InterruptedException { if ((!isMob(self)) || (isPlayer(self))) { detachScript(self, "conversation.tatooine_eisley_begol"); } setCondition(self, CONDITION_CONVERSABLE); setCondition(self, CONDITION_INTERESTING); setInvulnerable(self, true); setName(self, "Begol Reigle"); 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, "Begol Reigle"); 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.tatooine_eisley_begol"); 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_eisley_begol_condition_blocker(player, npc)) { string_id message = new string_id(c_stringFile, "s_91"); chat.chat(npc, player, message); return SCRIPT_CONTINUE; } if (tatooine_eisley_begol_condition_sodQuestComplete(player, npc)) { tatooine_eisley_begol_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_65"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_eisley_begol.branchId", 2); npcStartConversation(player, npc, "tatooine_eisley_begol", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (tatooine_eisley_begol_condition_sodOnTask(player, npc)) { string_id message = new string_id(c_stringFile, "s_77"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_78"); } utils.setScriptVar(player, "conversation.tatooine_eisley_begol.branchId", 5); npcStartConversation(player, npc, "tatooine_eisley_begol", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (tatooine_eisley_begol_condition_tdcQuestComplete(player, npc)) { tatooine_eisley_begol_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_59"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_60"); } utils.setScriptVar(player, "conversation.tatooine_eisley_begol.branchId", 8); npcStartConversation(player, npc, "tatooine_eisley_begol", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (tatooine_eisley_begol_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_20"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (tatooine_eisley_begol_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_22"); } utils.setScriptVar(player, "conversation.tatooine_eisley_begol.branchId", 11); npcStartConversation(player, npc, "tatooine_eisley_begol", message, responses); } else { 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("tatooine_eisley_begol")) { return SCRIPT_CONTINUE; } obj_id npc = self; int branchId = utils.getIntScriptVar(player, "conversation.tatooine_eisley_begol.branchId"); if (branchId == 2 && tatooine_eisley_begol_handleBranch2(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 3 && tatooine_eisley_begol_handleBranch3(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 5 && tatooine_eisley_begol_handleBranch5(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 6 && tatooine_eisley_begol_handleBranch6(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 8 && tatooine_eisley_begol_handleBranch8(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 9 && tatooine_eisley_begol_handleBranch9(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 10 && tatooine_eisley_begol_handleBranch10(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 11 && tatooine_eisley_begol_handleBranch11(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 12 && tatooine_eisley_begol_handleBranch12(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 13 && tatooine_eisley_begol_handleBranch13(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 14 && tatooine_eisley_begol_handleBranch14(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 15 && tatooine_eisley_begol_handleBranch15(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 16 && tatooine_eisley_begol_handleBranch16(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 17 && tatooine_eisley_begol_handleBranch17(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 18 && tatooine_eisley_begol_handleBranch18(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 19 && tatooine_eisley_begol_handleBranch19(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 20 && tatooine_eisley_begol_handleBranch20(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 21 && tatooine_eisley_begol_handleBranch21(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 22 && tatooine_eisley_begol_handleBranch22(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 23 && tatooine_eisley_begol_handleBranch23(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_eisley_begol.branchId"); return SCRIPT_CONTINUE; } }