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.space_combat; import script.library.space_transition; import script.library.utils; public class ep3_civilian_pilot extends script.base_script { public ep3_civilian_pilot() { } public static String c_stringFile = "conversation/ep3_civilian_pilot"; public boolean ep3_civilian_pilot_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException { return true; } public boolean ep3_civilian_pilot_condition_isTooFar(obj_id player, obj_id npc) throws InterruptedException { obj_id containingShip = space_transition.getContainingShip(player); return (getDistance(npc, containingShip) > space_transition.STATION_COMM_MAX_DISTANCE); } public void ep3_civilian_pilot_action_playCommSound(obj_id player, obj_id npc) throws InterruptedException { space_combat.playCombatTauntSound(player); } public int ep3_civilian_pilot_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_4")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_9"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_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.ep3_civilian_pilot.branchId", 3); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_5")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_8"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_civilian_pilot_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_14"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_15"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 10); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_6")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_7"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_civilian_pilot_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_10"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_11"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 21); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_58")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_61"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_civilian_pilot_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_64"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_65"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 4); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_64")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_66"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_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.ep3_civilian_pilot.branchId", 5); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_65")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_67"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_civilian_pilot_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_75"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_76"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 7); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_69")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_73"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_75")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_78"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } if (response.equals("s_76")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_77"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_14")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_41"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_civilian_pilot_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_46"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_47"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 11); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_15")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_40"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_civilian_pilot_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_42"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_43"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 18); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_46")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_49"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_civilian_pilot_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_50"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_51"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 12); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_47")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_48"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_50")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_53"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } if (response.equals("s_51")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_52"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_civilian_pilot_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_54"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_55"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 14); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_54")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_57"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } if (response.equals("s_55")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_56"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_42")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_45"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); prose_package pp = new prose_package(); pp.stringId = message; pp.actor.set(player); pp.target.set(npc); chat.chat(npc, player, pp); npcEndConversation(player); return SCRIPT_CONTINUE; } } if (response.equals("s_43")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_44"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_10")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_13"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_civilian_pilot_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_16"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_17"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 22); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_11")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_12"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_civilian_pilot_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_28"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_29"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 29); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_16")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_18"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } if (response.equals("s_17")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_19"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_civilian_pilot_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_20"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_21"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 24); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_20")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_24"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_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_25"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 25); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_21")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_22"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_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_23"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 27); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_25")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_26"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_23")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_27"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_28")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_30"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } if (response.equals("s_29")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_31"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_civilian_pilot_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_32"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_33"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 31); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_32")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_35"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_36"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_37"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 32); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_33")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_34"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_civilian_pilot_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_36")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_39"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } if (response.equals("s_37")) { if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_38"); utils.removeScriptVar(player, "conversation.ep3_civilian_pilot.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.ep3_civilian_pilot"); } 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.ep3_civilian_pilot"); 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 (ep3_civilian_pilot_condition_isTooFar(player, npc)) { string_id message = new string_id(c_stringFile, "s_185"); chat.chat(npc, player, message); return SCRIPT_CONTINUE; } if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_86"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (ep3_civilian_pilot_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses[] = new string_id[numberOfResponses]; if (hasResponse0) { responses[responseIndex++] = new string_id(c_stringFile, "s_4"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_5"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_6"); } utils.setScriptVar(player, "conversation.ep3_civilian_pilot.branchId", 2); npcStartConversation(player, npc, "ep3_civilian_pilot", 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("ep3_civilian_pilot")) { return SCRIPT_CONTINUE; } obj_id npc = self; int branchId = utils.getIntScriptVar(player, "conversation.ep3_civilian_pilot.branchId"); if (branchId == 2 && ep3_civilian_pilot_handleBranch2(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 3 && ep3_civilian_pilot_handleBranch3(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 4 && ep3_civilian_pilot_handleBranch4(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 5 && ep3_civilian_pilot_handleBranch5(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 7 && ep3_civilian_pilot_handleBranch7(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 10 && ep3_civilian_pilot_handleBranch10(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 11 && ep3_civilian_pilot_handleBranch11(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 12 && ep3_civilian_pilot_handleBranch12(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 14 && ep3_civilian_pilot_handleBranch14(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 18 && ep3_civilian_pilot_handleBranch18(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 21 && ep3_civilian_pilot_handleBranch21(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 22 && ep3_civilian_pilot_handleBranch22(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 24 && ep3_civilian_pilot_handleBranch24(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 25 && ep3_civilian_pilot_handleBranch25(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 27 && ep3_civilian_pilot_handleBranch27(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 29 && ep3_civilian_pilot_handleBranch29(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 31 && ep3_civilian_pilot_handleBranch31(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 32 && ep3_civilian_pilot_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.ep3_civilian_pilot.branchId"); return SCRIPT_CONTINUE; } }