// ====================================================================== // // ig88_bothan_02.script // Copyright 2004, Sony Online Entertainment // All Rights Reserved. // // Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! // // ====================================================================== // ====================================================================== // Library Includes // ====================================================================== include library.ai_lib; include library.chat; include library.conversation; include library.groundquests; include library.utils; // ====================================================================== // Script Constants // ====================================================================== string c_stringFile = "conversation/ig88_bothan_02"; // ====================================================================== // Script Conditions // ====================================================================== boolean ig88_bothan_02_condition__defaultCondition (obj_id player, obj_id npc) { return true; } // ---------------------------------------------------------------------- boolean ig88_bothan_02_condition_finishedQuest (obj_id player, obj_id npc) { return groundquests.hasCompletedQuest(player, "feeder_ig88_02"); } // ---------------------------------------------------------------------- boolean ig88_bothan_02_condition_onQuest (obj_id player, obj_id npc) { return groundquests.isTaskActive(player, "feeder_ig88_01", "feeder_ig88_wait_02"); } // ---------------------------------------------------------------------- boolean ig88_bothan_02_condition_needsQuest (obj_id player, obj_id npc) { return groundquests.isTaskActive(player, "feeder_ig88_01", "feeder_singal_ig88_04"); } // ---------------------------------------------------------------------- boolean ig88_bothan_02_condition_endQuest (obj_id player, obj_id npc) { return groundquests.isTaskActive(player, "feeder_ig88_02", "feeder_ig88_02_signal_02"); } // ---------------------------------------------------------------------- boolean ig88_bothan_02_condition_onTask (obj_id player, obj_id npc) { return groundquests.isTaskActive(player, "feeder_ig88_02", "feeder_ig88_02_wait_01"); } // ====================================================================== // Script Actions // ====================================================================== void ig88_bothan_02_action_grantQuest02 (obj_id player, obj_id npc) { groundquests.grantQuest(player, "feeder_ig88_02"); groundquests.sendSignal(player, "feeder_signal_ig88_01_04"); } // ---------------------------------------------------------------------- void ig88_bothan_02_action_completeQuest (obj_id player, obj_id npc) { groundquests.sendSignal(player, "feeder_signal_ig88_02_02"); } // ====================================================================== // Script %TO Tokens // ====================================================================== // ====================================================================== // Script %DI Tokens // ====================================================================== // ====================================================================== // Script %DF Tokens // ====================================================================== // ====================================================================== // handleBranch Functions // ====================================================================== int ig88_bothan_02_handleBranch2 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Welcome back %TU. I see you have the items I need. This will just be a moment. Was it difficult? //-- [RESPONSE NOTE] //-- PLAYER: Yes very. if (response == "s_21") { //-- [NOTE] if (ig88_bothan_02_condition__defaultCondition (player, npc)) { //-- NPC: That's nice (distracted)... string_id message = new string_id (c_stringFile, "s_23"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Um, sister? boolean hasResponse0 = false; if (ig88_bothan_02_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_24"); utils.setScriptVar (player, "conversation.ig88_bothan_02.branchId", 3); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.ig88_bothan_02.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: No, not at all. if (response == "s_22") { //-- [NOTE] if (ig88_bothan_02_condition__defaultCondition (player, npc)) { //-- NPC: That's nice (distracted)... string_id message = new string_id (c_stringFile, "s_23"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Um, sister? boolean hasResponse0 = false; if (ig88_bothan_02_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_24"); utils.setScriptVar (player, "conversation.ig88_bothan_02.branchId", 3); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.ig88_bothan_02.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int ig88_bothan_02_handleBranch3 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: That's nice (distracted)... //-- [RESPONSE NOTE] //-- PLAYER: Um, sister? if (response == "s_24") { //-- [NOTE] if (ig88_bothan_02_condition__defaultCondition (player, npc)) { ig88_bothan_02_action_completeQuest (player, npc); //-- NPC: Yes, I was seeing someone who works for Tao-Ni Security. That's why I wanted the personnel files. Now get going, Kaibe needs that data. string_id message = new string_id (c_stringFile, "s_25"); utils.removeScriptVar (player, "conversation.ig88_bothan_02.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int ig88_bothan_02_handleBranch5 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: What are you doing back here? Have you got my parts yet? //-- [RESPONSE NOTE] //-- PLAYER: No, I was just checking in. if (response == "s_17") { //-- [NOTE] if (ig88_bothan_02_condition__defaultCondition (player, npc)) { //-- NPC: Well get back in there, Kaibe needs this data. string_id message = new string_id (c_stringFile, "s_20"); utils.removeScriptVar (player, "conversation.ig88_bothan_02.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I, um, forgot what I needed to get. if (response == "s_18") { doAnimationAction (player, "shrug_shoulders"); //-- [NOTE] if (ig88_bothan_02_condition__defaultCondition (player, npc)) { ig88_bothan_02_action_grantQuest02 (player, npc); //-- NPC: Here, I will upload it to your datapad. string_id message = new string_id (c_stringFile, "s_26"); utils.removeScriptVar (player, "conversation.ig88_bothan_02.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int ig88_bothan_02_handleBranch8 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Hello you must be %TU. Kaibe said you would be paying me a visit. He also told you that I would help you get the parts he needs, right? //-- [RESPONSE NOTE] //-- PLAYER: Yes, he did. if (response == "s_30") { doAnimationAction (player, "nod"); //-- [NOTE] if (ig88_bothan_02_condition__defaultCondition (player, npc)) { //-- NPC: What he didn't tell you was, I will not be accompanying you. I only do reconnaissance. Do you understand? string_id message = new string_id (c_stringFile, "s_32"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Yes. boolean hasResponse0 = false; if (ig88_bothan_02_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_02.branchId", 9); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.ig88_bothan_02.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int ig88_bothan_02_handleBranch9 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: What he didn't tell you was, I will not be accompanying you. I only do reconnaissance. Do you understand? //-- [RESPONSE NOTE] //-- PLAYER: Yes. if (response == "s_34") { doAnimationAction (player, "nod"); //-- [NOTE] if (ig88_bothan_02_condition__defaultCondition (player, npc)) { //-- NPC: Good, lets get down to business. Unlike my brother, I do things the old fashioned way. I snuck into the facility, and took notes for the items we will need. I will need you to collect three items for me. string_id message = new string_id (c_stringFile, "s_36"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Where are they? boolean hasResponse0 = false; if (ig88_bothan_02_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: No problem, what do you need? boolean hasResponse1 = false; if (ig88_bothan_02_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_38"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_46"); utils.setScriptVar (player, "conversation.ig88_bothan_02.branchId", 10); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.ig88_bothan_02.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int ig88_bothan_02_handleBranch10 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Good, lets get down to business. Unlike my brother, I do things the old fashioned way. I snuck into the facility, and took notes for the items we will need. I will need you to collect three items for me. //-- [RESPONSE NOTE] //-- PLAYER: Where are they? if (response == "s_38") { //-- [NOTE] if (ig88_bothan_02_condition__defaultCondition (player, npc)) { //-- NPC: I don't know where they are now, but I am sure you can find them easily enough. I need an electronic key, a copy of personnel files, and a handheld retinal scanner. Bring those to me and I will get the data Kaibe needs. string_id message = new string_id (c_stringFile, "s_40"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: No problem, I am on my way. boolean hasResponse0 = false; if (ig88_bothan_02_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_02.branchId", 11); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.ig88_bothan_02.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: No problem, what do you need? if (response == "s_46") { //-- [NOTE] if (ig88_bothan_02_condition__defaultCondition (player, npc)) { //-- NPC: I don't know where they are now, but I am sure you can find them easily enough. I need an electronic key, a copy of personnel files, and a handheld retinal scanner. Bring those to me and I will get the data Kaibe needs. string_id message = new string_id (c_stringFile, "s_40"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: No problem, I am on my way. boolean hasResponse0 = false; if (ig88_bothan_02_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_02.branchId", 11); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.ig88_bothan_02.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int ig88_bothan_02_handleBranch11 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: I don't know where they are now, but I am sure you can find them easily enough. I need an electronic key, a copy of personnel files, and a handheld retinal scanner. Bring those to me and I will get the data Kaibe needs. //-- [RESPONSE NOTE] //-- PLAYER: No problem, I am on my way. if (response == "s_42") { //-- [NOTE] if (ig88_bothan_02_condition__defaultCondition (player, npc)) { ig88_bothan_02_action_grantQuest02 (player, npc); //-- NPC: If you haven't yet, don't forget to pay a visit to my eccentric brother. He has a task for you as well. string_id message = new string_id (c_stringFile, "s_44"); utils.removeScriptVar (player, "conversation.ig88_bothan_02.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_02"); 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_02"); 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_02_condition_finishedQuest (player, npc)) { //-- NPC: What are you doing here, our business is concluded. string_id message = new string_id (c_stringFile, "s_4"); chat.chat (npc, player, message); return SCRIPT_CONTINUE; } //-- [NOTE] if (ig88_bothan_02_condition_endQuest (player, npc)) { //-- NPC: Welcome back %TU. I see you have the items I need. This will just be a moment. Was it difficult? string_id message = new string_id (c_stringFile, "s_6"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Yes very. boolean hasResponse0 = false; if (ig88_bothan_02_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: No, not at all. boolean hasResponse1 = false; if (ig88_bothan_02_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_21"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_22"); utils.setScriptVar (player, "conversation.ig88_bothan_02.branchId", 2); prose_package pp = new prose_package (); pp.stringId = message; pp.actor.set (player); pp.target.set (npc); npcStartConversation (player, npc, "ig88_bothan_02", null, pp, responses); } else { prose_package pp = new prose_package (); pp.stringId = message; pp.actor.set (player); pp.target.set (npc); chat.chat (npc, player, null, null, pp); } return SCRIPT_CONTINUE; } //-- [NOTE] if (ig88_bothan_02_condition_onQuest (player, npc)) { //-- NPC: What are you doing back here? Have you got my parts yet? string_id message = new string_id (c_stringFile, "s_13"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: No, I was just checking in. boolean hasResponse0 = false; if (ig88_bothan_02_condition_onTask (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: I, um, forgot what I needed to get. boolean hasResponse1 = false; if (!ig88_bothan_02_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_17"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_18"); utils.setScriptVar (player, "conversation.ig88_bothan_02.branchId", 5); npcStartConversation (player, npc, "ig88_bothan_02", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (ig88_bothan_02_condition_needsQuest (player, npc)) { //-- NPC: Hello you must be %TU. Kaibe said you would be paying me a visit. He also told you that I would help you get the parts he needs, right? string_id message = new string_id (c_stringFile, "s_28"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Yes, he did. boolean hasResponse0 = false; if (ig88_bothan_02_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_30"); utils.setScriptVar (player, "conversation.ig88_bothan_02.branchId", 8); prose_package pp = new prose_package (); pp.stringId = message; pp.actor.set (player); pp.target.set (npc); npcStartConversation (player, npc, "ig88_bothan_02", null, pp, responses); } else { prose_package pp = new prose_package (); pp.stringId = message; pp.actor.set (player); pp.target.set (npc); chat.chat (npc, player, null, null, pp); } return SCRIPT_CONTINUE; } //-- [NOTE] if (ig88_bothan_02_condition__defaultCondition (player, npc)) { //-- NPC: Excuse me, is there a reason you are in my home? string_id message = new string_id (c_stringFile, "s_48"); 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_02") return SCRIPT_CONTINUE; obj_id npc = self; int branchId = utils.getIntScriptVar (player, "conversation.ig88_bothan_02.branchId"); if (branchId == 2 && ig88_bothan_02_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 3 && ig88_bothan_02_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 5 && ig88_bothan_02_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 8 && ig88_bothan_02_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 9 && ig88_bothan_02_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 10 && ig88_bothan_02_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 11 && ig88_bothan_02_handleBranch11 (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_02.branchId"); return SCRIPT_CONTINUE; } // ======================================================================