// ====================================================================== // // inquisitor_admin.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/inquisitor_admin"; // ====================================================================== // Script Conditions // ====================================================================== boolean inquisitor_admin_condition__defaultCondition (obj_id player, obj_id npc) { return true; } // ---------------------------------------------------------------------- boolean inquisitor_admin_condition_isNeutQuest (obj_id player, obj_id npc) { faceTo(npc, player); return groundquests.hasCompletedQuest(player, "outbreak_quest_02_neutral"); } // ---------------------------------------------------------------------- boolean inquisitor_admin_condition_isRebQuest (obj_id player, obj_id npc) { faceTo(npc, player); return groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel"); } // ---------------------------------------------------------------------- boolean inquisitor_admin_condition_hasQuestForInq (obj_id player, obj_id npc) { faceTo(npc, player); return (groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial") || groundquests.hasCompletedQuest(player, "outbreak_quest_02_neutral") || groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")); } // ---------------------------------------------------------------------- boolean inquisitor_admin_condition_hasPreviousQuests (obj_id player, obj_id npc) { return (inquisitor_admin_condition_isImpQuest(player, npc) || inquisitor_admin_condition_isRebQuest(player, npc) || inquisitor_admin_condition_isNeutQuest(player, npc) && inquisitor_admin_condition_hasARandomInquisitorQuest(player, npc)); } // ---------------------------------------------------------------------- boolean inquisitor_admin_condition_isPlayerGodMode (obj_id player, obj_id npc) { return isGod(player); } // ---------------------------------------------------------------------- boolean inquisitor_admin_condition_hasARandomInquisitorQuest (obj_id player, obj_id npc) { string faction = ""; if(inquisitor_admin_condition_isImpQuest(player,npc)) { faction = "imperial"; } else if(inquisitor_admin_condition_isRebQuest(player,npc)) { faction = "rebel"; } else { faction = "neutral"; } if(faction == null || faction.length() <= 0) return false; boolean hasAValidQuest = false; for(int i = 1; i <= 5; i++) { if(!groundquests.isQuestActive(player, "outbreak_quest_administrative_building_" + faction + "_0" + i)) continue; hasAValidQuest = true; break; } return hasAValidQuest; } // ---------------------------------------------------------------------- boolean inquisitor_admin_condition_hasKey (obj_id player, obj_id npc) { string faction = ""; if(inquisitor_admin_condition_isImpQuest(player,npc)) { faction = "imperial"; } else if(inquisitor_admin_condition_isRebQuest(player,npc)) { faction = "rebel"; } else { faction = "neutral"; } if(faction == null || faction.length() <= 0) return false; boolean hasAValidTask = false; for(int i = 1; i <= 5; i++) { if(!groundquests.isTaskActive(player, "outbreak_quest_administrative_building_" + faction + "_0" + i, "returnInquisitor")) continue; hasAValidTask = true; break; } return hasAValidTask; } // ---------------------------------------------------------------------- boolean inquisitor_admin_condition_isNeutralOrRebelQuest (obj_id player, obj_id npc) { return inquisitor_admin_condition_isRebQuest(player, npc) || inquisitor_admin_condition_isNeutQuest(player, npc); } // ---------------------------------------------------------------------- boolean inquisitor_admin_condition_hasCompletedKeyDeletedDungeon (obj_id player, obj_id npc) { string faction = ""; if(inquisitor_admin_condition_isImpQuest(player,npc)) { faction = "imperial"; } else if(inquisitor_admin_condition_isRebQuest(player,npc)) { faction = "rebel"; } else { faction = "neutral"; } if(faction == null || faction.length() <= 0) return false; string theKeyQuest = ""; for(int i = 1; i <= 5; i++) { if(!groundquests.hasCompletedQuest(player, "outbreak_quest_administrative_building_" + faction + "_0" + i)) continue; theKeyQuest = "outbreak_quest_administrative_building_" + faction + "_0" + i; break; } if(theKeyQuest == null || theKeyQuest.length() <= 0) return false; return groundquests.hasCompletedQuest(player, theKeyQuest); //&& !groundquests.isQuestActiveOrComplete(player, "quest_name"); } // ---------------------------------------------------------------------- boolean inquisitor_admin_condition_isImpQuest (obj_id player, obj_id npc) { faceTo(npc, player); return groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial"); } // ---------------------------------------------------------------------- boolean inquisitor_admin_condition_hasFindKeyTaskActive (obj_id player, obj_id npc) { string faction = ""; if(inquisitor_admin_condition_isImpQuest(player,npc)) { faction = "imperial"; } else if(inquisitor_admin_condition_isRebQuest(player,npc)) { faction = "rebel"; } else { faction = "neutral"; } if(faction == null || faction.length() <= 0) return false; boolean hasAValidQuest = false; for(int i = 1; i <= 5; i++) { if(!groundquests.isTaskActive(player, "outbreak_quest_administrative_building_" + faction + "_0" + i, "findKey")) continue; hasAValidQuest = true; break; } return hasAValidQuest; } // ---------------------------------------------------------------------- boolean inquisitor_admin_condition_hasRadio (obj_id player, obj_id npc) { return groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "findEpsilonContact"); } // ====================================================================== // Script Actions // ====================================================================== void inquisitor_admin_action_sendSignalGoAdminBuilding (obj_id player, obj_id npc) { faceTo(npc, player); groundquests.sendSignal(player, "hasSpokenInquisitor"); } // ---------------------------------------------------------------------- void inquisitor_admin_action_grantDungeonQuest (obj_id player, obj_id npc) { //sendSystemMessageTestingOnly(player, "The next quest hasn't been created yet."); groundquests.grantQuest(player, "outbreak_quest_facility_01"); //remove scriptvars!! utils.removeScriptVarTree(player, "consoleMiniGame"); } // ---------------------------------------------------------------------- void inquisitor_admin_action_sendSignalReturnedInquisitor (obj_id player, obj_id npc) { groundquests.sendSignal(player, "hasReturnedInquisitor"); inquisitor_admin_action_grantDungeonQuest(player, npc); } // ====================================================================== // Script %TO Tokens // ====================================================================== // ====================================================================== // Script %DI Tokens // ====================================================================== // ====================================================================== // Script %DF Tokens // ====================================================================== // ====================================================================== // handleBranch Functions // ====================================================================== int inquisitor_admin_handleBranch2 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Looks like you have the key... //-- [RESPONSE NOTE] //-- PLAYER: You made me come back to tell me what I already knew? if (response == "s_38") { //-- [NOTE] if (inquisitor_admin_condition__defaultCondition (player, npc)) { //-- NPC: No. I wanted to also try and talk sense into you. The research facility has been overrun. There is nothing alive down there I assure you. string_id message = new string_id (c_stringFile, "s_39"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: I am not here to rescue survivors. boolean hasResponse0 = false; if (inquisitor_admin_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_40"); utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 3); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int inquisitor_admin_handleBranch3 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: No. I wanted to also try and talk sense into you. The research facility has been overrun. There is nothing alive down there I assure you. //-- [RESPONSE NOTE] //-- PLAYER: I am not here to rescue survivors. if (response == "s_40") { //-- [NOTE] if (inquisitor_admin_condition__defaultCondition (player, npc)) { //-- NPC: No? What then? string_id message = new string_id (c_stringFile, "s_41"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: I need to retrieve an unmutated Blackwing sample and destroy the canisters so the virus will dissipate. boolean hasResponse0 = false; if (inquisitor_admin_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.inquisitor_admin.branchId", 4); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int inquisitor_admin_handleBranch4 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: No? What then? //-- [RESPONSE NOTE] //-- PLAYER: I need to retrieve an unmutated Blackwing sample and destroy the canisters so the virus will dissipate. if (response == "s_42") { //-- [NOTE] if (inquisitor_admin_condition__defaultCondition (player, npc)) { //-- NPC: Maybe that is why the Empire hasn't bombarded this area into the stone age. string_id message = new string_id (c_stringFile, "s_43"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Maybe. boolean hasResponse0 = false; if (inquisitor_admin_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_52"); utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 5); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int inquisitor_admin_handleBranch5 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Maybe that is why the Empire hasn't bombarded this area into the stone age. //-- [RESPONSE NOTE] //-- PLAYER: Maybe. if (response == "s_52") { //-- [NOTE] if (inquisitor_admin_condition__defaultCondition (player, npc)) { //-- NPC: Well, hopefully I'll be long gone if you are successful. Oh, by the way, thanks for the shuttle parts. I hear we may be flight worthy sometime in the next several hours. string_id message = new string_id (c_stringFile, "s_54"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: I'd suggest you find a rock to hide under if you leave without me. boolean hasResponse0 = false; if (inquisitor_admin_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_56"); utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 6); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int inquisitor_admin_handleBranch6 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Well, hopefully I'll be long gone if you are successful. Oh, by the way, thanks for the shuttle parts. I hear we may be flight worthy sometime in the next several hours. //-- [RESPONSE NOTE] //-- PLAYER: I'd suggest you find a rock to hide under if you leave without me. if (response == "s_56") { //-- [NOTE] if (inquisitor_admin_condition__defaultCondition (player, npc)) { //-- NPC: Uh...well...uhm. I see. So, the facility has several underground levels. Some I haven't even seen myself. The Chief Virologist is....well, was...Dr. Giffax Jin. You might have a good chance of finding an unmutated sample in one of the cryogenic storage rooms next to his main office. Where that can be found I have no idea. string_id message = new string_id (c_stringFile, "s_58"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Great. Anything else? boolean hasResponse0 = false; if (inquisitor_admin_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_59"); utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 7); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int inquisitor_admin_handleBranch7 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Uh...well...uhm. I see. So, the facility has several underground levels. Some I haven't even seen myself. The Chief Virologist is....well, was...Dr. Giffax Jin. You might have a good chance of finding an unmutated sample in one of the cryogenic storage rooms next to his main office. Where that can be found I have no idea. //-- [RESPONSE NOTE] //-- PLAYER: Great. Anything else? if (response == "s_59") { //-- [NOTE] if (inquisitor_admin_condition__defaultCondition (player, npc)) { inquisitor_admin_action_sendSignalReturnedInquisitor (player, npc); //-- NPC: No. Good luck, %TU. string_id message = new string_id (c_stringFile, "s_61"); utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); prose_package pp = new prose_package (); pp.stringId = message; pp.actor.set (player); pp.target.set (npc); npcEndConversationWithMessage (player, pp); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int inquisitor_admin_handleBranch10 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: I have no time for your small talk citizen. //-- [RESPONSE NOTE] //-- PLAYER: I was sent by Darth Vader. I expect your full cooperation. if (response == "s_20") { //-- [NOTE] if (inquisitor_admin_condition__defaultCondition (player, npc)) { //-- NPC: Wh..what? Show me your authorization code! string_id message = new string_id (c_stringFile, "s_22"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Here. boolean hasResponse0 = false; if (inquisitor_admin_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.inquisitor_admin.branchId", 11); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int inquisitor_admin_handleBranch11 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Wh..what? Show me your authorization code! //-- [RESPONSE NOTE] //-- PLAYER: Here. if (response == "s_24") { doAnimationAction (player, "handshake_tandem"); //-- [NOTE] if (inquisitor_admin_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "nod_head_once"); //-- NPC: Look...we did all we could here. It all happened so quickly. string_id message = new string_id (c_stringFile, "s_26"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: I'm not here for your debriefing...I'm here to enter the research facility and find a sample of unmutated virus. boolean hasResponse0 = false; if (inquisitor_admin_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_28"); utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 12); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int inquisitor_admin_handleBranch12 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Look...we did all we could here. It all happened so quickly. //-- [RESPONSE NOTE] //-- PLAYER: I'm not here for your debriefing...I'm here to enter the research facility and find a sample of unmutated virus. if (response == "s_28") { //-- [NOTE] if (inquisitor_admin_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "shakefist"); //-- NPC: But...that is suicide. If you don't succumb to the virus, you'll surely be eaten! string_id message = new string_id (c_stringFile, "s_30"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: I'll be sure to tell Vader that you refused to support his bidding. boolean hasResponse0 = false; if (inquisitor_admin_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_32"); utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 13); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int inquisitor_admin_handleBranch13 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: But...that is suicide. If you don't succumb to the virus, you'll surely be eaten! //-- [RESPONSE NOTE] //-- PLAYER: I'll be sure to tell Vader that you refused to support his bidding. if (response == "s_32") { //-- [NOTE] if (inquisitor_admin_condition__defaultCondition (player, npc)) { //-- NPC: Wait...uh, I don't know where they kept the virus samples. You'll need an access key to use the facility command consoles. Surely they kept a record of all the experiments on the facility mainframe. I dropped my key long ago or I'd let you have it. I am pretty sure you'll be able to find one in the administrative building if you want to try that building. string_id message = new string_id (c_stringFile, "s_34"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Is there a specific room in the building I should check? boolean hasResponse0 = false; if (inquisitor_admin_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_36"); utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 14); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int inquisitor_admin_handleBranch14 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Wait...uh, I don't know where they kept the virus samples. You'll need an access key to use the facility command consoles. Surely they kept a record of all the experiments on the facility mainframe. I dropped my key long ago or I'd let you have it. I am pretty sure you'll be able to find one in the administrative building if you want to try that building. //-- [RESPONSE NOTE] //-- PLAYER: Is there a specific room in the building I should check? if (response == "s_36") { //-- [NOTE] if (inquisitor_admin_condition__defaultCondition (player, npc)) { //-- NPC: There was a lot of chaos when everything happened. There is no telling where a key might be. Sorry I can't give you an exact location. string_id message = new string_id (c_stringFile, "s_45"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: I'm going to look. You better hope you are right. boolean hasResponse0 = false; if (inquisitor_admin_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_47"); utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 15); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int inquisitor_admin_handleBranch15 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: There was a lot of chaos when everything happened. There is no telling where a key might be. Sorry I can't give you an exact location. //-- [RESPONSE NOTE] //-- PLAYER: I'm going to look. You better hope you are right. if (response == "s_47") { //-- [NOTE] if (inquisitor_admin_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "shrug_shoulders"); inquisitor_admin_action_sendSignalGoAdminBuilding (player, npc); //-- NPC: Well, if you don't come back... string_id message = new string_id (c_stringFile, "s_49"); utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- // ====================================================================== // User Script Triggers // ====================================================================== trigger OnInitialize () { if ((!isTangible (self)) || (isPlayer (self))) detachScript(self, "conversation.inquisitor_admin"); 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.inquisitor_admin"); 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 (inquisitor_admin_condition_hasCompletedKeyDeletedDungeon (player, npc)) { inquisitor_admin_action_grantDungeonQuest (player, npc); //-- NPC: So you lost your instructions for the facility? No problem. Let me get you that data. string_id message = new string_id (c_stringFile, "s_62"); chat.chat (npc, player, message); return SCRIPT_CONTINUE; } //-- [NOTE] if (inquisitor_admin_condition_hasKey (player, npc)) { //-- NPC: Looks like you have the key... string_id message = new string_id (c_stringFile, "s_37"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: You made me come back to tell me what I already knew? boolean hasResponse0 = false; if (inquisitor_admin_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.inquisitor_admin.branchId", 2); npcStartConversation (player, npc, "inquisitor_admin", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (inquisitor_admin_condition_hasFindKeyTaskActive (player, npc)) { //-- NPC: Come back when you have the key...if you even find it. string_id message = new string_id (c_stringFile, "s_50"); chat.chat (npc, player, message); return SCRIPT_CONTINUE; } //-- [NOTE] if (inquisitor_admin_condition_hasPreviousQuests (player, npc)) { //-- NPC: I have no time for your small talk citizen. string_id message = new string_id (c_stringFile, "s_73"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: I was sent by Darth Vader. I expect your full cooperation. boolean hasResponse0 = false; if (inquisitor_admin_condition_hasQuestForInq (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_20"); utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 10); npcStartConversation (player, npc, "inquisitor_admin", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (inquisitor_admin_condition_hasRadio (player, npc)) { //-- NPC: What am I supposed to do with that radio? Find someone else to pawn your goods to...I'm not interested. string_id message = new string_id (c_stringFile, "s_53"); chat.chat (npc, player, message); return SCRIPT_CONTINUE; } //-- [NOTE] if (inquisitor_admin_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "shoo"); //-- NPC: Anything you see here is Empire business. I expect you to forget it all once it is over. string_id message = new string_id (c_stringFile, "s_65"); 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 != "inquisitor_admin") return SCRIPT_CONTINUE; obj_id npc = self; int branchId = utils.getIntScriptVar (player, "conversation.inquisitor_admin.branchId"); if (branchId == 2 && inquisitor_admin_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 3 && inquisitor_admin_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 4 && inquisitor_admin_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 5 && inquisitor_admin_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 6 && inquisitor_admin_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 7 && inquisitor_admin_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 10 && inquisitor_admin_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 11 && inquisitor_admin_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 12 && inquisitor_admin_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 13 && inquisitor_admin_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 14 && inquisitor_admin_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 15 && inquisitor_admin_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); return SCRIPT_CONTINUE; } // ======================================================================