// ====================================================================== // // outbreak_rodian_pilot.script // // // // Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! // // ====================================================================== // ====================================================================== // Library Includes // ====================================================================== include library.ai_lib; include library.buff; include library.chat; include library.conversation; include library.features; include library.groundquests; include library.money; include library.space_quest; include library.utils; // ====================================================================== // Script Constants // ====================================================================== string c_stringFile = "conversation/outbreak_rodian_pilot"; // ====================================================================== // Script Conditions // ====================================================================== boolean outbreak_rodian_pilot_condition__defaultCondition (obj_id player, obj_id npc) { return true; } // ---------------------------------------------------------------------- boolean outbreak_rodian_pilot_condition_hasCollectionSlotAlpha (obj_id player, obj_id npc) { return hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_alpha"); } // ---------------------------------------------------------------------- boolean outbreak_rodian_pilot_condition_has100Credits (obj_id player, obj_id npc) { return money.hasFunds(player, money.MT_TOTAL, 100); } // ---------------------------------------------------------------------- boolean outbreak_rodian_pilot_condition_hasCollectionSlotEpsilon (obj_id player, obj_id npc) { return hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_epsilon"); } // ---------------------------------------------------------------------- boolean outbreak_rodian_pilot_condition_hasCollectionSlotDelta (obj_id player, obj_id npc) { return hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_delta"); } // ---------------------------------------------------------------------- boolean outbreak_rodian_pilot_condition_hasCollectionSlotBeta (obj_id player, obj_id npc) { return hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_beta"); } // ---------------------------------------------------------------------- boolean outbreak_rodian_pilot_condition_hasCollectionSlotGamma (obj_id player, obj_id npc) { return hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_gamma"); } // ---------------------------------------------------------------------- boolean outbreak_rodian_pilot_condition_has500Credits (obj_id player, obj_id npc) { return money.hasFunds(player, money.MT_TOTAL, 500); } // ---------------------------------------------------------------------- boolean outbreak_rodian_pilot_condition_has1000Credits (obj_id player, obj_id npc) { return money.hasFunds(player, money.MT_TOTAL, 1000); } // ---------------------------------------------------------------------- boolean outbreak_rodian_pilot_condition_has1500Credits (obj_id player, obj_id npc) { return money.hasFunds(player, money.MT_TOTAL, 1500); } // ---------------------------------------------------------------------- boolean outbreak_rodian_pilot_condition_has2000Credits (obj_id player, obj_id npc) { return money.hasFunds(player, money.MT_TOTAL, 2000); } // ---------------------------------------------------------------------- boolean outbreak_rodian_pilot_condition_hasFrequentFlyerBadge (obj_id player, obj_id npc) { return hasCompletedCollection(player, "deathtrooper_rodian_frequent_flyer"); } // ---------------------------------------------------------------------- boolean outbreak_rodian_pilot_condition_isEligibleForTrans (obj_id player, obj_id npc) { return outbreak_rodian_pilot_condition_hasCollectionSlotAlpha(player,npc) && (groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") || groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") || groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")) || isGod(player); } // ====================================================================== // Script Actions // ====================================================================== void outbreak_rodian_pilot_action_dropOffAlphaForCredits (obj_id player, obj_id npc) { if(money.requestPayment(player, npc, 100, "pass_fail", null, true)) { if(!hasCompletedCollection(player, "deathtrooper_rodian_frequent_flyer")) { modifyCollectionSlotValue(player, "outbreak_frequent_flyer_counter", 1); } outbreak_rodian_pilot_action_applyBuffs(player, npc); warpPlayer(player, "dathomir", -5925, 559, -6667, null, -5925, 559, -6667, null, true); } } // ---------------------------------------------------------------------- void outbreak_rodian_pilot_action_dropOffBetaForCredits (obj_id player, obj_id npc) { if(money.requestPayment(player, npc, 500, "pass_fail", null, true)) { if(!hasCompletedCollection(player, "deathtrooper_rodian_frequent_flyer")) { modifyCollectionSlotValue(player, "outbreak_frequent_flyer_counter", 1); } outbreak_rodian_pilot_action_applyBuffs(player, npc); warpPlayer(player, "dathomir", -6283, 561, -7521, null, -6283, 561, -7521, null, true); } } // ---------------------------------------------------------------------- void outbreak_rodian_pilot_action_dropOffGammaForCredits (obj_id player, obj_id npc) { if(money.requestPayment(player, npc, 1000, "pass_fail", null, true)) { if(!hasCompletedCollection(player, "deathtrooper_rodian_frequent_flyer")) { modifyCollectionSlotValue(player, "outbreak_frequent_flyer_counter", 1); } outbreak_rodian_pilot_action_applyBuffs(player, npc); warpPlayer(player, "dathomir", -6824, 553, -6456, null, -6824, 553, -6456, null, true); } } // ---------------------------------------------------------------------- void outbreak_rodian_pilot_action_dropOffDeltaForCredits (obj_id player, obj_id npc) { if(money.requestPayment(player, npc, 1500, "pass_fail", null, true)) { if(!hasCompletedCollection(player, "deathtrooper_rodian_frequent_flyer")) { modifyCollectionSlotValue(player, "outbreak_frequent_flyer_counter", 1); } outbreak_rodian_pilot_action_applyBuffs(player, npc); warpPlayer(player, "dathomir", -7145, 562, -6922, null, -7145, 562, -6922, null, true); } } // ---------------------------------------------------------------------- void outbreak_rodian_pilot_action_dropOffEpsilonForCredits (obj_id player, obj_id npc) { if(money.requestPayment(player, npc, 2000, "pass_fail", null, true)) { if(!hasCompletedCollection(player, "deathtrooper_rodian_frequent_flyer")) { modifyCollectionSlotValue(player, "outbreak_frequent_flyer_counter", 1); } outbreak_rodian_pilot_action_applyBuffs(player, npc); warpPlayer(player, "dathomir", -7448, 570, -7342, null, -7448, 570, -7342, null, true); } } // ---------------------------------------------------------------------- void outbreak_rodian_pilot_action_AlphaFree (obj_id player, obj_id npc) { outbreak_rodian_pilot_action_applyBuffs(player, npc); warpPlayer(player, "dathomir", -5925, 559, -6667, null, -5925, 559, -6667, null, true); } // ---------------------------------------------------------------------- void outbreak_rodian_pilot_action_EpsilonFree (obj_id player, obj_id npc) { outbreak_rodian_pilot_action_applyBuffs(player, npc); warpPlayer(player, "dathomir", -7448, 570, -7342, null, -7448, 570, -7342, null, true); } // ---------------------------------------------------------------------- void outbreak_rodian_pilot_action_DeltaFree (obj_id player, obj_id npc) { outbreak_rodian_pilot_action_applyBuffs(player, npc); warpPlayer(player, "dathomir", -7145, 562, -6922, null, -7145, 562, -6922, null, true); } // ---------------------------------------------------------------------- void outbreak_rodian_pilot_action_GammaFree (obj_id player, obj_id npc) { outbreak_rodian_pilot_action_applyBuffs(player, npc); warpPlayer(player, "dathomir", -6824, 553, -6456, null, -6824, 553, -6456, null, true); } // ---------------------------------------------------------------------- void outbreak_rodian_pilot_action_BetaFree (obj_id player, obj_id npc) { outbreak_rodian_pilot_action_applyBuffs(player, npc); warpPlayer(player, "dathomir", -6283, 561, -7521, null, -6283, 561, -7521, null, true); } // ---------------------------------------------------------------------- void outbreak_rodian_pilot_action_applyBuffs (obj_id player, obj_id npc) { messageTo(player, "death_troopers_apply_virus", null, 10.0f, false); setObjVar(player, "outbreak.usedGate", 1); buff.applyBuff(player, "death_troopers_no_vehicle"); } // ====================================================================== // Script %TO Tokens // ====================================================================== // ====================================================================== // Script %DI Tokens // ====================================================================== // ====================================================================== // Script %DF Tokens // ====================================================================== // ====================================================================== // handleBranch Functions // ====================================================================== int outbreak_rodian_pilot_handleBranch1 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Ahhh...a frequent flyer. Where would you like to go, %TU? //-- [RESPONSE NOTE] //-- PLAYER: Camp Alpha if (response == "s_49") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { outbreak_rodian_pilot_action_AlphaFree (player, npc); //-- NPC: Jump in. string_id message = new string_id (c_stringFile, "s_50"); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: Camp Beta if (response == "s_51") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { outbreak_rodian_pilot_action_BetaFree (player, npc); //-- NPC: Jump in. string_id message = new string_id (c_stringFile, "s_56"); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: Camp Gamma if (response == "s_52") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { outbreak_rodian_pilot_action_GammaFree (player, npc); //-- NPC: Jump in. string_id message = new string_id (c_stringFile, "s_57"); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: Camp Delta if (response == "s_54") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { outbreak_rodian_pilot_action_DeltaFree (player, npc); //-- NPC: Jump in. string_id message = new string_id (c_stringFile, "s_58"); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: Camp Epsilon if (response == "s_55") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { outbreak_rodian_pilot_action_EpsilonFree (player, npc); //-- NPC: Jump in. string_id message = new string_id (c_stringFile, "s_59"); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int outbreak_rodian_pilot_handleBranch7 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Hey. Looking for a ride somewhere? //-- [RESPONSE NOTE] //-- PLAYER: Maybe...can you drop me off inside the quarantine zone? if (response == "s_32") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { //-- NPC: Maybe...if you got the credits. string_id message = new string_id (c_stringFile, "s_33"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: How much? boolean hasResponse0 = false; if (outbreak_rodian_pilot_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_75"); utils.setScriptVar (player, "conversation.outbreak_rodian_pilot.branchId", 8); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int outbreak_rodian_pilot_handleBranch8 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Maybe...if you got the credits. //-- [RESPONSE NOTE] //-- PLAYER: How much? if (response == "s_75") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { //-- NPC: Depends on where you want to go. string_id message = new string_id (c_stringFile, "s_76"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Camp Alpha boolean hasResponse0 = false; if (outbreak_rodian_pilot_condition_hasCollectionSlotAlpha (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: Camp Beta boolean hasResponse1 = false; if (outbreak_rodian_pilot_condition_hasCollectionSlotBeta (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } //-- PLAYER: Camp Gamma boolean hasResponse2 = false; if (outbreak_rodian_pilot_condition_hasCollectionSlotGamma (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } //-- PLAYER: Camp Delta boolean hasResponse3 = false; if (outbreak_rodian_pilot_condition_hasCollectionSlotDelta (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse3 = true; } //-- PLAYER: Camp Epsilon boolean hasResponse4 = false; if (outbreak_rodian_pilot_condition_hasCollectionSlotEpsilon (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse4 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_20"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_28"); if (hasResponse2) responses [responseIndex++] = new string_id (c_stringFile, "s_47"); if (hasResponse3) responses [responseIndex++] = new string_id (c_stringFile, "s_70"); if (hasResponse4) responses [responseIndex++] = new string_id (c_stringFile, "s_84"); utils.setScriptVar (player, "conversation.outbreak_rodian_pilot.branchId", 9); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int outbreak_rodian_pilot_handleBranch9 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Depends on where you want to go. //-- [RESPONSE NOTE] //-- PLAYER: Camp Alpha if (response == "s_20") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { //-- NPC: That will be 100 credits. string_id message = new string_id (c_stringFile, "s_22"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Fine! Here. boolean hasResponse0 = false; if (outbreak_rodian_pilot_condition_has100Credits (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: I don't have the credits. boolean hasResponse1 = false; if (outbreak_rodian_pilot_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_35"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_38"); utils.setScriptVar (player, "conversation.outbreak_rodian_pilot.branchId", 10); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: Camp Beta if (response == "s_28") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { //-- NPC: That will be 500 credits. string_id message = new string_id (c_stringFile, "s_30"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Fine! Here. boolean hasResponse0 = false; if (outbreak_rodian_pilot_condition_has500Credits (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: I don't have the credits. boolean hasResponse1 = false; if (outbreak_rodian_pilot_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_37"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_42"); utils.setScriptVar (player, "conversation.outbreak_rodian_pilot.branchId", 13); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: Camp Gamma if (response == "s_47") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { //-- NPC: That will be 1000 credits. string_id message = new string_id (c_stringFile, "s_60"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Fine! Here. boolean hasResponse0 = false; if (outbreak_rodian_pilot_condition_has1000Credits (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: I don't have the credits. boolean hasResponse1 = false; if (outbreak_rodian_pilot_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_62"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_66"); utils.setScriptVar (player, "conversation.outbreak_rodian_pilot.branchId", 16); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: Camp Delta if (response == "s_70") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { //-- NPC: That will be 1500 credits. string_id message = new string_id (c_stringFile, "s_72"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Fine! Here. boolean hasResponse0 = false; if (outbreak_rodian_pilot_condition_has1500Credits (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: I don't have the credits. boolean hasResponse1 = false; if (outbreak_rodian_pilot_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_74"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_80"); utils.setScriptVar (player, "conversation.outbreak_rodian_pilot.branchId", 19); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: Camp Epsilon if (response == "s_84") { //-- [NOTE] if (outbreak_rodian_pilot_condition_has2000Credits (player, npc)) { //-- NPC: That will be 2000 credits. string_id message = new string_id (c_stringFile, "s_86"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Fine! Here. boolean hasResponse0 = false; if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: I don't have the credits. boolean hasResponse1 = false; if (outbreak_rodian_pilot_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_88"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_92"); utils.setScriptVar (player, "conversation.outbreak_rodian_pilot.branchId", 22); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int outbreak_rodian_pilot_handleBranch10 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: That will be 100 credits. //-- [RESPONSE NOTE] //-- PLAYER: Fine! Here. if (response == "s_35") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { outbreak_rodian_pilot_action_dropOffAlphaForCredits (player, npc); //-- NPC: Jump in. string_id message = new string_id (c_stringFile, "s_36"); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I don't have the credits. if (response == "s_38") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { //-- NPC: Well...guess you'll have to walk. string_id message = new string_id (c_stringFile, "s_43"); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int outbreak_rodian_pilot_handleBranch13 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: That will be 500 credits. //-- [RESPONSE NOTE] //-- PLAYER: Fine! Here. if (response == "s_37") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { outbreak_rodian_pilot_action_dropOffBetaForCredits (player, npc); //-- NPC: Jump in. string_id message = new string_id (c_stringFile, "s_40"); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I don't have the credits. if (response == "s_42") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { //-- NPC: Well...guess you'll have to walk. string_id message = new string_id (c_stringFile, "s_45"); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int outbreak_rodian_pilot_handleBranch16 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: That will be 1000 credits. //-- [RESPONSE NOTE] //-- PLAYER: Fine! Here. if (response == "s_62") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { outbreak_rodian_pilot_action_dropOffGammaForCredits (player, npc); //-- NPC: Jump in. string_id message = new string_id (c_stringFile, "s_64"); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I don't have the credits. if (response == "s_66") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { //-- NPC: Well...guess you'll have to walk. string_id message = new string_id (c_stringFile, "s_68"); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int outbreak_rodian_pilot_handleBranch19 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: That will be 1500 credits. //-- [RESPONSE NOTE] //-- PLAYER: Fine! Here. if (response == "s_74") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { outbreak_rodian_pilot_action_dropOffDeltaForCredits (player, npc); //-- NPC: Jump in. string_id message = new string_id (c_stringFile, "s_78"); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I don't have the credits. if (response == "s_80") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { //-- NPC: Well...guess you'll have to walk. string_id message = new string_id (c_stringFile, "s_82"); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int outbreak_rodian_pilot_handleBranch22 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: That will be 2000 credits. //-- [RESPONSE NOTE] //-- PLAYER: Fine! Here. if (response == "s_88") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { outbreak_rodian_pilot_action_dropOffEpsilonForCredits (player, npc); //-- NPC: Jump in. string_id message = new string_id (c_stringFile, "s_90"); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I don't have the credits. if (response == "s_92") { //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { //-- NPC: Well...guess you'll have to walk. string_id message = new string_id (c_stringFile, "s_94"); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- // ====================================================================== // User Script Triggers // ====================================================================== trigger OnInitialize () { 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; } // ====================================================================== // 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 (outbreak_rodian_pilot_condition_hasFrequentFlyerBadge (player, npc)) { doAnimationAction (npc, "bow2"); doAnimationAction (player, "wave2"); //-- NPC: Ahhh...a frequent flyer. Where would you like to go, %TU? string_id message = new string_id (c_stringFile, "s_48"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Camp Alpha boolean hasResponse0 = false; if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: Camp Beta boolean hasResponse1 = false; if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } //-- PLAYER: Camp Gamma boolean hasResponse2 = false; if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } //-- PLAYER: Camp Delta boolean hasResponse3 = false; if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse3 = true; } //-- PLAYER: Camp Epsilon boolean hasResponse4 = false; if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse4 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_49"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_51"); if (hasResponse2) responses [responseIndex++] = new string_id (c_stringFile, "s_52"); if (hasResponse3) responses [responseIndex++] = new string_id (c_stringFile, "s_54"); if (hasResponse4) responses [responseIndex++] = new string_id (c_stringFile, "s_55"); utils.setScriptVar (player, "conversation.outbreak_rodian_pilot.branchId", 1); prose_package pp = new prose_package (); pp.stringId = message; pp.actor.set (player); pp.target.set (npc); npcStartConversation (player, npc, "outbreak_rodian_pilot", 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 (outbreak_rodian_pilot_condition_isEligibleForTrans (player, npc)) { doAnimationAction (npc, "nervous"); //-- NPC: Hey. Looking for a ride somewhere? string_id message = new string_id (c_stringFile, "s_31"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Maybe...can you drop me off inside the quarantine zone? boolean hasResponse0 = false; if (outbreak_rodian_pilot_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.outbreak_rodian_pilot.branchId", 7); npcStartConversation (player, npc, "outbreak_rodian_pilot", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (outbreak_rodian_pilot_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "wave_on_dismissing"); //-- NPC: Sorry. Not interested. string_id message = new string_id (c_stringFile, "s_96"); 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 != "outbreak_rodian_pilot") return SCRIPT_CONTINUE; obj_id npc = self; int branchId = utils.getIntScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); if (branchId == 1 && outbreak_rodian_pilot_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 7 && outbreak_rodian_pilot_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 8 && outbreak_rodian_pilot_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 9 && outbreak_rodian_pilot_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 10 && outbreak_rodian_pilot_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 13 && outbreak_rodian_pilot_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 16 && outbreak_rodian_pilot_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 19 && outbreak_rodian_pilot_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 22 && outbreak_rodian_pilot_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); utils.removeScriptVar (player, "conversation.outbreak_rodian_pilot.branchId"); return SCRIPT_CONTINUE; } // ======================================================================