package script.conversation; import script.library.*; import script.*; public class rebel_broker extends script.base_script { public rebel_broker() { } public static String c_stringFile = "conversation/rebel_broker"; public boolean rebel_broker_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException { return true; } public boolean rebel_broker_condition_isImperialFaction(obj_id player, obj_id npc) throws InterruptedException { String factionName = factions.getFaction(player); if (factionName == null || factionName.equals("")) { return false; } else { return (factionName.equals(factions.FACTION_IMPERIAL)); } } public boolean rebel_broker_condition_wasBrushedOff(obj_id player, obj_id npc) throws InterruptedException { return utils.hasScriptVar(player, "rebelBroker.brushoff"); } public boolean rebel_broker_condition_isRebelPilot(obj_id player, obj_id npc) throws InterruptedException { return space_skill.hasRebelSkill(player); } public boolean rebel_broker_condition_isPilot(obj_id player, obj_id npc) throws InterruptedException { return space_skill.hasSpaceSkills(player); } public boolean rebel_broker_condition_hasSpaceExp(obj_id player, obj_id npc) throws InterruptedException { return features.isSpaceEdition(player); } public void rebel_broker_action_brushedOffImp(obj_id player, obj_id npc) throws InterruptedException { utils.setScriptVar(player, "rebelBroker.brushoff", true); } public void rebel_broker_action_addNabooWaypoint(obj_id player, obj_id npc) throws InterruptedException { trainerlocs.getTrainerLocationWaypoint(player, "rebel", "naboo"); } public void rebel_broker_action_addCorellianWaypoint(obj_id player, obj_id npc) throws InterruptedException { trainerlocs.getTrainerLocationWaypoint(player, "rebel", "corellia"); } public void rebel_broker_action_addTatooineWaypoint(obj_id player, obj_id npc) throws InterruptedException { trainerlocs.getTrainerLocationWaypoint(player, "rebel", "tatooine"); } public void rebel_broker_action_retireSkill(obj_id player, obj_id npc) throws InterruptedException { space_skill.retire(player, space_skill.REBEL); } public int rebel_broker_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_fc2710b9")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "rub_chin_thoughtful"); string_id message = new string_id(c_stringFile, "s_b42be0ca"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_658b5a75"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_697a1143"); } setObjVar(player, "conversation.rebel_broker.branchId", 3); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_3fd213c")) { if (rebel_broker_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_7671cbe2"); removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_658b5a75")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "nod_head_once"); string_id message = new string_id(c_stringFile, "s_c3bfda20"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_f72f24be"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_697a1143"); } setObjVar(player, "conversation.rebel_broker.branchId", 4); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_697a1143")) { if (rebel_broker_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_568d0bc"); removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_f72f24be")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "sigh_deeply"); rebel_broker_action_retireSkill(player, npc); string_id message = new string_id(c_stringFile, "s_6ed0d2aa"); removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } if (response.equals("s_697a1143")) { if (rebel_broker_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_568d0bc"); removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_d70dba34")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "yawn"); string_id message = new string_id(c_stringFile, "s_ef21d878"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_c2a4c0b1"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_169df3bb"); } setObjVar(player, "conversation.rebel_broker.branchId", 11); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_4c695dbd")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "wave2"); string_id message = new string_id(c_stringFile, "s_d6b3d709"); removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_c2a4c0b1")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "shake_head_no"); string_id message = new string_id(c_stringFile, "s_5af29bb7"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_895d093"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_c4d665ba"); } setObjVar(player, "conversation.rebel_broker.branchId", 12); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_169df3bb")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "wave2"); string_id message = new string_id(c_stringFile, "s_d6b3d709"); removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_895d093")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "wave2"); string_id message = new string_id(c_stringFile, "s_d6b3d709"); removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } if (response.equals("s_c4d665ba")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "slow_down"); string_id message = new string_id(c_stringFile, "s_1c0a2eb0"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_50f22f35"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_dbb2bd71"); } setObjVar(player, "conversation.rebel_broker.branchId", 13); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_50f22f35")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "wave2"); string_id message = new string_id(c_stringFile, "s_d6b3d709"); removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } if (response.equals("s_dbb2bd71")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "point_accusingly"); string_id message = new string_id(c_stringFile, "s_28a5ab46"); removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_ca776e30")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "point_to_self"); string_id message = new string_id(c_stringFile, "s_8a4e6549"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_e81a1436"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_169df3bb"); } setObjVar(player, "conversation.rebel_broker.branchId", 18); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_e81a1436")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "nod_head_multiple"); string_id message = new string_id(c_stringFile, "s_1adbb986"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_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_c0dd7feb"); } setObjVar(player, "conversation.rebel_broker.branchId", 19); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_169df3bb")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "wave2"); string_id message = new string_id(c_stringFile, "s_d6b3d709"); removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_c0dd7feb")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "snap_finger2"); string_id message = new string_id(c_stringFile, "s_3bde39e1"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (rebel_broker_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_63cd6ccb"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_d15ec255"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_6491bb19"); } setObjVar(player, "conversation.rebel_broker.branchId", 20); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_63cd6ccb")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "pound_fist_palm"); string_id message = new string_id(c_stringFile, "s_3714bdfe"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_159911f5"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_70f18874"); } setObjVar(player, "conversation.rebel_broker.branchId", 21); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_d15ec255")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "explain"); string_id message = new string_id(c_stringFile, "s_98a75031"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_159911f5"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_70f18874"); } setObjVar(player, "conversation.rebel_broker.branchId", 24); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_6491bb19")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "shake_head_disgust"); string_id message = new string_id(c_stringFile, "s_80d99409"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_159911f5"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_70f18874"); } setObjVar(player, "conversation.rebel_broker.branchId", 27); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_159911f5")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "wave_finger_warning"); rebel_broker_action_addNabooWaypoint(player, npc); string_id message = new string_id(c_stringFile, "s_c0ca92b1"); removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } if (response.equals("s_70f18874")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "shake_head_disgust"); string_id message = new string_id(c_stringFile, "s_84d6bcaa"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (rebel_broker_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_63cd6ccb"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_d15ec255"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_6491bb19"); } setObjVar(player, "conversation.rebel_broker.branchId", 20); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_63cd6ccb")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "pound_fist_palm"); string_id message = new string_id(c_stringFile, "s_3714bdfe"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_159911f5"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_70f18874"); } setObjVar(player, "conversation.rebel_broker.branchId", 21); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_d15ec255")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "explain"); string_id message = new string_id(c_stringFile, "s_98a75031"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_159911f5"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_70f18874"); } setObjVar(player, "conversation.rebel_broker.branchId", 24); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_6491bb19")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "shake_head_disgust"); string_id message = new string_id(c_stringFile, "s_80d99409"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_159911f5"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_70f18874"); } setObjVar(player, "conversation.rebel_broker.branchId", 27); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_159911f5")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "point_away"); rebel_broker_action_addCorellianWaypoint(player, npc); string_id message = new string_id(c_stringFile, "s_31bc521f"); removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } if (response.equals("s_70f18874")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "shrug_hands"); string_id message = new string_id(c_stringFile, "s_18dad60e"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (rebel_broker_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_63cd6ccb"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_d15ec255"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_6491bb19"); } setObjVar(player, "conversation.rebel_broker.branchId", 20); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch26(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_63cd6ccb")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "pound_fist_palm"); string_id message = new string_id(c_stringFile, "s_3714bdfe"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_159911f5"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_70f18874"); } setObjVar(player, "conversation.rebel_broker.branchId", 21); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_d15ec255")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "explain"); string_id message = new string_id(c_stringFile, "s_98a75031"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_159911f5"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_70f18874"); } setObjVar(player, "conversation.rebel_broker.branchId", 24); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_6491bb19")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "shake_head_disgust"); string_id message = new string_id(c_stringFile, "s_80d99409"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_159911f5"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_70f18874"); } setObjVar(player, "conversation.rebel_broker.branchId", 27); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_159911f5")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "manipulate_medium"); rebel_broker_action_addTatooineWaypoint(player, npc); string_id message = new string_id(c_stringFile, "s_43cd3e42"); removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); return SCRIPT_CONTINUE; } } if (response.equals("s_70f18874")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "snap_finger2"); string_id message = new string_id(c_stringFile, "s_bbc28ec8"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } boolean hasResponse2 = false; if (rebel_broker_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_63cd6ccb"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_d15ec255"); } if (hasResponse2) { responses[responseIndex++] = new string_id(c_stringFile, "s_6491bb19"); } setObjVar(player, "conversation.rebel_broker.branchId", 20); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int rebel_broker_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_63cd6ccb")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "pound_fist_palm"); string_id message = new string_id(c_stringFile, "s_3714bdfe"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_159911f5"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_70f18874"); } setObjVar(player, "conversation.rebel_broker.branchId", 21); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_d15ec255")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "explain"); string_id message = new string_id(c_stringFile, "s_98a75031"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_159911f5"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_70f18874"); } setObjVar(player, "conversation.rebel_broker.branchId", 24); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.branchId"); chat.chat(npc, player, message); npcEndConversation(player); } return SCRIPT_CONTINUE; } } if (response.equals("s_6491bb19")) { if (rebel_broker_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "shake_head_disgust"); string_id message = new string_id(c_stringFile, "s_80d99409"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_159911f5"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_70f18874"); } setObjVar(player, "conversation.rebel_broker.branchId", 27); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { removeObjVar(player, "conversation.rebel_broker.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.rebel_broker"); } setCondition(self, CONDITION_CONVERSABLE); setCondition(self, CONDITION_SPACE_INTERESTING); setInvulnerable(self, true); factions.setFaction(self, factions.FACTION_REBEL); return SCRIPT_CONTINUE; } public int OnAttach(obj_id self) throws InterruptedException { setCondition(self, CONDITION_CONVERSABLE); setCondition(self, CONDITION_SPACE_INTERESTING); setInvulnerable(self, true); factions.setFaction(self, factions.FACTION_REBEL); 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); faceTo(self, player); return SCRIPT_CONTINUE; } public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException { clearCondition(self, CONDITION_CONVERSABLE); detachScript(self, "conversation.rebel_broker"); 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 (!rebel_broker_condition_hasSpaceExp(player, npc)) { rebel_broker_action_brushedOffImp(player, npc); string_id message = new string_id(c_stringFile, "s_2a805b93"); chat.chat(npc, player, message); return SCRIPT_CONTINUE; } if (rebel_broker_condition_isRebelPilot(player, npc)) { doAnimationAction(npc, "greet"); string_id message = new string_id(c_stringFile, "s_b8e72ced"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_fc2710b9"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_3fd213c"); } setObjVar(player, "conversation.rebel_broker.branchId", 2); npcStartConversation(player, npc, "rebel_broker", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (rebel_broker_condition_wasBrushedOff(player, npc)) { doAnimationAction(npc, "wave_on_dismissing"); string_id message = new string_id(c_stringFile, "s_ee2fdf32"); chat.chat(npc, player, message); return SCRIPT_CONTINUE; } if (rebel_broker_condition_isImperialFaction(player, npc)) { doAnimationAction(npc, "stretch"); string_id message = new string_id(c_stringFile, "s_c4b91b55"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (rebel_broker_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_d70dba34"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_4c695dbd"); } setObjVar(player, "conversation.rebel_broker.branchId", 10); npcStartConversation(player, npc, "rebel_broker", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (rebel_broker_condition_isPilot(player, npc)) { string_id message = new string_id(c_stringFile, "s_aad360f4"); chat.chat(npc, player, message); return SCRIPT_CONTINUE; } if (rebel_broker_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_9fdd7cf3"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (rebel_broker_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_ca776e30"); } setObjVar(player, "conversation.rebel_broker.branchId", 17); npcStartConversation(player, npc, "rebel_broker", 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("rebel_broker")) { return SCRIPT_CONTINUE; } obj_id npc = self; int branchId = getIntObjVar(player, "conversation.rebel_broker.branchId"); if (branchId == 2 && rebel_broker_handleBranch2(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 3 && rebel_broker_handleBranch3(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 4 && rebel_broker_handleBranch4(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 10 && rebel_broker_handleBranch10(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 11 && rebel_broker_handleBranch11(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 12 && rebel_broker_handleBranch12(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 13 && rebel_broker_handleBranch13(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 17 && rebel_broker_handleBranch17(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 18 && rebel_broker_handleBranch18(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 19 && rebel_broker_handleBranch19(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 20 && rebel_broker_handleBranch20(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 21 && rebel_broker_handleBranch21(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 23 && rebel_broker_handleBranch23(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 24 && rebel_broker_handleBranch24(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 26 && rebel_broker_handleBranch26(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 27 && rebel_broker_handleBranch27(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 29 && rebel_broker_handleBranch29(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); removeObjVar(player, "conversation.rebel_broker.branchId"); return SCRIPT_CONTINUE; } }