// ====================================================================== // // ig88_bothan_01.script // Copyright 2004, Sony Online Entertainment // All Rights Reserved. // // Created with SwgConversationEditor 1.36 - DO NOT EDIT THIS AUTO-GENERATED FILE! // // ====================================================================== // ====================================================================== // Library Includes // ====================================================================== include library.ai_lib; include library.chat; include library.groundquests; include library.utils; // ====================================================================== // Script Constants // ====================================================================== string c_stringFile = "conversation/ig88_bothan_01"; // ====================================================================== // Script Conditions // ====================================================================== boolean ig88_bothan_01_condition__defaultCondition (obj_id player, obj_id npc) { return true; } // ---------------------------------------------------------------------- boolean ig88_bothan_01_condition_onTask (obj_id player, obj_id npc) { return (groundquests.isTaskActive(player, "feeder_ig88_03", "feeder_loot_ig88_01") || groundquests.isTaskActive(player, "feeder_ig88_03", "feeder_retrieve_ig88_01") || groundquests.isTaskActive(player, "feeder_ig88_03", "feeder_retrieve_ig88_02")); } // ---------------------------------------------------------------------- boolean ig88_bothan_01_condition_endQuest (obj_id player, obj_id npc) { return groundquests.isTaskActive(player, "feeder_ig88_03", "feeder_signal_ig88_02"); } // ---------------------------------------------------------------------- boolean ig88_bothan_01_condition_needsQuest (obj_id player, obj_id npc) { return groundquests.isTaskActive(player, "feeder_ig88_01", "feeder_singal_ig88_03"); } // ---------------------------------------------------------------------- boolean ig88_bothan_01_condition_onQuest (obj_id player, obj_id npc) { return groundquests.isTaskActive(player, "feeder_ig88_01", "feeder_ig88_wait_02"); } // ---------------------------------------------------------------------- boolean ig88_bothan_01_condition_finishedQuest (obj_id player, obj_id npc) { return groundquests.hasCompletedQuest(player, "feeder_ig88_03"); } // ====================================================================== // Script Actions // ====================================================================== void ig88_bothan_01_action_completeQuest (obj_id player, obj_id npc) { groundquests.sendSignal(player, "feeder_signal_ig88_03_02"); } // ---------------------------------------------------------------------- void ig88_bothan_01_action_grantQuest03 (obj_id player, obj_id npc) { groundquests.grantQuest(player, "feeder_ig88_03"); groundquests.sendSignal(player, "feeder_signal_ig88_01_03"); } // ====================================================================== // Script %TO Tokens // ====================================================================== // ====================================================================== // Script %DI Tokens // ====================================================================== // ====================================================================== // Script %DF Tokens // ====================================================================== // ====================================================================== // handleBranch Functions // ====================================================================== int ig88_bothan_01_handleBranch2 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Did you get them? How did you do this without a disguise? //-- [RESPONSE NOTE] //-- PLAYER: I didn't need one, I just took what I wanted. if (response == "s_8") { //-- [NOTE] if (ig88_bothan_01_condition__defaultCondition (player, npc)) { //-- NPC: Interesting approach... string_id message = new string_id (c_stringFile, "s_10"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: That's it? boolean hasResponse0 = false; if (ig88_bothan_01_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_12"); utils.setScriptVar (player, "conversation.ig88_bothan_01.branchId", 3); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.ig88_bothan_01.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: This is my disguise. if (response == "s_16") { //-- [NOTE] if (ig88_bothan_01_condition__defaultCondition (player, npc)) { //-- NPC: Interesting approach... string_id message = new string_id (c_stringFile, "s_10"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: That's it? boolean hasResponse0 = false; if (ig88_bothan_01_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_12"); utils.setScriptVar (player, "conversation.ig88_bothan_01.branchId", 3); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.ig88_bothan_01.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int ig88_bothan_01_handleBranch3 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Interesting approach... //-- [RESPONSE NOTE] //-- PLAYER: That's it? if (response == "s_12") { //-- [NOTE] if (ig88_bothan_01_condition__defaultCondition (player, npc)) { ig88_bothan_01_action_completeQuest (player, npc); //-- NPC: Yes, now get back to Kaibe. He is expecting you. string_id message = new string_id (c_stringFile, "s_14"); utils.removeScriptVar (player, "conversation.ig88_bothan_01.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int ig88_bothan_01_handleBranch5 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: You change your mind, and want me to make you a disguise? //-- [RESPONSE NOTE] //-- PLAYER: No, I just wanted to say hi. if (response == "s_20") { //-- [NOTE] if (ig88_bothan_01_condition__defaultCondition (player, npc)) { //-- NPC: Well hi, now get back there. string_id message = new string_id (c_stringFile, "s_22"); utils.removeScriptVar (player, "conversation.ig88_bothan_01.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: No, I just forgot what to get. if (response == "s_24") { //-- [NOTE] if (ig88_bothan_01_condition__defaultCondition (player, npc)) { ig88_bothan_01_action_grantQuest03 (player, npc); //-- NPC: Amateur. Here I have reloaded the information to your datapad. string_id message = new string_id (c_stringFile, "s_26"); utils.removeScriptVar (player, "conversation.ig88_bothan_01.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int ig88_bothan_01_handleBranch8 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Go away, you have no proof! //-- [RESPONSE NOTE] //-- PLAYER: Proof? Kaibe sent me. if (response == "s_30") { //-- [NOTE] if (ig88_bothan_01_condition__defaultCondition (player, npc)) { //-- NPC: Oh! In that case, what are you doing standing around. Let's get your disguise made. string_id message = new string_id (c_stringFile, "s_32"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Disguise? boolean hasResponse0 = false; if (ig88_bothan_01_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_34"); utils.setScriptVar (player, "conversation.ig88_bothan_01.branchId", 9); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.ig88_bothan_01.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int ig88_bothan_01_handleBranch9 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Oh! In that case, what are you doing standing around. Let's get your disguise made. //-- [RESPONSE NOTE] //-- PLAYER: Disguise? if (response == "s_34") { //-- [NOTE] if (ig88_bothan_01_condition__defaultCondition (player, npc)) { //-- NPC: Yes, how else are you going to get in? Let me see what I can put together... string_id message = new string_id (c_stringFile, "s_36"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: ... boolean hasResponse0 = false; if (ig88_bothan_01_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_38"); utils.setScriptVar (player, "conversation.ig88_bothan_01.branchId", 10); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.ig88_bothan_01.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int ig88_bothan_01_handleBranch10 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Yes, how else are you going to get in? Let me see what I can put together... //-- [RESPONSE NOTE] //-- PLAYER: ... if (response == "s_38") { //-- [NOTE] if (ig88_bothan_01_condition__defaultCondition (player, npc)) { //-- NPC: Well, I am out of sufficient parts to make you retain your own personality. But not to worry, I will take good care of you. string_id message = new string_id (c_stringFile, "s_40"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Um... Can't I just go in without a disguise? boolean hasResponse0 = false; if (ig88_bothan_01_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_42"); utils.setScriptVar (player, "conversation.ig88_bothan_01.branchId", 11); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.ig88_bothan_01.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int ig88_bothan_01_handleBranch11 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Well, I am out of sufficient parts to make you retain your own personality. But not to worry, I will take good care of you. //-- [RESPONSE NOTE] //-- PLAYER: Um... Can't I just go in without a disguise? if (response == "s_42") { //-- [NOTE] if (ig88_bothan_01_condition__defaultCondition (player, npc)) { //-- NPC: ... string_id message = new string_id (c_stringFile, "s_44"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Danger? Hah, I am not scared. Just tell me what I need. boolean hasResponse0 = false; if (ig88_bothan_01_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_46"); utils.setScriptVar (player, "conversation.ig88_bothan_01.branchId", 12); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.ig88_bothan_01.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int ig88_bothan_01_handleBranch12 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: ... //-- [RESPONSE NOTE] //-- PLAYER: Danger? Hah, I am not scared. Just tell me what I need. if (response == "s_46") { doAnimationAction (player, "pose_proudly"); //-- [NOTE] if (ig88_bothan_01_condition__defaultCondition (player, npc)) { //-- NPC: Well in that case, I just need a circuit board from Tao-Ni Security's mainframe. But to get it, I need you to overload the system, so their backup systems don't wipe the data. string_id message = new string_id (c_stringFile, "s_48"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: How do we do that? boolean hasResponse0 = false; if (ig88_bothan_01_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_50"); utils.setScriptVar (player, "conversation.ig88_bothan_01.branchId", 13); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.ig88_bothan_01.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int ig88_bothan_01_handleBranch13 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Well in that case, I just need a circuit board from Tao-Ni Security's mainframe. But to get it, I need you to overload the system, so their backup systems don't wipe the data. //-- [RESPONSE NOTE] //-- PLAYER: How do we do that? if (response == "s_50") { //-- [NOTE] if (ig88_bothan_01_condition__defaultCondition (player, npc)) { ig88_bothan_01_action_grantQuest03 (player, npc); //-- NPC: Easy, just get me some charged capacitors from the security droids there. We can use them. I will contact you when we have enough. string_id message = new string_id (c_stringFile, "s_52"); utils.removeScriptVar (player, "conversation.ig88_bothan_01.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- // ====================================================================== // User Script Triggers // ====================================================================== trigger OnInitialize () { if ((!isTangible (self)) || (isPlayer (self))) detachScript(self, "conversation.ig88_bothan_01"); setCondition (self, CONDITION_CONVERSABLE); return SCRIPT_CONTINUE; } trigger OnAttach () { setCondition (self, CONDITION_CONVERSABLE); return SCRIPT_CONTINUE; } trigger OnObjectMenuRequest (obj_id player, menu_info menuInfo) { 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; } trigger OnIncapacitated (obj_id killer) { clearCondition (self, CONDITION_CONVERSABLE); detachScript (self, "conversation.ig88_bothan_01"); return SCRIPT_CONTINUE; } // ====================================================================== // Script Triggers // ====================================================================== //-- This function should move to base_class.java boolean npcStartConversation(obj_id player, obj_id npc, string convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) { Object[] objects = new Object[responses.length]; System.arraycopy(responses, 0, objects, 0, responses.length); return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); } // ---------------------------------------------------------------------- trigger OnStartNpcConversation (obj_id player) { obj_id npc = self; if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) return SCRIPT_OVERRIDE; //-- [NOTE] if (ig88_bothan_01_condition_finishedQuest (player, npc)) { //-- NPC: Was there something else? I am busy making my disguise for my next contract. string_id message = new string_id (c_stringFile, "s_4"); chat.chat (npc, player, message); return SCRIPT_CONTINUE; } //-- [NOTE] if (ig88_bothan_01_condition_endQuest (player, npc)) { //-- NPC: Did you get them? How did you do this without a disguise? string_id message = new string_id (c_stringFile, "s_6"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: I didn't need one, I just took what I wanted. boolean hasResponse0 = false; if (ig88_bothan_01_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: This is my disguise. boolean hasResponse1 = false; if (ig88_bothan_01_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_8"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_16"); utils.setScriptVar (player, "conversation.ig88_bothan_01.branchId", 2); npcStartConversation (player, npc, "ig88_bothan_01", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (ig88_bothan_01_condition_onQuest (player, npc)) { //-- NPC: You change your mind, and want me to make you a disguise? string_id message = new string_id (c_stringFile, "s_18"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: No, I just wanted to say hi. boolean hasResponse0 = false; if (ig88_bothan_01_condition_onTask (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: No, I just forgot what to get. boolean hasResponse1 = false; if (!ig88_bothan_01_condition_onTask (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_24"); utils.setScriptVar (player, "conversation.ig88_bothan_01.branchId", 5); npcStartConversation (player, npc, "ig88_bothan_01", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (ig88_bothan_01_condition__defaultCondition (player, npc)) { //-- NPC: Go away, you have no proof! string_id message = new string_id (c_stringFile, "s_28"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Proof? Kaibe sent me. boolean hasResponse0 = false; if (ig88_bothan_01_condition_needsQuest (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_30"); utils.setScriptVar (player, "conversation.ig88_bothan_01.branchId", 8); npcStartConversation (player, npc, "ig88_bothan_01", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); return SCRIPT_CONTINUE; } // ---------------------------------------------------------------------- trigger OnNpcConversationResponse (string conversationId, obj_id player, string_id response) { if (conversationId != "ig88_bothan_01") return SCRIPT_CONTINUE; obj_id npc = self; int branchId = utils.getIntScriptVar (player, "conversation.ig88_bothan_01.branchId"); if (branchId == 2 && ig88_bothan_01_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 3 && ig88_bothan_01_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 5 && ig88_bothan_01_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 8 && ig88_bothan_01_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 9 && ig88_bothan_01_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 10 && ig88_bothan_01_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 11 && ig88_bothan_01_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 12 && ig88_bothan_01_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 13 && ig88_bothan_01_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); utils.removeScriptVar (player, "conversation.ig88_bothan_01.branchId"); return SCRIPT_CONTINUE; } // ======================================================================