// ====================================================================== // // npe_brochure.script // Copyright 2004, Sony Online Entertainment // All Rights Reserved. // // Created with SwgConversationEditor 1.35 - DO NOT EDIT THIS AUTO-GENERATED FILE! // // ====================================================================== // ====================================================================== // Library Includes // ====================================================================== include library.ai_lib; include library.chat; include library.create; include library.money; include library.utils; // ====================================================================== // Script Constants // ====================================================================== string c_stringFile = "conversation/npe_brochure"; // ====================================================================== // Script Conditions // ====================================================================== boolean npe_brochure_condition__defaultCondition (obj_id player, obj_id npc) { return true; } // ---------------------------------------------------------------------- boolean npe_brochure_condition_has100 (obj_id player, obj_id npc) { int cash = getTotalMoney (player); if (cash >= 100) { return true; } return false; } // ---------------------------------------------------------------------- boolean npe_brochure_condition_has50 (obj_id player, obj_id npc) { int cash = getTotalMoney (player); if (cash >= 50) { return true; } return false; } // ---------------------------------------------------------------------- boolean npe_brochure_condition_hasBought (obj_id player, obj_id npc) { return hasObjVar(player, "npe.boughtBrochure"); } // ====================================================================== // Script Actions // ====================================================================== void npe_brochure_action_payNPC50 (obj_id player, obj_id npc) { int cash = getTotalMoney (player); if (cash >= 50) { dictionary params = new dictionary(); money.requestPayment(player, npc, 50, "pass_fail", params, true); setObjVar(player, "npe.boughtBrochure", true); } } // ---------------------------------------------------------------------- void npe_brochure_action_payNPC100 (obj_id player, obj_id npc) { int cash = getTotalMoney (player); if (cash >= 100) { dictionary params = new dictionary(); money.requestPayment(player, npc, 100, "pass_fail", params, true); setObjVar(player, "npe.boughtBrochure", true); } } // ---------------------------------------------------------------------- void npe_brochure_action_giveWaypointStation (obj_id player, obj_id npc) { string BROCHURE = "object/tangible/space/story_loot/loot_npe_travel_brochure.iff"; if (isIdValid(player)) { obj_id playerInv = getObjectInSlot( player, "inventory" ); if(isIdValid(playerInv)) { obj_id item = createObject( BROCHURE, playerInv, "" ); sendSystemMessage(player, new string_id("npe", "brochure")); } } obj_id[] waypoints = getWaypointsInDatapad(player); boolean theyHave = false; for( int i = 0; i < waypoints.length; i++) { string myName = getWaypointName(waypoints[i]); if (myName == "Station Gamma") theyHave = true; } if (theyHave == false) { location emergence = new location (663, -1002, 2039, "space_ord_mantell", null); obj_id waypoint = createWaypointInDatapad(player, emergence); setWaypointName(waypoint, "Station Gamma"); setWaypointColor( waypoint, "space" ); setWaypointVisible( waypoint, true ); setWaypointActive( waypoint, true ); } } // ---------------------------------------------------------------------- void npe_brochure_action_faceToNoob (obj_id player, obj_id npc) { faceTo(npc, player); } // ====================================================================== // Script %TO Tokens // ====================================================================== // ====================================================================== // Script %DI Tokens // ====================================================================== // ====================================================================== // Script %DF Tokens // ====================================================================== // ====================================================================== // handleBranch Functions // ====================================================================== int npe_brochure_handleBranch1 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: What, you don't like the brochure? //-- [RESPONSE NOTE] //-- PLAYER: You ripped me off! if (response == "s_110") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { //-- NPC: I did not, you bought a brochure, and I gave you one. I can't help that you didn't like the place. string_id message = new string_id (c_stringFile, "s_111"); utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch3 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: You! You there! Looks like you could use a travel package to Station Gamma! //-- [RESPONSE NOTE] //-- PLAYER: Station what? if (response == "s_9") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { //-- NPC: Station Gamma! You haven't heard of it? I'm surprised! All the more reason to go! string_id message = new string_id (c_stringFile, "s_11"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Wait... tell me about this place. boolean hasResponse0 = false; if (npe_brochure_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_13"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 4); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I don't want whatever you're selling. if (response == "s_57") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "shoo"); //-- NPC: Fine! You're missing out! string_id message = new string_id (c_stringFile, "s_59"); utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: Nice fashion sense. if (response == "s_61") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "shrug_shoulders"); //-- NPC: Heh. Gotta do what you gotta do to get noticed around here. string_id message = new string_id (c_stringFile, "s_63"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: I guess. What are you selling? boolean hasResponse0 = false; if (npe_brochure_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_65"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 17); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch4 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Station Gamma! You haven't heard of it? I'm surprised! All the more reason to go! //-- [RESPONSE NOTE] //-- PLAYER: Wait... tell me about this place. if (response == "s_13") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "explain"); //-- NPC: Set in the wonderful atmosphere of Ord Mantell Space, Station Gamma is a resort in and of itself! To get the travel package, you only have to give me 50 credits. string_id message = new string_id (c_stringFile, "s_15"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: What?! Pay you? boolean hasResponse0 = false; if (npe_brochure_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_17"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 5); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch5 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Set in the wonderful atmosphere of Ord Mantell Space, Station Gamma is a resort in and of itself! To get the travel package, you only have to give me 50 credits. //-- [RESPONSE NOTE] //-- PLAYER: What?! Pay you? if (response == "s_17") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "dream"); //-- NPC: Station Gamma is a vacationer's dream, I tell you. Selling the package for 50 credits is unheard of. You're getting a deal! string_id message = new string_id (c_stringFile, "s_19"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Fine. Here are 50 credits... boolean hasResponse0 = false; if (npe_brochure_condition_has50 (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: I'm not giving you any money until you tell me more. boolean hasResponse1 = false; if (npe_brochure_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } //-- PLAYER: I don't have 50 credits. boolean hasResponse2 = false; if (!npe_brochure_condition_has50 (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_21"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_31"); if (hasResponse2) responses [responseIndex++] = new string_id (c_stringFile, "s_53"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 6); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch6 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Station Gamma is a vacationer's dream, I tell you. Selling the package for 50 credits is unheard of. You're getting a deal! //-- [RESPONSE NOTE] //-- PLAYER: Fine. Here are 50 credits... if (response == "s_21") { npe_brochure_action_payNPC50 (player, npc); //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "wave1"); //-- NPC: Thanks! See ya! string_id message = new string_id (c_stringFile, "s_23"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Hey! Wait! At least tell me where it is. boolean hasResponse0 = false; if (npe_brochure_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_25"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 7); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I'm not giving you any money until you tell me more. if (response == "s_31") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { //-- NPC: Fine. 100 credits and I'll tell you all I know. string_id message = new string_id (c_stringFile, "s_33"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Here's 100 credits. boolean hasResponse0 = false; if (npe_brochure_condition_has100 (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: I don't have 100 credits. boolean hasResponse1 = false; if (!npe_brochure_condition_has100 (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_47"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 10); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I don't have 50 credits. if (response == "s_53") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { //-- NPC: Looks like you're out of luck then! string_id message = new string_id (c_stringFile, "s_55"); utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch7 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Thanks! See ya! //-- [RESPONSE NOTE] //-- PLAYER: Hey! Wait! At least tell me where it is. if (response == "s_25") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { npe_brochure_action_giveWaypointStation (player, npc); //-- NPC: Oh yeah. Station Gamma is in Ord Mantell Space. You can get there by talking to Serissu in Hangar Bay 1. The entrance is right over there. She'll set you up with a ship. string_id message = new string_id (c_stringFile, "s_27"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Thanks, I guess... boolean hasResponse0 = false; if (npe_brochure_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_49"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 8); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch8 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Oh yeah. Station Gamma is in Ord Mantell Space. You can get there by talking to Serissu in Hangar Bay 1. The entrance is right over there. She'll set you up with a ship. //-- [RESPONSE NOTE] //-- PLAYER: Thanks, I guess... if (response == "s_49") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "laugh"); //-- NPC: Have fun! string_id message = new string_id (c_stringFile, "s_50"); utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch10 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Fine. 100 credits and I'll tell you all I know. //-- [RESPONSE NOTE] //-- PLAYER: Here's 100 credits. if (response == "s_35") { npe_brochure_action_payNPC100 (player, npc); //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { //-- NPC: Thanks. Okay, I lied. Station Gamma is actually overrun by an overlord and his cronies. It's a very dangerous place. I bet you can take it all by yourse...well, since you paid me, you might want to take some friends. string_id message = new string_id (c_stringFile, "s_37"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Where is it? boolean hasResponse0 = false; if (npe_brochure_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_39"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 11); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I don't have 100 credits. if (response == "s_47") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "shrug_shoulders"); //-- NPC: Sorry. Can't help you, then. string_id message = new string_id (c_stringFile, "s_51"); utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch11 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Thanks. Okay, I lied. Station Gamma is actually overrun by an overlord and his cronies. It's a very dangerous place. I bet you can take it all by yourse...well, since you paid me, you might want to take some friends. //-- [RESPONSE NOTE] //-- PLAYER: Where is it? if (response == "s_39") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { npe_brochure_action_giveWaypointStation (player, npc); //-- NPC: Ord Mantell Space. You can get there by talking to Serissu in Hangar Bay 1. The entrance is right over there. She'll set you up with a ship. string_id message = new string_id (c_stringFile, "s_41"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Thanks. I'll check it out. boolean hasResponse0 = false; if (npe_brochure_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_43"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 12); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch12 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Ord Mantell Space. You can get there by talking to Serissu in Hangar Bay 1. The entrance is right over there. She'll set you up with a ship. //-- [RESPONSE NOTE] //-- PLAYER: Thanks. I'll check it out. if (response == "s_43") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { //-- NPC: Good luck. You'll need it. string_id message = new string_id (c_stringFile, "s_45"); utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch17 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Heh. Gotta do what you gotta do to get noticed around here. //-- [RESPONSE NOTE] //-- PLAYER: I guess. What are you selling? if (response == "s_65") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { //-- NPC: Only travel packages to the best vacationing spot around: Station Gamma! string_id message = new string_id (c_stringFile, "s_67"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: I don't believe you. boolean hasResponse0 = false; if (npe_brochure_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_69"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 18); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch18 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Only travel packages to the best vacationing spot around: Station Gamma! //-- [RESPONSE NOTE] //-- PLAYER: I don't believe you. if (response == "s_69") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { //-- NPC: You don't gotta believe me to take advantage of this fantastic offer! The whole package for only 50 credits! string_id message = new string_id (c_stringFile, "s_71"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Rip off! boolean hasResponse0 = false; if (npe_brochure_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: Okay, but only because I'm curious. Here are 50 credits. boolean hasResponse1 = false; if (npe_brochure_condition_has50 (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } //-- PLAYER: I don't have 50 credits. boolean hasResponse2 = false; if (!npe_brochure_condition_has50 (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_73"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_97"); if (hasResponse2) responses [responseIndex++] = new string_id (c_stringFile, "s_112"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 19); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch19 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: You don't gotta believe me to take advantage of this fantastic offer! The whole package for only 50 credits! //-- [RESPONSE NOTE] //-- PLAYER: Rip off! if (response == "s_73") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "poke"); //-- NPC: Tough customer. string_id message = new string_id (c_stringFile, "s_75"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Give me more tangible information, first. boolean hasResponse0 = false; if (npe_brochure_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_77"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 20); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: Okay, but only because I'm curious. Here are 50 credits. if (response == "s_97") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "wave1"); npe_brochure_action_payNPC50 (player, npc); //-- NPC: Thanks! It's a lovely place, really. Have fun! string_id message = new string_id (c_stringFile, "s_99"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Wait, that's it? Tell me where it is at least. boolean hasResponse0 = false; if (npe_brochure_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_101"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 26); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I don't have 50 credits. if (response == "s_112") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "shoo"); //-- NPC: Looks like you miss out! string_id message = new string_id (c_stringFile, "s_114"); utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch20 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Tough customer. //-- [RESPONSE NOTE] //-- PLAYER: Give me more tangible information, first. if (response == "s_77") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { //-- NPC: More information means a higher price. Give me 100 credits. string_id message = new string_id (c_stringFile, "s_79"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Fine. Here's 100 credits. boolean hasResponse0 = false; if (npe_brochure_condition_has100 (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: I don't have 100 credits. boolean hasResponse1 = false; if (!npe_brochure_condition_has100 (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_81"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_93"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 21); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch21 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: More information means a higher price. Give me 100 credits. //-- [RESPONSE NOTE] //-- PLAYER: Fine. Here's 100 credits. if (response == "s_81") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "laugh"); //-- NPC: Thanks. Okay, I lied. Station Gamma is actually overrun by an overlord and his cronies. I bet you can take it all by yourse...well, since you paid me, you might want to take some friends. string_id message = new string_id (c_stringFile, "s_83"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Where is it? boolean hasResponse0 = false; if (npe_brochure_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_85"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 22); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: I don't have 100 credits. if (response == "s_93") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { //-- NPC: Looks like you miss out! string_id message = new string_id (c_stringFile, "s_95"); utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch22 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Thanks. Okay, I lied. Station Gamma is actually overrun by an overlord and his cronies. I bet you can take it all by yourse...well, since you paid me, you might want to take some friends. //-- [RESPONSE NOTE] //-- PLAYER: Where is it? if (response == "s_85") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "point_right"); npe_brochure_action_giveWaypointStation (player, npc); //-- NPC: Ord Mantell Space. You can get there by talking to Serissu in the Hangar Bay 1. The entrance is right over there. She'll set you up with a ship. string_id message = new string_id (c_stringFile, "s_87"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Thanks. I'll check it out. boolean hasResponse0 = false; if (npe_brochure_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_89"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 23); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch23 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Ord Mantell Space. You can get there by talking to Serissu in the Hangar Bay 1. The entrance is right over there. She'll set you up with a ship. //-- [RESPONSE NOTE] //-- PLAYER: Thanks. I'll check it out. if (response == "s_89") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { //-- NPC: Good luck. You'll need it. string_id message = new string_id (c_stringFile, "s_91"); utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch26 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Thanks! It's a lovely place, really. Have fun! //-- [RESPONSE NOTE] //-- PLAYER: Wait, that's it? Tell me where it is at least. if (response == "s_101") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "point_right"); npe_brochure_action_giveWaypointStation (player, npc); //-- NPC: Ord Mantell Space. You can get there by talking to Serissu in Hangar Bay 1. The entrance is right over there. She'll set you up with a ship. string_id message = new string_id (c_stringFile, "s_103"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Why do I feel cheated? Guess I'll check it out. boolean hasResponse0 = false; if (npe_brochure_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_105"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 27); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int npe_brochure_handleBranch27 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Ord Mantell Space. You can get there by talking to Serissu in Hangar Bay 1. The entrance is right over there. She'll set you up with a ship. //-- [RESPONSE NOTE] //-- PLAYER: Why do I feel cheated? Guess I'll check it out. if (response == "s_105") { //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "laugh"); //-- NPC: Good luck. You'll need it. Take friends. string_id message = new string_id (c_stringFile, "s_107"); utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- // ====================================================================== // User Script Triggers // ====================================================================== trigger OnInitialize () { if ((!isMob (self)) || (isPlayer (self))) detachScript(self, "conversation.npe_brochure"); setCondition (self, CONDITION_CONVERSABLE); setName( self, "Delo (Travel Agent)"); setInvulnerable (self, true); return SCRIPT_CONTINUE; } trigger OnAttach () { setCondition (self, CONDITION_CONVERSABLE); setName( self, "Delo (Travel Agent)"); setInvulnerable (self, true); 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.npe_brochure"); 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 (npe_brochure_condition_hasBought (player, npc)) { //-- NPC: What, you don't like the brochure? string_id message = new string_id (c_stringFile, "s_109"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: You ripped me off! boolean hasResponse0 = false; if (npe_brochure_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.npe_brochure.branchId", 1); npcStartConversation (player, npc, "npe_brochure", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (npe_brochure_condition__defaultCondition (player, npc)) { npe_brochure_action_faceToNoob (player, npc); //-- NPC: You! You there! Looks like you could use a travel package to Station Gamma! string_id message = new string_id (c_stringFile, "s_7"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Station what? boolean hasResponse0 = false; if (npe_brochure_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: I don't want whatever you're selling. boolean hasResponse1 = false; if (npe_brochure_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } //-- PLAYER: Nice fashion sense. boolean hasResponse2 = false; if (npe_brochure_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_9"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_57"); if (hasResponse2) responses [responseIndex++] = new string_id (c_stringFile, "s_61"); utils.setScriptVar (player, "conversation.npe_brochure.branchId", 3); npcStartConversation (player, npc, "npe_brochure", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); return SCRIPT_CONTINUE; } // ---------------------------------------------------------------------- trigger OnNpcConversationResponse (string conversationId, obj_id player, string_id response) { if (conversationId != "npe_brochure") return SCRIPT_CONTINUE; obj_id npc = self; int branchId = utils.getIntScriptVar (player, "conversation.npe_brochure.branchId"); if (branchId == 1 && npe_brochure_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 3 && npe_brochure_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 4 && npe_brochure_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 5 && npe_brochure_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 6 && npe_brochure_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 7 && npe_brochure_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 8 && npe_brochure_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 10 && npe_brochure_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 11 && npe_brochure_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 12 && npe_brochure_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 17 && npe_brochure_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 18 && npe_brochure_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 19 && npe_brochure_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 20 && npe_brochure_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 21 && npe_brochure_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 22 && npe_brochure_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 23 && npe_brochure_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 26 && npe_brochure_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 27 && npe_brochure_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); utils.removeScriptVar (player, "conversation.npe_brochure.branchId"); return SCRIPT_CONTINUE; } // ======================================================================