// ====================================================================== // // orion_rank3.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.space_quest; include library.utils; // ====================================================================== // Script Constants // ====================================================================== string c_stringFile = "conversation/orion_rank3"; // ====================================================================== // Script Conditions // ====================================================================== boolean orion_rank3_condition__defaultCondition (obj_id player, obj_id npc) { return true; } // ---------------------------------------------------------------------- boolean orion_rank3_condition_isOrionAligned (obj_id player, obj_id npc) { return hasCompletedCollectionSlot(player, "orion_rank_01_03"); } // ---------------------------------------------------------------------- boolean orion_rank3_condition_onQuest_01 (obj_id player, obj_id npc) { return (groundquests.isQuestActive(player, "orion_rank3_01") && !groundquests.isTaskActive(player, "orion_rank3_01", "wait_01")); } // ---------------------------------------------------------------------- boolean orion_rank3_condition_winQuest_01 (obj_id player, obj_id npc) { return (groundquests.isTaskActive(player, "orion_rank3_01", "wait_01") || groundquests.hasCompletedQuest(player, "orion_rank3_01")); } // ---------------------------------------------------------------------- boolean orion_rank3_condition_onQuest_02 (obj_id player, obj_id npc) { return (groundquests.isQuestActive(player, "orion_rank3_02") && !groundquests.isTaskActive(player, "orion_rank3_02", "wait_01")); } // ---------------------------------------------------------------------- boolean orion_rank3_condition_winQuest_02 (obj_id player, obj_id npc) { return (groundquests.isTaskActive(player, "orion_rank3_02", "wait_01") || groundquests.hasCompletedQuest(player, "orion_rank3_02")); } // ---------------------------------------------------------------------- boolean orion_rank3_condition_onQuest_03 (obj_id player, obj_id npc) { return (groundquests.isQuestActive(player, "orion_rank3_03") && !groundquests.isTaskActive(player, "orion_rank3_03", "wait_01")); } // ---------------------------------------------------------------------- boolean orion_rank3_condition_winQuest_03 (obj_id player, obj_id npc) { return (groundquests.isTaskActive(player, "orion_rank3_03", "wait_01") || groundquests.hasCompletedQuest(player, "orion_rank3_03")); } // ---------------------------------------------------------------------- boolean orion_rank3_condition_onQuest_04 (obj_id player, obj_id npc) { return (groundquests.isQuestActive(player, "orion_rank3_04") && !groundquests.isTaskActive(player, "orion_rank3_04", "wait_01")); } // ---------------------------------------------------------------------- boolean orion_rank3_condition_winQuest_04 (obj_id player, obj_id npc) { return (groundquests.isTaskActive(player, "orion_rank3_04", "wait_01")); } // ---------------------------------------------------------------------- boolean orion_rank3_condition_finishedAll (obj_id player, obj_id npc) { return groundquests.hasCompletedQuest(player, "orion_rank3_04"); } // ====================================================================== // Script Actions // ====================================================================== void orion_rank3_action_grantQuest_01 (obj_id player, obj_id npc) { groundquests.grantQuest(player, "orion_rank3_01"); } // ---------------------------------------------------------------------- void orion_rank3_action_clearRegrant_01 (obj_id player, obj_id npc) { groundquests.clearQuest(player, "orion_rank3_01"); space_quest.clearQuestFlags(player, "patrol", "orion_rank3_03"); space_quest.clearQuestFlags(player, "survival", "orion_rank3_01"); groundquests.grantQuest(player, "orion_rank3_01"); } // ---------------------------------------------------------------------- void orion_rank3_action_sendQuestSignal_01 (obj_id player, obj_id npc) { groundquests.sendSignal(player, "orion_rank3_01"); } // ---------------------------------------------------------------------- void orion_rank3_action_grantQuest_02 (obj_id player, obj_id npc) { groundquests.grantQuest(player, "orion_rank3_02"); } // ---------------------------------------------------------------------- void orion_rank3_action_sendQuestSignal_02 (obj_id player, obj_id npc) { groundquests.sendSignal(player, "orion_rank3_03"); } // ---------------------------------------------------------------------- void orion_rank3_action_clearRegrant_02 (obj_id player, obj_id npc) { groundquests.clearQuest(player, "orion_rank3_02"); space_quest.clearQuestFlags(player, "patrol", "orion_rank3_04"); space_quest.clearQuestFlags(player, "recovery", "orion_rank3_01"); groundquests.grantQuest(player, "orion_rank3_02"); } // ---------------------------------------------------------------------- void orion_rank3_action_grantQuest_03 (obj_id player, obj_id npc) { groundquests.grantQuest(player, "orion_rank3_03"); } // ---------------------------------------------------------------------- void orion_rank3_action_clearRegrant_03 (obj_id player, obj_id npc) { groundquests.clearQuest(player, "orion_rank3_03"); space_quest.clearQuestFlags(player, "patrol", "orion_rank3_01"); space_quest.clearQuestFlags(player, "rescue", "orion_rank3_01"); groundquests.grantQuest(player, "orion_rank3_03"); } // ---------------------------------------------------------------------- void orion_rank3_action_sendQuestSignal_03 (obj_id player, obj_id npc) { groundquests.sendSignal(player, "orion_rank3_04"); } // ---------------------------------------------------------------------- void orion_rank3_action_grantQuest_04 (obj_id player, obj_id npc) { groundquests.grantQuest(player, "orion_rank3_04"); } // ---------------------------------------------------------------------- void orion_rank3_action_clearRegrant_04 (obj_id player, obj_id npc) { groundquests.clearQuest(player, "orion_rank3_04"); space_quest.clearQuestFlags(player, "patrol", "orion_rank3_05"); space_quest.clearQuestFlags(player, "destroy_surpriseattack", "orion_rank3_01"); groundquests.grantQuest(player, "orion_rank3_04"); } // ---------------------------------------------------------------------- void orion_rank3_action_sendQuestSignal_04 (obj_id player, obj_id npc) { groundquests.sendSignal(player, "orion_rank3_05"); } // ====================================================================== // Script %TO Tokens // ====================================================================== // ====================================================================== // Script %DI Tokens // ====================================================================== // ====================================================================== // Script %DF Tokens // ====================================================================== // ====================================================================== // handleBranch Functions // ====================================================================== int orion_rank3_handleBranch2 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Congratulations. Although there is some bad news too. //-- [RESPONSE NOTE] //-- PLAYER: What kind of bad news? if (response == "s_56") { orion_rank3_action_sendQuestSignal_04 (player, npc); //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { //-- NPC: While you were out there Nova staged an attack and took out one of our top pilots. string_id message = new string_id (c_stringFile, "s_57"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: So I was just a distraction? boolean hasResponse0 = false; if (orion_rank3_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_58"); utils.setScriptVar (player, "conversation.orion_rank3.branchId", 3); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch3 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: While you were out there Nova staged an attack and took out one of our top pilots. //-- [RESPONSE NOTE] //-- PLAYER: So I was just a distraction? if (response == "s_58") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { //-- NPC: No, I think they meant to take you both out. This means war. string_id message = new string_id (c_stringFile, "s_59"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: War? boolean hasResponse0 = false; if (orion_rank3_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_60"); utils.setScriptVar (player, "conversation.orion_rank3.branchId", 4); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch4 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: No, I think they meant to take you both out. This means war. //-- [RESPONSE NOTE] //-- PLAYER: War? if (response == "s_60") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { //-- NPC: Yes, we can't let them get away with this. You need to get a promotion so we can use you on the front lines. Garrick Orion himself will be calling the shots at that level. string_id message = new string_id (c_stringFile, "s_61"); utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch6 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: How's the hunt coming? //-- [RESPONSE NOTE] //-- PLAYER: Just heading out now. if (response == "s_52") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { //-- NPC: They wont see what hit'em. string_id message = new string_id (c_stringFile, "s_54"); utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I need those coordinates again. if (response == "s_53") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { orion_rank3_action_clearRegrant_04 (player, npc); //-- NPC: Here, stick it to'em. string_id message = new string_id (c_stringFile, "s_55"); utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch9 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Congratulations on springing that trap. //-- [RESPONSE NOTE] //-- PLAYER: The Novans didn't know what hit them. if (response == "s_48") { orion_rank3_action_sendQuestSignal_03 (player, npc); //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { //-- NPC: I bet they didn't. You ready for your next assignment? string_id message = new string_id (c_stringFile, "s_49"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: More than ready. boolean hasResponse0 = false; if (orion_rank3_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.orion_rank3.branchId", 10); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch10 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: I bet they didn't. You ready for your next assignment? //-- [RESPONSE NOTE] //-- PLAYER: More than ready. if (response == "s_50") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { orion_rank3_action_grantQuest_04 (player, npc); //-- NPC: I think so too. It looks like their number one pilot is out to get you, as well. string_id message = new string_id (c_stringFile, "s_51"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Not if I get them first. boolean hasResponse0 = false; if (orion_rank3_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_113"); utils.setScriptVar (player, "conversation.orion_rank3.branchId", 11); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch11 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: I think so too. It looks like their number one pilot is out to get you, as well. //-- [RESPONSE NOTE] //-- PLAYER: Not if I get them first. if (response == "s_113") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { orion_rank3_action_grantQuest_04 (player, npc); //-- NPC: My thoughts exactly. You should head out to the area they were last seen. string_id message = new string_id (c_stringFile, "s_114"); utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch13 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: What are you doing here? Shouldn't you be out there springing that trap? //-- [RESPONSE NOTE] //-- PLAYER: Just gathering supplies. if (response == "s_44") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { //-- NPC: You must hurry. string_id message = new string_id (c_stringFile, "s_46"); utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I lost the coordinates. if (response == "s_45") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { orion_rank3_action_clearRegrant_03 (player, npc); //-- NPC: Here, now get out there. string_id message = new string_id (c_stringFile, "s_47"); utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch16 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Nice work on getting that freighter in. //-- [RESPONSE NOTE] //-- PLAYER: Thanks, they didn't like that at all. if (response == "s_38") { orion_rank3_action_sendQuestSignal_02 (player, npc); //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { //-- NPC: That's the point. string_id message = new string_id (c_stringFile, "s_39"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: So, what's next? boolean hasResponse0 = false; if (orion_rank3_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.orion_rank3.branchId", 17); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch17 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: That's the point. //-- [RESPONSE NOTE] //-- PLAYER: So, what's next? if (response == "s_40") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { //-- NPC: We need you to rescue one of our freighters that was attacked by 'pirates'. string_id message = new string_id (c_stringFile, "s_42"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: You think it is a trap? boolean hasResponse0 = false; if (orion_rank3_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_62"); utils.setScriptVar (player, "conversation.orion_rank3.branchId", 18); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch18 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: We need you to rescue one of our freighters that was attacked by 'pirates'. //-- [RESPONSE NOTE] //-- PLAYER: You think it is a trap? if (response == "s_62") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { orion_rank3_action_grantQuest_03 (player, npc); //-- NPC: I know it is. Lets teach them Novans a lesson. string_id message = new string_id (c_stringFile, "s_64"); utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch20 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Why are you here? You should be taking that Nova freighter. //-- [RESPONSE NOTE] //-- PLAYER: I know, I am heading out now. if (response == "s_68") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { //-- NPC: Give it to them. string_id message = new string_id (c_stringFile, "s_70"); utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I lost the coordinates. if (response == "s_72") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { orion_rank3_action_clearRegrant_02 (player, npc); //-- NPC: Here, now get out there. string_id message = new string_id (c_stringFile, "s_74"); utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch23 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Wow, great work! They won't be using those hyperspace lanes anytime soon. //-- [RESPONSE NOTE] //-- PLAYER: Thanks, it did get a little hairy out there. if (response == "s_78") { orion_rank3_action_sendQuestSignal_01 (player, npc); //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { //-- NPC: Nothing you couldn't handle, I'm sure. string_id message = new string_id (c_stringFile, "s_80"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Obviously, what's next? boolean hasResponse0 = false; if (orion_rank3_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_82"); utils.setScriptVar (player, "conversation.orion_rank3.branchId", 24); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch24 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Nothing you couldn't handle, I'm sure. //-- [RESPONSE NOTE] //-- PLAYER: Obviously, what's next? if (response == "s_82") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { //-- NPC: Nova is attempting to sneak some supplies in. string_id message = new string_id (c_stringFile, "s_84"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: You want me to blow up the freighter? boolean hasResponse0 = false; if (orion_rank3_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_86"); utils.setScriptVar (player, "conversation.orion_rank3.branchId", 25); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch25 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Nova is attempting to sneak some supplies in. //-- [RESPONSE NOTE] //-- PLAYER: You want me to blow up the freighter? if (response == "s_86") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { orion_rank3_action_grantQuest_02 (player, npc); //-- NPC: No, I want you to help take the freighter over. Just disable it, then escort it back once we have control. string_id message = new string_id (c_stringFile, "s_88"); utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch27 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: You are supposed to be disrupting those shipping lanes. //-- [RESPONSE NOTE] //-- PLAYER: On my way. if (response == "s_92") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { //-- NPC: Good, get going. string_id message = new string_id (c_stringFile, "s_94"); utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I lost the coordinates. if (response == "s_96") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { orion_rank3_action_clearRegrant_01 (player, npc); //-- NPC: Here they are, now get out there. string_id message = new string_id (c_stringFile, "s_98"); utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch30 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Welcome to the new Orion Industries. //-- [RESPONSE NOTE] //-- PLAYER: Thank you, it is a pleasure. if (response == "s_102") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { //-- NPC: We have been tasked with making Nova's life miserable. Can you handle that? string_id message = new string_id (c_stringFile, "s_104"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: It would be my pleasure. boolean hasResponse0 = false; if (orion_rank3_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_106"); utils.setScriptVar (player, "conversation.orion_rank3.branchId", 31); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch31 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: We have been tasked with making Nova's life miserable. Can you handle that? //-- [RESPONSE NOTE] //-- PLAYER: It would be my pleasure. if (response == "s_106") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { //-- NPC: Good. Our first order of business will be fun. We have uncovered some shipping routes that Nova thinks he can use. string_id message = new string_id (c_stringFile, "s_108"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: You want me to go there and cause trouble? boolean hasResponse0 = false; if (orion_rank3_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_110"); utils.setScriptVar (player, "conversation.orion_rank3.branchId", 32); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int orion_rank3_handleBranch32 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Good. Our first order of business will be fun. We have uncovered some shipping routes that Nova thinks he can use. //-- [RESPONSE NOTE] //-- PLAYER: You want me to go there and cause trouble? if (response == "s_110") { //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { orion_rank3_action_grantQuest_01 (player, npc); //-- NPC: Exactly, get out there and teach them that hyperspace is not safe. string_id message = new string_id (c_stringFile, "s_112"); utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- // ====================================================================== // User Script Triggers // ====================================================================== trigger OnInitialize () { if ((!isTangible (self)) || (isPlayer (self))) detachScript(self, "conversation.orion_rank3"); 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.orion_rank3"); 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 (orion_rank3_condition_finishedAll (player, npc)) { //-- NPC: Get your promotion taken care of. We need you out there. Go see Willard. string_id message = new string_id (c_stringFile, "s_7"); chat.chat (npc, player, message); return SCRIPT_CONTINUE; } //-- [NOTE] if (orion_rank3_condition_winQuest_04 (player, npc)) { //-- NPC: Congratulations. Although there is some bad news too. string_id message = new string_id (c_stringFile, "s_8"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: What kind of bad news? boolean hasResponse0 = false; if (orion_rank3_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.orion_rank3.branchId", 2); npcStartConversation (player, npc, "orion_rank3", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (orion_rank3_condition_onQuest_04 (player, npc)) { //-- NPC: How's the hunt coming? string_id message = new string_id (c_stringFile, "s_14"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Just heading out now. boolean hasResponse0 = false; if (orion_rank3_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: I need those coordinates again. boolean hasResponse1 = false; if (orion_rank3_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_52"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_53"); utils.setScriptVar (player, "conversation.orion_rank3.branchId", 6); npcStartConversation (player, npc, "orion_rank3", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (orion_rank3_condition_winQuest_03 (player, npc)) { //-- NPC: Congratulations on springing that trap. string_id message = new string_id (c_stringFile, "s_20"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: The Novans didn't know what hit them. boolean hasResponse0 = false; if (orion_rank3_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_48"); utils.setScriptVar (player, "conversation.orion_rank3.branchId", 9); npcStartConversation (player, npc, "orion_rank3", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (orion_rank3_condition_onQuest_03 (player, npc)) { //-- NPC: What are you doing here? Shouldn't you be out there springing that trap? string_id message = new string_id (c_stringFile, "s_28"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Just gathering supplies. boolean hasResponse0 = false; if (orion_rank3_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: I lost the coordinates. boolean hasResponse1 = false; if (orion_rank3_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_44"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_45"); utils.setScriptVar (player, "conversation.orion_rank3.branchId", 13); npcStartConversation (player, npc, "orion_rank3", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (orion_rank3_condition_winQuest_02 (player, npc)) { //-- NPC: Nice work on getting that freighter in. string_id message = new string_id (c_stringFile, "s_34"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Thanks, they didn't like that at all. boolean hasResponse0 = false; if (orion_rank3_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.orion_rank3.branchId", 16); npcStartConversation (player, npc, "orion_rank3", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (orion_rank3_condition_onQuest_02 (player, npc)) { //-- NPC: Why are you here? You should be taking that Nova freighter. string_id message = new string_id (c_stringFile, "s_66"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: I know, I am heading out now. boolean hasResponse0 = false; if (orion_rank3_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: I lost the coordinates. boolean hasResponse1 = false; if (orion_rank3_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_68"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_72"); utils.setScriptVar (player, "conversation.orion_rank3.branchId", 20); npcStartConversation (player, npc, "orion_rank3", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (orion_rank3_condition_winQuest_01 (player, npc)) { //-- NPC: Wow, great work! They won't be using those hyperspace lanes anytime soon. string_id message = new string_id (c_stringFile, "s_76"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Thanks, it did get a little hairy out there. boolean hasResponse0 = false; if (orion_rank3_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_78"); utils.setScriptVar (player, "conversation.orion_rank3.branchId", 23); npcStartConversation (player, npc, "orion_rank3", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (orion_rank3_condition_onQuest_01 (player, npc)) { //-- NPC: You are supposed to be disrupting those shipping lanes. string_id message = new string_id (c_stringFile, "s_90"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: On my way. boolean hasResponse0 = false; if (orion_rank3_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: I lost the coordinates. boolean hasResponse1 = false; if (orion_rank3_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_92"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_96"); utils.setScriptVar (player, "conversation.orion_rank3.branchId", 27); npcStartConversation (player, npc, "orion_rank3", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (orion_rank3_condition_isOrionAligned (player, npc)) { //-- NPC: Welcome to the new Orion Industries. string_id message = new string_id (c_stringFile, "s_100"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Thank you, it is a pleasure. boolean hasResponse0 = false; if (orion_rank3_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_102"); utils.setScriptVar (player, "conversation.orion_rank3.branchId", 30); npcStartConversation (player, npc, "orion_rank3", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (orion_rank3_condition__defaultCondition (player, npc)) { //-- NPC: Shouldn't you be somewhere else? string_id message = new string_id (c_stringFile, "s_116"); 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 != "orion_rank3") return SCRIPT_CONTINUE; obj_id npc = self; int branchId = utils.getIntScriptVar (player, "conversation.orion_rank3.branchId"); if (branchId == 2 && orion_rank3_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 3 && orion_rank3_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 4 && orion_rank3_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 6 && orion_rank3_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 9 && orion_rank3_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 10 && orion_rank3_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 11 && orion_rank3_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 13 && orion_rank3_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 16 && orion_rank3_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 17 && orion_rank3_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 18 && orion_rank3_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 20 && orion_rank3_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 23 && orion_rank3_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 24 && orion_rank3_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 25 && orion_rank3_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 27 && orion_rank3_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 30 && orion_rank3_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 31 && orion_rank3_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 32 && orion_rank3_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); utils.removeScriptVar (player, "conversation.orion_rank3.branchId"); return SCRIPT_CONTINUE; } // ======================================================================