package script.conversation; import script.library.*; import script.*; public class npe_pilot_medium extends script.base_script { public npe_pilot_medium() { } public static String c_stringFile = "conversation/npe_pilot_medium"; public boolean npe_pilot_medium_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException { return true; } public boolean npe_pilot_medium_condition_hasCompletedEasy(obj_id player, obj_id npc) throws InterruptedException { return groundquests.hasCompletedQuest(player, "npe_pilot_easy_4"); } public boolean npe_pilot_medium_condition_isOnMission(obj_id player, obj_id npc) throws InterruptedException { return (groundquests.isTaskActive(player, "npe_pilot_medium_1", "launch") || groundquests.isTaskActive(player, "npe_pilot_medium_1", "onSpaceQuest") || groundquests.isTaskActive(player, "npe_pilot_medium_2", "launch") || groundquests.isTaskActive(player, "npe_pilot_medium_2", "onSpaceQuest") || groundquests.isTaskActive(player, "npe_pilot_medium_3", "launch") || groundquests.isTaskActive(player, "npe_pilot_medium_3", "onSpaceQuest") || groundquests.isTaskActive(player, "npe_pilot_medium_4", "launch") || groundquests.isTaskActive(player, "npe_pilot_medium_4", "onSpaceQuest")); } public boolean npe_pilot_medium_condition_startedHard(obj_id player, obj_id npc) throws InterruptedException { return groundquests.isQuestActiveOrComplete(player, "npe_pilot_hard_1"); } public boolean npe_pilot_medium_condition_hasFailedMedMission1(obj_id player, obj_id npc) throws InterruptedException { return groundquests.isTaskActive(player, "npe_pilot_medium_1", "failedMed1"); } public boolean npe_pilot_medium_condition_hasWonMedMission1(obj_id player, obj_id npc) throws InterruptedException { return (groundquests.hasCompletedQuest(player, "npe_pilot_medium_1") || groundquests.isTaskActive(player, "npe_pilot_medium_1", "report")); } public boolean npe_pilot_medium_condition_hasFailedMedMission2(obj_id player, obj_id npc) throws InterruptedException { return groundquests.isTaskActive(player, "npe_pilot_medium_2", "failedMed2"); } public boolean npe_pilot_medium_condition_hasWonMedMission2(obj_id player, obj_id npc) throws InterruptedException { return (groundquests.hasCompletedQuest(player, "npe_pilot_medium_2") || groundquests.isTaskActive(player, "npe_pilot_medium_2", "report")); } public boolean npe_pilot_medium_condition_hasWonMedMission3(obj_id player, obj_id npc) throws InterruptedException { return (groundquests.hasCompletedQuest(player, "npe_pilot_medium_3") || groundquests.isTaskActive(player, "npe_pilot_medium_3", "report")); } public boolean npe_pilot_medium_condition_hasFailedMedMission3(obj_id player, obj_id npc) throws InterruptedException { return groundquests.isTaskActive(player, "npe_pilot_medium_3", "failedMed3"); } public boolean npe_pilot_medium_condition_hasFailedMedMission4(obj_id player, obj_id npc) throws InterruptedException { return groundquests.isTaskActive(player, "npe_pilot_medium_4", "failedMed4"); } public boolean npe_pilot_medium_condition_hasWonMedMission4(obj_id player, obj_id npc) throws InterruptedException { return (groundquests.hasCompletedQuest(player, "npe_pilot_medium_4") || groundquests.isTaskActive(player, "npe_pilot_medium_4", "report")); } public void npe_pilot_medium_action_grantReward1(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "reported"); } public void npe_pilot_medium_action_grantReward2(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "reported"); } public void npe_pilot_medium_action_grantReward3(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "reported"); } public void npe_pilot_medium_action_grantReward4(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "reported"); } public void npe_pilot_medium_action_grantMedMission2(obj_id player, obj_id npc) throws InterruptedException { space_quest.clearQuestFlags(player, "recovery", "npe_med_main_2"); space_quest.clearQuestFlags(player, "rescue", "npe_med_main_2a"); space_quest.clearQuestFlags(player, "patrol", "npe_med_main_2b"); space_quest.clearQuestFlags(player, "destroy_surpriseattack", "npe_med_main_2c"); space_quest.clearQuestFlags(player, "patrol", "npe_med_main_2d"); groundquests.clearQuest(player, "npe_pilot_medium_2"); groundquests.grantQuest(player, "npe_pilot_medium_2"); } public void npe_pilot_medium_action_grantMedMission1(obj_id player, obj_id npc) throws InterruptedException { space_quest.clearQuestFlags(player, "patrol", "npe_med_main_1"); space_quest.clearQuestFlags(player, "destroy", "npe_med_main_1a"); space_quest.clearQuestFlags(player, "patrol", "npe_med_main_1b"); groundquests.clearQuest(player, "npe_pilot_medium_1"); groundquests.grantQuest(player, "npe_pilot_medium_1"); } public void npe_pilot_medium_action_grantMedMission3(obj_id player, obj_id npc) throws InterruptedException { space_quest.clearQuestFlags(player, "destroy", "npe_med_main_3"); space_quest.clearQuestFlags(player, "rescue", "npe_med_main_3a"); space_quest.clearQuestFlags(player, "escort", "npe_med_main_3b"); space_quest.clearQuestFlags(player, "patrol", "npe_med_main_3c"); groundquests.clearQuest(player, "npe_pilot_medium_3"); groundquests.grantQuest(player, "npe_pilot_medium_3"); } public void npe_pilot_medium_action_PlayEffects(obj_id player, obj_id npc) throws InterruptedException { playClientEffectLoc(player, "clienteffect/int_camshake_heavy.cef", getLocation(player), 0); playClientEffectObj(player, "sound/exp_big_2.snd", player, ""); } public void npe_pilot_medium_action_grantMedMission4(obj_id player, obj_id npc) throws InterruptedException { space_quest.clearQuestFlags(player, "destroy", "npe_med_main_4"); space_quest.clearQuestFlags(player, "destroy_surpriseattack", "npe_med_main_4a"); space_quest.clearQuestFlags(player, "destroy_surpriseattack", "npe_med_main_4b"); space_quest.clearQuestFlags(player, "patrol", "npe_med_main_4c"); groundquests.clearQuest(player, "npe_pilot_medium_4"); groundquests.grantQuest(player, "npe_pilot_medium_4"); } public void npe_pilot_medium_action_signalFoundAleas(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "talktome"); } public void npe_pilot_medium_action_facePlayer(obj_id player, obj_id npc) throws InterruptedException { faceTo(npc, player); } public void npe_pilot_medium_action_sendToDartas(obj_id player, obj_id npc) throws InterruptedException { groundquests.grantQuest(player, "npe_pilot_dartas"); } public int npe_pilot_medium_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_100")) { npe_pilot_medium_action_grantReward4(player, npc); if (npe_pilot_medium_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_263"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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.npe_pilot_medium.branchId", 4); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_80")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_81"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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.npe_pilot_medium.branchId", 6); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_101")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { npe_pilot_medium_action_sendToDartas(player, npc); string_id message = new string_id(c_stringFile, "s_102"); utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_82")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_83"); utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_256")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "shrug_shoulders"); string_id message = new string_id(c_stringFile, "s_257"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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_258"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 9); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_258")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { npe_pilot_medium_action_grantMedMission4(player, npc); string_id message = new string_id(c_stringFile, "s_259"); utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_89")) { npe_pilot_medium_action_grantReward3(player, npc); if (npe_pilot_medium_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_90"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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.npe_pilot_medium.branchId", 12); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_91")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { npe_pilot_medium_action_PlayEffects(player, npc); string_id message = new string_id(c_stringFile, "s_92"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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_93"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 13); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_93")) { npe_pilot_medium_action_grantMedMission4(player, npc); if (npe_pilot_medium_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_94"); utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_248")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_249"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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_250"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 16); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_250")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { npe_pilot_medium_action_grantMedMission3(player, npc); string_id message = new string_id(c_stringFile, "s_251"); utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_77")) { npe_pilot_medium_action_grantReward2(player, npc); if (npe_pilot_medium_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_78"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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.npe_pilot_medium.branchId", 19); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_79")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_115"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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_117"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 20); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_117")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { npe_pilot_medium_action_grantMedMission3(player, npc); string_id message = new string_id(c_stringFile, "s_119"); utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_242")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_243"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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_244"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 23); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_244")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { npe_pilot_medium_action_grantMedMission2(player, npc); string_id message = new string_id(c_stringFile, "s_245"); utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_68")) { npe_pilot_medium_action_grantReward1(player, npc); if (npe_pilot_medium_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_69"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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_70"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 26); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch26(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_70")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { npe_pilot_medium_action_grantMedMission2(player, npc); string_id message = new string_id(c_stringFile, "s_71"); utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch28(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_236")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_237"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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_238"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 29); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_238")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "wave_on_dismissing"); npe_pilot_medium_action_grantMedMission1(player, npc); string_id message = new string_id(c_stringFile, "s_239"); utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int npe_pilot_medium_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_126")) { npe_pilot_medium_action_signalFoundAleas(player, npc); if (npe_pilot_medium_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_128"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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_130"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 32); 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.npe_pilot_medium.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 npe_pilot_medium_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_130")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_132"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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_134"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 33); 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.npe_pilot_medium.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 npe_pilot_medium_handleBranch33(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_134")) { if (npe_pilot_medium_condition__defaultCondition(player, npc)) { npe_pilot_medium_action_grantMedMission1(player, npc); string_id message = new string_id(c_stringFile, "s_136"); utils.removeScriptVar(player, "conversation.npe_pilot_medium.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int OnInitialize(obj_id self) throws InterruptedException { if ((!isMob(self)) || (isPlayer(self))) { detachScript(self, "conversation.npe_pilot_medium"); } setCondition(self, CONDITION_CONVERSABLE); setInvulnerable(self, true); setName(self, "Aleas Rans'ery (Ace Car'das Pilot)"); return SCRIPT_CONTINUE; } public int OnAttach(obj_id self) throws InterruptedException { setCondition(self, CONDITION_CONVERSABLE); setInvulnerable(self, true); setName(self, "Aleas Rans'ery (Ace Car'das Pilot)"); 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.npe_pilot_medium"); 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 (npe_pilot_medium_condition_startedHard(player, npc)) { string_id message = new string_id(c_stringFile, "s_60"); chat.chat(npc, player, message); return SCRIPT_CONTINUE; } if (npe_pilot_medium_condition_isOnMission(player, npc)) { npe_pilot_medium_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_235"); chat.chat(npc, player, message); return SCRIPT_CONTINUE; } if (npe_pilot_medium_condition_hasWonMedMission4(player, npc)) { npe_pilot_medium_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_97"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (npe_pilot_medium_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_100"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_80"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 3); npcStartConversation(player, npc, "npe_pilot_medium", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (npe_pilot_medium_condition_hasFailedMedMission4(player, npc)) { npe_pilot_medium_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_96"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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_256"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 8); npcStartConversation(player, npc, "npe_pilot_medium", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (npe_pilot_medium_condition_hasWonMedMission3(player, npc)) { npe_pilot_medium_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_87"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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.npe_pilot_medium.branchId", 11); npcStartConversation(player, npc, "npe_pilot_medium", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (npe_pilot_medium_condition_hasFailedMedMission3(player, npc)) { npe_pilot_medium_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_88"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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_248"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 15); npcStartConversation(player, npc, "npe_pilot_medium", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (npe_pilot_medium_condition_hasWonMedMission2(player, npc)) { npe_pilot_medium_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_75"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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.npe_pilot_medium.branchId", 18); npcStartConversation(player, npc, "npe_pilot_medium", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (npe_pilot_medium_condition_hasFailedMedMission2(player, npc)) { npe_pilot_medium_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_74"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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_242"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 22); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); npcStartConversation(player, npc, "npe_pilot_medium", 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 (npe_pilot_medium_condition_hasWonMedMission1(player, npc)) { npe_pilot_medium_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_66"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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_68"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 25); npcStartConversation(player, npc, "npe_pilot_medium", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (npe_pilot_medium_condition_hasFailedMedMission1(player, npc)) { npe_pilot_medium_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_103"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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_236"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 28); npcStartConversation(player, npc, "npe_pilot_medium", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (npe_pilot_medium_condition_hasCompletedEasy(player, npc)) { npe_pilot_medium_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_190"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (npe_pilot_medium_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_126"); } utils.setScriptVar(player, "conversation.npe_pilot_medium.branchId", 31); npcStartConversation(player, npc, "npe_pilot_medium", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (npe_pilot_medium_condition__defaultCondition(player, npc)) { npe_pilot_medium_action_facePlayer(player, npc); string_id message = new string_id(c_stringFile, "s_120"); 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("npe_pilot_medium")) { return SCRIPT_CONTINUE; } obj_id npc = self; int branchId = utils.getIntScriptVar(player, "conversation.npe_pilot_medium.branchId"); if (branchId == 3 && npe_pilot_medium_handleBranch3(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 4 && npe_pilot_medium_handleBranch4(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 6 && npe_pilot_medium_handleBranch6(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 8 && npe_pilot_medium_handleBranch8(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 9 && npe_pilot_medium_handleBranch9(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 11 && npe_pilot_medium_handleBranch11(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 12 && npe_pilot_medium_handleBranch12(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 13 && npe_pilot_medium_handleBranch13(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 15 && npe_pilot_medium_handleBranch15(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 16 && npe_pilot_medium_handleBranch16(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 18 && npe_pilot_medium_handleBranch18(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 19 && npe_pilot_medium_handleBranch19(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 20 && npe_pilot_medium_handleBranch20(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 22 && npe_pilot_medium_handleBranch22(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 23 && npe_pilot_medium_handleBranch23(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 25 && npe_pilot_medium_handleBranch25(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 26 && npe_pilot_medium_handleBranch26(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 28 && npe_pilot_medium_handleBranch28(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 29 && npe_pilot_medium_handleBranch29(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 31 && npe_pilot_medium_handleBranch31(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 32 && npe_pilot_medium_handleBranch32(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 33 && npe_pilot_medium_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.npe_pilot_medium.branchId"); return SCRIPT_CONTINUE; } }