package script.conversation; import script.*; import script.base_class.*; import script.combat_engine.*; import java.util.Arrays; import java.util.Hashtable; import java.util.Vector; import script.base_script; import script.library.ai_lib; import script.library.chat; import script.library.conversation; import script.library.groundquests; import script.library.space_quest; import script.library.utils; public class orion_rank3 extends script.base_script { public orion_rank3() { } public static String c_stringFile = "conversation/orion_rank3"; public boolean orion_rank3_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException { return true; } public boolean orion_rank3_condition_isOrionAligned(obj_id player, obj_id npc) throws InterruptedException { return hasCompletedCollectionSlot(player, "orion_rank_01_03"); } public boolean orion_rank3_condition_onQuest_01(obj_id player, obj_id npc) throws InterruptedException { return (groundquests.isQuestActive(player, "orion_rank3_01") && !groundquests.isTaskActive(player, "orion_rank3_01", "wait_01")); } public boolean orion_rank3_condition_winQuest_01(obj_id player, obj_id npc) throws InterruptedException { return (groundquests.isTaskActive(player, "orion_rank3_01", "wait_01") || groundquests.hasCompletedQuest(player, "orion_rank3_01")); } public boolean orion_rank3_condition_onQuest_02(obj_id player, obj_id npc) throws InterruptedException { return (groundquests.isQuestActive(player, "orion_rank3_02") && !groundquests.isTaskActive(player, "orion_rank3_02", "wait_01")); } public boolean orion_rank3_condition_winQuest_02(obj_id player, obj_id npc) throws InterruptedException { return (groundquests.isTaskActive(player, "orion_rank3_02", "wait_01") || groundquests.hasCompletedQuest(player, "orion_rank3_02")); } public boolean orion_rank3_condition_onQuest_03(obj_id player, obj_id npc) throws InterruptedException { return (groundquests.isQuestActive(player, "orion_rank3_03") && !groundquests.isTaskActive(player, "orion_rank3_03", "wait_01")); } public boolean orion_rank3_condition_winQuest_03(obj_id player, obj_id npc) throws InterruptedException { return (groundquests.isTaskActive(player, "orion_rank3_03", "wait_01") || groundquests.hasCompletedQuest(player, "orion_rank3_03")); } public boolean orion_rank3_condition_onQuest_04(obj_id player, obj_id npc) throws InterruptedException { return (groundquests.isQuestActive(player, "orion_rank3_04") && !groundquests.isTaskActive(player, "orion_rank3_04", "wait_01")); } public boolean orion_rank3_condition_winQuest_04(obj_id player, obj_id npc) throws InterruptedException { return (groundquests.isTaskActive(player, "orion_rank3_04", "wait_01")); } public boolean orion_rank3_condition_finishedAll(obj_id player, obj_id npc) throws InterruptedException { return groundquests.hasCompletedQuest(player, "orion_rank3_04"); } public void orion_rank3_action_grantQuest_01(obj_id player, obj_id npc) throws InterruptedException { groundquests.grantQuest(player, "orion_rank3_01"); } public void orion_rank3_action_clearRegrant_01(obj_id player, obj_id npc) throws InterruptedException { groundquests.clearQuest(player, "orion_rank3_01"); space_quest.clearQuestFlags(player, "patrol", "orion_rank3_03"); space_quest.clearQuestFlags(player, "survival", "orion_rank3_01"); groundquests.grantQuest(player, "orion_rank3_01"); } public void orion_rank3_action_sendQuestSignal_01(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "orion_rank3_01"); } public void orion_rank3_action_grantQuest_02(obj_id player, obj_id npc) throws InterruptedException { groundquests.grantQuest(player, "orion_rank3_02"); } public void orion_rank3_action_sendQuestSignal_02(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "orion_rank3_03"); } public void orion_rank3_action_clearRegrant_02(obj_id player, obj_id npc) throws InterruptedException { groundquests.clearQuest(player, "orion_rank3_02"); space_quest.clearQuestFlags(player, "patrol", "orion_rank3_04"); space_quest.clearQuestFlags(player, "recovery", "orion_rank3_01"); groundquests.grantQuest(player, "orion_rank3_02"); } public void orion_rank3_action_grantQuest_03(obj_id player, obj_id npc) throws InterruptedException { groundquests.grantQuest(player, "orion_rank3_03"); } public void orion_rank3_action_clearRegrant_03(obj_id player, obj_id npc) throws InterruptedException { groundquests.clearQuest(player, "orion_rank3_03"); space_quest.clearQuestFlags(player, "patrol", "orion_rank3_01"); space_quest.clearQuestFlags(player, "rescue", "orion_rank3_01"); groundquests.grantQuest(player, "orion_rank3_03"); } public void orion_rank3_action_sendQuestSignal_03(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "orion_rank3_04"); } public void orion_rank3_action_grantQuest_04(obj_id player, obj_id npc) throws InterruptedException { groundquests.grantQuest(player, "orion_rank3_04"); } public void orion_rank3_action_clearRegrant_04(obj_id player, obj_id npc) throws InterruptedException { groundquests.clearQuest(player, "orion_rank3_04"); space_quest.clearQuestFlags(player, "patrol", "orion_rank3_05"); space_quest.clearQuestFlags(player, "destroy_surpriseattack", "orion_rank3_01"); groundquests.grantQuest(player, "orion_rank3_04"); } public void orion_rank3_action_sendQuestSignal_04(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "orion_rank3_05"); } public int orion_rank3_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_56")) { orion_rank3_action_sendQuestSignal_04(player, npc); if (orion_rank3_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_57"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_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_58"); } utils.setScriptVar(player, "conversation.orion_rank3.branchId", 3); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_58")) { if (orion_rank3_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_59"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_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.orion_rank3.branchId", 4); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_60")) { if (orion_rank3_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_61"); utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_52")) { if (orion_rank3_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_54"); utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } if (response.equals("s_53")) { if (orion_rank3_condition__defaultCondition(player, npc)) { orion_rank3_action_clearRegrant_04(player, npc); string_id message = new string_id(c_stringFile, "s_55"); utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_48")) { orion_rank3_action_sendQuestSignal_03(player, npc); if (orion_rank3_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_49"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_50"); } utils.setScriptVar(player, "conversation.orion_rank3.branchId", 10); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_50")) { if (orion_rank3_condition__defaultCondition(player, npc)) { orion_rank3_action_grantQuest_04(player, npc); string_id message = new string_id(c_stringFile, "s_51"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_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_113"); } utils.setScriptVar(player, "conversation.orion_rank3.branchId", 11); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_113")) { if (orion_rank3_condition__defaultCondition(player, npc)) { orion_rank3_action_grantQuest_04(player, npc); string_id message = new string_id(c_stringFile, "s_114"); utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_44")) { if (orion_rank3_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_46"); utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } if (response.equals("s_45")) { if (orion_rank3_condition__defaultCondition(player, npc)) { orion_rank3_action_clearRegrant_03(player, npc); string_id message = new string_id(c_stringFile, "s_47"); utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_38")) { orion_rank3_action_sendQuestSignal_02(player, npc); if (orion_rank3_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_39"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_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_40"); } utils.setScriptVar(player, "conversation.orion_rank3.branchId", 17); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_40")) { if (orion_rank3_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_42"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_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.orion_rank3.branchId", 18); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_62")) { if (orion_rank3_condition__defaultCondition(player, npc)) { orion_rank3_action_grantQuest_03(player, npc); string_id message = new string_id(c_stringFile, "s_64"); utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_68")) { if (orion_rank3_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_70"); utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } if (response.equals("s_72")) { if (orion_rank3_condition__defaultCondition(player, npc)) { orion_rank3_action_clearRegrant_02(player, npc); string_id message = new string_id(c_stringFile, "s_74"); utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_78")) { orion_rank3_action_sendQuestSignal_01(player, npc); if (orion_rank3_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_80"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_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_82"); } utils.setScriptVar(player, "conversation.orion_rank3.branchId", 24); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_82")) { if (orion_rank3_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_84"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_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_86"); } utils.setScriptVar(player, "conversation.orion_rank3.branchId", 25); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_86")) { if (orion_rank3_condition__defaultCondition(player, npc)) { orion_rank3_action_grantQuest_02(player, npc); string_id message = new string_id(c_stringFile, "s_88"); utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_92")) { if (orion_rank3_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_94"); utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } if (response.equals("s_96")) { if (orion_rank3_condition__defaultCondition(player, npc)) { orion_rank3_action_clearRegrant_01(player, npc); string_id message = new string_id(c_stringFile, "s_98"); utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch30(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_102")) { if (orion_rank3_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_104"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_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.orion_rank3.branchId", 31); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_106")) { if (orion_rank3_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_108"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_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_110"); } utils.setScriptVar(player, "conversation.orion_rank3.branchId", 32); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int orion_rank3_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_110")) { if (orion_rank3_condition__defaultCondition(player, npc)) { orion_rank3_action_grantQuest_01(player, npc); string_id message = new string_id(c_stringFile, "s_112"); utils.removeScriptVar(player, "conversation.orion_rank3.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.orion_rank3"); } 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.orion_rank3"); 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 (orion_rank3_condition_finishedAll(player, npc)) { string_id message = new string_id(c_stringFile, "s_7"); chat.chat(npc, player, message); return SCRIPT_CONTINUE; } if (orion_rank3_condition_winQuest_04(player, npc)) { string_id message = new string_id(c_stringFile, "s_8"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_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.orion_rank3.branchId", 2); npcStartConversation(player, npc, "orion_rank3", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (orion_rank3_condition_onQuest_04(player, npc)) { string_id message = new string_id(c_stringFile, "s_14"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (orion_rank3_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_52"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_53"); } utils.setScriptVar(player, "conversation.orion_rank3.branchId", 6); npcStartConversation(player, npc, "orion_rank3", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (orion_rank3_condition_winQuest_03(player, npc)) { string_id message = new string_id(c_stringFile, "s_20"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_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_48"); } utils.setScriptVar(player, "conversation.orion_rank3.branchId", 9); npcStartConversation(player, npc, "orion_rank3", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (orion_rank3_condition_onQuest_03(player, npc)) { string_id message = new string_id(c_stringFile, "s_28"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (orion_rank3_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_44"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_45"); } utils.setScriptVar(player, "conversation.orion_rank3.branchId", 13); npcStartConversation(player, npc, "orion_rank3", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (orion_rank3_condition_winQuest_02(player, npc)) { string_id message = new string_id(c_stringFile, "s_34"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_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.orion_rank3.branchId", 16); npcStartConversation(player, npc, "orion_rank3", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (orion_rank3_condition_onQuest_02(player, npc)) { string_id message = new string_id(c_stringFile, "s_66"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (orion_rank3_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_68"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_72"); } utils.setScriptVar(player, "conversation.orion_rank3.branchId", 20); npcStartConversation(player, npc, "orion_rank3", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (orion_rank3_condition_winQuest_01(player, npc)) { string_id message = new string_id(c_stringFile, "s_76"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_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.orion_rank3.branchId", 23); npcStartConversation(player, npc, "orion_rank3", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (orion_rank3_condition_onQuest_01(player, npc)) { string_id message = new string_id(c_stringFile, "s_90"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (orion_rank3_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_92"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_96"); } utils.setScriptVar(player, "conversation.orion_rank3.branchId", 27); npcStartConversation(player, npc, "orion_rank3", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (orion_rank3_condition_isOrionAligned(player, npc)) { string_id message = new string_id(c_stringFile, "s_100"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (orion_rank3_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_102"); } utils.setScriptVar(player, "conversation.orion_rank3.branchId", 30); npcStartConversation(player, npc, "orion_rank3", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (orion_rank3_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_116"); 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("orion_rank3")) { return SCRIPT_CONTINUE; } obj_id npc = self; int branchId = utils.getIntScriptVar(player, "conversation.orion_rank3.branchId"); if (branchId == 2 && orion_rank3_handleBranch2(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 3 && orion_rank3_handleBranch3(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 4 && orion_rank3_handleBranch4(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 6 && orion_rank3_handleBranch6(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 9 && orion_rank3_handleBranch9(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 10 && orion_rank3_handleBranch10(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 11 && orion_rank3_handleBranch11(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 13 && orion_rank3_handleBranch13(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 16 && orion_rank3_handleBranch16(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 17 && orion_rank3_handleBranch17(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 18 && orion_rank3_handleBranch18(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 20 && orion_rank3_handleBranch20(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 23 && orion_rank3_handleBranch23(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 24 && orion_rank3_handleBranch24(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 25 && orion_rank3_handleBranch25(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 27 && orion_rank3_handleBranch27(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 30 && orion_rank3_handleBranch30(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 31 && orion_rank3_handleBranch31(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 32 && orion_rank3_handleBranch32(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); utils.removeScriptVar(player, "conversation.orion_rank3.branchId"); return SCRIPT_CONTINUE; } }