From 4957f948b039464cfb9b299d2f900c3a9f57a9cb Mon Sep 17 00:00:00 2001 From: Eric Barr Date: Mon, 31 Mar 2014 10:01:52 -0700 Subject: [PATCH] Reverted scripts back to initial state we received them --- .../bib_fortuna_mos_eisley.script | 2212 ++--- .../boss_terminal_mining_cave.script | 674 +- ...oss_terminal_mining_cave_controller.script | 948 +- .../boss_terminal_mining_cave_foreman.script | 948 +- ...oss_terminal_mining_research_barnet.script | 674 +- ...boss_terminal_mining_research_lapaz.script | 674 +- .../boss_terminal_pirate_cave.script | 964 +- .../boss_terminal_research_barnet.script | 948 +- .../boss_terminal_research_lapaz.script | 948 +- .../script/conversation/cale_serasai.script | 1604 ++-- .../conversation/camp_beta_leader.script | 1366 +-- .../conversation/camp_delta_leader.script | 1348 +-- .../conversation/camp_gamma_leader.script | 1494 +-- .../collections_ice_cream_part_eight.script | 1076 +-- .../collections_ice_cream_part_five.script | 956 +- .../collections_ice_cream_part_four.script | 956 +- .../collections_ice_cream_part_nine.script | 1316 +-- .../collections_ice_cream_part_one.script | 714 +- .../collections_ice_cream_part_seven.script | 956 +- .../collections_ice_cream_part_six.script | 956 +- .../collections_ice_cream_part_ten.script | 1076 +-- .../collections_ice_cream_part_three.script | 840 +- .../collections_ice_cream_part_two.script | 956 +- .../conversation/delivery_chardle.script | 1320 +-- .../conversation/delivery_hassel.script | 1394 +-- .../conversation/delivery_pirrohn.script | 1320 +-- .../conversation/disgruntled_leader.script | 1102 +-- .../gcw_demoralized_soldier.script | 2046 ++-- .../gcw_introduction_talon_karrde.script | 3890 ++++---- .../hacker_lok_pirate_cave.script | 7122 +++++++------- .../conversation/happer_mos_eisley.script | 1158 +-- .../game/script/conversation/hx_138.script | 8406 ++++++++--------- .../conversation/jedi_robe_jinsu_taker.script | 2392 ++--- .../game/script/conversation/jinkins.script | 2892 +++--- .../conversation/junk_dealer_generic.script | 2204 ++--- .../conversation/junk_dealer_jawa.script | 866 +- .../conversation/junk_dealer_smuggler.script | 1294 +-- .../script/conversation/mako_ghast.script | 3552 +++---- .../conversation/moore_lok_cantina.script | 5234 +++++----- .../mtp_corsec_intelligence_officer.script | 1618 ++-- .../conversation/nym_arena_referee.script | 1316 +-- .../nym_themepark_quatermaster.script | 2770 +++--- ..._delivery_deathtrooper_conversation.script | 2904 +++--- .../conversation/rebel_pilot_rescue.script | 662 +- .../rebel_remembrance_day_wedge.script | 1076 +-- .../conversation/scientist_collection.script | 1798 ++-- .../game/script/conversation/sheeli.script | 942 +- .../shuttle_control_terminal.script | 1132 +-- .../game/script/conversation/vana_sage.script | 4866 +++++----- .../conversation/water_treatment.script | 2414 ++--- .../game/script/csr/get_resource_crate.script | 250 +- .../script/systems/gcw/stringsBestine.txt | 56 +- .../missions/base/mission_dynamic_base.script | 26 +- .../script/systems/spawning/spawn_base.script | 46 +- 54 files changed, 46336 insertions(+), 46336 deletions(-) diff --git a/sku.0/sys.server/compiled/game/script/conversation/bib_fortuna_mos_eisley.script b/sku.0/sys.server/compiled/game/script/conversation/bib_fortuna_mos_eisley.script index 03d8088e0..74ecfd3b6 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/bib_fortuna_mos_eisley.script +++ b/sku.0/sys.server/compiled/game/script/conversation/bib_fortuna_mos_eisley.script @@ -1,1106 +1,1106 @@ -// ====================================================================== -// -// bib_fortuna_mos_eisley.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.badge; -include library.buff; -include library.chat; -include library.collection; -include library.conversation; -include library.create; -include library.factions; -include library.groundquests; -include library.space_quest; -include library.static_item; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/bib_fortuna_mos_eisley"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean bib_fortuna_mos_eisley_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean bib_fortuna_mos_eisley_condition_hasComlinkQuest01Neut (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "quest_01_comlink_call_to_adventure_neut_faction"); -} - -// ---------------------------------------------------------------------- - -boolean bib_fortuna_mos_eisley_condition_hasComlinkQuest01Pos (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "quest_01_comlink_call_to_adventure_pos_faction"); -} - -// ---------------------------------------------------------------------- - -boolean bib_fortuna_mos_eisley_condition_hasComlinkQuest01Neg (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "quest_01_comlink_call_to_adventure_neg_faction"); -} - -// ---------------------------------------------------------------------- - -boolean bib_fortuna_mos_eisley_condition_hasTheBiolabClue (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return ( - (groundquests.isQuestActive(player, "quest_02_investigate_murder") - && groundquests.isTaskActive(player, "quest_02_investigate_murder", "talkBibFortunaBiolabClue")) - || (groundquests.hasCompletedQuest(player, "quest_02_investigate_murder") - && !groundquests.isQuestActiveOrComplete(player, "quest_03_investigate_biolab")) - ); -} - -// ---------------------------------------------------------------------- - -boolean bib_fortuna_mos_eisley_condition_hasBiolabQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "quest_02_investigate_murder") - && groundquests.isQuestActive(player, "quest_03_investigate_biolab"); -} - -// ---------------------------------------------------------------------- - -boolean bib_fortuna_mos_eisley_condition_hasCompletedBiolabQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "quest_03_investigate_biolab") - && groundquests.isQuestActive(player, "quest_04_meet_cale_herron"); -} - -// ---------------------------------------------------------------------- - -boolean bib_fortuna_mos_eisley_condition_needsToGatherClues (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "quest_02_investigate_murder", "speakHapper") - || groundquests.isTaskActive(player, "quest_02_investigate_murder", "identifyBody") - || groundquests.isTaskActive(player, "quest_02_investigate_murder", "getClues"); -} - -// ---------------------------------------------------------------------- - -boolean bib_fortuna_mos_eisley_condition_hasQuestOneNotQuestTwo (obj_id player, obj_id npc) -{ - return ( - !groundquests.isQuestActiveOrComplete(player, "quest_02_investigate_murder") - && (groundquests.hasCompletedQuest(player, "quest_01_comlink_call_to_adventure_pos_faction") - || groundquests.hasCompletedQuest(player, "quest_01_comlink_call_to_adventure_neg_faction") - || groundquests.hasCompletedQuest(player, "quest_01_comlink_call_to_adventure_neut_faction")) - ); -} - -// ---------------------------------------------------------------------- - -boolean bib_fortuna_mos_eisley_condition_hasCompletedBiolabButCancelHerron (obj_id player, obj_id npc) -{ - return groundquests.hasCompletedQuest(player, "quest_03_investigate_biolab") - && !groundquests.isQuestActiveOrComplete(player, "quest_04_meet_cale_herron"); -} - -// ---------------------------------------------------------------------- - -boolean bib_fortuna_mos_eisley_condition_hasCompletedInvestigationCancelBiolab (obj_id player, obj_id npc) -{ - return groundquests.hasCompletedQuest(player, "quest_02_investigate_murder") - && !groundquests.isQuestActiveOrComplete(player, "quest_03_investigate_biolab"); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void bib_fortuna_mos_eisley_action_comlinkQuestOnceSignal (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "bibWaitingForPlayer"); -} - -// ---------------------------------------------------------------------- - -void bib_fortuna_mos_eisley_action_grantQuest02Investigate (obj_id player, obj_id npc) -{ - bib_fortuna_mos_eisley_action_comlinkQuestOnceSignal(player, npc); - groundquests.grantQuest(player, "quest_02_investigate_murder"); -} - -// ---------------------------------------------------------------------- - -void bib_fortuna_mos_eisley_action_sendSignalAndGrantQuest03Biolab (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "quest02PlayerHasClues"); -} - -// ---------------------------------------------------------------------- - -void bib_fortuna_mos_eisley_action_grantQuest03 (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "quest_03_investigate_biolab"); -} - -// ---------------------------------------------------------------------- - -void bib_fortuna_mos_eisley_action_clearQuest03 (obj_id player, obj_id npc) -{ - groundquests.clearQuest(player, "quest_03_investigate_biolab"); -} - -// ---------------------------------------------------------------------- - -void bib_fortuna_mos_eisley_action_clearThenGrantQuest03 (obj_id player, obj_id npc) -{ - bib_fortuna_mos_eisley_action_clearQuest03(player, npc); - bib_fortuna_mos_eisley_action_grantQuest03(player, npc); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int bib_fortuna_mos_eisley_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Did you get lost? You were supposed to be looking into Bera Jeza's previous employer. - - //-- [RESPONSE NOTE] - //-- PLAYER: Oh...right. - if (response == "s_42") - { - //-- [NOTE] - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - bib_fortuna_mos_eisley_action_clearThenGrantQuest03 (player, npc); - - //-- NPC: Try again. - string_id message = new string_id (c_stringFile, "s_43"); - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int bib_fortuna_mos_eisley_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Well? - - //-- [RESPONSE NOTE] - //-- PLAYER: Well, I found out your lab assistant was involved in the Spice Manufacturing. - if (response == "s_23") - { - //-- [NOTE] - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - //-- NPC: And do you have any new clues as to the identity of the killer? Witnesses? Anything new? - string_id message = new string_id (c_stringFile, "s_24"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Bera Jeza worked at a local biolab here in Mos Eisley. - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_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.bib_fortuna_mos_eisley.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int bib_fortuna_mos_eisley_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: And do you have any new clues as to the identity of the killer? Witnesses? Anything new? - - //-- [RESPONSE NOTE] - //-- PLAYER: Bera Jeza worked at a local biolab here in Mos Eisley. - if (response == "s_25") - { - //-- [NOTE] - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - //-- NPC: Right. We know this already. Mos Eisley Biolab. Did the police have nothing else? - string_id message = new string_id (c_stringFile, "s_26"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: No. I figured I would start by visiting the employer. - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_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_27"); - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int bib_fortuna_mos_eisley_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Right. We know this already. Mos Eisley Biolab. Did the police have nothing else? - - //-- [RESPONSE NOTE] - //-- PLAYER: No. I figured I would start by visiting the employer. - if (response == "s_27") - { - //-- [NOTE] - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - bib_fortuna_mos_eisley_action_sendSignalAndGrantQuest03Biolab (player, npc); - - //-- NPC: Very well. Check back with us as soon are you find more details. Keep a keen eye out for any information regarding a new drug. Bera Jeza was in the middle of selling us some sort of super soldier drug and Jabba is very interested in getting his hands on the chemical makeup. Do not fail us, %TU. - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int bib_fortuna_mos_eisley_handleBranch11 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I'm not sure why Jabba has called upon the likes of you, %TU, but I obey. - - //-- [RESPONSE NOTE] - //-- PLAYER: What is going on here? - if (response == "s_30") - { - //-- [NOTE] - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - //-- NPC: A personal business associate of Jabba's has been murdered. Jabba is very interested in finding out who is responsible. - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: And this is where I come in... - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_34"); - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int bib_fortuna_mos_eisley_handleBranch12 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: A new face is important to keep discreet here, %TU. Jabba appreciates that you have answered the call. - - //-- [RESPONSE NOTE] - //-- PLAYER: What is going on here? - if (response == "s_30") - { - //-- [NOTE] - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - //-- NPC: A personal business associate of Jabba's has been murdered. Jabba is very interested in finding out who is responsible. - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: And this is where I come in... - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_34"); - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int bib_fortuna_mos_eisley_handleBranch13 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: It is good to see you again, %TU. I am glad that you have decided to answer Jabba's call. - - //-- [RESPONSE NOTE] - //-- PLAYER: What is going on here? - if (response == "s_30") - { - //-- [NOTE] - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - //-- NPC: A personal business associate of Jabba's has been murdered. Jabba is very interested in finding out who is responsible. - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: And this is where I come in... - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_34"); - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int bib_fortuna_mos_eisley_handleBranch14 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: A personal business associate of Jabba's has been murdered. Jabba is very interested in finding out who is responsible. - - //-- [RESPONSE NOTE] - //-- PLAYER: And this is where I come in... - if (response == "s_34") - { - //-- [NOTE] - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - //-- NPC: Correct. Start by identifying the body with the Mos Eisley Police. The dead female Aqualish is Bera Jeza, a lab assistant for some local lab. Claim that you are a close friend, then probe for information. - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Alright. I'll be back. - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_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.bib_fortuna_mos_eisley.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int bib_fortuna_mos_eisley_handleBranch15 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Correct. Start by identifying the body with the Mos Eisley Police. The dead female Aqualish is Bera Jeza, a lab assistant for some local lab. Claim that you are a close friend, then probe for information. - - //-- [RESPONSE NOTE] - //-- PLAYER: Alright. I'll be back. - if (response == "s_39") - { - //-- [NOTE] - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - bib_fortuna_mos_eisley_action_grantQuest02Investigate (player, npc); - - //-- NPC: Do so quickly. I need to report back to Jabba within the next few minutes. - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int bib_fortuna_mos_eisley_handleBranch17 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Start by identifying the body with the Mos Eisley Police. The dead female Aqualish is Bera Jeza, a lab assistant for some local lab. Claim that you are a close friend, then probe for information. - - //-- [RESPONSE NOTE] - //-- PLAYER: Alright. I'll be back. - if (response == "s_39") - { - //-- [NOTE] - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - bib_fortuna_mos_eisley_action_grantQuest02Investigate (player, npc); - - //-- NPC: Do so quickly. I need to report back to Jabba within the next few minutes. - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.bib_fortuna_mos_eisley"); - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; -} - -trigger OnAttach () -{ - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - 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.bib_fortuna_mos_eisley"); - - return SCRIPT_CONTINUE; -} - -trigger OnDetach () -{ - clearCondition (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 (bib_fortuna_mos_eisley_condition_hasCompletedBiolabButCancelHerron (player, npc)) - { - //-- NPC: Did you get lost? You were supposed to be looking into Bera Jeza's previous employer. - string_id message = new string_id (c_stringFile, "s_41"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Oh...right. - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_42"); - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 1); - - npcStartConversation (player, npc, "bib_fortuna_mos_eisley", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (bib_fortuna_mos_eisley_condition_hasCompletedBiolabQuest (player, npc)) - { - //-- NPC: Jabba gave you a job. Find Bera Jeza's killer so we may enact justice. - string_id message = new string_id (c_stringFile, "s_21"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (bib_fortuna_mos_eisley_condition_hasBiolabQuest (player, npc)) - { - //-- NPC: Find the bio-laboratory, %TU, then check in. Jabba is not patient about these things. - string_id message = new string_id (c_stringFile, "s_19"); - 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 (bib_fortuna_mos_eisley_condition_hasCompletedInvestigationCancelBiolab (player, npc)) - { - bib_fortuna_mos_eisley_action_grantQuest03 (player, npc); - - //-- NPC: You need to find the bio-laboratory, %TU, then check in. Jabba is not patient about these things. - string_id message = new string_id (c_stringFile, "s_47"); - 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 (bib_fortuna_mos_eisley_condition_hasTheBiolabClue (player, npc)) - { - //-- NPC: Well? - string_id message = new string_id (c_stringFile, "s_22"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Well, I found out your lab assistant was involved in the Spice Manufacturing. - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_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_23"); - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 6); - - npcStartConversation (player, npc, "bib_fortuna_mos_eisley", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (bib_fortuna_mos_eisley_condition_needsToGatherClues (player, npc)) - { - //-- NPC: Are you one of those henchmen that can't follow simple instructions? Speak with the Mos Eisley police and get some details. - string_id message = new string_id (c_stringFile, "s_37"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (bib_fortuna_mos_eisley_condition_hasComlinkQuest01Neg (player, npc)) - { - //-- NPC: I'm not sure why Jabba has called upon the likes of you, %TU, but I obey. - string_id message = new string_id (c_stringFile, "s_201"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What is going on here? - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_30"); - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 13); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "bib_fortuna_mos_eisley", 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 (bib_fortuna_mos_eisley_condition_hasComlinkQuest01Neut (player, npc)) - { - //-- NPC: A new face is important to keep discreet here, %TU. Jabba appreciates that you have answered the call. - string_id message = new string_id (c_stringFile, "s_203"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What is going on here? - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_30"); - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 13); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "bib_fortuna_mos_eisley", 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 (bib_fortuna_mos_eisley_condition_hasComlinkQuest01Pos (player, npc)) - { - //-- NPC: It is good to see you again, %TU. I am glad that you have decided to answer Jabba's call. - string_id message = new string_id (c_stringFile, "s_205"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What is going on here? - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_30"); - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 13); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "bib_fortuna_mos_eisley", 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 (bib_fortuna_mos_eisley_condition_hasQuestOneNotQuestTwo (player, npc)) - { - //-- NPC: Start by identifying the body with the Mos Eisley Police. The dead female Aqualish is Bera Jeza, a lab assistant for some local lab. Claim that you are a close friend, then probe for information. - string_id message = new string_id (c_stringFile, "s_46"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Alright. I'll be back. - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_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.bib_fortuna_mos_eisley.branchId", 15); - - npcStartConversation (player, npc, "bib_fortuna_mos_eisley", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "wave_on_dismissing"); - - //-- NPC: I'm waiting for someone at the moment and it isn't you. - string_id message = new string_id (c_stringFile, "s_195"); - 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 != "bib_fortuna_mos_eisley") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - if (branchId == 1 && bib_fortuna_mos_eisley_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && bib_fortuna_mos_eisley_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && bib_fortuna_mos_eisley_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && bib_fortuna_mos_eisley_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 11 && bib_fortuna_mos_eisley_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 12 && bib_fortuna_mos_eisley_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 13 && bib_fortuna_mos_eisley_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 14 && bib_fortuna_mos_eisley_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 15 && bib_fortuna_mos_eisley_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 17 && bib_fortuna_mos_eisley_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// bib_fortuna_mos_eisley.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.badge; +include library.buff; +include library.chat; +include library.collection; +include library.conversation; +include library.create; +include library.factions; +include library.groundquests; +include library.space_quest; +include library.static_item; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/bib_fortuna_mos_eisley"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean bib_fortuna_mos_eisley_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean bib_fortuna_mos_eisley_condition_hasComlinkQuest01Neut (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "quest_01_comlink_call_to_adventure_neut_faction"); +} + +// ---------------------------------------------------------------------- + +boolean bib_fortuna_mos_eisley_condition_hasComlinkQuest01Pos (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "quest_01_comlink_call_to_adventure_pos_faction"); +} + +// ---------------------------------------------------------------------- + +boolean bib_fortuna_mos_eisley_condition_hasComlinkQuest01Neg (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "quest_01_comlink_call_to_adventure_neg_faction"); +} + +// ---------------------------------------------------------------------- + +boolean bib_fortuna_mos_eisley_condition_hasTheBiolabClue (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return ( + (groundquests.isQuestActive(player, "quest_02_investigate_murder") + && groundquests.isTaskActive(player, "quest_02_investigate_murder", "talkBibFortunaBiolabClue")) + || (groundquests.hasCompletedQuest(player, "quest_02_investigate_murder") + && !groundquests.isQuestActiveOrComplete(player, "quest_03_investigate_biolab")) + ); +} + +// ---------------------------------------------------------------------- + +boolean bib_fortuna_mos_eisley_condition_hasBiolabQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedQuest(player, "quest_02_investigate_murder") + && groundquests.isQuestActive(player, "quest_03_investigate_biolab"); +} + +// ---------------------------------------------------------------------- + +boolean bib_fortuna_mos_eisley_condition_hasCompletedBiolabQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedQuest(player, "quest_03_investigate_biolab") + && groundquests.isQuestActive(player, "quest_04_meet_cale_herron"); +} + +// ---------------------------------------------------------------------- + +boolean bib_fortuna_mos_eisley_condition_needsToGatherClues (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "quest_02_investigate_murder", "speakHapper") + || groundquests.isTaskActive(player, "quest_02_investigate_murder", "identifyBody") + || groundquests.isTaskActive(player, "quest_02_investigate_murder", "getClues"); +} + +// ---------------------------------------------------------------------- + +boolean bib_fortuna_mos_eisley_condition_hasQuestOneNotQuestTwo (obj_id player, obj_id npc) +{ + return ( + !groundquests.isQuestActiveOrComplete(player, "quest_02_investigate_murder") + && (groundquests.hasCompletedQuest(player, "quest_01_comlink_call_to_adventure_pos_faction") + || groundquests.hasCompletedQuest(player, "quest_01_comlink_call_to_adventure_neg_faction") + || groundquests.hasCompletedQuest(player, "quest_01_comlink_call_to_adventure_neut_faction")) + ); +} + +// ---------------------------------------------------------------------- + +boolean bib_fortuna_mos_eisley_condition_hasCompletedBiolabButCancelHerron (obj_id player, obj_id npc) +{ + return groundquests.hasCompletedQuest(player, "quest_03_investigate_biolab") + && !groundquests.isQuestActiveOrComplete(player, "quest_04_meet_cale_herron"); +} + +// ---------------------------------------------------------------------- + +boolean bib_fortuna_mos_eisley_condition_hasCompletedInvestigationCancelBiolab (obj_id player, obj_id npc) +{ + return groundquests.hasCompletedQuest(player, "quest_02_investigate_murder") + && !groundquests.isQuestActiveOrComplete(player, "quest_03_investigate_biolab"); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void bib_fortuna_mos_eisley_action_comlinkQuestOnceSignal (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "bibWaitingForPlayer"); +} + +// ---------------------------------------------------------------------- + +void bib_fortuna_mos_eisley_action_grantQuest02Investigate (obj_id player, obj_id npc) +{ + bib_fortuna_mos_eisley_action_comlinkQuestOnceSignal(player, npc); + groundquests.grantQuest(player, "quest_02_investigate_murder"); +} + +// ---------------------------------------------------------------------- + +void bib_fortuna_mos_eisley_action_sendSignalAndGrantQuest03Biolab (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "quest02PlayerHasClues"); +} + +// ---------------------------------------------------------------------- + +void bib_fortuna_mos_eisley_action_grantQuest03 (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "quest_03_investigate_biolab"); +} + +// ---------------------------------------------------------------------- + +void bib_fortuna_mos_eisley_action_clearQuest03 (obj_id player, obj_id npc) +{ + groundquests.clearQuest(player, "quest_03_investigate_biolab"); +} + +// ---------------------------------------------------------------------- + +void bib_fortuna_mos_eisley_action_clearThenGrantQuest03 (obj_id player, obj_id npc) +{ + bib_fortuna_mos_eisley_action_clearQuest03(player, npc); + bib_fortuna_mos_eisley_action_grantQuest03(player, npc); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int bib_fortuna_mos_eisley_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Did you get lost? You were supposed to be looking into Bera Jeza's previous employer. + + //-- [RESPONSE NOTE] + //-- PLAYER: Oh...right. + if (response == "s_42") + { + //-- [NOTE] + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + bib_fortuna_mos_eisley_action_clearThenGrantQuest03 (player, npc); + + //-- NPC: Try again. + string_id message = new string_id (c_stringFile, "s_43"); + utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int bib_fortuna_mos_eisley_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Well? + + //-- [RESPONSE NOTE] + //-- PLAYER: Well, I found out your lab assistant was involved in the Spice Manufacturing. + if (response == "s_23") + { + //-- [NOTE] + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + //-- NPC: And do you have any new clues as to the identity of the killer? Witnesses? Anything new? + string_id message = new string_id (c_stringFile, "s_24"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Bera Jeza worked at a local biolab here in Mos Eisley. + boolean hasResponse0 = false; + if (bib_fortuna_mos_eisley_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.bib_fortuna_mos_eisley.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int bib_fortuna_mos_eisley_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: And do you have any new clues as to the identity of the killer? Witnesses? Anything new? + + //-- [RESPONSE NOTE] + //-- PLAYER: Bera Jeza worked at a local biolab here in Mos Eisley. + if (response == "s_25") + { + //-- [NOTE] + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + //-- NPC: Right. We know this already. Mos Eisley Biolab. Did the police have nothing else? + string_id message = new string_id (c_stringFile, "s_26"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: No. I figured I would start by visiting the employer. + boolean hasResponse0 = false; + if (bib_fortuna_mos_eisley_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_27"); + + utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int bib_fortuna_mos_eisley_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Right. We know this already. Mos Eisley Biolab. Did the police have nothing else? + + //-- [RESPONSE NOTE] + //-- PLAYER: No. I figured I would start by visiting the employer. + if (response == "s_27") + { + //-- [NOTE] + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + bib_fortuna_mos_eisley_action_sendSignalAndGrantQuest03Biolab (player, npc); + + //-- NPC: Very well. Check back with us as soon are you find more details. Keep a keen eye out for any information regarding a new drug. Bera Jeza was in the middle of selling us some sort of super soldier drug and Jabba is very interested in getting his hands on the chemical makeup. Do not fail us, %TU. + string_id message = new string_id (c_stringFile, "s_28"); + utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int bib_fortuna_mos_eisley_handleBranch11 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I'm not sure why Jabba has called upon the likes of you, %TU, but I obey. + + //-- [RESPONSE NOTE] + //-- PLAYER: What is going on here? + if (response == "s_30") + { + //-- [NOTE] + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + //-- NPC: A personal business associate of Jabba's has been murdered. Jabba is very interested in finding out who is responsible. + string_id message = new string_id (c_stringFile, "s_32"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: And this is where I come in... + boolean hasResponse0 = false; + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_34"); + + utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 14); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int bib_fortuna_mos_eisley_handleBranch12 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: A new face is important to keep discreet here, %TU. Jabba appreciates that you have answered the call. + + //-- [RESPONSE NOTE] + //-- PLAYER: What is going on here? + if (response == "s_30") + { + //-- [NOTE] + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + //-- NPC: A personal business associate of Jabba's has been murdered. Jabba is very interested in finding out who is responsible. + string_id message = new string_id (c_stringFile, "s_32"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: And this is where I come in... + boolean hasResponse0 = false; + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_34"); + + utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 14); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int bib_fortuna_mos_eisley_handleBranch13 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: It is good to see you again, %TU. I am glad that you have decided to answer Jabba's call. + + //-- [RESPONSE NOTE] + //-- PLAYER: What is going on here? + if (response == "s_30") + { + //-- [NOTE] + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + //-- NPC: A personal business associate of Jabba's has been murdered. Jabba is very interested in finding out who is responsible. + string_id message = new string_id (c_stringFile, "s_32"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: And this is where I come in... + boolean hasResponse0 = false; + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_34"); + + utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 14); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int bib_fortuna_mos_eisley_handleBranch14 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: A personal business associate of Jabba's has been murdered. Jabba is very interested in finding out who is responsible. + + //-- [RESPONSE NOTE] + //-- PLAYER: And this is where I come in... + if (response == "s_34") + { + //-- [NOTE] + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + //-- NPC: Correct. Start by identifying the body with the Mos Eisley Police. The dead female Aqualish is Bera Jeza, a lab assistant for some local lab. Claim that you are a close friend, then probe for information. + string_id message = new string_id (c_stringFile, "s_36"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Alright. I'll be back. + boolean hasResponse0 = false; + if (bib_fortuna_mos_eisley_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.bib_fortuna_mos_eisley.branchId", 15); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int bib_fortuna_mos_eisley_handleBranch15 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Correct. Start by identifying the body with the Mos Eisley Police. The dead female Aqualish is Bera Jeza, a lab assistant for some local lab. Claim that you are a close friend, then probe for information. + + //-- [RESPONSE NOTE] + //-- PLAYER: Alright. I'll be back. + if (response == "s_39") + { + //-- [NOTE] + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + bib_fortuna_mos_eisley_action_grantQuest02Investigate (player, npc); + + //-- NPC: Do so quickly. I need to report back to Jabba within the next few minutes. + string_id message = new string_id (c_stringFile, "s_44"); + utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int bib_fortuna_mos_eisley_handleBranch17 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Start by identifying the body with the Mos Eisley Police. The dead female Aqualish is Bera Jeza, a lab assistant for some local lab. Claim that you are a close friend, then probe for information. + + //-- [RESPONSE NOTE] + //-- PLAYER: Alright. I'll be back. + if (response == "s_39") + { + //-- [NOTE] + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + bib_fortuna_mos_eisley_action_grantQuest02Investigate (player, npc); + + //-- NPC: Do so quickly. I need to report back to Jabba within the next few minutes. + string_id message = new string_id (c_stringFile, "s_44"); + utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.bib_fortuna_mos_eisley"); + + setCondition (self, CONDITION_CONVERSABLE); + setCondition (self, CONDITION_INTERESTING); + return SCRIPT_CONTINUE; +} + +trigger OnAttach () +{ + + setCondition (self, CONDITION_CONVERSABLE); + setCondition (self, CONDITION_INTERESTING); + 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.bib_fortuna_mos_eisley"); + + return SCRIPT_CONTINUE; +} + +trigger OnDetach () +{ + clearCondition (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 (bib_fortuna_mos_eisley_condition_hasCompletedBiolabButCancelHerron (player, npc)) + { + //-- NPC: Did you get lost? You were supposed to be looking into Bera Jeza's previous employer. + string_id message = new string_id (c_stringFile, "s_41"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Oh...right. + boolean hasResponse0 = false; + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_42"); + + utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 1); + + npcStartConversation (player, npc, "bib_fortuna_mos_eisley", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (bib_fortuna_mos_eisley_condition_hasCompletedBiolabQuest (player, npc)) + { + //-- NPC: Jabba gave you a job. Find Bera Jeza's killer so we may enact justice. + string_id message = new string_id (c_stringFile, "s_21"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (bib_fortuna_mos_eisley_condition_hasBiolabQuest (player, npc)) + { + //-- NPC: Find the bio-laboratory, %TU, then check in. Jabba is not patient about these things. + string_id message = new string_id (c_stringFile, "s_19"); + 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 (bib_fortuna_mos_eisley_condition_hasCompletedInvestigationCancelBiolab (player, npc)) + { + bib_fortuna_mos_eisley_action_grantQuest03 (player, npc); + + //-- NPC: You need to find the bio-laboratory, %TU, then check in. Jabba is not patient about these things. + string_id message = new string_id (c_stringFile, "s_47"); + 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 (bib_fortuna_mos_eisley_condition_hasTheBiolabClue (player, npc)) + { + //-- NPC: Well? + string_id message = new string_id (c_stringFile, "s_22"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Well, I found out your lab assistant was involved in the Spice Manufacturing. + boolean hasResponse0 = false; + if (bib_fortuna_mos_eisley_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_23"); + + utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 6); + + npcStartConversation (player, npc, "bib_fortuna_mos_eisley", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (bib_fortuna_mos_eisley_condition_needsToGatherClues (player, npc)) + { + //-- NPC: Are you one of those henchmen that can't follow simple instructions? Speak with the Mos Eisley police and get some details. + string_id message = new string_id (c_stringFile, "s_37"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (bib_fortuna_mos_eisley_condition_hasComlinkQuest01Neg (player, npc)) + { + //-- NPC: I'm not sure why Jabba has called upon the likes of you, %TU, but I obey. + string_id message = new string_id (c_stringFile, "s_201"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What is going on here? + boolean hasResponse0 = false; + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_30"); + + utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 13); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "bib_fortuna_mos_eisley", 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 (bib_fortuna_mos_eisley_condition_hasComlinkQuest01Neut (player, npc)) + { + //-- NPC: A new face is important to keep discreet here, %TU. Jabba appreciates that you have answered the call. + string_id message = new string_id (c_stringFile, "s_203"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What is going on here? + boolean hasResponse0 = false; + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_30"); + + utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 13); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "bib_fortuna_mos_eisley", 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 (bib_fortuna_mos_eisley_condition_hasComlinkQuest01Pos (player, npc)) + { + //-- NPC: It is good to see you again, %TU. I am glad that you have decided to answer Jabba's call. + string_id message = new string_id (c_stringFile, "s_205"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What is going on here? + boolean hasResponse0 = false; + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_30"); + + utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 13); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "bib_fortuna_mos_eisley", 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 (bib_fortuna_mos_eisley_condition_hasQuestOneNotQuestTwo (player, npc)) + { + //-- NPC: Start by identifying the body with the Mos Eisley Police. The dead female Aqualish is Bera Jeza, a lab assistant for some local lab. Claim that you are a close friend, then probe for information. + string_id message = new string_id (c_stringFile, "s_46"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Alright. I'll be back. + boolean hasResponse0 = false; + if (bib_fortuna_mos_eisley_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.bib_fortuna_mos_eisley.branchId", 15); + + npcStartConversation (player, npc, "bib_fortuna_mos_eisley", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "wave_on_dismissing"); + + //-- NPC: I'm waiting for someone at the moment and it isn't you. + string_id message = new string_id (c_stringFile, "s_195"); + 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 != "bib_fortuna_mos_eisley") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); + + if (branchId == 1 && bib_fortuna_mos_eisley_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && bib_fortuna_mos_eisley_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && bib_fortuna_mos_eisley_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && bib_fortuna_mos_eisley_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 11 && bib_fortuna_mos_eisley_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 12 && bib_fortuna_mos_eisley_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 13 && bib_fortuna_mos_eisley_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 14 && bib_fortuna_mos_eisley_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 15 && bib_fortuna_mos_eisley_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 17 && bib_fortuna_mos_eisley_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave.script b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave.script index deb0d8d21..6fee97d56 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave.script +++ b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave.script @@ -1,337 +1,337 @@ -// ====================================================================== -// -// boss_terminal_mining_cave.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.create; -include library.features; -include library.groundquests; -include library.space_quest; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/boss_terminal_mining_cave"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean boss_terminal_mining_cave_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_cave_condition_hasQuest (obj_id player, obj_id npc) -{ - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_cave_condition_hasGroup (obj_id player, obj_id npc) -{ - obj_id groupid = getGroupObject(player); - if(!isValidId(groupid)) - { - //systemMessageTestingOnly(player, "no group"); - return false; - } - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_cave_condition_hasBossTask (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_boss_1", "findNymsGirlfriend") - || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_boss_1", "fightNymsGirlfriend"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_cave_condition_hasQuestAndGroup (obj_id player, obj_id npc) -{ - if(!boss_terminal_mining_cave_condition_hasGroup(player,npc)) - return false; - if(!boss_terminal_mining_cave_condition_hasQuest(player,npc)) - return false; - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_cave_condition_wave_event_active (obj_id player, obj_id npc) -{ - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void boss_terminal_mining_cave_action_startEvent (obj_id player, obj_id npc) -{ - //Tell the controller we are busy. - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 0, false); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_mining_cave_action_foundTerminal (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundNymsGirlfriend"); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_mining_cave_action_unauthorizedUse (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_mining_cave_action_busyWithOtherPlayer (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int boss_terminal_mining_cave_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Holding Pen Terminal - - //-- [RESPONSE NOTE] - //-- PLAYER: Open holding pen. - if (response == "s_36") - { - //-- [NOTE] - if (boss_terminal_mining_cave_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_cave_action_startEvent (player, npc); - - //-- NPC: Command accepted. Opening Pen to 'Nym's Girlfriend' - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave.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; -} - -messageHandler spawnEnemies() -{ - if(params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; -} - -messageHandler handleQuestFlavorObjectCleanup() -{ - if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if(objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for(int i = 0; 1 < objList.length; i++) - { - if(!isValidId(objList[i])) - continue; - - messageTo(objList[i], "destroySelf", null, 0, false); - } - 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 (boss_terminal_mining_cave_condition_wave_event_active (player, npc)) - { - //-- NPC: Terminal busy. - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_mining_cave_condition_hasBossTask (player, npc)) - { - boss_terminal_mining_cave_action_foundTerminal (player, npc); - - //-- NPC: Holding Pen Terminal - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Open holding pen. - boolean hasResponse0 = false; - if (boss_terminal_mining_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_36"); - - utils.setScriptVar (player, "conversation.boss_terminal_mining_cave.branchId", 2); - - npcStartConversation (player, npc, "boss_terminal_mining_cave", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_mining_cave_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_cave_action_unauthorizedUse (player, npc); - - //-- NPC: Unauthorized message - string_id message = new string_id (c_stringFile, "s_34"); - 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 != "boss_terminal_mining_cave") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_mining_cave.branchId"); - - if (branchId == 2 && boss_terminal_mining_cave_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// boss_terminal_mining_cave.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.create; +include library.features; +include library.groundquests; +include library.space_quest; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/boss_terminal_mining_cave"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean boss_terminal_mining_cave_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_cave_condition_hasQuest (obj_id player, obj_id npc) +{ + return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_cave_condition_hasGroup (obj_id player, obj_id npc) +{ + obj_id groupid = getGroupObject(player); + if(!isValidId(groupid)) + { + //systemMessageTestingOnly(player, "no group"); + return false; + } + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_cave_condition_hasBossTask (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_boss_1", "findNymsGirlfriend") + || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_boss_1", "fightNymsGirlfriend"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_cave_condition_hasQuestAndGroup (obj_id player, obj_id npc) +{ + if(!boss_terminal_mining_cave_condition_hasGroup(player,npc)) + return false; + if(!boss_terminal_mining_cave_condition_hasQuest(player,npc)) + return false; + return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_cave_condition_wave_event_active (obj_id player, obj_id npc) +{ + int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); + return wave > 0; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void boss_terminal_mining_cave_action_startEvent (obj_id player, obj_id npc) +{ + //Tell the controller we are busy. + dictionary dict = new dictionary(); + dict.put("player", player); + messageTo(npc, "waveEventControllerNPCStart", dict, 0, false); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_mining_cave_action_foundTerminal (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundNymsGirlfriend"); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_mining_cave_action_unauthorizedUse (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); + chat.chat(npc, barkString); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_mining_cave_action_busyWithOtherPlayer (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); + chat.chat(npc, barkString); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int boss_terminal_mining_cave_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Holding Pen Terminal + + //-- [RESPONSE NOTE] + //-- PLAYER: Open holding pen. + if (response == "s_36") + { + //-- [NOTE] + if (boss_terminal_mining_cave_condition__defaultCondition (player, npc)) + { + boss_terminal_mining_cave_action_startEvent (player, npc); + + //-- NPC: Command accepted. Opening Pen to 'Nym's Girlfriend' + string_id message = new string_id (c_stringFile, "s_37"); + utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave.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; +} + +messageHandler spawnEnemies() +{ + if(params == null) + { + return SCRIPT_CONTINUE; + } + + messageTo(self, "waveEventControllerNPCStart", params, 0, false); + return SCRIPT_CONTINUE; +} + +messageHandler handleQuestFlavorObjectCleanup() +{ + if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) + { + return SCRIPT_CONTINUE; + } + + obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); + if(objList == null || objList.length <= 0) + { + return SCRIPT_CONTINUE; + } + + for(int i = 0; 1 < objList.length; i++) + { + if(!isValidId(objList[i])) + continue; + + messageTo(objList[i], "destroySelf", null, 0, false); + } + 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 (boss_terminal_mining_cave_condition_wave_event_active (player, npc)) + { + //-- NPC: Terminal busy. + string_id message = new string_id (c_stringFile, "s_7"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_mining_cave_condition_hasBossTask (player, npc)) + { + boss_terminal_mining_cave_action_foundTerminal (player, npc); + + //-- NPC: Holding Pen Terminal + string_id message = new string_id (c_stringFile, "s_35"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Open holding pen. + boolean hasResponse0 = false; + if (boss_terminal_mining_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_36"); + + utils.setScriptVar (player, "conversation.boss_terminal_mining_cave.branchId", 2); + + npcStartConversation (player, npc, "boss_terminal_mining_cave", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_mining_cave_condition__defaultCondition (player, npc)) + { + boss_terminal_mining_cave_action_unauthorizedUse (player, npc); + + //-- NPC: Unauthorized message + string_id message = new string_id (c_stringFile, "s_34"); + 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 != "boss_terminal_mining_cave") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_mining_cave.branchId"); + + if (branchId == 2 && boss_terminal_mining_cave_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_controller.script b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_controller.script index dc30630ac..e27991b49 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_controller.script +++ b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_controller.script @@ -1,474 +1,474 @@ -// ====================================================================== -// -// boss_terminal_mining_cave_controller.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.create; -include library.features; -include library.groundquests; -include library.space_quest; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/boss_terminal_mining_cave_controller"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean boss_terminal_mining_cave_controller_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_cave_controller_condition_hasQuest (obj_id player, obj_id npc) -{ - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_cave_controller_condition_hasGroup (obj_id player, obj_id npc) -{ - obj_id groupid = getGroupObject(player); - if(!isValidId(groupid)) - { - //systemMessageTestingOnly(player, "no group"); - return false; - } - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_cave_controller_condition_hasBossTask (obj_id player, obj_id npc) -{ - return (groundquests.isTaskActive(player, "u16_nym_themepark_mine_boss", "FindControllerMine") - || groundquests.isTaskActive(player, "u16_nym_themepark_mine_boss", "killControllerMine")) - && hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_mine_activate"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_cave_controller_condition_hasQuestAndGroup (obj_id player, obj_id npc) -{ - if(!boss_terminal_mining_cave_controller_condition_hasGroup(player,npc)) - return false; - if(!boss_terminal_mining_cave_controller_condition_hasQuest(player,npc)) - return false; - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_cave_controller_condition_wave_event_active (obj_id player, obj_id npc) -{ - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void boss_terminal_mining_cave_controller_action_startEvent (obj_id player, obj_id npc) -{ - boss_terminal_mining_cave_controller_action_foundTerminal(player,npc); - //Tell the controller we are busy. - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 4, false); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_mining_cave_controller_action_foundTerminal (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "HasFoundControllerMine"); - obj_id myGroup = getGroupObject(player); - if(isValidId(myGroup)) - { - obj_id[] members = getGroupMemberIds(myGroup); - - for(int i = 0; i < members.length; i++) - { - if(!isIdValid(members[i]) || !exists(members[i])) - continue; - - if(getDistance(members[i], npc) > 200) - continue; - - if(boss_terminal_mining_cave_controller_condition_hasBossTask(members[i], npc)) - { - groundquests.sendSignal(members[i], "HasFoundControllerMine"); - } - } - } -} - -// ---------------------------------------------------------------------- - -void boss_terminal_mining_cave_controller_action_unauthorizedUse (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_mining_cave_controller_action_busyWithOtherPlayer (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int boss_terminal_mining_cave_controller_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Terminal busy. - - //-- [RESPONSE NOTE] - //-- PLAYER: Log Off - if (response == "s_9") - { - //-- [NOTE] - if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) - { - //-- NPC: Have a nice day! - string_id message = new string_id (c_stringFile, "s_10"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int boss_terminal_mining_cave_controller_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Mine Controller Terminal - - //-- [RESPONSE NOTE] - //-- PLAYER: Call the Mine Controller - if (response == "s_36") - { - //-- [NOTE] - if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_cave_controller_action_startEvent (player, npc); - - //-- NPC: Command accepted. - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int boss_terminal_mining_cave_controller_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Unauthorized terminal access. - - //-- [RESPONSE NOTE] - //-- PLAYER: Log off. - if (response == "s_14") - { - //-- [NOTE] - if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) - { - //-- NPC: Have a nice day! - string_id message = new string_id (c_stringFile, "s_16"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_controller.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; -} - -messageHandler spawnEnemies() -{ - if(params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; -} - -messageHandler handleQuestFlavorObjectCleanup() -{ - if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if(objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for(int i = 0; 1 < objList.length; i++) - { - if(!isValidId(objList[i])) - continue; - - messageTo(objList[i], "destroySelf", null, 0, false); - } - 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 (boss_terminal_mining_cave_controller_condition_wave_event_active (player, npc)) - { - //-- NPC: Terminal busy. - string_id message = new string_id (c_stringFile, "s_7"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Log Off - boolean hasResponse0 = false; - if (boss_terminal_mining_cave_controller_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_9"); - - utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId", 1); - - npcStartConversation (player, npc, "boss_terminal_mining_cave_controller", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_mining_cave_controller_condition_hasBossTask (player, npc)) - { - //-- NPC: Mine Controller Terminal - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Call the Mine Controller - boolean hasResponse0 = false; - if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_36"); - - utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId", 3); - - npcStartConversation (player, npc, "boss_terminal_mining_cave_controller", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_cave_controller_action_unauthorizedUse (player, npc); - - //-- NPC: Unauthorized terminal access. - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Log off. - boolean hasResponse0 = false; - if (boss_terminal_mining_cave_controller_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_14"); - - utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId", 5); - - npcStartConversation (player, npc, "boss_terminal_mining_cave_controller", 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 != "boss_terminal_mining_cave_controller") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId"); - - if (branchId == 1 && boss_terminal_mining_cave_controller_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && boss_terminal_mining_cave_controller_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && boss_terminal_mining_cave_controller_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// boss_terminal_mining_cave_controller.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.create; +include library.features; +include library.groundquests; +include library.space_quest; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/boss_terminal_mining_cave_controller"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean boss_terminal_mining_cave_controller_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_cave_controller_condition_hasQuest (obj_id player, obj_id npc) +{ + return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_cave_controller_condition_hasGroup (obj_id player, obj_id npc) +{ + obj_id groupid = getGroupObject(player); + if(!isValidId(groupid)) + { + //systemMessageTestingOnly(player, "no group"); + return false; + } + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_cave_controller_condition_hasBossTask (obj_id player, obj_id npc) +{ + return (groundquests.isTaskActive(player, "u16_nym_themepark_mine_boss", "FindControllerMine") + || groundquests.isTaskActive(player, "u16_nym_themepark_mine_boss", "killControllerMine")) + && hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_mine_activate"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_cave_controller_condition_hasQuestAndGroup (obj_id player, obj_id npc) +{ + if(!boss_terminal_mining_cave_controller_condition_hasGroup(player,npc)) + return false; + if(!boss_terminal_mining_cave_controller_condition_hasQuest(player,npc)) + return false; + return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_cave_controller_condition_wave_event_active (obj_id player, obj_id npc) +{ + int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); + return wave > 0; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void boss_terminal_mining_cave_controller_action_startEvent (obj_id player, obj_id npc) +{ + boss_terminal_mining_cave_controller_action_foundTerminal(player,npc); + //Tell the controller we are busy. + dictionary dict = new dictionary(); + dict.put("player", player); + messageTo(npc, "waveEventControllerNPCStart", dict, 4, false); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_mining_cave_controller_action_foundTerminal (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "HasFoundControllerMine"); + obj_id myGroup = getGroupObject(player); + if(isValidId(myGroup)) + { + obj_id[] members = getGroupMemberIds(myGroup); + + for(int i = 0; i < members.length; i++) + { + if(!isIdValid(members[i]) || !exists(members[i])) + continue; + + if(getDistance(members[i], npc) > 200) + continue; + + if(boss_terminal_mining_cave_controller_condition_hasBossTask(members[i], npc)) + { + groundquests.sendSignal(members[i], "HasFoundControllerMine"); + } + } + } +} + +// ---------------------------------------------------------------------- + +void boss_terminal_mining_cave_controller_action_unauthorizedUse (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); + chat.chat(npc, barkString); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_mining_cave_controller_action_busyWithOtherPlayer (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); + chat.chat(npc, barkString); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int boss_terminal_mining_cave_controller_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Terminal busy. + + //-- [RESPONSE NOTE] + //-- PLAYER: Log Off + if (response == "s_9") + { + //-- [NOTE] + if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) + { + //-- NPC: Have a nice day! + string_id message = new string_id (c_stringFile, "s_10"); + utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int boss_terminal_mining_cave_controller_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Mine Controller Terminal + + //-- [RESPONSE NOTE] + //-- PLAYER: Call the Mine Controller + if (response == "s_36") + { + //-- [NOTE] + if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) + { + boss_terminal_mining_cave_controller_action_startEvent (player, npc); + + //-- NPC: Command accepted. + string_id message = new string_id (c_stringFile, "s_37"); + utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int boss_terminal_mining_cave_controller_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Unauthorized terminal access. + + //-- [RESPONSE NOTE] + //-- PLAYER: Log off. + if (response == "s_14") + { + //-- [NOTE] + if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) + { + //-- NPC: Have a nice day! + string_id message = new string_id (c_stringFile, "s_16"); + utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_controller.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; +} + +messageHandler spawnEnemies() +{ + if(params == null) + { + return SCRIPT_CONTINUE; + } + + messageTo(self, "waveEventControllerNPCStart", params, 0, false); + return SCRIPT_CONTINUE; +} + +messageHandler handleQuestFlavorObjectCleanup() +{ + if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) + { + return SCRIPT_CONTINUE; + } + + obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); + if(objList == null || objList.length <= 0) + { + return SCRIPT_CONTINUE; + } + + for(int i = 0; 1 < objList.length; i++) + { + if(!isValidId(objList[i])) + continue; + + messageTo(objList[i], "destroySelf", null, 0, false); + } + 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 (boss_terminal_mining_cave_controller_condition_wave_event_active (player, npc)) + { + //-- NPC: Terminal busy. + string_id message = new string_id (c_stringFile, "s_7"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Log Off + boolean hasResponse0 = false; + if (boss_terminal_mining_cave_controller_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_9"); + + utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId", 1); + + npcStartConversation (player, npc, "boss_terminal_mining_cave_controller", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_mining_cave_controller_condition_hasBossTask (player, npc)) + { + //-- NPC: Mine Controller Terminal + string_id message = new string_id (c_stringFile, "s_35"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Call the Mine Controller + boolean hasResponse0 = false; + if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_36"); + + utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId", 3); + + npcStartConversation (player, npc, "boss_terminal_mining_cave_controller", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) + { + boss_terminal_mining_cave_controller_action_unauthorizedUse (player, npc); + + //-- NPC: Unauthorized terminal access. + string_id message = new string_id (c_stringFile, "s_34"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Log off. + boolean hasResponse0 = false; + if (boss_terminal_mining_cave_controller_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_14"); + + utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId", 5); + + npcStartConversation (player, npc, "boss_terminal_mining_cave_controller", 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 != "boss_terminal_mining_cave_controller") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId"); + + if (branchId == 1 && boss_terminal_mining_cave_controller_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && boss_terminal_mining_cave_controller_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && boss_terminal_mining_cave_controller_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_foreman.script b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_foreman.script index 93580dd35..a0fc3d9ff 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_foreman.script +++ b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_foreman.script @@ -1,474 +1,474 @@ -// ====================================================================== -// -// boss_terminal_mining_cave_foreman.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.create; -include library.features; -include library.groundquests; -include library.space_quest; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/boss_terminal_mining_cave_foreman"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean boss_terminal_mining_cave_foreman_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_cave_foreman_condition_hasQuest (obj_id player, obj_id npc) -{ - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_cave_foreman_condition_hasGroup (obj_id player, obj_id npc) -{ - obj_id groupid = getGroupObject(player); - if(!isValidId(groupid)) - { - //systemMessageTestingOnly(player, "no group"); - return false; - } - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_cave_foreman_condition_hasBossTask (obj_id player, obj_id npc) -{ - return (groundquests.isTaskActive(player, "u16_nym_themepark_mine_boss", "findForemanMine") - || groundquests.isTaskActive(player, "u16_nym_themepark_mine_boss", "killGrandForeman")) - && hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_mine_activate"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_cave_foreman_condition_hasQuestAndGroup (obj_id player, obj_id npc) -{ - if(!boss_terminal_mining_cave_foreman_condition_hasGroup(player,npc)) - return false; - if(!boss_terminal_mining_cave_foreman_condition_hasQuest(player,npc)) - return false; - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_cave_foreman_condition_wave_event_active (obj_id player, obj_id npc) -{ - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void boss_terminal_mining_cave_foreman_action_startEvent (obj_id player, obj_id npc) -{ - boss_terminal_mining_cave_foreman_action_foundTerminal(player,npc); - //Tell the controller we are busy. - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 4, false); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_mining_cave_foreman_action_foundTerminal (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundForemanMine"); - obj_id myGroup = getGroupObject(player); - if(isValidId(myGroup)) - { - obj_id[] members = getGroupMemberIds(myGroup); - - for(int i = 0; i < members.length; i++) - { - if(!isIdValid(members[i]) || !exists(members[i])) - continue; - - if(getDistance(members[i], npc) > 200) - continue; - - if(boss_terminal_mining_cave_foreman_condition_hasBossTask(members[i], npc)) - { - groundquests.sendSignal(members[i], "hasFoundForemanMine"); - } - } - } -} - -// ---------------------------------------------------------------------- - -void boss_terminal_mining_cave_foreman_action_unauthorizedUse (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_mining_cave_foreman_action_busyWithOtherPlayer (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int boss_terminal_mining_cave_foreman_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Terminal busy. - - //-- [RESPONSE NOTE] - //-- PLAYER: Log Off - if (response == "s_9") - { - //-- [NOTE] - if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) - { - //-- NPC: Have a nice day! - string_id message = new string_id (c_stringFile, "s_10"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int boss_terminal_mining_cave_foreman_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Grand Foreman Terminal - - //-- [RESPONSE NOTE] - //-- PLAYER: Call the Grand Foreman - if (response == "s_36") - { - //-- [NOTE] - if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_cave_foreman_action_startEvent (player, npc); - - //-- NPC: Command accepted. - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int boss_terminal_mining_cave_foreman_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Unauthorized terminal access. - - //-- [RESPONSE NOTE] - //-- PLAYER: Log off. - if (response == "s_14") - { - //-- [NOTE] - if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) - { - //-- NPC: Have a nice day! - string_id message = new string_id (c_stringFile, "s_16"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.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; -} - -messageHandler spawnEnemies() -{ - if(params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; -} - -messageHandler handleQuestFlavorObjectCleanup() -{ - if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if(objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for(int i = 0; 1 < objList.length; i++) - { - if(!isValidId(objList[i])) - continue; - - messageTo(objList[i], "destroySelf", null, 0, false); - } - 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 (boss_terminal_mining_cave_foreman_condition_wave_event_active (player, npc)) - { - //-- NPC: Terminal busy. - string_id message = new string_id (c_stringFile, "s_7"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Log Off - boolean hasResponse0 = false; - if (boss_terminal_mining_cave_foreman_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_9"); - - utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId", 1); - - npcStartConversation (player, npc, "boss_terminal_mining_cave_foreman", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_mining_cave_foreman_condition_hasBossTask (player, npc)) - { - //-- NPC: Grand Foreman Terminal - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Call the Grand Foreman - boolean hasResponse0 = false; - if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_36"); - - utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId", 3); - - npcStartConversation (player, npc, "boss_terminal_mining_cave_foreman", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_cave_foreman_action_unauthorizedUse (player, npc); - - //-- NPC: Unauthorized terminal access. - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Log off. - boolean hasResponse0 = false; - if (boss_terminal_mining_cave_foreman_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_14"); - - utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId", 5); - - npcStartConversation (player, npc, "boss_terminal_mining_cave_foreman", 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 != "boss_terminal_mining_cave_foreman") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId"); - - if (branchId == 1 && boss_terminal_mining_cave_foreman_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && boss_terminal_mining_cave_foreman_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && boss_terminal_mining_cave_foreman_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// boss_terminal_mining_cave_foreman.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.create; +include library.features; +include library.groundquests; +include library.space_quest; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/boss_terminal_mining_cave_foreman"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean boss_terminal_mining_cave_foreman_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_cave_foreman_condition_hasQuest (obj_id player, obj_id npc) +{ + return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_cave_foreman_condition_hasGroup (obj_id player, obj_id npc) +{ + obj_id groupid = getGroupObject(player); + if(!isValidId(groupid)) + { + //systemMessageTestingOnly(player, "no group"); + return false; + } + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_cave_foreman_condition_hasBossTask (obj_id player, obj_id npc) +{ + return (groundquests.isTaskActive(player, "u16_nym_themepark_mine_boss", "findForemanMine") + || groundquests.isTaskActive(player, "u16_nym_themepark_mine_boss", "killGrandForeman")) + && hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_mine_activate"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_cave_foreman_condition_hasQuestAndGroup (obj_id player, obj_id npc) +{ + if(!boss_terminal_mining_cave_foreman_condition_hasGroup(player,npc)) + return false; + if(!boss_terminal_mining_cave_foreman_condition_hasQuest(player,npc)) + return false; + return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_cave_foreman_condition_wave_event_active (obj_id player, obj_id npc) +{ + int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); + return wave > 0; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void boss_terminal_mining_cave_foreman_action_startEvent (obj_id player, obj_id npc) +{ + boss_terminal_mining_cave_foreman_action_foundTerminal(player,npc); + //Tell the controller we are busy. + dictionary dict = new dictionary(); + dict.put("player", player); + messageTo(npc, "waveEventControllerNPCStart", dict, 4, false); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_mining_cave_foreman_action_foundTerminal (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundForemanMine"); + obj_id myGroup = getGroupObject(player); + if(isValidId(myGroup)) + { + obj_id[] members = getGroupMemberIds(myGroup); + + for(int i = 0; i < members.length; i++) + { + if(!isIdValid(members[i]) || !exists(members[i])) + continue; + + if(getDistance(members[i], npc) > 200) + continue; + + if(boss_terminal_mining_cave_foreman_condition_hasBossTask(members[i], npc)) + { + groundquests.sendSignal(members[i], "hasFoundForemanMine"); + } + } + } +} + +// ---------------------------------------------------------------------- + +void boss_terminal_mining_cave_foreman_action_unauthorizedUse (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); + chat.chat(npc, barkString); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_mining_cave_foreman_action_busyWithOtherPlayer (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); + chat.chat(npc, barkString); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int boss_terminal_mining_cave_foreman_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Terminal busy. + + //-- [RESPONSE NOTE] + //-- PLAYER: Log Off + if (response == "s_9") + { + //-- [NOTE] + if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) + { + //-- NPC: Have a nice day! + string_id message = new string_id (c_stringFile, "s_10"); + utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int boss_terminal_mining_cave_foreman_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Grand Foreman Terminal + + //-- [RESPONSE NOTE] + //-- PLAYER: Call the Grand Foreman + if (response == "s_36") + { + //-- [NOTE] + if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) + { + boss_terminal_mining_cave_foreman_action_startEvent (player, npc); + + //-- NPC: Command accepted. + string_id message = new string_id (c_stringFile, "s_37"); + utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int boss_terminal_mining_cave_foreman_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Unauthorized terminal access. + + //-- [RESPONSE NOTE] + //-- PLAYER: Log off. + if (response == "s_14") + { + //-- [NOTE] + if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) + { + //-- NPC: Have a nice day! + string_id message = new string_id (c_stringFile, "s_16"); + utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.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; +} + +messageHandler spawnEnemies() +{ + if(params == null) + { + return SCRIPT_CONTINUE; + } + + messageTo(self, "waveEventControllerNPCStart", params, 0, false); + return SCRIPT_CONTINUE; +} + +messageHandler handleQuestFlavorObjectCleanup() +{ + if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) + { + return SCRIPT_CONTINUE; + } + + obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); + if(objList == null || objList.length <= 0) + { + return SCRIPT_CONTINUE; + } + + for(int i = 0; 1 < objList.length; i++) + { + if(!isValidId(objList[i])) + continue; + + messageTo(objList[i], "destroySelf", null, 0, false); + } + 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 (boss_terminal_mining_cave_foreman_condition_wave_event_active (player, npc)) + { + //-- NPC: Terminal busy. + string_id message = new string_id (c_stringFile, "s_7"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Log Off + boolean hasResponse0 = false; + if (boss_terminal_mining_cave_foreman_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_9"); + + utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId", 1); + + npcStartConversation (player, npc, "boss_terminal_mining_cave_foreman", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_mining_cave_foreman_condition_hasBossTask (player, npc)) + { + //-- NPC: Grand Foreman Terminal + string_id message = new string_id (c_stringFile, "s_35"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Call the Grand Foreman + boolean hasResponse0 = false; + if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_36"); + + utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId", 3); + + npcStartConversation (player, npc, "boss_terminal_mining_cave_foreman", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) + { + boss_terminal_mining_cave_foreman_action_unauthorizedUse (player, npc); + + //-- NPC: Unauthorized terminal access. + string_id message = new string_id (c_stringFile, "s_34"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Log off. + boolean hasResponse0 = false; + if (boss_terminal_mining_cave_foreman_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_14"); + + utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId", 5); + + npcStartConversation (player, npc, "boss_terminal_mining_cave_foreman", 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 != "boss_terminal_mining_cave_foreman") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId"); + + if (branchId == 1 && boss_terminal_mining_cave_foreman_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && boss_terminal_mining_cave_foreman_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && boss_terminal_mining_cave_foreman_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_barnet.script b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_barnet.script index a2dfa7c29..087e19af5 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_barnet.script +++ b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_barnet.script @@ -1,337 +1,337 @@ -// ====================================================================== -// -// boss_terminal_mining_research_barnet.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.create; -include library.features; -include library.groundquests; -include library.space_quest; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/boss_terminal_mining_research_barnet"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean boss_terminal_mining_research_barnet_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_research_barnet_condition_hasQuest (obj_id player, obj_id npc) -{ - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_research_barnet_condition_hasGroup (obj_id player, obj_id npc) -{ - obj_id groupid = getGroupObject(player); - if(!isValidId(groupid)) - { - //systemMessageTestingOnly(player, "no group"); - return false; - } - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_research_barnet_condition_hasBossTask (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "findUdoBarnet") - || groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "killUdoBarnet"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_research_barnet_condition_hasQuestAndGroup (obj_id player, obj_id npc) -{ - if(!boss_terminal_mining_research_barnet_condition_hasGroup(player,npc)) - return false; - if(!boss_terminal_mining_research_barnet_condition_hasQuest(player,npc)) - return false; - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_research_barnet_condition_wave_event_active (obj_id player, obj_id npc) -{ - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void boss_terminal_mining_research_barnet_action_startEvent (obj_id player, obj_id npc) -{ - //Tell the controller we are busy. - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 0, false); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_mining_research_barnet_action_foundTerminal (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundUdoBarnet"); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_mining_research_barnet_action_unauthorizedUse (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_mining_research_barnet_action_busyWithOtherPlayer (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int boss_terminal_mining_research_barnet_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Grand Foreman Terminal - - //-- [RESPONSE NOTE] - //-- PLAYER: Call the Grand Foreman - if (response == "s_36") - { - //-- [NOTE] - if (boss_terminal_mining_research_barnet_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_research_barnet_action_startEvent (player, npc); - - //-- NPC: Command accepted. - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_research_barnet.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; -} - -messageHandler spawnEnemies() -{ - if(params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; -} - -messageHandler handleQuestFlavorObjectCleanup() -{ - if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if(objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for(int i = 0; 1 < objList.length; i++) - { - if(!isValidId(objList[i])) - continue; - - messageTo(objList[i], "destroySelf", null, 0, false); - } - 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 (boss_terminal_mining_research_barnet_condition_wave_event_active (player, npc)) - { - //-- NPC: Terminal busy. - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_mining_research_barnet_condition_hasBossTask (player, npc)) - { - boss_terminal_mining_research_barnet_action_foundTerminal (player, npc); - - //-- NPC: Grand Foreman Terminal - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Call the Grand Foreman - boolean hasResponse0 = false; - if (boss_terminal_mining_research_barnet_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_36"); - - utils.setScriptVar (player, "conversation.boss_terminal_mining_research_barnet.branchId", 2); - - npcStartConversation (player, npc, "boss_terminal_mining_research_barnet", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_mining_research_barnet_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_research_barnet_action_unauthorizedUse (player, npc); - - //-- NPC: Unauthorized message - string_id message = new string_id (c_stringFile, "s_34"); - 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 != "boss_terminal_mining_research_barnet") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_mining_research_barnet.branchId"); - - if (branchId == 2 && boss_terminal_mining_research_barnet_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_mining_research_barnet.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// boss_terminal_mining_research_barnet.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.create; +include library.features; +include library.groundquests; +include library.space_quest; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/boss_terminal_mining_research_barnet"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean boss_terminal_mining_research_barnet_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_research_barnet_condition_hasQuest (obj_id player, obj_id npc) +{ + return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_research_barnet_condition_hasGroup (obj_id player, obj_id npc) +{ + obj_id groupid = getGroupObject(player); + if(!isValidId(groupid)) + { + //systemMessageTestingOnly(player, "no group"); + return false; + } + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_research_barnet_condition_hasBossTask (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "findUdoBarnet") + || groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "killUdoBarnet"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_research_barnet_condition_hasQuestAndGroup (obj_id player, obj_id npc) +{ + if(!boss_terminal_mining_research_barnet_condition_hasGroup(player,npc)) + return false; + if(!boss_terminal_mining_research_barnet_condition_hasQuest(player,npc)) + return false; + return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_research_barnet_condition_wave_event_active (obj_id player, obj_id npc) +{ + int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); + return wave > 0; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void boss_terminal_mining_research_barnet_action_startEvent (obj_id player, obj_id npc) +{ + //Tell the controller we are busy. + dictionary dict = new dictionary(); + dict.put("player", player); + messageTo(npc, "waveEventControllerNPCStart", dict, 0, false); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_mining_research_barnet_action_foundTerminal (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundUdoBarnet"); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_mining_research_barnet_action_unauthorizedUse (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); + chat.chat(npc, barkString); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_mining_research_barnet_action_busyWithOtherPlayer (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); + chat.chat(npc, barkString); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int boss_terminal_mining_research_barnet_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Grand Foreman Terminal + + //-- [RESPONSE NOTE] + //-- PLAYER: Call the Grand Foreman + if (response == "s_36") + { + //-- [NOTE] + if (boss_terminal_mining_research_barnet_condition__defaultCondition (player, npc)) + { + boss_terminal_mining_research_barnet_action_startEvent (player, npc); + + //-- NPC: Command accepted. + string_id message = new string_id (c_stringFile, "s_37"); + utils.removeScriptVar (player, "conversation.boss_terminal_mining_research_barnet.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; +} + +messageHandler spawnEnemies() +{ + if(params == null) + { + return SCRIPT_CONTINUE; + } + + messageTo(self, "waveEventControllerNPCStart", params, 0, false); + return SCRIPT_CONTINUE; +} + +messageHandler handleQuestFlavorObjectCleanup() +{ + if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) + { + return SCRIPT_CONTINUE; + } + + obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); + if(objList == null || objList.length <= 0) + { + return SCRIPT_CONTINUE; + } + + for(int i = 0; 1 < objList.length; i++) + { + if(!isValidId(objList[i])) + continue; + + messageTo(objList[i], "destroySelf", null, 0, false); + } + 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 (boss_terminal_mining_research_barnet_condition_wave_event_active (player, npc)) + { + //-- NPC: Terminal busy. + string_id message = new string_id (c_stringFile, "s_7"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_mining_research_barnet_condition_hasBossTask (player, npc)) + { + boss_terminal_mining_research_barnet_action_foundTerminal (player, npc); + + //-- NPC: Grand Foreman Terminal + string_id message = new string_id (c_stringFile, "s_35"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Call the Grand Foreman + boolean hasResponse0 = false; + if (boss_terminal_mining_research_barnet_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_36"); + + utils.setScriptVar (player, "conversation.boss_terminal_mining_research_barnet.branchId", 2); + + npcStartConversation (player, npc, "boss_terminal_mining_research_barnet", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_mining_research_barnet_condition__defaultCondition (player, npc)) + { + boss_terminal_mining_research_barnet_action_unauthorizedUse (player, npc); + + //-- NPC: Unauthorized message + string_id message = new string_id (c_stringFile, "s_34"); + 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 != "boss_terminal_mining_research_barnet") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_mining_research_barnet.branchId"); + + if (branchId == 2 && boss_terminal_mining_research_barnet_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.boss_terminal_mining_research_barnet.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_lapaz.script b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_lapaz.script index a2685210b..78697a022 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_lapaz.script +++ b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_lapaz.script @@ -1,337 +1,337 @@ -// ====================================================================== -// -// boss_terminal_mining_research_lapaz.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.create; -include library.features; -include library.groundquests; -include library.space_quest; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/boss_terminal_mining_research_lapaz"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean boss_terminal_mining_research_lapaz_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_research_lapaz_condition_hasQuest (obj_id player, obj_id npc) -{ - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_research_lapaz_condition_hasGroup (obj_id player, obj_id npc) -{ - obj_id groupid = getGroupObject(player); - if(!isValidId(groupid)) - { - //systemMessageTestingOnly(player, "no group"); - return false; - } - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_research_lapaz_condition_hasBossTask (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "findKellLapaz") - || groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "KillKellLapaz"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_research_lapaz_condition_hasQuestAndGroup (obj_id player, obj_id npc) -{ - if(!boss_terminal_mining_research_lapaz_condition_hasGroup(player,npc)) - return false; - if(!boss_terminal_mining_research_lapaz_condition_hasQuest(player,npc)) - return false; - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_mining_research_lapaz_condition_wave_event_active (obj_id player, obj_id npc) -{ - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void boss_terminal_mining_research_lapaz_action_startEvent (obj_id player, obj_id npc) -{ - //Tell the controller we are busy. - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 0, false); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_mining_research_lapaz_action_foundTerminal (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundKellLapaz"); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_mining_research_lapaz_action_unauthorizedUse (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_mining_research_lapaz_action_busyWithOtherPlayer (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int boss_terminal_mining_research_lapaz_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Personal Terminal - Kell Lapaz - - //-- [RESPONSE NOTE] - //-- PLAYER: Call Kell Lapaz - if (response == "s_36") - { - //-- [NOTE] - if (boss_terminal_mining_research_lapaz_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_research_lapaz_action_startEvent (player, npc); - - //-- NPC: Command accepted. - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_research_lapaz.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; -} - -messageHandler spawnEnemies() -{ - if(params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; -} - -messageHandler handleQuestFlavorObjectCleanup() -{ - if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if(objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for(int i = 0; 1 < objList.length; i++) - { - if(!isValidId(objList[i])) - continue; - - messageTo(objList[i], "destroySelf", null, 0, false); - } - 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 (boss_terminal_mining_research_lapaz_condition_wave_event_active (player, npc)) - { - //-- NPC: Terminal busy. - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_mining_research_lapaz_condition_hasBossTask (player, npc)) - { - boss_terminal_mining_research_lapaz_action_foundTerminal (player, npc); - - //-- NPC: Personal Terminal - Kell Lapaz - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Call Kell Lapaz - boolean hasResponse0 = false; - if (boss_terminal_mining_research_lapaz_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_36"); - - utils.setScriptVar (player, "conversation.boss_terminal_mining_research_lapaz.branchId", 2); - - npcStartConversation (player, npc, "boss_terminal_mining_research_lapaz", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_mining_research_lapaz_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_research_lapaz_action_unauthorizedUse (player, npc); - - //-- NPC: Unauthorized message - string_id message = new string_id (c_stringFile, "s_34"); - 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 != "boss_terminal_mining_research_lapaz") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_mining_research_lapaz.branchId"); - - if (branchId == 2 && boss_terminal_mining_research_lapaz_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_mining_research_lapaz.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// boss_terminal_mining_research_lapaz.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.create; +include library.features; +include library.groundquests; +include library.space_quest; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/boss_terminal_mining_research_lapaz"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean boss_terminal_mining_research_lapaz_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_research_lapaz_condition_hasQuest (obj_id player, obj_id npc) +{ + return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_research_lapaz_condition_hasGroup (obj_id player, obj_id npc) +{ + obj_id groupid = getGroupObject(player); + if(!isValidId(groupid)) + { + //systemMessageTestingOnly(player, "no group"); + return false; + } + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_research_lapaz_condition_hasBossTask (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "findKellLapaz") + || groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "KillKellLapaz"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_research_lapaz_condition_hasQuestAndGroup (obj_id player, obj_id npc) +{ + if(!boss_terminal_mining_research_lapaz_condition_hasGroup(player,npc)) + return false; + if(!boss_terminal_mining_research_lapaz_condition_hasQuest(player,npc)) + return false; + return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_mining_research_lapaz_condition_wave_event_active (obj_id player, obj_id npc) +{ + int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); + return wave > 0; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void boss_terminal_mining_research_lapaz_action_startEvent (obj_id player, obj_id npc) +{ + //Tell the controller we are busy. + dictionary dict = new dictionary(); + dict.put("player", player); + messageTo(npc, "waveEventControllerNPCStart", dict, 0, false); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_mining_research_lapaz_action_foundTerminal (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundKellLapaz"); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_mining_research_lapaz_action_unauthorizedUse (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); + chat.chat(npc, barkString); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_mining_research_lapaz_action_busyWithOtherPlayer (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); + chat.chat(npc, barkString); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int boss_terminal_mining_research_lapaz_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Personal Terminal - Kell Lapaz + + //-- [RESPONSE NOTE] + //-- PLAYER: Call Kell Lapaz + if (response == "s_36") + { + //-- [NOTE] + if (boss_terminal_mining_research_lapaz_condition__defaultCondition (player, npc)) + { + boss_terminal_mining_research_lapaz_action_startEvent (player, npc); + + //-- NPC: Command accepted. + string_id message = new string_id (c_stringFile, "s_37"); + utils.removeScriptVar (player, "conversation.boss_terminal_mining_research_lapaz.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; +} + +messageHandler spawnEnemies() +{ + if(params == null) + { + return SCRIPT_CONTINUE; + } + + messageTo(self, "waveEventControllerNPCStart", params, 0, false); + return SCRIPT_CONTINUE; +} + +messageHandler handleQuestFlavorObjectCleanup() +{ + if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) + { + return SCRIPT_CONTINUE; + } + + obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); + if(objList == null || objList.length <= 0) + { + return SCRIPT_CONTINUE; + } + + for(int i = 0; 1 < objList.length; i++) + { + if(!isValidId(objList[i])) + continue; + + messageTo(objList[i], "destroySelf", null, 0, false); + } + 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 (boss_terminal_mining_research_lapaz_condition_wave_event_active (player, npc)) + { + //-- NPC: Terminal busy. + string_id message = new string_id (c_stringFile, "s_7"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_mining_research_lapaz_condition_hasBossTask (player, npc)) + { + boss_terminal_mining_research_lapaz_action_foundTerminal (player, npc); + + //-- NPC: Personal Terminal - Kell Lapaz + string_id message = new string_id (c_stringFile, "s_35"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Call Kell Lapaz + boolean hasResponse0 = false; + if (boss_terminal_mining_research_lapaz_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_36"); + + utils.setScriptVar (player, "conversation.boss_terminal_mining_research_lapaz.branchId", 2); + + npcStartConversation (player, npc, "boss_terminal_mining_research_lapaz", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_mining_research_lapaz_condition__defaultCondition (player, npc)) + { + boss_terminal_mining_research_lapaz_action_unauthorizedUse (player, npc); + + //-- NPC: Unauthorized message + string_id message = new string_id (c_stringFile, "s_34"); + 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 != "boss_terminal_mining_research_lapaz") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_mining_research_lapaz.branchId"); + + if (branchId == 2 && boss_terminal_mining_research_lapaz_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.boss_terminal_mining_research_lapaz.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_pirate_cave.script b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_pirate_cave.script index fb9175798..9315a60ab 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_pirate_cave.script +++ b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_pirate_cave.script @@ -1,482 +1,482 @@ -// ====================================================================== -// -// boss_terminal_pirate_cave.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.create; -include library.features; -include library.groundquests; -include library.space_quest; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/boss_terminal_pirate_cave"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean boss_terminal_pirate_cave_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_pirate_cave_condition_hasQuest (obj_id player, obj_id npc) -{ - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_pirate_cave_condition_hasGroup (obj_id player, obj_id npc) -{ - obj_id groupid = getGroupObject(player); - if(!isValidId(groupid)) - { - //systemMessageTestingOnly(player, "no group"); - return false; - } - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_pirate_cave_condition_hasBossTask (obj_id player, obj_id npc) -{ - return (groundquests.isTaskActive(player, "u16_nym_themepark_pirate_boss_1", "findNymsGirlfriend") - || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_boss_1", "fightNymsGirlfriend")) - && hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_hideout_activate"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_pirate_cave_condition_hasFightTask (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_pirate_cave_condition_hasQuestAndGroup (obj_id player, obj_id npc) -{ - if(!boss_terminal_pirate_cave_condition_hasGroup(player,npc)) - return false; - if(!boss_terminal_pirate_cave_condition_hasQuest(player,npc)) - return false; - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_pirate_cave_condition_wave_event_active (obj_id player, obj_id npc) -{ - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void boss_terminal_pirate_cave_action_startEvent (obj_id player, obj_id npc) -{ - //Tell the controller we are busy. - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 0, false); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_pirate_cave_action_foundTerminal (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundNymsGirlfriend"); - obj_id myGroup = getGroupObject(player); - if(isValidId(myGroup)) - { - obj_id[] members = getGroupMemberIds(myGroup); - - for(int i = 0; i < members.length; i++) - { - if(!isIdValid(members[i]) || !exists(members[i])) - continue; - - if(getDistance(members[i], npc) > 200) - continue; - - if(boss_terminal_pirate_cave_condition_hasBossTask(members[i], npc)) - { - groundquests.sendSignal(members[i], "hasFoundNymsGirlfriend"); - } - } - } -} - -// ---------------------------------------------------------------------- - -void boss_terminal_pirate_cave_action_unauthorizedUse (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_pirate_cave_action_busyWithOtherPlayer (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int boss_terminal_pirate_cave_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Terminal busy. - - //-- [RESPONSE NOTE] - //-- PLAYER: Log off. - if (response == "s_11") - { - //-- [NOTE] - if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: Have a nice day! - string_id message = new string_id (c_stringFile, "s_12"); - utils.removeScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int boss_terminal_pirate_cave_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Holding Pen Terminal - - //-- [RESPONSE NOTE] - //-- PLAYER: Open holding pen. - if (response == "s_36") - { - //-- [NOTE] - if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) - { - boss_terminal_pirate_cave_action_startEvent (player, npc); - - //-- NPC: Command accepted. Opening Pen to 'Nym's Girlfriend' - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int boss_terminal_pirate_cave_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Unauthorized terminal access. - - //-- [RESPONSE NOTE] - //-- PLAYER: Log off. - if (response == "s_14") - { - //-- [NOTE] - if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: Have a nice day! - string_id message = new string_id (c_stringFile, "s_16"); - utils.removeScriptVar (player, "conversation.boss_terminal_pirate_cave.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; -} - -messageHandler spawnEnemies() -{ - if(params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; -} - -messageHandler handleQuestFlavorObjectCleanup() -{ - if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if(objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for(int i = 0; 1 < objList.length; i++) - { - if(!isValidId(objList[i])) - continue; - - messageTo(objList[i], "destroySelf", null, 0, false); - } - 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 (boss_terminal_pirate_cave_condition_wave_event_active (player, npc)) - { - //-- NPC: Terminal busy. - string_id message = new string_id (c_stringFile, "s_7"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Log off. - boolean hasResponse0 = false; - if (boss_terminal_pirate_cave_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_11"); - - utils.setScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId", 1); - - npcStartConversation (player, npc, "boss_terminal_pirate_cave", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_pirate_cave_condition_hasBossTask (player, npc)) - { - boss_terminal_pirate_cave_action_foundTerminal (player, npc); - - //-- NPC: Holding Pen Terminal - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Open holding pen. - boolean hasResponse0 = false; - if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_36"); - - utils.setScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId", 3); - - npcStartConversation (player, npc, "boss_terminal_pirate_cave", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) - { - boss_terminal_pirate_cave_action_unauthorizedUse (player, npc); - - //-- NPC: Unauthorized terminal access. - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Log off. - boolean hasResponse0 = false; - if (boss_terminal_pirate_cave_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_14"); - - utils.setScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId", 5); - - npcStartConversation (player, npc, "boss_terminal_pirate_cave", 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 != "boss_terminal_pirate_cave") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId"); - - if (branchId == 1 && boss_terminal_pirate_cave_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && boss_terminal_pirate_cave_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && boss_terminal_pirate_cave_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// boss_terminal_pirate_cave.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.create; +include library.features; +include library.groundquests; +include library.space_quest; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/boss_terminal_pirate_cave"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean boss_terminal_pirate_cave_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_pirate_cave_condition_hasQuest (obj_id player, obj_id npc) +{ + return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_pirate_cave_condition_hasGroup (obj_id player, obj_id npc) +{ + obj_id groupid = getGroupObject(player); + if(!isValidId(groupid)) + { + //systemMessageTestingOnly(player, "no group"); + return false; + } + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_pirate_cave_condition_hasBossTask (obj_id player, obj_id npc) +{ + return (groundquests.isTaskActive(player, "u16_nym_themepark_pirate_boss_1", "findNymsGirlfriend") + || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_boss_1", "fightNymsGirlfriend")) + && hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_hideout_activate"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_pirate_cave_condition_hasFightTask (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_pirate_cave_condition_hasQuestAndGroup (obj_id player, obj_id npc) +{ + if(!boss_terminal_pirate_cave_condition_hasGroup(player,npc)) + return false; + if(!boss_terminal_pirate_cave_condition_hasQuest(player,npc)) + return false; + return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_pirate_cave_condition_wave_event_active (obj_id player, obj_id npc) +{ + int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); + return wave > 0; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void boss_terminal_pirate_cave_action_startEvent (obj_id player, obj_id npc) +{ + //Tell the controller we are busy. + dictionary dict = new dictionary(); + dict.put("player", player); + messageTo(npc, "waveEventControllerNPCStart", dict, 0, false); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_pirate_cave_action_foundTerminal (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundNymsGirlfriend"); + obj_id myGroup = getGroupObject(player); + if(isValidId(myGroup)) + { + obj_id[] members = getGroupMemberIds(myGroup); + + for(int i = 0; i < members.length; i++) + { + if(!isIdValid(members[i]) || !exists(members[i])) + continue; + + if(getDistance(members[i], npc) > 200) + continue; + + if(boss_terminal_pirate_cave_condition_hasBossTask(members[i], npc)) + { + groundquests.sendSignal(members[i], "hasFoundNymsGirlfriend"); + } + } + } +} + +// ---------------------------------------------------------------------- + +void boss_terminal_pirate_cave_action_unauthorizedUse (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); + chat.chat(npc, barkString); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_pirate_cave_action_busyWithOtherPlayer (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); + chat.chat(npc, barkString); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int boss_terminal_pirate_cave_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Terminal busy. + + //-- [RESPONSE NOTE] + //-- PLAYER: Log off. + if (response == "s_11") + { + //-- [NOTE] + if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: Have a nice day! + string_id message = new string_id (c_stringFile, "s_12"); + utils.removeScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int boss_terminal_pirate_cave_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Holding Pen Terminal + + //-- [RESPONSE NOTE] + //-- PLAYER: Open holding pen. + if (response == "s_36") + { + //-- [NOTE] + if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) + { + boss_terminal_pirate_cave_action_startEvent (player, npc); + + //-- NPC: Command accepted. Opening Pen to 'Nym's Girlfriend' + string_id message = new string_id (c_stringFile, "s_37"); + utils.removeScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int boss_terminal_pirate_cave_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Unauthorized terminal access. + + //-- [RESPONSE NOTE] + //-- PLAYER: Log off. + if (response == "s_14") + { + //-- [NOTE] + if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: Have a nice day! + string_id message = new string_id (c_stringFile, "s_16"); + utils.removeScriptVar (player, "conversation.boss_terminal_pirate_cave.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; +} + +messageHandler spawnEnemies() +{ + if(params == null) + { + return SCRIPT_CONTINUE; + } + + messageTo(self, "waveEventControllerNPCStart", params, 0, false); + return SCRIPT_CONTINUE; +} + +messageHandler handleQuestFlavorObjectCleanup() +{ + if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) + { + return SCRIPT_CONTINUE; + } + + obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); + if(objList == null || objList.length <= 0) + { + return SCRIPT_CONTINUE; + } + + for(int i = 0; 1 < objList.length; i++) + { + if(!isValidId(objList[i])) + continue; + + messageTo(objList[i], "destroySelf", null, 0, false); + } + 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 (boss_terminal_pirate_cave_condition_wave_event_active (player, npc)) + { + //-- NPC: Terminal busy. + string_id message = new string_id (c_stringFile, "s_7"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Log off. + boolean hasResponse0 = false; + if (boss_terminal_pirate_cave_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_11"); + + utils.setScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId", 1); + + npcStartConversation (player, npc, "boss_terminal_pirate_cave", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_pirate_cave_condition_hasBossTask (player, npc)) + { + boss_terminal_pirate_cave_action_foundTerminal (player, npc); + + //-- NPC: Holding Pen Terminal + string_id message = new string_id (c_stringFile, "s_35"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Open holding pen. + boolean hasResponse0 = false; + if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_36"); + + utils.setScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId", 3); + + npcStartConversation (player, npc, "boss_terminal_pirate_cave", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) + { + boss_terminal_pirate_cave_action_unauthorizedUse (player, npc); + + //-- NPC: Unauthorized terminal access. + string_id message = new string_id (c_stringFile, "s_34"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Log off. + boolean hasResponse0 = false; + if (boss_terminal_pirate_cave_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_14"); + + utils.setScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId", 5); + + npcStartConversation (player, npc, "boss_terminal_pirate_cave", 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 != "boss_terminal_pirate_cave") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId"); + + if (branchId == 1 && boss_terminal_pirate_cave_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && boss_terminal_pirate_cave_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && boss_terminal_pirate_cave_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_barnet.script b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_barnet.script index 11ce7c30f..ff099d5d4 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_barnet.script +++ b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_barnet.script @@ -1,474 +1,474 @@ -// ====================================================================== -// -// boss_terminal_research_barnet.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.create; -include library.features; -include library.groundquests; -include library.space_quest; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/boss_terminal_research_barnet"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean boss_terminal_research_barnet_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_research_barnet_condition_hasQuest (obj_id player, obj_id npc) -{ - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_research_barnet_condition_hasGroup (obj_id player, obj_id npc) -{ - obj_id groupid = getGroupObject(player); - if(!isValidId(groupid)) - { - //systemMessageTestingOnly(player, "no group"); - return false; - } - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_research_barnet_condition_hasBossTask (obj_id player, obj_id npc) -{ - return (groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "findUdoBarnet") - || groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "killUdoBarnet")) - && hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_lab_activate"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_research_barnet_condition_hasQuestAndGroup (obj_id player, obj_id npc) -{ - if(!boss_terminal_research_barnet_condition_hasGroup(player,npc)) - return false; - if(!boss_terminal_research_barnet_condition_hasQuest(player,npc)) - return false; - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_research_barnet_condition_wave_event_active (obj_id player, obj_id npc) -{ - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void boss_terminal_research_barnet_action_startEvent (obj_id player, obj_id npc) -{ - boss_terminal_research_barnet_action_foundTerminal(player,npc); - //Tell the controller we are busy. - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 4, false); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_research_barnet_action_foundTerminal (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundUdoBarnet"); - obj_id myGroup = getGroupObject(player); - if(isValidId(myGroup)) - { - obj_id[] members = getGroupMemberIds(myGroup); - - for(int i = 0; i < members.length; i++) - { - if(!isIdValid(members[i]) || !exists(members[i])) - continue; - - if(getDistance(members[i], npc) > 200) - continue; - - if(boss_terminal_research_barnet_condition_hasBossTask(members[i], npc)) - { - groundquests.sendSignal(members[i], "hasFoundUdoBarnet"); - } - } - } -} - -// ---------------------------------------------------------------------- - -void boss_terminal_research_barnet_action_unauthorizedUse (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_research_barnet_action_busyWithOtherPlayer (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int boss_terminal_research_barnet_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Terminal busy. - - //-- [RESPONSE NOTE] - //-- PLAYER: Log off. - if (response == "s_11") - { - //-- [NOTE] - if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) - { - //-- NPC: Have a nice day! - string_id message = new string_id (c_stringFile, "s_12"); - utils.removeScriptVar (player, "conversation.boss_terminal_research_barnet.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int boss_terminal_research_barnet_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Personal Terminal - Udo Barnet - - //-- [RESPONSE NOTE] - //-- PLAYER: Call Udo Barnet - if (response == "s_36") - { - //-- [NOTE] - if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) - { - boss_terminal_research_barnet_action_startEvent (player, npc); - - //-- NPC: Command accepted. - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_research_barnet.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int boss_terminal_research_barnet_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Unauthorized terminal access. - - //-- [RESPONSE NOTE] - //-- PLAYER: Log off. - if (response == "s_14") - { - //-- [NOTE] - if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) - { - //-- NPC: Have a nice day! - string_id message = new string_id (c_stringFile, "s_16"); - utils.removeScriptVar (player, "conversation.boss_terminal_research_barnet.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; -} - -messageHandler spawnEnemies() -{ - if(params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; -} - -messageHandler handleQuestFlavorObjectCleanup() -{ - if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if(objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for(int i = 0; 1 < objList.length; i++) - { - if(!isValidId(objList[i])) - continue; - - messageTo(objList[i], "destroySelf", null, 0, false); - } - 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 (boss_terminal_research_barnet_condition_wave_event_active (player, npc)) - { - //-- NPC: Terminal busy. - string_id message = new string_id (c_stringFile, "s_7"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Log off. - boolean hasResponse0 = false; - if (boss_terminal_research_barnet_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_11"); - - utils.setScriptVar (player, "conversation.boss_terminal_research_barnet.branchId", 1); - - npcStartConversation (player, npc, "boss_terminal_research_barnet", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_research_barnet_condition_hasBossTask (player, npc)) - { - //-- NPC: Personal Terminal - Udo Barnet - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Call Udo Barnet - boolean hasResponse0 = false; - if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_36"); - - utils.setScriptVar (player, "conversation.boss_terminal_research_barnet.branchId", 3); - - npcStartConversation (player, npc, "boss_terminal_research_barnet", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) - { - boss_terminal_research_barnet_action_unauthorizedUse (player, npc); - - //-- NPC: Unauthorized terminal access. - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Log off. - boolean hasResponse0 = false; - if (boss_terminal_research_barnet_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_14"); - - utils.setScriptVar (player, "conversation.boss_terminal_research_barnet.branchId", 5); - - npcStartConversation (player, npc, "boss_terminal_research_barnet", 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 != "boss_terminal_research_barnet") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_research_barnet.branchId"); - - if (branchId == 1 && boss_terminal_research_barnet_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && boss_terminal_research_barnet_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && boss_terminal_research_barnet_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_research_barnet.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// boss_terminal_research_barnet.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.create; +include library.features; +include library.groundquests; +include library.space_quest; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/boss_terminal_research_barnet"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean boss_terminal_research_barnet_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_research_barnet_condition_hasQuest (obj_id player, obj_id npc) +{ + return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_research_barnet_condition_hasGroup (obj_id player, obj_id npc) +{ + obj_id groupid = getGroupObject(player); + if(!isValidId(groupid)) + { + //systemMessageTestingOnly(player, "no group"); + return false; + } + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_research_barnet_condition_hasBossTask (obj_id player, obj_id npc) +{ + return (groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "findUdoBarnet") + || groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "killUdoBarnet")) + && hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_lab_activate"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_research_barnet_condition_hasQuestAndGroup (obj_id player, obj_id npc) +{ + if(!boss_terminal_research_barnet_condition_hasGroup(player,npc)) + return false; + if(!boss_terminal_research_barnet_condition_hasQuest(player,npc)) + return false; + return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_research_barnet_condition_wave_event_active (obj_id player, obj_id npc) +{ + int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); + return wave > 0; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void boss_terminal_research_barnet_action_startEvent (obj_id player, obj_id npc) +{ + boss_terminal_research_barnet_action_foundTerminal(player,npc); + //Tell the controller we are busy. + dictionary dict = new dictionary(); + dict.put("player", player); + messageTo(npc, "waveEventControllerNPCStart", dict, 4, false); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_research_barnet_action_foundTerminal (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundUdoBarnet"); + obj_id myGroup = getGroupObject(player); + if(isValidId(myGroup)) + { + obj_id[] members = getGroupMemberIds(myGroup); + + for(int i = 0; i < members.length; i++) + { + if(!isIdValid(members[i]) || !exists(members[i])) + continue; + + if(getDistance(members[i], npc) > 200) + continue; + + if(boss_terminal_research_barnet_condition_hasBossTask(members[i], npc)) + { + groundquests.sendSignal(members[i], "hasFoundUdoBarnet"); + } + } + } +} + +// ---------------------------------------------------------------------- + +void boss_terminal_research_barnet_action_unauthorizedUse (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); + chat.chat(npc, barkString); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_research_barnet_action_busyWithOtherPlayer (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); + chat.chat(npc, barkString); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int boss_terminal_research_barnet_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Terminal busy. + + //-- [RESPONSE NOTE] + //-- PLAYER: Log off. + if (response == "s_11") + { + //-- [NOTE] + if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) + { + //-- NPC: Have a nice day! + string_id message = new string_id (c_stringFile, "s_12"); + utils.removeScriptVar (player, "conversation.boss_terminal_research_barnet.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int boss_terminal_research_barnet_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Personal Terminal - Udo Barnet + + //-- [RESPONSE NOTE] + //-- PLAYER: Call Udo Barnet + if (response == "s_36") + { + //-- [NOTE] + if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) + { + boss_terminal_research_barnet_action_startEvent (player, npc); + + //-- NPC: Command accepted. + string_id message = new string_id (c_stringFile, "s_37"); + utils.removeScriptVar (player, "conversation.boss_terminal_research_barnet.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int boss_terminal_research_barnet_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Unauthorized terminal access. + + //-- [RESPONSE NOTE] + //-- PLAYER: Log off. + if (response == "s_14") + { + //-- [NOTE] + if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) + { + //-- NPC: Have a nice day! + string_id message = new string_id (c_stringFile, "s_16"); + utils.removeScriptVar (player, "conversation.boss_terminal_research_barnet.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; +} + +messageHandler spawnEnemies() +{ + if(params == null) + { + return SCRIPT_CONTINUE; + } + + messageTo(self, "waveEventControllerNPCStart", params, 0, false); + return SCRIPT_CONTINUE; +} + +messageHandler handleQuestFlavorObjectCleanup() +{ + if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) + { + return SCRIPT_CONTINUE; + } + + obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); + if(objList == null || objList.length <= 0) + { + return SCRIPT_CONTINUE; + } + + for(int i = 0; 1 < objList.length; i++) + { + if(!isValidId(objList[i])) + continue; + + messageTo(objList[i], "destroySelf", null, 0, false); + } + 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 (boss_terminal_research_barnet_condition_wave_event_active (player, npc)) + { + //-- NPC: Terminal busy. + string_id message = new string_id (c_stringFile, "s_7"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Log off. + boolean hasResponse0 = false; + if (boss_terminal_research_barnet_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_11"); + + utils.setScriptVar (player, "conversation.boss_terminal_research_barnet.branchId", 1); + + npcStartConversation (player, npc, "boss_terminal_research_barnet", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_research_barnet_condition_hasBossTask (player, npc)) + { + //-- NPC: Personal Terminal - Udo Barnet + string_id message = new string_id (c_stringFile, "s_35"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Call Udo Barnet + boolean hasResponse0 = false; + if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_36"); + + utils.setScriptVar (player, "conversation.boss_terminal_research_barnet.branchId", 3); + + npcStartConversation (player, npc, "boss_terminal_research_barnet", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) + { + boss_terminal_research_barnet_action_unauthorizedUse (player, npc); + + //-- NPC: Unauthorized terminal access. + string_id message = new string_id (c_stringFile, "s_34"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Log off. + boolean hasResponse0 = false; + if (boss_terminal_research_barnet_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_14"); + + utils.setScriptVar (player, "conversation.boss_terminal_research_barnet.branchId", 5); + + npcStartConversation (player, npc, "boss_terminal_research_barnet", 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 != "boss_terminal_research_barnet") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_research_barnet.branchId"); + + if (branchId == 1 && boss_terminal_research_barnet_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && boss_terminal_research_barnet_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && boss_terminal_research_barnet_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.boss_terminal_research_barnet.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_lapaz.script b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_lapaz.script index 97a9d2f4e..8491da1c1 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_lapaz.script +++ b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_lapaz.script @@ -1,474 +1,474 @@ -// ====================================================================== -// -// boss_terminal_research_lapaz.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.create; -include library.features; -include library.groundquests; -include library.space_quest; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/boss_terminal_research_lapaz"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean boss_terminal_research_lapaz_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_research_lapaz_condition_hasQuest (obj_id player, obj_id npc) -{ - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_research_lapaz_condition_hasGroup (obj_id player, obj_id npc) -{ - obj_id groupid = getGroupObject(player); - if(!isValidId(groupid)) - { - //systemMessageTestingOnly(player, "no group"); - return false; - } - return true; -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_research_lapaz_condition_hasBossTask (obj_id player, obj_id npc) -{ - return (groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "findKellLapaz") - || groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "KillKellLapaz")) - && hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_lab_activate"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_research_lapaz_condition_hasQuestAndGroup (obj_id player, obj_id npc) -{ - if(!boss_terminal_research_lapaz_condition_hasGroup(player,npc)) - return false; - if(!boss_terminal_research_lapaz_condition_hasQuest(player,npc)) - return false; - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); -} - -// ---------------------------------------------------------------------- - -boolean boss_terminal_research_lapaz_condition_wave_event_active (obj_id player, obj_id npc) -{ - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void boss_terminal_research_lapaz_action_startEvent (obj_id player, obj_id npc) -{ - boss_terminal_research_lapaz_action_foundTerminal(player,npc); - //Tell the controller we are busy. - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 4, false); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_research_lapaz_action_foundTerminal (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundKellLapaz"); - obj_id myGroup = getGroupObject(player); - if(isValidId(myGroup)) - { - obj_id[] members = getGroupMemberIds(myGroup); - - for(int i = 0; i < members.length; i++) - { - if(!isIdValid(members[i]) || !exists(members[i])) - continue; - - if(getDistance(members[i], npc) > 200) - continue; - - if(boss_terminal_research_lapaz_condition_hasBossTask(members[i], npc)) - { - groundquests.sendSignal(members[i], "hasFoundKellLapaz"); - } - } - } -} - -// ---------------------------------------------------------------------- - -void boss_terminal_research_lapaz_action_unauthorizedUse (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); -} - -// ---------------------------------------------------------------------- - -void boss_terminal_research_lapaz_action_busyWithOtherPlayer (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int boss_terminal_research_lapaz_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Terminal busy. - - //-- [RESPONSE NOTE] - //-- PLAYER: Log off. - if (response == "s_11") - { - //-- [NOTE] - if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) - { - //-- NPC: Have a nice day! - string_id message = new string_id (c_stringFile, "s_12"); - utils.removeScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int boss_terminal_research_lapaz_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Personal Terminal - Kell Lapaz - - //-- [RESPONSE NOTE] - //-- PLAYER: Call Kell Lapaz - if (response == "s_36") - { - //-- [NOTE] - if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) - { - boss_terminal_research_lapaz_action_startEvent (player, npc); - - //-- NPC: Command accepted. - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int boss_terminal_research_lapaz_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Unauthorized terminal access. - - //-- [RESPONSE NOTE] - //-- PLAYER: Log off. - if (response == "s_14") - { - //-- [NOTE] - if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) - { - //-- NPC: Have a nice day! - string_id message = new string_id (c_stringFile, "s_16"); - utils.removeScriptVar (player, "conversation.boss_terminal_research_lapaz.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; -} - -messageHandler spawnEnemies() -{ - if(params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; -} - -messageHandler handleQuestFlavorObjectCleanup() -{ - if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if(objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for(int i = 0; 1 < objList.length; i++) - { - if(!isValidId(objList[i])) - continue; - - messageTo(objList[i], "destroySelf", null, 0, false); - } - 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 (boss_terminal_research_lapaz_condition_wave_event_active (player, npc)) - { - //-- NPC: Terminal busy. - string_id message = new string_id (c_stringFile, "s_7"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Log off. - boolean hasResponse0 = false; - if (boss_terminal_research_lapaz_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_11"); - - utils.setScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId", 1); - - npcStartConversation (player, npc, "boss_terminal_research_lapaz", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_research_lapaz_condition_hasBossTask (player, npc)) - { - //-- NPC: Personal Terminal - Kell Lapaz - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Call Kell Lapaz - boolean hasResponse0 = false; - if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_36"); - - utils.setScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId", 3); - - npcStartConversation (player, npc, "boss_terminal_research_lapaz", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) - { - boss_terminal_research_lapaz_action_unauthorizedUse (player, npc); - - //-- NPC: Unauthorized terminal access. - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Log off. - boolean hasResponse0 = false; - if (boss_terminal_research_lapaz_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_14"); - - utils.setScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId", 5); - - npcStartConversation (player, npc, "boss_terminal_research_lapaz", 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 != "boss_terminal_research_lapaz") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId"); - - if (branchId == 1 && boss_terminal_research_lapaz_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && boss_terminal_research_lapaz_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && boss_terminal_research_lapaz_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// boss_terminal_research_lapaz.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.create; +include library.features; +include library.groundquests; +include library.space_quest; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/boss_terminal_research_lapaz"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean boss_terminal_research_lapaz_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_research_lapaz_condition_hasQuest (obj_id player, obj_id npc) +{ + return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_research_lapaz_condition_hasGroup (obj_id player, obj_id npc) +{ + obj_id groupid = getGroupObject(player); + if(!isValidId(groupid)) + { + //systemMessageTestingOnly(player, "no group"); + return false; + } + return true; +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_research_lapaz_condition_hasBossTask (obj_id player, obj_id npc) +{ + return (groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "findKellLapaz") + || groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "KillKellLapaz")) + && hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_lab_activate"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_research_lapaz_condition_hasQuestAndGroup (obj_id player, obj_id npc) +{ + if(!boss_terminal_research_lapaz_condition_hasGroup(player,npc)) + return false; + if(!boss_terminal_research_lapaz_condition_hasQuest(player,npc)) + return false; + return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); +} + +// ---------------------------------------------------------------------- + +boolean boss_terminal_research_lapaz_condition_wave_event_active (obj_id player, obj_id npc) +{ + int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); + return wave > 0; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void boss_terminal_research_lapaz_action_startEvent (obj_id player, obj_id npc) +{ + boss_terminal_research_lapaz_action_foundTerminal(player,npc); + //Tell the controller we are busy. + dictionary dict = new dictionary(); + dict.put("player", player); + messageTo(npc, "waveEventControllerNPCStart", dict, 4, false); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_research_lapaz_action_foundTerminal (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundKellLapaz"); + obj_id myGroup = getGroupObject(player); + if(isValidId(myGroup)) + { + obj_id[] members = getGroupMemberIds(myGroup); + + for(int i = 0; i < members.length; i++) + { + if(!isIdValid(members[i]) || !exists(members[i])) + continue; + + if(getDistance(members[i], npc) > 200) + continue; + + if(boss_terminal_research_lapaz_condition_hasBossTask(members[i], npc)) + { + groundquests.sendSignal(members[i], "hasFoundKellLapaz"); + } + } + } +} + +// ---------------------------------------------------------------------- + +void boss_terminal_research_lapaz_action_unauthorizedUse (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); + chat.chat(npc, barkString); +} + +// ---------------------------------------------------------------------- + +void boss_terminal_research_lapaz_action_busyWithOtherPlayer (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); + chat.chat(npc, barkString); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int boss_terminal_research_lapaz_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Terminal busy. + + //-- [RESPONSE NOTE] + //-- PLAYER: Log off. + if (response == "s_11") + { + //-- [NOTE] + if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) + { + //-- NPC: Have a nice day! + string_id message = new string_id (c_stringFile, "s_12"); + utils.removeScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int boss_terminal_research_lapaz_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Personal Terminal - Kell Lapaz + + //-- [RESPONSE NOTE] + //-- PLAYER: Call Kell Lapaz + if (response == "s_36") + { + //-- [NOTE] + if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) + { + boss_terminal_research_lapaz_action_startEvent (player, npc); + + //-- NPC: Command accepted. + string_id message = new string_id (c_stringFile, "s_37"); + utils.removeScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int boss_terminal_research_lapaz_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Unauthorized terminal access. + + //-- [RESPONSE NOTE] + //-- PLAYER: Log off. + if (response == "s_14") + { + //-- [NOTE] + if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) + { + //-- NPC: Have a nice day! + string_id message = new string_id (c_stringFile, "s_16"); + utils.removeScriptVar (player, "conversation.boss_terminal_research_lapaz.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; +} + +messageHandler spawnEnemies() +{ + if(params == null) + { + return SCRIPT_CONTINUE; + } + + messageTo(self, "waveEventControllerNPCStart", params, 0, false); + return SCRIPT_CONTINUE; +} + +messageHandler handleQuestFlavorObjectCleanup() +{ + if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) + { + return SCRIPT_CONTINUE; + } + + obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); + if(objList == null || objList.length <= 0) + { + return SCRIPT_CONTINUE; + } + + for(int i = 0; 1 < objList.length; i++) + { + if(!isValidId(objList[i])) + continue; + + messageTo(objList[i], "destroySelf", null, 0, false); + } + 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 (boss_terminal_research_lapaz_condition_wave_event_active (player, npc)) + { + //-- NPC: Terminal busy. + string_id message = new string_id (c_stringFile, "s_7"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Log off. + boolean hasResponse0 = false; + if (boss_terminal_research_lapaz_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_11"); + + utils.setScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId", 1); + + npcStartConversation (player, npc, "boss_terminal_research_lapaz", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_research_lapaz_condition_hasBossTask (player, npc)) + { + //-- NPC: Personal Terminal - Kell Lapaz + string_id message = new string_id (c_stringFile, "s_35"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Call Kell Lapaz + boolean hasResponse0 = false; + if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_36"); + + utils.setScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId", 3); + + npcStartConversation (player, npc, "boss_terminal_research_lapaz", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) + { + boss_terminal_research_lapaz_action_unauthorizedUse (player, npc); + + //-- NPC: Unauthorized terminal access. + string_id message = new string_id (c_stringFile, "s_34"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Log off. + boolean hasResponse0 = false; + if (boss_terminal_research_lapaz_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_14"); + + utils.setScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId", 5); + + npcStartConversation (player, npc, "boss_terminal_research_lapaz", 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 != "boss_terminal_research_lapaz") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId"); + + if (branchId == 1 && boss_terminal_research_lapaz_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && boss_terminal_research_lapaz_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && boss_terminal_research_lapaz_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/cale_serasai.script b/sku.0/sys.server/compiled/game/script/conversation/cale_serasai.script index 3cf6613d1..36faad9b8 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/cale_serasai.script +++ b/sku.0/sys.server/compiled/game/script/conversation/cale_serasai.script @@ -1,802 +1,802 @@ -// ====================================================================== -// -// cale_serasai.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/cale_serasai"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean cale_serasai_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean cale_serasai_condition_isAmbassador (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "speakToAmbassador"); -} - -// ---------------------------------------------------------------------- - -boolean cale_serasai_condition_deliverMessage (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "deliverMessage"); -} - -// ---------------------------------------------------------------------- - -boolean cale_serasai_condition_moveThroughKill (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "killTheHenchmen"); -} - -// ---------------------------------------------------------------------- - -boolean cale_serasai_condition_speakLastTime (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "speakToAmbassadorTwo") - || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_negotiate_peace") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_rescue_sheeli")); -} - -// ---------------------------------------------------------------------- - -boolean cale_serasai_condition_hasNotCompletedWave (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "killTheHenchmen"); -} - -// ---------------------------------------------------------------------- - -boolean cale_serasai_condition_failedExtraction (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "u16_nym_themepark_rescue_sheeli_fail", "failedExtraction"); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void cale_serasai_action_signalMessageReceived (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasDeliveredMessage"); - - LOG("nym_wave_event", "sending wave signal"); - - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 2, false); -} - -// ---------------------------------------------------------------------- - -void cale_serasai_action_giveRescueMission (obj_id player, obj_id npc) -{ - //groundquests.grantQuest(player, "u16_nym_themepark_rescue_sheeli"); -} - -// ---------------------------------------------------------------------- - -void cale_serasai_action_signalAmbassador (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasSpokenToAmbassador"); -} - -// ---------------------------------------------------------------------- - -void cale_serasai_action_signalKill (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasKilledTheHenchmen"); -} - -// ---------------------------------------------------------------------- - -void cale_serasai_action_signalSpokenLastTime (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasSpokenToAmbassadorTwo"); -} - -// ---------------------------------------------------------------------- - -void cale_serasai_action_clearFail (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasSpokenCaleRemoveFail"); - cale_serasai_action_giveRescueMission(player,npc); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int cale_serasai_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Look...you made your point. I don't want any more trouble. I've sent a com to release Choster's sister. Now please leave me alone. - - //-- [RESPONSE NOTE] - //-- PLAYER: Oh? What about the peace agreement? - if (response == "s_18") - { - //-- [NOTE] - if (cale_serasai_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "udaman"); - - cale_serasai_action_giveRescueMission (player, npc); - - //-- NPC: We'll be in contact. - string_id message = new string_id (c_stringFile, "s_19"); - utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int cale_serasai_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You have a response from Nym? - - //-- [RESPONSE NOTE] - //-- PLAYER: I do. - if (response == "s_14") - { - //-- [NOTE] - if (cale_serasai_condition__defaultCondition (player, npc)) - { - //-- NPC: What does the pirate say. - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Hand over Choster's sister for a ransom. - boolean hasResponse0 = false; - if (cale_serasai_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_35"); - - utils.setScriptVar (player, "conversation.cale_serasai.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int cale_serasai_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: What does the pirate say. - - //-- [RESPONSE NOTE] - //-- PLAYER: Hand over Choster's sister for a ransom. - if (response == "s_35") - { - //-- [NOTE] - if (cale_serasai_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "slit_throat"); - - //-- NPC: Let me guess. You just made that up didn't you? We want Choster. If we don't get Choster, the female Twi'lek dies! - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm not going to let you do that! - boolean hasResponse0 = false; - if (cale_serasai_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_37"); - - utils.setScriptVar (player, "conversation.cale_serasai.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int cale_serasai_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Let me guess. You just made that up didn't you? We want Choster. If we don't get Choster, the female Twi'lek dies! - - //-- [RESPONSE NOTE] - //-- PLAYER: I'm not going to let you do that! - if (response == "s_37") - { - //-- [NOTE] - if (cale_serasai_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "thumb_down"); - - cale_serasai_action_signalMessageReceived (player, npc); - - //-- NPC: We'll see. Attack! - string_id message = new string_id (c_stringFile, "s_38"); - utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int cale_serasai_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Are you the 'emissary' for Nym? By the way everyone talks, I expected the spacer they call %TU to be a bit bigger. - - //-- [RESPONSE NOTE] - //-- PLAYER: I'm here. Talk peace. - if (response == "s_24") - { - //-- [NOTE] - if (cale_serasai_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_once"); - - //-- NPC: Straight to business. I like that. Okay, here is the deal. You pass us Choster, we'll sign a cease fire agreement. - string_id message = new string_id (c_stringFile, "s_26"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Choster? Never heard of him. - boolean hasResponse0 = false; - if (cale_serasai_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_29"); - - utils.setScriptVar (player, "conversation.cale_serasai.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int cale_serasai_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Straight to business. I like that. Okay, here is the deal. You pass us Choster, we'll sign a cease fire agreement. - - //-- [RESPONSE NOTE] - //-- PLAYER: Choster? Never heard of him. - if (response == "s_29") - { - //-- [NOTE] - if (cale_serasai_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_no"); - - //-- NPC: Don't lie. We know you used him to get past the security system in our hideout. You'll hand him over then we'll sign an agreement. We'll even give you a good faith gift in credits. - string_id message = new string_id (c_stringFile, "s_30"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Nym won't go for it. - boolean hasResponse0 = false; - if (cale_serasai_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.cale_serasai.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int cale_serasai_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Don't lie. We know you used him to get past the security system in our hideout. You'll hand him over then we'll sign an agreement. We'll even give you a good faith gift in credits. - - //-- [RESPONSE NOTE] - //-- PLAYER: Nym won't go for it. - if (response == "s_32") - { - //-- [NOTE] - if (cale_serasai_condition__defaultCondition (player, npc)) - { - //-- NPC: Well, we have Choster's sister. So either way, someone is going to pay. Hand over Choster or we kill the sister...I doubt you want her blood on your hands, %TU. - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Let me contact Nym. - boolean hasResponse0 = false; - if (cale_serasai_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.cale_serasai.branchId", 11); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int cale_serasai_handleBranch11 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Well, we have Choster's sister. So either way, someone is going to pay. Hand over Choster or we kill the sister...I doubt you want her blood on your hands, %TU. - - //-- [RESPONSE NOTE] - //-- PLAYER: Let me contact Nym. - if (response == "s_40") - { - //-- [NOTE] - if (cale_serasai_condition__defaultCondition (player, npc)) - { - cale_serasai_action_signalAmbassador (player, npc); - - //-- NPC: Take your time. - string_id message = new string_id (c_stringFile, "s_42"); - utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.cale_serasai"); - - 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.cale_serasai"); - - 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 (cale_serasai_condition_speakLastTime (player, npc)) - { - doAnimationAction (npc, "scared"); - - cale_serasai_action_signalSpokenLastTime (player, npc); - - //-- NPC: Look...you made your point. I don't want any more trouble. I've sent a com to release Choster's sister. Now please leave me alone. - string_id message = new string_id (c_stringFile, "s_11"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Oh? What about the peace agreement? - boolean hasResponse0 = false; - if (cale_serasai_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_18"); - - utils.setScriptVar (player, "conversation.cale_serasai.branchId", 1); - - npcStartConversation (player, npc, "cale_serasai", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (cale_serasai_condition_hasNotCompletedWave (player, npc)) - { - cale_serasai_action_signalMessageReceived (player, npc); - - //-- NPC: Ha ha ha! You are back? Get him boys! - string_id message = new string_id (c_stringFile, "s_43"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (cale_serasai_condition_deliverMessage (player, npc)) - { - //-- NPC: You have a response from Nym? - string_id message = new string_id (c_stringFile, "s_13"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I do. - boolean hasResponse0 = false; - if (cale_serasai_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_14"); - - utils.setScriptVar (player, "conversation.cale_serasai.branchId", 4); - - npcStartConversation (player, npc, "cale_serasai", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (cale_serasai_condition_isAmbassador (player, npc)) - { - doAnimationAction (npc, "sigh_deeply"); - - //-- NPC: Are you the 'emissary' for Nym? By the way everyone talks, I expected the spacer they call %TU to be a bit bigger. - string_id message = new string_id (c_stringFile, "s_22"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm here. Talk peace. - boolean hasResponse0 = false; - if (cale_serasai_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_24"); - - utils.setScriptVar (player, "conversation.cale_serasai.branchId", 8); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "cale_serasai", 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 (cale_serasai_condition__defaultCondition (player, npc)) - { - //-- NPC: We don't need strangers around here. I suggest you leave. - string_id message = new string_id (c_stringFile, "s_46"); - 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 != "cale_serasai") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.cale_serasai.branchId"); - - if (branchId == 1 && cale_serasai_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && cale_serasai_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && cale_serasai_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && cale_serasai_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && cale_serasai_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && cale_serasai_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && cale_serasai_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 11 && cale_serasai_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// cale_serasai.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/cale_serasai"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean cale_serasai_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean cale_serasai_condition_isAmbassador (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "speakToAmbassador"); +} + +// ---------------------------------------------------------------------- + +boolean cale_serasai_condition_deliverMessage (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "deliverMessage"); +} + +// ---------------------------------------------------------------------- + +boolean cale_serasai_condition_moveThroughKill (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "killTheHenchmen"); +} + +// ---------------------------------------------------------------------- + +boolean cale_serasai_condition_speakLastTime (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "speakToAmbassadorTwo") + || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_negotiate_peace") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_rescue_sheeli")); +} + +// ---------------------------------------------------------------------- + +boolean cale_serasai_condition_hasNotCompletedWave (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "killTheHenchmen"); +} + +// ---------------------------------------------------------------------- + +boolean cale_serasai_condition_failedExtraction (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "u16_nym_themepark_rescue_sheeli_fail", "failedExtraction"); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void cale_serasai_action_signalMessageReceived (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasDeliveredMessage"); + + LOG("nym_wave_event", "sending wave signal"); + + dictionary dict = new dictionary(); + dict.put("player", player); + messageTo(npc, "waveEventControllerNPCStart", dict, 2, false); +} + +// ---------------------------------------------------------------------- + +void cale_serasai_action_giveRescueMission (obj_id player, obj_id npc) +{ + //groundquests.grantQuest(player, "u16_nym_themepark_rescue_sheeli"); +} + +// ---------------------------------------------------------------------- + +void cale_serasai_action_signalAmbassador (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasSpokenToAmbassador"); +} + +// ---------------------------------------------------------------------- + +void cale_serasai_action_signalKill (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasKilledTheHenchmen"); +} + +// ---------------------------------------------------------------------- + +void cale_serasai_action_signalSpokenLastTime (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasSpokenToAmbassadorTwo"); +} + +// ---------------------------------------------------------------------- + +void cale_serasai_action_clearFail (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasSpokenCaleRemoveFail"); + cale_serasai_action_giveRescueMission(player,npc); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int cale_serasai_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Look...you made your point. I don't want any more trouble. I've sent a com to release Choster's sister. Now please leave me alone. + + //-- [RESPONSE NOTE] + //-- PLAYER: Oh? What about the peace agreement? + if (response == "s_18") + { + //-- [NOTE] + if (cale_serasai_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "udaman"); + + cale_serasai_action_giveRescueMission (player, npc); + + //-- NPC: We'll be in contact. + string_id message = new string_id (c_stringFile, "s_19"); + utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int cale_serasai_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You have a response from Nym? + + //-- [RESPONSE NOTE] + //-- PLAYER: I do. + if (response == "s_14") + { + //-- [NOTE] + if (cale_serasai_condition__defaultCondition (player, npc)) + { + //-- NPC: What does the pirate say. + string_id message = new string_id (c_stringFile, "s_20"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Hand over Choster's sister for a ransom. + boolean hasResponse0 = false; + if (cale_serasai_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_35"); + + utils.setScriptVar (player, "conversation.cale_serasai.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int cale_serasai_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: What does the pirate say. + + //-- [RESPONSE NOTE] + //-- PLAYER: Hand over Choster's sister for a ransom. + if (response == "s_35") + { + //-- [NOTE] + if (cale_serasai_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "slit_throat"); + + //-- NPC: Let me guess. You just made that up didn't you? We want Choster. If we don't get Choster, the female Twi'lek dies! + string_id message = new string_id (c_stringFile, "s_36"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm not going to let you do that! + boolean hasResponse0 = false; + if (cale_serasai_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_37"); + + utils.setScriptVar (player, "conversation.cale_serasai.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int cale_serasai_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Let me guess. You just made that up didn't you? We want Choster. If we don't get Choster, the female Twi'lek dies! + + //-- [RESPONSE NOTE] + //-- PLAYER: I'm not going to let you do that! + if (response == "s_37") + { + //-- [NOTE] + if (cale_serasai_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "thumb_down"); + + cale_serasai_action_signalMessageReceived (player, npc); + + //-- NPC: We'll see. Attack! + string_id message = new string_id (c_stringFile, "s_38"); + utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int cale_serasai_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Are you the 'emissary' for Nym? By the way everyone talks, I expected the spacer they call %TU to be a bit bigger. + + //-- [RESPONSE NOTE] + //-- PLAYER: I'm here. Talk peace. + if (response == "s_24") + { + //-- [NOTE] + if (cale_serasai_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "nod_head_once"); + + //-- NPC: Straight to business. I like that. Okay, here is the deal. You pass us Choster, we'll sign a cease fire agreement. + string_id message = new string_id (c_stringFile, "s_26"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Choster? Never heard of him. + boolean hasResponse0 = false; + if (cale_serasai_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_29"); + + utils.setScriptVar (player, "conversation.cale_serasai.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int cale_serasai_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Straight to business. I like that. Okay, here is the deal. You pass us Choster, we'll sign a cease fire agreement. + + //-- [RESPONSE NOTE] + //-- PLAYER: Choster? Never heard of him. + if (response == "s_29") + { + //-- [NOTE] + if (cale_serasai_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "shake_head_no"); + + //-- NPC: Don't lie. We know you used him to get past the security system in our hideout. You'll hand him over then we'll sign an agreement. We'll even give you a good faith gift in credits. + string_id message = new string_id (c_stringFile, "s_30"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Nym won't go for it. + boolean hasResponse0 = false; + if (cale_serasai_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.cale_serasai.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int cale_serasai_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Don't lie. We know you used him to get past the security system in our hideout. You'll hand him over then we'll sign an agreement. We'll even give you a good faith gift in credits. + + //-- [RESPONSE NOTE] + //-- PLAYER: Nym won't go for it. + if (response == "s_32") + { + //-- [NOTE] + if (cale_serasai_condition__defaultCondition (player, npc)) + { + //-- NPC: Well, we have Choster's sister. So either way, someone is going to pay. Hand over Choster or we kill the sister...I doubt you want her blood on your hands, %TU. + string_id message = new string_id (c_stringFile, "s_34"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Let me contact Nym. + boolean hasResponse0 = false; + if (cale_serasai_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.cale_serasai.branchId", 11); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcSpeak (player, pp); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int cale_serasai_handleBranch11 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Well, we have Choster's sister. So either way, someone is going to pay. Hand over Choster or we kill the sister...I doubt you want her blood on your hands, %TU. + + //-- [RESPONSE NOTE] + //-- PLAYER: Let me contact Nym. + if (response == "s_40") + { + //-- [NOTE] + if (cale_serasai_condition__defaultCondition (player, npc)) + { + cale_serasai_action_signalAmbassador (player, npc); + + //-- NPC: Take your time. + string_id message = new string_id (c_stringFile, "s_42"); + utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.cale_serasai"); + + 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.cale_serasai"); + + 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 (cale_serasai_condition_speakLastTime (player, npc)) + { + doAnimationAction (npc, "scared"); + + cale_serasai_action_signalSpokenLastTime (player, npc); + + //-- NPC: Look...you made your point. I don't want any more trouble. I've sent a com to release Choster's sister. Now please leave me alone. + string_id message = new string_id (c_stringFile, "s_11"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Oh? What about the peace agreement? + boolean hasResponse0 = false; + if (cale_serasai_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_18"); + + utils.setScriptVar (player, "conversation.cale_serasai.branchId", 1); + + npcStartConversation (player, npc, "cale_serasai", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (cale_serasai_condition_hasNotCompletedWave (player, npc)) + { + cale_serasai_action_signalMessageReceived (player, npc); + + //-- NPC: Ha ha ha! You are back? Get him boys! + string_id message = new string_id (c_stringFile, "s_43"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (cale_serasai_condition_deliverMessage (player, npc)) + { + //-- NPC: You have a response from Nym? + string_id message = new string_id (c_stringFile, "s_13"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I do. + boolean hasResponse0 = false; + if (cale_serasai_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_14"); + + utils.setScriptVar (player, "conversation.cale_serasai.branchId", 4); + + npcStartConversation (player, npc, "cale_serasai", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (cale_serasai_condition_isAmbassador (player, npc)) + { + doAnimationAction (npc, "sigh_deeply"); + + //-- NPC: Are you the 'emissary' for Nym? By the way everyone talks, I expected the spacer they call %TU to be a bit bigger. + string_id message = new string_id (c_stringFile, "s_22"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm here. Talk peace. + boolean hasResponse0 = false; + if (cale_serasai_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_24"); + + utils.setScriptVar (player, "conversation.cale_serasai.branchId", 8); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "cale_serasai", 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 (cale_serasai_condition__defaultCondition (player, npc)) + { + //-- NPC: We don't need strangers around here. I suggest you leave. + string_id message = new string_id (c_stringFile, "s_46"); + 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 != "cale_serasai") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.cale_serasai.branchId"); + + if (branchId == 1 && cale_serasai_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && cale_serasai_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && cale_serasai_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && cale_serasai_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && cale_serasai_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && cale_serasai_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && cale_serasai_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 11 && cale_serasai_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.cale_serasai.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/camp_beta_leader.script b/sku.0/sys.server/compiled/game/script/conversation/camp_beta_leader.script index 7bde8e50e..0a1e35cd8 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/camp_beta_leader.script +++ b/sku.0/sys.server/compiled/game/script/conversation/camp_beta_leader.script @@ -1,683 +1,683 @@ -// ====================================================================== -// -// camp_beta_leader.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.features; -include library.groundquests; -include library.space_quest; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/camp_beta_leader"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean camp_beta_leader_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean camp_beta_leader_condition_hasRadio (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "outbreak_radio_delivery_01", "findBossInCharge"); -} - -// ---------------------------------------------------------------------- - -boolean camp_beta_leader_condition_hasBetsy (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "outbreak_betsy_hidden_content", "hasBetsy"); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void camp_beta_leader_action_deliverRadioSignal (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundBoss"); -} - -// ---------------------------------------------------------------------- - -void camp_beta_leader_action_hasDeliveredBetsy (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasDeliveredBetsy"); - if(!hasCompletedCollectionSlot(player, "hidden_content_betsy")) - { - modifyCollectionSlotValue(player, "hidden_content_betsy", 1); - } -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int camp_beta_leader_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Hello. - - //-- [RESPONSE NOTE] - //-- PLAYER: I have someone that you may be missing. - if (response == "s_20") - { - //-- [NOTE] - if (camp_beta_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "celebrate"); - - camp_beta_leader_action_hasDeliveredBetsy (player, npc); - - //-- NPC: Betsy? Where did you find her! Never mind...I don't care. This is the best thing to happen since this nightmare started! Thank you, %TU! - string_id message = new string_id (c_stringFile, "s_21"); - utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_beta_leader_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: It's been a while since we have seen a survivor. Glad you found us. - - //-- [RESPONSE NOTE] - //-- PLAYER: Actually I was sent here to deliver a radio. - if (response == "s_32") - { - //-- [NOTE] - if (camp_beta_leader_condition__defaultCondition (player, npc)) - { - camp_beta_leader_action_deliverRadioSignal (player, npc); - - //-- NPC: A radio? That is the best news I have heard since...uh, in a long time. Please hand it over. - string_id message = new string_id (c_stringFile, "s_33"); - utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_beta_leader_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yes? - - //-- [RESPONSE NOTE] - //-- PLAYER: How did you get stuck in the quarantine zone? - if (response == "s_53") - { - //-- [NOTE] - if (camp_beta_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (player, "explain"); - - //-- NPC: I happened to be in the wrong place at the wrong time I guess. I was out extracting ore when I heard the first ugly. - string_id message = new string_id (c_stringFile, "s_64"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Ugly? - boolean hasResponse0 = false; - if (camp_beta_leader_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.camp_beta_leader.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_beta_leader_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I happened to be in the wrong place at the wrong time I guess. I was out extracting ore when I heard the first ugly. - - //-- [RESPONSE NOTE] - //-- PLAYER: Ugly? - if (response == "s_65") - { - //-- [NOTE] - if (camp_beta_leader_condition__defaultCondition (player, npc)) - { - //-- NPC: That is what I call them...anyway, I could hear it scream...or growl...some sort of combination of the two. It was calling the others, calling for back up or something, while staring directly at me and drooling. It was 150 meters away but it was close enough to scare the daylights out of me... - string_id message = new string_id (c_stringFile, "s_66"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Okay...well, I have to g.... - boolean hasResponse0 = false; - if (camp_beta_leader_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_67"); - - utils.setScriptVar (player, "conversation.camp_beta_leader.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_beta_leader_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: That is what I call them...anyway, I could hear it scream...or growl...some sort of combination of the two. It was calling the others, calling for back up or something, while staring directly at me and drooling. It was 150 meters away but it was close enough to scare the daylights out of me... - - //-- [RESPONSE NOTE] - //-- PLAYER: Okay...well, I have to g.... - if (response == "s_67") - { - //-- [NOTE] - if (camp_beta_leader_condition__defaultCondition (player, npc)) - { - //-- NPC: Luckily for me, it was missing a foot. It tried to hobble toward me...it stuck it's stump in the ground and made this kind of squish sound hitting the compacted ground. - string_id message = new string_id (c_stringFile, "s_68"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: OKAY! Heard enough, I'm going to go now. - boolean hasResponse0 = false; - if (camp_beta_leader_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.camp_beta_leader.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_beta_leader_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Luckily for me, it was missing a foot. It tried to hobble toward me...it stuck it's stump in the ground and made this kind of squish sound hitting the compacted ground. - - //-- [RESPONSE NOTE] - //-- PLAYER: OKAY! Heard enough, I'm going to go now. - if (response == "s_69") - { - //-- [NOTE] - if (camp_beta_leader_condition__defaultCondition (player, npc)) - { - //-- NPC: Betsy sensed a threat and lunged at the ugly. - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Wait. Who's Betsy? - boolean hasResponse0 = false; - if (camp_beta_leader_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_71"); - - utils.setScriptVar (player, "conversation.camp_beta_leader.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_beta_leader_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Betsy sensed a threat and lunged at the ugly. - - //-- [RESPONSE NOTE] - //-- PLAYER: Wait. Who's Betsy? - if (response == "s_71") - { - //-- [NOTE] - if (camp_beta_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "cover_eyes"); - - //-- NPC: My Carrion Spat, Betsy. She knocked it on the ground and covered my retreat. I ran up to some rocks and hid. Of course more showed up then and surrounded poor Betsy. Next thing I knew I was running away. I didn't stick around to watch...she was my best friend. Oh dear...Betsy didn't have a chance. - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sorry for your loss. - boolean hasResponse0 = false; - if (camp_beta_leader_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_73"); - - utils.setScriptVar (player, "conversation.camp_beta_leader.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_beta_leader_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: My Carrion Spat, Betsy. She knocked it on the ground and covered my retreat. I ran up to some rocks and hid. Of course more showed up then and surrounded poor Betsy. Next thing I knew I was running away. I didn't stick around to watch...she was my best friend. Oh dear...Betsy didn't have a chance. - - //-- [RESPONSE NOTE] - //-- PLAYER: Sorry for your loss. - if (response == "s_73") - { - //-- [NOTE] - if (camp_beta_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "catchbreath"); - - //-- NPC: (SOB) - string_id message = new string_id (c_stringFile, "s_74"); - utils.removeScriptVar (player, "conversation.camp_beta_leader.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 (camp_beta_leader_condition_hasBetsy (player, npc)) - { - //-- NPC: Hello. - string_id message = new string_id (c_stringFile, "s_19"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I have someone that you may be missing. - boolean hasResponse0 = false; - if (camp_beta_leader_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_20"); - - utils.setScriptVar (player, "conversation.camp_beta_leader.branchId", 1); - - npcStartConversation (player, npc, "camp_beta_leader", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (camp_beta_leader_condition_hasRadio (player, npc)) - { - //-- NPC: It's been a while since we have seen a survivor. Glad you found us. - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Actually I was sent here to deliver a radio. - boolean hasResponse0 = false; - if (camp_beta_leader_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.camp_beta_leader.branchId", 3); - - npcStartConversation (player, npc, "camp_beta_leader", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (camp_beta_leader_condition__defaultCondition (player, npc)) - { - //-- NPC: Yes? - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: How did you get stuck in the quarantine zone? - boolean hasResponse0 = false; - if (camp_beta_leader_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_53"); - - utils.setScriptVar (player, "conversation.camp_beta_leader.branchId", 5); - - npcStartConversation (player, npc, "camp_beta_leader", 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 != "camp_beta_leader") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.camp_beta_leader.branchId"); - - if (branchId == 1 && camp_beta_leader_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && camp_beta_leader_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && camp_beta_leader_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && camp_beta_leader_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && camp_beta_leader_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && camp_beta_leader_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && camp_beta_leader_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && camp_beta_leader_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// camp_beta_leader.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.features; +include library.groundquests; +include library.space_quest; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/camp_beta_leader"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean camp_beta_leader_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean camp_beta_leader_condition_hasRadio (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "outbreak_radio_delivery_01", "findBossInCharge"); +} + +// ---------------------------------------------------------------------- + +boolean camp_beta_leader_condition_hasBetsy (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "outbreak_betsy_hidden_content", "hasBetsy"); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void camp_beta_leader_action_deliverRadioSignal (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundBoss"); +} + +// ---------------------------------------------------------------------- + +void camp_beta_leader_action_hasDeliveredBetsy (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasDeliveredBetsy"); + if(!hasCompletedCollectionSlot(player, "hidden_content_betsy")) + { + modifyCollectionSlotValue(player, "hidden_content_betsy", 1); + } +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int camp_beta_leader_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Hello. + + //-- [RESPONSE NOTE] + //-- PLAYER: I have someone that you may be missing. + if (response == "s_20") + { + //-- [NOTE] + if (camp_beta_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "celebrate"); + + camp_beta_leader_action_hasDeliveredBetsy (player, npc); + + //-- NPC: Betsy? Where did you find her! Never mind...I don't care. This is the best thing to happen since this nightmare started! Thank you, %TU! + string_id message = new string_id (c_stringFile, "s_21"); + utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_beta_leader_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: It's been a while since we have seen a survivor. Glad you found us. + + //-- [RESPONSE NOTE] + //-- PLAYER: Actually I was sent here to deliver a radio. + if (response == "s_32") + { + //-- [NOTE] + if (camp_beta_leader_condition__defaultCondition (player, npc)) + { + camp_beta_leader_action_deliverRadioSignal (player, npc); + + //-- NPC: A radio? That is the best news I have heard since...uh, in a long time. Please hand it over. + string_id message = new string_id (c_stringFile, "s_33"); + utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_beta_leader_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yes? + + //-- [RESPONSE NOTE] + //-- PLAYER: How did you get stuck in the quarantine zone? + if (response == "s_53") + { + //-- [NOTE] + if (camp_beta_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (player, "explain"); + + //-- NPC: I happened to be in the wrong place at the wrong time I guess. I was out extracting ore when I heard the first ugly. + string_id message = new string_id (c_stringFile, "s_64"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Ugly? + boolean hasResponse0 = false; + if (camp_beta_leader_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.camp_beta_leader.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_beta_leader_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I happened to be in the wrong place at the wrong time I guess. I was out extracting ore when I heard the first ugly. + + //-- [RESPONSE NOTE] + //-- PLAYER: Ugly? + if (response == "s_65") + { + //-- [NOTE] + if (camp_beta_leader_condition__defaultCondition (player, npc)) + { + //-- NPC: That is what I call them...anyway, I could hear it scream...or growl...some sort of combination of the two. It was calling the others, calling for back up or something, while staring directly at me and drooling. It was 150 meters away but it was close enough to scare the daylights out of me... + string_id message = new string_id (c_stringFile, "s_66"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Okay...well, I have to g.... + boolean hasResponse0 = false; + if (camp_beta_leader_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_67"); + + utils.setScriptVar (player, "conversation.camp_beta_leader.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_beta_leader_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: That is what I call them...anyway, I could hear it scream...or growl...some sort of combination of the two. It was calling the others, calling for back up or something, while staring directly at me and drooling. It was 150 meters away but it was close enough to scare the daylights out of me... + + //-- [RESPONSE NOTE] + //-- PLAYER: Okay...well, I have to g.... + if (response == "s_67") + { + //-- [NOTE] + if (camp_beta_leader_condition__defaultCondition (player, npc)) + { + //-- NPC: Luckily for me, it was missing a foot. It tried to hobble toward me...it stuck it's stump in the ground and made this kind of squish sound hitting the compacted ground. + string_id message = new string_id (c_stringFile, "s_68"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: OKAY! Heard enough, I'm going to go now. + boolean hasResponse0 = false; + if (camp_beta_leader_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.camp_beta_leader.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_beta_leader_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Luckily for me, it was missing a foot. It tried to hobble toward me...it stuck it's stump in the ground and made this kind of squish sound hitting the compacted ground. + + //-- [RESPONSE NOTE] + //-- PLAYER: OKAY! Heard enough, I'm going to go now. + if (response == "s_69") + { + //-- [NOTE] + if (camp_beta_leader_condition__defaultCondition (player, npc)) + { + //-- NPC: Betsy sensed a threat and lunged at the ugly. + string_id message = new string_id (c_stringFile, "s_70"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Wait. Who's Betsy? + boolean hasResponse0 = false; + if (camp_beta_leader_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_71"); + + utils.setScriptVar (player, "conversation.camp_beta_leader.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_beta_leader_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Betsy sensed a threat and lunged at the ugly. + + //-- [RESPONSE NOTE] + //-- PLAYER: Wait. Who's Betsy? + if (response == "s_71") + { + //-- [NOTE] + if (camp_beta_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "cover_eyes"); + + //-- NPC: My Carrion Spat, Betsy. She knocked it on the ground and covered my retreat. I ran up to some rocks and hid. Of course more showed up then and surrounded poor Betsy. Next thing I knew I was running away. I didn't stick around to watch...she was my best friend. Oh dear...Betsy didn't have a chance. + string_id message = new string_id (c_stringFile, "s_72"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sorry for your loss. + boolean hasResponse0 = false; + if (camp_beta_leader_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_73"); + + utils.setScriptVar (player, "conversation.camp_beta_leader.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_beta_leader_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: My Carrion Spat, Betsy. She knocked it on the ground and covered my retreat. I ran up to some rocks and hid. Of course more showed up then and surrounded poor Betsy. Next thing I knew I was running away. I didn't stick around to watch...she was my best friend. Oh dear...Betsy didn't have a chance. + + //-- [RESPONSE NOTE] + //-- PLAYER: Sorry for your loss. + if (response == "s_73") + { + //-- [NOTE] + if (camp_beta_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "catchbreath"); + + //-- NPC: (SOB) + string_id message = new string_id (c_stringFile, "s_74"); + utils.removeScriptVar (player, "conversation.camp_beta_leader.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 (camp_beta_leader_condition_hasBetsy (player, npc)) + { + //-- NPC: Hello. + string_id message = new string_id (c_stringFile, "s_19"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I have someone that you may be missing. + boolean hasResponse0 = false; + if (camp_beta_leader_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_20"); + + utils.setScriptVar (player, "conversation.camp_beta_leader.branchId", 1); + + npcStartConversation (player, npc, "camp_beta_leader", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (camp_beta_leader_condition_hasRadio (player, npc)) + { + //-- NPC: It's been a while since we have seen a survivor. Glad you found us. + string_id message = new string_id (c_stringFile, "s_31"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Actually I was sent here to deliver a radio. + boolean hasResponse0 = false; + if (camp_beta_leader_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.camp_beta_leader.branchId", 3); + + npcStartConversation (player, npc, "camp_beta_leader", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (camp_beta_leader_condition__defaultCondition (player, npc)) + { + //-- NPC: Yes? + string_id message = new string_id (c_stringFile, "s_34"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: How did you get stuck in the quarantine zone? + boolean hasResponse0 = false; + if (camp_beta_leader_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_53"); + + utils.setScriptVar (player, "conversation.camp_beta_leader.branchId", 5); + + npcStartConversation (player, npc, "camp_beta_leader", 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 != "camp_beta_leader") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.camp_beta_leader.branchId"); + + if (branchId == 1 && camp_beta_leader_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && camp_beta_leader_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && camp_beta_leader_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && camp_beta_leader_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && camp_beta_leader_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && camp_beta_leader_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && camp_beta_leader_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && camp_beta_leader_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.camp_beta_leader.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/camp_delta_leader.script b/sku.0/sys.server/compiled/game/script/conversation/camp_delta_leader.script index 68bc13ea5..65480f544 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/camp_delta_leader.script +++ b/sku.0/sys.server/compiled/game/script/conversation/camp_delta_leader.script @@ -1,674 +1,674 @@ -// ====================================================================== -// -// camp_delta_leader.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.features; -include library.groundquests; -include library.space_quest; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/camp_delta_leader"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean camp_delta_leader_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean camp_delta_leader_condition_hasRadio (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "findBossInCharge"); -} - -// ---------------------------------------------------------------------- - -boolean camp_delta_leader_condition_hasBaton (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "outbreak_stun_baton_hidden_content", "hasBaton"); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void camp_delta_leader_action_deliverRadioSignal (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundBossCampDelta"); -} - -// ---------------------------------------------------------------------- - -void camp_delta_leader_action_hasDeliveredBaton (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasDeliveredBaton"); - if(!hasCompletedCollectionSlot(player, "hidden_content_stun_baton")) - { - modifyCollectionSlotValue(player, "hidden_content_stun_baton", 1); - } -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int camp_delta_leader_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Hello. - - //-- [RESPONSE NOTE] - //-- PLAYER: I have something for you. - if (response == "s_20") - { - //-- [NOTE] - if (camp_delta_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "celebrate1"); - - camp_delta_leader_action_hasDeliveredBaton (player, npc); - - //-- NPC: Well...now that looks a lot like my stun baton. Let me take a look at it. Well now...I don't know where you found it, but you did. I can't wait to use it again. - string_id message = new string_id (c_stringFile, "s_21"); - utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_delta_leader_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Report to supply if you need anything. You'll be taking up a defensive position at the fort entrance. - - //-- [RESPONSE NOTE] - //-- PLAYER: I have a radio for you. - if (response == "s_32") - { - //-- [NOTE] - if (camp_delta_leader_condition__defaultCondition (player, npc)) - { - //-- NPC: A working radio? Call in our position, we need to get out of here. - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Feel free to try. But don't get your hopes up. - boolean hasResponse0 = false; - if (camp_delta_leader_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.camp_delta_leader.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_delta_leader_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: A working radio? Call in our position, we need to get out of here. - - //-- [RESPONSE NOTE] - //-- PLAYER: Feel free to try. But don't get your hopes up. - if (response == "s_75") - { - //-- [NOTE] - if (camp_delta_leader_condition__defaultCondition (player, npc)) - { - //-- NPC: So it is as bad as I thought then. We'll never get out of here alive. Do me a favor...don't share this with anyone here. Morale is already really low. - string_id message = new string_id (c_stringFile, "s_76"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Don't be so quick to give up hope. Medical and food supplies are being dropped. - boolean hasResponse0 = false; - if (camp_delta_leader_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.camp_delta_leader.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_delta_leader_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: So it is as bad as I thought then. We'll never get out of here alive. Do me a favor...don't share this with anyone here. Morale is already really low. - - //-- [RESPONSE NOTE] - //-- PLAYER: Don't be so quick to give up hope. Medical and food supplies are being dropped. - if (response == "s_78") - { - //-- [NOTE] - if (camp_delta_leader_condition__defaultCondition (player, npc)) - { - //-- NPC: Well I suppose the Empire wouldn't bother unless they had a plan. - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Right. By the way, your call sign is 'camp delta.' - boolean hasResponse0 = false; - if (camp_delta_leader_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_81"); - - utils.setScriptVar (player, "conversation.camp_delta_leader.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_delta_leader_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Well I suppose the Empire wouldn't bother unless they had a plan. - - //-- [RESPONSE NOTE] - //-- PLAYER: Right. By the way, your call sign is 'camp delta.' - if (response == "s_81") - { - //-- [NOTE] - if (camp_delta_leader_condition__defaultCondition (player, npc)) - { - camp_delta_leader_action_deliverRadioSignal (player, npc); - - //-- NPC: Roger. - string_id message = new string_id (c_stringFile, "s_82"); - utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_delta_leader_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You'll need a few more weapons if you plan on surviving the next wave of attacks. Get with supply to scavenge something. - - //-- [RESPONSE NOTE] - //-- PLAYER: So you been in the quarantine zone long? - if (response == "s_53") - { - //-- [NOTE] - if (camp_delta_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (player, "explain"); - - //-- NPC: I was one of the grunts stationed at this forward post before it all began. Watched my whole squad get sick, die and then stand up hungry. - string_id message = new string_id (c_stringFile, "s_64"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: You didn't run? - boolean hasResponse0 = false; - if (camp_delta_leader_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.camp_delta_leader.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_delta_leader_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I was one of the grunts stationed at this forward post before it all began. Watched my whole squad get sick, die and then stand up hungry. - - //-- [RESPONSE NOTE] - //-- PLAYER: You didn't run? - if (response == "s_65") - { - //-- [NOTE] - if (camp_delta_leader_condition__defaultCondition (player, npc)) - { - //-- NPC: I dropped a CryoBan and while they stood there frozen, I beat them into to small pieces with a stun baton. - string_id message = new string_id (c_stringFile, "s_66"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Uh... - boolean hasResponse0 = false; - if (camp_delta_leader_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_67"); - - utils.setScriptVar (player, "conversation.camp_delta_leader.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_delta_leader_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I dropped a CryoBan and while they stood there frozen, I beat them into to small pieces with a stun baton. - - //-- [RESPONSE NOTE] - //-- PLAYER: Uh... - if (response == "s_67") - { - //-- [NOTE] - if (camp_delta_leader_condition__defaultCondition (player, npc)) - { - //-- NPC: Now that I think of it, where did I put that baton? - string_id message = new string_id (c_stringFile, "s_68"); - utils.removeScriptVar (player, "conversation.camp_delta_leader.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 (camp_delta_leader_condition_hasBaton (player, npc)) - { - //-- NPC: Hello. - string_id message = new string_id (c_stringFile, "s_19"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I have something for you. - boolean hasResponse0 = false; - if (camp_delta_leader_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_20"); - - utils.setScriptVar (player, "conversation.camp_delta_leader.branchId", 1); - - npcStartConversation (player, npc, "camp_delta_leader", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (camp_delta_leader_condition_hasRadio (player, npc)) - { - //-- NPC: Report to supply if you need anything. You'll be taking up a defensive position at the fort entrance. - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I have a radio for you. - boolean hasResponse0 = false; - if (camp_delta_leader_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.camp_delta_leader.branchId", 3); - - npcStartConversation (player, npc, "camp_delta_leader", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (camp_delta_leader_condition__defaultCondition (player, npc)) - { - //-- NPC: You'll need a few more weapons if you plan on surviving the next wave of attacks. Get with supply to scavenge something. - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: So you been in the quarantine zone long? - boolean hasResponse0 = false; - if (camp_delta_leader_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_53"); - - utils.setScriptVar (player, "conversation.camp_delta_leader.branchId", 8); - - npcStartConversation (player, npc, "camp_delta_leader", 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 != "camp_delta_leader") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.camp_delta_leader.branchId"); - - if (branchId == 1 && camp_delta_leader_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && camp_delta_leader_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && camp_delta_leader_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && camp_delta_leader_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && camp_delta_leader_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && camp_delta_leader_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && camp_delta_leader_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && camp_delta_leader_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// camp_delta_leader.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.features; +include library.groundquests; +include library.space_quest; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/camp_delta_leader"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean camp_delta_leader_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean camp_delta_leader_condition_hasRadio (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "findBossInCharge"); +} + +// ---------------------------------------------------------------------- + +boolean camp_delta_leader_condition_hasBaton (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "outbreak_stun_baton_hidden_content", "hasBaton"); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void camp_delta_leader_action_deliverRadioSignal (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundBossCampDelta"); +} + +// ---------------------------------------------------------------------- + +void camp_delta_leader_action_hasDeliveredBaton (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasDeliveredBaton"); + if(!hasCompletedCollectionSlot(player, "hidden_content_stun_baton")) + { + modifyCollectionSlotValue(player, "hidden_content_stun_baton", 1); + } +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int camp_delta_leader_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Hello. + + //-- [RESPONSE NOTE] + //-- PLAYER: I have something for you. + if (response == "s_20") + { + //-- [NOTE] + if (camp_delta_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "celebrate1"); + + camp_delta_leader_action_hasDeliveredBaton (player, npc); + + //-- NPC: Well...now that looks a lot like my stun baton. Let me take a look at it. Well now...I don't know where you found it, but you did. I can't wait to use it again. + string_id message = new string_id (c_stringFile, "s_21"); + utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_delta_leader_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Report to supply if you need anything. You'll be taking up a defensive position at the fort entrance. + + //-- [RESPONSE NOTE] + //-- PLAYER: I have a radio for you. + if (response == "s_32") + { + //-- [NOTE] + if (camp_delta_leader_condition__defaultCondition (player, npc)) + { + //-- NPC: A working radio? Call in our position, we need to get out of here. + string_id message = new string_id (c_stringFile, "s_33"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Feel free to try. But don't get your hopes up. + boolean hasResponse0 = false; + if (camp_delta_leader_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.camp_delta_leader.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_delta_leader_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: A working radio? Call in our position, we need to get out of here. + + //-- [RESPONSE NOTE] + //-- PLAYER: Feel free to try. But don't get your hopes up. + if (response == "s_75") + { + //-- [NOTE] + if (camp_delta_leader_condition__defaultCondition (player, npc)) + { + //-- NPC: So it is as bad as I thought then. We'll never get out of here alive. Do me a favor...don't share this with anyone here. Morale is already really low. + string_id message = new string_id (c_stringFile, "s_76"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Don't be so quick to give up hope. Medical and food supplies are being dropped. + boolean hasResponse0 = false; + if (camp_delta_leader_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.camp_delta_leader.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_delta_leader_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: So it is as bad as I thought then. We'll never get out of here alive. Do me a favor...don't share this with anyone here. Morale is already really low. + + //-- [RESPONSE NOTE] + //-- PLAYER: Don't be so quick to give up hope. Medical and food supplies are being dropped. + if (response == "s_78") + { + //-- [NOTE] + if (camp_delta_leader_condition__defaultCondition (player, npc)) + { + //-- NPC: Well I suppose the Empire wouldn't bother unless they had a plan. + string_id message = new string_id (c_stringFile, "s_79"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Right. By the way, your call sign is 'camp delta.' + boolean hasResponse0 = false; + if (camp_delta_leader_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_81"); + + utils.setScriptVar (player, "conversation.camp_delta_leader.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_delta_leader_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Well I suppose the Empire wouldn't bother unless they had a plan. + + //-- [RESPONSE NOTE] + //-- PLAYER: Right. By the way, your call sign is 'camp delta.' + if (response == "s_81") + { + //-- [NOTE] + if (camp_delta_leader_condition__defaultCondition (player, npc)) + { + camp_delta_leader_action_deliverRadioSignal (player, npc); + + //-- NPC: Roger. + string_id message = new string_id (c_stringFile, "s_82"); + utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_delta_leader_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You'll need a few more weapons if you plan on surviving the next wave of attacks. Get with supply to scavenge something. + + //-- [RESPONSE NOTE] + //-- PLAYER: So you been in the quarantine zone long? + if (response == "s_53") + { + //-- [NOTE] + if (camp_delta_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (player, "explain"); + + //-- NPC: I was one of the grunts stationed at this forward post before it all began. Watched my whole squad get sick, die and then stand up hungry. + string_id message = new string_id (c_stringFile, "s_64"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: You didn't run? + boolean hasResponse0 = false; + if (camp_delta_leader_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.camp_delta_leader.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_delta_leader_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I was one of the grunts stationed at this forward post before it all began. Watched my whole squad get sick, die and then stand up hungry. + + //-- [RESPONSE NOTE] + //-- PLAYER: You didn't run? + if (response == "s_65") + { + //-- [NOTE] + if (camp_delta_leader_condition__defaultCondition (player, npc)) + { + //-- NPC: I dropped a CryoBan and while they stood there frozen, I beat them into to small pieces with a stun baton. + string_id message = new string_id (c_stringFile, "s_66"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Uh... + boolean hasResponse0 = false; + if (camp_delta_leader_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_67"); + + utils.setScriptVar (player, "conversation.camp_delta_leader.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_delta_leader_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I dropped a CryoBan and while they stood there frozen, I beat them into to small pieces with a stun baton. + + //-- [RESPONSE NOTE] + //-- PLAYER: Uh... + if (response == "s_67") + { + //-- [NOTE] + if (camp_delta_leader_condition__defaultCondition (player, npc)) + { + //-- NPC: Now that I think of it, where did I put that baton? + string_id message = new string_id (c_stringFile, "s_68"); + utils.removeScriptVar (player, "conversation.camp_delta_leader.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 (camp_delta_leader_condition_hasBaton (player, npc)) + { + //-- NPC: Hello. + string_id message = new string_id (c_stringFile, "s_19"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I have something for you. + boolean hasResponse0 = false; + if (camp_delta_leader_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_20"); + + utils.setScriptVar (player, "conversation.camp_delta_leader.branchId", 1); + + npcStartConversation (player, npc, "camp_delta_leader", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (camp_delta_leader_condition_hasRadio (player, npc)) + { + //-- NPC: Report to supply if you need anything. You'll be taking up a defensive position at the fort entrance. + string_id message = new string_id (c_stringFile, "s_31"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I have a radio for you. + boolean hasResponse0 = false; + if (camp_delta_leader_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.camp_delta_leader.branchId", 3); + + npcStartConversation (player, npc, "camp_delta_leader", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (camp_delta_leader_condition__defaultCondition (player, npc)) + { + //-- NPC: You'll need a few more weapons if you plan on surviving the next wave of attacks. Get with supply to scavenge something. + string_id message = new string_id (c_stringFile, "s_34"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: So you been in the quarantine zone long? + boolean hasResponse0 = false; + if (camp_delta_leader_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_53"); + + utils.setScriptVar (player, "conversation.camp_delta_leader.branchId", 8); + + npcStartConversation (player, npc, "camp_delta_leader", 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 != "camp_delta_leader") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.camp_delta_leader.branchId"); + + if (branchId == 1 && camp_delta_leader_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && camp_delta_leader_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && camp_delta_leader_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && camp_delta_leader_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && camp_delta_leader_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && camp_delta_leader_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && camp_delta_leader_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && camp_delta_leader_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/camp_gamma_leader.script b/sku.0/sys.server/compiled/game/script/conversation/camp_gamma_leader.script index eb5332efb..c086718af 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/camp_gamma_leader.script +++ b/sku.0/sys.server/compiled/game/script/conversation/camp_gamma_leader.script @@ -1,747 +1,747 @@ -// ====================================================================== -// -// camp_gamma_leader.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.features; -include library.groundquests; -include library.space_quest; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/camp_gamma_leader"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean camp_gamma_leader_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean camp_gamma_leader_condition_hasRadio (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "outbreak_radio_delivery_02", "findBossInCharge"); -} - -// ---------------------------------------------------------------------- - -boolean camp_gamma_leader_condition_hasCamera (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "outbreak_scout_camera_hidden_content", "hasCamera"); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void camp_gamma_leader_action_deliverRadioSignal (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundBossCampGamma"); -} - -// ---------------------------------------------------------------------- - -void camp_gamma_leader_action_hasDeliveredCamera (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasDeliveredCamera"); - if(!hasCompletedCollectionSlot(player, "hidden_content_camera")) - { - modifyCollectionSlotValue(player, "hidden_content_camera", 1); - } -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int camp_gamma_leader_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Hello. - - //-- [RESPONSE NOTE] - //-- PLAYER: I have something for you. - if (response == "s_22") - { - //-- [NOTE] - if (camp_gamma_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "thank"); - - camp_gamma_leader_action_hasDeliveredCamera (player, npc); - - //-- NPC: A smashed scout camera? Hey...wait a second. This is the scout unit we were here to rescue. Wow. Well, at least I have something to show for the trouble. Thanks, %TU. - string_id message = new string_id (c_stringFile, "s_23"); - utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_gamma_leader_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Report to the medic in the camp if you have any injuries...or if you are feeling sick in any way. - - //-- [RESPONSE NOTE] - //-- PLAYER: I'm not sick or injured, I have a radio for you. - if (response == "s_32") - { - //-- [NOTE] - if (camp_gamma_leader_condition__defaultCondition (player, npc)) - { - //-- NPC: A radio? Well, I suppose talking to the Empire beats talking to the hasty walls. Maybe they'll drop supplies. - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Check in with camp alpha. Your call sign is 'camp gamma.' - boolean hasResponse0 = false; - if (camp_gamma_leader_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.camp_gamma_leader.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_gamma_leader_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: A radio? Well, I suppose talking to the Empire beats talking to the hasty walls. Maybe they'll drop supplies. - - //-- [RESPONSE NOTE] - //-- PLAYER: Check in with camp alpha. Your call sign is 'camp gamma.' - if (response == "s_75") - { - //-- [NOTE] - if (camp_gamma_leader_condition__defaultCondition (player, npc)) - { - camp_gamma_leader_action_deliverRadioSignal (player, npc); - - //-- NPC: Will do. - string_id message = new string_id (c_stringFile, "s_76"); - utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_gamma_leader_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Can I help you? - - //-- [RESPONSE NOTE] - //-- PLAYER: How did you get stuck in the quarantine zone? - if (response == "s_53") - { - //-- [NOTE] - if (camp_gamma_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (player, "explain"); - - //-- NPC: I was part of a rescue team of 5 dropped in before the walls went up. We lost a squad of scouts...never did find them. Anyway, we were on foot at the last known location when they attacked. - string_id message = new string_id (c_stringFile, "s_64"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: The undead? - boolean hasResponse0 = false; - if (camp_gamma_leader_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.camp_gamma_leader.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_gamma_leader_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I was part of a rescue team of 5 dropped in before the walls went up. We lost a squad of scouts...never did find them. Anyway, we were on foot at the last known location when they attacked. - - //-- [RESPONSE NOTE] - //-- PLAYER: The undead? - if (response == "s_65") - { - //-- [NOTE] - if (camp_gamma_leader_condition__defaultCondition (player, npc)) - { - //-- NPC: Yeah...at first we just thought they were Stormtroopers, considering...well, considering they were Stormtroopers, but they weren't attacking. Just screaming at us in unison. Really strange...anyway. We didn't waste a moment before laying down surpressive fire. - string_id message = new string_id (c_stringFile, "s_66"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Did it do any good? - boolean hasResponse0 = false; - if (camp_gamma_leader_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_67"); - - utils.setScriptVar (player, "conversation.camp_gamma_leader.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_gamma_leader_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yeah...at first we just thought they were Stormtroopers, considering...well, considering they were Stormtroopers, but they weren't attacking. Just screaming at us in unison. Really strange...anyway. We didn't waste a moment before laying down surpressive fire. - - //-- [RESPONSE NOTE] - //-- PLAYER: Did it do any good? - if (response == "s_67") - { - //-- [NOTE] - if (camp_gamma_leader_condition__defaultCondition (player, npc)) - { - //-- NPC: Not really. We would shoot them down and they'd pop back up. Alpha team maneuvered to flank but they were right on top of them...they didn't care about flanking or suppressive fire...since of course they don't die. A few of us managed to run but even that didn't help. - string_id message = new string_id (c_stringFile, "s_68"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: They surrounded you? - boolean hasResponse0 = false; - if (camp_gamma_leader_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.camp_gamma_leader.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_gamma_leader_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Not really. We would shoot them down and they'd pop back up. Alpha team maneuvered to flank but they were right on top of them...they didn't care about flanking or suppressive fire...since of course they don't die. A few of us managed to run but even that didn't help. - - //-- [RESPONSE NOTE] - //-- PLAYER: They surrounded you? - if (response == "s_69") - { - //-- [NOTE] - if (camp_gamma_leader_condition__defaultCondition (player, npc)) - { - //-- NPC: No. Actually we made it back to an extraction point not far from here. Set up a defensive position and laid low. That was when the others got sick. You probably know what happened next. - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: The extraction never came? - boolean hasResponse0 = false; - if (camp_gamma_leader_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_71"); - - utils.setScriptVar (player, "conversation.camp_gamma_leader.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_gamma_leader_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: No. Actually we made it back to an extraction point not far from here. Set up a defensive position and laid low. That was when the others got sick. You probably know what happened next. - - //-- [RESPONSE NOTE] - //-- PLAYER: The extraction never came? - if (response == "s_71") - { - //-- [NOTE] - if (camp_gamma_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "cover_eyes"); - - //-- NPC: I called it off. As soon as the first one of my unit stood up and started eating the other, I wasn't about to risk it. I thought I was a gonner...but the sickness never took me. - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Well, looks like you are keeping everyone alive here. - boolean hasResponse0 = false; - if (camp_gamma_leader_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_73"); - - utils.setScriptVar (player, "conversation.camp_gamma_leader.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int camp_gamma_leader_handleBranch11 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I called it off. As soon as the first one of my unit stood up and started eating the other, I wasn't about to risk it. I thought I was a gonner...but the sickness never took me. - - //-- [RESPONSE NOTE] - //-- PLAYER: Well, looks like you are keeping everyone alive here. - if (response == "s_73") - { - //-- [NOTE] - if (camp_gamma_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "catchbreath"); - - //-- NPC: Maybe, but for how long? - string_id message = new string_id (c_stringFile, "s_74"); - utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - return SCRIPT_CONTINUE; -} - -trigger OnAttach () -{ - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - 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 (camp_gamma_leader_condition_hasCamera (player, npc)) - { - //-- NPC: Hello. - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I have something for you. - boolean hasResponse0 = false; - if (camp_gamma_leader_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_22"); - - utils.setScriptVar (player, "conversation.camp_gamma_leader.branchId", 1); - - npcStartConversation (player, npc, "camp_gamma_leader", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (camp_gamma_leader_condition_hasRadio (player, npc)) - { - //-- NPC: Report to the medic in the camp if you have any injuries...or if you are feeling sick in any way. - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm not sick or injured, I have a radio for you. - boolean hasResponse0 = false; - if (camp_gamma_leader_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.camp_gamma_leader.branchId", 3); - - npcStartConversation (player, npc, "camp_gamma_leader", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (camp_gamma_leader_condition__defaultCondition (player, npc)) - { - //-- NPC: Can I help you? - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: How did you get stuck in the quarantine zone? - boolean hasResponse0 = false; - if (camp_gamma_leader_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_53"); - - utils.setScriptVar (player, "conversation.camp_gamma_leader.branchId", 6); - - npcStartConversation (player, npc, "camp_gamma_leader", 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 != "camp_gamma_leader") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.camp_gamma_leader.branchId"); - - if (branchId == 1 && camp_gamma_leader_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && camp_gamma_leader_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && camp_gamma_leader_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && camp_gamma_leader_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && camp_gamma_leader_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && camp_gamma_leader_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && camp_gamma_leader_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && camp_gamma_leader_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 11 && camp_gamma_leader_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// camp_gamma_leader.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.features; +include library.groundquests; +include library.space_quest; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/camp_gamma_leader"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean camp_gamma_leader_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean camp_gamma_leader_condition_hasRadio (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "outbreak_radio_delivery_02", "findBossInCharge"); +} + +// ---------------------------------------------------------------------- + +boolean camp_gamma_leader_condition_hasCamera (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "outbreak_scout_camera_hidden_content", "hasCamera"); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void camp_gamma_leader_action_deliverRadioSignal (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundBossCampGamma"); +} + +// ---------------------------------------------------------------------- + +void camp_gamma_leader_action_hasDeliveredCamera (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasDeliveredCamera"); + if(!hasCompletedCollectionSlot(player, "hidden_content_camera")) + { + modifyCollectionSlotValue(player, "hidden_content_camera", 1); + } +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int camp_gamma_leader_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Hello. + + //-- [RESPONSE NOTE] + //-- PLAYER: I have something for you. + if (response == "s_22") + { + //-- [NOTE] + if (camp_gamma_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "thank"); + + camp_gamma_leader_action_hasDeliveredCamera (player, npc); + + //-- NPC: A smashed scout camera? Hey...wait a second. This is the scout unit we were here to rescue. Wow. Well, at least I have something to show for the trouble. Thanks, %TU. + string_id message = new string_id (c_stringFile, "s_23"); + utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_gamma_leader_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Report to the medic in the camp if you have any injuries...or if you are feeling sick in any way. + + //-- [RESPONSE NOTE] + //-- PLAYER: I'm not sick or injured, I have a radio for you. + if (response == "s_32") + { + //-- [NOTE] + if (camp_gamma_leader_condition__defaultCondition (player, npc)) + { + //-- NPC: A radio? Well, I suppose talking to the Empire beats talking to the hasty walls. Maybe they'll drop supplies. + string_id message = new string_id (c_stringFile, "s_33"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Check in with camp alpha. Your call sign is 'camp gamma.' + boolean hasResponse0 = false; + if (camp_gamma_leader_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.camp_gamma_leader.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_gamma_leader_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: A radio? Well, I suppose talking to the Empire beats talking to the hasty walls. Maybe they'll drop supplies. + + //-- [RESPONSE NOTE] + //-- PLAYER: Check in with camp alpha. Your call sign is 'camp gamma.' + if (response == "s_75") + { + //-- [NOTE] + if (camp_gamma_leader_condition__defaultCondition (player, npc)) + { + camp_gamma_leader_action_deliverRadioSignal (player, npc); + + //-- NPC: Will do. + string_id message = new string_id (c_stringFile, "s_76"); + utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_gamma_leader_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Can I help you? + + //-- [RESPONSE NOTE] + //-- PLAYER: How did you get stuck in the quarantine zone? + if (response == "s_53") + { + //-- [NOTE] + if (camp_gamma_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (player, "explain"); + + //-- NPC: I was part of a rescue team of 5 dropped in before the walls went up. We lost a squad of scouts...never did find them. Anyway, we were on foot at the last known location when they attacked. + string_id message = new string_id (c_stringFile, "s_64"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: The undead? + boolean hasResponse0 = false; + if (camp_gamma_leader_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.camp_gamma_leader.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_gamma_leader_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I was part of a rescue team of 5 dropped in before the walls went up. We lost a squad of scouts...never did find them. Anyway, we were on foot at the last known location when they attacked. + + //-- [RESPONSE NOTE] + //-- PLAYER: The undead? + if (response == "s_65") + { + //-- [NOTE] + if (camp_gamma_leader_condition__defaultCondition (player, npc)) + { + //-- NPC: Yeah...at first we just thought they were Stormtroopers, considering...well, considering they were Stormtroopers, but they weren't attacking. Just screaming at us in unison. Really strange...anyway. We didn't waste a moment before laying down surpressive fire. + string_id message = new string_id (c_stringFile, "s_66"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Did it do any good? + boolean hasResponse0 = false; + if (camp_gamma_leader_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_67"); + + utils.setScriptVar (player, "conversation.camp_gamma_leader.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_gamma_leader_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yeah...at first we just thought they were Stormtroopers, considering...well, considering they were Stormtroopers, but they weren't attacking. Just screaming at us in unison. Really strange...anyway. We didn't waste a moment before laying down surpressive fire. + + //-- [RESPONSE NOTE] + //-- PLAYER: Did it do any good? + if (response == "s_67") + { + //-- [NOTE] + if (camp_gamma_leader_condition__defaultCondition (player, npc)) + { + //-- NPC: Not really. We would shoot them down and they'd pop back up. Alpha team maneuvered to flank but they were right on top of them...they didn't care about flanking or suppressive fire...since of course they don't die. A few of us managed to run but even that didn't help. + string_id message = new string_id (c_stringFile, "s_68"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: They surrounded you? + boolean hasResponse0 = false; + if (camp_gamma_leader_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.camp_gamma_leader.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_gamma_leader_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Not really. We would shoot them down and they'd pop back up. Alpha team maneuvered to flank but they were right on top of them...they didn't care about flanking or suppressive fire...since of course they don't die. A few of us managed to run but even that didn't help. + + //-- [RESPONSE NOTE] + //-- PLAYER: They surrounded you? + if (response == "s_69") + { + //-- [NOTE] + if (camp_gamma_leader_condition__defaultCondition (player, npc)) + { + //-- NPC: No. Actually we made it back to an extraction point not far from here. Set up a defensive position and laid low. That was when the others got sick. You probably know what happened next. + string_id message = new string_id (c_stringFile, "s_70"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: The extraction never came? + boolean hasResponse0 = false; + if (camp_gamma_leader_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_71"); + + utils.setScriptVar (player, "conversation.camp_gamma_leader.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_gamma_leader_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: No. Actually we made it back to an extraction point not far from here. Set up a defensive position and laid low. That was when the others got sick. You probably know what happened next. + + //-- [RESPONSE NOTE] + //-- PLAYER: The extraction never came? + if (response == "s_71") + { + //-- [NOTE] + if (camp_gamma_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "cover_eyes"); + + //-- NPC: I called it off. As soon as the first one of my unit stood up and started eating the other, I wasn't about to risk it. I thought I was a gonner...but the sickness never took me. + string_id message = new string_id (c_stringFile, "s_72"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Well, looks like you are keeping everyone alive here. + boolean hasResponse0 = false; + if (camp_gamma_leader_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_73"); + + utils.setScriptVar (player, "conversation.camp_gamma_leader.branchId", 11); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int camp_gamma_leader_handleBranch11 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I called it off. As soon as the first one of my unit stood up and started eating the other, I wasn't about to risk it. I thought I was a gonner...but the sickness never took me. + + //-- [RESPONSE NOTE] + //-- PLAYER: Well, looks like you are keeping everyone alive here. + if (response == "s_73") + { + //-- [NOTE] + if (camp_gamma_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "catchbreath"); + + //-- NPC: Maybe, but for how long? + string_id message = new string_id (c_stringFile, "s_74"); + utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + setCondition (self, CONDITION_CONVERSABLE); + setCondition (self, CONDITION_INTERESTING); + + return SCRIPT_CONTINUE; +} + +trigger OnAttach () +{ + setCondition (self, CONDITION_CONVERSABLE); + setCondition (self, CONDITION_INTERESTING); + + 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 (camp_gamma_leader_condition_hasCamera (player, npc)) + { + //-- NPC: Hello. + string_id message = new string_id (c_stringFile, "s_21"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I have something for you. + boolean hasResponse0 = false; + if (camp_gamma_leader_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_22"); + + utils.setScriptVar (player, "conversation.camp_gamma_leader.branchId", 1); + + npcStartConversation (player, npc, "camp_gamma_leader", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (camp_gamma_leader_condition_hasRadio (player, npc)) + { + //-- NPC: Report to the medic in the camp if you have any injuries...or if you are feeling sick in any way. + string_id message = new string_id (c_stringFile, "s_31"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm not sick or injured, I have a radio for you. + boolean hasResponse0 = false; + if (camp_gamma_leader_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.camp_gamma_leader.branchId", 3); + + npcStartConversation (player, npc, "camp_gamma_leader", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (camp_gamma_leader_condition__defaultCondition (player, npc)) + { + //-- NPC: Can I help you? + string_id message = new string_id (c_stringFile, "s_34"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: How did you get stuck in the quarantine zone? + boolean hasResponse0 = false; + if (camp_gamma_leader_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_53"); + + utils.setScriptVar (player, "conversation.camp_gamma_leader.branchId", 6); + + npcStartConversation (player, npc, "camp_gamma_leader", 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 != "camp_gamma_leader") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.camp_gamma_leader.branchId"); + + if (branchId == 1 && camp_gamma_leader_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && camp_gamma_leader_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && camp_gamma_leader_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && camp_gamma_leader_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && camp_gamma_leader_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && camp_gamma_leader_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && camp_gamma_leader_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && camp_gamma_leader_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 11 && camp_gamma_leader_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_eight.script b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_eight.script index 9ace075ed..94c95c154 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_eight.script +++ b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_eight.script @@ -1,538 +1,538 @@ -// ====================================================================== -// -// collections_ice_cream_part_eight.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/collections_ice_cream_part_eight"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean collections_ice_cream_part_eight_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean collections_ice_cream_part_eight_condition_hasActiveTask (obj_id player, obj_id npc) -{ - if(groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_nore_brrea"); - } - return false; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void collections_ice_cream_part_eight_action_signalNextTask (obj_id player, obj_id npc) -{ - modifyCollectionSlotValue(player, "col_fried_icecream_part_08", 1); - groundquests.sendSignal(player, "meet_nore_brrea"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int collections_ice_cream_part_eight_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Hello. What brings you to me? - - //-- [RESPONSE NOTE] - //-- PLAYER: I am looking for Nore Brrea to ask some questions about this fryer. - if (response == "s_9") - { - //-- [NOTE] - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - //-- NPC: That is the X34 model version 3 right? Did you come here to see if I had lost my touch? - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Actually I am here to ask you to help me reverse engineer it. - boolean hasResponse0 = false; - if (collections_ice_cream_part_eight_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_12"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_eight_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: That is the X34 model version 3 right? Did you come here to see if I had lost my touch? - - //-- [RESPONSE NOTE] - //-- PLAYER: Actually I am here to ask you to help me reverse engineer it. - if (response == "s_12") - { - //-- [NOTE] - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - //-- NPC: I doubt I can be of much assistance for that. It is true that I worked at a factory that built that model but my position was purely managerial. - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: You must know something technical. - boolean hasResponse0 = false; - if (collections_ice_cream_part_eight_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_16"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_eight_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I doubt I can be of much assistance for that. It is true that I worked at a factory that built that model but my position was purely managerial. - - //-- [RESPONSE NOTE] - //-- PLAYER: You must know something technical. - if (response == "s_16") - { - //-- [NOTE] - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - //-- NPC: The first thing to come to mind with that model is the defective Temperature Control System. Many thought it was the timing mechanism that was defective but it was really the fact that the temperature was never adequately regulated. - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I have heard that. Can you point out the defective system? - boolean hasResponse0 = false; - if (collections_ice_cream_part_eight_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_19"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_eight_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: The first thing to come to mind with that model is the defective Temperature Control System. Many thought it was the timing mechanism that was defective but it was really the fact that the temperature was never adequately regulated. - - //-- [RESPONSE NOTE] - //-- PLAYER: I have heard that. Can you point out the defective system? - if (response == "s_19") - { - //-- [NOTE] - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - //-- NPC: Yes. It is right here. You should really make sure this system works properly or else the fryer is nearly worthless. - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I hate to ask...but is there anyone else that might help with the reverse engineering process? - boolean hasResponse0 = false; - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_24"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_eight_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yes. It is right here. You should really make sure this system works properly or else the fryer is nearly worthless. - - //-- [RESPONSE NOTE] - //-- PLAYER: I hate to ask...but is there anyone else that might help with the reverse engineering process? - if (response == "s_24") - { - //-- [NOTE] - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - //-- NPC: I know the current location of a droid that was assigned schematic revisions for that model. Would that help you? - string_id message = new string_id (c_stringFile, "s_25"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Uh. Yeah. I have a feeling that might be exactly who I need to speak with. - boolean hasResponse0 = false; - if (collections_ice_cream_part_eight_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_27"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_eight_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I know the current location of a droid that was assigned schematic revisions for that model. Would that help you? - - //-- [RESPONSE NOTE] - //-- PLAYER: Uh. Yeah. I have a feeling that might be exactly who I need to speak with. - if (response == "s_27") - { - //-- [NOTE] - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_eight_action_signalNextTask (player, npc); - - //-- NPC: Here you go. His name is A5 S5 but everyone calls him 'Otonon Tracks.' - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.collections_ice_cream_part_eight"); - - 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.collections_ice_cream_part_eight"); - - 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 (collections_ice_cream_part_eight_condition_hasActiveTask (player, npc)) - { - //-- NPC: Hello. What brings you to me? - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I am looking for Nore Brrea to ask some questions about this fryer. - boolean hasResponse0 = false; - if (collections_ice_cream_part_eight_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_9"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_eight", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - //-- NPC: I'm sorry. I am waiting for someone else that looks sort of like you, only better looking. - string_id message = new string_id (c_stringFile, "s_30"); - 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 != "collections_ice_cream_part_eight") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - if (branchId == 1 && collections_ice_cream_part_eight_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && collections_ice_cream_part_eight_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && collections_ice_cream_part_eight_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && collections_ice_cream_part_eight_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && collections_ice_cream_part_eight_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && collections_ice_cream_part_eight_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// collections_ice_cream_part_eight.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/collections_ice_cream_part_eight"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean collections_ice_cream_part_eight_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean collections_ice_cream_part_eight_condition_hasActiveTask (obj_id player, obj_id npc) +{ + if(groundquests.isQuestActive(player, "chapter9_ice_cream")) + { + return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_nore_brrea"); + } + return false; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void collections_ice_cream_part_eight_action_signalNextTask (obj_id player, obj_id npc) +{ + modifyCollectionSlotValue(player, "col_fried_icecream_part_08", 1); + groundquests.sendSignal(player, "meet_nore_brrea"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int collections_ice_cream_part_eight_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Hello. What brings you to me? + + //-- [RESPONSE NOTE] + //-- PLAYER: I am looking for Nore Brrea to ask some questions about this fryer. + if (response == "s_9") + { + //-- [NOTE] + if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) + { + //-- NPC: That is the X34 model version 3 right? Did you come here to see if I had lost my touch? + string_id message = new string_id (c_stringFile, "s_10"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Actually I am here to ask you to help me reverse engineer it. + boolean hasResponse0 = false; + if (collections_ice_cream_part_eight_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_12"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 2); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_eight_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: That is the X34 model version 3 right? Did you come here to see if I had lost my touch? + + //-- [RESPONSE NOTE] + //-- PLAYER: Actually I am here to ask you to help me reverse engineer it. + if (response == "s_12") + { + //-- [NOTE] + if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) + { + //-- NPC: I doubt I can be of much assistance for that. It is true that I worked at a factory that built that model but my position was purely managerial. + string_id message = new string_id (c_stringFile, "s_14"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: You must know something technical. + boolean hasResponse0 = false; + if (collections_ice_cream_part_eight_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_16"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_eight_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I doubt I can be of much assistance for that. It is true that I worked at a factory that built that model but my position was purely managerial. + + //-- [RESPONSE NOTE] + //-- PLAYER: You must know something technical. + if (response == "s_16") + { + //-- [NOTE] + if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) + { + //-- NPC: The first thing to come to mind with that model is the defective Temperature Control System. Many thought it was the timing mechanism that was defective but it was really the fact that the temperature was never adequately regulated. + string_id message = new string_id (c_stringFile, "s_18"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I have heard that. Can you point out the defective system? + boolean hasResponse0 = false; + if (collections_ice_cream_part_eight_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_19"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_eight_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: The first thing to come to mind with that model is the defective Temperature Control System. Many thought it was the timing mechanism that was defective but it was really the fact that the temperature was never adequately regulated. + + //-- [RESPONSE NOTE] + //-- PLAYER: I have heard that. Can you point out the defective system? + if (response == "s_19") + { + //-- [NOTE] + if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) + { + //-- NPC: Yes. It is right here. You should really make sure this system works properly or else the fryer is nearly worthless. + string_id message = new string_id (c_stringFile, "s_20"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I hate to ask...but is there anyone else that might help with the reverse engineering process? + boolean hasResponse0 = false; + if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_24"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_eight_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yes. It is right here. You should really make sure this system works properly or else the fryer is nearly worthless. + + //-- [RESPONSE NOTE] + //-- PLAYER: I hate to ask...but is there anyone else that might help with the reverse engineering process? + if (response == "s_24") + { + //-- [NOTE] + if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) + { + //-- NPC: I know the current location of a droid that was assigned schematic revisions for that model. Would that help you? + string_id message = new string_id (c_stringFile, "s_25"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Uh. Yeah. I have a feeling that might be exactly who I need to speak with. + boolean hasResponse0 = false; + if (collections_ice_cream_part_eight_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_27"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_eight_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I know the current location of a droid that was assigned schematic revisions for that model. Would that help you? + + //-- [RESPONSE NOTE] + //-- PLAYER: Uh. Yeah. I have a feeling that might be exactly who I need to speak with. + if (response == "s_27") + { + //-- [NOTE] + if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) + { + collections_ice_cream_part_eight_action_signalNextTask (player, npc); + + //-- NPC: Here you go. His name is A5 S5 but everyone calls him 'Otonon Tracks.' + string_id message = new string_id (c_stringFile, "s_28"); + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.collections_ice_cream_part_eight"); + + 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.collections_ice_cream_part_eight"); + + 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 (collections_ice_cream_part_eight_condition_hasActiveTask (player, npc)) + { + //-- NPC: Hello. What brings you to me? + string_id message = new string_id (c_stringFile, "s_4"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I am looking for Nore Brrea to ask some questions about this fryer. + boolean hasResponse0 = false; + if (collections_ice_cream_part_eight_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_9"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 1); + + npcStartConversation (player, npc, "collections_ice_cream_part_eight", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) + { + //-- NPC: I'm sorry. I am waiting for someone else that looks sort of like you, only better looking. + string_id message = new string_id (c_stringFile, "s_30"); + 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 != "collections_ice_cream_part_eight") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); + + if (branchId == 1 && collections_ice_cream_part_eight_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && collections_ice_cream_part_eight_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && collections_ice_cream_part_eight_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && collections_ice_cream_part_eight_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && collections_ice_cream_part_eight_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && collections_ice_cream_part_eight_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_five.script b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_five.script index 07ab6af42..f06b0468d 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_five.script +++ b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_five.script @@ -1,478 +1,478 @@ -// ====================================================================== -// -// collections_ice_cream_part_five.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/collections_ice_cream_part_five"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean collections_ice_cream_part_five_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean collections_ice_cream_part_five_condition_hasActiveTask (obj_id player, obj_id npc) -{ - if(groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_kerhi_hilak"); - } - return false; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void collections_ice_cream_part_five_action_signalNextTask (obj_id player, obj_id npc) -{ - modifyCollectionSlotValue(player, "col_fried_icecream_part_05", 1); - groundquests.sendSignal(player, "meet_kerhi_hilak"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int collections_ice_cream_part_five_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Hello my name is Kerhi hi-Lak welcome to my humble shop. - - //-- [RESPONSE NOTE] - //-- PLAYER: Hi Kerhi hi-Lak, I was told that you might know something about this fryer? - if (response == "s_9") - { - //-- [NOTE] - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - //-- NPC: I know a few things about those old fryers. Mainly that they break down and they are impossible to sell. If you are here to sell it, I am not interested. - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Actually I am hoping to reverse engineer it. - boolean hasResponse0 = false; - if (collections_ice_cream_part_five_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_12"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_five.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_five_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I know a few things about those old fryers. Mainly that they break down and they are impossible to sell. If you are here to sell it, I am not interested. - - //-- [RESPONSE NOTE] - //-- PLAYER: Actually I am hoping to reverse engineer it. - if (response == "s_12") - { - //-- [NOTE] - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - //-- NPC: Hah! The first thing I would recommend changing is the Timer Mechanism. The old models had a defective timer, probably affected by the extreme heat. If you insulate the timer mechanism from the heat I bet it would help. - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What does the Timer Mechanism do exactly? - boolean hasResponse0 = false; - if (collections_ice_cream_part_five_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_16"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_five.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_five_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Hah! The first thing I would recommend changing is the Timer Mechanism. The old models had a defective timer, probably affected by the extreme heat. If you insulate the timer mechanism from the heat I bet it would help. - - //-- [RESPONSE NOTE] - //-- PLAYER: What does the Timer Mechanism do exactly? - if (response == "s_16") - { - //-- [NOTE] - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - //-- NPC: The timer is manually set by the cook. It is usually used to avoid over cooking what ever is in the fryer. If the timer is defective, not only will the food burn, but so will the oil. Perhaps even the entire fryer and anything in the immediate area would also be damaged. - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Some great information. Thank you. - boolean hasResponse0 = false; - if (collections_ice_cream_part_five_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_19"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_five.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_five_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: The timer is manually set by the cook. It is usually used to avoid over cooking what ever is in the fryer. If the timer is defective, not only will the food burn, but so will the oil. Perhaps even the entire fryer and anything in the immediate area would also be damaged. - - //-- [RESPONSE NOTE] - //-- PLAYER: Some great information. Thank you. - if (response == "s_19") - { - //-- [NOTE] - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - //-- NPC: You might want to speak with Tombl Blaus. He was an old fryer assembly worker. Used to work in the factory on one or two of the parts for these things. - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Where would Tombl Blaus be located exactly? - boolean hasResponse0 = false; - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_24"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_five.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_five_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You might want to speak with Tombl Blaus. He was an old fryer assembly worker. Used to work in the factory on one or two of the parts for these things. - - //-- [RESPONSE NOTE] - //-- PLAYER: Where would Tombl Blaus be located exactly? - if (response == "s_24") - { - //-- [NOTE] - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_five_action_signalNextTask (player, npc); - - //-- NPC: Here is his location. Good luck. - string_id message = new string_id (c_stringFile, "s_25"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.collections_ice_cream_part_five"); - - 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.collections_ice_cream_part_five"); - - 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 (collections_ice_cream_part_five_condition_hasActiveTask (player, npc)) - { - //-- NPC: Hello my name is Kerhi hi-Lak welcome to my humble shop. - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Hi Kerhi hi-Lak, I was told that you might know something about this fryer? - boolean hasResponse0 = false; - if (collections_ice_cream_part_five_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_9"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_five.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_five", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - //-- NPC: Hello my name is Kerhi Hilak welcome to my humble shop. Feel free to look around and ask questions. - string_id message = new string_id (c_stringFile, "s_26"); - 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 != "collections_ice_cream_part_five") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); - - if (branchId == 1 && collections_ice_cream_part_five_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && collections_ice_cream_part_five_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && collections_ice_cream_part_five_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && collections_ice_cream_part_five_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && collections_ice_cream_part_five_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// collections_ice_cream_part_five.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/collections_ice_cream_part_five"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean collections_ice_cream_part_five_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean collections_ice_cream_part_five_condition_hasActiveTask (obj_id player, obj_id npc) +{ + if(groundquests.isQuestActive(player, "chapter9_ice_cream")) + { + return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_kerhi_hilak"); + } + return false; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void collections_ice_cream_part_five_action_signalNextTask (obj_id player, obj_id npc) +{ + modifyCollectionSlotValue(player, "col_fried_icecream_part_05", 1); + groundquests.sendSignal(player, "meet_kerhi_hilak"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int collections_ice_cream_part_five_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Hello my name is Kerhi hi-Lak welcome to my humble shop. + + //-- [RESPONSE NOTE] + //-- PLAYER: Hi Kerhi hi-Lak, I was told that you might know something about this fryer? + if (response == "s_9") + { + //-- [NOTE] + if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) + { + //-- NPC: I know a few things about those old fryers. Mainly that they break down and they are impossible to sell. If you are here to sell it, I am not interested. + string_id message = new string_id (c_stringFile, "s_10"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Actually I am hoping to reverse engineer it. + boolean hasResponse0 = false; + if (collections_ice_cream_part_five_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_12"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_five.branchId", 2); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_five_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I know a few things about those old fryers. Mainly that they break down and they are impossible to sell. If you are here to sell it, I am not interested. + + //-- [RESPONSE NOTE] + //-- PLAYER: Actually I am hoping to reverse engineer it. + if (response == "s_12") + { + //-- [NOTE] + if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) + { + //-- NPC: Hah! The first thing I would recommend changing is the Timer Mechanism. The old models had a defective timer, probably affected by the extreme heat. If you insulate the timer mechanism from the heat I bet it would help. + string_id message = new string_id (c_stringFile, "s_14"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What does the Timer Mechanism do exactly? + boolean hasResponse0 = false; + if (collections_ice_cream_part_five_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_16"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_five.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_five_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Hah! The first thing I would recommend changing is the Timer Mechanism. The old models had a defective timer, probably affected by the extreme heat. If you insulate the timer mechanism from the heat I bet it would help. + + //-- [RESPONSE NOTE] + //-- PLAYER: What does the Timer Mechanism do exactly? + if (response == "s_16") + { + //-- [NOTE] + if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) + { + //-- NPC: The timer is manually set by the cook. It is usually used to avoid over cooking what ever is in the fryer. If the timer is defective, not only will the food burn, but so will the oil. Perhaps even the entire fryer and anything in the immediate area would also be damaged. + string_id message = new string_id (c_stringFile, "s_18"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Some great information. Thank you. + boolean hasResponse0 = false; + if (collections_ice_cream_part_five_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_19"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_five.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_five_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: The timer is manually set by the cook. It is usually used to avoid over cooking what ever is in the fryer. If the timer is defective, not only will the food burn, but so will the oil. Perhaps even the entire fryer and anything in the immediate area would also be damaged. + + //-- [RESPONSE NOTE] + //-- PLAYER: Some great information. Thank you. + if (response == "s_19") + { + //-- [NOTE] + if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) + { + //-- NPC: You might want to speak with Tombl Blaus. He was an old fryer assembly worker. Used to work in the factory on one or two of the parts for these things. + string_id message = new string_id (c_stringFile, "s_20"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Where would Tombl Blaus be located exactly? + boolean hasResponse0 = false; + if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_24"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_five.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_five_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You might want to speak with Tombl Blaus. He was an old fryer assembly worker. Used to work in the factory on one or two of the parts for these things. + + //-- [RESPONSE NOTE] + //-- PLAYER: Where would Tombl Blaus be located exactly? + if (response == "s_24") + { + //-- [NOTE] + if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) + { + collections_ice_cream_part_five_action_signalNextTask (player, npc); + + //-- NPC: Here is his location. Good luck. + string_id message = new string_id (c_stringFile, "s_25"); + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.collections_ice_cream_part_five"); + + 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.collections_ice_cream_part_five"); + + 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 (collections_ice_cream_part_five_condition_hasActiveTask (player, npc)) + { + //-- NPC: Hello my name is Kerhi hi-Lak welcome to my humble shop. + string_id message = new string_id (c_stringFile, "s_4"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Hi Kerhi hi-Lak, I was told that you might know something about this fryer? + boolean hasResponse0 = false; + if (collections_ice_cream_part_five_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_9"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_five.branchId", 1); + + npcStartConversation (player, npc, "collections_ice_cream_part_five", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) + { + //-- NPC: Hello my name is Kerhi Hilak welcome to my humble shop. Feel free to look around and ask questions. + string_id message = new string_id (c_stringFile, "s_26"); + 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 != "collections_ice_cream_part_five") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); + + if (branchId == 1 && collections_ice_cream_part_five_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && collections_ice_cream_part_five_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && collections_ice_cream_part_five_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && collections_ice_cream_part_five_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && collections_ice_cream_part_five_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_four.script b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_four.script index 397b6b726..5f771e7d0 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_four.script +++ b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_four.script @@ -1,478 +1,478 @@ -// ====================================================================== -// -// collections_ice_cream_part_four.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/collections_ice_cream_part_four"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean collections_ice_cream_part_four_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean collections_ice_cream_part_four_condition_hasActiveTask (obj_id player, obj_id npc) -{ - if(groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_eteto_topan"); - } - return false; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void collections_ice_cream_part_four_action_signalNextTask (obj_id player, obj_id npc) -{ - modifyCollectionSlotValue(player, "col_fried_icecream_part_04", 1); - groundquests.sendSignal(player, "meet_eteto_topan"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int collections_ice_cream_part_four_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Hello. I am busy in the garden at the moment. I wasn't expecting company. - - //-- [RESPONSE NOTE] - //-- PLAYER: I am sorry Eteto I don't want to take too much of your time. - if (response == "s_9") - { - //-- [NOTE] - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - //-- NPC: Oh? Do I know you? I don't recall your face. - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: No. Mikfa Faaus suggested I come and ask you about this fryer. - boolean hasResponse0 = false; - if (collections_ice_cream_part_four_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_12"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_four.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_four_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Oh? Do I know you? I don't recall your face. - - //-- [RESPONSE NOTE] - //-- PLAYER: No. Mikfa Faaus suggested I come and ask you about this fryer. - if (response == "s_12") - { - //-- [NOTE] - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - //-- NPC: Oh dear me. I am retired. I haven't handled one of those things in a long time. That looks as old as me. Does it work? - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: No it is broken. I am trying to reverse engineer it. - boolean hasResponse0 = false; - if (collections_ice_cream_part_four_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_16"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_four.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_four_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Oh dear me. I am retired. I haven't handled one of those things in a long time. That looks as old as me. Does it work? - - //-- [RESPONSE NOTE] - //-- PLAYER: No it is broken. I am trying to reverse engineer it. - if (response == "s_16") - { - //-- [NOTE] - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - //-- NPC: Oh. Well in that case I might be able to help. Obviously the fryer has a heating element that cannot be flammable and as well as not exceed the melting point of the fryer or the heating element itself. It must of course be hot enough to bring the oil to a boiling point. - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Wow. Thank you. Is there anything else you can tell me? - boolean hasResponse0 = false; - if (collections_ice_cream_part_four_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_19"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_four.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_four_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Oh. Well in that case I might be able to help. Obviously the fryer has a heating element that cannot be flammable and as well as not exceed the melting point of the fryer or the heating element itself. It must of course be hot enough to bring the oil to a boiling point. - - //-- [RESPONSE NOTE] - //-- PLAYER: Wow. Thank you. Is there anything else you can tell me? - if (response == "s_19") - { - //-- [NOTE] - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - //-- NPC: Huh? Who are you? Were we just having a conversation? Oh poodoo. I recognize that model of fryer. Kerhi Hilak used to sell those in her shop. You should visit her and maybe she'll buy it. That is what you wanted to do right? Sell it? - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Uh yeah. Where is Kerhi hi-Lak again? - boolean hasResponse0 = false; - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_24"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_four.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_four_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Huh? Who are you? Were we just having a conversation? Oh poodoo. I recognize that model of fryer. Kerhi Hilak used to sell those in her shop. You should visit her and maybe she'll buy it. That is what you wanted to do right? Sell it? - - //-- [RESPONSE NOTE] - //-- PLAYER: Uh yeah. Where is Kerhi hi-Lak again? - if (response == "s_24") - { - //-- [NOTE] - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_four_action_signalNextTask (player, npc); - - //-- NPC: Here you go. - string_id message = new string_id (c_stringFile, "s_25"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.collections_ice_cream_part_four"); - - 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.collections_ice_cream_part_four"); - - 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 (collections_ice_cream_part_four_condition_hasActiveTask (player, npc)) - { - //-- NPC: Hello. I am busy in the garden at the moment. I wasn't expecting company. - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I am sorry Eteto I don't want to take too much of your time. - boolean hasResponse0 = false; - if (collections_ice_cream_part_four_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_9"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_four.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_four", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - //-- NPC: Hello. I am busy in the garden at the moment. Maybe you can come back later for tea. - string_id message = new string_id (c_stringFile, "s_26"); - 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 != "collections_ice_cream_part_four") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); - - if (branchId == 1 && collections_ice_cream_part_four_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && collections_ice_cream_part_four_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && collections_ice_cream_part_four_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && collections_ice_cream_part_four_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && collections_ice_cream_part_four_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// collections_ice_cream_part_four.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/collections_ice_cream_part_four"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean collections_ice_cream_part_four_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean collections_ice_cream_part_four_condition_hasActiveTask (obj_id player, obj_id npc) +{ + if(groundquests.isQuestActive(player, "chapter9_ice_cream")) + { + return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_eteto_topan"); + } + return false; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void collections_ice_cream_part_four_action_signalNextTask (obj_id player, obj_id npc) +{ + modifyCollectionSlotValue(player, "col_fried_icecream_part_04", 1); + groundquests.sendSignal(player, "meet_eteto_topan"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int collections_ice_cream_part_four_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Hello. I am busy in the garden at the moment. I wasn't expecting company. + + //-- [RESPONSE NOTE] + //-- PLAYER: I am sorry Eteto I don't want to take too much of your time. + if (response == "s_9") + { + //-- [NOTE] + if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) + { + //-- NPC: Oh? Do I know you? I don't recall your face. + string_id message = new string_id (c_stringFile, "s_10"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: No. Mikfa Faaus suggested I come and ask you about this fryer. + boolean hasResponse0 = false; + if (collections_ice_cream_part_four_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_12"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_four.branchId", 2); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_four_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Oh? Do I know you? I don't recall your face. + + //-- [RESPONSE NOTE] + //-- PLAYER: No. Mikfa Faaus suggested I come and ask you about this fryer. + if (response == "s_12") + { + //-- [NOTE] + if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) + { + //-- NPC: Oh dear me. I am retired. I haven't handled one of those things in a long time. That looks as old as me. Does it work? + string_id message = new string_id (c_stringFile, "s_14"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: No it is broken. I am trying to reverse engineer it. + boolean hasResponse0 = false; + if (collections_ice_cream_part_four_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_16"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_four.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_four_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Oh dear me. I am retired. I haven't handled one of those things in a long time. That looks as old as me. Does it work? + + //-- [RESPONSE NOTE] + //-- PLAYER: No it is broken. I am trying to reverse engineer it. + if (response == "s_16") + { + //-- [NOTE] + if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) + { + //-- NPC: Oh. Well in that case I might be able to help. Obviously the fryer has a heating element that cannot be flammable and as well as not exceed the melting point of the fryer or the heating element itself. It must of course be hot enough to bring the oil to a boiling point. + string_id message = new string_id (c_stringFile, "s_18"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Wow. Thank you. Is there anything else you can tell me? + boolean hasResponse0 = false; + if (collections_ice_cream_part_four_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_19"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_four.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_four_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Oh. Well in that case I might be able to help. Obviously the fryer has a heating element that cannot be flammable and as well as not exceed the melting point of the fryer or the heating element itself. It must of course be hot enough to bring the oil to a boiling point. + + //-- [RESPONSE NOTE] + //-- PLAYER: Wow. Thank you. Is there anything else you can tell me? + if (response == "s_19") + { + //-- [NOTE] + if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) + { + //-- NPC: Huh? Who are you? Were we just having a conversation? Oh poodoo. I recognize that model of fryer. Kerhi Hilak used to sell those in her shop. You should visit her and maybe she'll buy it. That is what you wanted to do right? Sell it? + string_id message = new string_id (c_stringFile, "s_20"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Uh yeah. Where is Kerhi hi-Lak again? + boolean hasResponse0 = false; + if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_24"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_four.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_four_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Huh? Who are you? Were we just having a conversation? Oh poodoo. I recognize that model of fryer. Kerhi Hilak used to sell those in her shop. You should visit her and maybe she'll buy it. That is what you wanted to do right? Sell it? + + //-- [RESPONSE NOTE] + //-- PLAYER: Uh yeah. Where is Kerhi hi-Lak again? + if (response == "s_24") + { + //-- [NOTE] + if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) + { + collections_ice_cream_part_four_action_signalNextTask (player, npc); + + //-- NPC: Here you go. + string_id message = new string_id (c_stringFile, "s_25"); + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.collections_ice_cream_part_four"); + + 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.collections_ice_cream_part_four"); + + 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 (collections_ice_cream_part_four_condition_hasActiveTask (player, npc)) + { + //-- NPC: Hello. I am busy in the garden at the moment. I wasn't expecting company. + string_id message = new string_id (c_stringFile, "s_4"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I am sorry Eteto I don't want to take too much of your time. + boolean hasResponse0 = false; + if (collections_ice_cream_part_four_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_9"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_four.branchId", 1); + + npcStartConversation (player, npc, "collections_ice_cream_part_four", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) + { + //-- NPC: Hello. I am busy in the garden at the moment. Maybe you can come back later for tea. + string_id message = new string_id (c_stringFile, "s_26"); + 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 != "collections_ice_cream_part_four") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); + + if (branchId == 1 && collections_ice_cream_part_four_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && collections_ice_cream_part_four_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && collections_ice_cream_part_four_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && collections_ice_cream_part_four_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && collections_ice_cream_part_four_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_nine.script b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_nine.script index 9a1164c53..a763d4f21 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_nine.script +++ b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_nine.script @@ -1,658 +1,658 @@ -// ====================================================================== -// -// collections_ice_cream_part_nine.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/collections_ice_cream_part_nine"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean collections_ice_cream_part_nine_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean collections_ice_cream_part_nine_condition_hasActiveTask (obj_id player, obj_id npc) -{ - if(groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_otonon_tracks"); - } - return false; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void collections_ice_cream_part_nine_action_signalNextTask (obj_id player, obj_id npc) -{ - modifyCollectionSlotValue(player, "col_fried_icecream_part_09", 1); - groundquests.sendSignal(player, "meet_otonon_tracks"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int collections_ice_cream_part_nine_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Hello. May I take your order? - - //-- [RESPONSE NOTE] - //-- PLAYER: I am looking for a droid named 'Otonon Tracks.' Are you, uh...him? - if (response == "s_9") - { - //-- [NOTE] - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - //-- NPC: I am A5 S5 tending droid for the Ice Cream Man, my current owner who has nick named me 'Ice Maker.' No one refers to me as 'Otonon Tracks' any longer. - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Do you know anything about the construction of this fryer? I am trying to reverse engineer it. - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_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_12"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_nine_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I am A5 S5 tending droid for the Ice Cream Man, my current owner who has nick named me 'Ice Maker.' No one refers to me as 'Otonon Tracks' any longer. - - //-- [RESPONSE NOTE] - //-- PLAYER: Do you know anything about the construction of this fryer? I am trying to reverse engineer it. - if (response == "s_12") - { - //-- [NOTE] - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - //-- NPC: The X34 model version 3. I know that model as I revised a few parts for the version 4 schematic. What would you like to know? - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Do you have any of the schematics by chance? - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_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_16"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_nine_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: The X34 model version 3. I know that model as I revised a few parts for the version 4 schematic. What would you like to know? - - //-- [RESPONSE NOTE] - //-- PLAYER: Do you have any of the schematics by chance? - if (response == "s_16") - { - //-- [NOTE] - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - //-- NPC: Let me check. - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: How long will that take? - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_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_19"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_nine_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Let me check. - - //-- [RESPONSE NOTE] - //-- PLAYER: How long will that take? - if (response == "s_19") - { - //-- [NOTE] - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - //-- NPC: Please wait. I am scanning my memory banks. - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Are you done yet? - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_24"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_nine_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Please wait. I am scanning my memory banks. - - //-- [RESPONSE NOTE] - //-- PLAYER: Are you done yet? - if (response == "s_24") - { - //-- [NOTE] - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - //-- NPC: I cannot find any existing schematic data outside of the fryer diagram. Do you want me to interface with your datapad and provide this information? - string_id message = new string_id (c_stringFile, "s_25"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes. Please uh, interface as you like. - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_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_27"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_nine_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I cannot find any existing schematic data outside of the fryer diagram. Do you want me to interface with your datapad and provide this information? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes. Please uh, interface as you like. - if (response == "s_27") - { - //-- [NOTE] - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - //-- NPC: Done. Now, may I take your order? - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I was hoping you could tell me where I could find out more regarding the fryer. - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_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_31"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_nine_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Done. Now, may I take your order? - - //-- [RESPONSE NOTE] - //-- PLAYER: I was hoping you could tell me where I could find out more regarding the fryer. - if (response == "s_31") - { - //-- [NOTE] - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - //-- NPC: You could just ask the Ice Cream Man for a copy of his schematic. - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Why didn't you tell me he had the schematic? I could have just asked him. - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_34"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_nine_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You could just ask the Ice Cream Man for a copy of his schematic. - - //-- [RESPONSE NOTE] - //-- PLAYER: Why didn't you tell me he had the schematic? I could have just asked him. - if (response == "s_34") - { - //-- [NOTE] - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_nine_action_signalNextTask (player, npc); - - //-- NPC: You never asked. Next please. - string_id message = new string_id (c_stringFile, "s_36"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.collections_ice_cream_part_nine"); - - 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.collections_ice_cream_part_nine"); - - 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 (collections_ice_cream_part_nine_condition_hasActiveTask (player, npc)) - { - //-- NPC: Hello. May I take your order? - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I am looking for a droid named 'Otonon Tracks.' Are you, uh...him? - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_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_9"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_nine", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - //-- NPC: Hello. I am A5 S5, a tending droid. May I take your ice cream order? - string_id message = new string_id (c_stringFile, "s_38"); - 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 != "collections_ice_cream_part_nine") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - if (branchId == 1 && collections_ice_cream_part_nine_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && collections_ice_cream_part_nine_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && collections_ice_cream_part_nine_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && collections_ice_cream_part_nine_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && collections_ice_cream_part_nine_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && collections_ice_cream_part_nine_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && collections_ice_cream_part_nine_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && collections_ice_cream_part_nine_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// collections_ice_cream_part_nine.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/collections_ice_cream_part_nine"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean collections_ice_cream_part_nine_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean collections_ice_cream_part_nine_condition_hasActiveTask (obj_id player, obj_id npc) +{ + if(groundquests.isQuestActive(player, "chapter9_ice_cream")) + { + return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_otonon_tracks"); + } + return false; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void collections_ice_cream_part_nine_action_signalNextTask (obj_id player, obj_id npc) +{ + modifyCollectionSlotValue(player, "col_fried_icecream_part_09", 1); + groundquests.sendSignal(player, "meet_otonon_tracks"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int collections_ice_cream_part_nine_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Hello. May I take your order? + + //-- [RESPONSE NOTE] + //-- PLAYER: I am looking for a droid named 'Otonon Tracks.' Are you, uh...him? + if (response == "s_9") + { + //-- [NOTE] + if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) + { + //-- NPC: I am A5 S5 tending droid for the Ice Cream Man, my current owner who has nick named me 'Ice Maker.' No one refers to me as 'Otonon Tracks' any longer. + string_id message = new string_id (c_stringFile, "s_10"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Do you know anything about the construction of this fryer? I am trying to reverse engineer it. + boolean hasResponse0 = false; + if (collections_ice_cream_part_nine_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_12"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 2); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_nine_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I am A5 S5 tending droid for the Ice Cream Man, my current owner who has nick named me 'Ice Maker.' No one refers to me as 'Otonon Tracks' any longer. + + //-- [RESPONSE NOTE] + //-- PLAYER: Do you know anything about the construction of this fryer? I am trying to reverse engineer it. + if (response == "s_12") + { + //-- [NOTE] + if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) + { + //-- NPC: The X34 model version 3. I know that model as I revised a few parts for the version 4 schematic. What would you like to know? + string_id message = new string_id (c_stringFile, "s_14"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Do you have any of the schematics by chance? + boolean hasResponse0 = false; + if (collections_ice_cream_part_nine_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_16"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_nine_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: The X34 model version 3. I know that model as I revised a few parts for the version 4 schematic. What would you like to know? + + //-- [RESPONSE NOTE] + //-- PLAYER: Do you have any of the schematics by chance? + if (response == "s_16") + { + //-- [NOTE] + if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) + { + //-- NPC: Let me check. + string_id message = new string_id (c_stringFile, "s_18"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: How long will that take? + boolean hasResponse0 = false; + if (collections_ice_cream_part_nine_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_19"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_nine_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Let me check. + + //-- [RESPONSE NOTE] + //-- PLAYER: How long will that take? + if (response == "s_19") + { + //-- [NOTE] + if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) + { + //-- NPC: Please wait. I am scanning my memory banks. + string_id message = new string_id (c_stringFile, "s_20"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Are you done yet? + boolean hasResponse0 = false; + if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_24"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_nine_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Please wait. I am scanning my memory banks. + + //-- [RESPONSE NOTE] + //-- PLAYER: Are you done yet? + if (response == "s_24") + { + //-- [NOTE] + if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) + { + //-- NPC: I cannot find any existing schematic data outside of the fryer diagram. Do you want me to interface with your datapad and provide this information? + string_id message = new string_id (c_stringFile, "s_25"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes. Please uh, interface as you like. + boolean hasResponse0 = false; + if (collections_ice_cream_part_nine_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_27"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_nine_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I cannot find any existing schematic data outside of the fryer diagram. Do you want me to interface with your datapad and provide this information? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes. Please uh, interface as you like. + if (response == "s_27") + { + //-- [NOTE] + if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) + { + //-- NPC: Done. Now, may I take your order? + string_id message = new string_id (c_stringFile, "s_28"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I was hoping you could tell me where I could find out more regarding the fryer. + boolean hasResponse0 = false; + if (collections_ice_cream_part_nine_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_31"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_nine_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Done. Now, may I take your order? + + //-- [RESPONSE NOTE] + //-- PLAYER: I was hoping you could tell me where I could find out more regarding the fryer. + if (response == "s_31") + { + //-- [NOTE] + if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) + { + //-- NPC: You could just ask the Ice Cream Man for a copy of his schematic. + string_id message = new string_id (c_stringFile, "s_32"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Why didn't you tell me he had the schematic? I could have just asked him. + boolean hasResponse0 = false; + if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_34"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_nine_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You could just ask the Ice Cream Man for a copy of his schematic. + + //-- [RESPONSE NOTE] + //-- PLAYER: Why didn't you tell me he had the schematic? I could have just asked him. + if (response == "s_34") + { + //-- [NOTE] + if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) + { + collections_ice_cream_part_nine_action_signalNextTask (player, npc); + + //-- NPC: You never asked. Next please. + string_id message = new string_id (c_stringFile, "s_36"); + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.collections_ice_cream_part_nine"); + + 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.collections_ice_cream_part_nine"); + + 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 (collections_ice_cream_part_nine_condition_hasActiveTask (player, npc)) + { + //-- NPC: Hello. May I take your order? + string_id message = new string_id (c_stringFile, "s_4"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I am looking for a droid named 'Otonon Tracks.' Are you, uh...him? + boolean hasResponse0 = false; + if (collections_ice_cream_part_nine_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_9"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 1); + + npcStartConversation (player, npc, "collections_ice_cream_part_nine", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) + { + //-- NPC: Hello. I am A5 S5, a tending droid. May I take your ice cream order? + string_id message = new string_id (c_stringFile, "s_38"); + 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 != "collections_ice_cream_part_nine") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); + + if (branchId == 1 && collections_ice_cream_part_nine_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && collections_ice_cream_part_nine_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && collections_ice_cream_part_nine_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && collections_ice_cream_part_nine_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && collections_ice_cream_part_nine_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && collections_ice_cream_part_nine_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && collections_ice_cream_part_nine_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && collections_ice_cream_part_nine_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_one.script b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_one.script index 3b9c7e49c..f69d75fa5 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_one.script +++ b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_one.script @@ -1,357 +1,357 @@ -// ====================================================================== -// -// collections_ice_cream_part_one.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/collections_ice_cream_part_one"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean collections_ice_cream_part_one_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean collections_ice_cream_part_one_condition_hasActiveTask (obj_id player, obj_id npc) -{ - if(groundquests.isQuestActive(player, "chapter9_ice_cream")) - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_hunde_decan"); - - return false; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void collections_ice_cream_part_one_action_signalNextTask (obj_id player, obj_id npc) -{ - modifyCollectionSlotValue(player, "col_fried_icecream_part_01", 1); - groundquests.sendSignal(player, "meet_hunde_decan"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int collections_ice_cream_part_one_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I'm a tired old man living the simple life. How are you? - - //-- [RESPONSE NOTE] - //-- PLAYER: I'm fine. I found this fryer... - if (response == "s_9") - { - //-- [NOTE] - if (collections_ice_cream_part_one_condition__defaultCondition (player, npc)) - { - //-- NPC: Wow. Where did you find that old thing? Talk about old. I'd be surprised if that still works. - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: It doesn't. Can you help me fix it? - boolean hasResponse0 = false; - if (collections_ice_cream_part_one_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_12"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_one.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_one.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_one_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Wow. Where did you find that old thing? Talk about old. I'd be surprised if that still works. - - //-- [RESPONSE NOTE] - //-- PLAYER: It doesn't. Can you help me fix it? - if (response == "s_12") - { - //-- [NOTE] - if (collections_ice_cream_part_one_condition__defaultCondition (player, npc)) - { - //-- NPC: Oh no. I'm no repair man. Oh but look. You can probably still use this fryer basket. It belongs to the fryer anyway. I was just using it as a waste basket anyway. - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Gee...thanks. - boolean hasResponse0 = false; - if (collections_ice_cream_part_one_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_16"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_one.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_one.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_one_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Oh no. I'm no repair man. Oh but look. You can probably still use this fryer basket. It belongs to the fryer anyway. I was just using it as a waste basket anyway. - - //-- [RESPONSE NOTE] - //-- PLAYER: Gee...thanks. - if (response == "s_16") - { - //-- [NOTE] - if (collections_ice_cream_part_one_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_one_action_signalNextTask (player, npc); - - //-- NPC: You know what? You can go see Amyva. She's an acquaintance of mine and used to work with fryers just like this one. I'll put her location in your datapad. - string_id message = new string_id (c_stringFile, "s_18"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_one.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.collections_ice_cream_part_one"); - - 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.collections_ice_cream_part_one"); - - 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 (collections_ice_cream_part_one_condition_hasActiveTask (player, npc)) - { - //-- NPC: I'm a tired old man living the simple life. How are you? - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm fine. I found this fryer... - boolean hasResponse0 = false; - if (collections_ice_cream_part_one_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_9"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_one.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_one", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (collections_ice_cream_part_one_condition__defaultCondition (player, npc)) - { - //-- NPC: I'm a tired old man living the simple life. Always glad to say 'Hi' to travelers. Be careful out there. - string_id message = new string_id (c_stringFile, "s_17"); - 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 != "collections_ice_cream_part_one") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_one.branchId"); - - if (branchId == 1 && collections_ice_cream_part_one_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && collections_ice_cream_part_one_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && collections_ice_cream_part_one_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_one.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// collections_ice_cream_part_one.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/collections_ice_cream_part_one"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean collections_ice_cream_part_one_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean collections_ice_cream_part_one_condition_hasActiveTask (obj_id player, obj_id npc) +{ + if(groundquests.isQuestActive(player, "chapter9_ice_cream")) + return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_hunde_decan"); + + return false; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void collections_ice_cream_part_one_action_signalNextTask (obj_id player, obj_id npc) +{ + modifyCollectionSlotValue(player, "col_fried_icecream_part_01", 1); + groundquests.sendSignal(player, "meet_hunde_decan"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int collections_ice_cream_part_one_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I'm a tired old man living the simple life. How are you? + + //-- [RESPONSE NOTE] + //-- PLAYER: I'm fine. I found this fryer... + if (response == "s_9") + { + //-- [NOTE] + if (collections_ice_cream_part_one_condition__defaultCondition (player, npc)) + { + //-- NPC: Wow. Where did you find that old thing? Talk about old. I'd be surprised if that still works. + string_id message = new string_id (c_stringFile, "s_10"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: It doesn't. Can you help me fix it? + boolean hasResponse0 = false; + if (collections_ice_cream_part_one_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_12"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_one.branchId", 2); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_one.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_one_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Wow. Where did you find that old thing? Talk about old. I'd be surprised if that still works. + + //-- [RESPONSE NOTE] + //-- PLAYER: It doesn't. Can you help me fix it? + if (response == "s_12") + { + //-- [NOTE] + if (collections_ice_cream_part_one_condition__defaultCondition (player, npc)) + { + //-- NPC: Oh no. I'm no repair man. Oh but look. You can probably still use this fryer basket. It belongs to the fryer anyway. I was just using it as a waste basket anyway. + string_id message = new string_id (c_stringFile, "s_14"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Gee...thanks. + boolean hasResponse0 = false; + if (collections_ice_cream_part_one_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_16"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_one.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_one.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_one_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Oh no. I'm no repair man. Oh but look. You can probably still use this fryer basket. It belongs to the fryer anyway. I was just using it as a waste basket anyway. + + //-- [RESPONSE NOTE] + //-- PLAYER: Gee...thanks. + if (response == "s_16") + { + //-- [NOTE] + if (collections_ice_cream_part_one_condition__defaultCondition (player, npc)) + { + collections_ice_cream_part_one_action_signalNextTask (player, npc); + + //-- NPC: You know what? You can go see Amyva. She's an acquaintance of mine and used to work with fryers just like this one. I'll put her location in your datapad. + string_id message = new string_id (c_stringFile, "s_18"); + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_one.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.collections_ice_cream_part_one"); + + 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.collections_ice_cream_part_one"); + + 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 (collections_ice_cream_part_one_condition_hasActiveTask (player, npc)) + { + //-- NPC: I'm a tired old man living the simple life. How are you? + string_id message = new string_id (c_stringFile, "s_4"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm fine. I found this fryer... + boolean hasResponse0 = false; + if (collections_ice_cream_part_one_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_9"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_one.branchId", 1); + + npcStartConversation (player, npc, "collections_ice_cream_part_one", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (collections_ice_cream_part_one_condition__defaultCondition (player, npc)) + { + //-- NPC: I'm a tired old man living the simple life. Always glad to say 'Hi' to travelers. Be careful out there. + string_id message = new string_id (c_stringFile, "s_17"); + 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 != "collections_ice_cream_part_one") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_one.branchId"); + + if (branchId == 1 && collections_ice_cream_part_one_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && collections_ice_cream_part_one_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && collections_ice_cream_part_one_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_one.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_seven.script b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_seven.script index 0cec96c48..7ebea1ea6 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_seven.script +++ b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_seven.script @@ -1,478 +1,478 @@ -// ====================================================================== -// -// collections_ice_cream_part_seven.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/collections_ice_cream_part_seven"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean collections_ice_cream_part_seven_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean collections_ice_cream_part_seven_condition_hasActiveTask (obj_id player, obj_id npc) -{ - if(groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_lepwalk_chan"); - } - return false; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void collections_ice_cream_part_seven_action_signalNextTask (obj_id player, obj_id npc) -{ - modifyCollectionSlotValue(player, "col_fried_icecream_part_07", 1); - groundquests.sendSignal(player, "meet_lepwalk_chan"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int collections_ice_cream_part_seven_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I haven't seen anyone out here in a while. You lost? - - //-- [RESPONSE NOTE] - //-- PLAYER: No. I am looking for Lepwalk C'han. Wanted to ask him about reverse engineering this fryer. - if (response == "s_9") - { - //-- [NOTE] - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - //-- NPC: I am Lepwalk Chan and I know a few things about that fryer...but I don't know how much help I will be. - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Tombl mentioned you might have worked on the Oil Filtration System? - boolean hasResponse0 = false; - if (collections_ice_cream_part_seven_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_12"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_seven_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I am Lepwalk Chan and I know a few things about that fryer...but I don't know how much help I will be. - - //-- [RESPONSE NOTE] - //-- PLAYER: Tombl mentioned you might have worked on the Oil Filtration System? - if (response == "s_12") - { - //-- [NOTE] - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - //-- NPC: Oh you know Tombl? Yeah he and I worked on the fryer. I put in the Oil Filtration System. It was basically responsible for filtering out food remnants left behind in the frying process. - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Why does the oil need to be filtered? - boolean hasResponse0 = false; - if (collections_ice_cream_part_seven_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_16"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_seven_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Oh you know Tombl? Yeah he and I worked on the fryer. I put in the Oil Filtration System. It was basically responsible for filtering out food remnants left behind in the frying process. - - //-- [RESPONSE NOTE] - //-- PLAYER: Why does the oil need to be filtered? - if (response == "s_16") - { - //-- [NOTE] - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - //-- NPC: Well, you can't really leave the food in the oil or it will eventually burn. The filter unit in the fryer circulates the oil and catches and destroys food particles so you can use the same oil repeatedly. - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Ahh...I see. - boolean hasResponse0 = false; - if (collections_ice_cream_part_seven_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_19"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_seven_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Well, you can't really leave the food in the oil or it will eventually burn. The filter unit in the fryer circulates the oil and catches and destroys food particles so you can use the same oil repeatedly. - - //-- [RESPONSE NOTE] - //-- PLAYER: Ahh...I see. - if (response == "s_19") - { - //-- [NOTE] - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - //-- NPC: Anything else? - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I was about to ask you the same. Do you know anything else about the fryer? - boolean hasResponse0 = false; - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_24"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_seven_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Anything else? - - //-- [RESPONSE NOTE] - //-- PLAYER: I was about to ask you the same. Do you know anything else about the fryer? - if (response == "s_24") - { - //-- [NOTE] - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_seven_action_signalNextTask (player, npc); - - //-- NPC: Not enough to help you. You might want to speak to my old factory manager Nore Brrea. I will give you a datapad location. - string_id message = new string_id (c_stringFile, "s_25"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.collections_ice_cream_part_seven"); - - 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.collections_ice_cream_part_seven"); - - 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 (collections_ice_cream_part_seven_condition_hasActiveTask (player, npc)) - { - //-- NPC: I haven't seen anyone out here in a while. You lost? - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: No. I am looking for Lepwalk C'han. Wanted to ask him about reverse engineering this fryer. - boolean hasResponse0 = false; - if (collections_ice_cream_part_seven_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_9"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_seven", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - //-- NPC: I haven't seen anyone out here in a while. You must be lost. - string_id message = new string_id (c_stringFile, "s_26"); - 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 != "collections_ice_cream_part_seven") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); - - if (branchId == 1 && collections_ice_cream_part_seven_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && collections_ice_cream_part_seven_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && collections_ice_cream_part_seven_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && collections_ice_cream_part_seven_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && collections_ice_cream_part_seven_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// collections_ice_cream_part_seven.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/collections_ice_cream_part_seven"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean collections_ice_cream_part_seven_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean collections_ice_cream_part_seven_condition_hasActiveTask (obj_id player, obj_id npc) +{ + if(groundquests.isQuestActive(player, "chapter9_ice_cream")) + { + return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_lepwalk_chan"); + } + return false; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void collections_ice_cream_part_seven_action_signalNextTask (obj_id player, obj_id npc) +{ + modifyCollectionSlotValue(player, "col_fried_icecream_part_07", 1); + groundquests.sendSignal(player, "meet_lepwalk_chan"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int collections_ice_cream_part_seven_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I haven't seen anyone out here in a while. You lost? + + //-- [RESPONSE NOTE] + //-- PLAYER: No. I am looking for Lepwalk C'han. Wanted to ask him about reverse engineering this fryer. + if (response == "s_9") + { + //-- [NOTE] + if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) + { + //-- NPC: I am Lepwalk Chan and I know a few things about that fryer...but I don't know how much help I will be. + string_id message = new string_id (c_stringFile, "s_10"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Tombl mentioned you might have worked on the Oil Filtration System? + boolean hasResponse0 = false; + if (collections_ice_cream_part_seven_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_12"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId", 2); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_seven_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I am Lepwalk Chan and I know a few things about that fryer...but I don't know how much help I will be. + + //-- [RESPONSE NOTE] + //-- PLAYER: Tombl mentioned you might have worked on the Oil Filtration System? + if (response == "s_12") + { + //-- [NOTE] + if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) + { + //-- NPC: Oh you know Tombl? Yeah he and I worked on the fryer. I put in the Oil Filtration System. It was basically responsible for filtering out food remnants left behind in the frying process. + string_id message = new string_id (c_stringFile, "s_14"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Why does the oil need to be filtered? + boolean hasResponse0 = false; + if (collections_ice_cream_part_seven_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_16"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_seven_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Oh you know Tombl? Yeah he and I worked on the fryer. I put in the Oil Filtration System. It was basically responsible for filtering out food remnants left behind in the frying process. + + //-- [RESPONSE NOTE] + //-- PLAYER: Why does the oil need to be filtered? + if (response == "s_16") + { + //-- [NOTE] + if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) + { + //-- NPC: Well, you can't really leave the food in the oil or it will eventually burn. The filter unit in the fryer circulates the oil and catches and destroys food particles so you can use the same oil repeatedly. + string_id message = new string_id (c_stringFile, "s_18"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Ahh...I see. + boolean hasResponse0 = false; + if (collections_ice_cream_part_seven_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_19"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_seven_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Well, you can't really leave the food in the oil or it will eventually burn. The filter unit in the fryer circulates the oil and catches and destroys food particles so you can use the same oil repeatedly. + + //-- [RESPONSE NOTE] + //-- PLAYER: Ahh...I see. + if (response == "s_19") + { + //-- [NOTE] + if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) + { + //-- NPC: Anything else? + string_id message = new string_id (c_stringFile, "s_20"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I was about to ask you the same. Do you know anything else about the fryer? + boolean hasResponse0 = false; + if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_24"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_seven_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Anything else? + + //-- [RESPONSE NOTE] + //-- PLAYER: I was about to ask you the same. Do you know anything else about the fryer? + if (response == "s_24") + { + //-- [NOTE] + if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) + { + collections_ice_cream_part_seven_action_signalNextTask (player, npc); + + //-- NPC: Not enough to help you. You might want to speak to my old factory manager Nore Brrea. I will give you a datapad location. + string_id message = new string_id (c_stringFile, "s_25"); + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.collections_ice_cream_part_seven"); + + 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.collections_ice_cream_part_seven"); + + 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 (collections_ice_cream_part_seven_condition_hasActiveTask (player, npc)) + { + //-- NPC: I haven't seen anyone out here in a while. You lost? + string_id message = new string_id (c_stringFile, "s_4"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: No. I am looking for Lepwalk C'han. Wanted to ask him about reverse engineering this fryer. + boolean hasResponse0 = false; + if (collections_ice_cream_part_seven_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_9"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId", 1); + + npcStartConversation (player, npc, "collections_ice_cream_part_seven", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) + { + //-- NPC: I haven't seen anyone out here in a while. You must be lost. + string_id message = new string_id (c_stringFile, "s_26"); + 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 != "collections_ice_cream_part_seven") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); + + if (branchId == 1 && collections_ice_cream_part_seven_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && collections_ice_cream_part_seven_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && collections_ice_cream_part_seven_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && collections_ice_cream_part_seven_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && collections_ice_cream_part_seven_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_six.script b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_six.script index 5ae7b825a..fd32b473d 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_six.script +++ b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_six.script @@ -1,478 +1,478 @@ -// ====================================================================== -// -// collections_ice_cream_part_six.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/collections_ice_cream_part_six"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean collections_ice_cream_part_six_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean collections_ice_cream_part_six_condition_hasActiveTask (obj_id player, obj_id npc) -{ - if(groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_tombl_blaus"); - } - return false; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void collections_ice_cream_part_six_action_signalNextTask (obj_id player, obj_id npc) -{ - modifyCollectionSlotValue(player, "col_fried_icecream_part_06", 1); - groundquests.sendSignal(player, "meet_tombl_blaus"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int collections_ice_cream_part_six_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yeah? - - //-- [RESPONSE NOTE] - //-- PLAYER: Hi. Are you Tombl Blaus? - if (response == "s_9") - { - //-- [NOTE] - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - //-- NPC: I might be. Who is asking? - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I just wanted to ask you about this fryer. - boolean hasResponse0 = false; - if (collections_ice_cream_part_six_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_12"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_six.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_six_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I might be. Who is asking? - - //-- [RESPONSE NOTE] - //-- PLAYER: I just wanted to ask you about this fryer. - if (response == "s_12") - { - //-- [NOTE] - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - //-- NPC: Let me see that contraption. Yeah...I used to put these together in a factory. That was a long time ago. How did you get this? - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I found it. Can you help me reverse engineer it? - boolean hasResponse0 = false; - if (collections_ice_cream_part_six_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_16"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_six.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_six_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Let me see that contraption. Yeah...I used to put these together in a factory. That was a long time ago. How did you get this? - - //-- [RESPONSE NOTE] - //-- PLAYER: I found it. Can you help me reverse engineer it? - if (response == "s_16") - { - //-- [NOTE] - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - //-- NPC: Well. Not really. The only thing I ever worked on was the ventilation system. - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What did the ventilation system do exactly? - boolean hasResponse0 = false; - if (collections_ice_cream_part_six_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_19"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_six.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_six_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Well. Not really. The only thing I ever worked on was the ventilation system. - - //-- [RESPONSE NOTE] - //-- PLAYER: What did the ventilation system do exactly? - if (response == "s_19") - { - //-- [NOTE] - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - //-- NPC: It blew cool air over the heating element and kept the fryer enclosure itself from becoming too hot. That is basically all I know. Here. It's this unit right here. - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Anyone else at the factory with you that might know more? - boolean hasResponse0 = false; - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_24"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_six.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_six_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: It blew cool air over the heating element and kept the fryer enclosure itself from becoming too hot. That is basically all I know. Here. It's this unit right here. - - //-- [RESPONSE NOTE] - //-- PLAYER: Anyone else at the factory with you that might know more? - if (response == "s_24") - { - //-- [NOTE] - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_six_action_signalNextTask (player, npc); - - //-- NPC: As a matter of fact yes. I worked with Lepwalk C'han in the factory. I think he might know about the Oil Filtration System. Here is his current location. Tell him I said 'Hello.' - string_id message = new string_id (c_stringFile, "s_25"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.collections_ice_cream_part_six"); - - 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.collections_ice_cream_part_six"); - - 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 (collections_ice_cream_part_six_condition_hasActiveTask (player, npc)) - { - //-- NPC: Yeah? - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Hi. Are you Tombl Blaus? - boolean hasResponse0 = false; - if (collections_ice_cream_part_six_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_9"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_six.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_six", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - //-- NPC: This is a dangerous area. You should head back because if you get lost, no one will find you. - string_id message = new string_id (c_stringFile, "s_26"); - 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 != "collections_ice_cream_part_six") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); - - if (branchId == 1 && collections_ice_cream_part_six_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && collections_ice_cream_part_six_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && collections_ice_cream_part_six_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && collections_ice_cream_part_six_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && collections_ice_cream_part_six_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// collections_ice_cream_part_six.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/collections_ice_cream_part_six"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean collections_ice_cream_part_six_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean collections_ice_cream_part_six_condition_hasActiveTask (obj_id player, obj_id npc) +{ + if(groundquests.isQuestActive(player, "chapter9_ice_cream")) + { + return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_tombl_blaus"); + } + return false; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void collections_ice_cream_part_six_action_signalNextTask (obj_id player, obj_id npc) +{ + modifyCollectionSlotValue(player, "col_fried_icecream_part_06", 1); + groundquests.sendSignal(player, "meet_tombl_blaus"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int collections_ice_cream_part_six_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yeah? + + //-- [RESPONSE NOTE] + //-- PLAYER: Hi. Are you Tombl Blaus? + if (response == "s_9") + { + //-- [NOTE] + if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) + { + //-- NPC: I might be. Who is asking? + string_id message = new string_id (c_stringFile, "s_10"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I just wanted to ask you about this fryer. + boolean hasResponse0 = false; + if (collections_ice_cream_part_six_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_12"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_six.branchId", 2); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_six_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I might be. Who is asking? + + //-- [RESPONSE NOTE] + //-- PLAYER: I just wanted to ask you about this fryer. + if (response == "s_12") + { + //-- [NOTE] + if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) + { + //-- NPC: Let me see that contraption. Yeah...I used to put these together in a factory. That was a long time ago. How did you get this? + string_id message = new string_id (c_stringFile, "s_14"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I found it. Can you help me reverse engineer it? + boolean hasResponse0 = false; + if (collections_ice_cream_part_six_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_16"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_six.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_six_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Let me see that contraption. Yeah...I used to put these together in a factory. That was a long time ago. How did you get this? + + //-- [RESPONSE NOTE] + //-- PLAYER: I found it. Can you help me reverse engineer it? + if (response == "s_16") + { + //-- [NOTE] + if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) + { + //-- NPC: Well. Not really. The only thing I ever worked on was the ventilation system. + string_id message = new string_id (c_stringFile, "s_18"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What did the ventilation system do exactly? + boolean hasResponse0 = false; + if (collections_ice_cream_part_six_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_19"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_six.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_six_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Well. Not really. The only thing I ever worked on was the ventilation system. + + //-- [RESPONSE NOTE] + //-- PLAYER: What did the ventilation system do exactly? + if (response == "s_19") + { + //-- [NOTE] + if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) + { + //-- NPC: It blew cool air over the heating element and kept the fryer enclosure itself from becoming too hot. That is basically all I know. Here. It's this unit right here. + string_id message = new string_id (c_stringFile, "s_20"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Anyone else at the factory with you that might know more? + boolean hasResponse0 = false; + if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_24"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_six.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_six_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: It blew cool air over the heating element and kept the fryer enclosure itself from becoming too hot. That is basically all I know. Here. It's this unit right here. + + //-- [RESPONSE NOTE] + //-- PLAYER: Anyone else at the factory with you that might know more? + if (response == "s_24") + { + //-- [NOTE] + if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) + { + collections_ice_cream_part_six_action_signalNextTask (player, npc); + + //-- NPC: As a matter of fact yes. I worked with Lepwalk C'han in the factory. I think he might know about the Oil Filtration System. Here is his current location. Tell him I said 'Hello.' + string_id message = new string_id (c_stringFile, "s_25"); + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.collections_ice_cream_part_six"); + + 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.collections_ice_cream_part_six"); + + 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 (collections_ice_cream_part_six_condition_hasActiveTask (player, npc)) + { + //-- NPC: Yeah? + string_id message = new string_id (c_stringFile, "s_4"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Hi. Are you Tombl Blaus? + boolean hasResponse0 = false; + if (collections_ice_cream_part_six_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_9"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_six.branchId", 1); + + npcStartConversation (player, npc, "collections_ice_cream_part_six", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) + { + //-- NPC: This is a dangerous area. You should head back because if you get lost, no one will find you. + string_id message = new string_id (c_stringFile, "s_26"); + 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 != "collections_ice_cream_part_six") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); + + if (branchId == 1 && collections_ice_cream_part_six_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && collections_ice_cream_part_six_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && collections_ice_cream_part_six_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && collections_ice_cream_part_six_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && collections_ice_cream_part_six_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_ten.script b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_ten.script index 3b435540b..94c1db244 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_ten.script +++ b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_ten.script @@ -1,538 +1,538 @@ -// ====================================================================== -// -// collections_ice_cream_part_ten.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/collections_ice_cream_part_ten"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean collections_ice_cream_part_ten_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean collections_ice_cream_part_ten_condition_hasActiveTask (obj_id player, obj_id npc) -{ - if(groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_ice_cream_man"); - } - return false; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void collections_ice_cream_part_ten_action_signalNextTask (obj_id player, obj_id npc) -{ - modifyCollectionSlotValue(player, "col_fried_icecream_part_10", 1); - groundquests.sendSignal(player, "meet_ice_cream_man"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int collections_ice_cream_part_ten_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I love Ice Cream. Don't you? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes. Hi. Can I ask you a question? - if (response == "s_9") - { - //-- [NOTE] - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - //-- NPC: Is it about ice cream? - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Well no. It is about a fryer. - boolean hasResponse0 = false; - if (collections_ice_cream_part_ten_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_12"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_ten_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Is it about ice cream? - - //-- [RESPONSE NOTE] - //-- PLAYER: Well no. It is about a fryer. - if (response == "s_12") - { - //-- [NOTE] - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - //-- NPC: Well if it isn't about ice cream...wait. Did you say fryer? - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes. Here, see? - boolean hasResponse0 = false; - if (collections_ice_cream_part_ten_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_16"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_ten_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Well if it isn't about ice cream...wait. Did you say fryer? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes. Here, see? - if (response == "s_16") - { - //-- [NOTE] - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - //-- NPC: Oh! It's the X34 model version 3! I have been looking all over for that model. How much do you want for the fryer? - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Uh. I need the schematic actually. Would you like to trade? - boolean hasResponse0 = false; - if (collections_ice_cream_part_ten_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_19"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_ten_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Oh! It's the X34 model version 3! I have been looking all over for that model. How much do you want for the fryer? - - //-- [RESPONSE NOTE] - //-- PLAYER: Uh. I need the schematic actually. Would you like to trade? - if (response == "s_19") - { - //-- [NOTE] - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - //-- NPC: The fryer schematic? It is worthless to me and I have copies. I would be glad to trade. - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: By the way, what do you need the broken fryer for? - boolean hasResponse0 = false; - if (collections_ice_cream_part_ten_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_35"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_ten_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: The fryer schematic? It is worthless to me and I have copies. I would be glad to trade. - - //-- [RESPONSE NOTE] - //-- PLAYER: By the way, what do you need the broken fryer for? - if (response == "s_35") - { - //-- [NOTE] - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - //-- NPC: For spare parts. I have several Corellian Fried Ice Cream Fryers that need extra parts. - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: So this is a Fried Ice Cream Fryer? - boolean hasResponse0 = false; - if (collections_ice_cream_part_ten_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_37"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_ten_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: For spare parts. I have several Corellian Fried Ice Cream Fryers that need extra parts. - - //-- [RESPONSE NOTE] - //-- PLAYER: So this is a Fried Ice Cream Fryer? - if (response == "s_37") - { - //-- [NOTE] - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_ten_action_signalNextTask (player, npc); - - //-- NPC: You didn't even know what you had? Hah! Here take your silly schematic. - string_id message = new string_id (c_stringFile, "s_38"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.collections_ice_cream_part_ten"); - - 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.collections_ice_cream_part_ten"); - - 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 (collections_ice_cream_part_ten_condition_hasActiveTask (player, npc)) - { - //-- NPC: I love Ice Cream. Don't you? - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes. Hi. Can I ask you a question? - boolean hasResponse0 = false; - if (collections_ice_cream_part_ten_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_9"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_ten", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - //-- NPC: Ice cream here...sold by the scoop. - string_id message = new string_id (c_stringFile, "s_30"); - 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 != "collections_ice_cream_part_ten") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - if (branchId == 1 && collections_ice_cream_part_ten_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && collections_ice_cream_part_ten_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && collections_ice_cream_part_ten_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && collections_ice_cream_part_ten_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && collections_ice_cream_part_ten_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && collections_ice_cream_part_ten_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// collections_ice_cream_part_ten.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/collections_ice_cream_part_ten"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean collections_ice_cream_part_ten_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean collections_ice_cream_part_ten_condition_hasActiveTask (obj_id player, obj_id npc) +{ + if(groundquests.isQuestActive(player, "chapter9_ice_cream")) + { + return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_ice_cream_man"); + } + return false; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void collections_ice_cream_part_ten_action_signalNextTask (obj_id player, obj_id npc) +{ + modifyCollectionSlotValue(player, "col_fried_icecream_part_10", 1); + groundquests.sendSignal(player, "meet_ice_cream_man"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int collections_ice_cream_part_ten_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I love Ice Cream. Don't you? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes. Hi. Can I ask you a question? + if (response == "s_9") + { + //-- [NOTE] + if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) + { + //-- NPC: Is it about ice cream? + string_id message = new string_id (c_stringFile, "s_10"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Well no. It is about a fryer. + boolean hasResponse0 = false; + if (collections_ice_cream_part_ten_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_12"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 2); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_ten_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Is it about ice cream? + + //-- [RESPONSE NOTE] + //-- PLAYER: Well no. It is about a fryer. + if (response == "s_12") + { + //-- [NOTE] + if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) + { + //-- NPC: Well if it isn't about ice cream...wait. Did you say fryer? + string_id message = new string_id (c_stringFile, "s_14"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes. Here, see? + boolean hasResponse0 = false; + if (collections_ice_cream_part_ten_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_16"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_ten_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Well if it isn't about ice cream...wait. Did you say fryer? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes. Here, see? + if (response == "s_16") + { + //-- [NOTE] + if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) + { + //-- NPC: Oh! It's the X34 model version 3! I have been looking all over for that model. How much do you want for the fryer? + string_id message = new string_id (c_stringFile, "s_18"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Uh. I need the schematic actually. Would you like to trade? + boolean hasResponse0 = false; + if (collections_ice_cream_part_ten_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_19"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_ten_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Oh! It's the X34 model version 3! I have been looking all over for that model. How much do you want for the fryer? + + //-- [RESPONSE NOTE] + //-- PLAYER: Uh. I need the schematic actually. Would you like to trade? + if (response == "s_19") + { + //-- [NOTE] + if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) + { + //-- NPC: The fryer schematic? It is worthless to me and I have copies. I would be glad to trade. + string_id message = new string_id (c_stringFile, "s_20"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: By the way, what do you need the broken fryer for? + boolean hasResponse0 = false; + if (collections_ice_cream_part_ten_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_35"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_ten_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: The fryer schematic? It is worthless to me and I have copies. I would be glad to trade. + + //-- [RESPONSE NOTE] + //-- PLAYER: By the way, what do you need the broken fryer for? + if (response == "s_35") + { + //-- [NOTE] + if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) + { + //-- NPC: For spare parts. I have several Corellian Fried Ice Cream Fryers that need extra parts. + string_id message = new string_id (c_stringFile, "s_36"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: So this is a Fried Ice Cream Fryer? + boolean hasResponse0 = false; + if (collections_ice_cream_part_ten_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_37"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_ten_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: For spare parts. I have several Corellian Fried Ice Cream Fryers that need extra parts. + + //-- [RESPONSE NOTE] + //-- PLAYER: So this is a Fried Ice Cream Fryer? + if (response == "s_37") + { + //-- [NOTE] + if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) + { + collections_ice_cream_part_ten_action_signalNextTask (player, npc); + + //-- NPC: You didn't even know what you had? Hah! Here take your silly schematic. + string_id message = new string_id (c_stringFile, "s_38"); + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.collections_ice_cream_part_ten"); + + 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.collections_ice_cream_part_ten"); + + 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 (collections_ice_cream_part_ten_condition_hasActiveTask (player, npc)) + { + //-- NPC: I love Ice Cream. Don't you? + string_id message = new string_id (c_stringFile, "s_4"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes. Hi. Can I ask you a question? + boolean hasResponse0 = false; + if (collections_ice_cream_part_ten_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_9"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 1); + + npcStartConversation (player, npc, "collections_ice_cream_part_ten", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) + { + //-- NPC: Ice cream here...sold by the scoop. + string_id message = new string_id (c_stringFile, "s_30"); + 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 != "collections_ice_cream_part_ten") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); + + if (branchId == 1 && collections_ice_cream_part_ten_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && collections_ice_cream_part_ten_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && collections_ice_cream_part_ten_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && collections_ice_cream_part_ten_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && collections_ice_cream_part_ten_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && collections_ice_cream_part_ten_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_three.script b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_three.script index 38a91a212..b212df641 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_three.script +++ b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_three.script @@ -1,420 +1,420 @@ -// ====================================================================== -// -// collections_ice_cream_part_three.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/collections_ice_cream_part_three"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean collections_ice_cream_part_three_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean collections_ice_cream_part_three_condition_hasActiveTask (obj_id player, obj_id npc) -{ - if(groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_mikfa_faaus"); - } - return false; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void collections_ice_cream_part_three_action_signalNextTask (obj_id player, obj_id npc) -{ - modifyCollectionSlotValue(player, "col_fried_icecream_part_03", 1); - groundquests.sendSignal(player, "meet_mikfa_faaus"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int collections_ice_cream_part_three_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yeasss? - - //-- [RESPONSE NOTE] - //-- PLAYER: I was sent to you by Amyva. It is about reverse engineering this fryer? - if (response == "s_9") - { - //-- [NOTE] - if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_no"); - - //-- NPC: Dat ting? Mesa knowa a lotta little 'bout fryers. Mesa use to fix kitchen refrigerator units. No fryers. - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Perhaps you can still help me try to reverse engineer... - boolean hasResponse0 = false; - if (collections_ice_cream_part_three_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_12"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_three.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_three_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Dat ting? Mesa knowa a lotta little 'bout fryers. Mesa use to fix kitchen refrigerator units. No fryers. - - //-- [RESPONSE NOTE] - //-- PLAYER: Perhaps you can still help me try to reverse engineer... - if (response == "s_12") - { - //-- [NOTE] - if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) - { - //-- NPC: You'sa finds mea refrigerator unit and mesa help yous. Mesa don't haves anyting going on anyways but mesa not gonna try to gives pointers on fryer. - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Oh. Perhaps you know of someone else that can help me? - boolean hasResponse0 = false; - if (collections_ice_cream_part_three_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_16"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_three.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_three_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You'sa finds mea refrigerator unit and mesa help yous. Mesa don't haves anyting going on anyways but mesa not gonna try to gives pointers on fryer. - - //-- [RESPONSE NOTE] - //-- PLAYER: Oh. Perhaps you know of someone else that can help me? - if (response == "s_16") - { - //-- [NOTE] - if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) - { - //-- NPC: Mesa do. Names Eteto Topan. Mesa give yous his hangs out in yous data ting. - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Oh...thanks. Gosh seems like a long way to travel just to find someone else that is a world away. - boolean hasResponse0 = false; - if (collections_ice_cream_part_three_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_19"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_three.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_three_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Mesa do. Names Eteto Topan. Mesa give yous his hangs out in yous data ting. - - //-- [RESPONSE NOTE] - //-- PLAYER: Oh...thanks. Gosh seems like a long way to travel just to find someone else that is a world away. - if (response == "s_19") - { - //-- [NOTE] - if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_three_action_signalNextTask (player, npc); - - //-- NPC: Mmmmm? Nexta times yous bring me a refrigerator. Oh and byes duh ways its looky like your fryer ting is missing mittens. Dose cookers wears mittens when day using fryer. To protects Demself... - string_id message = new string_id (c_stringFile, "s_20"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.collections_ice_cream_part_three"); - - 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.collections_ice_cream_part_three"); - - 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 (collections_ice_cream_part_three_condition_hasActiveTask (player, npc)) - { - //-- NPC: Yeasss? - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I was sent to you by Amyva. It is about reverse engineering this fryer? - boolean hasResponse0 = false; - if (collections_ice_cream_part_three_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_9"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_three.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_three", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) - { - //-- NPC: I don't know you and wish you no ill will. Now please excuse me. - string_id message = new string_id (c_stringFile, "s_22"); - 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 != "collections_ice_cream_part_three") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); - - if (branchId == 1 && collections_ice_cream_part_three_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && collections_ice_cream_part_three_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && collections_ice_cream_part_three_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && collections_ice_cream_part_three_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// collections_ice_cream_part_three.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/collections_ice_cream_part_three"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean collections_ice_cream_part_three_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean collections_ice_cream_part_three_condition_hasActiveTask (obj_id player, obj_id npc) +{ + if(groundquests.isQuestActive(player, "chapter9_ice_cream")) + { + return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_mikfa_faaus"); + } + return false; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void collections_ice_cream_part_three_action_signalNextTask (obj_id player, obj_id npc) +{ + modifyCollectionSlotValue(player, "col_fried_icecream_part_03", 1); + groundquests.sendSignal(player, "meet_mikfa_faaus"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int collections_ice_cream_part_three_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yeasss? + + //-- [RESPONSE NOTE] + //-- PLAYER: I was sent to you by Amyva. It is about reverse engineering this fryer? + if (response == "s_9") + { + //-- [NOTE] + if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "shake_head_no"); + + //-- NPC: Dat ting? Mesa knowa a lotta little 'bout fryers. Mesa use to fix kitchen refrigerator units. No fryers. + string_id message = new string_id (c_stringFile, "s_10"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Perhaps you can still help me try to reverse engineer... + boolean hasResponse0 = false; + if (collections_ice_cream_part_three_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_12"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_three.branchId", 2); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_three_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Dat ting? Mesa knowa a lotta little 'bout fryers. Mesa use to fix kitchen refrigerator units. No fryers. + + //-- [RESPONSE NOTE] + //-- PLAYER: Perhaps you can still help me try to reverse engineer... + if (response == "s_12") + { + //-- [NOTE] + if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) + { + //-- NPC: You'sa finds mea refrigerator unit and mesa help yous. Mesa don't haves anyting going on anyways but mesa not gonna try to gives pointers on fryer. + string_id message = new string_id (c_stringFile, "s_14"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Oh. Perhaps you know of someone else that can help me? + boolean hasResponse0 = false; + if (collections_ice_cream_part_three_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_16"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_three.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_three_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You'sa finds mea refrigerator unit and mesa help yous. Mesa don't haves anyting going on anyways but mesa not gonna try to gives pointers on fryer. + + //-- [RESPONSE NOTE] + //-- PLAYER: Oh. Perhaps you know of someone else that can help me? + if (response == "s_16") + { + //-- [NOTE] + if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) + { + //-- NPC: Mesa do. Names Eteto Topan. Mesa give yous his hangs out in yous data ting. + string_id message = new string_id (c_stringFile, "s_18"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Oh...thanks. Gosh seems like a long way to travel just to find someone else that is a world away. + boolean hasResponse0 = false; + if (collections_ice_cream_part_three_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_19"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_three.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_three_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Mesa do. Names Eteto Topan. Mesa give yous his hangs out in yous data ting. + + //-- [RESPONSE NOTE] + //-- PLAYER: Oh...thanks. Gosh seems like a long way to travel just to find someone else that is a world away. + if (response == "s_19") + { + //-- [NOTE] + if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) + { + collections_ice_cream_part_three_action_signalNextTask (player, npc); + + //-- NPC: Mmmmm? Nexta times yous bring me a refrigerator. Oh and byes duh ways its looky like your fryer ting is missing mittens. Dose cookers wears mittens when day using fryer. To protects Demself... + string_id message = new string_id (c_stringFile, "s_20"); + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.collections_ice_cream_part_three"); + + 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.collections_ice_cream_part_three"); + + 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 (collections_ice_cream_part_three_condition_hasActiveTask (player, npc)) + { + //-- NPC: Yeasss? + string_id message = new string_id (c_stringFile, "s_4"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I was sent to you by Amyva. It is about reverse engineering this fryer? + boolean hasResponse0 = false; + if (collections_ice_cream_part_three_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_9"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_three.branchId", 1); + + npcStartConversation (player, npc, "collections_ice_cream_part_three", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) + { + //-- NPC: I don't know you and wish you no ill will. Now please excuse me. + string_id message = new string_id (c_stringFile, "s_22"); + 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 != "collections_ice_cream_part_three") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); + + if (branchId == 1 && collections_ice_cream_part_three_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && collections_ice_cream_part_three_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && collections_ice_cream_part_three_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && collections_ice_cream_part_three_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_two.script b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_two.script index cb88a6633..27f83a04b 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_two.script +++ b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_two.script @@ -1,478 +1,478 @@ -// ====================================================================== -// -// collections_ice_cream_part_two.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/collections_ice_cream_part_two"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean collections_ice_cream_part_two_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean collections_ice_cream_part_two_condition_hasActiveTask (obj_id player, obj_id npc) -{ - if(groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_amyva_vanew"); - } - return false; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void collections_ice_cream_part_two_action_signalNextTask (obj_id player, obj_id npc) -{ - modifyCollectionSlotValue(player, "col_fried_icecream_part_02", 1); - groundquests.sendSignal(player, "meet_amyva_vanew"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int collections_ice_cream_part_two_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I'm sorry but I am busy right now. Place your order with the order droid. - - //-- [RESPONSE NOTE] - //-- PLAYER: Oh. Are you off soon? I was sent here by Hunde Decan...it is regarding this fryer. - if (response == "s_9") - { - //-- [NOTE] - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - //-- NPC: Hah...that must be an antique. Try selling it to the local junk dealer. I bet you'll get a decent price. - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Actually, I was hoping to fix it. - boolean hasResponse0 = false; - if (collections_ice_cream_part_two_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_12"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_two.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_two_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Hah...that must be an antique. Try selling it to the local junk dealer. I bet you'll get a decent price. - - //-- [RESPONSE NOTE] - //-- PLAYER: Actually, I was hoping to fix it. - if (response == "s_12") - { - //-- [NOTE] - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - //-- NPC: I doubt that would be the best way to approach getting a working fryer. Take my advice and reverse engineer it and have a new one crafted. - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Any idea how I might do that? - boolean hasResponse0 = false; - if (collections_ice_cream_part_two_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_16"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_two.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_two_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I doubt that would be the best way to approach getting a working fryer. Take my advice and reverse engineer it and have a new one crafted. - - //-- [RESPONSE NOTE] - //-- PLAYER: Any idea how I might do that? - if (response == "s_16") - { - //-- [NOTE] - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - //-- NPC: Sure. I see you have much of the broken fryer intact. All you have to do is get a bit of detailed information for all the pieces and store it in your datapad. Once you have enough data you can create a schematic and give it to a trader to craft. - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Hmmmm. Which piece should I start with? - boolean hasResponse0 = false; - if (collections_ice_cream_part_two_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_19"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_two.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_two_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Sure. I see you have much of the broken fryer intact. All you have to do is get a bit of detailed information for all the pieces and store it in your datapad. Once you have enough data you can create a schematic and give it to a trader to craft. - - //-- [RESPONSE NOTE] - //-- PLAYER: Hmmmm. Which piece should I start with? - if (response == "s_19") - { - //-- [NOTE] - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - //-- NPC: See those tongs in there? Those are the fryer tongs and are used to lift food out of the fryer. You are basically looking at a piece of bent metal with a handle. Pretty simple. - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Oh. I see. But what about the other pieces? - boolean hasResponse0 = false; - if (collections_ice_cream_part_two_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_22"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_two.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int collections_ice_cream_part_two_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: See those tongs in there? Those are the fryer tongs and are used to lift food out of the fryer. You are basically looking at a piece of bent metal with a handle. Pretty simple. - - //-- [RESPONSE NOTE] - //-- PLAYER: Oh. I see. But what about the other pieces? - if (response == "s_22") - { - //-- [NOTE] - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_two_action_signalNextTask (player, npc); - - //-- NPC: You might want to speak with Mikfa Faaus for other parts. I will give you his current location. I am much too busy to help you any further. - string_id message = new string_id (c_stringFile, "s_24"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.collections_ice_cream_part_two"); - - 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.collections_ice_cream_part_two"); - - 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 (collections_ice_cream_part_two_condition_hasActiveTask (player, npc)) - { - //-- NPC: I'm sorry but I am busy right now. Place your order with the order droid. - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Oh. Are you off soon? I was sent here by Hunde Decan...it is regarding this fryer. - boolean hasResponse0 = false; - if (collections_ice_cream_part_two_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_9"); - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_two.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_two", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - //-- NPC: I'm sorry but I am busy right now. If you can place your order with the order droid I will get to you as soon as possible. - string_id message = new string_id (c_stringFile, "s_26"); - 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 != "collections_ice_cream_part_two") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); - - if (branchId == 1 && collections_ice_cream_part_two_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && collections_ice_cream_part_two_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && collections_ice_cream_part_two_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && collections_ice_cream_part_two_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && collections_ice_cream_part_two_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// collections_ice_cream_part_two.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/collections_ice_cream_part_two"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean collections_ice_cream_part_two_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean collections_ice_cream_part_two_condition_hasActiveTask (obj_id player, obj_id npc) +{ + if(groundquests.isQuestActive(player, "chapter9_ice_cream")) + { + return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_amyva_vanew"); + } + return false; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void collections_ice_cream_part_two_action_signalNextTask (obj_id player, obj_id npc) +{ + modifyCollectionSlotValue(player, "col_fried_icecream_part_02", 1); + groundquests.sendSignal(player, "meet_amyva_vanew"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int collections_ice_cream_part_two_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I'm sorry but I am busy right now. Place your order with the order droid. + + //-- [RESPONSE NOTE] + //-- PLAYER: Oh. Are you off soon? I was sent here by Hunde Decan...it is regarding this fryer. + if (response == "s_9") + { + //-- [NOTE] + if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) + { + //-- NPC: Hah...that must be an antique. Try selling it to the local junk dealer. I bet you'll get a decent price. + string_id message = new string_id (c_stringFile, "s_10"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Actually, I was hoping to fix it. + boolean hasResponse0 = false; + if (collections_ice_cream_part_two_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_12"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_two.branchId", 2); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_two_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Hah...that must be an antique. Try selling it to the local junk dealer. I bet you'll get a decent price. + + //-- [RESPONSE NOTE] + //-- PLAYER: Actually, I was hoping to fix it. + if (response == "s_12") + { + //-- [NOTE] + if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) + { + //-- NPC: I doubt that would be the best way to approach getting a working fryer. Take my advice and reverse engineer it and have a new one crafted. + string_id message = new string_id (c_stringFile, "s_14"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Any idea how I might do that? + boolean hasResponse0 = false; + if (collections_ice_cream_part_two_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_16"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_two.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_two_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I doubt that would be the best way to approach getting a working fryer. Take my advice and reverse engineer it and have a new one crafted. + + //-- [RESPONSE NOTE] + //-- PLAYER: Any idea how I might do that? + if (response == "s_16") + { + //-- [NOTE] + if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) + { + //-- NPC: Sure. I see you have much of the broken fryer intact. All you have to do is get a bit of detailed information for all the pieces and store it in your datapad. Once you have enough data you can create a schematic and give it to a trader to craft. + string_id message = new string_id (c_stringFile, "s_18"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Hmmmm. Which piece should I start with? + boolean hasResponse0 = false; + if (collections_ice_cream_part_two_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_19"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_two.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_two_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Sure. I see you have much of the broken fryer intact. All you have to do is get a bit of detailed information for all the pieces and store it in your datapad. Once you have enough data you can create a schematic and give it to a trader to craft. + + //-- [RESPONSE NOTE] + //-- PLAYER: Hmmmm. Which piece should I start with? + if (response == "s_19") + { + //-- [NOTE] + if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) + { + //-- NPC: See those tongs in there? Those are the fryer tongs and are used to lift food out of the fryer. You are basically looking at a piece of bent metal with a handle. Pretty simple. + string_id message = new string_id (c_stringFile, "s_20"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Oh. I see. But what about the other pieces? + boolean hasResponse0 = false; + if (collections_ice_cream_part_two_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_22"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_two.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int collections_ice_cream_part_two_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: See those tongs in there? Those are the fryer tongs and are used to lift food out of the fryer. You are basically looking at a piece of bent metal with a handle. Pretty simple. + + //-- [RESPONSE NOTE] + //-- PLAYER: Oh. I see. But what about the other pieces? + if (response == "s_22") + { + //-- [NOTE] + if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) + { + collections_ice_cream_part_two_action_signalNextTask (player, npc); + + //-- NPC: You might want to speak with Mikfa Faaus for other parts. I will give you his current location. I am much too busy to help you any further. + string_id message = new string_id (c_stringFile, "s_24"); + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.collections_ice_cream_part_two"); + + 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.collections_ice_cream_part_two"); + + 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 (collections_ice_cream_part_two_condition_hasActiveTask (player, npc)) + { + //-- NPC: I'm sorry but I am busy right now. Place your order with the order droid. + string_id message = new string_id (c_stringFile, "s_4"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Oh. Are you off soon? I was sent here by Hunde Decan...it is regarding this fryer. + boolean hasResponse0 = false; + if (collections_ice_cream_part_two_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_9"); + + utils.setScriptVar (player, "conversation.collections_ice_cream_part_two.branchId", 1); + + npcStartConversation (player, npc, "collections_ice_cream_part_two", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) + { + //-- NPC: I'm sorry but I am busy right now. If you can place your order with the order droid I will get to you as soon as possible. + string_id message = new string_id (c_stringFile, "s_26"); + 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 != "collections_ice_cream_part_two") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); + + if (branchId == 1 && collections_ice_cream_part_two_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && collections_ice_cream_part_two_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && collections_ice_cream_part_two_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && collections_ice_cream_part_two_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && collections_ice_cream_part_two_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/delivery_chardle.script b/sku.0/sys.server/compiled/game/script/conversation/delivery_chardle.script index 086fb7479..ae1fb773c 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/delivery_chardle.script +++ b/sku.0/sys.server/compiled/game/script/conversation/delivery_chardle.script @@ -1,660 +1,660 @@ -// ====================================================================== -// -// delivery_chardle.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/delivery_chardle"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean delivery_chardle_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean delivery_chardle_condition_noAntivirus (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return (!groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") - && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") - && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")); -} - -// ---------------------------------------------------------------------- - -boolean delivery_chardle_condition_hasNotFoundBeta (obj_id player, obj_id npc) -{ - return !hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_epsilon"); -} - -// ---------------------------------------------------------------------- - -boolean delivery_chardle_condition_neverDelivered (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return (!groundquests.isQuestActiveOrComplete(player, "camp_delta_delivery_01")); -} - -// ---------------------------------------------------------------------- - -boolean delivery_chardle_condition_hasMeetingTask (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "camp_delta_delivery_01", "getBeastDelta"); -} - -// ---------------------------------------------------------------------- - -boolean delivery_chardle_condition_hasEscortTask (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "camp_delta_delivery_01", "escortTaskDelta"); -} - -// ---------------------------------------------------------------------- - -boolean delivery_chardle_condition_hasDeliveredBefore (obj_id player, obj_id npc) -{ - return groundquests.hasCompletedQuest(player, "camp_delta_delivery_01"); -} - -// ---------------------------------------------------------------------- - -boolean delivery_chardle_condition_tooLowLevel (obj_id player, obj_id npc) -{ - return getLevel(player) < 60; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void delivery_chardle_action_giveQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(groundquests.hasCompletedQuest(player, "camp_delta_delivery_01")) - { - delivery_chardle_action_clearDeliveryQuest(player, npc); - } - groundquests.grantQuest(player, "camp_delta_delivery_01"); -} - -// ---------------------------------------------------------------------- - -void delivery_chardle_action_clearDeliveryQuest (obj_id player, obj_id npc) -{ - groundquests.clearQuest(player, "camp_delta_delivery_01"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int delivery_chardle_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I need someone good with combat and you look like you want some extra credits! - - //-- [RESPONSE NOTE] - //-- PLAYER: Depends on what you need. - if (response == "s_96") - { - //-- [NOTE] - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: I need someone to escort my delivery volunteer to camp beta. I already know you have been there, word gets around. The volunteer knows the way as well so between the two of you no one should get lost. - string_id message = new string_id (c_stringFile, "s_97"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What are we delivering? - boolean hasResponse0 = false; - if (delivery_chardle_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_14"); - - utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int delivery_chardle_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I need someone to escort my delivery volunteer to camp beta. I already know you have been there, word gets around. The volunteer knows the way as well so between the two of you no one should get lost. - - //-- [RESPONSE NOTE] - //-- PLAYER: What are we delivering? - if (response == "s_14") - { - //-- [NOTE] - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - //-- NPC: Medical supplies, food, water, ammunition. What do you think we are delivering? Imperial recruitment posters? Are you interested in helping out? - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sure. I'll help. - boolean hasResponse0 = false; - if (delivery_chardle_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_20"); - - utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int delivery_chardle_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Medical supplies, food, water, ammunition. What do you think we are delivering? Imperial recruitment posters? Are you interested in helping out? - - //-- [RESPONSE NOTE] - //-- PLAYER: Sure. I'll help. - if (response == "s_20") - { - //-- [NOTE] - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - //-- NPC: Oh I almost forgot. You should know that the delivery volunteer is armed with more than weapons. If the volunteer thinks he is about to succomb to the undead he will hit a panic switch and detonate explosives he is carrying. - string_id message = new string_id (c_stringFile, "s_22"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Uh....why? - boolean hasResponse0 = false; - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_24"); - - utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int delivery_chardle_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Oh I almost forgot. You should know that the delivery volunteer is armed with more than weapons. If the volunteer thinks he is about to succomb to the undead he will hit a panic switch and detonate explosives he is carrying. - - //-- [RESPONSE NOTE] - //-- PLAYER: Uh....why? - if (response == "s_24") - { - //-- [NOTE] - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - //-- NPC: Why? Because no one wants to come back as one of those things. - string_id message = new string_id (c_stringFile, "s_26"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Okay...I guess. - boolean hasResponse0 = false; - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_28"); - - utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int delivery_chardle_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Why? Because no one wants to come back as one of those things. - - //-- [RESPONSE NOTE] - //-- PLAYER: Okay...I guess. - if (response == "s_28") - { - //-- [NOTE] - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - delivery_chardle_action_giveQuest (player, npc); - - //-- NPC: Go to the waypoint in your datapad. I'll send the delivery volunteer as soon as you are there. - string_id message = new string_id (c_stringFile, "s_30"); - utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int delivery_chardle_handleBranch12 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You want to help out with another delivery? Same credit amount if you are interested. - - //-- [RESPONSE NOTE] - //-- PLAYER: Sure. - if (response == "s_34") - { - //-- [NOTE] - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - delivery_chardle_action_giveQuest (player, npc); - - //-- NPC: Go to the waypoint in your datapad. I'll send the delivery volunteer as soon as you are there. - string_id message = new string_id (c_stringFile, "s_36"); - utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.delivery_chardle"); - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - return SCRIPT_CONTINUE; -} - -trigger OnAttach () -{ - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - 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.delivery_chardle"); - - 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 (delivery_chardle_condition_noAntivirus (player, npc)) - { - //-- NPC: You don't have the anti-virus yet?? Get away from me...go see Doctor Cody. She can help you out. - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_chardle_condition_tooLowLevel (player, npc)) - { - //-- NPC: I'd ask you to help out but you are a little green behind the ears for anything I have. - string_id message = new string_id (c_stringFile, "s_37"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_chardle_condition_hasNotFoundBeta (player, npc)) - { - //-- NPC: I hear there is another camp not far from here. If you find it, come back. I have a job you might want. - string_id message = new string_id (c_stringFile, "s_10"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_chardle_condition_hasEscortTask (player, npc)) - { - delivery_chardle_action_clearDeliveryQuest (player, npc); - - //-- NPC: I don't know what happened but you managed to lose the delivery volunteer. Come back when you want to try again. - string_id message = new string_id (c_stringFile, "s_16"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_chardle_condition_hasMeetingTask (player, npc)) - { - //-- NPC: You need to complete the delivery. Go to the waypoint I provided. - string_id message = new string_id (c_stringFile, "s_15"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_chardle_condition_neverDelivered (player, npc)) - { - doAnimationAction (npc, "thumb_up"); - - //-- NPC: I need someone good with combat and you look like you want some extra credits! - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Depends on what you need. - boolean hasResponse0 = false; - if (delivery_chardle_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_96"); - - utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 6); - - npcStartConversation (player, npc, "delivery_chardle", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_chardle_condition_hasDeliveredBefore (player, npc)) - { - //-- NPC: You want to help out with another delivery? Same credit amount if you are interested. - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sure. - boolean hasResponse0 = false; - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_34"); - - utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 12); - - npcStartConversation (player, npc, "delivery_chardle", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - //-- NPC: If you are hungry let me know. We have plenty of rations. If you want them hot, you can always leave them out in the sun a while. - string_id message = new string_id (c_stringFile, "s_60"); - 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 != "delivery_chardle") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.delivery_chardle.branchId"); - - if (branchId == 6 && delivery_chardle_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && delivery_chardle_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && delivery_chardle_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && delivery_chardle_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && delivery_chardle_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 12 && delivery_chardle_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// delivery_chardle.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/delivery_chardle"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean delivery_chardle_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean delivery_chardle_condition_noAntivirus (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return (!groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") + && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") + && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")); +} + +// ---------------------------------------------------------------------- + +boolean delivery_chardle_condition_hasNotFoundBeta (obj_id player, obj_id npc) +{ + return !hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_epsilon"); +} + +// ---------------------------------------------------------------------- + +boolean delivery_chardle_condition_neverDelivered (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return (!groundquests.isQuestActiveOrComplete(player, "camp_delta_delivery_01")); +} + +// ---------------------------------------------------------------------- + +boolean delivery_chardle_condition_hasMeetingTask (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "camp_delta_delivery_01", "getBeastDelta"); +} + +// ---------------------------------------------------------------------- + +boolean delivery_chardle_condition_hasEscortTask (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "camp_delta_delivery_01", "escortTaskDelta"); +} + +// ---------------------------------------------------------------------- + +boolean delivery_chardle_condition_hasDeliveredBefore (obj_id player, obj_id npc) +{ + return groundquests.hasCompletedQuest(player, "camp_delta_delivery_01"); +} + +// ---------------------------------------------------------------------- + +boolean delivery_chardle_condition_tooLowLevel (obj_id player, obj_id npc) +{ + return getLevel(player) < 60; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void delivery_chardle_action_giveQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(groundquests.hasCompletedQuest(player, "camp_delta_delivery_01")) + { + delivery_chardle_action_clearDeliveryQuest(player, npc); + } + groundquests.grantQuest(player, "camp_delta_delivery_01"); +} + +// ---------------------------------------------------------------------- + +void delivery_chardle_action_clearDeliveryQuest (obj_id player, obj_id npc) +{ + groundquests.clearQuest(player, "camp_delta_delivery_01"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int delivery_chardle_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I need someone good with combat and you look like you want some extra credits! + + //-- [RESPONSE NOTE] + //-- PLAYER: Depends on what you need. + if (response == "s_96") + { + //-- [NOTE] + if (delivery_chardle_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: I need someone to escort my delivery volunteer to camp beta. I already know you have been there, word gets around. The volunteer knows the way as well so between the two of you no one should get lost. + string_id message = new string_id (c_stringFile, "s_97"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What are we delivering? + boolean hasResponse0 = false; + if (delivery_chardle_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_14"); + + utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int delivery_chardle_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I need someone to escort my delivery volunteer to camp beta. I already know you have been there, word gets around. The volunteer knows the way as well so between the two of you no one should get lost. + + //-- [RESPONSE NOTE] + //-- PLAYER: What are we delivering? + if (response == "s_14") + { + //-- [NOTE] + if (delivery_chardle_condition__defaultCondition (player, npc)) + { + //-- NPC: Medical supplies, food, water, ammunition. What do you think we are delivering? Imperial recruitment posters? Are you interested in helping out? + string_id message = new string_id (c_stringFile, "s_18"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sure. I'll help. + boolean hasResponse0 = false; + if (delivery_chardle_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_20"); + + utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int delivery_chardle_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Medical supplies, food, water, ammunition. What do you think we are delivering? Imperial recruitment posters? Are you interested in helping out? + + //-- [RESPONSE NOTE] + //-- PLAYER: Sure. I'll help. + if (response == "s_20") + { + //-- [NOTE] + if (delivery_chardle_condition__defaultCondition (player, npc)) + { + //-- NPC: Oh I almost forgot. You should know that the delivery volunteer is armed with more than weapons. If the volunteer thinks he is about to succomb to the undead he will hit a panic switch and detonate explosives he is carrying. + string_id message = new string_id (c_stringFile, "s_22"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Uh....why? + boolean hasResponse0 = false; + if (delivery_chardle_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_24"); + + utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int delivery_chardle_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Oh I almost forgot. You should know that the delivery volunteer is armed with more than weapons. If the volunteer thinks he is about to succomb to the undead he will hit a panic switch and detonate explosives he is carrying. + + //-- [RESPONSE NOTE] + //-- PLAYER: Uh....why? + if (response == "s_24") + { + //-- [NOTE] + if (delivery_chardle_condition__defaultCondition (player, npc)) + { + //-- NPC: Why? Because no one wants to come back as one of those things. + string_id message = new string_id (c_stringFile, "s_26"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Okay...I guess. + boolean hasResponse0 = false; + if (delivery_chardle_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_28"); + + utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int delivery_chardle_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Why? Because no one wants to come back as one of those things. + + //-- [RESPONSE NOTE] + //-- PLAYER: Okay...I guess. + if (response == "s_28") + { + //-- [NOTE] + if (delivery_chardle_condition__defaultCondition (player, npc)) + { + delivery_chardle_action_giveQuest (player, npc); + + //-- NPC: Go to the waypoint in your datapad. I'll send the delivery volunteer as soon as you are there. + string_id message = new string_id (c_stringFile, "s_30"); + utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int delivery_chardle_handleBranch12 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You want to help out with another delivery? Same credit amount if you are interested. + + //-- [RESPONSE NOTE] + //-- PLAYER: Sure. + if (response == "s_34") + { + //-- [NOTE] + if (delivery_chardle_condition__defaultCondition (player, npc)) + { + delivery_chardle_action_giveQuest (player, npc); + + //-- NPC: Go to the waypoint in your datapad. I'll send the delivery volunteer as soon as you are there. + string_id message = new string_id (c_stringFile, "s_36"); + utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.delivery_chardle"); + + setCondition (self, CONDITION_CONVERSABLE); + setCondition (self, CONDITION_INTERESTING); + + return SCRIPT_CONTINUE; +} + +trigger OnAttach () +{ + setCondition (self, CONDITION_CONVERSABLE); + setCondition (self, CONDITION_INTERESTING); + + 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.delivery_chardle"); + + 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 (delivery_chardle_condition_noAntivirus (player, npc)) + { + //-- NPC: You don't have the anti-virus yet?? Get away from me...go see Doctor Cody. She can help you out. + string_id message = new string_id (c_stringFile, "s_7"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_chardle_condition_tooLowLevel (player, npc)) + { + //-- NPC: I'd ask you to help out but you are a little green behind the ears for anything I have. + string_id message = new string_id (c_stringFile, "s_37"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_chardle_condition_hasNotFoundBeta (player, npc)) + { + //-- NPC: I hear there is another camp not far from here. If you find it, come back. I have a job you might want. + string_id message = new string_id (c_stringFile, "s_10"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_chardle_condition_hasEscortTask (player, npc)) + { + delivery_chardle_action_clearDeliveryQuest (player, npc); + + //-- NPC: I don't know what happened but you managed to lose the delivery volunteer. Come back when you want to try again. + string_id message = new string_id (c_stringFile, "s_16"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_chardle_condition_hasMeetingTask (player, npc)) + { + //-- NPC: You need to complete the delivery. Go to the waypoint I provided. + string_id message = new string_id (c_stringFile, "s_15"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_chardle_condition_neverDelivered (player, npc)) + { + doAnimationAction (npc, "thumb_up"); + + //-- NPC: I need someone good with combat and you look like you want some extra credits! + string_id message = new string_id (c_stringFile, "s_73"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Depends on what you need. + boolean hasResponse0 = false; + if (delivery_chardle_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_96"); + + utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 6); + + npcStartConversation (player, npc, "delivery_chardle", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_chardle_condition_hasDeliveredBefore (player, npc)) + { + //-- NPC: You want to help out with another delivery? Same credit amount if you are interested. + string_id message = new string_id (c_stringFile, "s_32"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sure. + boolean hasResponse0 = false; + if (delivery_chardle_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_34"); + + utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 12); + + npcStartConversation (player, npc, "delivery_chardle", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_chardle_condition__defaultCondition (player, npc)) + { + //-- NPC: If you are hungry let me know. We have plenty of rations. If you want them hot, you can always leave them out in the sun a while. + string_id message = new string_id (c_stringFile, "s_60"); + 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 != "delivery_chardle") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.delivery_chardle.branchId"); + + if (branchId == 6 && delivery_chardle_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && delivery_chardle_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && delivery_chardle_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && delivery_chardle_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && delivery_chardle_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 12 && delivery_chardle_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/delivery_hassel.script b/sku.0/sys.server/compiled/game/script/conversation/delivery_hassel.script index 194513177..f8e3011b3 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/delivery_hassel.script +++ b/sku.0/sys.server/compiled/game/script/conversation/delivery_hassel.script @@ -1,697 +1,697 @@ -// ====================================================================== -// -// delivery_hassel.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.create; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/delivery_hassel"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean delivery_hassel_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean delivery_hassel_condition_noAntivirus (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return (!groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") - && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") - && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")); -} - -// ---------------------------------------------------------------------- - -boolean delivery_hassel_condition_hasNotFoundNextCamp (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(!hasObjVar(npc, "questName")) - { - return false; - } - - string questName = getStringObjVar(npc, "questName"); - if(questName == null || questName.length() <= 0) - { - return false; - } - - string collectionSlot = ""; - if(questName.startsWith("camp_alpha_delivery_0")) - { - collectionSlot = "exp_icon_deathtroopers_camp_beta"; - } - else if(questName.startsWith("camp_beta_delivery_0")) - { - collectionSlot = "exp_icon_deathtroopers_camp_gamma"; - } - else if(questName.startsWith("camp_gamma_delivery_0")) - { - collectionSlot = "exp_icon_deathtroopers_camp_delta"; - } - else if(questName.startsWith("camp_delta_delivery_0")) - { - collectionSlot = "exp_icon_deathtroopers_camp_epsilon"; - } - - if(collectionSlot == null || collectionSlot.length() <= 0) - { - return false; - } - - return !hasCompletedCollectionSlot(player, collectionSlot); -} - -// ---------------------------------------------------------------------- - -boolean delivery_hassel_condition_neverDelivered (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(!hasObjVar(npc, "questName")) - { - return false; - } - - string questName = getStringObjVar(npc, "questName"); - if(questName == null || questName.length() <= 0) - { - return false; - } - return (!groundquests.isQuestActiveOrComplete(player, questName)); -} - -// ---------------------------------------------------------------------- - -boolean delivery_hassel_condition_hasDeliveredBefore (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(!hasObjVar(npc, "questName")) - { - return false; - } - - string questName = getStringObjVar(npc, "questName"); - if(questName == null || questName.length() <= 0) - { - return false; - } - - return groundquests.hasCompletedQuest(player, questName); -} - -// ---------------------------------------------------------------------- - -boolean delivery_hassel_condition_hasQuestCompleted (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(!hasObjVar(npc, "questName")) - { - return false; - } - - string questName = getStringObjVar(npc, "questName"); - if(questName == null || questName.length() <= 0) - { - return false; - } - - return (groundquests.hasCompletedQuest(player, questName)); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void delivery_hassel_action_giveQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(!hasObjVar(npc, "questName")) - { - CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() npc "+npc+" has no questName objvar. Aborting the camp defense functionality."); - return; - } - - string questName = getStringObjVar(npc, "questName"); - if(questName == null || questName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() npc "+npc+" has an invalid questName objvar. Aborting the camp defense functionality."); - return; - } - - if(groundquests.hasCompletedQuest(player, questName)) - { - groundquests.clearQuest(player, questName); - } - - CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() NPC "+npc+" has questName: "+questName+"."); - - string creatureName = getStringObjVar(npc, "creature_type"); - if(creatureName == null || creatureName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() NPC "+npc+" has an invalid creatureName. Aborting the camp defense functionality."); - return; - } - - int combatLevel = getLevel(player); - if(combatLevel < 0 || combatLevel > 90) - { - CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() Player "+player+" has a level that is invalid. Player level is: "+combatLevel+". Aborting the camp defense."); - return; - } - - int maxLevel = getIntObjVar(npc, "maxLevel"); - if(maxLevel < 0 || maxLevel > 90) - { - CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() NPC "+npc+" has an invalid maxLevel. Aborting the camp defense."); - return; - } - - if(combatLevel > maxLevel) - { - combatLevel = maxLevel; - } - - CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() NPC "+npc+" is attempting to give player: "+player+" the quest: "+questName+"."); - - groundquests.grantQuest(player, questName); - - setObjVar(npc, "combatLevel", combatLevel); - setObjVar(npc, "owner", player); - setObjVar(npc, create.INITIALIZE_CREATURE_DO_NOT_SCALE_OBJVAR, 1); - - dictionary creatureDict = utils.dataTableGetRow("datatables/mob/creatures.iff", creatureName); - if(creatureDict != null) - { - create.initializeCreature (npc, creatureName, creatureDict, combatLevel); - } - - setName(npc, "Delivery Volunteer ("+getPlayerName(player)+")"); - setInvulnerable(npc, false); - utils.setScriptVar(npc, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - clearCondition(npc, CONDITION_CONVERSABLE); - clearCondition(npc, CONDITION_INTERESTING); - setAttrib(npc, HEALTH, getMaxAttrib( npc, HEALTH )); - messageTo(npc, "startBeastDeliveryPathing", null, 1, false); -} - -// ---------------------------------------------------------------------- - -void delivery_hassel_action_clearDeliveryQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(!hasObjVar(npc, "questName")) - { - return; - } - - string questName = getStringObjVar(npc, "questName"); - if(questName == null || questName.length() <= 0) - { - return; - } - groundquests.clearQuest(player, questName); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int delivery_hassel_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I need someone good with combat and you look like you want some extra credits! - - //-- [RESPONSE NOTE] - //-- PLAYER: Depends on what you need. - if (response == "s_96") - { - //-- [NOTE] - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: I need someone to escort me to the next camp. I already know you have been there, word gets around. - string_id message = new string_id (c_stringFile, "s_97"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What are we delivering? - boolean hasResponse0 = false; - if (delivery_hassel_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.delivery_hassel.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int delivery_hassel_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I need someone to escort me to the next camp. I already know you have been there, word gets around. - - //-- [RESPONSE NOTE] - //-- PLAYER: What are we delivering? - if (response == "s_13") - { - //-- [NOTE] - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - //-- NPC: Medical supplies, food, water, ammunition, news...maybe a little hope. - string_id message = new string_id (c_stringFile, "s_17"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sure. I'll help. - boolean hasResponse0 = false; - if (delivery_hassel_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_19"); - - utils.setScriptVar (player, "conversation.delivery_hassel.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int delivery_hassel_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Medical supplies, food, water, ammunition, news...maybe a little hope. - - //-- [RESPONSE NOTE] - //-- PLAYER: Sure. I'll help. - if (response == "s_19") - { - //-- [NOTE] - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - //-- NPC: Oh, I almost forgot. You should know that I am armed with more than weapons. If I think we are about to be overrun I will hit a panic switch and detonate explosives I am carrying. I AM NOT going to wander Dathomir as one of THEM! - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Uh...I will keep my distance then. - boolean hasResponse0 = false; - if (delivery_hassel_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.delivery_hassel.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int delivery_hassel_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Oh, I almost forgot. You should know that I am armed with more than weapons. If I think we are about to be overrun I will hit a panic switch and detonate explosives I am carrying. I AM NOT going to wander Dathomir as one of THEM! - - //-- [RESPONSE NOTE] - //-- PLAYER: Uh...I will keep my distance then. - if (response == "s_38") - { - //-- [NOTE] - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - delivery_hassel_action_giveQuest (player, npc); - - //-- NPC: Alright. Follow me. - string_id message = new string_id (c_stringFile, "s_40"); - utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int delivery_hassel_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You want to help out with another delivery? Same credit amount if you are interested. - - //-- [RESPONSE NOTE] - //-- PLAYER: Sure. - if (response == "s_33") - { - //-- [NOTE] - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - delivery_hassel_action_giveQuest (player, npc); - - //-- NPC: Alright. Follow me. - string_id message = new string_id (c_stringFile, "s_35"); - utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.delivery_hassel"); - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - return SCRIPT_CONTINUE; -} - -trigger OnAttach () -{ - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - 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.delivery_hassel"); - - 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 (delivery_hassel_condition_noAntivirus (player, npc)) - { - //-- NPC: You don't have the anti-virus yet?? Get away from me...go see Doctor Cody. She can help you out. - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_hassel_condition_hasNotFoundNextCamp (player, npc)) - { - //-- NPC: I hear there is another camp not far from here. If you find it, come back. I have a job you might want. - string_id message = new string_id (c_stringFile, "s_10"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_hassel_condition_neverDelivered (player, npc)) - { - doAnimationAction (npc, "thumb_up"); - - //-- NPC: I need someone good with combat and you look like you want some extra credits! - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Depends on what you need. - boolean hasResponse0 = false; - if (delivery_hassel_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_96"); - - utils.setScriptVar (player, "conversation.delivery_hassel.branchId", 3); - - npcStartConversation (player, npc, "delivery_hassel", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_hassel_condition_hasDeliveredBefore (player, npc)) - { - //-- NPC: You want to help out with another delivery? Same credit amount if you are interested. - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sure. - boolean hasResponse0 = false; - if (delivery_hassel_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_33"); - - utils.setScriptVar (player, "conversation.delivery_hassel.branchId", 8); - - npcStartConversation (player, npc, "delivery_hassel", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - //-- NPC: If you are hungry there are plenty of rations inside the camp. - string_id message = new string_id (c_stringFile, "s_60"); - 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 != "delivery_hassel") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.delivery_hassel.branchId"); - - if (branchId == 3 && delivery_hassel_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && delivery_hassel_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && delivery_hassel_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && delivery_hassel_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && delivery_hassel_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// delivery_hassel.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.create; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/delivery_hassel"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean delivery_hassel_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean delivery_hassel_condition_noAntivirus (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return (!groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") + && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") + && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")); +} + +// ---------------------------------------------------------------------- + +boolean delivery_hassel_condition_hasNotFoundNextCamp (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(!hasObjVar(npc, "questName")) + { + return false; + } + + string questName = getStringObjVar(npc, "questName"); + if(questName == null || questName.length() <= 0) + { + return false; + } + + string collectionSlot = ""; + if(questName.startsWith("camp_alpha_delivery_0")) + { + collectionSlot = "exp_icon_deathtroopers_camp_beta"; + } + else if(questName.startsWith("camp_beta_delivery_0")) + { + collectionSlot = "exp_icon_deathtroopers_camp_gamma"; + } + else if(questName.startsWith("camp_gamma_delivery_0")) + { + collectionSlot = "exp_icon_deathtroopers_camp_delta"; + } + else if(questName.startsWith("camp_delta_delivery_0")) + { + collectionSlot = "exp_icon_deathtroopers_camp_epsilon"; + } + + if(collectionSlot == null || collectionSlot.length() <= 0) + { + return false; + } + + return !hasCompletedCollectionSlot(player, collectionSlot); +} + +// ---------------------------------------------------------------------- + +boolean delivery_hassel_condition_neverDelivered (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(!hasObjVar(npc, "questName")) + { + return false; + } + + string questName = getStringObjVar(npc, "questName"); + if(questName == null || questName.length() <= 0) + { + return false; + } + return (!groundquests.isQuestActiveOrComplete(player, questName)); +} + +// ---------------------------------------------------------------------- + +boolean delivery_hassel_condition_hasDeliveredBefore (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(!hasObjVar(npc, "questName")) + { + return false; + } + + string questName = getStringObjVar(npc, "questName"); + if(questName == null || questName.length() <= 0) + { + return false; + } + + return groundquests.hasCompletedQuest(player, questName); +} + +// ---------------------------------------------------------------------- + +boolean delivery_hassel_condition_hasQuestCompleted (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(!hasObjVar(npc, "questName")) + { + return false; + } + + string questName = getStringObjVar(npc, "questName"); + if(questName == null || questName.length() <= 0) + { + return false; + } + + return (groundquests.hasCompletedQuest(player, questName)); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void delivery_hassel_action_giveQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(!hasObjVar(npc, "questName")) + { + CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() npc "+npc+" has no questName objvar. Aborting the camp defense functionality."); + return; + } + + string questName = getStringObjVar(npc, "questName"); + if(questName == null || questName.length() <= 0) + { + CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() npc "+npc+" has an invalid questName objvar. Aborting the camp defense functionality."); + return; + } + + if(groundquests.hasCompletedQuest(player, questName)) + { + groundquests.clearQuest(player, questName); + } + + CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() NPC "+npc+" has questName: "+questName+"."); + + string creatureName = getStringObjVar(npc, "creature_type"); + if(creatureName == null || creatureName.length() <= 0) + { + CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() NPC "+npc+" has an invalid creatureName. Aborting the camp defense functionality."); + return; + } + + int combatLevel = getLevel(player); + if(combatLevel < 0 || combatLevel > 90) + { + CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() Player "+player+" has a level that is invalid. Player level is: "+combatLevel+". Aborting the camp defense."); + return; + } + + int maxLevel = getIntObjVar(npc, "maxLevel"); + if(maxLevel < 0 || maxLevel > 90) + { + CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() NPC "+npc+" has an invalid maxLevel. Aborting the camp defense."); + return; + } + + if(combatLevel > maxLevel) + { + combatLevel = maxLevel; + } + + CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() NPC "+npc+" is attempting to give player: "+player+" the quest: "+questName+"."); + + groundquests.grantQuest(player, questName); + + setObjVar(npc, "combatLevel", combatLevel); + setObjVar(npc, "owner", player); + setObjVar(npc, create.INITIALIZE_CREATURE_DO_NOT_SCALE_OBJVAR, 1); + + dictionary creatureDict = utils.dataTableGetRow("datatables/mob/creatures.iff", creatureName); + if(creatureDict != null) + { + create.initializeCreature (npc, creatureName, creatureDict, combatLevel); + } + + setName(npc, "Delivery Volunteer ("+getPlayerName(player)+")"); + setInvulnerable(npc, false); + utils.setScriptVar(npc, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); + clearCondition(npc, CONDITION_CONVERSABLE); + clearCondition(npc, CONDITION_INTERESTING); + setAttrib(npc, HEALTH, getMaxAttrib( npc, HEALTH )); + messageTo(npc, "startBeastDeliveryPathing", null, 1, false); +} + +// ---------------------------------------------------------------------- + +void delivery_hassel_action_clearDeliveryQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(!hasObjVar(npc, "questName")) + { + return; + } + + string questName = getStringObjVar(npc, "questName"); + if(questName == null || questName.length() <= 0) + { + return; + } + groundquests.clearQuest(player, questName); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int delivery_hassel_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I need someone good with combat and you look like you want some extra credits! + + //-- [RESPONSE NOTE] + //-- PLAYER: Depends on what you need. + if (response == "s_96") + { + //-- [NOTE] + if (delivery_hassel_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: I need someone to escort me to the next camp. I already know you have been there, word gets around. + string_id message = new string_id (c_stringFile, "s_97"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What are we delivering? + boolean hasResponse0 = false; + if (delivery_hassel_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.delivery_hassel.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int delivery_hassel_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I need someone to escort me to the next camp. I already know you have been there, word gets around. + + //-- [RESPONSE NOTE] + //-- PLAYER: What are we delivering? + if (response == "s_13") + { + //-- [NOTE] + if (delivery_hassel_condition__defaultCondition (player, npc)) + { + //-- NPC: Medical supplies, food, water, ammunition, news...maybe a little hope. + string_id message = new string_id (c_stringFile, "s_17"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sure. I'll help. + boolean hasResponse0 = false; + if (delivery_hassel_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_19"); + + utils.setScriptVar (player, "conversation.delivery_hassel.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int delivery_hassel_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Medical supplies, food, water, ammunition, news...maybe a little hope. + + //-- [RESPONSE NOTE] + //-- PLAYER: Sure. I'll help. + if (response == "s_19") + { + //-- [NOTE] + if (delivery_hassel_condition__defaultCondition (player, npc)) + { + //-- NPC: Oh, I almost forgot. You should know that I am armed with more than weapons. If I think we are about to be overrun I will hit a panic switch and detonate explosives I am carrying. I AM NOT going to wander Dathomir as one of THEM! + string_id message = new string_id (c_stringFile, "s_21"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Uh...I will keep my distance then. + boolean hasResponse0 = false; + if (delivery_hassel_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.delivery_hassel.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int delivery_hassel_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Oh, I almost forgot. You should know that I am armed with more than weapons. If I think we are about to be overrun I will hit a panic switch and detonate explosives I am carrying. I AM NOT going to wander Dathomir as one of THEM! + + //-- [RESPONSE NOTE] + //-- PLAYER: Uh...I will keep my distance then. + if (response == "s_38") + { + //-- [NOTE] + if (delivery_hassel_condition__defaultCondition (player, npc)) + { + delivery_hassel_action_giveQuest (player, npc); + + //-- NPC: Alright. Follow me. + string_id message = new string_id (c_stringFile, "s_40"); + utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int delivery_hassel_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You want to help out with another delivery? Same credit amount if you are interested. + + //-- [RESPONSE NOTE] + //-- PLAYER: Sure. + if (response == "s_33") + { + //-- [NOTE] + if (delivery_hassel_condition__defaultCondition (player, npc)) + { + delivery_hassel_action_giveQuest (player, npc); + + //-- NPC: Alright. Follow me. + string_id message = new string_id (c_stringFile, "s_35"); + utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.delivery_hassel"); + + setCondition (self, CONDITION_CONVERSABLE); + setCondition (self, CONDITION_INTERESTING); + + return SCRIPT_CONTINUE; +} + +trigger OnAttach () +{ + setCondition (self, CONDITION_CONVERSABLE); + setCondition (self, CONDITION_INTERESTING); + + 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.delivery_hassel"); + + 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 (delivery_hassel_condition_noAntivirus (player, npc)) + { + //-- NPC: You don't have the anti-virus yet?? Get away from me...go see Doctor Cody. She can help you out. + string_id message = new string_id (c_stringFile, "s_7"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_hassel_condition_hasNotFoundNextCamp (player, npc)) + { + //-- NPC: I hear there is another camp not far from here. If you find it, come back. I have a job you might want. + string_id message = new string_id (c_stringFile, "s_10"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_hassel_condition_neverDelivered (player, npc)) + { + doAnimationAction (npc, "thumb_up"); + + //-- NPC: I need someone good with combat and you look like you want some extra credits! + string_id message = new string_id (c_stringFile, "s_73"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Depends on what you need. + boolean hasResponse0 = false; + if (delivery_hassel_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_96"); + + utils.setScriptVar (player, "conversation.delivery_hassel.branchId", 3); + + npcStartConversation (player, npc, "delivery_hassel", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_hassel_condition_hasDeliveredBefore (player, npc)) + { + //-- NPC: You want to help out with another delivery? Same credit amount if you are interested. + string_id message = new string_id (c_stringFile, "s_31"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sure. + boolean hasResponse0 = false; + if (delivery_hassel_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_33"); + + utils.setScriptVar (player, "conversation.delivery_hassel.branchId", 8); + + npcStartConversation (player, npc, "delivery_hassel", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_hassel_condition__defaultCondition (player, npc)) + { + //-- NPC: If you are hungry there are plenty of rations inside the camp. + string_id message = new string_id (c_stringFile, "s_60"); + 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 != "delivery_hassel") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.delivery_hassel.branchId"); + + if (branchId == 3 && delivery_hassel_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && delivery_hassel_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && delivery_hassel_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && delivery_hassel_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && delivery_hassel_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/delivery_pirrohn.script b/sku.0/sys.server/compiled/game/script/conversation/delivery_pirrohn.script index ffb79e088..fed16a3ec 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/delivery_pirrohn.script +++ b/sku.0/sys.server/compiled/game/script/conversation/delivery_pirrohn.script @@ -1,660 +1,660 @@ -// ====================================================================== -// -// delivery_pirrohn.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/delivery_pirrohn"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean delivery_pirrohn_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean delivery_pirrohn_condition_noAntivirus (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return (!groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") - && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") - && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")); -} - -// ---------------------------------------------------------------------- - -boolean delivery_pirrohn_condition_hasNotFoundBeta (obj_id player, obj_id npc) -{ - return !hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_gamma"); -} - -// ---------------------------------------------------------------------- - -boolean delivery_pirrohn_condition_neverDelivered (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return (!groundquests.isQuestActiveOrComplete(player, "camp_beta_delivery_01")); -} - -// ---------------------------------------------------------------------- - -boolean delivery_pirrohn_condition_hasMeetingTask (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "camp_beta_delivery_01", "getBeastBeta"); -} - -// ---------------------------------------------------------------------- - -boolean delivery_pirrohn_condition_hasEscortTask (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "camp_beta_delivery_01", "escortTaskBeta"); -} - -// ---------------------------------------------------------------------- - -boolean delivery_pirrohn_condition_hasDeliveredBefore (obj_id player, obj_id npc) -{ - return groundquests.hasCompletedQuest(player, "camp_beta_delivery_01"); -} - -// ---------------------------------------------------------------------- - -boolean delivery_pirrohn_condition_tooLowLevel (obj_id player, obj_id npc) -{ - return getLevel(player) < 20; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void delivery_pirrohn_action_giveQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(groundquests.hasCompletedQuest(player, "camp_beta_delivery_01")) - { - delivery_pirrohn_action_clearDeliveryQuest(player, npc); - } - groundquests.grantQuest(player, "camp_beta_delivery_01"); -} - -// ---------------------------------------------------------------------- - -void delivery_pirrohn_action_clearDeliveryQuest (obj_id player, obj_id npc) -{ - groundquests.clearQuest(player, "camp_beta_delivery_01"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int delivery_pirrohn_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I need someone good with combat and you look like you want some extra credits! - - //-- [RESPONSE NOTE] - //-- PLAYER: Depends on what you need. - if (response == "s_96") - { - //-- [NOTE] - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: I need someone to escort my delivery volunteer to camp beta. I already know you have been there, word gets around. The volunteer knows the way as well so between the two of you no one should get lost. - string_id message = new string_id (c_stringFile, "s_97"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What are we delivering? - boolean hasResponse0 = false; - if (delivery_pirrohn_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_14"); - - utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int delivery_pirrohn_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I need someone to escort my delivery volunteer to camp beta. I already know you have been there, word gets around. The volunteer knows the way as well so between the two of you no one should get lost. - - //-- [RESPONSE NOTE] - //-- PLAYER: What are we delivering? - if (response == "s_14") - { - //-- [NOTE] - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - //-- NPC: Medical supplies, food, water, ammunition. What do you think we are delivering? Imperial recruitment posters? Are you interested in helping out? - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sure. I'll help. - boolean hasResponse0 = false; - if (delivery_pirrohn_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_20"); - - utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int delivery_pirrohn_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Medical supplies, food, water, ammunition. What do you think we are delivering? Imperial recruitment posters? Are you interested in helping out? - - //-- [RESPONSE NOTE] - //-- PLAYER: Sure. I'll help. - if (response == "s_20") - { - //-- [NOTE] - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - //-- NPC: Oh I almost forgot. You should know that the delivery volunteer is armed with more than weapons. If the volunteer thinks he is about to succomb to the undead he will hit a panic switch and detonate explosives he is carrying. - string_id message = new string_id (c_stringFile, "s_22"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Uh....why? - boolean hasResponse0 = false; - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_24"); - - utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int delivery_pirrohn_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Oh I almost forgot. You should know that the delivery volunteer is armed with more than weapons. If the volunteer thinks he is about to succomb to the undead he will hit a panic switch and detonate explosives he is carrying. - - //-- [RESPONSE NOTE] - //-- PLAYER: Uh....why? - if (response == "s_24") - { - //-- [NOTE] - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - //-- NPC: Why? Because no one wants to come back as one of those things. - string_id message = new string_id (c_stringFile, "s_26"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Okay...I guess. - boolean hasResponse0 = false; - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_28"); - - utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int delivery_pirrohn_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Why? Because no one wants to come back as one of those things. - - //-- [RESPONSE NOTE] - //-- PLAYER: Okay...I guess. - if (response == "s_28") - { - //-- [NOTE] - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - delivery_pirrohn_action_giveQuest (player, npc); - - //-- NPC: Go to the waypoint in your datapad. I'll send the delivery volunteer as soon as you are there. - string_id message = new string_id (c_stringFile, "s_30"); - utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int delivery_pirrohn_handleBranch12 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You want to help out with another delivery? Same credit amount if you are interested. - - //-- [RESPONSE NOTE] - //-- PLAYER: Sure. - if (response == "s_34") - { - //-- [NOTE] - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - delivery_pirrohn_action_giveQuest (player, npc); - - //-- NPC: Go to the waypoint in your datapad. I'll send the delivery volunteer as soon as you are there. - string_id message = new string_id (c_stringFile, "s_36"); - utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.delivery_pirrohn"); - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - return SCRIPT_CONTINUE; -} - -trigger OnAttach () -{ - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - 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.delivery_pirrohn"); - - 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 (delivery_pirrohn_condition_noAntivirus (player, npc)) - { - //-- NPC: You don't have the anti-virus yet?? Get away from me...go see Doctor Cody. She can help you out. - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_pirrohn_condition_tooLowLevel (player, npc)) - { - //-- NPC: I'd ask you to help out but you are a little green behind the ears for anything I have. - string_id message = new string_id (c_stringFile, "s_37"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_pirrohn_condition_hasNotFoundBeta (player, npc)) - { - //-- NPC: I hear there is another camp not far from here. If you find it, come back. I have a job you might want. - string_id message = new string_id (c_stringFile, "s_10"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_pirrohn_condition_hasEscortTask (player, npc)) - { - delivery_pirrohn_action_clearDeliveryQuest (player, npc); - - //-- NPC: I don't know what happened but you managed to lose the delivery volunteer. Come back when you want to try again. - string_id message = new string_id (c_stringFile, "s_16"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_pirrohn_condition_hasMeetingTask (player, npc)) - { - //-- NPC: You need to complete the delivery. Go to the waypoint I provided. - string_id message = new string_id (c_stringFile, "s_15"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_pirrohn_condition_neverDelivered (player, npc)) - { - doAnimationAction (npc, "thumb_up"); - - //-- NPC: I need someone good with combat and you look like you want some extra credits! - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Depends on what you need. - boolean hasResponse0 = false; - if (delivery_pirrohn_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_96"); - - utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 6); - - npcStartConversation (player, npc, "delivery_pirrohn", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_pirrohn_condition_hasDeliveredBefore (player, npc)) - { - //-- NPC: You want to help out with another delivery? Same credit amount if you are interested. - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sure. - boolean hasResponse0 = false; - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_34"); - - utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 12); - - npcStartConversation (player, npc, "delivery_pirrohn", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - //-- NPC: If you are hungry let me know. We have plenty of rations. If you want them hot, you can always leave them out in the sun a while. - string_id message = new string_id (c_stringFile, "s_60"); - 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 != "delivery_pirrohn") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - if (branchId == 6 && delivery_pirrohn_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && delivery_pirrohn_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && delivery_pirrohn_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && delivery_pirrohn_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && delivery_pirrohn_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 12 && delivery_pirrohn_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// delivery_pirrohn.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/delivery_pirrohn"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean delivery_pirrohn_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean delivery_pirrohn_condition_noAntivirus (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return (!groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") + && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") + && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")); +} + +// ---------------------------------------------------------------------- + +boolean delivery_pirrohn_condition_hasNotFoundBeta (obj_id player, obj_id npc) +{ + return !hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_gamma"); +} + +// ---------------------------------------------------------------------- + +boolean delivery_pirrohn_condition_neverDelivered (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return (!groundquests.isQuestActiveOrComplete(player, "camp_beta_delivery_01")); +} + +// ---------------------------------------------------------------------- + +boolean delivery_pirrohn_condition_hasMeetingTask (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "camp_beta_delivery_01", "getBeastBeta"); +} + +// ---------------------------------------------------------------------- + +boolean delivery_pirrohn_condition_hasEscortTask (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "camp_beta_delivery_01", "escortTaskBeta"); +} + +// ---------------------------------------------------------------------- + +boolean delivery_pirrohn_condition_hasDeliveredBefore (obj_id player, obj_id npc) +{ + return groundquests.hasCompletedQuest(player, "camp_beta_delivery_01"); +} + +// ---------------------------------------------------------------------- + +boolean delivery_pirrohn_condition_tooLowLevel (obj_id player, obj_id npc) +{ + return getLevel(player) < 20; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void delivery_pirrohn_action_giveQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(groundquests.hasCompletedQuest(player, "camp_beta_delivery_01")) + { + delivery_pirrohn_action_clearDeliveryQuest(player, npc); + } + groundquests.grantQuest(player, "camp_beta_delivery_01"); +} + +// ---------------------------------------------------------------------- + +void delivery_pirrohn_action_clearDeliveryQuest (obj_id player, obj_id npc) +{ + groundquests.clearQuest(player, "camp_beta_delivery_01"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int delivery_pirrohn_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I need someone good with combat and you look like you want some extra credits! + + //-- [RESPONSE NOTE] + //-- PLAYER: Depends on what you need. + if (response == "s_96") + { + //-- [NOTE] + if (delivery_pirrohn_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: I need someone to escort my delivery volunteer to camp beta. I already know you have been there, word gets around. The volunteer knows the way as well so between the two of you no one should get lost. + string_id message = new string_id (c_stringFile, "s_97"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What are we delivering? + boolean hasResponse0 = false; + if (delivery_pirrohn_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_14"); + + utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int delivery_pirrohn_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I need someone to escort my delivery volunteer to camp beta. I already know you have been there, word gets around. The volunteer knows the way as well so between the two of you no one should get lost. + + //-- [RESPONSE NOTE] + //-- PLAYER: What are we delivering? + if (response == "s_14") + { + //-- [NOTE] + if (delivery_pirrohn_condition__defaultCondition (player, npc)) + { + //-- NPC: Medical supplies, food, water, ammunition. What do you think we are delivering? Imperial recruitment posters? Are you interested in helping out? + string_id message = new string_id (c_stringFile, "s_18"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sure. I'll help. + boolean hasResponse0 = false; + if (delivery_pirrohn_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_20"); + + utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int delivery_pirrohn_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Medical supplies, food, water, ammunition. What do you think we are delivering? Imperial recruitment posters? Are you interested in helping out? + + //-- [RESPONSE NOTE] + //-- PLAYER: Sure. I'll help. + if (response == "s_20") + { + //-- [NOTE] + if (delivery_pirrohn_condition__defaultCondition (player, npc)) + { + //-- NPC: Oh I almost forgot. You should know that the delivery volunteer is armed with more than weapons. If the volunteer thinks he is about to succomb to the undead he will hit a panic switch and detonate explosives he is carrying. + string_id message = new string_id (c_stringFile, "s_22"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Uh....why? + boolean hasResponse0 = false; + if (delivery_pirrohn_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_24"); + + utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int delivery_pirrohn_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Oh I almost forgot. You should know that the delivery volunteer is armed with more than weapons. If the volunteer thinks he is about to succomb to the undead he will hit a panic switch and detonate explosives he is carrying. + + //-- [RESPONSE NOTE] + //-- PLAYER: Uh....why? + if (response == "s_24") + { + //-- [NOTE] + if (delivery_pirrohn_condition__defaultCondition (player, npc)) + { + //-- NPC: Why? Because no one wants to come back as one of those things. + string_id message = new string_id (c_stringFile, "s_26"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Okay...I guess. + boolean hasResponse0 = false; + if (delivery_pirrohn_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_28"); + + utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int delivery_pirrohn_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Why? Because no one wants to come back as one of those things. + + //-- [RESPONSE NOTE] + //-- PLAYER: Okay...I guess. + if (response == "s_28") + { + //-- [NOTE] + if (delivery_pirrohn_condition__defaultCondition (player, npc)) + { + delivery_pirrohn_action_giveQuest (player, npc); + + //-- NPC: Go to the waypoint in your datapad. I'll send the delivery volunteer as soon as you are there. + string_id message = new string_id (c_stringFile, "s_30"); + utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int delivery_pirrohn_handleBranch12 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You want to help out with another delivery? Same credit amount if you are interested. + + //-- [RESPONSE NOTE] + //-- PLAYER: Sure. + if (response == "s_34") + { + //-- [NOTE] + if (delivery_pirrohn_condition__defaultCondition (player, npc)) + { + delivery_pirrohn_action_giveQuest (player, npc); + + //-- NPC: Go to the waypoint in your datapad. I'll send the delivery volunteer as soon as you are there. + string_id message = new string_id (c_stringFile, "s_36"); + utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.delivery_pirrohn"); + + setCondition (self, CONDITION_CONVERSABLE); + setCondition (self, CONDITION_INTERESTING); + + return SCRIPT_CONTINUE; +} + +trigger OnAttach () +{ + setCondition (self, CONDITION_CONVERSABLE); + setCondition (self, CONDITION_INTERESTING); + + 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.delivery_pirrohn"); + + 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 (delivery_pirrohn_condition_noAntivirus (player, npc)) + { + //-- NPC: You don't have the anti-virus yet?? Get away from me...go see Doctor Cody. She can help you out. + string_id message = new string_id (c_stringFile, "s_7"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_pirrohn_condition_tooLowLevel (player, npc)) + { + //-- NPC: I'd ask you to help out but you are a little green behind the ears for anything I have. + string_id message = new string_id (c_stringFile, "s_37"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_pirrohn_condition_hasNotFoundBeta (player, npc)) + { + //-- NPC: I hear there is another camp not far from here. If you find it, come back. I have a job you might want. + string_id message = new string_id (c_stringFile, "s_10"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_pirrohn_condition_hasEscortTask (player, npc)) + { + delivery_pirrohn_action_clearDeliveryQuest (player, npc); + + //-- NPC: I don't know what happened but you managed to lose the delivery volunteer. Come back when you want to try again. + string_id message = new string_id (c_stringFile, "s_16"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_pirrohn_condition_hasMeetingTask (player, npc)) + { + //-- NPC: You need to complete the delivery. Go to the waypoint I provided. + string_id message = new string_id (c_stringFile, "s_15"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_pirrohn_condition_neverDelivered (player, npc)) + { + doAnimationAction (npc, "thumb_up"); + + //-- NPC: I need someone good with combat and you look like you want some extra credits! + string_id message = new string_id (c_stringFile, "s_73"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Depends on what you need. + boolean hasResponse0 = false; + if (delivery_pirrohn_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_96"); + + utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 6); + + npcStartConversation (player, npc, "delivery_pirrohn", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_pirrohn_condition_hasDeliveredBefore (player, npc)) + { + //-- NPC: You want to help out with another delivery? Same credit amount if you are interested. + string_id message = new string_id (c_stringFile, "s_32"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sure. + boolean hasResponse0 = false; + if (delivery_pirrohn_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_34"); + + utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 12); + + npcStartConversation (player, npc, "delivery_pirrohn", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (delivery_pirrohn_condition__defaultCondition (player, npc)) + { + //-- NPC: If you are hungry let me know. We have plenty of rations. If you want them hot, you can always leave them out in the sun a while. + string_id message = new string_id (c_stringFile, "s_60"); + 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 != "delivery_pirrohn") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.delivery_pirrohn.branchId"); + + if (branchId == 6 && delivery_pirrohn_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && delivery_pirrohn_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && delivery_pirrohn_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && delivery_pirrohn_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && delivery_pirrohn_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 12 && delivery_pirrohn_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/disgruntled_leader.script b/sku.0/sys.server/compiled/game/script/conversation/disgruntled_leader.script index d5c6aeb0b..e1b550a0f 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/disgruntled_leader.script +++ b/sku.0/sys.server/compiled/game/script/conversation/disgruntled_leader.script @@ -1,551 +1,551 @@ -// ====================================================================== -// -// disgruntled_leader.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/disgruntled_leader"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean disgruntled_leader_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean disgruntled_leader_condition_hasQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_meet_townspeople", "findTownsPeople"); - -} - -// ---------------------------------------------------------------------- - -boolean disgruntled_leader_condition_hasFinishedQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_return_townsperson", "returnToTownsPerson"); -} - -// ---------------------------------------------------------------------- - -boolean disgruntled_leader_condition_isWorkingOnIt (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_meet_townspeople", "findFiltrationGuy") - || (groundquests.hasCompletedQuest(player, "u16_nym_meet_townspeople") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_return_townsperson")); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void disgruntled_leader_action_signalToGoToNym (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundTownsPeopleAgain"); -} - -// ---------------------------------------------------------------------- - -void disgruntled_leader_action_hasMetTownsPeople (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundTownsPeople"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int disgruntled_leader_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Oh you want my thanks because you lifted a finger? You tell Nym that this is only the beginning. We need things fixed around this city. You tell him I'm making a list and if he thinks this is the last he's heard from us then he's got another think coming! And that's not all, we... - - //-- [RESPONSE NOTE] - //-- PLAYER: You're welcome. - if (response == "s_17") - { - doAnimationAction (player, "shake_head_disgust"); - - //-- [NOTE] - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - disgruntled_leader_action_signalToGoToNym (player, npc); - - //-- NPC: Fine! Walk off while I'm talking! Nym will hear about how rude his so-called 'Champion' is, too, you can count on that! - string_id message = new string_id (c_stringFile, "s_18"); - utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int disgruntled_leader_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Who are you? - - //-- [RESPONSE NOTE] - //-- PLAYER: I'm the Champion...oh never mind. - if (response == "s_10") - { - doAnimationAction (player, "point_to_self"); - - //-- [NOTE] - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_accusingly"); - - //-- NPC: Do you work for Nym? - string_id message = new string_id (c_stringFile, "s_12"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes, Nym asked me... - boolean hasResponse0 = false; - if (disgruntled_leader_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_14"); - - utils.setScriptVar (player, "conversation.disgruntled_leader.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int disgruntled_leader_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Do you work for Nym? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes, Nym asked me... - if (response == "s_14") - { - doAnimationAction (player, "taken_aback"); - - //-- [NOTE] - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "poke"); - - //-- NPC: Look. We need Nym to take care of some basic needs! It is obvious by his total reluctance to talk to his citizens that he doesn't care. But I bet he will when we all leave. Maybe a better name for this hole is Nym's Ghost Town! - string_id message = new string_id (c_stringFile, "s_19"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Take it easy. I'm... - boolean hasResponse0 = false; - if (disgruntled_leader_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_21"); - - utils.setScriptVar (player, "conversation.disgruntled_leader.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int disgruntled_leader_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Look. We need Nym to take care of some basic needs! It is obvious by his total reluctance to talk to his citizens that he doesn't care. But I bet he will when we all leave. Maybe a better name for this hole is Nym's Ghost Town! - - //-- [RESPONSE NOTE] - //-- PLAYER: Take it easy. I'm... - if (response == "s_21") - { - doAnimationAction (player, "taken_aback"); - - //-- [NOTE] - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - //-- NPC: How about you make yourself useful and fix the water supply before we all die. If you didn't notice the streams on this planet are not drinkable. We used to have access to filtered water, but now we don't. We haven't even been able to properly bathe in weeks! Yes, it is quite obvious that Nym is trying to kill us all! - string_id message = new string_id (c_stringFile, "s_23"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'll take care of it. - boolean hasResponse0 = false; - if (disgruntled_leader_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.disgruntled_leader.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int disgruntled_leader_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: How about you make yourself useful and fix the water supply before we all die. If you didn't notice the streams on this planet are not drinkable. We used to have access to filtered water, but now we don't. We haven't even been able to properly bathe in weeks! Yes, it is quite obvious that Nym is trying to kill us all! - - //-- [RESPONSE NOTE] - //-- PLAYER: I'll take care of it. - if (response == "s_25") - { - //-- [NOTE] - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_away"); - - disgruntled_leader_action_hasMetTownsPeople (player, npc); - - //-- NPC: Sure you will. Here is the location of Phor Cl-lan. He's the so-called Water Treatment Tech. Maybe a 'Champion' can squeeze some fresh water out of him... if you can manage not to get lost. - string_id message = new string_id (c_stringFile, "s_27"); - utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.disgruntled_leader"); - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; -} - -trigger OnAttach () -{ - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - 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.disgruntled_leader"); - - 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 (disgruntled_leader_condition_hasFinishedQuest (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - //-- NPC: Oh you want my thanks because you lifted a finger? You tell Nym that this is only the beginning. We need things fixed around this city. You tell him I'm making a list and if he thinks this is the last he's heard from us then he's got another think coming! And that's not all, we... - string_id message = new string_id (c_stringFile, "s_16"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: You're welcome. - boolean hasResponse0 = false; - if (disgruntled_leader_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.disgruntled_leader.branchId", 1); - - npcStartConversation (player, npc, "disgruntled_leader", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (disgruntled_leader_condition_isWorkingOnIt (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - doAnimationAction (player, "standing_placate"); - - //-- NPC: What? Got lost? Tired? Want a Gualaar? I can't even get a Gualaar and I'm a town veteran! And another thing...! - string_id message = new string_id (c_stringFile, "s_29"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (disgruntled_leader_condition_hasQuest (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - //-- NPC: Who are you? - string_id message = new string_id (c_stringFile, "s_8"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm the Champion...oh never mind. - boolean hasResponse0 = false; - if (disgruntled_leader_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_10"); - - utils.setScriptVar (player, "conversation.disgruntled_leader.branchId", 4); - - npcStartConversation (player, npc, "disgruntled_leader", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - //-- NPC: My grievances will be heard by someone in charge! - string_id message = new string_id (c_stringFile, "s_30"); - 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 != "disgruntled_leader") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.disgruntled_leader.branchId"); - - if (branchId == 1 && disgruntled_leader_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && disgruntled_leader_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && disgruntled_leader_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && disgruntled_leader_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && disgruntled_leader_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// disgruntled_leader.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/disgruntled_leader"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean disgruntled_leader_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean disgruntled_leader_condition_hasQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_meet_townspeople", "findTownsPeople"); + +} + +// ---------------------------------------------------------------------- + +boolean disgruntled_leader_condition_hasFinishedQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_return_townsperson", "returnToTownsPerson"); +} + +// ---------------------------------------------------------------------- + +boolean disgruntled_leader_condition_isWorkingOnIt (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_meet_townspeople", "findFiltrationGuy") + || (groundquests.hasCompletedQuest(player, "u16_nym_meet_townspeople") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_return_townsperson")); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void disgruntled_leader_action_signalToGoToNym (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundTownsPeopleAgain"); +} + +// ---------------------------------------------------------------------- + +void disgruntled_leader_action_hasMetTownsPeople (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundTownsPeople"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int disgruntled_leader_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Oh you want my thanks because you lifted a finger? You tell Nym that this is only the beginning. We need things fixed around this city. You tell him I'm making a list and if he thinks this is the last he's heard from us then he's got another think coming! And that's not all, we... + + //-- [RESPONSE NOTE] + //-- PLAYER: You're welcome. + if (response == "s_17") + { + doAnimationAction (player, "shake_head_disgust"); + + //-- [NOTE] + if (disgruntled_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "gesticulate_wildly"); + + disgruntled_leader_action_signalToGoToNym (player, npc); + + //-- NPC: Fine! Walk off while I'm talking! Nym will hear about how rude his so-called 'Champion' is, too, you can count on that! + string_id message = new string_id (c_stringFile, "s_18"); + utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int disgruntled_leader_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Who are you? + + //-- [RESPONSE NOTE] + //-- PLAYER: I'm the Champion...oh never mind. + if (response == "s_10") + { + doAnimationAction (player, "point_to_self"); + + //-- [NOTE] + if (disgruntled_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "point_accusingly"); + + //-- NPC: Do you work for Nym? + string_id message = new string_id (c_stringFile, "s_12"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes, Nym asked me... + boolean hasResponse0 = false; + if (disgruntled_leader_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_14"); + + utils.setScriptVar (player, "conversation.disgruntled_leader.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int disgruntled_leader_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Do you work for Nym? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes, Nym asked me... + if (response == "s_14") + { + doAnimationAction (player, "taken_aback"); + + //-- [NOTE] + if (disgruntled_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "poke"); + + //-- NPC: Look. We need Nym to take care of some basic needs! It is obvious by his total reluctance to talk to his citizens that he doesn't care. But I bet he will when we all leave. Maybe a better name for this hole is Nym's Ghost Town! + string_id message = new string_id (c_stringFile, "s_19"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Take it easy. I'm... + boolean hasResponse0 = false; + if (disgruntled_leader_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_21"); + + utils.setScriptVar (player, "conversation.disgruntled_leader.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int disgruntled_leader_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Look. We need Nym to take care of some basic needs! It is obvious by his total reluctance to talk to his citizens that he doesn't care. But I bet he will when we all leave. Maybe a better name for this hole is Nym's Ghost Town! + + //-- [RESPONSE NOTE] + //-- PLAYER: Take it easy. I'm... + if (response == "s_21") + { + doAnimationAction (player, "taken_aback"); + + //-- [NOTE] + if (disgruntled_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "gesticulate_wildly"); + + //-- NPC: How about you make yourself useful and fix the water supply before we all die. If you didn't notice the streams on this planet are not drinkable. We used to have access to filtered water, but now we don't. We haven't even been able to properly bathe in weeks! Yes, it is quite obvious that Nym is trying to kill us all! + string_id message = new string_id (c_stringFile, "s_23"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'll take care of it. + boolean hasResponse0 = false; + if (disgruntled_leader_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.disgruntled_leader.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int disgruntled_leader_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: How about you make yourself useful and fix the water supply before we all die. If you didn't notice the streams on this planet are not drinkable. We used to have access to filtered water, but now we don't. We haven't even been able to properly bathe in weeks! Yes, it is quite obvious that Nym is trying to kill us all! + + //-- [RESPONSE NOTE] + //-- PLAYER: I'll take care of it. + if (response == "s_25") + { + //-- [NOTE] + if (disgruntled_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "point_away"); + + disgruntled_leader_action_hasMetTownsPeople (player, npc); + + //-- NPC: Sure you will. Here is the location of Phor Cl-lan. He's the so-called Water Treatment Tech. Maybe a 'Champion' can squeeze some fresh water out of him... if you can manage not to get lost. + string_id message = new string_id (c_stringFile, "s_27"); + utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.disgruntled_leader"); + + setCondition (self, CONDITION_CONVERSABLE); + setCondition( self, CONDITION_INTERESTING ); + + return SCRIPT_CONTINUE; +} + +trigger OnAttach () +{ + setCondition (self, CONDITION_CONVERSABLE); + setCondition( self, CONDITION_INTERESTING ); + + 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.disgruntled_leader"); + + 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 (disgruntled_leader_condition_hasFinishedQuest (player, npc)) + { + doAnimationAction (npc, "gesticulate_wildly"); + + //-- NPC: Oh you want my thanks because you lifted a finger? You tell Nym that this is only the beginning. We need things fixed around this city. You tell him I'm making a list and if he thinks this is the last he's heard from us then he's got another think coming! And that's not all, we... + string_id message = new string_id (c_stringFile, "s_16"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: You're welcome. + boolean hasResponse0 = false; + if (disgruntled_leader_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.disgruntled_leader.branchId", 1); + + npcStartConversation (player, npc, "disgruntled_leader", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (disgruntled_leader_condition_isWorkingOnIt (player, npc)) + { + doAnimationAction (npc, "gesticulate_wildly"); + + doAnimationAction (player, "standing_placate"); + + //-- NPC: What? Got lost? Tired? Want a Gualaar? I can't even get a Gualaar and I'm a town veteran! And another thing...! + string_id message = new string_id (c_stringFile, "s_29"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (disgruntled_leader_condition_hasQuest (player, npc)) + { + doAnimationAction (npc, "gesticulate_wildly"); + + //-- NPC: Who are you? + string_id message = new string_id (c_stringFile, "s_8"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm the Champion...oh never mind. + boolean hasResponse0 = false; + if (disgruntled_leader_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_10"); + + utils.setScriptVar (player, "conversation.disgruntled_leader.branchId", 4); + + npcStartConversation (player, npc, "disgruntled_leader", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (disgruntled_leader_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "gesticulate_wildly"); + + //-- NPC: My grievances will be heard by someone in charge! + string_id message = new string_id (c_stringFile, "s_30"); + 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 != "disgruntled_leader") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.disgruntled_leader.branchId"); + + if (branchId == 1 && disgruntled_leader_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && disgruntled_leader_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && disgruntled_leader_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && disgruntled_leader_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && disgruntled_leader_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/gcw_demoralized_soldier.script b/sku.0/sys.server/compiled/game/script/conversation/gcw_demoralized_soldier.script index 420e42c02..008cad202 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/gcw_demoralized_soldier.script +++ b/sku.0/sys.server/compiled/game/script/conversation/gcw_demoralized_soldier.script @@ -1,1023 +1,1023 @@ -// ====================================================================== -// -// gcw_demoralized_soldier.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.factions; -include library.gcw; -include library.groundquests; -include library.trial; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/gcw_demoralized_soldier"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean gcw_demoralized_soldier_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean gcw_demoralized_soldier_condition_isReadyToTalkImperial (obj_id player, obj_id npc) -{ - if(utils.hasObjVar(npc, "faction_recruit_quest") && utils.hasScriptVar(npc, "faction_ent") && factions.isImperial(npc) - && groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_RALLY)) - { - int questStatus = utils.getIntObjVar(npc, "faction_recruit_quest"); - obj_id faction_ent = utils.getObjIdScriptVar(npc, "faction_ent"); - if((questStatus == 1) &&(faction_ent == player)) - { - return true; - } - } - return false; -} - -// ---------------------------------------------------------------------- - -boolean gcw_demoralized_soldier_condition_isReadyToTalkRebel (obj_id player, obj_id npc) -{ - if(utils.hasObjVar(npc, "faction_recruit_quest") && utils.hasScriptVar(npc, "faction_ent") && factions.isRebel(npc) - && groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_RALLY)) - { - int questStatus = utils.getIntObjVar(npc, "faction_recruit_quest"); - obj_id faction_ent = utils.getObjIdScriptVar(npc, "faction_ent"); - if((questStatus == 1) &&(faction_ent == player)) - { - return true; - } - } - return false; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void gcw_demoralized_soldier_action_convinced (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "gcw_rally_demoralized"); - trial.addNonInstanceFactionParticipant(player, npc); - messageTo(npc, "convinced", null, 2.0f, false ); -} - -// ---------------------------------------------------------------------- - -void gcw_demoralized_soldier_action_notConvinced (obj_id player, obj_id npc) -{ - messageTo(npc, "notConvinced", null, 0f, false ); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int gcw_demoralized_soldier_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Thank you. I just came apart when the fighting started. - - //-- [RESPONSE NOTE] - //-- PLAYER: That's understandable. But they need you out there! - if (response == "s_6") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - //-- NPC: I know. But the more they need me, the more dangerous its going to be. - string_id message = new string_id (c_stringFile, "s_8"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: The Imperials fight to maintain peace in the galaxy. You cannot turn your back on that! - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: That's the risk you took when you signed up. - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_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_20"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_17"); - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Ask yourself, what would people think if they knew you were hiding when the fighting started? - if (response == "s_14") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - //-- NPC: Yeah, I know. - string_id message = new string_id (c_stringFile, "s_22"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Would you want the people back home to be ashamed of you? - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: When you get back home, you'd want them to know you fought the rebel menace. - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_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_23"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_26"); - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Not much of an imperial if you hide at the first sight of blaster fire! - if (response == "s_30") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - //-- NPC: Yeah, maybe I'm just not cut out for this. - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Get a hold of yourself soldier! I want to see you out there killing rebel scum RIGHT NOW!! - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Yeah, I can see that. Pay is bad, food is worse and I hear Vader can be a though boss to work for. - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_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_34"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_38"); - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_demoralized_soldier_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I know. But the more they need me, the more dangerous its going to be. - - //-- [RESPONSE NOTE] - //-- PLAYER: The Imperials fight to maintain peace in the galaxy. You cannot turn your back on that! - if (response == "s_20") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_convinced (player, npc); - - //-- NPC: You're right, I can't turn my back on my duty. Thank you. - string_id message = new string_id (c_stringFile, "s_21"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: That's the risk you took when you signed up. - if (response == "s_17") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_notConvinced (player, npc); - - //-- NPC: Just go away! I'm not going back to the fighting! - string_id message = new string_id (c_stringFile, "s_19"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_demoralized_soldier_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yeah, I know. - - //-- [RESPONSE NOTE] - //-- PLAYER: Would you want the people back home to be ashamed of you? - if (response == "s_23") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_convinced (player, npc); - - //-- NPC: No... No I don't! I need to pull myself together and get back out there. Thank you. - string_id message = new string_id (c_stringFile, "s_25"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: When you get back home, you'd want them to know you fought the rebel menace. - if (response == "s_26") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_notConvinced (player, npc); - - //-- NPC: Get back home? If I fight I might never get back home. Go away! - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_demoralized_soldier_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yeah, maybe I'm just not cut out for this. - - //-- [RESPONSE NOTE] - //-- PLAYER: Get a hold of yourself soldier! I want to see you out there killing rebel scum RIGHT NOW!! - if (response == "s_34") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_convinced (player, npc); - - //-- NPC: yes.. I mean YES! DIE REBEL SCUM! - string_id message = new string_id (c_stringFile, "s_36"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Yeah, I can see that. Pay is bad, food is worse and I hear Vader can be a though boss to work for. - if (response == "s_38") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_notConvinced (player, npc); - - //-- NPC: Argh.. go away! - string_id message = new string_id (c_stringFile, "s_40"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_demoralized_soldier_handleBranch11 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Thank you. I panicked when the fighting started. - - //-- [RESPONSE NOTE] - //-- PLAYER: That's understandable. But they need you out there! - if (response == "s_44") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - //-- NPC: I know. But the more they need me, the more dangerous its going to be. - string_id message = new string_id (c_stringFile, "s_46"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: The rebellion fights to free the galaxy from oppression, you cannot turn your back on that! - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: That's the risk of you took when you signed up. - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_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_48"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_52"); - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Ask yourself, what would people think if they knew you were hiding when the fighting started? - if (response == "s_56") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - //-- NPC: Yeah, I know. - string_id message = new string_id (c_stringFile, "s_58"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Would you want the people back home to be ashamed of you? - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: When you get back home, you'd want them to know you fought Imperial oppression. - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_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_60"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_64"); - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: A soldier of the Rebellion should not leave his post. - if (response == "s_68") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - //-- NPC: Yeah, maybe I'm just not cut out for this. - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Get a hold of yourself soldier! I want to see you out there killing Imperial vermin RIGHT NOW!! - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: I can see that. The Empire's got Star Destroyers, Death Stars, a Huge Army, AT-AT's, Darth Vader, and ... - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_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_72"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_76"); - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_demoralized_soldier_handleBranch12 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I know. But the more they need me, the more dangerous its going to be. - - //-- [RESPONSE NOTE] - //-- PLAYER: The rebellion fights to free the galaxy from oppression, you cannot turn your back on that! - if (response == "s_48") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_convinced (player, npc); - - //-- NPC: You're right, I can't turn my back on my duty. Thank you. - string_id message = new string_id (c_stringFile, "s_50"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: That's the risk of you took when you signed up. - if (response == "s_52") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_notConvinced (player, npc); - - //-- NPC: Just go away! I'm not going back to the fighting! - string_id message = new string_id (c_stringFile, "s_54"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_demoralized_soldier_handleBranch15 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yeah, I know. - - //-- [RESPONSE NOTE] - //-- PLAYER: Would you want the people back home to be ashamed of you? - if (response == "s_60") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_convinced (player, npc); - - //-- NPC: No. No I don't! I need to pull myself together and get back out there. Thank you. - string_id message = new string_id (c_stringFile, "s_62"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: When you get back home, you'd want them to know you fought Imperial oppression. - if (response == "s_64") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_notConvinced (player, npc); - - //-- NPC: Get back home? If I fight I might never get back home. Go away! - string_id message = new string_id (c_stringFile, "s_66"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_demoralized_soldier_handleBranch18 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yeah, maybe I'm just not cut out for this. - - //-- [RESPONSE NOTE] - //-- PLAYER: Get a hold of yourself soldier! I want to see you out there killing Imperial vermin RIGHT NOW!! - if (response == "s_72") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_convinced (player, npc); - - //-- NPC: yes.. I mean YES! DIE IMPERIAL SCUM! - string_id message = new string_id (c_stringFile, "s_74"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I can see that. The Empire's got Star Destroyers, Death Stars, a Huge Army, AT-AT's, Darth Vader, and ... - if (response == "s_76") - { - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_notConvinced (player, npc); - - //-- NPC: Argh.. go away! - string_id message = new string_id (c_stringFile, "s_78"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.gcw_demoralized_soldier"); - - 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.gcw_demoralized_soldier"); - - 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 (gcw_demoralized_soldier_condition_isReadyToTalkImperial (player, npc)) - { - //-- NPC: Thank you. I just came apart when the fighting started. - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: That's understandable. But they need you out there! - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Ask yourself, what would people think if they knew you were hiding when the fighting started? - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Not much of an imperial if you hide at the first sight of blaster fire! - boolean hasResponse2 = false; - if (gcw_demoralized_soldier_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_6"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_14"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_30"); - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 1); - - npcStartConversation (player, npc, "gcw_demoralized_soldier", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (gcw_demoralized_soldier_condition_isReadyToTalkRebel (player, npc)) - { - //-- NPC: Thank you. I panicked when the fighting started. - string_id message = new string_id (c_stringFile, "s_42"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: That's understandable. But they need you out there! - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Ask yourself, what would people think if they knew you were hiding when the fighting started? - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: A soldier of the Rebellion should not leave his post. - boolean hasResponse2 = false; - if (gcw_demoralized_soldier_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_44"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_56"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_68"); - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 11); - - npcStartConversation (player, npc, "gcw_demoralized_soldier", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - //-- NPC: Please, go away. They'll find me. I can't take this! I need to get away from the fighting! - string_id message = new string_id (c_stringFile, "s_80"); - 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 != "gcw_demoralized_soldier") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - if (branchId == 1 && gcw_demoralized_soldier_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && gcw_demoralized_soldier_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && gcw_demoralized_soldier_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && gcw_demoralized_soldier_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 11 && gcw_demoralized_soldier_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 12 && gcw_demoralized_soldier_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 15 && gcw_demoralized_soldier_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 18 && gcw_demoralized_soldier_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// gcw_demoralized_soldier.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.factions; +include library.gcw; +include library.groundquests; +include library.trial; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/gcw_demoralized_soldier"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean gcw_demoralized_soldier_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean gcw_demoralized_soldier_condition_isReadyToTalkImperial (obj_id player, obj_id npc) +{ + if(utils.hasObjVar(npc, "faction_recruit_quest") && utils.hasScriptVar(npc, "faction_ent") && factions.isImperial(npc) + && groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_RALLY)) + { + int questStatus = utils.getIntObjVar(npc, "faction_recruit_quest"); + obj_id faction_ent = utils.getObjIdScriptVar(npc, "faction_ent"); + if((questStatus == 1) &&(faction_ent == player)) + { + return true; + } + } + return false; +} + +// ---------------------------------------------------------------------- + +boolean gcw_demoralized_soldier_condition_isReadyToTalkRebel (obj_id player, obj_id npc) +{ + if(utils.hasObjVar(npc, "faction_recruit_quest") && utils.hasScriptVar(npc, "faction_ent") && factions.isRebel(npc) + && groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_RALLY)) + { + int questStatus = utils.getIntObjVar(npc, "faction_recruit_quest"); + obj_id faction_ent = utils.getObjIdScriptVar(npc, "faction_ent"); + if((questStatus == 1) &&(faction_ent == player)) + { + return true; + } + } + return false; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void gcw_demoralized_soldier_action_convinced (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "gcw_rally_demoralized"); + trial.addNonInstanceFactionParticipant(player, npc); + messageTo(npc, "convinced", null, 2.0f, false ); +} + +// ---------------------------------------------------------------------- + +void gcw_demoralized_soldier_action_notConvinced (obj_id player, obj_id npc) +{ + messageTo(npc, "notConvinced", null, 0f, false ); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int gcw_demoralized_soldier_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Thank you. I just came apart when the fighting started. + + //-- [RESPONSE NOTE] + //-- PLAYER: That's understandable. But they need you out there! + if (response == "s_6") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + //-- NPC: I know. But the more they need me, the more dangerous its going to be. + string_id message = new string_id (c_stringFile, "s_8"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: The Imperials fight to maintain peace in the galaxy. You cannot turn your back on that! + boolean hasResponse0 = false; + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: That's the risk you took when you signed up. + boolean hasResponse1 = false; + if (gcw_demoralized_soldier_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_20"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_17"); + + utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 2); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Ask yourself, what would people think if they knew you were hiding when the fighting started? + if (response == "s_14") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + //-- NPC: Yeah, I know. + string_id message = new string_id (c_stringFile, "s_22"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Would you want the people back home to be ashamed of you? + boolean hasResponse0 = false; + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: When you get back home, you'd want them to know you fought the rebel menace. + boolean hasResponse1 = false; + if (gcw_demoralized_soldier_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_23"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_26"); + + utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Not much of an imperial if you hide at the first sight of blaster fire! + if (response == "s_30") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + //-- NPC: Yeah, maybe I'm just not cut out for this. + string_id message = new string_id (c_stringFile, "s_32"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Get a hold of yourself soldier! I want to see you out there killing rebel scum RIGHT NOW!! + boolean hasResponse0 = false; + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Yeah, I can see that. Pay is bad, food is worse and I hear Vader can be a though boss to work for. + boolean hasResponse1 = false; + if (gcw_demoralized_soldier_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_34"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_38"); + + utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_demoralized_soldier_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I know. But the more they need me, the more dangerous its going to be. + + //-- [RESPONSE NOTE] + //-- PLAYER: The Imperials fight to maintain peace in the galaxy. You cannot turn your back on that! + if (response == "s_20") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + gcw_demoralized_soldier_action_convinced (player, npc); + + //-- NPC: You're right, I can't turn my back on my duty. Thank you. + string_id message = new string_id (c_stringFile, "s_21"); + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: That's the risk you took when you signed up. + if (response == "s_17") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + gcw_demoralized_soldier_action_notConvinced (player, npc); + + //-- NPC: Just go away! I'm not going back to the fighting! + string_id message = new string_id (c_stringFile, "s_19"); + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_demoralized_soldier_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yeah, I know. + + //-- [RESPONSE NOTE] + //-- PLAYER: Would you want the people back home to be ashamed of you? + if (response == "s_23") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + gcw_demoralized_soldier_action_convinced (player, npc); + + //-- NPC: No... No I don't! I need to pull myself together and get back out there. Thank you. + string_id message = new string_id (c_stringFile, "s_25"); + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: When you get back home, you'd want them to know you fought the rebel menace. + if (response == "s_26") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + gcw_demoralized_soldier_action_notConvinced (player, npc); + + //-- NPC: Get back home? If I fight I might never get back home. Go away! + string_id message = new string_id (c_stringFile, "s_28"); + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_demoralized_soldier_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yeah, maybe I'm just not cut out for this. + + //-- [RESPONSE NOTE] + //-- PLAYER: Get a hold of yourself soldier! I want to see you out there killing rebel scum RIGHT NOW!! + if (response == "s_34") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + gcw_demoralized_soldier_action_convinced (player, npc); + + //-- NPC: yes.. I mean YES! DIE REBEL SCUM! + string_id message = new string_id (c_stringFile, "s_36"); + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Yeah, I can see that. Pay is bad, food is worse and I hear Vader can be a though boss to work for. + if (response == "s_38") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + gcw_demoralized_soldier_action_notConvinced (player, npc); + + //-- NPC: Argh.. go away! + string_id message = new string_id (c_stringFile, "s_40"); + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_demoralized_soldier_handleBranch11 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Thank you. I panicked when the fighting started. + + //-- [RESPONSE NOTE] + //-- PLAYER: That's understandable. But they need you out there! + if (response == "s_44") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + //-- NPC: I know. But the more they need me, the more dangerous its going to be. + string_id message = new string_id (c_stringFile, "s_46"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: The rebellion fights to free the galaxy from oppression, you cannot turn your back on that! + boolean hasResponse0 = false; + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: That's the risk of you took when you signed up. + boolean hasResponse1 = false; + if (gcw_demoralized_soldier_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_48"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_52"); + + utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 12); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Ask yourself, what would people think if they knew you were hiding when the fighting started? + if (response == "s_56") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + //-- NPC: Yeah, I know. + string_id message = new string_id (c_stringFile, "s_58"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Would you want the people back home to be ashamed of you? + boolean hasResponse0 = false; + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: When you get back home, you'd want them to know you fought Imperial oppression. + boolean hasResponse1 = false; + if (gcw_demoralized_soldier_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_60"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_64"); + + utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 15); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: A soldier of the Rebellion should not leave his post. + if (response == "s_68") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + //-- NPC: Yeah, maybe I'm just not cut out for this. + string_id message = new string_id (c_stringFile, "s_70"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Get a hold of yourself soldier! I want to see you out there killing Imperial vermin RIGHT NOW!! + boolean hasResponse0 = false; + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: I can see that. The Empire's got Star Destroyers, Death Stars, a Huge Army, AT-AT's, Darth Vader, and ... + boolean hasResponse1 = false; + if (gcw_demoralized_soldier_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_72"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_76"); + + utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 18); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_demoralized_soldier_handleBranch12 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I know. But the more they need me, the more dangerous its going to be. + + //-- [RESPONSE NOTE] + //-- PLAYER: The rebellion fights to free the galaxy from oppression, you cannot turn your back on that! + if (response == "s_48") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + gcw_demoralized_soldier_action_convinced (player, npc); + + //-- NPC: You're right, I can't turn my back on my duty. Thank you. + string_id message = new string_id (c_stringFile, "s_50"); + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: That's the risk of you took when you signed up. + if (response == "s_52") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + gcw_demoralized_soldier_action_notConvinced (player, npc); + + //-- NPC: Just go away! I'm not going back to the fighting! + string_id message = new string_id (c_stringFile, "s_54"); + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_demoralized_soldier_handleBranch15 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yeah, I know. + + //-- [RESPONSE NOTE] + //-- PLAYER: Would you want the people back home to be ashamed of you? + if (response == "s_60") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + gcw_demoralized_soldier_action_convinced (player, npc); + + //-- NPC: No. No I don't! I need to pull myself together and get back out there. Thank you. + string_id message = new string_id (c_stringFile, "s_62"); + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: When you get back home, you'd want them to know you fought Imperial oppression. + if (response == "s_64") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + gcw_demoralized_soldier_action_notConvinced (player, npc); + + //-- NPC: Get back home? If I fight I might never get back home. Go away! + string_id message = new string_id (c_stringFile, "s_66"); + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_demoralized_soldier_handleBranch18 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yeah, maybe I'm just not cut out for this. + + //-- [RESPONSE NOTE] + //-- PLAYER: Get a hold of yourself soldier! I want to see you out there killing Imperial vermin RIGHT NOW!! + if (response == "s_72") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + gcw_demoralized_soldier_action_convinced (player, npc); + + //-- NPC: yes.. I mean YES! DIE IMPERIAL SCUM! + string_id message = new string_id (c_stringFile, "s_74"); + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I can see that. The Empire's got Star Destroyers, Death Stars, a Huge Army, AT-AT's, Darth Vader, and ... + if (response == "s_76") + { + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + gcw_demoralized_soldier_action_notConvinced (player, npc); + + //-- NPC: Argh.. go away! + string_id message = new string_id (c_stringFile, "s_78"); + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.gcw_demoralized_soldier"); + + 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.gcw_demoralized_soldier"); + + 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 (gcw_demoralized_soldier_condition_isReadyToTalkImperial (player, npc)) + { + //-- NPC: Thank you. I just came apart when the fighting started. + string_id message = new string_id (c_stringFile, "s_4"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: That's understandable. But they need you out there! + boolean hasResponse0 = false; + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Ask yourself, what would people think if they knew you were hiding when the fighting started? + boolean hasResponse1 = false; + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Not much of an imperial if you hide at the first sight of blaster fire! + boolean hasResponse2 = false; + if (gcw_demoralized_soldier_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_6"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_14"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_30"); + + utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 1); + + npcStartConversation (player, npc, "gcw_demoralized_soldier", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (gcw_demoralized_soldier_condition_isReadyToTalkRebel (player, npc)) + { + //-- NPC: Thank you. I panicked when the fighting started. + string_id message = new string_id (c_stringFile, "s_42"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: That's understandable. But they need you out there! + boolean hasResponse0 = false; + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Ask yourself, what would people think if they knew you were hiding when the fighting started? + boolean hasResponse1 = false; + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: A soldier of the Rebellion should not leave his post. + boolean hasResponse2 = false; + if (gcw_demoralized_soldier_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_44"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_56"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_68"); + + utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 11); + + npcStartConversation (player, npc, "gcw_demoralized_soldier", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) + { + //-- NPC: Please, go away. They'll find me. I can't take this! I need to get away from the fighting! + string_id message = new string_id (c_stringFile, "s_80"); + 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 != "gcw_demoralized_soldier") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + if (branchId == 1 && gcw_demoralized_soldier_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && gcw_demoralized_soldier_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && gcw_demoralized_soldier_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && gcw_demoralized_soldier_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 11 && gcw_demoralized_soldier_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 12 && gcw_demoralized_soldier_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 15 && gcw_demoralized_soldier_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 18 && gcw_demoralized_soldier_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/gcw_introduction_talon_karrde.script b/sku.0/sys.server/compiled/game/script/conversation/gcw_introduction_talon_karrde.script index 9e1e8033f..5c38ca7b8 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/gcw_introduction_talon_karrde.script +++ b/sku.0/sys.server/compiled/game/script/conversation/gcw_introduction_talon_karrde.script @@ -1,1945 +1,1945 @@ -// ====================================================================== -// -// gcw_introduction_talon_karrde.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/gcw_introduction_talon_karrde"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean gcw_introduction_talon_karrde_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean gcw_introduction_talon_karrde_condition_hasIntroTask (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "gcw_introduction_quest", "contactSmuggler"); -} - -// ---------------------------------------------------------------------- - -boolean gcw_introduction_talon_karrde_condition_completedIntroNotNextStep (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "gcw_introduction_quest") - && !groundquests.hasCompletedQuest(player, "gcw_introduction_rebel_tatooine") - && !groundquests.hasCompletedQuest(player, "gcw_introduction_imperial_tatooine"); -} - -// ---------------------------------------------------------------------- - -boolean gcw_introduction_talon_karrde_condition_hasToken (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return true; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void gcw_introduction_talon_karrde_action_grantImperialQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); -} - -// ---------------------------------------------------------------------- - -void gcw_introduction_talon_karrde_action_grantRebelQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); -} - -// ---------------------------------------------------------------------- - -void gcw_introduction_talon_karrde_action_giveBadge (obj_id player, obj_id npc) -{ - faceTo(npc, player); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int gcw_introduction_talon_karrde_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Welcome back, %TU, do you have anything for me? - - //-- [RESPONSE NOTE] - //-- PLAYER: I have your token. - if (response == "s_50") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition_hasToken (player, npc)) - { - //-- NPC: Thank you very much, but someone already delivered several. But, I like a person that settles their debts in a timely manner, %TU. We both know you could have never come back. - string_id message = new string_id (c_stringFile, "s_51"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: That is how I do buisiness. - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_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_53"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 2); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: You trying to pull a fast one? Come back when you aren't playing games? - string_id message = new string_id (c_stringFile, "s_52"); - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Thank you very much, but someone already delivered several. But, I like a person that settles their debts in a timely manner, %TU. We both know you could have never come back. - - //-- [RESPONSE NOTE] - //-- PLAYER: That is how I do buisiness. - if (response == "s_53") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - doAnimationAction (player, "handshake_tandem"); - - gcw_introduction_talon_karrde_action_giveBadge (player, npc); - - //-- NPC: I'm impressed, %TU, and I'd like everyone in my organization to know were you and I stand. Please accept this. - string_id message = new string_id (c_stringFile, "s_54"); - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Looks like you lost that information I gave you. - - //-- [RESPONSE NOTE] - //-- PLAYER: Yeah - if (response == "s_43") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Refresh my memory. Were you going to help the Imperials or Rebels? - string_id message = new string_id (c_stringFile, "s_44"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Actually, I'm trying to stay neutral. - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Imeprial - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Alliance - boolean hasResponse2 = false; - if (gcw_introduction_talon_karrde_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_45"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_46"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_47"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Refresh my memory. Were you going to help the Imperials or Rebels? - - //-- [RESPONSE NOTE] - //-- PLAYER: Actually, I'm trying to stay neutral. - if (response == "s_45") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: You can still help out either of the factions for profit. I do it all the time. - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What do you mean? - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_28"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Imeprial - if (response == "s_46") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Are you sure? - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes. - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: I changed my mind. - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_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_36"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_37"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Alliance - if (response == "s_47") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Are you sure? - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: I changed my mind. - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_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_39"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_41"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yes? - - //-- [RESPONSE NOTE] - //-- PLAYER: I was hoping someone could tell me what is going on in Bestine. - if (response == "s_5") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: I see. Well, what do you have to trade for this information? - string_id message = new string_id (c_stringFile, "s_6"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I don't really have anything to trade. - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: I'll give you 2000 credits. - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_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_7"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_8"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I see. Well, what do you have to trade for this information? - - //-- [RESPONSE NOTE] - //-- PLAYER: I don't really have anything to trade. - if (response == "s_7") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: I'll make you a deal, you can owe me for the information. Sound good? - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Owe you? - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_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_11"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I'll give you 2000 credits. - if (response == "s_8") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Credits? Not interested. I'm more interested in other spoils. I'll make you a deal, you can owe me for the information. Sound good? - string_id message = new string_id (c_stringFile, "s_12"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Owe you? - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_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_11"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I'll make you a deal, you can owe me for the information. Sound good? - - //-- [RESPONSE NOTE] - //-- PLAYER: Owe you? - if (response == "s_11") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Here is the deal, you bring me back one of the tokens that the Empire or Alliance is using and I'll clear your debt. - string_id message = new string_id (c_stringFile, "s_13"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sounds too easy. - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_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_14"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Here is the deal, you bring me back one of the tokens that the Empire or Alliance is using and I'll clear your debt. - - //-- [RESPONSE NOTE] - //-- PLAYER: Sounds too easy. - if (response == "s_14") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: I assure you it is easy. The information I'm about to give you is a fair exchange for the work. - string_id message = new string_id (c_stringFile, "s_15"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Uh, okay. I'll do it. - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_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_16"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch11 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I assure you it is easy. The information I'm about to give you is a fair exchange for the work. - - //-- [RESPONSE NOTE] - //-- PLAYER: Uh, okay. I'll do it. - if (response == "s_16") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Good. Basically the Empire and Alliance are stepping up their conflict at specific locations throughout the Galaxy. - string_id message = new string_id (c_stringFile, "s_17"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Which planets? - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_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_18"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch12 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Good. Basically the Empire and Alliance are stepping up their conflict at specific locations throughout the Galaxy. - - //-- [RESPONSE NOTE] - //-- PLAYER: Which planets? - if (response == "s_18") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Well, Tatooine for one. Bestine is of strategic importance to the Empire. There has always been a strong influence here. - string_id message = new string_id (c_stringFile, "s_19"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: The other planets? - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_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_20"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch13 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Well, Tatooine for one. Bestine is of strategic importance to the Empire. There has always been a strong influence here. - - //-- [RESPONSE NOTE] - //-- PLAYER: The other planets? - if (response == "s_20") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Talus hasn't escaped the conflict. The city of Dearic has some military importance to the Alliance. Lastly, there is an ongoing conflict over Keren on Naboo, the Emperor's homeworld! - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I see. How do I get this token you need? - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_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_22"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch14 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Talus hasn't escaped the conflict. The city of Dearic has some military importance to the Alliance. Lastly, there is an ongoing conflict over Keren on Naboo, the Emperor's homeworld! - - //-- [RESPONSE NOTE] - //-- PLAYER: I see. How do I get this token you need? - if (response == "s_22") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: That depends on which side you will be supporting. - string_id message = new string_id (c_stringFile, "s_23"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm neutral in this conflict. - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Imperial - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Alliance - boolean hasResponse2 = false; - if (gcw_introduction_talon_karrde_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_24"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_25"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_26"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch15 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: That depends on which side you will be supporting. - - //-- [RESPONSE NOTE] - //-- PLAYER: I'm neutral in this conflict. - if (response == "s_24") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: You can still help out either of the factions for profit. I do it all the time. - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What do you mean? - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_28"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial - if (response == "s_25") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Are you sure? - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes. - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: I changed my mind. - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_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_36"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_37"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Alliance - if (response == "s_26") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Are you sure? - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: I changed my mind. - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_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_39"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_41"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch16 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You can still help out either of the factions for profit. I do it all the time. - - //-- [RESPONSE NOTE] - //-- PLAYER: What do you mean? - if (response == "s_28") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Tell them you want to be hired as a mercenary. It is basically all the pay with no obligation. Best kept secret in the Galaxy, apparently. - string_id message = new string_id (c_stringFile, "s_29"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Uh, alright. - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_30"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch17 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Tell them you want to be hired as a mercenary. It is basically all the pay with no obligation. Best kept secret in the Galaxy, apparently. - - //-- [RESPONSE NOTE] - //-- PLAYER: Uh, alright. - if (response == "s_30") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: So, what will it be? Imperial or Rebel? - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Imperial - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Alliance - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_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_32"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_33"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch18 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: So, what will it be? Imperial or Rebel? - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial - if (response == "s_32") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Are you sure? - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes. - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: I changed my mind. - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_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_36"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_37"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Alliance - if (response == "s_33") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Are you sure? - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: I changed my mind. - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_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_39"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_41"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch19 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Are you sure? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes. - if (response == "s_36") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Alright. I've put instructions in your datapad. - string_id message = new string_id (c_stringFile, "s_38"); - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I changed my mind. - if (response == "s_37") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: So, what will it be? Imperial or Rebel? - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Imperial - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Alliance - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_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_32"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_33"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch21 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Are you sure? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes - if (response == "s_39") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Alright. I've put instructions in your datapad. - string_id message = new string_id (c_stringFile, "s_40"); - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I changed my mind. - if (response == "s_41") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: So, what will it be? Imperial or Rebel? - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Imperial - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Alliance - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_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_32"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_33"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int gcw_introduction_talon_karrde_handleBranch23 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Credits? Not interested. I'm more interested in other spoils. I'll make you a deal, you can owe me for the information. Sound good? - - //-- [RESPONSE NOTE] - //-- PLAYER: Owe you? - if (response == "s_11") - { - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - //-- NPC: Here is the deal, you bring me back one of the tokens that the Empire or Alliance is using and I'll clear your debt. - string_id message = new string_id (c_stringFile, "s_13"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sounds too easy. - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_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_14"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.gcw_introduction_talon_karrde"); - - 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.gcw_introduction_talon_karrde"); - - 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 (gcw_introduction_talon_karrde_condition_hasToken (player, npc)) - { - doAnimationAction (npc, "nod"); - - //-- NPC: Welcome back, %TU, do you have anything for me? - string_id message = new string_id (c_stringFile, "s_49"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I have your token. - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_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.gcw_introduction_talon_karrde.branchId", 1); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "gcw_introduction_talon_karrde", 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 (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - doAnimationAction (player, "shake_head_disgust"); - - //-- NPC: Looks like you lost that information I gave you. - string_id message = new string_id (c_stringFile, "s_42"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yeah - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_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.gcw_introduction_talon_karrde.branchId", 5); - - npcStartConversation (player, npc, "gcw_introduction_talon_karrde", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (gcw_introduction_talon_karrde_condition_hasIntroTask (player, npc)) - { - doAnimationAction (npc, "nod"); - - //-- NPC: Yes? - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I was hoping someone could tell me what is going on in Bestine. - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_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_5"); - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 7); - - npcStartConversation (player, npc, "gcw_introduction_talon_karrde", 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 != "gcw_introduction_talon_karrde") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - if (branchId == 1 && gcw_introduction_talon_karrde_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && gcw_introduction_talon_karrde_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && gcw_introduction_talon_karrde_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && gcw_introduction_talon_karrde_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && gcw_introduction_talon_karrde_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && gcw_introduction_talon_karrde_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && gcw_introduction_talon_karrde_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && gcw_introduction_talon_karrde_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 11 && gcw_introduction_talon_karrde_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 12 && gcw_introduction_talon_karrde_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 13 && gcw_introduction_talon_karrde_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 14 && gcw_introduction_talon_karrde_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 15 && gcw_introduction_talon_karrde_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 16 && gcw_introduction_talon_karrde_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 17 && gcw_introduction_talon_karrde_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 18 && gcw_introduction_talon_karrde_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 19 && gcw_introduction_talon_karrde_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 21 && gcw_introduction_talon_karrde_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 23 && gcw_introduction_talon_karrde_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// gcw_introduction_talon_karrde.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/gcw_introduction_talon_karrde"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean gcw_introduction_talon_karrde_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean gcw_introduction_talon_karrde_condition_hasIntroTask (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "gcw_introduction_quest", "contactSmuggler"); +} + +// ---------------------------------------------------------------------- + +boolean gcw_introduction_talon_karrde_condition_completedIntroNotNextStep (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedQuest(player, "gcw_introduction_quest") + && !groundquests.hasCompletedQuest(player, "gcw_introduction_rebel_tatooine") + && !groundquests.hasCompletedQuest(player, "gcw_introduction_imperial_tatooine"); +} + +// ---------------------------------------------------------------------- + +boolean gcw_introduction_talon_karrde_condition_hasToken (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return true; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void gcw_introduction_talon_karrde_action_grantImperialQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); +} + +// ---------------------------------------------------------------------- + +void gcw_introduction_talon_karrde_action_grantRebelQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); +} + +// ---------------------------------------------------------------------- + +void gcw_introduction_talon_karrde_action_giveBadge (obj_id player, obj_id npc) +{ + faceTo(npc, player); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int gcw_introduction_talon_karrde_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Welcome back, %TU, do you have anything for me? + + //-- [RESPONSE NOTE] + //-- PLAYER: I have your token. + if (response == "s_50") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition_hasToken (player, npc)) + { + //-- NPC: Thank you very much, but someone already delivered several. But, I like a person that settles their debts in a timely manner, %TU. We both know you could have never come back. + string_id message = new string_id (c_stringFile, "s_51"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: That is how I do buisiness. + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_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_53"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 2); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcSpeak (player, pp); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: You trying to pull a fast one? Come back when you aren't playing games? + string_id message = new string_id (c_stringFile, "s_52"); + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Thank you very much, but someone already delivered several. But, I like a person that settles their debts in a timely manner, %TU. We both know you could have never come back. + + //-- [RESPONSE NOTE] + //-- PLAYER: That is how I do buisiness. + if (response == "s_53") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "handshake_tandem"); + + doAnimationAction (player, "handshake_tandem"); + + gcw_introduction_talon_karrde_action_giveBadge (player, npc); + + //-- NPC: I'm impressed, %TU, and I'd like everyone in my organization to know were you and I stand. Please accept this. + string_id message = new string_id (c_stringFile, "s_54"); + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Looks like you lost that information I gave you. + + //-- [RESPONSE NOTE] + //-- PLAYER: Yeah + if (response == "s_43") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Refresh my memory. Were you going to help the Imperials or Rebels? + string_id message = new string_id (c_stringFile, "s_44"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Actually, I'm trying to stay neutral. + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Imeprial + boolean hasResponse1 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Alliance + boolean hasResponse2 = false; + if (gcw_introduction_talon_karrde_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_45"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_46"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_47"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Refresh my memory. Were you going to help the Imperials or Rebels? + + //-- [RESPONSE NOTE] + //-- PLAYER: Actually, I'm trying to stay neutral. + if (response == "s_45") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: You can still help out either of the factions for profit. I do it all the time. + string_id message = new string_id (c_stringFile, "s_27"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What do you mean? + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_28"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Imeprial + if (response == "s_46") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Are you sure? + string_id message = new string_id (c_stringFile, "s_34"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes. + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: I changed my mind. + boolean hasResponse1 = false; + if (gcw_introduction_talon_karrde_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_36"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_37"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 19); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Alliance + if (response == "s_47") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Are you sure? + string_id message = new string_id (c_stringFile, "s_35"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: I changed my mind. + boolean hasResponse1 = false; + if (gcw_introduction_talon_karrde_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_39"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_41"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 21); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yes? + + //-- [RESPONSE NOTE] + //-- PLAYER: I was hoping someone could tell me what is going on in Bestine. + if (response == "s_5") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: I see. Well, what do you have to trade for this information? + string_id message = new string_id (c_stringFile, "s_6"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I don't really have anything to trade. + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: I'll give you 2000 credits. + boolean hasResponse1 = false; + if (gcw_introduction_talon_karrde_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_7"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_8"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I see. Well, what do you have to trade for this information? + + //-- [RESPONSE NOTE] + //-- PLAYER: I don't really have anything to trade. + if (response == "s_7") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: I'll make you a deal, you can owe me for the information. Sound good? + string_id message = new string_id (c_stringFile, "s_10"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Owe you? + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_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_11"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I'll give you 2000 credits. + if (response == "s_8") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Credits? Not interested. I'm more interested in other spoils. I'll make you a deal, you can owe me for the information. Sound good? + string_id message = new string_id (c_stringFile, "s_12"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Owe you? + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_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_11"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I'll make you a deal, you can owe me for the information. Sound good? + + //-- [RESPONSE NOTE] + //-- PLAYER: Owe you? + if (response == "s_11") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Here is the deal, you bring me back one of the tokens that the Empire or Alliance is using and I'll clear your debt. + string_id message = new string_id (c_stringFile, "s_13"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sounds too easy. + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_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_14"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Here is the deal, you bring me back one of the tokens that the Empire or Alliance is using and I'll clear your debt. + + //-- [RESPONSE NOTE] + //-- PLAYER: Sounds too easy. + if (response == "s_14") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: I assure you it is easy. The information I'm about to give you is a fair exchange for the work. + string_id message = new string_id (c_stringFile, "s_15"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Uh, okay. I'll do it. + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_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_16"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 11); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch11 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I assure you it is easy. The information I'm about to give you is a fair exchange for the work. + + //-- [RESPONSE NOTE] + //-- PLAYER: Uh, okay. I'll do it. + if (response == "s_16") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Good. Basically the Empire and Alliance are stepping up their conflict at specific locations throughout the Galaxy. + string_id message = new string_id (c_stringFile, "s_17"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Which planets? + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_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_18"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 12); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch12 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Good. Basically the Empire and Alliance are stepping up their conflict at specific locations throughout the Galaxy. + + //-- [RESPONSE NOTE] + //-- PLAYER: Which planets? + if (response == "s_18") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Well, Tatooine for one. Bestine is of strategic importance to the Empire. There has always been a strong influence here. + string_id message = new string_id (c_stringFile, "s_19"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: The other planets? + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_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_20"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 13); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch13 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Well, Tatooine for one. Bestine is of strategic importance to the Empire. There has always been a strong influence here. + + //-- [RESPONSE NOTE] + //-- PLAYER: The other planets? + if (response == "s_20") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Talus hasn't escaped the conflict. The city of Dearic has some military importance to the Alliance. Lastly, there is an ongoing conflict over Keren on Naboo, the Emperor's homeworld! + string_id message = new string_id (c_stringFile, "s_21"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I see. How do I get this token you need? + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_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_22"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 14); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch14 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Talus hasn't escaped the conflict. The city of Dearic has some military importance to the Alliance. Lastly, there is an ongoing conflict over Keren on Naboo, the Emperor's homeworld! + + //-- [RESPONSE NOTE] + //-- PLAYER: I see. How do I get this token you need? + if (response == "s_22") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: That depends on which side you will be supporting. + string_id message = new string_id (c_stringFile, "s_23"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm neutral in this conflict. + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Imperial + boolean hasResponse1 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Alliance + boolean hasResponse2 = false; + if (gcw_introduction_talon_karrde_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_24"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_25"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_26"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 15); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch15 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: That depends on which side you will be supporting. + + //-- [RESPONSE NOTE] + //-- PLAYER: I'm neutral in this conflict. + if (response == "s_24") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: You can still help out either of the factions for profit. I do it all the time. + string_id message = new string_id (c_stringFile, "s_27"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What do you mean? + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_28"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial + if (response == "s_25") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Are you sure? + string_id message = new string_id (c_stringFile, "s_34"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes. + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: I changed my mind. + boolean hasResponse1 = false; + if (gcw_introduction_talon_karrde_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_36"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_37"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 19); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Alliance + if (response == "s_26") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Are you sure? + string_id message = new string_id (c_stringFile, "s_35"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: I changed my mind. + boolean hasResponse1 = false; + if (gcw_introduction_talon_karrde_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_39"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_41"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 21); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch16 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You can still help out either of the factions for profit. I do it all the time. + + //-- [RESPONSE NOTE] + //-- PLAYER: What do you mean? + if (response == "s_28") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Tell them you want to be hired as a mercenary. It is basically all the pay with no obligation. Best kept secret in the Galaxy, apparently. + string_id message = new string_id (c_stringFile, "s_29"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Uh, alright. + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_30"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 17); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch17 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Tell them you want to be hired as a mercenary. It is basically all the pay with no obligation. Best kept secret in the Galaxy, apparently. + + //-- [RESPONSE NOTE] + //-- PLAYER: Uh, alright. + if (response == "s_30") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: So, what will it be? Imperial or Rebel? + string_id message = new string_id (c_stringFile, "s_31"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Imperial + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Alliance + boolean hasResponse1 = false; + if (gcw_introduction_talon_karrde_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_32"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_33"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 18); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch18 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: So, what will it be? Imperial or Rebel? + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial + if (response == "s_32") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Are you sure? + string_id message = new string_id (c_stringFile, "s_34"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes. + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: I changed my mind. + boolean hasResponse1 = false; + if (gcw_introduction_talon_karrde_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_36"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_37"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 19); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Alliance + if (response == "s_33") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Are you sure? + string_id message = new string_id (c_stringFile, "s_35"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: I changed my mind. + boolean hasResponse1 = false; + if (gcw_introduction_talon_karrde_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_39"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_41"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 21); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch19 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Are you sure? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes. + if (response == "s_36") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Alright. I've put instructions in your datapad. + string_id message = new string_id (c_stringFile, "s_38"); + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I changed my mind. + if (response == "s_37") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: So, what will it be? Imperial or Rebel? + string_id message = new string_id (c_stringFile, "s_31"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Imperial + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Alliance + boolean hasResponse1 = false; + if (gcw_introduction_talon_karrde_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_32"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_33"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 18); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch21 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Are you sure? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes + if (response == "s_39") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Alright. I've put instructions in your datapad. + string_id message = new string_id (c_stringFile, "s_40"); + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I changed my mind. + if (response == "s_41") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: So, what will it be? Imperial or Rebel? + string_id message = new string_id (c_stringFile, "s_31"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Imperial + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Alliance + boolean hasResponse1 = false; + if (gcw_introduction_talon_karrde_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_32"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_33"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 18); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int gcw_introduction_talon_karrde_handleBranch23 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Credits? Not interested. I'm more interested in other spoils. I'll make you a deal, you can owe me for the information. Sound good? + + //-- [RESPONSE NOTE] + //-- PLAYER: Owe you? + if (response == "s_11") + { + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + //-- NPC: Here is the deal, you bring me back one of the tokens that the Empire or Alliance is using and I'll clear your debt. + string_id message = new string_id (c_stringFile, "s_13"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sounds too easy. + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_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_14"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.gcw_introduction_talon_karrde"); + + 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.gcw_introduction_talon_karrde"); + + 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 (gcw_introduction_talon_karrde_condition_hasToken (player, npc)) + { + doAnimationAction (npc, "nod"); + + //-- NPC: Welcome back, %TU, do you have anything for me? + string_id message = new string_id (c_stringFile, "s_49"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I have your token. + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_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.gcw_introduction_talon_karrde.branchId", 1); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "gcw_introduction_talon_karrde", 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 (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) + { + doAnimationAction (player, "shake_head_disgust"); + + //-- NPC: Looks like you lost that information I gave you. + string_id message = new string_id (c_stringFile, "s_42"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yeah + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_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.gcw_introduction_talon_karrde.branchId", 5); + + npcStartConversation (player, npc, "gcw_introduction_talon_karrde", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (gcw_introduction_talon_karrde_condition_hasIntroTask (player, npc)) + { + doAnimationAction (npc, "nod"); + + //-- NPC: Yes? + string_id message = new string_id (c_stringFile, "s_4"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I was hoping someone could tell me what is going on in Bestine. + boolean hasResponse0 = false; + if (gcw_introduction_talon_karrde_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_5"); + + utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 7); + + npcStartConversation (player, npc, "gcw_introduction_talon_karrde", 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 != "gcw_introduction_talon_karrde") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + if (branchId == 1 && gcw_introduction_talon_karrde_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && gcw_introduction_talon_karrde_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && gcw_introduction_talon_karrde_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && gcw_introduction_talon_karrde_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && gcw_introduction_talon_karrde_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && gcw_introduction_talon_karrde_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && gcw_introduction_talon_karrde_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && gcw_introduction_talon_karrde_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 11 && gcw_introduction_talon_karrde_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 12 && gcw_introduction_talon_karrde_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 13 && gcw_introduction_talon_karrde_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 14 && gcw_introduction_talon_karrde_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 15 && gcw_introduction_talon_karrde_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 16 && gcw_introduction_talon_karrde_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 17 && gcw_introduction_talon_karrde_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 18 && gcw_introduction_talon_karrde_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 19 && gcw_introduction_talon_karrde_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 21 && gcw_introduction_talon_karrde_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 23 && gcw_introduction_talon_karrde_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/hacker_lok_pirate_cave.script b/sku.0/sys.server/compiled/game/script/conversation/hacker_lok_pirate_cave.script index 7897b2ba7..40ec0d57a 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/hacker_lok_pirate_cave.script +++ b/sku.0/sys.server/compiled/game/script/conversation/hacker_lok_pirate_cave.script @@ -1,3561 +1,3561 @@ -// ====================================================================== -// -// hacker_lok_pirate_cave.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/hacker_lok_pirate_cave"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean hacker_lok_pirate_cave_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean hacker_lok_pirate_cave_condition_hasCompletedPirate (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout"); -} - -// ---------------------------------------------------------------------- - -boolean hacker_lok_pirate_cave_condition_hasHackTask (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "findSecuritySystem") - || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "helpSliceSecurity"); -} - -// ---------------------------------------------------------------------- - -boolean hacker_lok_pirate_cave_condition_hasReturnTask (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "returnPirateComplete"); -} - -// ---------------------------------------------------------------------- - -boolean hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "colorWheel"); -} - -// ---------------------------------------------------------------------- - -boolean hacker_lok_pirate_cave_condition_hasJokeTaskActive (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "joke"); -} - -// ---------------------------------------------------------------------- - -boolean hacker_lok_pirate_cave_condition_hasNumberTaskActive (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "number"); -} - -// ---------------------------------------------------------------------- - -boolean hacker_lok_pirate_cave_condition_hasSlicedTheSystem (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "findDroidDisk"); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void hacker_lok_pirate_cave_action_colorWheelDone (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "colorWheelDone"); -} - -// ---------------------------------------------------------------------- - -void hacker_lok_pirate_cave_action_foundSecuritySys (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundSecuritySystem"); -} - -// ---------------------------------------------------------------------- - -void hacker_lok_pirate_cave_action_numbersDone (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "numberDone"); -} - -// ---------------------------------------------------------------------- - -void hacker_lok_pirate_cave_action_jokeDone (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "jokeDone"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int hacker_lok_pirate_cave_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Aargh! Can you help me with this thing? I've found a back door to this security system, but the AI program keeps asking me these stupid questions! Can you lend me your brain? - - //-- [RESPONSE NOTE] - //-- PLAYER: What are you talking about? - if (response == "s_56") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: I'm trying to slice through the pirates' security system. The system itself is really basic, but the final safeguard includes three questions that I need to answer. The questions don't have anything to do with the pirates or computers. I'm totally lost. - string_id message = new string_id (c_stringFile, "s_58"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Tell me what you need. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_59"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Tell me what you need. - if (response == "s_57") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: I can't answer these riddles. Who built this thing? Can you help me answer these questions? - string_id message = new string_id (c_stringFile, "s_60"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sure. What are the questions? - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_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.hacker_lok_pirate_cave.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hacker_lok_pirate_cave_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I'm trying to slice through the pirates' security system. The system itself is really basic, but the final safeguard includes three questions that I need to answer. The questions don't have anything to do with the pirates or computers. I'm totally lost. - - //-- [RESPONSE NOTE] - //-- PLAYER: Tell me what you need. - if (response == "s_59") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: I can't answer these riddles. Who built this thing? Can you help me answer these questions? - string_id message = new string_id (c_stringFile, "s_60"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sure. What are the questions? - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_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.hacker_lok_pirate_cave.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hacker_lok_pirate_cave_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I can't answer these riddles. Who built this thing? Can you help me answer these questions? - - //-- [RESPONSE NOTE] - //-- PLAYER: Sure. What are the questions? - if (response == "s_82") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: Great. I need to reroute the access commands, reset the security network, and break the defender chip. But I have to answer one question before I can complete each task. I can give you the questions in any order. - string_id message = new string_id (c_stringFile, "s_109"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Let's do the network reset. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Let's reroute the access commands. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Let's deal with the defender chip. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: See if the security system grants access now. - boolean hasResponse3 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_112"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_113"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_114"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_115"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hacker_lok_pirate_cave_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Great. I need to reroute the access commands, reset the security network, and break the defender chip. But I have to answer one question before I can complete each task. I can give you the questions in any order. - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's do the network reset. - if (response == "s_112") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm pretty sure it's purple. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: It's brown! Hah! I knew that one. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's orange. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_117"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_118"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_119"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's reroute the access commands. - if (response == "s_113") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: It's multiplying. 720. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Uh...220. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's nine. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_124"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_125"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_126"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's deal with the defender chip. - if (response == "s_114") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: What do you call a womprat that can lift a bantha? - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sir! - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: To get to the other side! - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: No such thing? - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_133"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_134"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_135"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: See if the security system grants access now. - if (response == "s_115") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: That did it! It's open! The droid is inside the room. - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hacker_lok_pirate_cave_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? - - //-- [RESPONSE NOTE] - //-- PLAYER: I'm pretty sure it's purple. - if (response == "s_117") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: Apparently that wasn't it... - string_id message = new string_id (c_stringFile, "s_120"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Let's do the network reset. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Let's reroute the access commands. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Let's deal with the defender chip. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: See if the security system grants access now. - boolean hasResponse3 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_112"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_113"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_114"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_115"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: It's brown! Hah! I knew that one. - if (response == "s_118") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: Apparently that wasn't it... - string_id message = new string_id (c_stringFile, "s_121"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Let's do the network reset. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Let's reroute the access commands. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Let's deal with the defender chip. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: See if the security system grants access now. - boolean hasResponse3 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_112"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_113"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_114"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_115"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: It's orange. I'm sure of it. - if (response == "s_119") - { - hacker_lok_pirate_cave_action_colorWheelDone (player, npc); - - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: Great! You must have studied art or something. I'd have never gotten that. Now what? - string_id message = new string_id (c_stringFile, "s_122"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Let's reroute the access commands. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Let's deal with the defender chip. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: See if the security system grants access now. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (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_141"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_142"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_149"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hacker_lok_pirate_cave_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Apparently that wasn't it... - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's do the network reset. - if (response == "s_112") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm pretty sure it's purple. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: It's brown! Hah! I knew that one. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's orange. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_117"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_118"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_119"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's reroute the access commands. - if (response == "s_113") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: It's multiplying. 720. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Uh...220. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's nine. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_124"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_125"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_126"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's deal with the defender chip. - if (response == "s_114") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: What do you call a womprat that can lift a bantha? - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sir! - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: To get to the other side! - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: No such thing? - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_133"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_134"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_135"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: See if the security system grants access now. - if (response == "s_115") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: That did it! It's open! The droid is inside the room. - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hacker_lok_pirate_cave_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Apparently that wasn't it... - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's do the network reset. - if (response == "s_112") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm pretty sure it's purple. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: It's brown! Hah! I knew that one. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's orange. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_117"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_118"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_119"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's reroute the access commands. - if (response == "s_113") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: It's multiplying. 720. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Uh...220. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's nine. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_124"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_125"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_126"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's deal with the defender chip. - if (response == "s_114") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: What do you call a womprat that can lift a bantha? - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sir! - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: To get to the other side! - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: No such thing? - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_133"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_134"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_135"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: See if the security system grants access now. - if (response == "s_115") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: That did it! It's open! The droid is inside the room. - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hacker_lok_pirate_cave_handleBranch11 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Great! You must have studied art or something. I'd have never gotten that. Now what? - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's reroute the access commands. - if (response == "s_141") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: It's multiplying. 720. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Uh...220. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's nine. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_124"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_125"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_126"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's deal with the defender chip. - if (response == "s_142") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: What do you call a womprat that can lift a bantha? - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sir! - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: To get to the other side! - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: No such thing? - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_133"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_134"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_135"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: See if the security system grants access now. - if (response == "s_149") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: That did it! It's open! The droid is inside the room. - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hacker_lok_pirate_cave_handleBranch12 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' - - //-- [RESPONSE NOTE] - //-- PLAYER: It's multiplying. 720. - if (response == "s_124") - { - hacker_lok_pirate_cave_action_numbersDone (player, npc); - - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: That's it! Good thing you know your math. All right, what now? - string_id message = new string_id (c_stringFile, "s_127"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Let's do the network reset. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Let's deal with the defender chip. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: See if the security system grants access now. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (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_143"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_144"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_148"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Uh...220. - if (response == "s_125") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: Apparently that wasn't it... - string_id message = new string_id (c_stringFile, "s_128"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Let's do the network reset. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Let's reroute the access commands. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Let's deal with the defender chip. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: See if the security system grants access now. - boolean hasResponse3 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_112"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_113"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_114"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_115"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: It's nine. I'm sure of it. - if (response == "s_126") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: Apparently that wasn't it... - string_id message = new string_id (c_stringFile, "s_129"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Let's do the network reset. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Let's reroute the access commands. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Let's deal with the defender chip. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: See if the security system grants access now. - boolean hasResponse3 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_112"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_113"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_114"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_115"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hacker_lok_pirate_cave_handleBranch13 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: That's it! Good thing you know your math. All right, what now? - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's do the network reset. - if (response == "s_143") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm pretty sure it's purple. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: It's brown! Hah! I knew that one. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's orange. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_117"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_118"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_119"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's deal with the defender chip. - if (response == "s_144") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: What do you call a womprat that can lift a bantha? - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sir! - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: To get to the other side! - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: No such thing? - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_133"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_134"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_135"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: See if the security system grants access now. - if (response == "s_148") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: That did it! It's open! The droid is inside the room. - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hacker_lok_pirate_cave_handleBranch14 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Apparently that wasn't it... - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's do the network reset. - if (response == "s_112") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm pretty sure it's purple. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: It's brown! Hah! I knew that one. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's orange. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_117"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_118"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_119"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's reroute the access commands. - if (response == "s_113") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: It's multiplying. 720. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Uh...220. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's nine. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_124"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_125"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_126"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's deal with the defender chip. - if (response == "s_114") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: What do you call a womprat that can lift a bantha? - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sir! - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: To get to the other side! - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: No such thing? - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_133"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_134"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_135"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: See if the security system grants access now. - if (response == "s_115") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: That did it! It's open! The droid is inside the room. - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hacker_lok_pirate_cave_handleBranch15 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Apparently that wasn't it... - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's do the network reset. - if (response == "s_112") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm pretty sure it's purple. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: It's brown! Hah! I knew that one. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's orange. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_117"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_118"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_119"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's reroute the access commands. - if (response == "s_113") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: It's multiplying. 720. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Uh...220. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's nine. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_124"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_125"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_126"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's deal with the defender chip. - if (response == "s_114") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: What do you call a womprat that can lift a bantha? - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sir! - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: To get to the other side! - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: No such thing? - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_133"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_134"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_135"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: See if the security system grants access now. - if (response == "s_115") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: That did it! It's open! The droid is inside the room. - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hacker_lok_pirate_cave_handleBranch16 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: What do you call a womprat that can lift a bantha? - - //-- [RESPONSE NOTE] - //-- PLAYER: Sir! - if (response == "s_133") - { - hacker_lok_pirate_cave_action_jokeDone (player, npc); - - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: Ugh...that's terrible. What kind of...never mind. What is next? - string_id message = new string_id (c_stringFile, "s_136"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Let's do the network reset. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Let's reroute the access commands. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: See if the security system grants access now. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (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_145"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_146"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_147"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: To get to the other side! - if (response == "s_134") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: That's not even funny! - string_id message = new string_id (c_stringFile, "s_137"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Let's do the network reset. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Let's reroute the access commands. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Let's deal with the defender chip. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: See if the security system grants access now. - boolean hasResponse3 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_112"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_113"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_114"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_115"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: No such thing? - if (response == "s_135") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: That's not even funny! - string_id message = new string_id (c_stringFile, "s_138"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Let's do the network reset. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Let's reroute the access commands. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Let's deal with the defender chip. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: See if the security system grants access now. - boolean hasResponse3 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_112"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_113"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_114"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_115"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hacker_lok_pirate_cave_handleBranch17 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Ugh...that's terrible. What kind of...never mind. What is next? - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's do the network reset. - if (response == "s_145") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm pretty sure it's purple. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: It's brown! Hah! I knew that one. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's orange. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_117"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_118"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_119"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's reroute the access commands. - if (response == "s_146") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: It's multiplying. 720. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Uh...220. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's nine. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_124"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_125"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_126"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: See if the security system grants access now. - if (response == "s_147") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: That did it! It's open! The droid is inside the room. - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hacker_lok_pirate_cave_handleBranch18 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: That's not even funny! - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's do the network reset. - if (response == "s_112") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm pretty sure it's purple. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: It's brown! Hah! I knew that one. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's orange. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_117"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_118"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_119"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's reroute the access commands. - if (response == "s_113") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: It's multiplying. 720. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Uh...220. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's nine. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_124"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_125"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_126"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's deal with the defender chip. - if (response == "s_114") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: What do you call a womprat that can lift a bantha? - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sir! - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: To get to the other side! - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: No such thing? - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_133"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_134"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_135"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: See if the security system grants access now. - if (response == "s_115") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: That did it! It's open! The droid is inside the room. - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hacker_lok_pirate_cave_handleBranch19 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: That's not even funny! - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's do the network reset. - if (response == "s_112") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm pretty sure it's purple. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: It's brown! Hah! I knew that one. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's orange. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_117"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_118"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_119"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's reroute the access commands. - if (response == "s_113") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: It's multiplying. 720. - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Uh...220. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: It's nine. I'm sure of it. - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_124"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_125"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_126"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let's deal with the defender chip. - if (response == "s_114") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: What do you call a womprat that can lift a bantha? - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sir! - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: To get to the other side! - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: No such thing? - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_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_133"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_134"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_135"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: See if the security system grants access now. - if (response == "s_115") - { - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: That did it! It's open! The droid is inside the room. - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.hacker_lok_pirate_cave"); - - 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.hacker_lok_pirate_cave"); - - 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 (hacker_lok_pirate_cave_condition_hasCompletedPirate (player, npc)) - { - //-- NPC: I think we are done here. Just don't blow my cover with the pirates. - string_id message = new string_id (c_stringFile, "s_54"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hacker_lok_pirate_cave_condition_hasReturnTask (player, npc)) - { - //-- NPC: Tell Vana everything is going as planned, thanks to you. See you topside. - string_id message = new string_id (c_stringFile, "s_53"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - //-- NPC: You did it. I'm glad Vana sent you. You'll find the droid inside the room. - string_id message = new string_id (c_stringFile, "s_52"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hacker_lok_pirate_cave_condition_hasHackTask (player, npc)) - { - hacker_lok_pirate_cave_action_foundSecuritySys (player, npc); - - //-- NPC: Aargh! Can you help me with this thing? I've found a back door to this security system, but the AI program keeps asking me these stupid questions! Can you lend me your brain? - string_id message = new string_id (c_stringFile, "s_55"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What are you talking about? - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Tell me what you need. - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_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_56"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_57"); - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 4); - - npcStartConversation (player, npc, "hacker_lok_pirate_cave", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - //-- NPC: You seem lost. Go somewhere else. - string_id message = new string_id (c_stringFile, "s_61"); - 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 != "hacker_lok_pirate_cave") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - if (branchId == 4 && hacker_lok_pirate_cave_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && hacker_lok_pirate_cave_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && hacker_lok_pirate_cave_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && hacker_lok_pirate_cave_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && hacker_lok_pirate_cave_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && hacker_lok_pirate_cave_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && hacker_lok_pirate_cave_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 11 && hacker_lok_pirate_cave_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 12 && hacker_lok_pirate_cave_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 13 && hacker_lok_pirate_cave_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 14 && hacker_lok_pirate_cave_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 15 && hacker_lok_pirate_cave_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 16 && hacker_lok_pirate_cave_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 17 && hacker_lok_pirate_cave_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 18 && hacker_lok_pirate_cave_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 19 && hacker_lok_pirate_cave_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// hacker_lok_pirate_cave.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/hacker_lok_pirate_cave"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean hacker_lok_pirate_cave_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean hacker_lok_pirate_cave_condition_hasCompletedPirate (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout"); +} + +// ---------------------------------------------------------------------- + +boolean hacker_lok_pirate_cave_condition_hasHackTask (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "findSecuritySystem") + || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "helpSliceSecurity"); +} + +// ---------------------------------------------------------------------- + +boolean hacker_lok_pirate_cave_condition_hasReturnTask (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "returnPirateComplete"); +} + +// ---------------------------------------------------------------------- + +boolean hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "colorWheel"); +} + +// ---------------------------------------------------------------------- + +boolean hacker_lok_pirate_cave_condition_hasJokeTaskActive (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "joke"); +} + +// ---------------------------------------------------------------------- + +boolean hacker_lok_pirate_cave_condition_hasNumberTaskActive (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "number"); +} + +// ---------------------------------------------------------------------- + +boolean hacker_lok_pirate_cave_condition_hasSlicedTheSystem (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "findDroidDisk"); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void hacker_lok_pirate_cave_action_colorWheelDone (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "colorWheelDone"); +} + +// ---------------------------------------------------------------------- + +void hacker_lok_pirate_cave_action_foundSecuritySys (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundSecuritySystem"); +} + +// ---------------------------------------------------------------------- + +void hacker_lok_pirate_cave_action_numbersDone (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "numberDone"); +} + +// ---------------------------------------------------------------------- + +void hacker_lok_pirate_cave_action_jokeDone (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "jokeDone"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int hacker_lok_pirate_cave_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Aargh! Can you help me with this thing? I've found a back door to this security system, but the AI program keeps asking me these stupid questions! Can you lend me your brain? + + //-- [RESPONSE NOTE] + //-- PLAYER: What are you talking about? + if (response == "s_56") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: I'm trying to slice through the pirates' security system. The system itself is really basic, but the final safeguard includes three questions that I need to answer. The questions don't have anything to do with the pirates or computers. I'm totally lost. + string_id message = new string_id (c_stringFile, "s_58"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Tell me what you need. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_59"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Tell me what you need. + if (response == "s_57") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: I can't answer these riddles. Who built this thing? Can you help me answer these questions? + string_id message = new string_id (c_stringFile, "s_60"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sure. What are the questions? + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_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.hacker_lok_pirate_cave.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hacker_lok_pirate_cave_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I'm trying to slice through the pirates' security system. The system itself is really basic, but the final safeguard includes three questions that I need to answer. The questions don't have anything to do with the pirates or computers. I'm totally lost. + + //-- [RESPONSE NOTE] + //-- PLAYER: Tell me what you need. + if (response == "s_59") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: I can't answer these riddles. Who built this thing? Can you help me answer these questions? + string_id message = new string_id (c_stringFile, "s_60"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sure. What are the questions? + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_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.hacker_lok_pirate_cave.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hacker_lok_pirate_cave_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I can't answer these riddles. Who built this thing? Can you help me answer these questions? + + //-- [RESPONSE NOTE] + //-- PLAYER: Sure. What are the questions? + if (response == "s_82") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: Great. I need to reroute the access commands, reset the security network, and break the defender chip. But I have to answer one question before I can complete each task. I can give you the questions in any order. + string_id message = new string_id (c_stringFile, "s_109"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Let's do the network reset. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Let's reroute the access commands. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Let's deal with the defender chip. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: See if the security system grants access now. + boolean hasResponse3 = false; + if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_112"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_113"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_114"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_115"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hacker_lok_pirate_cave_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Great. I need to reroute the access commands, reset the security network, and break the defender chip. But I have to answer one question before I can complete each task. I can give you the questions in any order. + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's do the network reset. + if (response == "s_112") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? + string_id message = new string_id (c_stringFile, "s_116"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm pretty sure it's purple. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: It's brown! Hah! I knew that one. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's orange. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_117"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_118"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_119"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's reroute the access commands. + if (response == "s_113") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' + string_id message = new string_id (c_stringFile, "s_123"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: It's multiplying. 720. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Uh...220. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's nine. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_124"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_125"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_126"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's deal with the defender chip. + if (response == "s_114") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: What do you call a womprat that can lift a bantha? + string_id message = new string_id (c_stringFile, "s_130"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sir! + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: To get to the other side! + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: No such thing? + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_133"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_134"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_135"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: See if the security system grants access now. + if (response == "s_115") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: That did it! It's open! The droid is inside the room. + string_id message = new string_id (c_stringFile, "s_139"); + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hacker_lok_pirate_cave_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? + + //-- [RESPONSE NOTE] + //-- PLAYER: I'm pretty sure it's purple. + if (response == "s_117") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: Apparently that wasn't it... + string_id message = new string_id (c_stringFile, "s_120"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Let's do the network reset. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Let's reroute the access commands. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Let's deal with the defender chip. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: See if the security system grants access now. + boolean hasResponse3 = false; + if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_112"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_113"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_114"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_115"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: It's brown! Hah! I knew that one. + if (response == "s_118") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: Apparently that wasn't it... + string_id message = new string_id (c_stringFile, "s_121"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Let's do the network reset. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Let's reroute the access commands. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Let's deal with the defender chip. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: See if the security system grants access now. + boolean hasResponse3 = false; + if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_112"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_113"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_114"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_115"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: It's orange. I'm sure of it. + if (response == "s_119") + { + hacker_lok_pirate_cave_action_colorWheelDone (player, npc); + + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: Great! You must have studied art or something. I'd have never gotten that. Now what? + string_id message = new string_id (c_stringFile, "s_122"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Let's reroute the access commands. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Let's deal with the defender chip. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: See if the security system grants access now. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (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_141"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_142"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_149"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 11); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hacker_lok_pirate_cave_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Apparently that wasn't it... + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's do the network reset. + if (response == "s_112") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? + string_id message = new string_id (c_stringFile, "s_116"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm pretty sure it's purple. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: It's brown! Hah! I knew that one. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's orange. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_117"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_118"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_119"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's reroute the access commands. + if (response == "s_113") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' + string_id message = new string_id (c_stringFile, "s_123"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: It's multiplying. 720. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Uh...220. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's nine. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_124"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_125"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_126"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's deal with the defender chip. + if (response == "s_114") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: What do you call a womprat that can lift a bantha? + string_id message = new string_id (c_stringFile, "s_130"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sir! + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: To get to the other side! + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: No such thing? + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_133"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_134"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_135"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: See if the security system grants access now. + if (response == "s_115") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: That did it! It's open! The droid is inside the room. + string_id message = new string_id (c_stringFile, "s_139"); + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hacker_lok_pirate_cave_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Apparently that wasn't it... + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's do the network reset. + if (response == "s_112") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? + string_id message = new string_id (c_stringFile, "s_116"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm pretty sure it's purple. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: It's brown! Hah! I knew that one. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's orange. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_117"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_118"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_119"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's reroute the access commands. + if (response == "s_113") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' + string_id message = new string_id (c_stringFile, "s_123"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: It's multiplying. 720. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Uh...220. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's nine. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_124"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_125"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_126"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's deal with the defender chip. + if (response == "s_114") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: What do you call a womprat that can lift a bantha? + string_id message = new string_id (c_stringFile, "s_130"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sir! + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: To get to the other side! + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: No such thing? + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_133"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_134"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_135"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: See if the security system grants access now. + if (response == "s_115") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: That did it! It's open! The droid is inside the room. + string_id message = new string_id (c_stringFile, "s_139"); + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hacker_lok_pirate_cave_handleBranch11 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Great! You must have studied art or something. I'd have never gotten that. Now what? + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's reroute the access commands. + if (response == "s_141") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' + string_id message = new string_id (c_stringFile, "s_123"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: It's multiplying. 720. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Uh...220. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's nine. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_124"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_125"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_126"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's deal with the defender chip. + if (response == "s_142") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: What do you call a womprat that can lift a bantha? + string_id message = new string_id (c_stringFile, "s_130"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sir! + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: To get to the other side! + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: No such thing? + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_133"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_134"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_135"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: See if the security system grants access now. + if (response == "s_149") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: That did it! It's open! The droid is inside the room. + string_id message = new string_id (c_stringFile, "s_139"); + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hacker_lok_pirate_cave_handleBranch12 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' + + //-- [RESPONSE NOTE] + //-- PLAYER: It's multiplying. 720. + if (response == "s_124") + { + hacker_lok_pirate_cave_action_numbersDone (player, npc); + + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: That's it! Good thing you know your math. All right, what now? + string_id message = new string_id (c_stringFile, "s_127"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Let's do the network reset. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Let's deal with the defender chip. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: See if the security system grants access now. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (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_143"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_144"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_148"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 13); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Uh...220. + if (response == "s_125") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: Apparently that wasn't it... + string_id message = new string_id (c_stringFile, "s_128"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Let's do the network reset. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Let's reroute the access commands. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Let's deal with the defender chip. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: See if the security system grants access now. + boolean hasResponse3 = false; + if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_112"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_113"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_114"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_115"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: It's nine. I'm sure of it. + if (response == "s_126") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: Apparently that wasn't it... + string_id message = new string_id (c_stringFile, "s_129"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Let's do the network reset. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Let's reroute the access commands. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Let's deal with the defender chip. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: See if the security system grants access now. + boolean hasResponse3 = false; + if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_112"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_113"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_114"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_115"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hacker_lok_pirate_cave_handleBranch13 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: That's it! Good thing you know your math. All right, what now? + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's do the network reset. + if (response == "s_143") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? + string_id message = new string_id (c_stringFile, "s_116"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm pretty sure it's purple. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: It's brown! Hah! I knew that one. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's orange. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_117"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_118"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_119"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's deal with the defender chip. + if (response == "s_144") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: What do you call a womprat that can lift a bantha? + string_id message = new string_id (c_stringFile, "s_130"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sir! + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: To get to the other side! + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: No such thing? + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_133"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_134"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_135"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: See if the security system grants access now. + if (response == "s_148") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: That did it! It's open! The droid is inside the room. + string_id message = new string_id (c_stringFile, "s_139"); + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hacker_lok_pirate_cave_handleBranch14 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Apparently that wasn't it... + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's do the network reset. + if (response == "s_112") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? + string_id message = new string_id (c_stringFile, "s_116"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm pretty sure it's purple. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: It's brown! Hah! I knew that one. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's orange. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_117"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_118"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_119"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's reroute the access commands. + if (response == "s_113") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' + string_id message = new string_id (c_stringFile, "s_123"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: It's multiplying. 720. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Uh...220. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's nine. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_124"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_125"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_126"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's deal with the defender chip. + if (response == "s_114") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: What do you call a womprat that can lift a bantha? + string_id message = new string_id (c_stringFile, "s_130"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sir! + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: To get to the other side! + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: No such thing? + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_133"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_134"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_135"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: See if the security system grants access now. + if (response == "s_115") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: That did it! It's open! The droid is inside the room. + string_id message = new string_id (c_stringFile, "s_139"); + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hacker_lok_pirate_cave_handleBranch15 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Apparently that wasn't it... + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's do the network reset. + if (response == "s_112") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? + string_id message = new string_id (c_stringFile, "s_116"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm pretty sure it's purple. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: It's brown! Hah! I knew that one. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's orange. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_117"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_118"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_119"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's reroute the access commands. + if (response == "s_113") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' + string_id message = new string_id (c_stringFile, "s_123"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: It's multiplying. 720. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Uh...220. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's nine. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_124"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_125"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_126"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's deal with the defender chip. + if (response == "s_114") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: What do you call a womprat that can lift a bantha? + string_id message = new string_id (c_stringFile, "s_130"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sir! + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: To get to the other side! + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: No such thing? + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_133"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_134"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_135"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: See if the security system grants access now. + if (response == "s_115") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: That did it! It's open! The droid is inside the room. + string_id message = new string_id (c_stringFile, "s_139"); + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hacker_lok_pirate_cave_handleBranch16 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: What do you call a womprat that can lift a bantha? + + //-- [RESPONSE NOTE] + //-- PLAYER: Sir! + if (response == "s_133") + { + hacker_lok_pirate_cave_action_jokeDone (player, npc); + + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: Ugh...that's terrible. What kind of...never mind. What is next? + string_id message = new string_id (c_stringFile, "s_136"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Let's do the network reset. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Let's reroute the access commands. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: See if the security system grants access now. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (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_145"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_146"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_147"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 17); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: To get to the other side! + if (response == "s_134") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: That's not even funny! + string_id message = new string_id (c_stringFile, "s_137"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Let's do the network reset. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Let's reroute the access commands. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Let's deal with the defender chip. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: See if the security system grants access now. + boolean hasResponse3 = false; + if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_112"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_113"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_114"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_115"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: No such thing? + if (response == "s_135") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: That's not even funny! + string_id message = new string_id (c_stringFile, "s_138"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Let's do the network reset. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Let's reroute the access commands. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Let's deal with the defender chip. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: See if the security system grants access now. + boolean hasResponse3 = false; + if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_112"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_113"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_114"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_115"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hacker_lok_pirate_cave_handleBranch17 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Ugh...that's terrible. What kind of...never mind. What is next? + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's do the network reset. + if (response == "s_145") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? + string_id message = new string_id (c_stringFile, "s_116"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm pretty sure it's purple. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: It's brown! Hah! I knew that one. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's orange. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_117"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_118"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_119"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's reroute the access commands. + if (response == "s_146") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' + string_id message = new string_id (c_stringFile, "s_123"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: It's multiplying. 720. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Uh...220. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's nine. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_124"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_125"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_126"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: See if the security system grants access now. + if (response == "s_147") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: That did it! It's open! The droid is inside the room. + string_id message = new string_id (c_stringFile, "s_139"); + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hacker_lok_pirate_cave_handleBranch18 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: That's not even funny! + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's do the network reset. + if (response == "s_112") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? + string_id message = new string_id (c_stringFile, "s_116"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm pretty sure it's purple. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: It's brown! Hah! I knew that one. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's orange. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_117"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_118"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_119"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's reroute the access commands. + if (response == "s_113") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' + string_id message = new string_id (c_stringFile, "s_123"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: It's multiplying. 720. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Uh...220. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's nine. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_124"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_125"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_126"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's deal with the defender chip. + if (response == "s_114") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: What do you call a womprat that can lift a bantha? + string_id message = new string_id (c_stringFile, "s_130"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sir! + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: To get to the other side! + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: No such thing? + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_133"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_134"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_135"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: See if the security system grants access now. + if (response == "s_115") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: That did it! It's open! The droid is inside the room. + string_id message = new string_id (c_stringFile, "s_139"); + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hacker_lok_pirate_cave_handleBranch19 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: That's not even funny! + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's do the network reset. + if (response == "s_112") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'On a color wheel, this color is the opposite of blue...' What does that mean? What's a color wheel? And what's the opposite of blue? + string_id message = new string_id (c_stringFile, "s_116"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm pretty sure it's purple. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: It's brown! Hah! I knew that one. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's orange. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_117"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_118"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_119"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's reroute the access commands. + if (response == "s_113") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: It says, 'Finish this number pair sequence... 1-2, 3-6, 4-24, 5-120, 6-?' + string_id message = new string_id (c_stringFile, "s_123"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: It's multiplying. 720. + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Uh...220. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: It's nine. I'm sure of it. + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_124"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_125"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_126"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let's deal with the defender chip. + if (response == "s_114") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: What do you call a womprat that can lift a bantha? + string_id message = new string_id (c_stringFile, "s_130"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sir! + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: To get to the other side! + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: No such thing? + boolean hasResponse2 = false; + if (hacker_lok_pirate_cave_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_133"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_134"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_135"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: See if the security system grants access now. + if (response == "s_115") + { + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: That did it! It's open! The droid is inside the room. + string_id message = new string_id (c_stringFile, "s_139"); + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.hacker_lok_pirate_cave"); + + 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.hacker_lok_pirate_cave"); + + 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 (hacker_lok_pirate_cave_condition_hasCompletedPirate (player, npc)) + { + //-- NPC: I think we are done here. Just don't blow my cover with the pirates. + string_id message = new string_id (c_stringFile, "s_54"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hacker_lok_pirate_cave_condition_hasReturnTask (player, npc)) + { + //-- NPC: Tell Vana everything is going as planned, thanks to you. See you topside. + string_id message = new string_id (c_stringFile, "s_53"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) + { + //-- NPC: You did it. I'm glad Vana sent you. You'll find the droid inside the room. + string_id message = new string_id (c_stringFile, "s_52"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hacker_lok_pirate_cave_condition_hasHackTask (player, npc)) + { + hacker_lok_pirate_cave_action_foundSecuritySys (player, npc); + + //-- NPC: Aargh! Can you help me with this thing? I've found a back door to this security system, but the AI program keeps asking me these stupid questions! Can you lend me your brain? + string_id message = new string_id (c_stringFile, "s_55"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What are you talking about? + boolean hasResponse0 = false; + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Tell me what you need. + boolean hasResponse1 = false; + if (hacker_lok_pirate_cave_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_56"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_57"); + + utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 4); + + npcStartConversation (player, npc, "hacker_lok_pirate_cave", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) + { + //-- NPC: You seem lost. Go somewhere else. + string_id message = new string_id (c_stringFile, "s_61"); + 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 != "hacker_lok_pirate_cave") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + if (branchId == 4 && hacker_lok_pirate_cave_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && hacker_lok_pirate_cave_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && hacker_lok_pirate_cave_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && hacker_lok_pirate_cave_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && hacker_lok_pirate_cave_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && hacker_lok_pirate_cave_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && hacker_lok_pirate_cave_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 11 && hacker_lok_pirate_cave_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 12 && hacker_lok_pirate_cave_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 13 && hacker_lok_pirate_cave_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 14 && hacker_lok_pirate_cave_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 15 && hacker_lok_pirate_cave_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 16 && hacker_lok_pirate_cave_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 17 && hacker_lok_pirate_cave_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 18 && hacker_lok_pirate_cave_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 19 && hacker_lok_pirate_cave_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/happer_mos_eisley.script b/sku.0/sys.server/compiled/game/script/conversation/happer_mos_eisley.script index d2f2f0078..62af627d5 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/happer_mos_eisley.script +++ b/sku.0/sys.server/compiled/game/script/conversation/happer_mos_eisley.script @@ -1,579 +1,579 @@ -// ====================================================================== -// -// happer_mos_eisley.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/happer_mos_eisley"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean happer_mos_eisley_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean happer_mos_eisley_condition_hasInvestigateQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "quest_02_investigate_murder"); -} - -// ---------------------------------------------------------------------- - -boolean happer_mos_eisley_condition_hasCompletedInvestigate (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "quest_02_investigate_murder"); -} - -// ---------------------------------------------------------------------- - -boolean happer_mos_eisley_condition_hasGatheredTheClue (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedTask(player, "quest_02_investigate_murder", "getClues") - || happer_mos_eisley_condition_hasCompletedInvestigate(player, npc); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void happer_mos_eisley_action_sendSignalClueUpdate (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "getCluesHapper"); -} - -// ---------------------------------------------------------------------- - -void happer_mos_eisley_action_sendSignalIdentifyBody (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "happerIdentifyBody"); -} - -// ---------------------------------------------------------------------- - -void happer_mos_eisley_action_sendSignalTalkHapper (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "speakWithHapper"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int happer_mos_eisley_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Sorry citizen, I have to attend to this murder scene. - - //-- [RESPONSE NOTE] - //-- PLAYER: Is that Bera Jeza? Oh no! - if (response == "s_9") - { - //-- [NOTE] - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - happer_mos_eisley_action_sendSignalIdentifyBody (player, npc); - - //-- NPC: You know the deceased? Perhaps you could shed some light on what could have happened. - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I don't know if I can help, but I am more than willing to assist the Mos Eisley Police if possible. - boolean hasResponse0 = false; - if (happer_mos_eisley_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_11"); - - utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int happer_mos_eisley_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You know the deceased? Perhaps you could shed some light on what could have happened. - - //-- [RESPONSE NOTE] - //-- PLAYER: I don't know if I can help, but I am more than willing to assist the Mos Eisley Police if possible. - if (response == "s_11") - { - //-- [NOTE] - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - //-- NPC: When did you last see, uh, Bera Jeza? - string_id message = new string_id (c_stringFile, "s_12"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: It's been a while. Perhaps a week or so. - boolean hasResponse0 = false; - if (happer_mos_eisley_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_14"); - - utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int happer_mos_eisley_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: When did you last see, uh, Bera Jeza? - - //-- [RESPONSE NOTE] - //-- PLAYER: It's been a while. Perhaps a week or so. - if (response == "s_14") - { - //-- [NOTE] - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - //-- NPC: I see. Well, Ms. Jeza seems to have met her fate an hour or more ago. Probably an organized crime related death. - string_id message = new string_id (c_stringFile, "s_16"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What do you mean organized? - boolean hasResponse0 = false; - if (happer_mos_eisley_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_18"); - - utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int happer_mos_eisley_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I see. Well, Ms. Jeza seems to have met her fate an hour or more ago. Probably an organized crime related death. - - //-- [RESPONSE NOTE] - //-- PLAYER: What do you mean organized? - if (response == "s_18") - { - //-- [NOTE] - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - //-- NPC: Your friend had a large sum of spice on her. If I was a betting man, I'd say she was involved in the manufacture. - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Don't you need a lab for that sort of thing? - boolean hasResponse0 = false; - if (happer_mos_eisley_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_22"); - - utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int happer_mos_eisley_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Your friend had a large sum of spice on her. If I was a betting man, I'd say she was involved in the manufacture. - - //-- [RESPONSE NOTE] - //-- PLAYER: Don't you need a lab for that sort of thing? - if (response == "s_22") - { - //-- [NOTE] - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - //-- NPC: Once we are done here I'll be interviewing her employer at the Mos Eisley Biolab. I have a feeling they are doing a little bit of moon lighting there. - string_id message = new string_id (c_stringFile, "s_24"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Is that the lab to the south? - boolean hasResponse0 = false; - if (happer_mos_eisley_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_26"); - - utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int happer_mos_eisley_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Once we are done here I'll be interviewing her employer at the Mos Eisley Biolab. I have a feeling they are doing a little bit of moon lighting there. - - //-- [RESPONSE NOTE] - //-- PLAYER: Is that the lab to the south? - if (response == "s_26") - { - //-- [NOTE] - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - happer_mos_eisley_action_sendSignalClueUpdate (player, npc); - - //-- NPC: I don't know exactly. You shouldn't worry about police matters. Now excuse me. - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.happer_mos_eisley"); - - 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.happer_mos_eisley"); - - 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 (happer_mos_eisley_condition_hasGatheredTheClue (player, npc)) - { - //-- NPC: There really isn't anything else you can do here. We'll let you know if we find anything new. - string_id message = new string_id (c_stringFile, "s_30"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (happer_mos_eisley_condition_hasInvestigateQuest (player, npc)) - { - happer_mos_eisley_action_sendSignalTalkHapper (player, npc); - - //-- NPC: Sorry citizen, I have to attend to this murder scene. - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Is that Bera Jeza? Oh no! - boolean hasResponse0 = false; - if (happer_mos_eisley_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_9"); - - utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 2); - - npcStartConversation (player, npc, "happer_mos_eisley", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - //-- NPC: Sorry citizen, I have a murder scene to attend to. - string_id message = new string_id (c_stringFile, "s_32"); - 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 != "happer_mos_eisley") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - if (branchId == 2 && happer_mos_eisley_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && happer_mos_eisley_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && happer_mos_eisley_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && happer_mos_eisley_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && happer_mos_eisley_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && happer_mos_eisley_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// happer_mos_eisley.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/happer_mos_eisley"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean happer_mos_eisley_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean happer_mos_eisley_condition_hasInvestigateQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "quest_02_investigate_murder"); +} + +// ---------------------------------------------------------------------- + +boolean happer_mos_eisley_condition_hasCompletedInvestigate (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedQuest(player, "quest_02_investigate_murder"); +} + +// ---------------------------------------------------------------------- + +boolean happer_mos_eisley_condition_hasGatheredTheClue (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedTask(player, "quest_02_investigate_murder", "getClues") + || happer_mos_eisley_condition_hasCompletedInvestigate(player, npc); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void happer_mos_eisley_action_sendSignalClueUpdate (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "getCluesHapper"); +} + +// ---------------------------------------------------------------------- + +void happer_mos_eisley_action_sendSignalIdentifyBody (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "happerIdentifyBody"); +} + +// ---------------------------------------------------------------------- + +void happer_mos_eisley_action_sendSignalTalkHapper (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "speakWithHapper"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int happer_mos_eisley_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Sorry citizen, I have to attend to this murder scene. + + //-- [RESPONSE NOTE] + //-- PLAYER: Is that Bera Jeza? Oh no! + if (response == "s_9") + { + //-- [NOTE] + if (happer_mos_eisley_condition__defaultCondition (player, npc)) + { + happer_mos_eisley_action_sendSignalIdentifyBody (player, npc); + + //-- NPC: You know the deceased? Perhaps you could shed some light on what could have happened. + string_id message = new string_id (c_stringFile, "s_10"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I don't know if I can help, but I am more than willing to assist the Mos Eisley Police if possible. + boolean hasResponse0 = false; + if (happer_mos_eisley_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_11"); + + utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int happer_mos_eisley_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You know the deceased? Perhaps you could shed some light on what could have happened. + + //-- [RESPONSE NOTE] + //-- PLAYER: I don't know if I can help, but I am more than willing to assist the Mos Eisley Police if possible. + if (response == "s_11") + { + //-- [NOTE] + if (happer_mos_eisley_condition__defaultCondition (player, npc)) + { + //-- NPC: When did you last see, uh, Bera Jeza? + string_id message = new string_id (c_stringFile, "s_12"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: It's been a while. Perhaps a week or so. + boolean hasResponse0 = false; + if (happer_mos_eisley_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_14"); + + utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int happer_mos_eisley_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: When did you last see, uh, Bera Jeza? + + //-- [RESPONSE NOTE] + //-- PLAYER: It's been a while. Perhaps a week or so. + if (response == "s_14") + { + //-- [NOTE] + if (happer_mos_eisley_condition__defaultCondition (player, npc)) + { + //-- NPC: I see. Well, Ms. Jeza seems to have met her fate an hour or more ago. Probably an organized crime related death. + string_id message = new string_id (c_stringFile, "s_16"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What do you mean organized? + boolean hasResponse0 = false; + if (happer_mos_eisley_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_18"); + + utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int happer_mos_eisley_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I see. Well, Ms. Jeza seems to have met her fate an hour or more ago. Probably an organized crime related death. + + //-- [RESPONSE NOTE] + //-- PLAYER: What do you mean organized? + if (response == "s_18") + { + //-- [NOTE] + if (happer_mos_eisley_condition__defaultCondition (player, npc)) + { + //-- NPC: Your friend had a large sum of spice on her. If I was a betting man, I'd say she was involved in the manufacture. + string_id message = new string_id (c_stringFile, "s_20"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Don't you need a lab for that sort of thing? + boolean hasResponse0 = false; + if (happer_mos_eisley_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_22"); + + utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int happer_mos_eisley_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Your friend had a large sum of spice on her. If I was a betting man, I'd say she was involved in the manufacture. + + //-- [RESPONSE NOTE] + //-- PLAYER: Don't you need a lab for that sort of thing? + if (response == "s_22") + { + //-- [NOTE] + if (happer_mos_eisley_condition__defaultCondition (player, npc)) + { + //-- NPC: Once we are done here I'll be interviewing her employer at the Mos Eisley Biolab. I have a feeling they are doing a little bit of moon lighting there. + string_id message = new string_id (c_stringFile, "s_24"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Is that the lab to the south? + boolean hasResponse0 = false; + if (happer_mos_eisley_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_26"); + + utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int happer_mos_eisley_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Once we are done here I'll be interviewing her employer at the Mos Eisley Biolab. I have a feeling they are doing a little bit of moon lighting there. + + //-- [RESPONSE NOTE] + //-- PLAYER: Is that the lab to the south? + if (response == "s_26") + { + //-- [NOTE] + if (happer_mos_eisley_condition__defaultCondition (player, npc)) + { + happer_mos_eisley_action_sendSignalClueUpdate (player, npc); + + //-- NPC: I don't know exactly. You shouldn't worry about police matters. Now excuse me. + string_id message = new string_id (c_stringFile, "s_28"); + utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.happer_mos_eisley"); + + 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.happer_mos_eisley"); + + 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 (happer_mos_eisley_condition_hasGatheredTheClue (player, npc)) + { + //-- NPC: There really isn't anything else you can do here. We'll let you know if we find anything new. + string_id message = new string_id (c_stringFile, "s_30"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (happer_mos_eisley_condition_hasInvestigateQuest (player, npc)) + { + happer_mos_eisley_action_sendSignalTalkHapper (player, npc); + + //-- NPC: Sorry citizen, I have to attend to this murder scene. + string_id message = new string_id (c_stringFile, "s_4"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Is that Bera Jeza? Oh no! + boolean hasResponse0 = false; + if (happer_mos_eisley_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_9"); + + utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 2); + + npcStartConversation (player, npc, "happer_mos_eisley", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (happer_mos_eisley_condition__defaultCondition (player, npc)) + { + //-- NPC: Sorry citizen, I have a murder scene to attend to. + string_id message = new string_id (c_stringFile, "s_32"); + 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 != "happer_mos_eisley") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.happer_mos_eisley.branchId"); + + if (branchId == 2 && happer_mos_eisley_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && happer_mos_eisley_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && happer_mos_eisley_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && happer_mos_eisley_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && happer_mos_eisley_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && happer_mos_eisley_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/hx_138.script b/sku.0/sys.server/compiled/game/script/conversation/hx_138.script index b065bf9f4..82938ba8c 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/hx_138.script +++ b/sku.0/sys.server/compiled/game/script/conversation/hx_138.script @@ -1,4203 +1,4203 @@ -// ====================================================================== -// -// hx_138.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/hx_138"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean hx_138_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_firstMeeting (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return (groundquests.isTaskActive(player, "outbreak_quest_02_imperial", "findTroopers") - || groundquests.isTaskActive(player, "outbreak_quest_02_rebel", "findTroopers") - || groundquests.isTaskActive(player, "outbreak_quest_02_neutral", "findTroopers") - ); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_hasRescueQuestActive (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return (groundquests.isTaskActive(player, "outbreak_quest_rescue_01", "spawnSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_01", "coaxingPleyer") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_02", "spawnSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_02", "coaxingPleyer") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_03", "spawnSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_03", "coaxingPleyer") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_04", "spawnSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_04", "coaxingPleyer") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_05", "spawnSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_05", "coaxingPleyer") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_06", "spawnSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_06", "coaxingPleyer") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_07", "spawnSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_07", "coaxingPleyer") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_08", "spawnSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_08", "coaxingPleyer") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_09", "spawnSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_09", "coaxingPleyer") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_010", "spawnSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_010", "coaxingPleyer") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_011", "spawnSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_012", "coaxingPleyer") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_013", "spawnSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_013", "coaxingPleyer") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_014", "spawnSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_014", "coaxingPleyer") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_015", "spawnSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_015", "coaxingPleyer") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_016", "spawnSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_016", "coaxingPleyer") - ); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_failedRescueOne (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_01_fail"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_failedRescueTwo (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_02_fail"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_failedRescueThree (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_03_fail"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_failedRescueFour (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_04_fail"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_successRescueOne (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_01_success"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_successRescueTwo (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_02_success"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_successRescueThree (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_03_success"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_successRescueFour (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_04_success"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_hasShuttlePartQuestActive (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_shuttle_parts"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_isStuckRescuing (obj_id player, obj_id npc) -{ - faceTo(npc, player); - //the task name is misleading. If the player actually has this task active they are waiting for the - //npc to breach the trigger volumen. It may be that the NPC no longer exists and the player - //is stuck - return (groundquests.isTaskActive(player, "outbreak_quest_rescue_01", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_02", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_03", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_04", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_01", "speakSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_02", "speakSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_03", "speakSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_04", "speakSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_05", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_06", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_07", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_08", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_05", "speakSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_06", "speakSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_07", "speakSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_08", "speakSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_09", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_010", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_011", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_012", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_09", "speakSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_010", "speakSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_011", "speakSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_012", "speakSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_013", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_014", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_015", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_016", "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_013", "speakSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_014", "speakSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_015", "speakSurvivor") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_016", "speakSurvivor") - ); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_finishedRescueCanceledShuttle (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_04_success") - && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_shuttle_parts"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_hasShuttlePartsNotMechanic (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "outbreak_quest_shuttle_parts", "deliverMechanic"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_isImperialQuestPlayer (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_isRebelQuestPlayer (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_isNeutralQuestPlayer (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_02_neutral"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_hasGivenPartsMechanic (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "outbreak_quest_shuttle_parts", "seeHX138"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_readyFirstRescue (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial") - || groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel") - || groundquests.hasCompletedQuest(player, "outbreak_quest_02_neutral")) - && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_01") - && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_05") - && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_06") - && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_07"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_hasFinishedShuttleParts (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_shuttle_parts"); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_isPlayerGodMode (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return isGod(player); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_hasCompletedRescue3Del4 (obj_id player, obj_id npc) -{ - return (groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_03") - || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_011") - || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_012") - || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_013")) - && (!groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_04") - && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_014") - && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_015") - && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_016")); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_hasCompletedRescue2Del3 (obj_id player, obj_id npc) -{ - return (groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_02") - || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_08") - || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_09") - || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_010")) - && (!groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_03") - && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_011") - && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_012") - && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_013")); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_hasCompletedRescue1Del2 (obj_id player, obj_id npc) -{ - return (groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_01") - || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_05") - || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_06") - || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_07")) - && (!groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_02") - && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_08") - && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_09") - && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_010")); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_isOnDungeonMissions (obj_id player, obj_id npc) -{ - string faction = ""; - if(hx_138_condition_isImperialQuestPlayer(player,npc)) - { - faction = "imperial"; - } - else if(hx_138_condition_isRebelQuestPlayer(player,npc)) - { - faction = "rebel"; - } - else - { - faction = "neutral"; - } - - if(faction == null || faction.length() <= 0) - return false; - - boolean hasAValidQuest = false; - for(int i = 1; i <= 5; i++) - { - if(!groundquests.isQuestActiveOrComplete(player, "outbreak_quest_administrative_building_" + faction + "_0" + i)) - continue; - - hasAValidQuest = true; - break; - } - - return hasAValidQuest; -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_shuttleEscape (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return (groundquests.isTaskActive(player, "outbreak_quest_facility_05_imperial", "seeHX138") - || groundquests.isTaskActive(player, "outbreak_quest_facility_05_rebel", "seeHX138") - || groundquests.isTaskActive(player, "outbreak_quest_facility_05_neutral", "seeHX138")); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_hasCompletedRescue4DelShuttle (obj_id player, obj_id npc) -{ - return (groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_04") - || groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_014") - || groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_015") - || groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_016") - && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_shuttle_parts")); -} - -// ---------------------------------------------------------------------- - -boolean hx_138_condition_hasRadio (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "findEpsilonContact"); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void hx_138_action_sendSignalMetHX138 (obj_id player, obj_id npc) -{ - faceTo(npc, player); - groundquests.sendSignal(player, "playerFoundStormtroopers"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_resetRescueOne (obj_id player, obj_id npc) -{ - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_01_fail"); - if(groundquests.isQuestActive(player, "outbreak_quest_rescue_01")) - groundquests.clearQuest(player, "outbreak_quest_rescue_01"); - else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_05")) - groundquests.clearQuest(player, "outbreak_quest_rescue_05"); - else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_06")) - groundquests.clearQuest(player, "outbreak_quest_rescue_06"); - else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_07")) - groundquests.clearQuest(player, "outbreak_quest_rescue_07"); - - hx_138_action_giveFirstSurvivorQuest(player,npc); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_giveSecondSurvivorQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_01_success"); - - int randNum = rand(1,4); - if(randNum <= 0 || randNum > 4) - { - return; - } - switch(randNum) - { - case 1: - groundquests.grantQuest(player, "outbreak_quest_rescue_02"); - break; - case 2: - groundquests.grantQuest(player, "outbreak_quest_rescue_08"); - break; - case 3: - groundquests.grantQuest(player, "outbreak_quest_rescue_09"); - break; - case 4: - groundquests.grantQuest(player, "outbreak_quest_rescue_010"); - break; - } -} - -// ---------------------------------------------------------------------- - -void hx_138_action_giveThirdSurvivorQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_02_success"); - - int randNum = rand(1,4); - if(randNum <= 0 || randNum > 4) - { - return; - } - switch(randNum) - { - case 1: - groundquests.grantQuest(player, "outbreak_quest_rescue_03"); - break; - case 2: - groundquests.grantQuest(player, "outbreak_quest_rescue_011"); - break; - case 3: - groundquests.grantQuest(player, "outbreak_quest_rescue_012"); - break; - case 4: - groundquests.grantQuest(player, "outbreak_quest_rescue_013"); - break; - } - -} - -// ---------------------------------------------------------------------- - -void hx_138_action_giveFourthSurvivorQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_03_success"); - - int randNum = rand(1,4); - if(randNum <= 0 || randNum > 4) - { - return; - } - switch(randNum) - { - case 1: - groundquests.grantQuest(player, "outbreak_quest_rescue_04"); - break; - case 2: - groundquests.grantQuest(player, "outbreak_quest_rescue_014"); - break; - case 3: - groundquests.grantQuest(player, "outbreak_quest_rescue_015"); - break; - case 4: - groundquests.grantQuest(player, "outbreak_quest_rescue_016"); - break; - } -} - -// ---------------------------------------------------------------------- - -void hx_138_action_resetRescueTwo (obj_id player, obj_id npc) -{ - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_02_fail"); - - if(groundquests.isQuestActive(player, "outbreak_quest_rescue_02")) - groundquests.clearQuest(player, "outbreak_quest_rescue_02"); - else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_08")) - groundquests.clearQuest(player, "outbreak_quest_rescue_08"); - else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_09")) - groundquests.clearQuest(player, "outbreak_quest_rescue_09"); - else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_010")) - groundquests.clearQuest(player, "outbreak_quest_rescue_010"); - - hx_138_action_giveSecondSurvivorQuest(player,npc); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_resetRescueThree (obj_id player, obj_id npc) -{ - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_03_fail"); - - if(groundquests.isQuestActive(player, "outbreak_quest_rescue_03")) - groundquests.clearQuest(player, "outbreak_quest_rescue_03"); - else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_011")) - groundquests.clearQuest(player, "outbreak_quest_rescue_011"); - else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_012")) - groundquests.clearQuest(player, "outbreak_quest_rescue_012"); - else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_013")) - groundquests.clearQuest(player, "outbreak_quest_rescue_013"); - - hx_138_action_giveThirdSurvivorQuest(player,npc); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_resetRescueFour (obj_id player, obj_id npc) -{ - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_04_fail"); - - if(groundquests.isQuestActive(player, "outbreak_quest_rescue_04")) - groundquests.clearQuest(player, "outbreak_quest_rescue_04"); - else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_014")) - groundquests.clearQuest(player, "outbreak_quest_rescue_014"); - else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_015")) - groundquests.clearQuest(player, "outbreak_quest_rescue_015"); - else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_016")) - groundquests.clearQuest(player, "outbreak_quest_rescue_016"); - - hx_138_action_giveFourthSurvivorQuest(player,npc); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_fixPlayerRescueQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(groundquests.isTaskActive(player, "outbreak_quest_rescue_01", "rescueCompleted")) - { - hx_138_action_resetRescueOne (player, npc); - } - else if(groundquests.isTaskActive(player, "outbreak_quest_rescue_02", "rescueCompleted")) - { - hx_138_action_resetRescueTwo (player, npc); - } - else if(groundquests.isTaskActive(player, "outbreak_quest_rescue_03", "rescueCompleted")) - { - hx_138_action_resetRescueThree (player, npc); - } - else - { - hx_138_action_resetRescueFour (player, npc); - } -} - -// ---------------------------------------------------------------------- - -void hx_138_action_finishRescueGiveShuttleQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_04_success"); - hx_138_action_giveShuttleQuest(player,npc); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_giveShuttleQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - groundquests.grantQuest(player, "outbreak_quest_shuttle_parts"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_finishShuttleParts (obj_id player, obj_id npc) -{ - faceTo(npc, player); - groundquests.sendSignal(player, "deliveredShuttleSupplies"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_giveFirstSurvivorQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - int randNum = rand(1,4); - if(randNum <= 0 || randNum > 4) - { - return; - } - switch(randNum) - { - case 1: - groundquests.grantQuest(player, "outbreak_quest_rescue_01"); - break; - case 2: - groundquests.grantQuest(player, "outbreak_quest_rescue_05"); - break; - case 3: - groundquests.grantQuest(player, "outbreak_quest_rescue_06"); - break; - case 4: - groundquests.grantQuest(player, "outbreak_quest_rescue_07"); - break; - } - -} - -// ---------------------------------------------------------------------- - -void hx_138_action_giveRandomInquisitorQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - int randNumber = rand(1,5); - if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_0"+randNumber); - } - else if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_0"+randNumber); - } - else - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_0"+randNumber); - } -} - -// ---------------------------------------------------------------------- - -void hx_138_action_giveInquisitorQuestOne (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_01"); - } - else if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_01"); - } - else - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_01"); - } -} - -// ---------------------------------------------------------------------- - -void hx_138_action_giveInquisitorQuestTwo (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_02"); - } - else if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_02"); - } - else - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_02"); - } -} - -// ---------------------------------------------------------------------- - -void hx_138_action_giveInquisitorQuestFive (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_05"); - } - else if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_05"); - } - else - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_05"); - } -} - -// ---------------------------------------------------------------------- - -void hx_138_action_giveInquisitorQuestFour (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_04"); - } - else if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_04"); - } - else - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_04"); - } -} - -// ---------------------------------------------------------------------- - -void hx_138_action_giveInquisitorQuestThree (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_03"); - } - else if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_03"); - } - else - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_03"); - } -} - -// ---------------------------------------------------------------------- - -void hx_138_action_fixRescueGates (obj_id player, obj_id npc) -{ - faceTo(npc, player); - for(int i = 1; i <= 5; i++) - { - if(groundquests.isTaskActive(player, "outbreak_quest_rescue_0"+i, "rescueCompleted") - || groundquests.isTaskActive(player, "outbreak_quest_rescue_0"+i, "speakSurvivor")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_0"+i); - groundquests.grantQuest(player, "outbreak_quest_rescue_0"+i); - return; - } - } -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue01a (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_01"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue01d (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_07"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue01c (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_06"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue01b (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_05"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue02a (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_02"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue02d (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_010"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue02c (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_09"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue02b (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_08"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue03d (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_013"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue03c (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_012"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue03b (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_011"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue03a (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_03"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue04d (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_016"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue04c (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_015"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue04b (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_014"); -} - -// ---------------------------------------------------------------------- - -void hx_138_action_godModeRescue04a (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_quest_rescue_04"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int hx_138_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I've already noticed a boost in morale as a result of your efforts, %TU. You are certainly our saviour. - - //-- [RESPONSE NOTE] - //-- PLAYER: I'm no one special. - if (response == "s_122") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shrug_shoulders"); - - //-- NPC: Mmmm...okay. Well, obviously you have your own mission. What is it exactly? - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I need to infiltrate the research facility. - boolean hasResponse0 = false; - if (hx_138_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_138"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: GOD MODE ONLY INQUISITOR QUEST TESTING - if (response == "s_177") - { - //-- [NOTE] - if (hx_138_condition_isImperialQuestPlayer (player, npc)) - { - //-- NPC: You are doing the Imp quest line, which Inquisitor quest would you like? - string_id message = new string_id (c_stringFile, "s_178"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Imperial Officer Body - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Imperial Scientist Body - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Imperial Stormtrooper Body - boolean hasResponse2 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: Imperial Scout Trooper Body - boolean hasResponse3 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - //-- PLAYER: Imperial Inquisitor Body - boolean hasResponse4 = false; - if (hx_138_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_181"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_182"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_183"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_184"); - - if (hasResponse4) - responses [responseIndex++] = new string_id (c_stringFile, "s_185"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_isRebelQuestPlayer (player, npc)) - { - //-- NPC: You are doing the Reb quest line, which Inquisitor quest would you like? - string_id message = new string_id (c_stringFile, "s_179"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Imperial Officer Body - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Imperial Scientist Body - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Imperial Stormtrooper Body - boolean hasResponse2 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: Imperial Scout Trooper Body - boolean hasResponse3 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - //-- PLAYER: Imperial Inquisitor Body - boolean hasResponse4 = false; - if (hx_138_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_191"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_192"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_193"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_194"); - - if (hasResponse4) - responses [responseIndex++] = new string_id (c_stringFile, "s_195"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_isNeutralQuestPlayer (player, npc)) - { - //-- NPC: You are doing the Neut quest line, which Inquisitor quest would you like? - string_id message = new string_id (c_stringFile, "s_180"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Imperial Officer Body - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Imperial Scientist Body - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Imperial Stormtrooper Body - boolean hasResponse2 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: Imperial Scout Trooper Body - boolean hasResponse3 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - //-- PLAYER: Imperial Inquisitor Body - boolean hasResponse4 = false; - if (hx_138_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_196"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_197"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_198"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_199"); - - if (hasResponse4) - responses [responseIndex++] = new string_id (c_stringFile, "s_200"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Mmmm...okay. Well, obviously you have your own mission. What is it exactly? - - //-- [RESPONSE NOTE] - //-- PLAYER: I need to infiltrate the research facility. - if (response == "s_138") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "laugh"); - - //-- NPC: Yeah right. Ha ha...seriously now. - string_id message = new string_id (c_stringFile, "s_139"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Uh, I need to infiltrate the research facility? - boolean hasResponse0 = false; - if (hx_138_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_140"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yeah right. Ha ha...seriously now. - - //-- [RESPONSE NOTE] - //-- PLAYER: Uh, I need to infiltrate the research facility? - if (response == "s_140") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - //-- NPC: What? You were serious? Look, I can't ask these guys to help you. We've lost too many as it is. - string_id message = new string_id (c_stringFile, "s_141"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I don't need your men. All I need is a way to get in. - boolean hasResponse0 = false; - if (hx_138_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_142"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: What? You were serious? Look, I can't ask these guys to help you. We've lost too many as it is. - - //-- [RESPONSE NOTE] - //-- PLAYER: I don't need your men. All I need is a way to get in. - if (response == "s_142") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - //-- NPC: That is suicide, but hey, you have made it this far. - string_id message = new string_id (c_stringFile, "s_143"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I gather the facility is sealed? - boolean hasResponse0 = false; - if (hx_138_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_144"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: That is suicide, but hey, you have made it this far. - - //-- [RESPONSE NOTE] - //-- PLAYER: I gather the facility is sealed? - if (response == "s_144") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - //-- NPC: No, but I hear it is very large and hard to navigate. The best way to find out where everything is down there is to get an administrative access key. You will have to talk to the Inquisitor about this, I was always responsible for duties topside. - string_id message = new string_id (c_stringFile, "s_145"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I see. Well it's been a pleasure. - boolean hasResponse0 = false; - if (hx_138_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_146"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: No, but I hear it is very large and hard to navigate. The best way to find out where everything is down there is to get an administrative access key. You will have to talk to the Inquisitor about this, I was always responsible for duties topside. - - //-- [RESPONSE NOTE] - //-- PLAYER: I see. Well it's been a pleasure. - if (response == "s_146") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "bow3"); - - hx_138_action_giveRandomInquisitorQuest (player, npc); - - //-- NPC: The pleasure was all mine, %TU. - string_id message = new string_id (c_stringFile, "s_147"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You are doing the Imp quest line, which Inquisitor quest would you like? - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial Officer Body - if (response == "s_181") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestOne (player, npc); - - //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. - string_id message = new string_id (c_stringFile, "s_186"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial Scientist Body - if (response == "s_182") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestTwo (player, npc); - - //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. - string_id message = new string_id (c_stringFile, "s_187"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial Stormtrooper Body - if (response == "s_183") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestThree (player, npc); - - //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. - string_id message = new string_id (c_stringFile, "s_188"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial Scout Trooper Body - if (response == "s_184") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestFour (player, npc); - - //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. - string_id message = new string_id (c_stringFile, "s_189"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial Inquisitor Body - if (response == "s_185") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestFive (player, npc); - - //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. - string_id message = new string_id (c_stringFile, "s_190"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch16 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You are doing the Reb quest line, which Inquisitor quest would you like? - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial Officer Body - if (response == "s_191") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestOne (player, npc); - - //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. - string_id message = new string_id (c_stringFile, "s_201"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial Scientist Body - if (response == "s_192") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestTwo (player, npc); - - //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. - string_id message = new string_id (c_stringFile, "s_202"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial Stormtrooper Body - if (response == "s_193") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestThree (player, npc); - - //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. - string_id message = new string_id (c_stringFile, "s_203"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial Scout Trooper Body - if (response == "s_194") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestFour (player, npc); - - //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. - string_id message = new string_id (c_stringFile, "s_204"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial Inquisitor Body - if (response == "s_195") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestFive (player, npc); - - //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. - string_id message = new string_id (c_stringFile, "s_205"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch22 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You are doing the Neut quest line, which Inquisitor quest would you like? - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial Officer Body - if (response == "s_196") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestOne (player, npc); - - //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. - string_id message = new string_id (c_stringFile, "s_206"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial Scientist Body - if (response == "s_197") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestTwo (player, npc); - - //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. - string_id message = new string_id (c_stringFile, "s_207"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial Stormtrooper Body - if (response == "s_198") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestThree (player, npc); - - //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. - string_id message = new string_id (c_stringFile, "s_208"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial Scout Trooper Body - if (response == "s_199") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestFour (player, npc); - - //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. - string_id message = new string_id (c_stringFile, "s_209"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Imperial Inquisitor Body - if (response == "s_200") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestFive (player, npc); - - //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. - string_id message = new string_id (c_stringFile, "s_210"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch32 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Hmmm....what happened? Do you need to redo the quest? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes! - if (response == "s_104") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_fixRescueGates (player, npc); - - //-- NPC: Okay...lets fix this. - string_id message = new string_id (c_stringFile, "s_105"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch34 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You did it again, %TU. That was the last one. But we need you again. - - //-- [RESPONSE NOTE] - //-- PLAYER: What is it this time? - if (response == "s_63") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - //-- NPC: The shuttle needs parts before we can start the evacuation. - string_id message = new string_id (c_stringFile, "s_65"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What parts are needed? - boolean hasResponse0 = false; - if (hx_138_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_67"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 35); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch35 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: The shuttle needs parts before we can start the evacuation. - - //-- [RESPONSE NOTE] - //-- PLAYER: What parts are needed? - if (response == "s_67") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - //-- NPC: We need fuel cells for the retro-thrust engines for starters, but we also need a new spinal trunk. While we were trying to rewire the spinal trunk we managed to blow the computer core memory. - string_id message = new string_id (c_stringFile, "s_69"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Uh...wow. Anything else? - boolean hasResponse0 = false; - if (hx_138_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_71"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 36); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch36 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: We need fuel cells for the retro-thrust engines for starters, but we also need a new spinal trunk. While we were trying to rewire the spinal trunk we managed to blow the computer core memory. - - //-- [RESPONSE NOTE] - //-- PLAYER: Uh...wow. Anything else? - if (response == "s_71") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - //-- NPC: Yeah, we need a few power converters. - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: How will I find all of these? - boolean hasResponse0 = false; - if (hx_138_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.hx_138.branchId", 37); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch37 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yeah, we need a few power converters. - - //-- [RESPONSE NOTE] - //-- PLAYER: How will I find all of these? - if (response == "s_75") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - //-- NPC: The onboard computer has located several downed shuttles within the area. Go to those locations and search the wreckage for the parts. - string_id message = new string_id (c_stringFile, "s_77"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Give me the coordinates. - boolean hasResponse0 = false; - if (hx_138_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_79"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 38); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch38 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: The onboard computer has located several downed shuttles within the area. Go to those locations and search the wreckage for the parts. - - //-- [RESPONSE NOTE] - //-- PLAYER: Give me the coordinates. - if (response == "s_79") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_finishRescueGiveShuttleQuest (player, npc); - - //-- NPC: Uploaded to your datapad. Good luck. We are all relying on you. - string_id message = new string_id (c_stringFile, "s_81"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch40 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yet another death. These survivors are depending on you, %TU! Luckily another survivor at that same location contacted us. Don't think, just do. - - //-- [RESPONSE NOTE] - //-- PLAYER: Ok...okay, I'm ready. - if (response == "s_85") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_resetRescueFour (player, npc); - - //-- NPC: Bring him home, %TU! - string_id message = new string_id (c_stringFile, "s_87"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch42 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: The Emperor will hear about you and all your fine work here, %TU. You are a true hero. - - //-- [RESPONSE NOTE] - //-- PLAYER: Great. Tell him I miss Alderaan. - if (response == "s_91") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - //-- NPC: You can channel your rebellious anger into rescuing the next survivor, %TU. - string_id message = new string_id (c_stringFile, "s_93"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Consider it channeled. - boolean hasResponse0 = false; - if (hx_138_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_95"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 43); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I exist to serve. - if (response == "s_99") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveFourthSurvivorQuest (player, npc); - - //-- NPC: Bring this one back, just like the last one, %TU. - string_id message = new string_id (c_stringFile, "s_101"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: (Godmode) I want to test the 4 different rescue 4 quests. - if (response == "s_356") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - //-- NPC: Make sure you don't already have the quest, then select a choice below. - string_id message = new string_id (c_stringFile, "s_357"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: outbreak_quest_rescue_04a - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: outbreak_quest_rescue_04b - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: outbreak_quest_rescue_04c - boolean hasResponse2 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: outbreak_quest_rescue_04d - boolean hasResponse3 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_358"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_359"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_360"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_361"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 46); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch43 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You can channel your rebellious anger into rescuing the next survivor, %TU. - - //-- [RESPONSE NOTE] - //-- PLAYER: Consider it channeled. - if (response == "s_95") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveFourthSurvivorQuest (player, npc); - - //-- NPC: Bring this one back, just like the last one, %TU. - string_id message = new string_id (c_stringFile, "s_97"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch46 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Make sure you don't already have the quest, then select a choice below. - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_04a - if (response == "s_358") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue04a (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_362"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_04b - if (response == "s_359") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue04b (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_364"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_04c - if (response == "s_360") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue04c (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_363"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_04d - if (response == "s_361") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue04d (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_365"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch51 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: We obviously can't save everyone. %TU, but we have to try. If you aren't the person for these missions please speak up. - - //-- [RESPONSE NOTE] - //-- PLAYER: I can do it. Give me another chance. - if (response == "s_121") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_resetRescueThree (player, npc); - - //-- NPC: There is another survivor at that same location. Don't mess this one up! - string_id message = new string_id (c_stringFile, "s_125"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch53 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Another success. That survivor may live into old age because of you. Great work. - - //-- [RESPONSE NOTE] - //-- PLAYER: We're done? - if (response == "s_129") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - //-- NPC: No. Another survivor is a little further out. Are you ready to attempt a rescue? - string_id message = new string_id (c_stringFile, "s_131"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I am ready. - boolean hasResponse0 = false; - if (hx_138_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_133"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 54); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: (Godmode) I want to test the 4 different rescue 3 quests. - if (response == "s_345") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - //-- NPC: Make sure you don't already have the quest, then select a choice below. - string_id message = new string_id (c_stringFile, "s_346"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: outbreak_quest_rescue_03a - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: outbreak_quest_rescue_03b - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: outbreak_quest_rescue_03c - boolean hasResponse2 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: outbreak_quest_rescue_03d - boolean hasResponse3 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_347"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_349"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_350"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_351"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 56); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch54 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: No. Another survivor is a little further out. Are you ready to attempt a rescue? - - //-- [RESPONSE NOTE] - //-- PLAYER: I am ready. - if (response == "s_133") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveThirdSurvivorQuest (player, npc); - - //-- NPC: Find that survivor, %TU. - string_id message = new string_id (c_stringFile, "s_135"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch56 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Make sure you don't already have the quest, then select a choice below. - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_03a - if (response == "s_347") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue03a (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_348"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_03b - if (response == "s_349") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue03b (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_352"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_03c - if (response == "s_350") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue03c (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_353"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_03d - if (response == "s_351") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue03d (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_354"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch61 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You've managed to save one survivor so I know you aren't completely incompetent. Stay alert! We have another survivor at that same location so you have a second chance. - - //-- [RESPONSE NOTE] - //-- PLAYER: I'm ready. - if (response == "s_159") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_resetRescueTwo (player, npc); - - //-- NPC: Go be the hero we need. - string_id message = new string_id (c_stringFile, "s_161"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch63 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Great work bringing the survivor back. We have a few more to rescue. Are you ready for the next location? - - //-- [RESPONSE NOTE] - //-- PLAYER: I am. - if (response == "s_165") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveSecondSurvivorQuest (player, npc); - - //-- NPC: Here is the second survivor - string_id message = new string_id (c_stringFile, "s_167"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: (Godmode) I want to test the 4 different rescue 2 quests. - if (response == "s_320") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - //-- NPC: Make sure you don't already have the quest, then select a choice below. - string_id message = new string_id (c_stringFile, "s_321"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: outbreak_quest_rescue_02a - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: outbreak_quest_rescue_02b - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: outbreak_quest_rescue_02c - boolean hasResponse2 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: outbreak_quest_rescue_02d - boolean hasResponse3 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_325"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_334"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_338"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_342"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 65); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch65 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Make sure you don't already have the quest, then select a choice below. - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_02a - if (response == "s_325") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue02a (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_326"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_02b - if (response == "s_334") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue02b (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_336"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_02c - if (response == "s_338") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue02c (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_340"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_02d - if (response == "s_342") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue02d (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_344"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch70 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Look, I'm sure you feel horrible so I'll spare you any additional guilt. Luckily, another survivor at that same location contacted us so you have a second chance. - - //-- [RESPONSE NOTE] - //-- PLAYER: I'm ready. - if (response == "s_216") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shakefist"); - - hx_138_action_resetRescueOne (player, npc); - - //-- NPC: Bring back the survivor alive this time! - string_id message = new string_id (c_stringFile, "s_218"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch77 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Are you ready to get to work? Alright. We have a situation. There are survivors spread out topside and I need someone to go and lead them back. The others are too weakened by the lack of supplies but you look fit to carry on the task. What do you say? - - //-- [RESPONSE NOTE] - //-- PLAYER: If I agree will you help me with my mission? - if (response == "s_305") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - //-- NPC: Sure. We'll have time after you do a few tasks to find out exactly what that entails. Are you ready for the first location? - string_id message = new string_id (c_stringFile, "s_307"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes - boolean hasResponse0 = false; - if (hx_138_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_308"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 78); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: (Godmode) I want to test the 4 different rescue 1 quests. - if (response == "s_310") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - //-- NPC: Make sure you don't already have the quest, then select a choice below. - string_id message = new string_id (c_stringFile, "s_311"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: outbreak_quest_rescue_01a - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: outbreak_quest_rescue_01b - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: outbreak_quest_rescue_01c - boolean hasResponse2 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: outbreak_quest_rescue_01d - boolean hasResponse3 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_312"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_313"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_314"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_315"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 80); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch78 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Sure. We'll have time after you do a few tasks to find out exactly what that entails. Are you ready for the first location? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes - if (response == "s_308") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveFirstSurvivorQuest (player, npc); - - //-- NPC: Here is the first location. - string_id message = new string_id (c_stringFile, "s_309"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch80 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Make sure you don't already have the quest, then select a choice below. - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_01a - if (response == "s_312") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue01a (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_316"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_01b - if (response == "s_313") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue01b (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_317"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_01c - if (response == "s_314") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue01c (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_318"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: outbreak_quest_rescue_01d - if (response == "s_315") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue01d (player, npc); - - //-- NPC: Done - string_id message = new string_id (c_stringFile, "s_319"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int hx_138_handleBranch85 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Another of the living! Tell me you came here by shuttle. - - //-- [RESPONSE NOTE] - //-- PLAYER: No. Shuttles are not allowed into the quarantine zone. - if (response == "s_244") - { - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_sendSignalMetHX138 (player, npc); - - //-- NPC: As I suspected. How did you get here? Oh that isn't important. Go get some rest and when you are ready, come back. I need a volunteer. - string_id message = new string_id (c_stringFile, "s_249"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.hx_138"); - - 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.hx_138"); - - 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 (hx_138_condition_shuttleEscape (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - //-- NPC: I ordered the shuttle to take off half an hour ago but they insisted on waiting for you. Get on that shuttle hero! - string_id message = new string_id (c_stringFile, "s_253"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_isOnDungeonMissions (player, npc)) - { - //-- NPC: Good luck with that mission of yours. We'll wait as long as we can for you, but don't expect us to wait too long. - string_id message = new string_id (c_stringFile, "s_251"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_hasFinishedShuttleParts (player, npc)) - { - //-- NPC: I've already noticed a boost in morale as a result of your efforts, %TU. You are certainly our saviour. - string_id message = new string_id (c_stringFile, "s_113"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm no one special. - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: GOD MODE ONLY INQUISITOR QUEST TESTING - boolean hasResponse1 = false; - if (hx_138_condition_isPlayerGodMode (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_122"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_177"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 3); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "hx_138", 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 (hx_138_condition_hasGivenPartsMechanic (player, npc)) - { - doAnimationAction (npc, "celebrate"); - - hx_138_action_finishShuttleParts (player, npc); - - //-- NPC: Fantastic work, %TU! Come back when you have gotten some rest. I can help you with your mission. - string_id message = new string_id (c_stringFile, "s_174"); - 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 (hx_138_condition_hasShuttlePartsNotMechanic (player, npc)) - { - //-- NPC: Looks like you have all the parts. Give them to the mechanic and come back...there is something else that has come up. - string_id message = new string_id (c_stringFile, "s_110"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_finishedRescueCanceledShuttle (player, npc)) - { - hx_138_action_giveShuttleQuest (player, npc); - - //-- NPC: Looks like you lost the datapad information with the shuttle waypoints. Let me give that to you again. - string_id message = new string_id (c_stringFile, "s_109"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_hasShuttlePartQuestActive (player, npc)) - { - //-- NPC: Come back when you have the shuttle parts. - string_id message = new string_id (c_stringFile, "s_56"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_isStuckRescuing (player, npc)) - { - //-- NPC: Hmmm....what happened? Do you need to redo the quest? - string_id message = new string_id (c_stringFile, "s_103"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes! - boolean hasResponse0 = false; - if (hx_138_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_104"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 32); - - npcStartConversation (player, npc, "hx_138", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_successRescueFour (player, npc)) - { - //-- NPC: You did it again, %TU. That was the last one. But we need you again. - string_id message = new string_id (c_stringFile, "s_61"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What is it this time? - boolean hasResponse0 = false; - if (hx_138_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_63"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 34); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "hx_138", 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 (hx_138_condition_failedRescueFour (player, npc)) - { - //-- NPC: Yet another death. These survivors are depending on you, %TU! Luckily another survivor at that same location contacted us. Don't think, just do. - string_id message = new string_id (c_stringFile, "s_83"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Ok...okay, I'm ready. - boolean hasResponse0 = false; - if (hx_138_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.hx_138.branchId", 40); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "hx_138", 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 (hx_138_condition_successRescueThree (player, npc)) - { - //-- NPC: The Emperor will hear about you and all your fine work here, %TU. You are a true hero. - string_id message = new string_id (c_stringFile, "s_89"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Great. Tell him I miss Alderaan. - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: I exist to serve. - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: (Godmode) I want to test the 4 different rescue 4 quests. - boolean hasResponse2 = false; - if (hx_138_condition_isPlayerGodMode (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_91"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_99"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_356"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 42); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "hx_138", 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 (hx_138_condition_failedRescueThree (player, npc)) - { - //-- NPC: We obviously can't save everyone. %TU, but we have to try. If you aren't the person for these missions please speak up. - string_id message = new string_id (c_stringFile, "s_119"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I can do it. Give me another chance. - boolean hasResponse0 = false; - if (hx_138_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_121"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 51); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "hx_138", 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 (hx_138_condition_successRescueTwo (player, npc)) - { - //-- NPC: Another success. That survivor may live into old age because of you. Great work. - string_id message = new string_id (c_stringFile, "s_127"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: We're done? - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: (Godmode) I want to test the 4 different rescue 3 quests. - boolean hasResponse1 = false; - if (hx_138_condition_isPlayerGodMode (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_129"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_345"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 53); - - npcStartConversation (player, npc, "hx_138", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_failedRescueTwo (player, npc)) - { - //-- NPC: You've managed to save one survivor so I know you aren't completely incompetent. Stay alert! We have another survivor at that same location so you have a second chance. - string_id message = new string_id (c_stringFile, "s_157"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm ready. - boolean hasResponse0 = false; - if (hx_138_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_159"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 61); - - npcStartConversation (player, npc, "hx_138", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_successRescueOne (player, npc)) - { - //-- NPC: Great work bringing the survivor back. We have a few more to rescue. Are you ready for the next location? - string_id message = new string_id (c_stringFile, "s_163"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I am. - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: (Godmode) I want to test the 4 different rescue 2 quests. - boolean hasResponse1 = false; - if (hx_138_condition_isPlayerGodMode (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_165"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_320"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 63); - - npcStartConversation (player, npc, "hx_138", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_failedRescueOne (player, npc)) - { - //-- NPC: Look, I'm sure you feel horrible so I'll spare you any additional guilt. Luckily, another survivor at that same location contacted us so you have a second chance. - string_id message = new string_id (c_stringFile, "s_214"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm ready. - boolean hasResponse0 = false; - if (hx_138_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_216"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 70); - - npcStartConversation (player, npc, "hx_138", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_hasRescueQuestActive (player, npc)) - { - doAnimationAction (npc, "shrug_shoulders"); - - //-- NPC: Where is the survivor? There is no time for resting. Find that survivor and bring him back alive! - string_id message = new string_id (c_stringFile, "s_220"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_hasCompletedRescue4DelShuttle (player, npc)) - { - hx_138_action_giveShuttleQuest (player, npc); - - //-- NPC: Looks like you took a break. Are you ready to go get those shuttle parts? - string_id message = new string_id (c_stringFile, "s_255"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_hasCompletedRescue3Del4 (player, npc)) - { - hx_138_action_giveFourthSurvivorQuest (player, npc); - - //-- NPC: Looks like you took a break. Hope you are ready to get started on the rescuing the last survivor. - string_id message = new string_id (c_stringFile, "s_245"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_hasCompletedRescue2Del3 (player, npc)) - { - hx_138_action_giveThirdSurvivorQuest (player, npc); - - //-- NPC: Looks like you took a break. Hope you are ready to get started on the rescuing the next survivor. - string_id message = new string_id (c_stringFile, "s_246"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_hasCompletedRescue1Del2 (player, npc)) - { - hx_138_action_giveSecondSurvivorQuest (player, npc); - - //-- NPC: Looks like you took a break. Hope you are ready to get started on the rescuing a survivor. - string_id message = new string_id (c_stringFile, "s_247"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_readyFirstRescue (player, npc)) - { - //-- NPC: Are you ready to get to work? Alright. We have a situation. There are survivors spread out topside and I need someone to go and lead them back. The others are too weakened by the lack of supplies but you look fit to carry on the task. What do you say? - string_id message = new string_id (c_stringFile, "s_226"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: If I agree will you help me with my mission? - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: (Godmode) I want to test the 4 different rescue 1 quests. - boolean hasResponse1 = false; - if (hx_138_condition_isPlayerGodMode (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_305"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_310"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 77); - - npcStartConversation (player, npc, "hx_138", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_firstMeeting (player, npc)) - { - doAnimationAction (npc, "nod"); - - //-- NPC: Another of the living! Tell me you came here by shuttle. - string_id message = new string_id (c_stringFile, "s_242"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: No. Shuttles are not allowed into the quarantine zone. - boolean hasResponse0 = false; - if (hx_138_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_244"); - - utils.setScriptVar (player, "conversation.hx_138.branchId", 85); - - npcStartConversation (player, npc, "hx_138", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition_hasRadio (player, npc)) - { - //-- NPC: Hello there...deliver that radio to Sogan Varga. He'll be able to put it to use. - string_id message = new string_id (c_stringFile, "s_257"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (hx_138_condition__defaultCondition (player, npc)) - { - //-- NPC: I don't know who you are but you can stay with us. We'll get you out of here sooner or later. - string_id message = new string_id (c_stringFile, "s_258"); - 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 != "hx_138") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.hx_138.branchId"); - - if (branchId == 3 && hx_138_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && hx_138_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && hx_138_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && hx_138_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && hx_138_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && hx_138_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && hx_138_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 16 && hx_138_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 22 && hx_138_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 32 && hx_138_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 34 && hx_138_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 35 && hx_138_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 36 && hx_138_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 37 && hx_138_handleBranch37 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 38 && hx_138_handleBranch38 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 40 && hx_138_handleBranch40 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 42 && hx_138_handleBranch42 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 43 && hx_138_handleBranch43 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 46 && hx_138_handleBranch46 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 51 && hx_138_handleBranch51 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 53 && hx_138_handleBranch53 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 54 && hx_138_handleBranch54 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 56 && hx_138_handleBranch56 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 61 && hx_138_handleBranch61 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 63 && hx_138_handleBranch63 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 65 && hx_138_handleBranch65 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 70 && hx_138_handleBranch70 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 77 && hx_138_handleBranch77 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 78 && hx_138_handleBranch78 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 80 && hx_138_handleBranch80 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 85 && hx_138_handleBranch85 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// hx_138.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/hx_138"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean hx_138_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_firstMeeting (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return (groundquests.isTaskActive(player, "outbreak_quest_02_imperial", "findTroopers") + || groundquests.isTaskActive(player, "outbreak_quest_02_rebel", "findTroopers") + || groundquests.isTaskActive(player, "outbreak_quest_02_neutral", "findTroopers") + ); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_hasRescueQuestActive (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return (groundquests.isTaskActive(player, "outbreak_quest_rescue_01", "spawnSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_01", "coaxingPleyer") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_02", "spawnSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_02", "coaxingPleyer") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_03", "spawnSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_03", "coaxingPleyer") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_04", "spawnSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_04", "coaxingPleyer") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_05", "spawnSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_05", "coaxingPleyer") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_06", "spawnSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_06", "coaxingPleyer") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_07", "spawnSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_07", "coaxingPleyer") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_08", "spawnSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_08", "coaxingPleyer") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_09", "spawnSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_09", "coaxingPleyer") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_010", "spawnSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_010", "coaxingPleyer") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_011", "spawnSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_012", "coaxingPleyer") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_013", "spawnSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_013", "coaxingPleyer") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_014", "spawnSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_014", "coaxingPleyer") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_015", "spawnSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_015", "coaxingPleyer") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_016", "spawnSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_016", "coaxingPleyer") + ); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_failedRescueOne (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "outbreak_quest_rescue_01_fail"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_failedRescueTwo (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "outbreak_quest_rescue_02_fail"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_failedRescueThree (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "outbreak_quest_rescue_03_fail"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_failedRescueFour (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "outbreak_quest_rescue_04_fail"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_successRescueOne (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "outbreak_quest_rescue_01_success"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_successRescueTwo (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "outbreak_quest_rescue_02_success"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_successRescueThree (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "outbreak_quest_rescue_03_success"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_successRescueFour (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "outbreak_quest_rescue_04_success"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_hasShuttlePartQuestActive (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "outbreak_quest_shuttle_parts"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_isStuckRescuing (obj_id player, obj_id npc) +{ + faceTo(npc, player); + //the task name is misleading. If the player actually has this task active they are waiting for the + //npc to breach the trigger volumen. It may be that the NPC no longer exists and the player + //is stuck + return (groundquests.isTaskActive(player, "outbreak_quest_rescue_01", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_02", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_03", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_04", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_01", "speakSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_02", "speakSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_03", "speakSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_04", "speakSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_05", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_06", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_07", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_08", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_05", "speakSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_06", "speakSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_07", "speakSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_08", "speakSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_09", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_010", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_011", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_012", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_09", "speakSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_010", "speakSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_011", "speakSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_012", "speakSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_013", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_014", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_015", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_016", "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_013", "speakSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_014", "speakSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_015", "speakSurvivor") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_016", "speakSurvivor") + ); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_finishedRescueCanceledShuttle (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_04_success") + && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_shuttle_parts"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_hasShuttlePartsNotMechanic (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "outbreak_quest_shuttle_parts", "deliverMechanic"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_isImperialQuestPlayer (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_isRebelQuestPlayer (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_isNeutralQuestPlayer (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedQuest(player, "outbreak_quest_02_neutral"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_hasGivenPartsMechanic (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "outbreak_quest_shuttle_parts", "seeHX138"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_readyFirstRescue (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return (groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial") + || groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel") + || groundquests.hasCompletedQuest(player, "outbreak_quest_02_neutral")) + && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_01") + && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_05") + && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_06") + && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_07"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_hasFinishedShuttleParts (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedQuest(player, "outbreak_quest_shuttle_parts"); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_isPlayerGodMode (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return isGod(player); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_hasCompletedRescue3Del4 (obj_id player, obj_id npc) +{ + return (groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_03") + || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_011") + || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_012") + || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_013")) + && (!groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_04") + && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_014") + && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_015") + && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_016")); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_hasCompletedRescue2Del3 (obj_id player, obj_id npc) +{ + return (groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_02") + || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_08") + || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_09") + || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_010")) + && (!groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_03") + && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_011") + && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_012") + && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_013")); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_hasCompletedRescue1Del2 (obj_id player, obj_id npc) +{ + return (groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_01") + || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_05") + || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_06") + || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_07")) + && (!groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_02") + && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_08") + && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_09") + && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_010")); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_isOnDungeonMissions (obj_id player, obj_id npc) +{ + string faction = ""; + if(hx_138_condition_isImperialQuestPlayer(player,npc)) + { + faction = "imperial"; + } + else if(hx_138_condition_isRebelQuestPlayer(player,npc)) + { + faction = "rebel"; + } + else + { + faction = "neutral"; + } + + if(faction == null || faction.length() <= 0) + return false; + + boolean hasAValidQuest = false; + for(int i = 1; i <= 5; i++) + { + if(!groundquests.isQuestActiveOrComplete(player, "outbreak_quest_administrative_building_" + faction + "_0" + i)) + continue; + + hasAValidQuest = true; + break; + } + + return hasAValidQuest; +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_shuttleEscape (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return (groundquests.isTaskActive(player, "outbreak_quest_facility_05_imperial", "seeHX138") + || groundquests.isTaskActive(player, "outbreak_quest_facility_05_rebel", "seeHX138") + || groundquests.isTaskActive(player, "outbreak_quest_facility_05_neutral", "seeHX138")); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_hasCompletedRescue4DelShuttle (obj_id player, obj_id npc) +{ + return (groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_04") + || groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_014") + || groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_015") + || groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_016") + && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_shuttle_parts")); +} + +// ---------------------------------------------------------------------- + +boolean hx_138_condition_hasRadio (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "findEpsilonContact"); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void hx_138_action_sendSignalMetHX138 (obj_id player, obj_id npc) +{ + faceTo(npc, player); + groundquests.sendSignal(player, "playerFoundStormtroopers"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_resetRescueOne (obj_id player, obj_id npc) +{ + faceTo(npc, player); + groundquests.clearQuest(player, "outbreak_quest_rescue_01_fail"); + if(groundquests.isQuestActive(player, "outbreak_quest_rescue_01")) + groundquests.clearQuest(player, "outbreak_quest_rescue_01"); + else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_05")) + groundquests.clearQuest(player, "outbreak_quest_rescue_05"); + else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_06")) + groundquests.clearQuest(player, "outbreak_quest_rescue_06"); + else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_07")) + groundquests.clearQuest(player, "outbreak_quest_rescue_07"); + + hx_138_action_giveFirstSurvivorQuest(player,npc); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_giveSecondSurvivorQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + groundquests.clearQuest(player, "outbreak_quest_rescue_01_success"); + + int randNum = rand(1,4); + if(randNum <= 0 || randNum > 4) + { + return; + } + switch(randNum) + { + case 1: + groundquests.grantQuest(player, "outbreak_quest_rescue_02"); + break; + case 2: + groundquests.grantQuest(player, "outbreak_quest_rescue_08"); + break; + case 3: + groundquests.grantQuest(player, "outbreak_quest_rescue_09"); + break; + case 4: + groundquests.grantQuest(player, "outbreak_quest_rescue_010"); + break; + } +} + +// ---------------------------------------------------------------------- + +void hx_138_action_giveThirdSurvivorQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + groundquests.clearQuest(player, "outbreak_quest_rescue_02_success"); + + int randNum = rand(1,4); + if(randNum <= 0 || randNum > 4) + { + return; + } + switch(randNum) + { + case 1: + groundquests.grantQuest(player, "outbreak_quest_rescue_03"); + break; + case 2: + groundquests.grantQuest(player, "outbreak_quest_rescue_011"); + break; + case 3: + groundquests.grantQuest(player, "outbreak_quest_rescue_012"); + break; + case 4: + groundquests.grantQuest(player, "outbreak_quest_rescue_013"); + break; + } + +} + +// ---------------------------------------------------------------------- + +void hx_138_action_giveFourthSurvivorQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + groundquests.clearQuest(player, "outbreak_quest_rescue_03_success"); + + int randNum = rand(1,4); + if(randNum <= 0 || randNum > 4) + { + return; + } + switch(randNum) + { + case 1: + groundquests.grantQuest(player, "outbreak_quest_rescue_04"); + break; + case 2: + groundquests.grantQuest(player, "outbreak_quest_rescue_014"); + break; + case 3: + groundquests.grantQuest(player, "outbreak_quest_rescue_015"); + break; + case 4: + groundquests.grantQuest(player, "outbreak_quest_rescue_016"); + break; + } +} + +// ---------------------------------------------------------------------- + +void hx_138_action_resetRescueTwo (obj_id player, obj_id npc) +{ + faceTo(npc, player); + groundquests.clearQuest(player, "outbreak_quest_rescue_02_fail"); + + if(groundquests.isQuestActive(player, "outbreak_quest_rescue_02")) + groundquests.clearQuest(player, "outbreak_quest_rescue_02"); + else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_08")) + groundquests.clearQuest(player, "outbreak_quest_rescue_08"); + else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_09")) + groundquests.clearQuest(player, "outbreak_quest_rescue_09"); + else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_010")) + groundquests.clearQuest(player, "outbreak_quest_rescue_010"); + + hx_138_action_giveSecondSurvivorQuest(player,npc); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_resetRescueThree (obj_id player, obj_id npc) +{ + faceTo(npc, player); + groundquests.clearQuest(player, "outbreak_quest_rescue_03_fail"); + + if(groundquests.isQuestActive(player, "outbreak_quest_rescue_03")) + groundquests.clearQuest(player, "outbreak_quest_rescue_03"); + else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_011")) + groundquests.clearQuest(player, "outbreak_quest_rescue_011"); + else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_012")) + groundquests.clearQuest(player, "outbreak_quest_rescue_012"); + else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_013")) + groundquests.clearQuest(player, "outbreak_quest_rescue_013"); + + hx_138_action_giveThirdSurvivorQuest(player,npc); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_resetRescueFour (obj_id player, obj_id npc) +{ + faceTo(npc, player); + groundquests.clearQuest(player, "outbreak_quest_rescue_04_fail"); + + if(groundquests.isQuestActive(player, "outbreak_quest_rescue_04")) + groundquests.clearQuest(player, "outbreak_quest_rescue_04"); + else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_014")) + groundquests.clearQuest(player, "outbreak_quest_rescue_014"); + else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_015")) + groundquests.clearQuest(player, "outbreak_quest_rescue_015"); + else if(groundquests.isQuestActive(player, "outbreak_quest_rescue_016")) + groundquests.clearQuest(player, "outbreak_quest_rescue_016"); + + hx_138_action_giveFourthSurvivorQuest(player,npc); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_fixPlayerRescueQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(groundquests.isTaskActive(player, "outbreak_quest_rescue_01", "rescueCompleted")) + { + hx_138_action_resetRescueOne (player, npc); + } + else if(groundquests.isTaskActive(player, "outbreak_quest_rescue_02", "rescueCompleted")) + { + hx_138_action_resetRescueTwo (player, npc); + } + else if(groundquests.isTaskActive(player, "outbreak_quest_rescue_03", "rescueCompleted")) + { + hx_138_action_resetRescueThree (player, npc); + } + else + { + hx_138_action_resetRescueFour (player, npc); + } +} + +// ---------------------------------------------------------------------- + +void hx_138_action_finishRescueGiveShuttleQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + groundquests.clearQuest(player, "outbreak_quest_rescue_04_success"); + hx_138_action_giveShuttleQuest(player,npc); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_giveShuttleQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + groundquests.grantQuest(player, "outbreak_quest_shuttle_parts"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_finishShuttleParts (obj_id player, obj_id npc) +{ + faceTo(npc, player); + groundquests.sendSignal(player, "deliveredShuttleSupplies"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_giveFirstSurvivorQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + int randNum = rand(1,4); + if(randNum <= 0 || randNum > 4) + { + return; + } + switch(randNum) + { + case 1: + groundquests.grantQuest(player, "outbreak_quest_rescue_01"); + break; + case 2: + groundquests.grantQuest(player, "outbreak_quest_rescue_05"); + break; + case 3: + groundquests.grantQuest(player, "outbreak_quest_rescue_06"); + break; + case 4: + groundquests.grantQuest(player, "outbreak_quest_rescue_07"); + break; + } + +} + +// ---------------------------------------------------------------------- + +void hx_138_action_giveRandomInquisitorQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + int randNumber = rand(1,5); + if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_0"+randNumber); + } + else if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_0"+randNumber); + } + else + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_0"+randNumber); + } +} + +// ---------------------------------------------------------------------- + +void hx_138_action_giveInquisitorQuestOne (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_01"); + } + else if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_01"); + } + else + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_01"); + } +} + +// ---------------------------------------------------------------------- + +void hx_138_action_giveInquisitorQuestTwo (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_02"); + } + else if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_02"); + } + else + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_02"); + } +} + +// ---------------------------------------------------------------------- + +void hx_138_action_giveInquisitorQuestFive (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_05"); + } + else if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_05"); + } + else + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_05"); + } +} + +// ---------------------------------------------------------------------- + +void hx_138_action_giveInquisitorQuestFour (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_04"); + } + else if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_04"); + } + else + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_04"); + } +} + +// ---------------------------------------------------------------------- + +void hx_138_action_giveInquisitorQuestThree (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_03"); + } + else if(groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_03"); + } + else + { + groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_03"); + } +} + +// ---------------------------------------------------------------------- + +void hx_138_action_fixRescueGates (obj_id player, obj_id npc) +{ + faceTo(npc, player); + for(int i = 1; i <= 5; i++) + { + if(groundquests.isTaskActive(player, "outbreak_quest_rescue_0"+i, "rescueCompleted") + || groundquests.isTaskActive(player, "outbreak_quest_rescue_0"+i, "speakSurvivor")) + { + groundquests.clearQuest(player, "outbreak_quest_rescue_0"+i); + groundquests.grantQuest(player, "outbreak_quest_rescue_0"+i); + return; + } + } +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue01a (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_01"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue01d (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_07"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue01c (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_06"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue01b (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_05"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue02a (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_02"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue02d (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_010"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue02c (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_09"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue02b (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_08"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue03d (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_013"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue03c (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_012"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue03b (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_011"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue03a (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_03"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue04d (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_016"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue04c (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_015"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue04b (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_014"); +} + +// ---------------------------------------------------------------------- + +void hx_138_action_godModeRescue04a (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_quest_rescue_04"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int hx_138_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I've already noticed a boost in morale as a result of your efforts, %TU. You are certainly our saviour. + + //-- [RESPONSE NOTE] + //-- PLAYER: I'm no one special. + if (response == "s_122") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "shrug_shoulders"); + + //-- NPC: Mmmm...okay. Well, obviously you have your own mission. What is it exactly? + string_id message = new string_id (c_stringFile, "s_123"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I need to infiltrate the research facility. + boolean hasResponse0 = false; + if (hx_138_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_138"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: GOD MODE ONLY INQUISITOR QUEST TESTING + if (response == "s_177") + { + //-- [NOTE] + if (hx_138_condition_isImperialQuestPlayer (player, npc)) + { + //-- NPC: You are doing the Imp quest line, which Inquisitor quest would you like? + string_id message = new string_id (c_stringFile, "s_178"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Imperial Officer Body + boolean hasResponse0 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Imperial Scientist Body + boolean hasResponse1 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Imperial Stormtrooper Body + boolean hasResponse2 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: Imperial Scout Trooper Body + boolean hasResponse3 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + //-- PLAYER: Imperial Inquisitor Body + boolean hasResponse4 = false; + if (hx_138_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_181"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_182"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_183"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_184"); + + if (hasResponse4) + responses [responseIndex++] = new string_id (c_stringFile, "s_185"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_isRebelQuestPlayer (player, npc)) + { + //-- NPC: You are doing the Reb quest line, which Inquisitor quest would you like? + string_id message = new string_id (c_stringFile, "s_179"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Imperial Officer Body + boolean hasResponse0 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Imperial Scientist Body + boolean hasResponse1 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Imperial Stormtrooper Body + boolean hasResponse2 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: Imperial Scout Trooper Body + boolean hasResponse3 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + //-- PLAYER: Imperial Inquisitor Body + boolean hasResponse4 = false; + if (hx_138_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_191"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_192"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_193"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_194"); + + if (hasResponse4) + responses [responseIndex++] = new string_id (c_stringFile, "s_195"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_isNeutralQuestPlayer (player, npc)) + { + //-- NPC: You are doing the Neut quest line, which Inquisitor quest would you like? + string_id message = new string_id (c_stringFile, "s_180"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Imperial Officer Body + boolean hasResponse0 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Imperial Scientist Body + boolean hasResponse1 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Imperial Stormtrooper Body + boolean hasResponse2 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: Imperial Scout Trooper Body + boolean hasResponse3 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + //-- PLAYER: Imperial Inquisitor Body + boolean hasResponse4 = false; + if (hx_138_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_196"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_197"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_198"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_199"); + + if (hasResponse4) + responses [responseIndex++] = new string_id (c_stringFile, "s_200"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 22); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Mmmm...okay. Well, obviously you have your own mission. What is it exactly? + + //-- [RESPONSE NOTE] + //-- PLAYER: I need to infiltrate the research facility. + if (response == "s_138") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "laugh"); + + //-- NPC: Yeah right. Ha ha...seriously now. + string_id message = new string_id (c_stringFile, "s_139"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Uh, I need to infiltrate the research facility? + boolean hasResponse0 = false; + if (hx_138_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_140"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yeah right. Ha ha...seriously now. + + //-- [RESPONSE NOTE] + //-- PLAYER: Uh, I need to infiltrate the research facility? + if (response == "s_140") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + //-- NPC: What? You were serious? Look, I can't ask these guys to help you. We've lost too many as it is. + string_id message = new string_id (c_stringFile, "s_141"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I don't need your men. All I need is a way to get in. + boolean hasResponse0 = false; + if (hx_138_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_142"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: What? You were serious? Look, I can't ask these guys to help you. We've lost too many as it is. + + //-- [RESPONSE NOTE] + //-- PLAYER: I don't need your men. All I need is a way to get in. + if (response == "s_142") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + //-- NPC: That is suicide, but hey, you have made it this far. + string_id message = new string_id (c_stringFile, "s_143"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I gather the facility is sealed? + boolean hasResponse0 = false; + if (hx_138_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_144"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: That is suicide, but hey, you have made it this far. + + //-- [RESPONSE NOTE] + //-- PLAYER: I gather the facility is sealed? + if (response == "s_144") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + //-- NPC: No, but I hear it is very large and hard to navigate. The best way to find out where everything is down there is to get an administrative access key. You will have to talk to the Inquisitor about this, I was always responsible for duties topside. + string_id message = new string_id (c_stringFile, "s_145"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I see. Well it's been a pleasure. + boolean hasResponse0 = false; + if (hx_138_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_146"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: No, but I hear it is very large and hard to navigate. The best way to find out where everything is down there is to get an administrative access key. You will have to talk to the Inquisitor about this, I was always responsible for duties topside. + + //-- [RESPONSE NOTE] + //-- PLAYER: I see. Well it's been a pleasure. + if (response == "s_146") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "bow3"); + + hx_138_action_giveRandomInquisitorQuest (player, npc); + + //-- NPC: The pleasure was all mine, %TU. + string_id message = new string_id (c_stringFile, "s_147"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You are doing the Imp quest line, which Inquisitor quest would you like? + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial Officer Body + if (response == "s_181") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveInquisitorQuestOne (player, npc); + + //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. + string_id message = new string_id (c_stringFile, "s_186"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial Scientist Body + if (response == "s_182") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveInquisitorQuestTwo (player, npc); + + //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. + string_id message = new string_id (c_stringFile, "s_187"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial Stormtrooper Body + if (response == "s_183") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveInquisitorQuestThree (player, npc); + + //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. + string_id message = new string_id (c_stringFile, "s_188"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial Scout Trooper Body + if (response == "s_184") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveInquisitorQuestFour (player, npc); + + //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. + string_id message = new string_id (c_stringFile, "s_189"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial Inquisitor Body + if (response == "s_185") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveInquisitorQuestFive (player, npc); + + //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. + string_id message = new string_id (c_stringFile, "s_190"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch16 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You are doing the Reb quest line, which Inquisitor quest would you like? + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial Officer Body + if (response == "s_191") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveInquisitorQuestOne (player, npc); + + //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. + string_id message = new string_id (c_stringFile, "s_201"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial Scientist Body + if (response == "s_192") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveInquisitorQuestTwo (player, npc); + + //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. + string_id message = new string_id (c_stringFile, "s_202"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial Stormtrooper Body + if (response == "s_193") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveInquisitorQuestThree (player, npc); + + //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. + string_id message = new string_id (c_stringFile, "s_203"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial Scout Trooper Body + if (response == "s_194") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveInquisitorQuestFour (player, npc); + + //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. + string_id message = new string_id (c_stringFile, "s_204"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial Inquisitor Body + if (response == "s_195") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveInquisitorQuestFive (player, npc); + + //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. + string_id message = new string_id (c_stringFile, "s_205"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch22 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You are doing the Neut quest line, which Inquisitor quest would you like? + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial Officer Body + if (response == "s_196") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveInquisitorQuestOne (player, npc); + + //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. + string_id message = new string_id (c_stringFile, "s_206"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial Scientist Body + if (response == "s_197") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveInquisitorQuestTwo (player, npc); + + //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. + string_id message = new string_id (c_stringFile, "s_207"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial Stormtrooper Body + if (response == "s_198") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveInquisitorQuestThree (player, npc); + + //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. + string_id message = new string_id (c_stringFile, "s_208"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial Scout Trooper Body + if (response == "s_199") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveInquisitorQuestFour (player, npc); + + //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. + string_id message = new string_id (c_stringFile, "s_209"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Imperial Inquisitor Body + if (response == "s_200") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveInquisitorQuestFive (player, npc); + + //-- NPC: Done. If this quest wasn't received, make sure you haven't already received or completed it. + string_id message = new string_id (c_stringFile, "s_210"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch32 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Hmmm....what happened? Do you need to redo the quest? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes! + if (response == "s_104") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_fixRescueGates (player, npc); + + //-- NPC: Okay...lets fix this. + string_id message = new string_id (c_stringFile, "s_105"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch34 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You did it again, %TU. That was the last one. But we need you again. + + //-- [RESPONSE NOTE] + //-- PLAYER: What is it this time? + if (response == "s_63") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + //-- NPC: The shuttle needs parts before we can start the evacuation. + string_id message = new string_id (c_stringFile, "s_65"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What parts are needed? + boolean hasResponse0 = false; + if (hx_138_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_67"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 35); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch35 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: The shuttle needs parts before we can start the evacuation. + + //-- [RESPONSE NOTE] + //-- PLAYER: What parts are needed? + if (response == "s_67") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + //-- NPC: We need fuel cells for the retro-thrust engines for starters, but we also need a new spinal trunk. While we were trying to rewire the spinal trunk we managed to blow the computer core memory. + string_id message = new string_id (c_stringFile, "s_69"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Uh...wow. Anything else? + boolean hasResponse0 = false; + if (hx_138_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_71"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 36); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch36 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: We need fuel cells for the retro-thrust engines for starters, but we also need a new spinal trunk. While we were trying to rewire the spinal trunk we managed to blow the computer core memory. + + //-- [RESPONSE NOTE] + //-- PLAYER: Uh...wow. Anything else? + if (response == "s_71") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + //-- NPC: Yeah, we need a few power converters. + string_id message = new string_id (c_stringFile, "s_73"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: How will I find all of these? + boolean hasResponse0 = false; + if (hx_138_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.hx_138.branchId", 37); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch37 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yeah, we need a few power converters. + + //-- [RESPONSE NOTE] + //-- PLAYER: How will I find all of these? + if (response == "s_75") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + //-- NPC: The onboard computer has located several downed shuttles within the area. Go to those locations and search the wreckage for the parts. + string_id message = new string_id (c_stringFile, "s_77"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Give me the coordinates. + boolean hasResponse0 = false; + if (hx_138_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_79"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 38); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch38 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: The onboard computer has located several downed shuttles within the area. Go to those locations and search the wreckage for the parts. + + //-- [RESPONSE NOTE] + //-- PLAYER: Give me the coordinates. + if (response == "s_79") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_finishRescueGiveShuttleQuest (player, npc); + + //-- NPC: Uploaded to your datapad. Good luck. We are all relying on you. + string_id message = new string_id (c_stringFile, "s_81"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch40 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yet another death. These survivors are depending on you, %TU! Luckily another survivor at that same location contacted us. Don't think, just do. + + //-- [RESPONSE NOTE] + //-- PLAYER: Ok...okay, I'm ready. + if (response == "s_85") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_resetRescueFour (player, npc); + + //-- NPC: Bring him home, %TU! + string_id message = new string_id (c_stringFile, "s_87"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch42 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: The Emperor will hear about you and all your fine work here, %TU. You are a true hero. + + //-- [RESPONSE NOTE] + //-- PLAYER: Great. Tell him I miss Alderaan. + if (response == "s_91") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + //-- NPC: You can channel your rebellious anger into rescuing the next survivor, %TU. + string_id message = new string_id (c_stringFile, "s_93"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Consider it channeled. + boolean hasResponse0 = false; + if (hx_138_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_95"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 43); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcSpeak (player, pp); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I exist to serve. + if (response == "s_99") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveFourthSurvivorQuest (player, npc); + + //-- NPC: Bring this one back, just like the last one, %TU. + string_id message = new string_id (c_stringFile, "s_101"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: (Godmode) I want to test the 4 different rescue 4 quests. + if (response == "s_356") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + //-- NPC: Make sure you don't already have the quest, then select a choice below. + string_id message = new string_id (c_stringFile, "s_357"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: outbreak_quest_rescue_04a + boolean hasResponse0 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: outbreak_quest_rescue_04b + boolean hasResponse1 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: outbreak_quest_rescue_04c + boolean hasResponse2 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: outbreak_quest_rescue_04d + boolean hasResponse3 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_358"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_359"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_360"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_361"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 46); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch43 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You can channel your rebellious anger into rescuing the next survivor, %TU. + + //-- [RESPONSE NOTE] + //-- PLAYER: Consider it channeled. + if (response == "s_95") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveFourthSurvivorQuest (player, npc); + + //-- NPC: Bring this one back, just like the last one, %TU. + string_id message = new string_id (c_stringFile, "s_97"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch46 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Make sure you don't already have the quest, then select a choice below. + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_04a + if (response == "s_358") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue04a (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_362"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_04b + if (response == "s_359") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue04b (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_364"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_04c + if (response == "s_360") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue04c (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_363"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_04d + if (response == "s_361") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue04d (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_365"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch51 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: We obviously can't save everyone. %TU, but we have to try. If you aren't the person for these missions please speak up. + + //-- [RESPONSE NOTE] + //-- PLAYER: I can do it. Give me another chance. + if (response == "s_121") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_resetRescueThree (player, npc); + + //-- NPC: There is another survivor at that same location. Don't mess this one up! + string_id message = new string_id (c_stringFile, "s_125"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch53 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Another success. That survivor may live into old age because of you. Great work. + + //-- [RESPONSE NOTE] + //-- PLAYER: We're done? + if (response == "s_129") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + //-- NPC: No. Another survivor is a little further out. Are you ready to attempt a rescue? + string_id message = new string_id (c_stringFile, "s_131"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I am ready. + boolean hasResponse0 = false; + if (hx_138_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_133"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 54); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: (Godmode) I want to test the 4 different rescue 3 quests. + if (response == "s_345") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + //-- NPC: Make sure you don't already have the quest, then select a choice below. + string_id message = new string_id (c_stringFile, "s_346"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: outbreak_quest_rescue_03a + boolean hasResponse0 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: outbreak_quest_rescue_03b + boolean hasResponse1 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: outbreak_quest_rescue_03c + boolean hasResponse2 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: outbreak_quest_rescue_03d + boolean hasResponse3 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_347"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_349"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_350"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_351"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 56); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch54 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: No. Another survivor is a little further out. Are you ready to attempt a rescue? + + //-- [RESPONSE NOTE] + //-- PLAYER: I am ready. + if (response == "s_133") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveThirdSurvivorQuest (player, npc); + + //-- NPC: Find that survivor, %TU. + string_id message = new string_id (c_stringFile, "s_135"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch56 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Make sure you don't already have the quest, then select a choice below. + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_03a + if (response == "s_347") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue03a (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_348"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_03b + if (response == "s_349") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue03b (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_352"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_03c + if (response == "s_350") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue03c (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_353"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_03d + if (response == "s_351") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue03d (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_354"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch61 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You've managed to save one survivor so I know you aren't completely incompetent. Stay alert! We have another survivor at that same location so you have a second chance. + + //-- [RESPONSE NOTE] + //-- PLAYER: I'm ready. + if (response == "s_159") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_resetRescueTwo (player, npc); + + //-- NPC: Go be the hero we need. + string_id message = new string_id (c_stringFile, "s_161"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch63 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Great work bringing the survivor back. We have a few more to rescue. Are you ready for the next location? + + //-- [RESPONSE NOTE] + //-- PLAYER: I am. + if (response == "s_165") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveSecondSurvivorQuest (player, npc); + + //-- NPC: Here is the second survivor + string_id message = new string_id (c_stringFile, "s_167"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: (Godmode) I want to test the 4 different rescue 2 quests. + if (response == "s_320") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + //-- NPC: Make sure you don't already have the quest, then select a choice below. + string_id message = new string_id (c_stringFile, "s_321"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: outbreak_quest_rescue_02a + boolean hasResponse0 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: outbreak_quest_rescue_02b + boolean hasResponse1 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: outbreak_quest_rescue_02c + boolean hasResponse2 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: outbreak_quest_rescue_02d + boolean hasResponse3 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_325"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_334"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_338"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_342"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 65); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch65 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Make sure you don't already have the quest, then select a choice below. + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_02a + if (response == "s_325") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue02a (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_326"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_02b + if (response == "s_334") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue02b (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_336"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_02c + if (response == "s_338") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue02c (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_340"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_02d + if (response == "s_342") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue02d (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_344"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch70 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Look, I'm sure you feel horrible so I'll spare you any additional guilt. Luckily, another survivor at that same location contacted us so you have a second chance. + + //-- [RESPONSE NOTE] + //-- PLAYER: I'm ready. + if (response == "s_216") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "shakefist"); + + hx_138_action_resetRescueOne (player, npc); + + //-- NPC: Bring back the survivor alive this time! + string_id message = new string_id (c_stringFile, "s_218"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch77 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Are you ready to get to work? Alright. We have a situation. There are survivors spread out topside and I need someone to go and lead them back. The others are too weakened by the lack of supplies but you look fit to carry on the task. What do you say? + + //-- [RESPONSE NOTE] + //-- PLAYER: If I agree will you help me with my mission? + if (response == "s_305") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + //-- NPC: Sure. We'll have time after you do a few tasks to find out exactly what that entails. Are you ready for the first location? + string_id message = new string_id (c_stringFile, "s_307"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes + boolean hasResponse0 = false; + if (hx_138_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_308"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 78); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: (Godmode) I want to test the 4 different rescue 1 quests. + if (response == "s_310") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + //-- NPC: Make sure you don't already have the quest, then select a choice below. + string_id message = new string_id (c_stringFile, "s_311"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: outbreak_quest_rescue_01a + boolean hasResponse0 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: outbreak_quest_rescue_01b + boolean hasResponse1 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: outbreak_quest_rescue_01c + boolean hasResponse2 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: outbreak_quest_rescue_01d + boolean hasResponse3 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_312"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_313"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_314"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_315"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 80); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch78 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Sure. We'll have time after you do a few tasks to find out exactly what that entails. Are you ready for the first location? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes + if (response == "s_308") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_giveFirstSurvivorQuest (player, npc); + + //-- NPC: Here is the first location. + string_id message = new string_id (c_stringFile, "s_309"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch80 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Make sure you don't already have the quest, then select a choice below. + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_01a + if (response == "s_312") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue01a (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_316"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_01b + if (response == "s_313") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue01b (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_317"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_01c + if (response == "s_314") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue01c (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_318"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: outbreak_quest_rescue_01d + if (response == "s_315") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_godModeRescue01d (player, npc); + + //-- NPC: Done + string_id message = new string_id (c_stringFile, "s_319"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int hx_138_handleBranch85 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Another of the living! Tell me you came here by shuttle. + + //-- [RESPONSE NOTE] + //-- PLAYER: No. Shuttles are not allowed into the quarantine zone. + if (response == "s_244") + { + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + hx_138_action_sendSignalMetHX138 (player, npc); + + //-- NPC: As I suspected. How did you get here? Oh that isn't important. Go get some rest and when you are ready, come back. I need a volunteer. + string_id message = new string_id (c_stringFile, "s_249"); + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.hx_138"); + + 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.hx_138"); + + 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 (hx_138_condition_shuttleEscape (player, npc)) + { + doAnimationAction (npc, "gesticulate_wildly"); + + //-- NPC: I ordered the shuttle to take off half an hour ago but they insisted on waiting for you. Get on that shuttle hero! + string_id message = new string_id (c_stringFile, "s_253"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_isOnDungeonMissions (player, npc)) + { + //-- NPC: Good luck with that mission of yours. We'll wait as long as we can for you, but don't expect us to wait too long. + string_id message = new string_id (c_stringFile, "s_251"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_hasFinishedShuttleParts (player, npc)) + { + //-- NPC: I've already noticed a boost in morale as a result of your efforts, %TU. You are certainly our saviour. + string_id message = new string_id (c_stringFile, "s_113"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm no one special. + boolean hasResponse0 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: GOD MODE ONLY INQUISITOR QUEST TESTING + boolean hasResponse1 = false; + if (hx_138_condition_isPlayerGodMode (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_122"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_177"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 3); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "hx_138", 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 (hx_138_condition_hasGivenPartsMechanic (player, npc)) + { + doAnimationAction (npc, "celebrate"); + + hx_138_action_finishShuttleParts (player, npc); + + //-- NPC: Fantastic work, %TU! Come back when you have gotten some rest. I can help you with your mission. + string_id message = new string_id (c_stringFile, "s_174"); + 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 (hx_138_condition_hasShuttlePartsNotMechanic (player, npc)) + { + //-- NPC: Looks like you have all the parts. Give them to the mechanic and come back...there is something else that has come up. + string_id message = new string_id (c_stringFile, "s_110"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_finishedRescueCanceledShuttle (player, npc)) + { + hx_138_action_giveShuttleQuest (player, npc); + + //-- NPC: Looks like you lost the datapad information with the shuttle waypoints. Let me give that to you again. + string_id message = new string_id (c_stringFile, "s_109"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_hasShuttlePartQuestActive (player, npc)) + { + //-- NPC: Come back when you have the shuttle parts. + string_id message = new string_id (c_stringFile, "s_56"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_isStuckRescuing (player, npc)) + { + //-- NPC: Hmmm....what happened? Do you need to redo the quest? + string_id message = new string_id (c_stringFile, "s_103"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes! + boolean hasResponse0 = false; + if (hx_138_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_104"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 32); + + npcStartConversation (player, npc, "hx_138", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_successRescueFour (player, npc)) + { + //-- NPC: You did it again, %TU. That was the last one. But we need you again. + string_id message = new string_id (c_stringFile, "s_61"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What is it this time? + boolean hasResponse0 = false; + if (hx_138_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_63"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 34); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "hx_138", 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 (hx_138_condition_failedRescueFour (player, npc)) + { + //-- NPC: Yet another death. These survivors are depending on you, %TU! Luckily another survivor at that same location contacted us. Don't think, just do. + string_id message = new string_id (c_stringFile, "s_83"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Ok...okay, I'm ready. + boolean hasResponse0 = false; + if (hx_138_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.hx_138.branchId", 40); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "hx_138", 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 (hx_138_condition_successRescueThree (player, npc)) + { + //-- NPC: The Emperor will hear about you and all your fine work here, %TU. You are a true hero. + string_id message = new string_id (c_stringFile, "s_89"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Great. Tell him I miss Alderaan. + boolean hasResponse0 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: I exist to serve. + boolean hasResponse1 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: (Godmode) I want to test the 4 different rescue 4 quests. + boolean hasResponse2 = false; + if (hx_138_condition_isPlayerGodMode (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_91"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_99"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_356"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 42); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "hx_138", 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 (hx_138_condition_failedRescueThree (player, npc)) + { + //-- NPC: We obviously can't save everyone. %TU, but we have to try. If you aren't the person for these missions please speak up. + string_id message = new string_id (c_stringFile, "s_119"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I can do it. Give me another chance. + boolean hasResponse0 = false; + if (hx_138_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_121"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 51); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "hx_138", 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 (hx_138_condition_successRescueTwo (player, npc)) + { + //-- NPC: Another success. That survivor may live into old age because of you. Great work. + string_id message = new string_id (c_stringFile, "s_127"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: We're done? + boolean hasResponse0 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: (Godmode) I want to test the 4 different rescue 3 quests. + boolean hasResponse1 = false; + if (hx_138_condition_isPlayerGodMode (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_129"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_345"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 53); + + npcStartConversation (player, npc, "hx_138", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_failedRescueTwo (player, npc)) + { + //-- NPC: You've managed to save one survivor so I know you aren't completely incompetent. Stay alert! We have another survivor at that same location so you have a second chance. + string_id message = new string_id (c_stringFile, "s_157"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm ready. + boolean hasResponse0 = false; + if (hx_138_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_159"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 61); + + npcStartConversation (player, npc, "hx_138", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_successRescueOne (player, npc)) + { + //-- NPC: Great work bringing the survivor back. We have a few more to rescue. Are you ready for the next location? + string_id message = new string_id (c_stringFile, "s_163"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I am. + boolean hasResponse0 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: (Godmode) I want to test the 4 different rescue 2 quests. + boolean hasResponse1 = false; + if (hx_138_condition_isPlayerGodMode (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_165"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_320"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 63); + + npcStartConversation (player, npc, "hx_138", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_failedRescueOne (player, npc)) + { + //-- NPC: Look, I'm sure you feel horrible so I'll spare you any additional guilt. Luckily, another survivor at that same location contacted us so you have a second chance. + string_id message = new string_id (c_stringFile, "s_214"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm ready. + boolean hasResponse0 = false; + if (hx_138_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_216"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 70); + + npcStartConversation (player, npc, "hx_138", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_hasRescueQuestActive (player, npc)) + { + doAnimationAction (npc, "shrug_shoulders"); + + //-- NPC: Where is the survivor? There is no time for resting. Find that survivor and bring him back alive! + string_id message = new string_id (c_stringFile, "s_220"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_hasCompletedRescue4DelShuttle (player, npc)) + { + hx_138_action_giveShuttleQuest (player, npc); + + //-- NPC: Looks like you took a break. Are you ready to go get those shuttle parts? + string_id message = new string_id (c_stringFile, "s_255"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_hasCompletedRescue3Del4 (player, npc)) + { + hx_138_action_giveFourthSurvivorQuest (player, npc); + + //-- NPC: Looks like you took a break. Hope you are ready to get started on the rescuing the last survivor. + string_id message = new string_id (c_stringFile, "s_245"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_hasCompletedRescue2Del3 (player, npc)) + { + hx_138_action_giveThirdSurvivorQuest (player, npc); + + //-- NPC: Looks like you took a break. Hope you are ready to get started on the rescuing the next survivor. + string_id message = new string_id (c_stringFile, "s_246"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_hasCompletedRescue1Del2 (player, npc)) + { + hx_138_action_giveSecondSurvivorQuest (player, npc); + + //-- NPC: Looks like you took a break. Hope you are ready to get started on the rescuing a survivor. + string_id message = new string_id (c_stringFile, "s_247"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_readyFirstRescue (player, npc)) + { + //-- NPC: Are you ready to get to work? Alright. We have a situation. There are survivors spread out topside and I need someone to go and lead them back. The others are too weakened by the lack of supplies but you look fit to carry on the task. What do you say? + string_id message = new string_id (c_stringFile, "s_226"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: If I agree will you help me with my mission? + boolean hasResponse0 = false; + if (hx_138_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: (Godmode) I want to test the 4 different rescue 1 quests. + boolean hasResponse1 = false; + if (hx_138_condition_isPlayerGodMode (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_305"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_310"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 77); + + npcStartConversation (player, npc, "hx_138", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_firstMeeting (player, npc)) + { + doAnimationAction (npc, "nod"); + + //-- NPC: Another of the living! Tell me you came here by shuttle. + string_id message = new string_id (c_stringFile, "s_242"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: No. Shuttles are not allowed into the quarantine zone. + boolean hasResponse0 = false; + if (hx_138_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_244"); + + utils.setScriptVar (player, "conversation.hx_138.branchId", 85); + + npcStartConversation (player, npc, "hx_138", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition_hasRadio (player, npc)) + { + //-- NPC: Hello there...deliver that radio to Sogan Varga. He'll be able to put it to use. + string_id message = new string_id (c_stringFile, "s_257"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (hx_138_condition__defaultCondition (player, npc)) + { + //-- NPC: I don't know who you are but you can stay with us. We'll get you out of here sooner or later. + string_id message = new string_id (c_stringFile, "s_258"); + 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 != "hx_138") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.hx_138.branchId"); + + if (branchId == 3 && hx_138_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && hx_138_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && hx_138_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && hx_138_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && hx_138_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && hx_138_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && hx_138_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 16 && hx_138_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 22 && hx_138_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 32 && hx_138_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 34 && hx_138_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 35 && hx_138_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 36 && hx_138_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 37 && hx_138_handleBranch37 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 38 && hx_138_handleBranch38 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 40 && hx_138_handleBranch40 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 42 && hx_138_handleBranch42 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 43 && hx_138_handleBranch43 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 46 && hx_138_handleBranch46 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 51 && hx_138_handleBranch51 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 53 && hx_138_handleBranch53 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 54 && hx_138_handleBranch54 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 56 && hx_138_handleBranch56 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 61 && hx_138_handleBranch61 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 63 && hx_138_handleBranch63 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 65 && hx_138_handleBranch65 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 70 && hx_138_handleBranch70 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 77 && hx_138_handleBranch77 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 78 && hx_138_handleBranch78 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 80 && hx_138_handleBranch80 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 85 && hx_138_handleBranch85 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.hx_138.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/jedi_robe_jinsu_taker.script b/sku.0/sys.server/compiled/game/script/conversation/jedi_robe_jinsu_taker.script index ebb8d305c..b72e034a7 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/jedi_robe_jinsu_taker.script +++ b/sku.0/sys.server/compiled/game/script/conversation/jedi_robe_jinsu_taker.script @@ -1,1196 +1,1196 @@ -// ====================================================================== -// -// jedi_robe_jinsu_taker.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.static_item; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/jedi_robe_jinsu_taker"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean jedi_robe_jinsu_taker_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean jedi_robe_jinsu_taker_condition_readyToHandOverJinsu (obj_id player, obj_id npc) -{ - if ( hasCompletedCollectionSlotPrereq(player, "col_lightsaber_1h_01_02") ) - { - if ( !hasCompletedCollectionSlot(player, "col_lightsaber_1h_01_02") ) - { - string jinsuTemplate = "object/weapon/melee/sword/crafted_saber/sword_lightsaber_mandalorian.iff"; - if ( utils.playerHasItemByTemplateInInventoryOrEquipped(player, jinsuTemplate) ) - { - return true; - } - } - } - - return false; -} - -// ---------------------------------------------------------------------- - -boolean jedi_robe_jinsu_taker_condition_alreadyGaveJinsu (obj_id player, obj_id npc) -{ - return hasCompletedCollectionSlot(player, "col_lightsaber_1h_01_02"); -} - -// ---------------------------------------------------------------------- - -boolean jedi_robe_jinsu_taker_condition_takeJinsu (obj_id player, obj_id npc) -{ - obj_id jinsuSaber = obj_id.NULL_ID; - string desiredTemplate = "object/weapon/melee/sword/crafted_saber/sword_lightsaber_mandalorian.iff"; - - obj_id[] contents = getInventoryAndEquipment(player); - if (contents != null) - { - for(int i = 0; i 0 ) - { - for ( int i = 0; i < jinsuCrystals.length; i++ ) - { - obj_id crystal = jinsuCrystals[i]; - if ( isIdValid(crystal) ) - { - putInOverloaded(crystal, playerInv); - } - } - } - } - - destroyObject(jinsuSaber); - modifyCollectionSlotValue(player, "col_lightsaber_1h_01_02", 1); - return true; - } - - return false; -} - -// ---------------------------------------------------------------------- - -boolean jedi_robe_jinsu_taker_condition_canReceive5GenPvP (obj_id player, obj_id npc) -{ - obj_id pvpSaberSchematic1Hand = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_01"); - if(isIdValid(pvpSaberSchematic1Hand) && hasCompletedCollection(player, "col_lightsaber_1h_01")) - { - return true; - } - - obj_id pvpSaberSchematic2Hand = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_02"); - if(isIdValid(pvpSaberSchematic2Hand) && hasCompletedCollection(player, "col_lightsaber_2h_01")) - { - return true; - } - - obj_id pvpSaberSchematicStaff = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_03"); - if(isIdValid(pvpSaberSchematicStaff) && hasCompletedCollection(player, "col_lightsaber_polearm_01")) - { - return true; - } - - return false; -} - -// ---------------------------------------------------------------------- - -boolean jedi_robe_jinsu_taker_condition_canTrade1Hand (obj_id player, obj_id npc) -{ - return isIdValid(utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_01")); -} - -// ---------------------------------------------------------------------- - -boolean jedi_robe_jinsu_taker_condition_canTrade2Hand (obj_id player, obj_id npc) -{ - return isIdValid(utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_02")); -} - -// ---------------------------------------------------------------------- - -boolean jedi_robe_jinsu_taker_condition_canTradeStaff (obj_id player, obj_id npc) -{ - return isIdValid(utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_03")); -} - -// ---------------------------------------------------------------------- - -boolean jedi_robe_jinsu_taker_condition_canReceive5thGenSaber (obj_id player, obj_id npc) -{ - return jedi_robe_jinsu_taker_condition_canReceive5GenPvP(player, npc) || jedi_robe_jinsu_taker_condition_canReceive5GenGCW(player, npc); -} - -// ---------------------------------------------------------------------- - -boolean jedi_robe_jinsu_taker_condition_canReceive5GenGCW (obj_id player, obj_id npc) -{ - obj_id gcwSaberSchematic1Hand = utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_1h_gen4"); - if(isIdValid(gcwSaberSchematic1Hand) && hasCompletedCollection(player, "col_lightsaber_1h_01")) - { - return true; - } - - obj_id gcwSaberSchematic2Hand = utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_2h_gen4"); - if(isIdValid(gcwSaberSchematic2Hand) && hasCompletedCollection(player, "col_lightsaber_2h_01")) - { - return true; - } - return false; -} - -// ---------------------------------------------------------------------- - -boolean jedi_robe_jinsu_taker_condition_canTradeGcw1Hand (obj_id player, obj_id npc) -{ - return isIdValid(utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_1h_gen4")); -} - -// ---------------------------------------------------------------------- - -boolean jedi_robe_jinsu_taker_condition_canTradeGcw2Hand (obj_id player, obj_id npc) -{ - return isIdValid(utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_2h_gen4")); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void jedi_robe_jinsu_taker_action_upgrade1HandPvP (obj_id player, obj_id npc) -{ - obj_id oldSchematic = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_01"); - obj_id newSchematic = static_item.createNewItemFunction("item_schematic_pvp_bf_saber_03_04", player); - - if((isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) && isIdValid(newSchematic)) - { - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") has upgraded their saber schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version "+ getStaticItemName(newSchematic) +"("+newSchematic+"). This will destroy the old one."); - destroyObject(oldSchematic); - } - else - { - sendSystemMessage(player, new string_id("spam", "couldnt_upgrade_saber_schematic")); - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") could NOT upgrade their schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version. One of these statements returned false: (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) = " + (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player)+ "or isIdValid(newSchematic) = " + isIdValid(newSchematic)); - } -} - -// ---------------------------------------------------------------------- - -void jedi_robe_jinsu_taker_action_upgrade2HandPvP (obj_id player, obj_id npc) -{ - obj_id oldSchematic = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_02"); - obj_id newSchematic = static_item.createNewItemFunction("item_schematic_pvp_bf_saber_03_05", player); - - if((isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) && isIdValid(newSchematic)) - { - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") has upgraded their saber schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version "+ getStaticItemName(newSchematic) +"("+newSchematic+"). This will destroy the old one."); - destroyObject(oldSchematic); - } - else - { - sendSystemMessage(player, new string_id("spam", "couldnt_upgrade_saber_schematic")); - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") could NOT upgrade their schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version. One of these statements returned false: (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) = " + (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player)+ "or isIdValid(newSchematic) = " + isIdValid(newSchematic)); - } -} - -// ---------------------------------------------------------------------- - -void jedi_robe_jinsu_taker_action_upgradeStaffPvP (obj_id player, obj_id npc) -{ - obj_id oldSchematic = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_03"); - obj_id newSchematic = static_item.createNewItemFunction("item_schematic_pvp_bf_saber_03_06", player); - - if((isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) && isIdValid(newSchematic)) - { - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") has upgraded their saber schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version "+ getStaticItemName(newSchematic) +"("+newSchematic+"). This will destroy the old one."); - destroyObject(oldSchematic); - } - else - { - sendSystemMessage(player, new string_id("spam", "couldnt_upgrade_saber_schematic")); - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") could NOT upgrade their schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version. One of these statements returned false: (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) = " + (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player)+ "or isIdValid(newSchematic) = " + isIdValid(newSchematic)); - } -} - -// ---------------------------------------------------------------------- - -void jedi_robe_jinsu_taker_action_upgradeGcw1Handed (obj_id player, obj_id npc) -{ - obj_id oldSchematic = utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_1h_gen4"); - obj_id newSchematic = static_item.createNewItemFunction("item_schematic_pvp_gcw_saber_1h_gen5", player); - - if((isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) && isIdValid(newSchematic)) - { - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") has upgraded their saber schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version "+ getStaticItemName(newSchematic) +"("+newSchematic+"). This will destroy the old one."); - destroyObject(oldSchematic); - } - else - { - sendSystemMessage(player, new string_id("spam", "couldnt_upgrade_saber_schematic")); - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") could NOT upgrade their schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version. One of these statements returned false: (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) = " + (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player)+ "or isIdValid(newSchematic) = " + isIdValid(newSchematic)); - } -} - -// ---------------------------------------------------------------------- - -void jedi_robe_jinsu_taker_action_upgradeGcw2Handed (obj_id player, obj_id npc) -{ - obj_id oldSchematic = utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_2h_gen4"); - obj_id newSchematic = static_item.createNewItemFunction("item_schematic_pvp_gcw_saber_2h_gen5", player); - - if((isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) && isIdValid(newSchematic)) - { - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") has upgraded their saber schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version "+ getStaticItemName(newSchematic) +"("+newSchematic+"). This will destroy the old one."); - destroyObject(oldSchematic); - } - else - { - sendSystemMessage(player, new string_id("spam", "couldnt_upgrade_saber_schematic")); - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") could NOT upgrade their schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version. One of these statements returned false: (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) = " + (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player)+ "or isIdValid(newSchematic) = " + isIdValid(newSchematic)); - } -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int jedi_robe_jinsu_taker_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Welcome back %TU. I see that you have a schematic for a new saber. Would you like to learn how to make it more powerful? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes I would. - if (response == "s_29") - { - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - //-- NPC: Which Saber would you like to upgrade? - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: The Sith Saber please. - boolean hasResponse0 = false; - if (jedi_robe_jinsu_taker_condition_canTrade1Hand (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: The Two-Handed Mysterious Saber please. - boolean hasResponse1 = false; - if (jedi_robe_jinsu_taker_condition_canTrade2Hand (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: The Double-Bladed Darth Phobos Saber please - boolean hasResponse2 = false; - if (jedi_robe_jinsu_taker_condition_canTradeStaff (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: This Fourth Generation One-Handed Lightsaber Hilt purchased from a GCW Vendor. - boolean hasResponse3 = false; - if (jedi_robe_jinsu_taker_condition_canTradeGcw1Hand (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - //-- PLAYER: This Fourth Generation Two-Handed Lightsaber Hilt purchased from a GCW Vendor. - boolean hasResponse4 = false; - if (jedi_robe_jinsu_taker_condition_canTradeGcw2Hand (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - //-- PLAYER: I have decided not do this after all. - boolean hasResponse5 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_38"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_45"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_46"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_63"); - - if (hasResponse4) - responses [responseIndex++] = new string_id (c_stringFile, "s_64"); - - if (hasResponse5) - responses [responseIndex++] = new string_id (c_stringFile, "s_56"); - - utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: No thank you, I like it the way it is. - if (response == "s_33") - { - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - //-- NPC: As you will it. - string_id message = new string_id (c_stringFile, "s_51"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jedi_robe_jinsu_taker_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Which Saber would you like to upgrade? - - //-- [RESPONSE NOTE] - //-- PLAYER: The Sith Saber please. - if (response == "s_38") - { - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition_canTrade1Hand (player, npc)) - { - jedi_robe_jinsu_taker_action_upgrade1HandPvP (player, npc); - - //-- NPC: Good, let me just upgrade your schematic... - string_id message = new string_id (c_stringFile, "s_40"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Thank you! - boolean hasResponse0 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_42"); - - utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - //-- NPC: It appears I was mistaken. Return to me with another schematic when you are ready. - string_id message = new string_id (c_stringFile, "s_53"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: The Two-Handed Mysterious Saber please. - if (response == "s_45") - { - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition_canTrade2Hand (player, npc)) - { - jedi_robe_jinsu_taker_action_upgrade2HandPvP (player, npc); - - //-- NPC: Good, let me just upgrade your schematic... There, your upgraded schematic will produce a much more powerful saber now. - string_id message = new string_id (c_stringFile, "s_48"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Thank you! - boolean hasResponse0 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_42"); - - utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - //-- NPC: It appears I was mistaken. Return to me with another schematic when you are ready. - string_id message = new string_id (c_stringFile, "s_54"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: The Double-Bladed Darth Phobos Saber please - if (response == "s_46") - { - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition_canTradeStaff (player, npc)) - { - jedi_robe_jinsu_taker_action_upgradeStaffPvP (player, npc); - - //-- NPC: Good, let me just upgrade your schematic... There, your upgraded schematic will produce a much more powerful saber now. - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Thank you! - boolean hasResponse0 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_42"); - - utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - //-- NPC: It appears I was mistaken. Return to me with another schematic when you are ready. - string_id message = new string_id (c_stringFile, "s_55"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: This Fourth Generation One-Handed Lightsaber Hilt purchased from a GCW Vendor. - if (response == "s_63") - { - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition_canTradeGcw1Hand (player, npc)) - { - jedi_robe_jinsu_taker_action_upgradeGcw1Handed (player, npc); - - //-- NPC: Good, let me just upgrade your schematic... There, your upgraded schematic will produce a much more powerful saber now. - string_id message = new string_id (c_stringFile, "s_65"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - //-- NPC: It appears I was mistaken. Return to me with another schematic when you are ready. - string_id message = new string_id (c_stringFile, "s_67"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: This Fourth Generation Two-Handed Lightsaber Hilt purchased from a GCW Vendor. - if (response == "s_64") - { - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition_canTradeGcw2Hand (player, npc)) - { - jedi_robe_jinsu_taker_action_upgradeGcw2Handed (player, npc); - - //-- NPC: Good, let me just upgrade your schematic... There, your upgraded schematic will produce a much more powerful saber now. - string_id message = new string_id (c_stringFile, "s_66"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - //-- NPC: It appears I was mistaken. Return to me with another schematic when you are ready. - string_id message = new string_id (c_stringFile, "s_68"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I have decided not do this after all. - if (response == "s_56") - { - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - //-- NPC: As you will it. - string_id message = new string_id (c_stringFile, "s_57"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jedi_robe_jinsu_taker_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Good, let me just upgrade your schematic... - - //-- [RESPONSE NOTE] - //-- PLAYER: Thank you! - if (response == "s_42") - { - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - //-- NPC: Continue to seek enlightenment my friend. - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jedi_robe_jinsu_taker_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Good, let me just upgrade your schematic... There, your upgraded schematic will produce a much more powerful saber now. - - //-- [RESPONSE NOTE] - //-- PLAYER: Thank you! - if (response == "s_42") - { - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - //-- NPC: Continue to seek enlightenment my friend. - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jedi_robe_jinsu_taker_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Good, let me just upgrade your schematic... There, your upgraded schematic will produce a much more powerful saber now. - - //-- [RESPONSE NOTE] - //-- PLAYER: Thank you! - if (response == "s_42") - { - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - //-- NPC: Continue to seek enlightenment my friend. - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jedi_robe_jinsu_taker_handleBranch17 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: There is much untapped potential within you. You have already taken the first step. Do you seek to continue? - - //-- [RESPONSE NOTE] - //-- PLAYER: I do. - if (response == "s_36") - { - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - //-- NPC: Very well. Then I must ask for something from you. Your Jinsu Razor, please. - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Okay, take it. - boolean hasResponse0 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: What?!!? No! - boolean hasResponse1 = false; - if (jedi_robe_jinsu_taker_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_43"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_60"); - - utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I do not. - if (response == "s_70") - { - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "applause_polite"); - - //-- NPC: Knowledge of your limits is a wisdom most choose to ignore. - string_id message = new string_id (c_stringFile, "s_72"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jedi_robe_jinsu_taker_handleBranch18 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Very well. Then I must ask for something from you. Your Jinsu Razor, please. - - //-- [RESPONSE NOTE] - //-- PLAYER: Okay, take it. - if (response == "s_43") - { - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition_takeJinsu (player, npc)) - { - doAnimationAction (npc, "bow"); - - //-- NPC: So I shall. Continue on your path...that which you seek is within reach. - string_id message = new string_id (c_stringFile, "s_49"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shoo"); - - //-- NPC: Ah, you use deception. I no longer sense your Jinsu Razor. As you wish, but begone. - string_id message = new string_id (c_stringFile, "s_58"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: What?!!? No! - if (response == "s_60") - { - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_disgust"); - - //-- NPC: You hold onto the past too dearly. - string_id message = new string_id (c_stringFile, "s_62"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.jedi_robe_jinsu_taker"); - - setCondition (self, CONDITION_CONVERSABLE); - ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL); - - return SCRIPT_CONTINUE; -} - -trigger OnAttach () -{ - setCondition (self, CONDITION_CONVERSABLE); - ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL); - - 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); - faceTo( self, player ); - return SCRIPT_CONTINUE; -} - -trigger OnIncapacitated (obj_id killer) -{ - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.jedi_robe_jinsu_taker"); - - 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 (jedi_robe_jinsu_taker_condition_canReceive5thGenSaber (player, npc)) - { - //-- NPC: Welcome back %TU. I see that you have a schematic for a new saber. Would you like to learn how to make it more powerful? - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes I would. - boolean hasResponse0 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: No thank you, I like it the way it is. - boolean hasResponse1 = false; - if (jedi_robe_jinsu_taker_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_29"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_33"); - - utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 1); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "jedi_robe_jinsu_taker", 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 (jedi_robe_jinsu_taker_condition_alreadyGaveJinsu (player, npc)) - { - //-- NPC: I have done all that I can for you, friend. - string_id message = new string_id (c_stringFile, "s_30"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition_readyToHandOverJinsu (player, npc)) - { - //-- NPC: There is much untapped potential within you. You have already taken the first step. Do you seek to continue? - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I do. - boolean hasResponse0 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: I do not. - boolean hasResponse1 = false; - if (jedi_robe_jinsu_taker_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_36"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_70"); - - utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 17); - - npcStartConversation (player, npc, "jedi_robe_jinsu_taker", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - //-- NPC: The path to enlightenment often requires one to relinquish that which they hold dear. - string_id message = new string_id (c_stringFile, "s_74"); - 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 != "jedi_robe_jinsu_taker") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - if (branchId == 1 && jedi_robe_jinsu_taker_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && jedi_robe_jinsu_taker_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && jedi_robe_jinsu_taker_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && jedi_robe_jinsu_taker_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && jedi_robe_jinsu_taker_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 17 && jedi_robe_jinsu_taker_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 18 && jedi_robe_jinsu_taker_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// jedi_robe_jinsu_taker.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.static_item; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/jedi_robe_jinsu_taker"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean jedi_robe_jinsu_taker_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean jedi_robe_jinsu_taker_condition_readyToHandOverJinsu (obj_id player, obj_id npc) +{ + if ( hasCompletedCollectionSlotPrereq(player, "col_lightsaber_1h_01_02") ) + { + if ( !hasCompletedCollectionSlot(player, "col_lightsaber_1h_01_02") ) + { + string jinsuTemplate = "object/weapon/melee/sword/crafted_saber/sword_lightsaber_mandalorian.iff"; + if ( utils.playerHasItemByTemplateInInventoryOrEquipped(player, jinsuTemplate) ) + { + return true; + } + } + } + + return false; +} + +// ---------------------------------------------------------------------- + +boolean jedi_robe_jinsu_taker_condition_alreadyGaveJinsu (obj_id player, obj_id npc) +{ + return hasCompletedCollectionSlot(player, "col_lightsaber_1h_01_02"); +} + +// ---------------------------------------------------------------------- + +boolean jedi_robe_jinsu_taker_condition_takeJinsu (obj_id player, obj_id npc) +{ + obj_id jinsuSaber = obj_id.NULL_ID; + string desiredTemplate = "object/weapon/melee/sword/crafted_saber/sword_lightsaber_mandalorian.iff"; + + obj_id[] contents = getInventoryAndEquipment(player); + if (contents != null) + { + for(int i = 0; i 0 ) + { + for ( int i = 0; i < jinsuCrystals.length; i++ ) + { + obj_id crystal = jinsuCrystals[i]; + if ( isIdValid(crystal) ) + { + putInOverloaded(crystal, playerInv); + } + } + } + } + + destroyObject(jinsuSaber); + modifyCollectionSlotValue(player, "col_lightsaber_1h_01_02", 1); + return true; + } + + return false; +} + +// ---------------------------------------------------------------------- + +boolean jedi_robe_jinsu_taker_condition_canReceive5GenPvP (obj_id player, obj_id npc) +{ + obj_id pvpSaberSchematic1Hand = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_01"); + if(isIdValid(pvpSaberSchematic1Hand) && hasCompletedCollection(player, "col_lightsaber_1h_01")) + { + return true; + } + + obj_id pvpSaberSchematic2Hand = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_02"); + if(isIdValid(pvpSaberSchematic2Hand) && hasCompletedCollection(player, "col_lightsaber_2h_01")) + { + return true; + } + + obj_id pvpSaberSchematicStaff = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_03"); + if(isIdValid(pvpSaberSchematicStaff) && hasCompletedCollection(player, "col_lightsaber_polearm_01")) + { + return true; + } + + return false; +} + +// ---------------------------------------------------------------------- + +boolean jedi_robe_jinsu_taker_condition_canTrade1Hand (obj_id player, obj_id npc) +{ + return isIdValid(utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_01")); +} + +// ---------------------------------------------------------------------- + +boolean jedi_robe_jinsu_taker_condition_canTrade2Hand (obj_id player, obj_id npc) +{ + return isIdValid(utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_02")); +} + +// ---------------------------------------------------------------------- + +boolean jedi_robe_jinsu_taker_condition_canTradeStaff (obj_id player, obj_id npc) +{ + return isIdValid(utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_03")); +} + +// ---------------------------------------------------------------------- + +boolean jedi_robe_jinsu_taker_condition_canReceive5thGenSaber (obj_id player, obj_id npc) +{ + return jedi_robe_jinsu_taker_condition_canReceive5GenPvP(player, npc) || jedi_robe_jinsu_taker_condition_canReceive5GenGCW(player, npc); +} + +// ---------------------------------------------------------------------- + +boolean jedi_robe_jinsu_taker_condition_canReceive5GenGCW (obj_id player, obj_id npc) +{ + obj_id gcwSaberSchematic1Hand = utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_1h_gen4"); + if(isIdValid(gcwSaberSchematic1Hand) && hasCompletedCollection(player, "col_lightsaber_1h_01")) + { + return true; + } + + obj_id gcwSaberSchematic2Hand = utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_2h_gen4"); + if(isIdValid(gcwSaberSchematic2Hand) && hasCompletedCollection(player, "col_lightsaber_2h_01")) + { + return true; + } + return false; +} + +// ---------------------------------------------------------------------- + +boolean jedi_robe_jinsu_taker_condition_canTradeGcw1Hand (obj_id player, obj_id npc) +{ + return isIdValid(utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_1h_gen4")); +} + +// ---------------------------------------------------------------------- + +boolean jedi_robe_jinsu_taker_condition_canTradeGcw2Hand (obj_id player, obj_id npc) +{ + return isIdValid(utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_2h_gen4")); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void jedi_robe_jinsu_taker_action_upgrade1HandPvP (obj_id player, obj_id npc) +{ + obj_id oldSchematic = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_01"); + obj_id newSchematic = static_item.createNewItemFunction("item_schematic_pvp_bf_saber_03_04", player); + + if((isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) && isIdValid(newSchematic)) + { + CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") has upgraded their saber schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version "+ getStaticItemName(newSchematic) +"("+newSchematic+"). This will destroy the old one."); + destroyObject(oldSchematic); + } + else + { + sendSystemMessage(player, new string_id("spam", "couldnt_upgrade_saber_schematic")); + CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") could NOT upgrade their schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version. One of these statements returned false: (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) = " + (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player)+ "or isIdValid(newSchematic) = " + isIdValid(newSchematic)); + } +} + +// ---------------------------------------------------------------------- + +void jedi_robe_jinsu_taker_action_upgrade2HandPvP (obj_id player, obj_id npc) +{ + obj_id oldSchematic = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_02"); + obj_id newSchematic = static_item.createNewItemFunction("item_schematic_pvp_bf_saber_03_05", player); + + if((isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) && isIdValid(newSchematic)) + { + CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") has upgraded their saber schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version "+ getStaticItemName(newSchematic) +"("+newSchematic+"). This will destroy the old one."); + destroyObject(oldSchematic); + } + else + { + sendSystemMessage(player, new string_id("spam", "couldnt_upgrade_saber_schematic")); + CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") could NOT upgrade their schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version. One of these statements returned false: (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) = " + (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player)+ "or isIdValid(newSchematic) = " + isIdValid(newSchematic)); + } +} + +// ---------------------------------------------------------------------- + +void jedi_robe_jinsu_taker_action_upgradeStaffPvP (obj_id player, obj_id npc) +{ + obj_id oldSchematic = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_03"); + obj_id newSchematic = static_item.createNewItemFunction("item_schematic_pvp_bf_saber_03_06", player); + + if((isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) && isIdValid(newSchematic)) + { + CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") has upgraded their saber schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version "+ getStaticItemName(newSchematic) +"("+newSchematic+"). This will destroy the old one."); + destroyObject(oldSchematic); + } + else + { + sendSystemMessage(player, new string_id("spam", "couldnt_upgrade_saber_schematic")); + CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") could NOT upgrade their schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version. One of these statements returned false: (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) = " + (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player)+ "or isIdValid(newSchematic) = " + isIdValid(newSchematic)); + } +} + +// ---------------------------------------------------------------------- + +void jedi_robe_jinsu_taker_action_upgradeGcw1Handed (obj_id player, obj_id npc) +{ + obj_id oldSchematic = utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_1h_gen4"); + obj_id newSchematic = static_item.createNewItemFunction("item_schematic_pvp_gcw_saber_1h_gen5", player); + + if((isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) && isIdValid(newSchematic)) + { + CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") has upgraded their saber schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version "+ getStaticItemName(newSchematic) +"("+newSchematic+"). This will destroy the old one."); + destroyObject(oldSchematic); + } + else + { + sendSystemMessage(player, new string_id("spam", "couldnt_upgrade_saber_schematic")); + CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") could NOT upgrade their schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version. One of these statements returned false: (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) = " + (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player)+ "or isIdValid(newSchematic) = " + isIdValid(newSchematic)); + } +} + +// ---------------------------------------------------------------------- + +void jedi_robe_jinsu_taker_action_upgradeGcw2Handed (obj_id player, obj_id npc) +{ + obj_id oldSchematic = utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_2h_gen4"); + obj_id newSchematic = static_item.createNewItemFunction("item_schematic_pvp_gcw_saber_2h_gen5", player); + + if((isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) && isIdValid(newSchematic)) + { + CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") has upgraded their saber schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version "+ getStaticItemName(newSchematic) +"("+newSchematic+"). This will destroy the old one."); + destroyObject(oldSchematic); + } + else + { + sendSystemMessage(player, new string_id("spam", "couldnt_upgrade_saber_schematic")); + CustomerServiceLog("jediSaberTrade", getFirstName(player) + "(" + player + ") could NOT upgrade their schematic "+ getStaticItemName(oldSchematic)+ "(" + oldSchematic + ") to a 5th Gen version. One of these statements returned false: (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) = " + (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player)+ "or isIdValid(newSchematic) = " + isIdValid(newSchematic)); + } +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int jedi_robe_jinsu_taker_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Welcome back %TU. I see that you have a schematic for a new saber. Would you like to learn how to make it more powerful? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes I would. + if (response == "s_29") + { + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + //-- NPC: Which Saber would you like to upgrade? + string_id message = new string_id (c_stringFile, "s_35"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: The Sith Saber please. + boolean hasResponse0 = false; + if (jedi_robe_jinsu_taker_condition_canTrade1Hand (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: The Two-Handed Mysterious Saber please. + boolean hasResponse1 = false; + if (jedi_robe_jinsu_taker_condition_canTrade2Hand (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: The Double-Bladed Darth Phobos Saber please + boolean hasResponse2 = false; + if (jedi_robe_jinsu_taker_condition_canTradeStaff (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: This Fourth Generation One-Handed Lightsaber Hilt purchased from a GCW Vendor. + boolean hasResponse3 = false; + if (jedi_robe_jinsu_taker_condition_canTradeGcw1Hand (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + //-- PLAYER: This Fourth Generation Two-Handed Lightsaber Hilt purchased from a GCW Vendor. + boolean hasResponse4 = false; + if (jedi_robe_jinsu_taker_condition_canTradeGcw2Hand (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse4 = true; + } + + //-- PLAYER: I have decided not do this after all. + boolean hasResponse5 = false; + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse5 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_38"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_45"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_46"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_63"); + + if (hasResponse4) + responses [responseIndex++] = new string_id (c_stringFile, "s_64"); + + if (hasResponse5) + responses [responseIndex++] = new string_id (c_stringFile, "s_56"); + + utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 2); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: No thank you, I like it the way it is. + if (response == "s_33") + { + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + //-- NPC: As you will it. + string_id message = new string_id (c_stringFile, "s_51"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jedi_robe_jinsu_taker_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Which Saber would you like to upgrade? + + //-- [RESPONSE NOTE] + //-- PLAYER: The Sith Saber please. + if (response == "s_38") + { + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition_canTrade1Hand (player, npc)) + { + jedi_robe_jinsu_taker_action_upgrade1HandPvP (player, npc); + + //-- NPC: Good, let me just upgrade your schematic... + string_id message = new string_id (c_stringFile, "s_40"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Thank you! + boolean hasResponse0 = false; + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_42"); + + utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + //-- NPC: It appears I was mistaken. Return to me with another schematic when you are ready. + string_id message = new string_id (c_stringFile, "s_53"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: The Two-Handed Mysterious Saber please. + if (response == "s_45") + { + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition_canTrade2Hand (player, npc)) + { + jedi_robe_jinsu_taker_action_upgrade2HandPvP (player, npc); + + //-- NPC: Good, let me just upgrade your schematic... There, your upgraded schematic will produce a much more powerful saber now. + string_id message = new string_id (c_stringFile, "s_48"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Thank you! + boolean hasResponse0 = false; + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_42"); + + utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + //-- NPC: It appears I was mistaken. Return to me with another schematic when you are ready. + string_id message = new string_id (c_stringFile, "s_54"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: The Double-Bladed Darth Phobos Saber please + if (response == "s_46") + { + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition_canTradeStaff (player, npc)) + { + jedi_robe_jinsu_taker_action_upgradeStaffPvP (player, npc); + + //-- NPC: Good, let me just upgrade your schematic... There, your upgraded schematic will produce a much more powerful saber now. + string_id message = new string_id (c_stringFile, "s_50"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Thank you! + boolean hasResponse0 = false; + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_42"); + + utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + //-- NPC: It appears I was mistaken. Return to me with another schematic when you are ready. + string_id message = new string_id (c_stringFile, "s_55"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: This Fourth Generation One-Handed Lightsaber Hilt purchased from a GCW Vendor. + if (response == "s_63") + { + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition_canTradeGcw1Hand (player, npc)) + { + jedi_robe_jinsu_taker_action_upgradeGcw1Handed (player, npc); + + //-- NPC: Good, let me just upgrade your schematic... There, your upgraded schematic will produce a much more powerful saber now. + string_id message = new string_id (c_stringFile, "s_65"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + //-- NPC: It appears I was mistaken. Return to me with another schematic when you are ready. + string_id message = new string_id (c_stringFile, "s_67"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: This Fourth Generation Two-Handed Lightsaber Hilt purchased from a GCW Vendor. + if (response == "s_64") + { + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition_canTradeGcw2Hand (player, npc)) + { + jedi_robe_jinsu_taker_action_upgradeGcw2Handed (player, npc); + + //-- NPC: Good, let me just upgrade your schematic... There, your upgraded schematic will produce a much more powerful saber now. + string_id message = new string_id (c_stringFile, "s_66"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + //-- NPC: It appears I was mistaken. Return to me with another schematic when you are ready. + string_id message = new string_id (c_stringFile, "s_68"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I have decided not do this after all. + if (response == "s_56") + { + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + //-- NPC: As you will it. + string_id message = new string_id (c_stringFile, "s_57"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jedi_robe_jinsu_taker_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Good, let me just upgrade your schematic... + + //-- [RESPONSE NOTE] + //-- PLAYER: Thank you! + if (response == "s_42") + { + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + //-- NPC: Continue to seek enlightenment my friend. + string_id message = new string_id (c_stringFile, "s_44"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jedi_robe_jinsu_taker_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Good, let me just upgrade your schematic... There, your upgraded schematic will produce a much more powerful saber now. + + //-- [RESPONSE NOTE] + //-- PLAYER: Thank you! + if (response == "s_42") + { + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + //-- NPC: Continue to seek enlightenment my friend. + string_id message = new string_id (c_stringFile, "s_44"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jedi_robe_jinsu_taker_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Good, let me just upgrade your schematic... There, your upgraded schematic will produce a much more powerful saber now. + + //-- [RESPONSE NOTE] + //-- PLAYER: Thank you! + if (response == "s_42") + { + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + //-- NPC: Continue to seek enlightenment my friend. + string_id message = new string_id (c_stringFile, "s_44"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jedi_robe_jinsu_taker_handleBranch17 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: There is much untapped potential within you. You have already taken the first step. Do you seek to continue? + + //-- [RESPONSE NOTE] + //-- PLAYER: I do. + if (response == "s_36") + { + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + //-- NPC: Very well. Then I must ask for something from you. Your Jinsu Razor, please. + string_id message = new string_id (c_stringFile, "s_39"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Okay, take it. + boolean hasResponse0 = false; + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: What?!!? No! + boolean hasResponse1 = false; + if (jedi_robe_jinsu_taker_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_43"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_60"); + + utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 18); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I do not. + if (response == "s_70") + { + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "applause_polite"); + + //-- NPC: Knowledge of your limits is a wisdom most choose to ignore. + string_id message = new string_id (c_stringFile, "s_72"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jedi_robe_jinsu_taker_handleBranch18 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Very well. Then I must ask for something from you. Your Jinsu Razor, please. + + //-- [RESPONSE NOTE] + //-- PLAYER: Okay, take it. + if (response == "s_43") + { + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition_takeJinsu (player, npc)) + { + doAnimationAction (npc, "bow"); + + //-- NPC: So I shall. Continue on your path...that which you seek is within reach. + string_id message = new string_id (c_stringFile, "s_49"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "shoo"); + + //-- NPC: Ah, you use deception. I no longer sense your Jinsu Razor. As you wish, but begone. + string_id message = new string_id (c_stringFile, "s_58"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: What?!!? No! + if (response == "s_60") + { + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "shake_head_disgust"); + + //-- NPC: You hold onto the past too dearly. + string_id message = new string_id (c_stringFile, "s_62"); + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.jedi_robe_jinsu_taker"); + + setCondition (self, CONDITION_CONVERSABLE); + ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL); + + return SCRIPT_CONTINUE; +} + +trigger OnAttach () +{ + setCondition (self, CONDITION_CONVERSABLE); + ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL); + + 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); + faceTo( self, player ); + return SCRIPT_CONTINUE; +} + +trigger OnIncapacitated (obj_id killer) +{ + clearCondition (self, CONDITION_CONVERSABLE); + detachScript (self, "conversation.jedi_robe_jinsu_taker"); + + 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 (jedi_robe_jinsu_taker_condition_canReceive5thGenSaber (player, npc)) + { + //-- NPC: Welcome back %TU. I see that you have a schematic for a new saber. Would you like to learn how to make it more powerful? + string_id message = new string_id (c_stringFile, "s_27"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes I would. + boolean hasResponse0 = false; + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: No thank you, I like it the way it is. + boolean hasResponse1 = false; + if (jedi_robe_jinsu_taker_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_29"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_33"); + + utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 1); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "jedi_robe_jinsu_taker", 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 (jedi_robe_jinsu_taker_condition_alreadyGaveJinsu (player, npc)) + { + //-- NPC: I have done all that I can for you, friend. + string_id message = new string_id (c_stringFile, "s_30"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition_readyToHandOverJinsu (player, npc)) + { + //-- NPC: There is much untapped potential within you. You have already taken the first step. Do you seek to continue? + string_id message = new string_id (c_stringFile, "s_32"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I do. + boolean hasResponse0 = false; + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: I do not. + boolean hasResponse1 = false; + if (jedi_robe_jinsu_taker_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_36"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_70"); + + utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 17); + + npcStartConversation (player, npc, "jedi_robe_jinsu_taker", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) + { + //-- NPC: The path to enlightenment often requires one to relinquish that which they hold dear. + string_id message = new string_id (c_stringFile, "s_74"); + 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 != "jedi_robe_jinsu_taker") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + if (branchId == 1 && jedi_robe_jinsu_taker_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && jedi_robe_jinsu_taker_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && jedi_robe_jinsu_taker_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && jedi_robe_jinsu_taker_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && jedi_robe_jinsu_taker_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 17 && jedi_robe_jinsu_taker_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 18 && jedi_robe_jinsu_taker_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/jinkins.script b/sku.0/sys.server/compiled/game/script/conversation/jinkins.script index 238bf874e..1a988bcfd 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/jinkins.script +++ b/sku.0/sys.server/compiled/game/script/conversation/jinkins.script @@ -1,1446 +1,1446 @@ -// ====================================================================== -// -// jinkins.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.collection; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/jinkins"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean jinkins_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean jinkins_condition_hasCompletedPirate (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_vana_to_jinkins") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_interview_moore"); -} - -// ---------------------------------------------------------------------- - -boolean jinkins_condition_hasReturnedFromMoore (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_interview_moore", "tellJinkinsMoore") - || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_interview_moore") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine")); -} - -// ---------------------------------------------------------------------- - -boolean jinkins_condition_hasMineQuestIncomplete (obj_id player, obj_id npc) -{ - return groundquests.isQuestActive(player, "u16_nym_themepark_mine"); -} - -// ---------------------------------------------------------------------- - -boolean jinkins_condition_hasMineFilter (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_mine", "returnMineComplete"); -} - -// ---------------------------------------------------------------------- - -boolean jinkins_condition_isDoneMineQuest (obj_id player, obj_id npc) -{ - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_mine"); -} - -// ---------------------------------------------------------------------- - -boolean jinkins_condition_allQuestsComplete (obj_id player, obj_id npc) -{ - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_jinkins_kole"); -} - -// ---------------------------------------------------------------------- - -boolean jinkins_condition_hasCompletedThemePark (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_shuttle_ambush"); -} - -// ---------------------------------------------------------------------- - -boolean jinkins_condition_hasNotCompletedPirate (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return !groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout") - || !groundquests.hasCompletedQuest(player, "u16_nym_themepark_vana_to_jinkins"); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void jinkins_action_giveMooreQuest (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_interview_moore"); -} - -// ---------------------------------------------------------------------- - -void jinkins_action_grantMineQuest (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_mine"); - - if(!hasCompletedCollectionSlot(player, "kill_nyms_themepark_enraged_miner_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_enraged_miner_activate", 1); - } - - if(!hasCompletedCollectionSlot(player, "kill_nyms_themepark_mine_droideka_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_mine_droideka_activate", 1); - } -} - -// ---------------------------------------------------------------------- - -void jinkins_action_completeMooreQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - groundquests.sendSignal(player, "hasToldJinkinsMoore"); -} - -// ---------------------------------------------------------------------- - -void jinkins_action_completeMineQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - groundquests.sendSignal(player, "hasCompletedMine"); -} - -// ---------------------------------------------------------------------- - -void jinkins_action_hasFoundJinkins (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundJinkins"); -} - -// ---------------------------------------------------------------------- - -void jinkins_action_gotoKole (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_jinkins_kole"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int jinkins_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You are back? Did you bring me the gas? - - //-- [RESPONSE NOTE] - //-- PLAYER: Here is the filter. Why so surprised? - if (response == "s_39") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - jinkins_action_completeMineQuest (player, npc); - - //-- NPC: Great. You're pretty persistent...and resourceful, %TU. Good work. This gas should be extremely useful to Nym. Come see me again when you are ready for another mission. - string_id message = new string_id (c_stringFile, "s_40"); - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jinkins_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yes? - - //-- [RESPONSE NOTE] - //-- PLAYER: What was I supposed to do? - if (response == "s_147") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "backhand"); - - //-- NPC: Go to the Imperial mine and get the air filter. - string_id message = new string_id (c_stringFile, "s_148"); - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jinkins_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I wasn't expecting you to come back. Figured you hopped a shuttle back to Naboo or whatever planet you come from. So you met with Sergeant Moore? What did he say about Imperial threats in the mine? - - //-- [RESPONSE NOTE] - //-- PLAYER: Possibly some Droidekas. - if (response == "s_136") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - //-- NPC: So are you in? - string_id message = new string_id (c_stringFile, "s_137"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What about the poison gas? - boolean hasResponse0 = false; - if (jinkins_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_138"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jinkins_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: So are you in? - - //-- [RESPONSE NOTE] - //-- PLAYER: What about the poison gas? - if (response == "s_138") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - //-- NPC: It looks like the mine has a cheap air filtration system. It barely meets Imperial code and didn't stop the gas from infecting the miners. But I think the filters trapped some of the gas. Just find the filtration system and look for some kinda sealed container. Oh, and now that the filters have had some time do their work, the air down there should be clean. If you're lucky, anyway. - string_id message = new string_id (c_stringFile, "s_139"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: How dangerous is this gas? - boolean hasResponse0 = false; - if (jinkins_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_140"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jinkins_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: It looks like the mine has a cheap air filtration system. It barely meets Imperial code and didn't stop the gas from infecting the miners. But I think the filters trapped some of the gas. Just find the filtration system and look for some kinda sealed container. Oh, and now that the filters have had some time do their work, the air down there should be clean. If you're lucky, anyway. - - //-- [RESPONSE NOTE] - //-- PLAYER: How dangerous is this gas? - if (response == "s_140") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - //-- NPC: You scared? I said don't worry about the gas. The filters should have scrubbed the air clean by now. The real danger is gonna be the miners. The gas has poisoned their brains. They've taken over the mine and will attack anyone who comes near the place. They're like wild dinkos... - string_id message = new string_id (c_stringFile, "s_141"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: And the Droidekas. - boolean hasResponse0 = false; - if (jinkins_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_142"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jinkins_handleBranch11 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You scared? I said don't worry about the gas. The filters should have scrubbed the air clean by now. The real danger is gonna be the miners. The gas has poisoned their brains. They've taken over the mine and will attack anyone who comes near the place. They're like wild dinkos... - - //-- [RESPONSE NOTE] - //-- PLAYER: And the Droidekas. - if (response == "s_142") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - //-- NPC: Oh yeah. Them too. - string_id message = new string_id (c_stringFile, "s_143"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Well, I can take a shot at getting this gas... - boolean hasResponse0 = false; - if (jinkins_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_144"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jinkins_handleBranch12 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Oh yeah. Them too. - - //-- [RESPONSE NOTE] - //-- PLAYER: Well, I can take a shot at getting this gas... - if (response == "s_144") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - //-- NPC: Good. I'll mark the location of the mine in your datapad. This will be a tough mission, though; if you have any friends, you might want to ask for their help. Or least tell them how you want your remains handled. - string_id message = new string_id (c_stringFile, "s_145"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'll get started right away. - boolean hasResponse0 = false; - if (jinkins_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_46"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jinkins_handleBranch13 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Good. I'll mark the location of the mine in your datapad. This will be a tough mission, though; if you have any friends, you might want to ask for their help. Or least tell them how you want your remains handled. - - //-- [RESPONSE NOTE] - //-- PLAYER: I'll get started right away. - if (response == "s_46") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - jinkins_action_grantMineQuest (player, npc); - - //-- NPC: Excellent. Before you leave, you might try asking around to see if anyone else has tasks involving that mine. - string_id message = new string_id (c_stringFile, "s_47"); - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jinkins_handleBranch15 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Great job with the Sulfur Lake Pirates, %TU. I have a dangerous job that pays well if you are willing to accept it. - - //-- [RESPONSE NOTE] - //-- PLAYER: Who are you? - if (response == "s_101") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - //-- NPC: I'm Jinkins, Nym's chief engineer. Nym asks for weapons, and I build them. I joined up with the Lok Revenants a few months before the Battle of Naboo, which makes me one of this crew's oldest members, along with Kole of course. - string_id message = new string_id (c_stringFile, "s_102"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Alright, what is the job? - boolean hasResponse0 = false; - if (jinkins_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_104"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: What is the job? - if (response == "s_103") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - //-- NPC: I need you to check something out for us. I sliced some the data from the Imperial droid you found and discovered that it was on a ship trying to escape an Imperial mining installation here on Lok. - string_id message = new string_id (c_stringFile, "s_106"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Why was it trying to escape? - boolean hasResponse0 = false; - if (jinkins_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_107"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jinkins_handleBranch16 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I'm Jinkins, Nym's chief engineer. Nym asks for weapons, and I build them. I joined up with the Lok Revenants a few months before the Battle of Naboo, which makes me one of this crew's oldest members, along with Kole of course. - - //-- [RESPONSE NOTE] - //-- PLAYER: Alright, what is the job? - if (response == "s_104") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - //-- NPC: I need you to check something out for us. I sliced some the data from the Imperial droid you found and discovered that it was on a ship trying to escape an Imperial mining installation here on Lok. - string_id message = new string_id (c_stringFile, "s_106"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Why was it trying to escape? - boolean hasResponse0 = false; - if (jinkins_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_107"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jinkins_handleBranch17 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I need you to check something out for us. I sliced some the data from the Imperial droid you found and discovered that it was on a ship trying to escape an Imperial mining installation here on Lok. - - //-- [RESPONSE NOTE] - //-- PLAYER: Why was it trying to escape? - if (response == "s_107") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - //-- NPC: It was an Imperial labor camp. Obviously not a place known for their safe working conditions... Anyway, the droid says the miners hit some sort of gas pocket. The entire work crew had their brains boiled. They survived, but they're crazy. And the droid thinks that some of the Imperial officers were infected too. Any gas that drives Imperials out of their minds is a good thing to have around, so we want some samples of it. - string_id message = new string_id (c_stringFile, "s_108"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Won't the facility be filled with poison? - boolean hasResponse0 = false; - if (jinkins_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_109"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jinkins_handleBranch18 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: It was an Imperial labor camp. Obviously not a place known for their safe working conditions... Anyway, the droid says the miners hit some sort of gas pocket. The entire work crew had their brains boiled. They survived, but they're crazy. And the droid thinks that some of the Imperial officers were infected too. Any gas that drives Imperials out of their minds is a good thing to have around, so we want some samples of it. - - //-- [RESPONSE NOTE] - //-- PLAYER: Won't the facility be filled with poison? - if (response == "s_109") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - //-- NPC: We are looking into that. For now we need you to visit someone to find out what type of threats might exist in the mine. - string_id message = new string_id (c_stringFile, "s_110"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Threats? - boolean hasResponse0 = false; - if (jinkins_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_119"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jinkins_handleBranch19 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: We are looking into that. For now we need you to visit someone to find out what type of threats might exist in the mine. - - //-- [RESPONSE NOTE] - //-- PLAYER: Threats? - if (response == "s_119") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - //-- NPC: Since the Imperials aren't sure what's going on with the mine, they've sent some of their droids to monitor the situation. You may have to deal with them as well. - string_id message = new string_id (c_stringFile, "s_121"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What kind of droids? - boolean hasResponse0 = false; - if (jinkins_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_123"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jinkins_handleBranch20 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Since the Imperials aren't sure what's going on with the mine, they've sent some of their droids to monitor the situation. You may have to deal with them as well. - - //-- [RESPONSE NOTE] - //-- PLAYER: What kind of droids? - if (response == "s_123") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - //-- NPC: We don't know, exactly. But we do have an ex-Imperial in our pocket who might have some information for you. Sergeant Moore owes Nym several thousand credits. He'll probably tell you whatever you need to know, for a price. Since he left the Imperial army, he spends most of his time in the cantina. - string_id message = new string_id (c_stringFile, "s_125"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Why did he leave the army? - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Where is he? - boolean hasResponse1 = false; - if (jinkins_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_127"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_132"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jinkins_handleBranch21 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: We don't know, exactly. But we do have an ex-Imperial in our pocket who might have some information for you. Sergeant Moore owes Nym several thousand credits. He'll probably tell you whatever you need to know, for a price. Since he left the Imperial army, he spends most of his time in the cantina. - - //-- [RESPONSE NOTE] - //-- PLAYER: Why did he leave the army? - if (response == "s_127") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - //-- NPC: The Empire found out that he was borrowing credits from Nym. He was going to be executed, but he has friends in the Tagge family. They put in a good word, and Moore was kicked out instead of killed. But, he still has good information about the Empire's droids. - string_id message = new string_id (c_stringFile, "s_129"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Maybe I should go talk to him. - boolean hasResponse0 = false; - if (jinkins_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_133"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Where is he? - if (response == "s_132") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - jinkins_action_giveMooreQuest (player, npc); - - //-- NPC: You'll be happy to hear he is in the Stronghold Cantina. I know you've been there before, but just in case you've forgotten, I've given you a waypoint. Come back once you get the information about the droids in the mining facility. - string_id message = new string_id (c_stringFile, "s_134"); - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int jinkins_handleBranch22 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: The Empire found out that he was borrowing credits from Nym. He was going to be executed, but he has friends in the Tagge family. They put in a good word, and Moore was kicked out instead of killed. But, he still has good information about the Empire's droids. - - //-- [RESPONSE NOTE] - //-- PLAYER: Maybe I should go talk to him. - if (response == "s_133") - { - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - jinkins_action_giveMooreQuest (player, npc); - - //-- NPC: You'll be happy to hear he is in the Stronghold Cantina. I know you've been there before, but just in case you've forgotten, I've given you a waypoint. Come back once you get the information about the droids in the mining facility. - string_id message = new string_id (c_stringFile, "s_134"); - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.jinkins"); - - 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.jinkins"); - - 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 (jinkins_condition_hasCompletedThemePark (player, npc)) - { - //-- NPC: You earned the title of Lok Revenant, %TU. Make sure to check with all the other pirates and see if they need your help. There is a special prize I'm reserving for you if you can get all the work done. - string_id message = new string_id (c_stringFile, "s_52"); - 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 (jinkins_condition_allQuestsComplete (player, npc)) - { - //-- NPC: Great work on the Mine, %TU. I have a feeling you have a bright pirate future ahead of you. - string_id message = new string_id (c_stringFile, "s_48"); - 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 (jinkins_condition_isDoneMineQuest (player, npc)) - { - jinkins_action_gotoKole (player, npc); - - //-- NPC: Hi again, %TU. Speak with Kole. He has some special plans for you. - string_id message = new string_id (c_stringFile, "s_50"); - 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 (jinkins_condition_hasMineFilter (player, npc)) - { - doAnimationAction (npc, "nod_head_multiple"); - - //-- NPC: You are back? Did you bring me the gas? - string_id message = new string_id (c_stringFile, "s_38"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Here is the filter. Why so surprised? - boolean hasResponse0 = false; - if (jinkins_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.jinkins.branchId", 4); - - npcStartConversation (player, npc, "jinkins", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (jinkins_condition_hasMineQuestIncomplete (player, npc)) - { - //-- NPC: Yes? - string_id message = new string_id (c_stringFile, "s_146"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What was I supposed to do? - boolean hasResponse0 = false; - if (jinkins_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_147"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 6); - - npcStartConversation (player, npc, "jinkins", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (jinkins_condition_hasReturnedFromMoore (player, npc)) - { - doAnimationAction (npc, "adjust"); - - jinkins_action_completeMooreQuest (player, npc); - - //-- NPC: I wasn't expecting you to come back. Figured you hopped a shuttle back to Naboo or whatever planet you come from. So you met with Sergeant Moore? What did he say about Imperial threats in the mine? - string_id message = new string_id (c_stringFile, "s_135"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Possibly some Droidekas. - boolean hasResponse0 = false; - if (jinkins_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_136"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 8); - - npcStartConversation (player, npc, "jinkins", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (jinkins_condition_hasCompletedPirate (player, npc)) - { - doAnimationAction (npc, "clap_rousing"); - - jinkins_action_hasFoundJinkins (player, npc); - - //-- NPC: Great job with the Sulfur Lake Pirates, %TU. I have a dangerous job that pays well if you are willing to accept it. - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Who are you? - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: What is the job? - boolean hasResponse1 = false; - if (jinkins_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_101"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_103"); - - utils.setScriptVar (player, "conversation.jinkins.branchId", 15); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "jinkins", 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 (jinkins_condition_hasNotCompletedPirate (player, npc)) - { - doAnimationAction (npc, "shoo"); - - //-- NPC: You look a little lost. Maybe you should speak with Vana Sage to make sure you aren't in the wrong location at the wrong time. - string_id message = new string_id (c_stringFile, "s_105"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (jinkins_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "tap_foot"); - - //-- NPC: Sorry, we have work to do here. Not interested. - string_id message = new string_id (c_stringFile, "s_100"); - 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 != "jinkins") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.jinkins.branchId"); - - if (branchId == 4 && jinkins_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && jinkins_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && jinkins_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && jinkins_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && jinkins_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 11 && jinkins_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 12 && jinkins_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 13 && jinkins_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 15 && jinkins_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 16 && jinkins_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 17 && jinkins_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 18 && jinkins_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 19 && jinkins_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 20 && jinkins_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 21 && jinkins_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 22 && jinkins_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.jinkins.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// jinkins.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.collection; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/jinkins"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean jinkins_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean jinkins_condition_hasCompletedPirate (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_vana_to_jinkins") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_interview_moore"); +} + +// ---------------------------------------------------------------------- + +boolean jinkins_condition_hasReturnedFromMoore (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_interview_moore", "tellJinkinsMoore") + || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_interview_moore") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine")); +} + +// ---------------------------------------------------------------------- + +boolean jinkins_condition_hasMineQuestIncomplete (obj_id player, obj_id npc) +{ + return groundquests.isQuestActive(player, "u16_nym_themepark_mine"); +} + +// ---------------------------------------------------------------------- + +boolean jinkins_condition_hasMineFilter (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_mine", "returnMineComplete"); +} + +// ---------------------------------------------------------------------- + +boolean jinkins_condition_isDoneMineQuest (obj_id player, obj_id npc) +{ + return groundquests.hasCompletedQuest(player, "u16_nym_themepark_mine"); +} + +// ---------------------------------------------------------------------- + +boolean jinkins_condition_allQuestsComplete (obj_id player, obj_id npc) +{ + return groundquests.hasCompletedQuest(player, "u16_nym_themepark_jinkins_kole"); +} + +// ---------------------------------------------------------------------- + +boolean jinkins_condition_hasCompletedThemePark (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedQuest(player, "u16_nym_themepark_shuttle_ambush"); +} + +// ---------------------------------------------------------------------- + +boolean jinkins_condition_hasNotCompletedPirate (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return !groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout") + || !groundquests.hasCompletedQuest(player, "u16_nym_themepark_vana_to_jinkins"); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void jinkins_action_giveMooreQuest (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_interview_moore"); +} + +// ---------------------------------------------------------------------- + +void jinkins_action_grantMineQuest (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_mine"); + + if(!hasCompletedCollectionSlot(player, "kill_nyms_themepark_enraged_miner_activate")) + { + modifyCollectionSlotValue(player, "kill_nyms_themepark_enraged_miner_activate", 1); + } + + if(!hasCompletedCollectionSlot(player, "kill_nyms_themepark_mine_droideka_activate")) + { + modifyCollectionSlotValue(player, "kill_nyms_themepark_mine_droideka_activate", 1); + } +} + +// ---------------------------------------------------------------------- + +void jinkins_action_completeMooreQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + groundquests.sendSignal(player, "hasToldJinkinsMoore"); +} + +// ---------------------------------------------------------------------- + +void jinkins_action_completeMineQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + groundquests.sendSignal(player, "hasCompletedMine"); +} + +// ---------------------------------------------------------------------- + +void jinkins_action_hasFoundJinkins (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundJinkins"); +} + +// ---------------------------------------------------------------------- + +void jinkins_action_gotoKole (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_jinkins_kole"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int jinkins_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You are back? Did you bring me the gas? + + //-- [RESPONSE NOTE] + //-- PLAYER: Here is the filter. Why so surprised? + if (response == "s_39") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + jinkins_action_completeMineQuest (player, npc); + + //-- NPC: Great. You're pretty persistent...and resourceful, %TU. Good work. This gas should be extremely useful to Nym. Come see me again when you are ready for another mission. + string_id message = new string_id (c_stringFile, "s_40"); + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jinkins_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yes? + + //-- [RESPONSE NOTE] + //-- PLAYER: What was I supposed to do? + if (response == "s_147") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "backhand"); + + //-- NPC: Go to the Imperial mine and get the air filter. + string_id message = new string_id (c_stringFile, "s_148"); + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jinkins_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I wasn't expecting you to come back. Figured you hopped a shuttle back to Naboo or whatever planet you come from. So you met with Sergeant Moore? What did he say about Imperial threats in the mine? + + //-- [RESPONSE NOTE] + //-- PLAYER: Possibly some Droidekas. + if (response == "s_136") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + //-- NPC: So are you in? + string_id message = new string_id (c_stringFile, "s_137"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What about the poison gas? + boolean hasResponse0 = false; + if (jinkins_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_138"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jinkins_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: So are you in? + + //-- [RESPONSE NOTE] + //-- PLAYER: What about the poison gas? + if (response == "s_138") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + //-- NPC: It looks like the mine has a cheap air filtration system. It barely meets Imperial code and didn't stop the gas from infecting the miners. But I think the filters trapped some of the gas. Just find the filtration system and look for some kinda sealed container. Oh, and now that the filters have had some time do their work, the air down there should be clean. If you're lucky, anyway. + string_id message = new string_id (c_stringFile, "s_139"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: How dangerous is this gas? + boolean hasResponse0 = false; + if (jinkins_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_140"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jinkins_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: It looks like the mine has a cheap air filtration system. It barely meets Imperial code and didn't stop the gas from infecting the miners. But I think the filters trapped some of the gas. Just find the filtration system and look for some kinda sealed container. Oh, and now that the filters have had some time do their work, the air down there should be clean. If you're lucky, anyway. + + //-- [RESPONSE NOTE] + //-- PLAYER: How dangerous is this gas? + if (response == "s_140") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + //-- NPC: You scared? I said don't worry about the gas. The filters should have scrubbed the air clean by now. The real danger is gonna be the miners. The gas has poisoned their brains. They've taken over the mine and will attack anyone who comes near the place. They're like wild dinkos... + string_id message = new string_id (c_stringFile, "s_141"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: And the Droidekas. + boolean hasResponse0 = false; + if (jinkins_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_142"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 11); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jinkins_handleBranch11 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You scared? I said don't worry about the gas. The filters should have scrubbed the air clean by now. The real danger is gonna be the miners. The gas has poisoned their brains. They've taken over the mine and will attack anyone who comes near the place. They're like wild dinkos... + + //-- [RESPONSE NOTE] + //-- PLAYER: And the Droidekas. + if (response == "s_142") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + //-- NPC: Oh yeah. Them too. + string_id message = new string_id (c_stringFile, "s_143"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Well, I can take a shot at getting this gas... + boolean hasResponse0 = false; + if (jinkins_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_144"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 12); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jinkins_handleBranch12 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Oh yeah. Them too. + + //-- [RESPONSE NOTE] + //-- PLAYER: Well, I can take a shot at getting this gas... + if (response == "s_144") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + //-- NPC: Good. I'll mark the location of the mine in your datapad. This will be a tough mission, though; if you have any friends, you might want to ask for their help. Or least tell them how you want your remains handled. + string_id message = new string_id (c_stringFile, "s_145"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'll get started right away. + boolean hasResponse0 = false; + if (jinkins_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_46"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 13); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jinkins_handleBranch13 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Good. I'll mark the location of the mine in your datapad. This will be a tough mission, though; if you have any friends, you might want to ask for their help. Or least tell them how you want your remains handled. + + //-- [RESPONSE NOTE] + //-- PLAYER: I'll get started right away. + if (response == "s_46") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + jinkins_action_grantMineQuest (player, npc); + + //-- NPC: Excellent. Before you leave, you might try asking around to see if anyone else has tasks involving that mine. + string_id message = new string_id (c_stringFile, "s_47"); + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jinkins_handleBranch15 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Great job with the Sulfur Lake Pirates, %TU. I have a dangerous job that pays well if you are willing to accept it. + + //-- [RESPONSE NOTE] + //-- PLAYER: Who are you? + if (response == "s_101") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + //-- NPC: I'm Jinkins, Nym's chief engineer. Nym asks for weapons, and I build them. I joined up with the Lok Revenants a few months before the Battle of Naboo, which makes me one of this crew's oldest members, along with Kole of course. + string_id message = new string_id (c_stringFile, "s_102"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Alright, what is the job? + boolean hasResponse0 = false; + if (jinkins_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_104"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: What is the job? + if (response == "s_103") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + //-- NPC: I need you to check something out for us. I sliced some the data from the Imperial droid you found and discovered that it was on a ship trying to escape an Imperial mining installation here on Lok. + string_id message = new string_id (c_stringFile, "s_106"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Why was it trying to escape? + boolean hasResponse0 = false; + if (jinkins_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_107"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 17); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jinkins_handleBranch16 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I'm Jinkins, Nym's chief engineer. Nym asks for weapons, and I build them. I joined up with the Lok Revenants a few months before the Battle of Naboo, which makes me one of this crew's oldest members, along with Kole of course. + + //-- [RESPONSE NOTE] + //-- PLAYER: Alright, what is the job? + if (response == "s_104") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + //-- NPC: I need you to check something out for us. I sliced some the data from the Imperial droid you found and discovered that it was on a ship trying to escape an Imperial mining installation here on Lok. + string_id message = new string_id (c_stringFile, "s_106"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Why was it trying to escape? + boolean hasResponse0 = false; + if (jinkins_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_107"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 17); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jinkins_handleBranch17 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I need you to check something out for us. I sliced some the data from the Imperial droid you found and discovered that it was on a ship trying to escape an Imperial mining installation here on Lok. + + //-- [RESPONSE NOTE] + //-- PLAYER: Why was it trying to escape? + if (response == "s_107") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + //-- NPC: It was an Imperial labor camp. Obviously not a place known for their safe working conditions... Anyway, the droid says the miners hit some sort of gas pocket. The entire work crew had their brains boiled. They survived, but they're crazy. And the droid thinks that some of the Imperial officers were infected too. Any gas that drives Imperials out of their minds is a good thing to have around, so we want some samples of it. + string_id message = new string_id (c_stringFile, "s_108"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Won't the facility be filled with poison? + boolean hasResponse0 = false; + if (jinkins_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_109"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 18); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jinkins_handleBranch18 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: It was an Imperial labor camp. Obviously not a place known for their safe working conditions... Anyway, the droid says the miners hit some sort of gas pocket. The entire work crew had their brains boiled. They survived, but they're crazy. And the droid thinks that some of the Imperial officers were infected too. Any gas that drives Imperials out of their minds is a good thing to have around, so we want some samples of it. + + //-- [RESPONSE NOTE] + //-- PLAYER: Won't the facility be filled with poison? + if (response == "s_109") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + //-- NPC: We are looking into that. For now we need you to visit someone to find out what type of threats might exist in the mine. + string_id message = new string_id (c_stringFile, "s_110"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Threats? + boolean hasResponse0 = false; + if (jinkins_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_119"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 19); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jinkins_handleBranch19 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: We are looking into that. For now we need you to visit someone to find out what type of threats might exist in the mine. + + //-- [RESPONSE NOTE] + //-- PLAYER: Threats? + if (response == "s_119") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + //-- NPC: Since the Imperials aren't sure what's going on with the mine, they've sent some of their droids to monitor the situation. You may have to deal with them as well. + string_id message = new string_id (c_stringFile, "s_121"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What kind of droids? + boolean hasResponse0 = false; + if (jinkins_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_123"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 20); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jinkins_handleBranch20 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Since the Imperials aren't sure what's going on with the mine, they've sent some of their droids to monitor the situation. You may have to deal with them as well. + + //-- [RESPONSE NOTE] + //-- PLAYER: What kind of droids? + if (response == "s_123") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + //-- NPC: We don't know, exactly. But we do have an ex-Imperial in our pocket who might have some information for you. Sergeant Moore owes Nym several thousand credits. He'll probably tell you whatever you need to know, for a price. Since he left the Imperial army, he spends most of his time in the cantina. + string_id message = new string_id (c_stringFile, "s_125"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Why did he leave the army? + boolean hasResponse0 = false; + if (jinkins_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Where is he? + boolean hasResponse1 = false; + if (jinkins_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_127"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_132"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 21); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jinkins_handleBranch21 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: We don't know, exactly. But we do have an ex-Imperial in our pocket who might have some information for you. Sergeant Moore owes Nym several thousand credits. He'll probably tell you whatever you need to know, for a price. Since he left the Imperial army, he spends most of his time in the cantina. + + //-- [RESPONSE NOTE] + //-- PLAYER: Why did he leave the army? + if (response == "s_127") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + //-- NPC: The Empire found out that he was borrowing credits from Nym. He was going to be executed, but he has friends in the Tagge family. They put in a good word, and Moore was kicked out instead of killed. But, he still has good information about the Empire's droids. + string_id message = new string_id (c_stringFile, "s_129"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Maybe I should go talk to him. + boolean hasResponse0 = false; + if (jinkins_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_133"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 22); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Where is he? + if (response == "s_132") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + jinkins_action_giveMooreQuest (player, npc); + + //-- NPC: You'll be happy to hear he is in the Stronghold Cantina. I know you've been there before, but just in case you've forgotten, I've given you a waypoint. Come back once you get the information about the droids in the mining facility. + string_id message = new string_id (c_stringFile, "s_134"); + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int jinkins_handleBranch22 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: The Empire found out that he was borrowing credits from Nym. He was going to be executed, but he has friends in the Tagge family. They put in a good word, and Moore was kicked out instead of killed. But, he still has good information about the Empire's droids. + + //-- [RESPONSE NOTE] + //-- PLAYER: Maybe I should go talk to him. + if (response == "s_133") + { + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + jinkins_action_giveMooreQuest (player, npc); + + //-- NPC: You'll be happy to hear he is in the Stronghold Cantina. I know you've been there before, but just in case you've forgotten, I've given you a waypoint. Come back once you get the information about the droids in the mining facility. + string_id message = new string_id (c_stringFile, "s_134"); + utils.removeScriptVar (player, "conversation.jinkins.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.jinkins"); + + 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.jinkins"); + + 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 (jinkins_condition_hasCompletedThemePark (player, npc)) + { + //-- NPC: You earned the title of Lok Revenant, %TU. Make sure to check with all the other pirates and see if they need your help. There is a special prize I'm reserving for you if you can get all the work done. + string_id message = new string_id (c_stringFile, "s_52"); + 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 (jinkins_condition_allQuestsComplete (player, npc)) + { + //-- NPC: Great work on the Mine, %TU. I have a feeling you have a bright pirate future ahead of you. + string_id message = new string_id (c_stringFile, "s_48"); + 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 (jinkins_condition_isDoneMineQuest (player, npc)) + { + jinkins_action_gotoKole (player, npc); + + //-- NPC: Hi again, %TU. Speak with Kole. He has some special plans for you. + string_id message = new string_id (c_stringFile, "s_50"); + 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 (jinkins_condition_hasMineFilter (player, npc)) + { + doAnimationAction (npc, "nod_head_multiple"); + + //-- NPC: You are back? Did you bring me the gas? + string_id message = new string_id (c_stringFile, "s_38"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Here is the filter. Why so surprised? + boolean hasResponse0 = false; + if (jinkins_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.jinkins.branchId", 4); + + npcStartConversation (player, npc, "jinkins", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (jinkins_condition_hasMineQuestIncomplete (player, npc)) + { + //-- NPC: Yes? + string_id message = new string_id (c_stringFile, "s_146"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What was I supposed to do? + boolean hasResponse0 = false; + if (jinkins_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_147"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 6); + + npcStartConversation (player, npc, "jinkins", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (jinkins_condition_hasReturnedFromMoore (player, npc)) + { + doAnimationAction (npc, "adjust"); + + jinkins_action_completeMooreQuest (player, npc); + + //-- NPC: I wasn't expecting you to come back. Figured you hopped a shuttle back to Naboo or whatever planet you come from. So you met with Sergeant Moore? What did he say about Imperial threats in the mine? + string_id message = new string_id (c_stringFile, "s_135"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Possibly some Droidekas. + boolean hasResponse0 = false; + if (jinkins_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_136"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 8); + + npcStartConversation (player, npc, "jinkins", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (jinkins_condition_hasCompletedPirate (player, npc)) + { + doAnimationAction (npc, "clap_rousing"); + + jinkins_action_hasFoundJinkins (player, npc); + + //-- NPC: Great job with the Sulfur Lake Pirates, %TU. I have a dangerous job that pays well if you are willing to accept it. + string_id message = new string_id (c_stringFile, "s_99"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Who are you? + boolean hasResponse0 = false; + if (jinkins_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: What is the job? + boolean hasResponse1 = false; + if (jinkins_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_101"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_103"); + + utils.setScriptVar (player, "conversation.jinkins.branchId", 15); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "jinkins", 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 (jinkins_condition_hasNotCompletedPirate (player, npc)) + { + doAnimationAction (npc, "shoo"); + + //-- NPC: You look a little lost. Maybe you should speak with Vana Sage to make sure you aren't in the wrong location at the wrong time. + string_id message = new string_id (c_stringFile, "s_105"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (jinkins_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "tap_foot"); + + //-- NPC: Sorry, we have work to do here. Not interested. + string_id message = new string_id (c_stringFile, "s_100"); + 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 != "jinkins") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.jinkins.branchId"); + + if (branchId == 4 && jinkins_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && jinkins_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && jinkins_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && jinkins_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && jinkins_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 11 && jinkins_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 12 && jinkins_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 13 && jinkins_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 15 && jinkins_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 16 && jinkins_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 17 && jinkins_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 18 && jinkins_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 19 && jinkins_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 20 && jinkins_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 21 && jinkins_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 22 && jinkins_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.jinkins.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_generic.script b/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_generic.script index 53b0987f9..d76d4c36b 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_generic.script +++ b/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_generic.script @@ -1,1102 +1,1102 @@ -// ====================================================================== -// -// junk_dealer_generic.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.smuggler; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/junk_dealer_generic"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean junk_dealer_generic_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_generic_condition_check_inv (obj_id player, obj_id npc) -{ - return smuggler.checkInventory(player, npc); -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_generic_condition_hasNoInv (obj_id player, obj_id npc) -{ - boolean hasNoInvRoom = false; - obj_id playerInv = utils.getInventoryContainer(player); - if ( isIdValid(playerInv) ) - { - int free_space = getVolumeFree(playerInv); - if (free_space < 1 ) - { - hasNoInvRoom = true; - } - } - return hasNoInvRoom; -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_generic_condition_checkForKit (obj_id player, obj_id npc) -{ - obj_id[] objContents = utils.getContents(player, true); - - if( objContents != null ) - { - for( int intI = 0; intI 0; -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_generic_condition_checkBuyBackContainer (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(!smuggler.hasBuyBackContainer(player)) - { - junk_dealer_generic_action_createBuyBackContainer(player, npc); - } - return true; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void junk_dealer_generic_action_start_dealing (obj_id player, obj_id npc) -{ - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startDealing", params, 0.0f, false); -} - -// ---------------------------------------------------------------------- - -void junk_dealer_generic_action_face_to (obj_id player, obj_id npc) -{ - faceTo(npc, player); -} - -// ---------------------------------------------------------------------- - -void junk_dealer_generic_action_giveOrange (obj_id player, obj_id npc) -{ - obj_id playerInv = getObjectInSlot( player, "inventory" ); - if(isIdValid(playerInv)) - { - obj_id item = createObject( "object/tangible/loot/collectible/kits/orange_rug_kit.iff", playerInv, "" ); - } - return; -} - -// ---------------------------------------------------------------------- - -void junk_dealer_generic_action_giveBlue (obj_id player, obj_id npc) -{ - obj_id playerInv = getObjectInSlot( player, "inventory" ); - if(isIdValid(playerInv)) - { - obj_id item = createObject( "object/tangible/loot/collectible/kits/blue_rug_kit.iff", playerInv, "" ); - } - return; -} - -// ---------------------------------------------------------------------- - -void junk_dealer_generic_action_giveGong (obj_id player, obj_id npc) -{ - obj_id playerInv = getObjectInSlot( player, "inventory" ); - if(isIdValid(playerInv)) - { - obj_id item = createObject( "object/tangible/loot/collectible/kits/gong_kit.iff", playerInv, "" ); - } - return; -} - -// ---------------------------------------------------------------------- - -void junk_dealer_generic_action_giveSculpture (obj_id player, obj_id npc) -{ - obj_id playerInv = getObjectInSlot( player, "inventory" ); - if(isIdValid(playerInv)) - { - obj_id item = createObject( "object/tangible/loot/collectible/kits/sculpture_kit.iff", playerInv, "" ); - } - return; -} - -// ---------------------------------------------------------------------- - -void junk_dealer_generic_action_giveTable (obj_id player, obj_id npc) -{ - obj_id playerInv = getObjectInSlot( player, "inventory" ); - if(isIdValid(playerInv)) - { - obj_id item = createObject( "object/tangible/loot/collectible/kits/light_table_kit.iff", playerInv, "" ); - } - return; -} - -// ---------------------------------------------------------------------- - -void junk_dealer_generic_action_startBuyBack (obj_id player, obj_id npc) -{ - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startBuyBack", params, 0.0f, false); -} - -// ---------------------------------------------------------------------- - -void junk_dealer_generic_action_createBuyBackContainer (obj_id player, obj_id npc) -{ - if(!isValidId(smuggler.createBuyBackControlDeviceOnPlayer(player))) - { - CustomerServiceLog("Junk_Dealer: ", "junk_dealer_generic conversation - Player (OID: " + player + ") did not get his buy back container set up properly."); - } -} - -// ---------------------------------------------------------------------- - -void junk_dealer_generic_action_startFlagNoSale (obj_id player, obj_id npc) -{ - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startFlaggingItemsNoSale", params, 0.0f, false); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int junk_dealer_generic_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Welcome traveler. I am a buyer of goods that most would deem as junk. If you are interested I will look through what you have to offer and set a price for anything that I wish to buy. I also have come across some other items of interest that I am looking to get rid of. - - //-- [RESPONSE NOTE] - //-- PLAYER: I sold you something I actually needed. Can I buy it back? - if (response == "s_43") - { - //-- [NOTE] - if (junk_dealer_generic_condition_hasNoInv (player, npc)) - { - //-- NPC: Looks like your inventory is full. Come back when you make some room. - string_id message = new string_id (c_stringFile, "s_47"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - junk_dealer_generic_action_startBuyBack (player, npc); - - //-- NPC: Of course! All you need to do is give me back the credits. What was the item? - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I have some things that you might be interested in. - if (response == "s_54fab04f") - { - //-- [NOTE] - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - junk_dealer_generic_action_start_dealing (player, npc); - - //-- NPC: Alright, let me see what you are offering. - string_id message = new string_id (c_stringFile, "s_84a67771"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: How can I mark items so you know what to buy and not to buy? - if (response == "s_48") - { - //-- [NOTE] - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - junk_dealer_generic_action_startFlagNoSale (player, npc); - - //-- NPC: Just select an item in this list to toggle the items sellable or no sell. - string_id message = new string_id (c_stringFile, "s_50"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I am sorry but I don't think I have anything you would want. - if (response == "s_cd7a3f41") - { - //-- [NOTE] - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - //-- NPC: That is too bad. Remember to come visit me in the future if you happen to come across anything I would be interested in. - string_id message = new string_id (c_stringFile, "s_4bd9d15e"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: What sort of items do you have that you are looking to get rid of? - if (response == "s_3aa18b2d") - { - //-- [NOTE] - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - //-- NPC: An inventor recently sold me and my fellow junk dealers a large quantity of these special kits that were supposed to revolutionize crafting. Unfortunately, they are useless without the special components that they are designed to use. - string_id message = new string_id (c_stringFile, "s_d9e6b751"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Why don't you just get some of the special components? - boolean hasResponse0 = false; - if (junk_dealer_generic_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_6d53d062"); - - utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int junk_dealer_generic_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: An inventor recently sold me and my fellow junk dealers a large quantity of these special kits that were supposed to revolutionize crafting. Unfortunately, they are useless without the special components that they are designed to use. - - //-- [RESPONSE NOTE] - //-- PLAYER: Why don't you just get some of the special components? - if (response == "s_6d53d062") - { - //-- [NOTE] - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - //-- NPC: Apparently this inventor had them all on a shipment that was coming in from the core worlds. As luck would have it the shipment was hijacked en route and all the components were lost to pirates. This caused the inventor to go out of business, leaving all of us stuck with these useless kits. - string_id message = new string_id (c_stringFile, "s_e29f48dc"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What good would a useless kit do me? - boolean hasResponse0 = false; - if (junk_dealer_generic_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_324b9b0f"); - - utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int junk_dealer_generic_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Apparently this inventor had them all on a shipment that was coming in from the core worlds. As luck would have it the shipment was hijacked en route and all the components were lost to pirates. This caused the inventor to go out of business, leaving all of us stuck with these useless kits. - - //-- [RESPONSE NOTE] - //-- PLAYER: What good would a useless kit do me? - if (response == "s_324b9b0f") - { - //-- [NOTE] - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - //-- NPC: You seem to be the adventurous sort so I figured that you might be able to find the parts. I mean they had to go somewhere, although my guess is that they are probably all over the galaxy by now. - string_id message = new string_id (c_stringFile, "s_12fe83a6"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Hmmmm, well how much do you want for these kits? - boolean hasResponse0 = false; - if (junk_dealer_generic_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_e1a103e5"); - - utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int junk_dealer_generic_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You seem to be the adventurous sort so I figured that you might be able to find the parts. I mean they had to go somewhere, although my guess is that they are probably all over the galaxy by now. - - //-- [RESPONSE NOTE] - //-- PLAYER: Hmmmm, well how much do you want for these kits? - if (response == "s_e1a103e5") - { - //-- [NOTE] - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - //-- NPC: I just want them gone. They are taking up valuable space in my inventory so I will just give you one of each type if you want. - string_id message = new string_id (c_stringFile, "s_4d65752"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Ok sounds good. What sort of kits do you have? - boolean hasResponse0 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: No thanks, I don't think that I need any of those kits. - boolean hasResponse1 = false; - if (junk_dealer_generic_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_d347bee3"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_b60b73f8"); - - utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int junk_dealer_generic_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I just want them gone. They are taking up valuable space in my inventory so I will just give you one of each type if you want. - - //-- [RESPONSE NOTE] - //-- PLAYER: Ok sounds good. What sort of kits do you have? - if (response == "s_d347bee3") - { - //-- [NOTE] - if (junk_dealer_generic_condition_checkForKit (player, npc)) - { - //-- NPC: Well let's see here. I have one that makes an orange rug, one that makes a blue rug, one that can make a Nabooian sculpture, one that makes a table, and one that makes some sort of model gong. I will only give you one kit at a time so if you want another you are going to have to get rid of the one you currently have first. - string_id message = new string_id (c_stringFile, "s_3fc7eb45"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Let me have one of those orange rug kits. - boolean hasResponse0 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: I will take one of the blue rug kits. - boolean hasResponse1 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: I think I would like one of those model gong kits. - boolean hasResponse2 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: Let me have one that makes the table. - boolean hasResponse3 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - //-- PLAYER: I think I will try out the one that makes the sculpture. - boolean hasResponse4 = false; - if (junk_dealer_generic_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_ee977dee"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_8f39769"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_fe657cdd"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_9ede4b84"); - - if (hasResponse4) - responses [responseIndex++] = new string_id (c_stringFile, "s_87c5851b"); - - utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (junk_dealer_generic_condition_checkForKitToo (player, npc)) - { - //-- NPC: It would appear that you already have one of these kits. I know I really want to get rid of all these kits but I just can't be handing them all out at once. You never know when they might be worth something. - string_id message = new string_id (c_stringFile, "s_3df21ea0"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: No thanks, I don't think that I need any of those kits. - if (response == "s_b60b73f8") - { - //-- [NOTE] - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - //-- NPC: Can't say that I blame you for not taking one. It's sad that I can't even give them away. If I ever see that inventor again I am going to make him really sorry. - string_id message = new string_id (c_stringFile, "s_3633b5a5"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int junk_dealer_generic_handleBranch11 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Well let's see here. I have one that makes an orange rug, one that makes a blue rug, one that can make a Nabooian sculpture, one that makes a table, and one that makes some sort of model gong. I will only give you one kit at a time so if you want another you are going to have to get rid of the one you currently have first. - - //-- [RESPONSE NOTE] - //-- PLAYER: Let me have one of those orange rug kits. - if (response == "s_ee977dee") - { - //-- [NOTE] - if (!junk_dealer_generic_condition_hasNoInv (player, npc)) - { - junk_dealer_generic_action_giveOrange (player, npc); - - //-- NPC: Ok, here you go. I guess in order to make it work you need to add ten special components to the kit. When you examine a kit, it has a list of what you need in order to complete the kit. It also has a read-out of whether it currently has a component or not. Oh, and if you do happen to make anything useful with that kit, I might be interested in buying that from you. - string_id message = new string_id (c_stringFile, "s_14efaaa2"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (junk_dealer_generic_condition_hasNoInv (player, npc)) - { - //-- NPC: I am sorry but you do not have any space in your inventory for me to give you a kit. Maybe you should clear out some room and talk to me again if you are still interested. - string_id message = new string_id (c_stringFile, "s_5b10c0b9"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I will take one of the blue rug kits. - if (response == "s_8f39769") - { - //-- [NOTE] - if (!junk_dealer_generic_condition_hasNoInv (player, npc)) - { - junk_dealer_generic_action_giveBlue (player, npc); - - //-- NPC: Ok, here you go. I guess in order to make it work you need to add ten special components to the kit. When you examine a kit, it has a list of what you need in order to complete the kit. It also has a read-out of whether it currently has a component or not. Oh, and if you do happen to make anything useful with that kit, I might be interested in buying that from you. - string_id message = new string_id (c_stringFile, "s_27"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (junk_dealer_generic_condition_hasNoInv (player, npc)) - { - //-- NPC: I am sorry but you do not have any space in your inventory for me to give you a kit. Maybe you should clear out some room and talk to me again if you are still interested. - string_id message = new string_id (c_stringFile, "s_29"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I think I would like one of those model gong kits. - if (response == "s_fe657cdd") - { - //-- [NOTE] - if (!junk_dealer_generic_condition_hasNoInv (player, npc)) - { - junk_dealer_generic_action_giveGong (player, npc); - - //-- NPC: Ok, here you go. I guess in order to make it work you need to add ten special components to the kit. When you examine a kit, it has a list of what you need in order to complete the kit. It also has a read-out of whether it currently has a component or not. Oh, and if you do happen to make anything useful with that kit, I might be interested in buying that from you. - string_id message = new string_id (c_stringFile, "s_32"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (junk_dealer_generic_condition_hasNoInv (player, npc)) - { - //-- NPC: I am sorry but you do not have any space in your inventory for me to give you a kit. Maybe you should clear out some room and talk to me again if you are still interested. - string_id message = new string_id (c_stringFile, "s_34"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Let me have one that makes the table. - if (response == "s_9ede4b84") - { - //-- [NOTE] - if (!junk_dealer_generic_condition_hasNoInv (player, npc)) - { - junk_dealer_generic_action_giveTable (player, npc); - - //-- NPC: Ok, here you go. I guess in order to make it work you need to add ten special components to the kit. When you examine a kit, it has a list of what you need in order to complete the kit. It also has a read-out of whether it currently has a component or not. Oh, and if you do happen to make anything useful with that kit, I might be interested in buying that from you. - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (junk_dealer_generic_condition_hasNoInv (player, npc)) - { - //-- NPC: I am sorry but you do not have any space in your inventory for me to give you a kit. Maybe you should clear out some room and talk to me again if you are still interested. - string_id message = new string_id (c_stringFile, "s_39"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I think I will try out the one that makes the sculpture. - if (response == "s_87c5851b") - { - //-- [NOTE] - if (!junk_dealer_generic_condition_hasNoInv (player, npc)) - { - junk_dealer_generic_action_giveSculpture (player, npc); - - //-- NPC: Ok, here you go. I guess in order to make it work you need to add ten special components to the kit. When you examine a kit, it has a list of what you need in order to complete the kit. It also has a read-out of whether it currently has a component or not. Oh, and if you do happen to make anything useful with that kit, I might be interested in buying that from you. - string_id message = new string_id (c_stringFile, "s_42"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (junk_dealer_generic_condition_hasNoInv (player, npc)) - { - //-- NPC: I am sorry but you do not have any space in your inventory for me to give you a kit. Maybe you should clear out some room and talk to me again if you are still interested. - string_id message = new string_id (c_stringFile, "s_49"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isMob (self)) || (isPlayer (self))) - detachScript(self, "conversation.junk_dealer_generic"); - - 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.junk_dealer_generic"); - - 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 (junk_dealer_generic_condition_checkBuyBackContainer (player, npc)) - { - junk_dealer_generic_action_face_to (player, npc); - - //-- NPC: Welcome traveler. I am a buyer of goods that most would deem as junk. If you are interested I will look through what you have to offer and set a price for anything that I wish to buy. I also have come across some other items of interest that I am looking to get rid of. - string_id message = new string_id (c_stringFile, "s_bef51e38"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I sold you something I actually needed. Can I buy it back? - boolean hasResponse0 = false; - if (junk_dealer_generic_condition_hasBuyBackItems (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: I have some things that you might be interested in. - boolean hasResponse1 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: How can I mark items so you know what to buy and not to buy? - boolean hasResponse2 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: I am sorry but I don't think I have anything you would want. - boolean hasResponse3 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - //-- PLAYER: What sort of items do you have that you are looking to get rid of? - boolean hasResponse4 = false; - if (junk_dealer_generic_condition_check_inv (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_43"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_54fab04f"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_48"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_cd7a3f41"); - - if (hasResponse4) - responses [responseIndex++] = new string_id (c_stringFile, "s_3aa18b2d"); - - utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 1); - - npcStartConversation (player, npc, "junk_dealer_generic", 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 != "junk_dealer_generic") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - if (branchId == 1 && junk_dealer_generic_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && junk_dealer_generic_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && junk_dealer_generic_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && junk_dealer_generic_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && junk_dealer_generic_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 11 && junk_dealer_generic_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// junk_dealer_generic.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.smuggler; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/junk_dealer_generic"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean junk_dealer_generic_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_generic_condition_check_inv (obj_id player, obj_id npc) +{ + return smuggler.checkInventory(player, npc); +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_generic_condition_hasNoInv (obj_id player, obj_id npc) +{ + boolean hasNoInvRoom = false; + obj_id playerInv = utils.getInventoryContainer(player); + if ( isIdValid(playerInv) ) + { + int free_space = getVolumeFree(playerInv); + if (free_space < 1 ) + { + hasNoInvRoom = true; + } + } + return hasNoInvRoom; +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_generic_condition_checkForKit (obj_id player, obj_id npc) +{ + obj_id[] objContents = utils.getContents(player, true); + + if( objContents != null ) + { + for( int intI = 0; intI 0; +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_generic_condition_checkBuyBackContainer (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(!smuggler.hasBuyBackContainer(player)) + { + junk_dealer_generic_action_createBuyBackContainer(player, npc); + } + return true; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void junk_dealer_generic_action_start_dealing (obj_id player, obj_id npc) +{ + dictionary params = new dictionary(); + params.put("player", player); + + messageTo(npc, "startDealing", params, 0.0f, false); +} + +// ---------------------------------------------------------------------- + +void junk_dealer_generic_action_face_to (obj_id player, obj_id npc) +{ + faceTo(npc, player); +} + +// ---------------------------------------------------------------------- + +void junk_dealer_generic_action_giveOrange (obj_id player, obj_id npc) +{ + obj_id playerInv = getObjectInSlot( player, "inventory" ); + if(isIdValid(playerInv)) + { + obj_id item = createObject( "object/tangible/loot/collectible/kits/orange_rug_kit.iff", playerInv, "" ); + } + return; +} + +// ---------------------------------------------------------------------- + +void junk_dealer_generic_action_giveBlue (obj_id player, obj_id npc) +{ + obj_id playerInv = getObjectInSlot( player, "inventory" ); + if(isIdValid(playerInv)) + { + obj_id item = createObject( "object/tangible/loot/collectible/kits/blue_rug_kit.iff", playerInv, "" ); + } + return; +} + +// ---------------------------------------------------------------------- + +void junk_dealer_generic_action_giveGong (obj_id player, obj_id npc) +{ + obj_id playerInv = getObjectInSlot( player, "inventory" ); + if(isIdValid(playerInv)) + { + obj_id item = createObject( "object/tangible/loot/collectible/kits/gong_kit.iff", playerInv, "" ); + } + return; +} + +// ---------------------------------------------------------------------- + +void junk_dealer_generic_action_giveSculpture (obj_id player, obj_id npc) +{ + obj_id playerInv = getObjectInSlot( player, "inventory" ); + if(isIdValid(playerInv)) + { + obj_id item = createObject( "object/tangible/loot/collectible/kits/sculpture_kit.iff", playerInv, "" ); + } + return; +} + +// ---------------------------------------------------------------------- + +void junk_dealer_generic_action_giveTable (obj_id player, obj_id npc) +{ + obj_id playerInv = getObjectInSlot( player, "inventory" ); + if(isIdValid(playerInv)) + { + obj_id item = createObject( "object/tangible/loot/collectible/kits/light_table_kit.iff", playerInv, "" ); + } + return; +} + +// ---------------------------------------------------------------------- + +void junk_dealer_generic_action_startBuyBack (obj_id player, obj_id npc) +{ + dictionary params = new dictionary(); + params.put("player", player); + + messageTo(npc, "startBuyBack", params, 0.0f, false); +} + +// ---------------------------------------------------------------------- + +void junk_dealer_generic_action_createBuyBackContainer (obj_id player, obj_id npc) +{ + if(!isValidId(smuggler.createBuyBackControlDeviceOnPlayer(player))) + { + CustomerServiceLog("Junk_Dealer: ", "junk_dealer_generic conversation - Player (OID: " + player + ") did not get his buy back container set up properly."); + } +} + +// ---------------------------------------------------------------------- + +void junk_dealer_generic_action_startFlagNoSale (obj_id player, obj_id npc) +{ + dictionary params = new dictionary(); + params.put("player", player); + + messageTo(npc, "startFlaggingItemsNoSale", params, 0.0f, false); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int junk_dealer_generic_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Welcome traveler. I am a buyer of goods that most would deem as junk. If you are interested I will look through what you have to offer and set a price for anything that I wish to buy. I also have come across some other items of interest that I am looking to get rid of. + + //-- [RESPONSE NOTE] + //-- PLAYER: I sold you something I actually needed. Can I buy it back? + if (response == "s_43") + { + //-- [NOTE] + if (junk_dealer_generic_condition_hasNoInv (player, npc)) + { + //-- NPC: Looks like your inventory is full. Come back when you make some room. + string_id message = new string_id (c_stringFile, "s_47"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + junk_dealer_generic_action_startBuyBack (player, npc); + + //-- NPC: Of course! All you need to do is give me back the credits. What was the item? + string_id message = new string_id (c_stringFile, "s_44"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I have some things that you might be interested in. + if (response == "s_54fab04f") + { + //-- [NOTE] + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + junk_dealer_generic_action_start_dealing (player, npc); + + //-- NPC: Alright, let me see what you are offering. + string_id message = new string_id (c_stringFile, "s_84a67771"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: How can I mark items so you know what to buy and not to buy? + if (response == "s_48") + { + //-- [NOTE] + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + junk_dealer_generic_action_startFlagNoSale (player, npc); + + //-- NPC: Just select an item in this list to toggle the items sellable or no sell. + string_id message = new string_id (c_stringFile, "s_50"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I am sorry but I don't think I have anything you would want. + if (response == "s_cd7a3f41") + { + //-- [NOTE] + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + //-- NPC: That is too bad. Remember to come visit me in the future if you happen to come across anything I would be interested in. + string_id message = new string_id (c_stringFile, "s_4bd9d15e"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: What sort of items do you have that you are looking to get rid of? + if (response == "s_3aa18b2d") + { + //-- [NOTE] + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + //-- NPC: An inventor recently sold me and my fellow junk dealers a large quantity of these special kits that were supposed to revolutionize crafting. Unfortunately, they are useless without the special components that they are designed to use. + string_id message = new string_id (c_stringFile, "s_d9e6b751"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Why don't you just get some of the special components? + boolean hasResponse0 = false; + if (junk_dealer_generic_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_6d53d062"); + + utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int junk_dealer_generic_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: An inventor recently sold me and my fellow junk dealers a large quantity of these special kits that were supposed to revolutionize crafting. Unfortunately, they are useless without the special components that they are designed to use. + + //-- [RESPONSE NOTE] + //-- PLAYER: Why don't you just get some of the special components? + if (response == "s_6d53d062") + { + //-- [NOTE] + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + //-- NPC: Apparently this inventor had them all on a shipment that was coming in from the core worlds. As luck would have it the shipment was hijacked en route and all the components were lost to pirates. This caused the inventor to go out of business, leaving all of us stuck with these useless kits. + string_id message = new string_id (c_stringFile, "s_e29f48dc"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What good would a useless kit do me? + boolean hasResponse0 = false; + if (junk_dealer_generic_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_324b9b0f"); + + utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int junk_dealer_generic_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Apparently this inventor had them all on a shipment that was coming in from the core worlds. As luck would have it the shipment was hijacked en route and all the components were lost to pirates. This caused the inventor to go out of business, leaving all of us stuck with these useless kits. + + //-- [RESPONSE NOTE] + //-- PLAYER: What good would a useless kit do me? + if (response == "s_324b9b0f") + { + //-- [NOTE] + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + //-- NPC: You seem to be the adventurous sort so I figured that you might be able to find the parts. I mean they had to go somewhere, although my guess is that they are probably all over the galaxy by now. + string_id message = new string_id (c_stringFile, "s_12fe83a6"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Hmmmm, well how much do you want for these kits? + boolean hasResponse0 = false; + if (junk_dealer_generic_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_e1a103e5"); + + utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int junk_dealer_generic_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You seem to be the adventurous sort so I figured that you might be able to find the parts. I mean they had to go somewhere, although my guess is that they are probably all over the galaxy by now. + + //-- [RESPONSE NOTE] + //-- PLAYER: Hmmmm, well how much do you want for these kits? + if (response == "s_e1a103e5") + { + //-- [NOTE] + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + //-- NPC: I just want them gone. They are taking up valuable space in my inventory so I will just give you one of each type if you want. + string_id message = new string_id (c_stringFile, "s_4d65752"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Ok sounds good. What sort of kits do you have? + boolean hasResponse0 = false; + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: No thanks, I don't think that I need any of those kits. + boolean hasResponse1 = false; + if (junk_dealer_generic_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_d347bee3"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_b60b73f8"); + + utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int junk_dealer_generic_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I just want them gone. They are taking up valuable space in my inventory so I will just give you one of each type if you want. + + //-- [RESPONSE NOTE] + //-- PLAYER: Ok sounds good. What sort of kits do you have? + if (response == "s_d347bee3") + { + //-- [NOTE] + if (junk_dealer_generic_condition_checkForKit (player, npc)) + { + //-- NPC: Well let's see here. I have one that makes an orange rug, one that makes a blue rug, one that can make a Nabooian sculpture, one that makes a table, and one that makes some sort of model gong. I will only give you one kit at a time so if you want another you are going to have to get rid of the one you currently have first. + string_id message = new string_id (c_stringFile, "s_3fc7eb45"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Let me have one of those orange rug kits. + boolean hasResponse0 = false; + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: I will take one of the blue rug kits. + boolean hasResponse1 = false; + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: I think I would like one of those model gong kits. + boolean hasResponse2 = false; + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: Let me have one that makes the table. + boolean hasResponse3 = false; + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + //-- PLAYER: I think I will try out the one that makes the sculpture. + boolean hasResponse4 = false; + if (junk_dealer_generic_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_ee977dee"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_8f39769"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_fe657cdd"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_9ede4b84"); + + if (hasResponse4) + responses [responseIndex++] = new string_id (c_stringFile, "s_87c5851b"); + + utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 11); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (junk_dealer_generic_condition_checkForKitToo (player, npc)) + { + //-- NPC: It would appear that you already have one of these kits. I know I really want to get rid of all these kits but I just can't be handing them all out at once. You never know when they might be worth something. + string_id message = new string_id (c_stringFile, "s_3df21ea0"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: No thanks, I don't think that I need any of those kits. + if (response == "s_b60b73f8") + { + //-- [NOTE] + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + //-- NPC: Can't say that I blame you for not taking one. It's sad that I can't even give them away. If I ever see that inventor again I am going to make him really sorry. + string_id message = new string_id (c_stringFile, "s_3633b5a5"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int junk_dealer_generic_handleBranch11 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Well let's see here. I have one that makes an orange rug, one that makes a blue rug, one that can make a Nabooian sculpture, one that makes a table, and one that makes some sort of model gong. I will only give you one kit at a time so if you want another you are going to have to get rid of the one you currently have first. + + //-- [RESPONSE NOTE] + //-- PLAYER: Let me have one of those orange rug kits. + if (response == "s_ee977dee") + { + //-- [NOTE] + if (!junk_dealer_generic_condition_hasNoInv (player, npc)) + { + junk_dealer_generic_action_giveOrange (player, npc); + + //-- NPC: Ok, here you go. I guess in order to make it work you need to add ten special components to the kit. When you examine a kit, it has a list of what you need in order to complete the kit. It also has a read-out of whether it currently has a component or not. Oh, and if you do happen to make anything useful with that kit, I might be interested in buying that from you. + string_id message = new string_id (c_stringFile, "s_14efaaa2"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (junk_dealer_generic_condition_hasNoInv (player, npc)) + { + //-- NPC: I am sorry but you do not have any space in your inventory for me to give you a kit. Maybe you should clear out some room and talk to me again if you are still interested. + string_id message = new string_id (c_stringFile, "s_5b10c0b9"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I will take one of the blue rug kits. + if (response == "s_8f39769") + { + //-- [NOTE] + if (!junk_dealer_generic_condition_hasNoInv (player, npc)) + { + junk_dealer_generic_action_giveBlue (player, npc); + + //-- NPC: Ok, here you go. I guess in order to make it work you need to add ten special components to the kit. When you examine a kit, it has a list of what you need in order to complete the kit. It also has a read-out of whether it currently has a component or not. Oh, and if you do happen to make anything useful with that kit, I might be interested in buying that from you. + string_id message = new string_id (c_stringFile, "s_27"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (junk_dealer_generic_condition_hasNoInv (player, npc)) + { + //-- NPC: I am sorry but you do not have any space in your inventory for me to give you a kit. Maybe you should clear out some room and talk to me again if you are still interested. + string_id message = new string_id (c_stringFile, "s_29"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I think I would like one of those model gong kits. + if (response == "s_fe657cdd") + { + //-- [NOTE] + if (!junk_dealer_generic_condition_hasNoInv (player, npc)) + { + junk_dealer_generic_action_giveGong (player, npc); + + //-- NPC: Ok, here you go. I guess in order to make it work you need to add ten special components to the kit. When you examine a kit, it has a list of what you need in order to complete the kit. It also has a read-out of whether it currently has a component or not. Oh, and if you do happen to make anything useful with that kit, I might be interested in buying that from you. + string_id message = new string_id (c_stringFile, "s_32"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (junk_dealer_generic_condition_hasNoInv (player, npc)) + { + //-- NPC: I am sorry but you do not have any space in your inventory for me to give you a kit. Maybe you should clear out some room and talk to me again if you are still interested. + string_id message = new string_id (c_stringFile, "s_34"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Let me have one that makes the table. + if (response == "s_9ede4b84") + { + //-- [NOTE] + if (!junk_dealer_generic_condition_hasNoInv (player, npc)) + { + junk_dealer_generic_action_giveTable (player, npc); + + //-- NPC: Ok, here you go. I guess in order to make it work you need to add ten special components to the kit. When you examine a kit, it has a list of what you need in order to complete the kit. It also has a read-out of whether it currently has a component or not. Oh, and if you do happen to make anything useful with that kit, I might be interested in buying that from you. + string_id message = new string_id (c_stringFile, "s_37"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (junk_dealer_generic_condition_hasNoInv (player, npc)) + { + //-- NPC: I am sorry but you do not have any space in your inventory for me to give you a kit. Maybe you should clear out some room and talk to me again if you are still interested. + string_id message = new string_id (c_stringFile, "s_39"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I think I will try out the one that makes the sculpture. + if (response == "s_87c5851b") + { + //-- [NOTE] + if (!junk_dealer_generic_condition_hasNoInv (player, npc)) + { + junk_dealer_generic_action_giveSculpture (player, npc); + + //-- NPC: Ok, here you go. I guess in order to make it work you need to add ten special components to the kit. When you examine a kit, it has a list of what you need in order to complete the kit. It also has a read-out of whether it currently has a component or not. Oh, and if you do happen to make anything useful with that kit, I might be interested in buying that from you. + string_id message = new string_id (c_stringFile, "s_42"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (junk_dealer_generic_condition_hasNoInv (player, npc)) + { + //-- NPC: I am sorry but you do not have any space in your inventory for me to give you a kit. Maybe you should clear out some room and talk to me again if you are still interested. + string_id message = new string_id (c_stringFile, "s_49"); + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isMob (self)) || (isPlayer (self))) + detachScript(self, "conversation.junk_dealer_generic"); + + 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.junk_dealer_generic"); + + 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 (junk_dealer_generic_condition_checkBuyBackContainer (player, npc)) + { + junk_dealer_generic_action_face_to (player, npc); + + //-- NPC: Welcome traveler. I am a buyer of goods that most would deem as junk. If you are interested I will look through what you have to offer and set a price for anything that I wish to buy. I also have come across some other items of interest that I am looking to get rid of. + string_id message = new string_id (c_stringFile, "s_bef51e38"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I sold you something I actually needed. Can I buy it back? + boolean hasResponse0 = false; + if (junk_dealer_generic_condition_hasBuyBackItems (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: I have some things that you might be interested in. + boolean hasResponse1 = false; + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: How can I mark items so you know what to buy and not to buy? + boolean hasResponse2 = false; + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: I am sorry but I don't think I have anything you would want. + boolean hasResponse3 = false; + if (junk_dealer_generic_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + //-- PLAYER: What sort of items do you have that you are looking to get rid of? + boolean hasResponse4 = false; + if (junk_dealer_generic_condition_check_inv (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_43"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_54fab04f"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_48"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_cd7a3f41"); + + if (hasResponse4) + responses [responseIndex++] = new string_id (c_stringFile, "s_3aa18b2d"); + + utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 1); + + npcStartConversation (player, npc, "junk_dealer_generic", 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 != "junk_dealer_generic") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + if (branchId == 1 && junk_dealer_generic_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && junk_dealer_generic_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && junk_dealer_generic_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && junk_dealer_generic_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && junk_dealer_generic_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 11 && junk_dealer_generic_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_jawa.script b/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_jawa.script index b8a63258a..f2a62a0aa 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_jawa.script +++ b/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_jawa.script @@ -1,433 +1,433 @@ -// ====================================================================== -// -// junk_dealer_jawa.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.smuggler; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/junk_dealer_jawa"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean junk_dealer_jawa_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_jawa_condition_hasNoInv (obj_id player, obj_id npc) -{ - faceTo(npc, player); - boolean hasNoInvRoom = false; - obj_id playerInv = utils.getInventoryContainer(player); - if ( isIdValid(playerInv) ) - { - int free_space = getVolumeFree(playerInv); - if (free_space < 1 ) - { - hasNoInvRoom = true; - } - } - return hasNoInvRoom; -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_jawa_condition_hasBuyBackItems (obj_id player, obj_id npc) -{ - faceTo(npc, player); - obj_id[] listOfBuyBacks = smuggler.getBuyBackItemsInContainer(player); - return listOfBuyBacks != null && listOfBuyBacks.length > 0; -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_jawa_condition_checkBuyBackContainer (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(!smuggler.hasBuyBackContainer(player)) - { - junk_dealer_jawa_action_createBuyBackContainer(player, npc); - } - return true; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void junk_dealer_jawa_action_start_dealing (obj_id player, obj_id npc) -{ - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startDealing", params, 0.0f, false); -} - -// ---------------------------------------------------------------------- - -void junk_dealer_jawa_action_face_to (obj_id player, obj_id npc) -{ - faceTo(npc, player); -} - -// ---------------------------------------------------------------------- - -void junk_dealer_jawa_action_startBuyBack (obj_id player, obj_id npc) -{ - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startBuyBack", params, 0.0f, false); -} - -// ---------------------------------------------------------------------- - -void junk_dealer_jawa_action_createBuyBackContainer (obj_id player, obj_id npc) -{ - if(!isValidId(smuggler.createBuyBackControlDeviceOnPlayer(player))) - { - CustomerServiceLog("Junk_Dealer: ", "junk_dealer_generic conversation - Player (OID: " + player + ") did not get his buy back container set up properly."); - } -} - -// ---------------------------------------------------------------------- - -void junk_dealer_jawa_action_startFlagNoSale (obj_id player, obj_id npc) -{ - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startFlaggingItemsNoSale", params, 0.0f, false); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int junk_dealer_jawa_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: M'um m'aloo Eyeta! - - //-- [RESPONSE NOTE] - //-- PLAYER: I sold you something I actually needed. Can I buy it back? - if (response == "s_43") - { - //-- [NOTE] - if (junk_dealer_jawa_condition_hasNoInv (player, npc)) - { - //-- NPC: Yanna kuzu peekay. - string_id message = new string_id (c_stringFile, "s_47"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I don't have room? Okay. I'll take care of that. - boolean hasResponse0 = false; - if (junk_dealer_jawa_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_53"); - - utils.setScriptVar (player, "conversation.junk_dealer_jawa.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (junk_dealer_jawa_condition__defaultCondition (player, npc)) - { - junk_dealer_jawa_action_startBuyBack (player, npc); - - //-- NPC: Etee uwanna waa. - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I have some things that you might be interested in. - if (response == "s_54fab04f") - { - //-- [NOTE] - if (junk_dealer_jawa_condition__defaultCondition (player, npc)) - { - junk_dealer_jawa_action_start_dealing (player, npc); - - //-- NPC: Etee uwanna waa. - string_id message = new string_id (c_stringFile, "s_84a67771"); - utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: How can I mark items so you know what to buy and not to buy? - if (response == "s_48") - { - //-- [NOTE] - if (junk_dealer_jawa_condition__defaultCondition (player, npc)) - { - junk_dealer_jawa_action_startFlagNoSale (player, npc); - - //-- NPC: Yukusu kenza keena. - string_id message = new string_id (c_stringFile, "s_50"); - utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int junk_dealer_jawa_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yanna kuzu peekay. - - //-- [RESPONSE NOTE] - //-- PLAYER: I don't have room? Okay. I'll take care of that. - if (response == "s_53") - { - //-- [NOTE] - if (junk_dealer_jawa_condition__defaultCondition (player, npc)) - { - //-- NPC: Yanna kuzu peekay!! Peekay...peekay! - string_id message = new string_id (c_stringFile, "s_54"); - utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isMob (self)) || (isPlayer (self))) - detachScript(self, "conversation.junk_dealer_jawa"); - - 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.junk_dealer_jawa"); - - 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 (junk_dealer_jawa_condition_checkBuyBackContainer (player, npc)) - { - junk_dealer_jawa_action_face_to (player, npc); - - //-- NPC: M'um m'aloo Eyeta! - string_id message = new string_id (c_stringFile, "s_bef51e38"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I sold you something I actually needed. Can I buy it back? - boolean hasResponse0 = false; - if (junk_dealer_jawa_condition_hasBuyBackItems (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: I have some things that you might be interested in. - boolean hasResponse1 = false; - if (junk_dealer_jawa_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: How can I mark items so you know what to buy and not to buy? - boolean hasResponse2 = false; - if (junk_dealer_jawa_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_43"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_54fab04f"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_48"); - - utils.setScriptVar (player, "conversation.junk_dealer_jawa.branchId", 1); - - npcStartConversation (player, npc, "junk_dealer_jawa", 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 != "junk_dealer_jawa") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.junk_dealer_jawa.branchId"); - - if (branchId == 1 && junk_dealer_jawa_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && junk_dealer_jawa_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// junk_dealer_jawa.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.smuggler; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/junk_dealer_jawa"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean junk_dealer_jawa_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_jawa_condition_hasNoInv (obj_id player, obj_id npc) +{ + faceTo(npc, player); + boolean hasNoInvRoom = false; + obj_id playerInv = utils.getInventoryContainer(player); + if ( isIdValid(playerInv) ) + { + int free_space = getVolumeFree(playerInv); + if (free_space < 1 ) + { + hasNoInvRoom = true; + } + } + return hasNoInvRoom; +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_jawa_condition_hasBuyBackItems (obj_id player, obj_id npc) +{ + faceTo(npc, player); + obj_id[] listOfBuyBacks = smuggler.getBuyBackItemsInContainer(player); + return listOfBuyBacks != null && listOfBuyBacks.length > 0; +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_jawa_condition_checkBuyBackContainer (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(!smuggler.hasBuyBackContainer(player)) + { + junk_dealer_jawa_action_createBuyBackContainer(player, npc); + } + return true; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void junk_dealer_jawa_action_start_dealing (obj_id player, obj_id npc) +{ + dictionary params = new dictionary(); + params.put("player", player); + + messageTo(npc, "startDealing", params, 0.0f, false); +} + +// ---------------------------------------------------------------------- + +void junk_dealer_jawa_action_face_to (obj_id player, obj_id npc) +{ + faceTo(npc, player); +} + +// ---------------------------------------------------------------------- + +void junk_dealer_jawa_action_startBuyBack (obj_id player, obj_id npc) +{ + dictionary params = new dictionary(); + params.put("player", player); + + messageTo(npc, "startBuyBack", params, 0.0f, false); +} + +// ---------------------------------------------------------------------- + +void junk_dealer_jawa_action_createBuyBackContainer (obj_id player, obj_id npc) +{ + if(!isValidId(smuggler.createBuyBackControlDeviceOnPlayer(player))) + { + CustomerServiceLog("Junk_Dealer: ", "junk_dealer_generic conversation - Player (OID: " + player + ") did not get his buy back container set up properly."); + } +} + +// ---------------------------------------------------------------------- + +void junk_dealer_jawa_action_startFlagNoSale (obj_id player, obj_id npc) +{ + dictionary params = new dictionary(); + params.put("player", player); + + messageTo(npc, "startFlaggingItemsNoSale", params, 0.0f, false); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int junk_dealer_jawa_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: M'um m'aloo Eyeta! + + //-- [RESPONSE NOTE] + //-- PLAYER: I sold you something I actually needed. Can I buy it back? + if (response == "s_43") + { + //-- [NOTE] + if (junk_dealer_jawa_condition_hasNoInv (player, npc)) + { + //-- NPC: Yanna kuzu peekay. + string_id message = new string_id (c_stringFile, "s_47"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I don't have room? Okay. I'll take care of that. + boolean hasResponse0 = false; + if (junk_dealer_jawa_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_53"); + + utils.setScriptVar (player, "conversation.junk_dealer_jawa.branchId", 2); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (junk_dealer_jawa_condition__defaultCondition (player, npc)) + { + junk_dealer_jawa_action_startBuyBack (player, npc); + + //-- NPC: Etee uwanna waa. + string_id message = new string_id (c_stringFile, "s_44"); + utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I have some things that you might be interested in. + if (response == "s_54fab04f") + { + //-- [NOTE] + if (junk_dealer_jawa_condition__defaultCondition (player, npc)) + { + junk_dealer_jawa_action_start_dealing (player, npc); + + //-- NPC: Etee uwanna waa. + string_id message = new string_id (c_stringFile, "s_84a67771"); + utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: How can I mark items so you know what to buy and not to buy? + if (response == "s_48") + { + //-- [NOTE] + if (junk_dealer_jawa_condition__defaultCondition (player, npc)) + { + junk_dealer_jawa_action_startFlagNoSale (player, npc); + + //-- NPC: Yukusu kenza keena. + string_id message = new string_id (c_stringFile, "s_50"); + utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int junk_dealer_jawa_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yanna kuzu peekay. + + //-- [RESPONSE NOTE] + //-- PLAYER: I don't have room? Okay. I'll take care of that. + if (response == "s_53") + { + //-- [NOTE] + if (junk_dealer_jawa_condition__defaultCondition (player, npc)) + { + //-- NPC: Yanna kuzu peekay!! Peekay...peekay! + string_id message = new string_id (c_stringFile, "s_54"); + utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isMob (self)) || (isPlayer (self))) + detachScript(self, "conversation.junk_dealer_jawa"); + + 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.junk_dealer_jawa"); + + 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 (junk_dealer_jawa_condition_checkBuyBackContainer (player, npc)) + { + junk_dealer_jawa_action_face_to (player, npc); + + //-- NPC: M'um m'aloo Eyeta! + string_id message = new string_id (c_stringFile, "s_bef51e38"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I sold you something I actually needed. Can I buy it back? + boolean hasResponse0 = false; + if (junk_dealer_jawa_condition_hasBuyBackItems (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: I have some things that you might be interested in. + boolean hasResponse1 = false; + if (junk_dealer_jawa_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: How can I mark items so you know what to buy and not to buy? + boolean hasResponse2 = false; + if (junk_dealer_jawa_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_43"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_54fab04f"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_48"); + + utils.setScriptVar (player, "conversation.junk_dealer_jawa.branchId", 1); + + npcStartConversation (player, npc, "junk_dealer_jawa", 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 != "junk_dealer_jawa") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.junk_dealer_jawa.branchId"); + + if (branchId == 1 && junk_dealer_jawa_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && junk_dealer_jawa_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_smuggler.script b/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_smuggler.script index cde843f8b..804fea600 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_smuggler.script +++ b/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_smuggler.script @@ -1,647 +1,647 @@ -// ====================================================================== -// -// junk_dealer_smuggler.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.group; -include library.quests; -include library.smuggler; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/junk_dealer_smuggler"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean junk_dealer_smuggler_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_smuggler_condition_check_inv (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return smuggler.checkInventory(player, npc); -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_smuggler_condition_hasNoInv (obj_id player, obj_id npc) -{ - faceTo(npc, player); - boolean hasNoInvRoom = false; - obj_id playerInv = utils.getInventoryContainer(player); - if ( isIdValid(playerInv) ) - { - int free_space = getVolumeFree(playerInv); - if (free_space < 1 ) - { - hasNoInvRoom = true; - } - } - return hasNoInvRoom; -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_smuggler_condition_check_master (obj_id player, obj_id npc) -{ - faceTo(npc, player); - obj_id master = utils.getObjIdScriptVar(npc, "smugglerMaster"); - - if(master != player) - { - return false; - } - - return true; -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_smuggler_condition_isInParty (obj_id player, obj_id npc) -{ - faceTo(npc, player); - obj_id master = utils.getObjIdScriptVar(npc, "smugglerMaster"); - - if(player == master) - { - return true; - } - - // Collect party members and set them on the Jedi casting this buff - if(group.isGrouped(master)) - { - Vector party = group.getPCMembersInRange(master, 32f); - - if(party != null) - { - for(int i = 0; i < party.size(); i++) - { - obj_id who = (obj_id)party.elementAt(i); - - if(player == who) - { - return true; - } - } - } - } - - return false; -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_smuggler_condition_canGetPistolQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - obj_id module = utils.getStaticItemInInventory(player, "item_reward_modify_pistol_01_01"); - - if(!isIdValid(module) || getCount(module) <= 0) - { - return false; - } - - if(groundquests.isQuestActive(player, "quest/smuggler_modules_for_pistol")) - { - return false; - } - - return true; -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_smuggler_condition_canGetPistolQuestComplete (obj_id player, obj_id npc) -{ - faceTo(npc, player); - obj_id module = utils.getStaticItemInInventory(player, "item_reward_modify_pistol_01_01"); - - if(!isIdValid(module) || getCount(module) < 100) - { - return false; - } - - if(!groundquests.isQuestActive(player, "quest/smuggler_modules_for_pistol")) - { - return false; - } - - return true; -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_smuggler_condition_hasBuyBackItems (obj_id player, obj_id npc) -{ - obj_id[] listOfBuyBacks = smuggler.getBuyBackItemsInContainer(player); - return listOfBuyBacks != null && listOfBuyBacks.length > 0; -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_smuggler_condition_isInPartyWithBuyBack (obj_id player, obj_id npc) -{ - return junk_dealer_smuggler_condition_isInParty(player, npc) && junk_dealer_smuggler_condition_hasBuyBackItems(player, npc); -} - -// ---------------------------------------------------------------------- - -boolean junk_dealer_smuggler_condition_checkBuyBackContainer (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(!smuggler.hasBuyBackContainer(player)) - { - junk_dealer_smuggler_action_createBuyBackContainer(player, npc); - } - return true; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void junk_dealer_smuggler_action_start_dealing (obj_id player, obj_id npc) -{ - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startDealing", params, 0.0f, false); -} - -// ---------------------------------------------------------------------- - -void junk_dealer_smuggler_action_face_to (obj_id player, obj_id npc) -{ - faceTo(npc, player); -} - -// ---------------------------------------------------------------------- - -void junk_dealer_smuggler_action_grant_pistol_quest (obj_id player, obj_id npc) -{ - groundquests.requestGrantQuest(player, "quest/smuggler_modules_for_pistol", true); -} - -// ---------------------------------------------------------------------- - -void junk_dealer_smuggler_action_complete_pistol_quest (obj_id player, obj_id npc) -{ - obj_id module = utils.getStaticItemInInventory(player, "item_reward_modify_pistol_01_01"); - - if(!isIdValid(module) || getCount(module) < 100) - { - return; - } - - int count = getCount(module); - - count -= 100; - - if(count <= 0) - { - destroyObject(module); - } - else - { - setCount(module, count); - } - - groundquests.sendSignal(player, "smugglerModulesCollected"); -} - -// ---------------------------------------------------------------------- - -void junk_dealer_smuggler_action_startBuyBack (obj_id player, obj_id npc) -{ - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startBuyBack", params, 0.0f, false); -} - -// ---------------------------------------------------------------------- - -void junk_dealer_smuggler_action_createBuyBackContainer (obj_id player, obj_id npc) -{ - if(!isValidId(smuggler.createBuyBackControlDeviceOnPlayer(player))) - { - CustomerServiceLog("Junk_Dealer: ", "junk_dealer_generic conversation - Player (OID: " + player + ") did not get his buy back container set up properly."); - } -} - -// ---------------------------------------------------------------------- - -void junk_dealer_smuggler_action_dismiss (obj_id player, obj_id npc) -{ - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "dismissDealer", params, 1.0f, false); -} - -// ---------------------------------------------------------------------- - -void junk_dealer_smuggler_action_startFlagNoSale (obj_id player, obj_id npc) -{ - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startFlaggingItemsNoSale", params, 0.0f, false); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int junk_dealer_smuggler_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I hope you didn't call me out here for nothing. Let's get on with it. - - //-- [RESPONSE NOTE] - //-- PLAYER: I sold you something I actually needed. Can I buy it back? - if (response == "s_17") - { - //-- [NOTE] - if (junk_dealer_smuggler_condition_hasNoInv (player, npc)) - { - //-- NPC: Looks like your inventory is full. Come back when you make some room. - string_id message = new string_id (c_stringFile, "s_18"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - junk_dealer_smuggler_action_startBuyBack (player, npc); - - //-- NPC: Of course! All you need to do is give me back the credits. What was the item? - string_id message = new string_id (c_stringFile, "s_19"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I have some things that you might be interested in. - if (response == "s_54fab04f") - { - //-- [NOTE] - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - junk_dealer_smuggler_action_start_dealing (player, npc); - - //-- NPC: Alright, let me see what you are offering. - string_id message = new string_id (c_stringFile, "s_84a67771"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: How can I mark items so you know what to buy and not to buy? - if (response == "s_20") - { - //-- [NOTE] - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - junk_dealer_smuggler_action_startFlagNoSale (player, npc); - - //-- NPC: Just select an item in this list to toggle the items sellable or no sell. - string_id message = new string_id (c_stringFile, "s_23"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I am sorry but I don't think I have anything you would want. - if (response == "s_cd7a3f41") - { - //-- [NOTE] - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - //-- NPC: Arg! I knew you were good for nothing! I'll remember this the next time. - string_id message = new string_id (c_stringFile, "s_4bd9d15e"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I'm done dealing with you. Please leave. - if (response == "s_43") - { - //-- [NOTE] - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - junk_dealer_smuggler_action_dismiss (player, npc); - - //-- NPC: I better get going. Make sure to keep me in mind, if you run across anything else I might find of value. - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I heard you like pistol modifications. - if (response == "s_15") - { - //-- [NOTE] - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - junk_dealer_smuggler_action_grant_pistol_quest (player, npc); - - //-- NPC: Oh yes! I collect them for... uh... research purposes! - string_id message = new string_id (c_stringFile, "s_21"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Here are those pistol modules you requested. - if (response == "s_24") - { - //-- [NOTE] - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - junk_dealer_smuggler_action_complete_pistol_quest (player, npc); - - //-- NPC: Excellent! I will make sure these get to the... uh... scientists! - string_id message = new string_id (c_stringFile, "s_26"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isMob (self)) || (isPlayer (self))) - detachScript(self, "conversation.junk_dealer_smuggler"); - - 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.junk_dealer_smuggler"); - - 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 (junk_dealer_smuggler_condition_checkBuyBackContainer (player, npc)) - { - //-- NPC: I hope you didn't call me out here for nothing. Let's get on with it. - string_id message = new string_id (c_stringFile, "s_bef51e38"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I sold you something I actually needed. Can I buy it back? - boolean hasResponse0 = false; - if (junk_dealer_smuggler_condition_isInPartyWithBuyBack (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: I have some things that you might be interested in. - boolean hasResponse1 = false; - if (junk_dealer_smuggler_condition_isInParty (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: How can I mark items so you know what to buy and not to buy? - boolean hasResponse2 = false; - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: I am sorry but I don't think I have anything you would want. - boolean hasResponse3 = false; - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - //-- PLAYER: I'm done dealing with you. Please leave. - boolean hasResponse4 = false; - if (junk_dealer_smuggler_condition_check_master (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - //-- PLAYER: I heard you like pistol modifications. - boolean hasResponse5 = false; - if (junk_dealer_smuggler_condition_canGetPistolQuest (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - //-- PLAYER: Here are those pistol modules you requested. - boolean hasResponse6 = false; - if (junk_dealer_smuggler_condition_canGetPistolQuestComplete (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse6 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_17"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_54fab04f"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_20"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_cd7a3f41"); - - if (hasResponse4) - responses [responseIndex++] = new string_id (c_stringFile, "s_43"); - - if (hasResponse5) - responses [responseIndex++] = new string_id (c_stringFile, "s_15"); - - if (hasResponse6) - responses [responseIndex++] = new string_id (c_stringFile, "s_24"); - - utils.setScriptVar (player, "conversation.junk_dealer_smuggler.branchId", 1); - - npcStartConversation (player, npc, "junk_dealer_smuggler", 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 != "junk_dealer_smuggler") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - if (branchId == 1 && junk_dealer_smuggler_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// junk_dealer_smuggler.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.group; +include library.quests; +include library.smuggler; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/junk_dealer_smuggler"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean junk_dealer_smuggler_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_smuggler_condition_check_inv (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return smuggler.checkInventory(player, npc); +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_smuggler_condition_hasNoInv (obj_id player, obj_id npc) +{ + faceTo(npc, player); + boolean hasNoInvRoom = false; + obj_id playerInv = utils.getInventoryContainer(player); + if ( isIdValid(playerInv) ) + { + int free_space = getVolumeFree(playerInv); + if (free_space < 1 ) + { + hasNoInvRoom = true; + } + } + return hasNoInvRoom; +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_smuggler_condition_check_master (obj_id player, obj_id npc) +{ + faceTo(npc, player); + obj_id master = utils.getObjIdScriptVar(npc, "smugglerMaster"); + + if(master != player) + { + return false; + } + + return true; +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_smuggler_condition_isInParty (obj_id player, obj_id npc) +{ + faceTo(npc, player); + obj_id master = utils.getObjIdScriptVar(npc, "smugglerMaster"); + + if(player == master) + { + return true; + } + + // Collect party members and set them on the Jedi casting this buff + if(group.isGrouped(master)) + { + Vector party = group.getPCMembersInRange(master, 32f); + + if(party != null) + { + for(int i = 0; i < party.size(); i++) + { + obj_id who = (obj_id)party.elementAt(i); + + if(player == who) + { + return true; + } + } + } + } + + return false; +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_smuggler_condition_canGetPistolQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + obj_id module = utils.getStaticItemInInventory(player, "item_reward_modify_pistol_01_01"); + + if(!isIdValid(module) || getCount(module) <= 0) + { + return false; + } + + if(groundquests.isQuestActive(player, "quest/smuggler_modules_for_pistol")) + { + return false; + } + + return true; +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_smuggler_condition_canGetPistolQuestComplete (obj_id player, obj_id npc) +{ + faceTo(npc, player); + obj_id module = utils.getStaticItemInInventory(player, "item_reward_modify_pistol_01_01"); + + if(!isIdValid(module) || getCount(module) < 100) + { + return false; + } + + if(!groundquests.isQuestActive(player, "quest/smuggler_modules_for_pistol")) + { + return false; + } + + return true; +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_smuggler_condition_hasBuyBackItems (obj_id player, obj_id npc) +{ + obj_id[] listOfBuyBacks = smuggler.getBuyBackItemsInContainer(player); + return listOfBuyBacks != null && listOfBuyBacks.length > 0; +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_smuggler_condition_isInPartyWithBuyBack (obj_id player, obj_id npc) +{ + return junk_dealer_smuggler_condition_isInParty(player, npc) && junk_dealer_smuggler_condition_hasBuyBackItems(player, npc); +} + +// ---------------------------------------------------------------------- + +boolean junk_dealer_smuggler_condition_checkBuyBackContainer (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(!smuggler.hasBuyBackContainer(player)) + { + junk_dealer_smuggler_action_createBuyBackContainer(player, npc); + } + return true; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void junk_dealer_smuggler_action_start_dealing (obj_id player, obj_id npc) +{ + dictionary params = new dictionary(); + params.put("player", player); + + messageTo(npc, "startDealing", params, 0.0f, false); +} + +// ---------------------------------------------------------------------- + +void junk_dealer_smuggler_action_face_to (obj_id player, obj_id npc) +{ + faceTo(npc, player); +} + +// ---------------------------------------------------------------------- + +void junk_dealer_smuggler_action_grant_pistol_quest (obj_id player, obj_id npc) +{ + groundquests.requestGrantQuest(player, "quest/smuggler_modules_for_pistol", true); +} + +// ---------------------------------------------------------------------- + +void junk_dealer_smuggler_action_complete_pistol_quest (obj_id player, obj_id npc) +{ + obj_id module = utils.getStaticItemInInventory(player, "item_reward_modify_pistol_01_01"); + + if(!isIdValid(module) || getCount(module) < 100) + { + return; + } + + int count = getCount(module); + + count -= 100; + + if(count <= 0) + { + destroyObject(module); + } + else + { + setCount(module, count); + } + + groundquests.sendSignal(player, "smugglerModulesCollected"); +} + +// ---------------------------------------------------------------------- + +void junk_dealer_smuggler_action_startBuyBack (obj_id player, obj_id npc) +{ + dictionary params = new dictionary(); + params.put("player", player); + + messageTo(npc, "startBuyBack", params, 0.0f, false); +} + +// ---------------------------------------------------------------------- + +void junk_dealer_smuggler_action_createBuyBackContainer (obj_id player, obj_id npc) +{ + if(!isValidId(smuggler.createBuyBackControlDeviceOnPlayer(player))) + { + CustomerServiceLog("Junk_Dealer: ", "junk_dealer_generic conversation - Player (OID: " + player + ") did not get his buy back container set up properly."); + } +} + +// ---------------------------------------------------------------------- + +void junk_dealer_smuggler_action_dismiss (obj_id player, obj_id npc) +{ + dictionary params = new dictionary(); + params.put("player", player); + + messageTo(npc, "dismissDealer", params, 1.0f, false); +} + +// ---------------------------------------------------------------------- + +void junk_dealer_smuggler_action_startFlagNoSale (obj_id player, obj_id npc) +{ + dictionary params = new dictionary(); + params.put("player", player); + + messageTo(npc, "startFlaggingItemsNoSale", params, 0.0f, false); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int junk_dealer_smuggler_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I hope you didn't call me out here for nothing. Let's get on with it. + + //-- [RESPONSE NOTE] + //-- PLAYER: I sold you something I actually needed. Can I buy it back? + if (response == "s_17") + { + //-- [NOTE] + if (junk_dealer_smuggler_condition_hasNoInv (player, npc)) + { + //-- NPC: Looks like your inventory is full. Come back when you make some room. + string_id message = new string_id (c_stringFile, "s_18"); + utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) + { + junk_dealer_smuggler_action_startBuyBack (player, npc); + + //-- NPC: Of course! All you need to do is give me back the credits. What was the item? + string_id message = new string_id (c_stringFile, "s_19"); + utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I have some things that you might be interested in. + if (response == "s_54fab04f") + { + //-- [NOTE] + if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) + { + junk_dealer_smuggler_action_start_dealing (player, npc); + + //-- NPC: Alright, let me see what you are offering. + string_id message = new string_id (c_stringFile, "s_84a67771"); + utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: How can I mark items so you know what to buy and not to buy? + if (response == "s_20") + { + //-- [NOTE] + if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) + { + junk_dealer_smuggler_action_startFlagNoSale (player, npc); + + //-- NPC: Just select an item in this list to toggle the items sellable or no sell. + string_id message = new string_id (c_stringFile, "s_23"); + utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I am sorry but I don't think I have anything you would want. + if (response == "s_cd7a3f41") + { + //-- [NOTE] + if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) + { + //-- NPC: Arg! I knew you were good for nothing! I'll remember this the next time. + string_id message = new string_id (c_stringFile, "s_4bd9d15e"); + utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I'm done dealing with you. Please leave. + if (response == "s_43") + { + //-- [NOTE] + if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) + { + junk_dealer_smuggler_action_dismiss (player, npc); + + //-- NPC: I better get going. Make sure to keep me in mind, if you run across anything else I might find of value. + string_id message = new string_id (c_stringFile, "s_44"); + utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I heard you like pistol modifications. + if (response == "s_15") + { + //-- [NOTE] + if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) + { + junk_dealer_smuggler_action_grant_pistol_quest (player, npc); + + //-- NPC: Oh yes! I collect them for... uh... research purposes! + string_id message = new string_id (c_stringFile, "s_21"); + utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Here are those pistol modules you requested. + if (response == "s_24") + { + //-- [NOTE] + if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) + { + junk_dealer_smuggler_action_complete_pistol_quest (player, npc); + + //-- NPC: Excellent! I will make sure these get to the... uh... scientists! + string_id message = new string_id (c_stringFile, "s_26"); + utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isMob (self)) || (isPlayer (self))) + detachScript(self, "conversation.junk_dealer_smuggler"); + + 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.junk_dealer_smuggler"); + + 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 (junk_dealer_smuggler_condition_checkBuyBackContainer (player, npc)) + { + //-- NPC: I hope you didn't call me out here for nothing. Let's get on with it. + string_id message = new string_id (c_stringFile, "s_bef51e38"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I sold you something I actually needed. Can I buy it back? + boolean hasResponse0 = false; + if (junk_dealer_smuggler_condition_isInPartyWithBuyBack (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: I have some things that you might be interested in. + boolean hasResponse1 = false; + if (junk_dealer_smuggler_condition_isInParty (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: How can I mark items so you know what to buy and not to buy? + boolean hasResponse2 = false; + if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: I am sorry but I don't think I have anything you would want. + boolean hasResponse3 = false; + if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + //-- PLAYER: I'm done dealing with you. Please leave. + boolean hasResponse4 = false; + if (junk_dealer_smuggler_condition_check_master (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse4 = true; + } + + //-- PLAYER: I heard you like pistol modifications. + boolean hasResponse5 = false; + if (junk_dealer_smuggler_condition_canGetPistolQuest (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse5 = true; + } + + //-- PLAYER: Here are those pistol modules you requested. + boolean hasResponse6 = false; + if (junk_dealer_smuggler_condition_canGetPistolQuestComplete (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse6 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_17"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_54fab04f"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_20"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_cd7a3f41"); + + if (hasResponse4) + responses [responseIndex++] = new string_id (c_stringFile, "s_43"); + + if (hasResponse5) + responses [responseIndex++] = new string_id (c_stringFile, "s_15"); + + if (hasResponse6) + responses [responseIndex++] = new string_id (c_stringFile, "s_24"); + + utils.setScriptVar (player, "conversation.junk_dealer_smuggler.branchId", 1); + + npcStartConversation (player, npc, "junk_dealer_smuggler", 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 != "junk_dealer_smuggler") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); + + if (branchId == 1 && junk_dealer_smuggler_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/mako_ghast.script b/sku.0/sys.server/compiled/game/script/conversation/mako_ghast.script index 3596d4c1b..a2bb8dc36 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/mako_ghast.script +++ b/sku.0/sys.server/compiled/game/script/conversation/mako_ghast.script @@ -1,1776 +1,1776 @@ -// ====================================================================== -// -// mako_ghast.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/mako_ghast"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean mako_ghast_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean mako_ghast_condition_canDoEliteHideout (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_elite_kill_pirate_cave_collection") - && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_hideout"); -} - -// ---------------------------------------------------------------------- - -boolean mako_ghast_condition_hasEliteHideoutNotComplete (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_pirate_cave_collection"); -} - -// ---------------------------------------------------------------------- - -boolean mako_ghast_condition_hasReturnedEliteHideout (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_elite_kill_pirate_cave_collection", "returnKillCaveTrollComplete"); -} - -// ---------------------------------------------------------------------- - -boolean mako_ghast_condition_canDoEliteCave (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_elite_kill_miner_cave_collection") - && groundquests.hasCompletedQuest(player, "u16_nym_themepark_elite_kill_pirate_cave_collection") - && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine"); -} - -// ---------------------------------------------------------------------- - -boolean mako_ghast_condition_hasEliteCaveNotComplete (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_miner_cave_collection"); -} - -// ---------------------------------------------------------------------- - -boolean mako_ghast_condition_hasReturnedEliteCave (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_elite_kill_miner_cave_collection", "returnMineElitesComplete"); -} - -// ---------------------------------------------------------------------- - -boolean mako_ghast_condition_canDoEliteLab (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_elite_kill_imperial_facility_collection") - && groundquests.hasCompletedQuest(player, "u16_nym_themepark_elite_kill_miner_cave_collection") - && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_research_facility"); -} - -// ---------------------------------------------------------------------- - -boolean mako_ghast_condition_hasEliteLabNotComplete (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_imperial_facility_collection"); -} - -// ---------------------------------------------------------------------- - -boolean mako_ghast_condition_hasReturnedEliteLab (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_elite_kill_imperial_facility_collection", "returnResearchFacilityElitesComplete"); -} - -// ---------------------------------------------------------------------- - -boolean mako_ghast_condition_hasntDoneLab (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_research_facility") - && groundquests.hasCompletedQuest(player, "u16_nym_themepark_mine") - && groundquests.hasCompletedQuest(player, "u16_nym_themepark_elite_kill_miner_cave_collection"); -} - -// ---------------------------------------------------------------------- - -boolean mako_ghast_condition_hasntDoneCave (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine") - && groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout") - && groundquests.hasCompletedQuest(player, "u16_nym_themepark_elite_kill_pirate_cave_collection"); -} - -// ---------------------------------------------------------------------- - -boolean mako_ghast_condition_hasntDoneHideout (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_hideout"); -} - -// ---------------------------------------------------------------------- - -boolean mako_ghast_condition_hasCompletedPirateEliteCollection (obj_id player, obj_id npc) -{ - return hasCompletedCollection(player, "kill_nyms_themepark_elite_hideout") - && groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_pirate_cave_collection"); -} - -// ---------------------------------------------------------------------- - -boolean mako_ghast_condition_hasCompletedLabEliteCollection (obj_id player, obj_id npc) -{ - return hasCompletedCollection(player, "kill_nyms_themepark_elite_lab") - && groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_imperial_facility_collection"); -} - -// ---------------------------------------------------------------------- - -boolean mako_ghast_condition_hasCompletedMinerEliteCollection (obj_id player, obj_id npc) -{ - return hasCompletedCollection(player, "kill_nyms_themepark_elite_cave") - && groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_miner_cave_collection"); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void mako_ghast_action_grantHideoutKill (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_elite_kill_pirate_cave_collection"); - if(!hasCompletedCollectionSlot(player, "kill_nyms_themepark_cave_troll_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_cave_troll_activate", 1); - } -} - -// ---------------------------------------------------------------------- - -void mako_ghast_action_completeHideoutKill (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasCompletedKillCaveTroll"); -} - -// ---------------------------------------------------------------------- - -void mako_ghast_action_grantCaveKill (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_elite_kill_miner_cave_collection"); - if(!hasCompletedCollectionSlot(player, "kill_nyms_themepark_elite_cave_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_elite_cave_activate", 1); - } -} - -// ---------------------------------------------------------------------- - -void mako_ghast_action_completeCaveKill (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasCompletedMineElites"); -} - -// ---------------------------------------------------------------------- - -void mako_ghast_action_grantLabKill (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_elite_kill_imperial_facility_collection"); - if(!hasCompletedCollectionSlot(player, "kill_nyms_themepark_elite_lab_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_elite_lab_activate", 1); - } -} - -// ---------------------------------------------------------------------- - -void mako_ghast_action_completeLabKill (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasCompletedResearchFacilityElites"); -} - -// ---------------------------------------------------------------------- - -void mako_ghast_action_BruteForceCompletePirateElite (obj_id player, obj_id npc) -{ - if(mako_ghast_condition_hasCompletedPirateEliteCollection(player,npc)) - { - if(groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_pirate_cave_collection")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_elite_kill_pirate_cave_collection for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_elite_kill_pirate_cave_collection"); - if((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - } -} - -// ---------------------------------------------------------------------- - -void mako_ghast_action_BruteForceCompleteLabElite (obj_id player, obj_id npc) -{ - if(mako_ghast_condition_hasCompletedLabEliteCollection(player,npc)) - { - if(groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_imperial_facility_collection")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_elite_kill_imperial_facility_collection for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_elite_kill_imperial_facility_collection"); - if((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - } -} - -// ---------------------------------------------------------------------- - -void mako_ghast_action_BruteForceCompleteMinerElite (obj_id player, obj_id npc) -{ - if(mako_ghast_condition_hasCompletedMinerEliteCollection(player,npc)) - { - if(groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_miner_cave_collection")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_elite_kill_miner_cave_collection for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_elite_kill_miner_cave_collection"); - if((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - } -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int mako_ghast_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Congratulations! You've managed to do what no other scum or villain around here has been able to. - - //-- [RESPONSE NOTE] - //-- PLAYER: Nothing I couldn't handle. - if (response == "s_36") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - //-- NPC: Indeed you are a force to be reckoned with, %TU. You have my thanks, and more importantly, the thanks of Nym. - string_id message = new string_id (c_stringFile, "s_37"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I just did what needed to be done. - boolean hasResponse0 = false; - if (mako_ghast_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_94"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 2); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Indeed you are a force to be reckoned with, %TU. You have my thanks, and more importantly, the thanks of Nym. - - //-- [RESPONSE NOTE] - //-- PLAYER: I just did what needed to be done. - if (response == "s_94") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - mako_ghast_action_completeLabKill (player, npc); - - //-- NPC: And it has not gone unnoticed. You've done a great service for us all today. It will be some time before any of Nym's enemies crawl out from under their rocks. - string_id message = new string_id (c_stringFile, "s_95"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Perhaps I did not stress enough the urgency of this task. What are you still doing here? - - //-- [RESPONSE NOTE] - //-- PLAYER: Sorry, i'll get right on it. - if (response == "s_34") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - //-- NPC: Don't come back until your mission is accomplished! - string_id message = new string_id (c_stringFile, "s_35"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: %TU, I have one last mission for you. This could prove much more dangerous than your last assignment. Are you ready? - - //-- [RESPONSE NOTE] - //-- PLAYER: Sign me up. - if (response == "s_32") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - //-- NPC: I knew we could count on you. - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Just tell me what needs to be done. - boolean hasResponse0 = false; - if (mako_ghast_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_88"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I knew we could count on you. - - //-- [RESPONSE NOTE] - //-- PLAYER: Just tell me what needs to be done. - if (response == "s_88") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - //-- NPC: There is an Imperial Research Facility being operated primarily by mercenaries. The details of their operation, however, are not important for you to complete this operation. - string_id message = new string_id (c_stringFile, "s_89"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Get to the point. - boolean hasResponse0 = false; - if (mako_ghast_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_90"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: There is an Imperial Research Facility being operated primarily by mercenaries. The details of their operation, however, are not important for you to complete this operation. - - //-- [RESPONSE NOTE] - //-- PLAYER: Get to the point. - if (response == "s_90") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - //-- NPC: There are four targets working in the facility. These four have proved elusive for Nym and have meddled in his affairs for long enough. - string_id message = new string_id (c_stringFile, "s_91"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: They will be dealt with. - boolean hasResponse0 = false; - if (mako_ghast_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_92"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: There are four targets working in the facility. These four have proved elusive for Nym and have meddled in his affairs for long enough. - - //-- [RESPONSE NOTE] - //-- PLAYER: They will be dealt with. - if (response == "s_92") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - mako_ghast_action_grantLabKill (player, npc); - - //-- NPC: Nym will consider this a personal favor if you manage to eliminate these targets. Be quick about it, and let this be a message to anyone who opposes Nym. - string_id message = new string_id (c_stringFile, "s_93"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch13 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Are the rumors true? Were successful in your task? - - //-- [RESPONSE NOTE] - //-- PLAYER: Indeed. - if (response == "s_27") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - mako_ghast_action_completeCaveKill (player, npc); - - //-- NPC: You are proving to be a very useful asset to us. Nym will be very pleased to hear this. This could provide us with the necessary opening to take control of the mining operation. We'll talk again when you are ready for your last task. - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch16 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: That was quick... - - //-- [RESPONSE NOTE] - //-- PLAYER: I forgot what I was supposed to do. - if (response == "s_41") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - //-- NPC: Get to the mine cave, and help us with our little problem. Stop wasting time! - string_id message = new string_id (c_stringFile, "s_43"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch18 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Glad you're back. Are you interested in performing another task for Nym? - - //-- [RESPONSE NOTE] - //-- PLAYER: I am. Let's hear it. - if (response == "s_47") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - //-- NPC: There is a mining operation in a cave not far from here. The miners should not pose too much of a problem, but they aren't the main targets. - string_id message = new string_id (c_stringFile, "s_49"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: There is more than one target? - boolean hasResponse0 = false; - if (mako_ghast_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_67"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch19 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: There is a mining operation in a cave not far from here. The miners should not pose too much of a problem, but they aren't the main targets. - - //-- [RESPONSE NOTE] - //-- PLAYER: There is more than one target? - if (response == "s_67") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - //-- NPC: I'm getting to that! - string_id message = new string_id (c_stringFile, "s_68"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm sorry, please continue. - boolean hasResponse0 = false; - if (mako_ghast_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.mako_ghast.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch20 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I'm getting to that! - - //-- [RESPONSE NOTE] - //-- PLAYER: I'm sorry, please continue. - if (response == "s_69") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - //-- NPC: As I was saying, there are two high priority targets in this mining cave that Nym would like... Lets just say, they wouldn't be missed. - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Who or what are the targets? - boolean hasResponse0 = false; - if (mako_ghast_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_71"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch21 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: As I was saying, there are two high priority targets in this mining cave that Nym would like... Lets just say, they wouldn't be missed. - - //-- [RESPONSE NOTE] - //-- PLAYER: Who or what are the targets? - if (response == "s_71") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - //-- NPC: A Rodian named Raynar Cath and a Sullustan named Wes Riggers. - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Any particular reason these two need to go away? - boolean hasResponse0 = false; - if (mako_ghast_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_73"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch22 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: A Rodian named Raynar Cath and a Sullustan named Wes Riggers. - - //-- [RESPONSE NOTE] - //-- PLAYER: Any particular reason these two need to go away? - if (response == "s_73") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - //-- NPC: Lets just say they were a bit too vocal for their own good. You don't need to know the details. - string_id message = new string_id (c_stringFile, "s_74"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'll take care of it. - boolean hasResponse0 = false; - if (mako_ghast_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.mako_ghast.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch23 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Lets just say they were a bit too vocal for their own good. You don't need to know the details. - - //-- [RESPONSE NOTE] - //-- PLAYER: I'll take care of it. - if (response == "s_75") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - mako_ghast_action_grantCaveKill (player, npc); - - //-- NPC: Excellent. Head to the mine cave and take care of this little problem. Do this for us and I may have more work for you in the future. - string_id message = new string_id (c_stringFile, "s_76"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch26 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Nice job taking down that bridge troll. I thought it might prove impossible for you. - - //-- [RESPONSE NOTE] - //-- PLAYER: Just like bull's-eyeing womp rats back home. - if (response == "s_64") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - mako_ghast_action_completeHideoutKill (player, npc); - - //-- NPC: Great kid, but don't get cocky. This was only a minor victory against one of Nym's enemies. But, you did provide a good service for Nym today. Come talk to me when you're up for something a little more challenging. - string_id message = new string_id (c_stringFile, "s_66"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch29 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Is it dead? - - //-- [RESPONSE NOTE] - //-- PLAYER: Where was I supposed to go again? - if (response == "s_81") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - //-- NPC: To the Sulfur Lake Pirate hideout! - string_id message = new string_id (c_stringFile, "s_83"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch31 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: %TU, I am looking for someone who can handle themselves in a fight. If that isn't you then please leave me to my work. - - //-- [RESPONSE NOTE] - //-- PLAYER: I've been known to get my hands dirty from time to time. - if (response == "s_87") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - //-- NPC: That is just what I wanted to hear. Ready for the details? - string_id message = new string_id (c_stringFile, "s_97"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm ready, willing, and able. What do you need done? - boolean hasResponse0 = false; - if (mako_ghast_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_99"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch32 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: That is just what I wanted to hear. Ready for the details? - - //-- [RESPONSE NOTE] - //-- PLAYER: I'm ready, willing, and able. What do you need done? - if (response == "s_99") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - //-- NPC: The word around the stronghold is that the local Sulfur Lake Pirates have a pretty nasty beast under their control. I want you to travel to their hideout and take it down. - string_id message = new string_id (c_stringFile, "s_101"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Any particular reason? - boolean hasResponse0 = false; - if (mako_ghast_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_103"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 33); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mako_ghast_handleBranch33 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: The word around the stronghold is that the local Sulfur Lake Pirates have a pretty nasty beast under their control. I want you to travel to their hideout and take it down. - - //-- [RESPONSE NOTE] - //-- PLAYER: Any particular reason? - if (response == "s_103") - { - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - mako_ghast_action_grantHideoutKill (player, npc); - - //-- NPC: It's very simple. The Sulfur Lake Pirates and Nym never exactly saw eye to eye. We want to let them know who still runs this planet. - string_id message = new string_id (c_stringFile, "s_107"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.mako_ghast"); - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; -} - -trigger OnAttach () -{ - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - 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.mako_ghast"); - - 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 (mako_ghast_condition_hasReturnedEliteLab (player, npc)) - { - //-- NPC: Congratulations! You've managed to do what no other scum or villain around here has been able to. - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Nothing I couldn't handle. - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_36"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 1); - - npcStartConversation (player, npc, "mako_ghast", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mako_ghast_condition_hasCompletedLabEliteCollection (player, npc)) - { - mako_ghast_action_BruteForceCompleteLabElite (player, npc); - - //-- NPC: Looks like things got a little bit mixed up with those Imperial Research Facility Elites. Let me help. - string_id message = new string_id (c_stringFile, "s_109"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mako_ghast_condition_hasEliteLabNotComplete (player, npc)) - { - //-- NPC: Perhaps I did not stress enough the urgency of this task. What are you still doing here? - string_id message = new string_id (c_stringFile, "s_30"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sorry, i'll get right on it. - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_34"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 5); - - npcStartConversation (player, npc, "mako_ghast", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mako_ghast_condition_canDoEliteLab (player, npc)) - { - //-- NPC: %TU, I have one last mission for you. This could prove much more dangerous than your last assignment. Are you ready? - string_id message = new string_id (c_stringFile, "s_29"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sign me up. - boolean hasResponse0 = false; - if (mako_ghast_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.mako_ghast.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "mako_ghast", 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 (mako_ghast_condition_hasntDoneLab (player, npc)) - { - //-- NPC: Get cleared by Kole and come back to me. - string_id message = new string_id (c_stringFile, "s_105"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mako_ghast_condition_hasReturnedEliteCave (player, npc)) - { - //-- NPC: Are the rumors true? Were successful in your task? - string_id message = new string_id (c_stringFile, "s_23"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Indeed. - boolean hasResponse0 = false; - if (mako_ghast_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_27"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 13); - - npcStartConversation (player, npc, "mako_ghast", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mako_ghast_condition_hasCompletedMinerEliteCollection (player, npc)) - { - mako_ghast_action_BruteForceCompleteMinerElite (player, npc); - - //-- NPC: Looks like things got a little bit mixed up with those Mining Cave Elites. Let me help. - string_id message = new string_id (c_stringFile, "s_110"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mako_ghast_condition_hasEliteCaveNotComplete (player, npc)) - { - //-- NPC: That was quick... - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I forgot what I was supposed to do. - boolean hasResponse0 = false; - if (mako_ghast_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_41"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 16); - - npcStartConversation (player, npc, "mako_ghast", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mako_ghast_condition_canDoEliteCave (player, npc)) - { - //-- NPC: Glad you're back. Are you interested in performing another task for Nym? - string_id message = new string_id (c_stringFile, "s_45"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I am. Let's hear it. - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_47"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 18); - - npcStartConversation (player, npc, "mako_ghast", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mako_ghast_condition_hasntDoneCave (player, npc)) - { - //-- NPC: Get cleared by Jinkins and come back to me. - string_id message = new string_id (c_stringFile, "s_104"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mako_ghast_condition_hasReturnedEliteHideout (player, npc)) - { - //-- NPC: Nice job taking down that bridge troll. I thought it might prove impossible for you. - string_id message = new string_id (c_stringFile, "s_62"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Just like bull's-eyeing womp rats back home. - boolean hasResponse0 = false; - if (mako_ghast_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_64"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 26); - - npcStartConversation (player, npc, "mako_ghast", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mako_ghast_condition_hasCompletedPirateEliteCollection (player, npc)) - { - mako_ghast_action_BruteForceCompletePirateElite (player, npc); - - //-- NPC: Looks like things got a little bit mixed up with the Bridge Troll. Let me help. - string_id message = new string_id (c_stringFile, "s_111"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mako_ghast_condition_hasEliteHideoutNotComplete (player, npc)) - { - //-- NPC: Is it dead? - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Where was I supposed to go again? - boolean hasResponse0 = false; - if (mako_ghast_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_81"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 29); - - npcStartConversation (player, npc, "mako_ghast", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mako_ghast_condition_canDoEliteHideout (player, npc)) - { - //-- NPC: %TU, I am looking for someone who can handle themselves in a fight. If that isn't you then please leave me to my work. - string_id message = new string_id (c_stringFile, "s_85"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I've been known to get my hands dirty from time to time. - boolean hasResponse0 = false; - if (mako_ghast_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_87"); - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 31); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "mako_ghast", 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 (mako_ghast_condition_hasntDoneHideout (player, npc)) - { - //-- NPC: Get cleared by Vana and come back to me. - string_id message = new string_id (c_stringFile, "s_112"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mako_ghast_condition__defaultCondition (player, npc)) - { - //-- NPC: I don't have time for this right now. - string_id message = new string_id (c_stringFile, "s_114"); - 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 != "mako_ghast") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.mako_ghast.branchId"); - - if (branchId == 1 && mako_ghast_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && mako_ghast_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && mako_ghast_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && mako_ghast_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && mako_ghast_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && mako_ghast_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && mako_ghast_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 13 && mako_ghast_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 16 && mako_ghast_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 18 && mako_ghast_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 19 && mako_ghast_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 20 && mako_ghast_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 21 && mako_ghast_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 22 && mako_ghast_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 23 && mako_ghast_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 26 && mako_ghast_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 29 && mako_ghast_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 31 && mako_ghast_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 32 && mako_ghast_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 33 && mako_ghast_handleBranch33 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// mako_ghast.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/mako_ghast"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean mako_ghast_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean mako_ghast_condition_canDoEliteHideout (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_elite_kill_pirate_cave_collection") + && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_hideout"); +} + +// ---------------------------------------------------------------------- + +boolean mako_ghast_condition_hasEliteHideoutNotComplete (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_pirate_cave_collection"); +} + +// ---------------------------------------------------------------------- + +boolean mako_ghast_condition_hasReturnedEliteHideout (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_elite_kill_pirate_cave_collection", "returnKillCaveTrollComplete"); +} + +// ---------------------------------------------------------------------- + +boolean mako_ghast_condition_canDoEliteCave (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_elite_kill_miner_cave_collection") + && groundquests.hasCompletedQuest(player, "u16_nym_themepark_elite_kill_pirate_cave_collection") + && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine"); +} + +// ---------------------------------------------------------------------- + +boolean mako_ghast_condition_hasEliteCaveNotComplete (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_miner_cave_collection"); +} + +// ---------------------------------------------------------------------- + +boolean mako_ghast_condition_hasReturnedEliteCave (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_elite_kill_miner_cave_collection", "returnMineElitesComplete"); +} + +// ---------------------------------------------------------------------- + +boolean mako_ghast_condition_canDoEliteLab (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_elite_kill_imperial_facility_collection") + && groundquests.hasCompletedQuest(player, "u16_nym_themepark_elite_kill_miner_cave_collection") + && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_research_facility"); +} + +// ---------------------------------------------------------------------- + +boolean mako_ghast_condition_hasEliteLabNotComplete (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_imperial_facility_collection"); +} + +// ---------------------------------------------------------------------- + +boolean mako_ghast_condition_hasReturnedEliteLab (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_elite_kill_imperial_facility_collection", "returnResearchFacilityElitesComplete"); +} + +// ---------------------------------------------------------------------- + +boolean mako_ghast_condition_hasntDoneLab (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_research_facility") + && groundquests.hasCompletedQuest(player, "u16_nym_themepark_mine") + && groundquests.hasCompletedQuest(player, "u16_nym_themepark_elite_kill_miner_cave_collection"); +} + +// ---------------------------------------------------------------------- + +boolean mako_ghast_condition_hasntDoneCave (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine") + && groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout") + && groundquests.hasCompletedQuest(player, "u16_nym_themepark_elite_kill_pirate_cave_collection"); +} + +// ---------------------------------------------------------------------- + +boolean mako_ghast_condition_hasntDoneHideout (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_hideout"); +} + +// ---------------------------------------------------------------------- + +boolean mako_ghast_condition_hasCompletedPirateEliteCollection (obj_id player, obj_id npc) +{ + return hasCompletedCollection(player, "kill_nyms_themepark_elite_hideout") + && groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_pirate_cave_collection"); +} + +// ---------------------------------------------------------------------- + +boolean mako_ghast_condition_hasCompletedLabEliteCollection (obj_id player, obj_id npc) +{ + return hasCompletedCollection(player, "kill_nyms_themepark_elite_lab") + && groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_imperial_facility_collection"); +} + +// ---------------------------------------------------------------------- + +boolean mako_ghast_condition_hasCompletedMinerEliteCollection (obj_id player, obj_id npc) +{ + return hasCompletedCollection(player, "kill_nyms_themepark_elite_cave") + && groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_miner_cave_collection"); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void mako_ghast_action_grantHideoutKill (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_elite_kill_pirate_cave_collection"); + if(!hasCompletedCollectionSlot(player, "kill_nyms_themepark_cave_troll_activate")) + { + modifyCollectionSlotValue(player, "kill_nyms_themepark_cave_troll_activate", 1); + } +} + +// ---------------------------------------------------------------------- + +void mako_ghast_action_completeHideoutKill (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasCompletedKillCaveTroll"); +} + +// ---------------------------------------------------------------------- + +void mako_ghast_action_grantCaveKill (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_elite_kill_miner_cave_collection"); + if(!hasCompletedCollectionSlot(player, "kill_nyms_themepark_elite_cave_activate")) + { + modifyCollectionSlotValue(player, "kill_nyms_themepark_elite_cave_activate", 1); + } +} + +// ---------------------------------------------------------------------- + +void mako_ghast_action_completeCaveKill (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasCompletedMineElites"); +} + +// ---------------------------------------------------------------------- + +void mako_ghast_action_grantLabKill (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_elite_kill_imperial_facility_collection"); + if(!hasCompletedCollectionSlot(player, "kill_nyms_themepark_elite_lab_activate")) + { + modifyCollectionSlotValue(player, "kill_nyms_themepark_elite_lab_activate", 1); + } +} + +// ---------------------------------------------------------------------- + +void mako_ghast_action_completeLabKill (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasCompletedResearchFacilityElites"); +} + +// ---------------------------------------------------------------------- + +void mako_ghast_action_BruteForceCompletePirateElite (obj_id player, obj_id npc) +{ + if(mako_ghast_condition_hasCompletedPirateEliteCollection(player,npc)) + { + if(groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_pirate_cave_collection")) + { + CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_elite_kill_pirate_cave_collection for player: "+player+" so they do not remailn bugged."); + int questid = questGetQuestId("quest/u16_nym_themepark_elite_kill_pirate_cave_collection"); + if((questid != 0) && questIsQuestActive(questid, player)) + { + questCompleteQuest(questid, player); + } + } + } +} + +// ---------------------------------------------------------------------- + +void mako_ghast_action_BruteForceCompleteLabElite (obj_id player, obj_id npc) +{ + if(mako_ghast_condition_hasCompletedLabEliteCollection(player,npc)) + { + if(groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_imperial_facility_collection")) + { + CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_elite_kill_imperial_facility_collection for player: "+player+" so they do not remailn bugged."); + int questid = questGetQuestId("quest/u16_nym_themepark_elite_kill_imperial_facility_collection"); + if((questid != 0) && questIsQuestActive(questid, player)) + { + questCompleteQuest(questid, player); + } + } + } +} + +// ---------------------------------------------------------------------- + +void mako_ghast_action_BruteForceCompleteMinerElite (obj_id player, obj_id npc) +{ + if(mako_ghast_condition_hasCompletedMinerEliteCollection(player,npc)) + { + if(groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_miner_cave_collection")) + { + CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_elite_kill_miner_cave_collection for player: "+player+" so they do not remailn bugged."); + int questid = questGetQuestId("quest/u16_nym_themepark_elite_kill_miner_cave_collection"); + if((questid != 0) && questIsQuestActive(questid, player)) + { + questCompleteQuest(questid, player); + } + } + } +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int mako_ghast_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Congratulations! You've managed to do what no other scum or villain around here has been able to. + + //-- [RESPONSE NOTE] + //-- PLAYER: Nothing I couldn't handle. + if (response == "s_36") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + //-- NPC: Indeed you are a force to be reckoned with, %TU. You have my thanks, and more importantly, the thanks of Nym. + string_id message = new string_id (c_stringFile, "s_37"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I just did what needed to be done. + boolean hasResponse0 = false; + if (mako_ghast_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_94"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 2); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcSpeak (player, pp); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Indeed you are a force to be reckoned with, %TU. You have my thanks, and more importantly, the thanks of Nym. + + //-- [RESPONSE NOTE] + //-- PLAYER: I just did what needed to be done. + if (response == "s_94") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + mako_ghast_action_completeLabKill (player, npc); + + //-- NPC: And it has not gone unnoticed. You've done a great service for us all today. It will be some time before any of Nym's enemies crawl out from under their rocks. + string_id message = new string_id (c_stringFile, "s_95"); + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Perhaps I did not stress enough the urgency of this task. What are you still doing here? + + //-- [RESPONSE NOTE] + //-- PLAYER: Sorry, i'll get right on it. + if (response == "s_34") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + //-- NPC: Don't come back until your mission is accomplished! + string_id message = new string_id (c_stringFile, "s_35"); + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: %TU, I have one last mission for you. This could prove much more dangerous than your last assignment. Are you ready? + + //-- [RESPONSE NOTE] + //-- PLAYER: Sign me up. + if (response == "s_32") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + //-- NPC: I knew we could count on you. + string_id message = new string_id (c_stringFile, "s_33"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Just tell me what needs to be done. + boolean hasResponse0 = false; + if (mako_ghast_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_88"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I knew we could count on you. + + //-- [RESPONSE NOTE] + //-- PLAYER: Just tell me what needs to be done. + if (response == "s_88") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + //-- NPC: There is an Imperial Research Facility being operated primarily by mercenaries. The details of their operation, however, are not important for you to complete this operation. + string_id message = new string_id (c_stringFile, "s_89"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Get to the point. + boolean hasResponse0 = false; + if (mako_ghast_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_90"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: There is an Imperial Research Facility being operated primarily by mercenaries. The details of their operation, however, are not important for you to complete this operation. + + //-- [RESPONSE NOTE] + //-- PLAYER: Get to the point. + if (response == "s_90") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + //-- NPC: There are four targets working in the facility. These four have proved elusive for Nym and have meddled in his affairs for long enough. + string_id message = new string_id (c_stringFile, "s_91"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: They will be dealt with. + boolean hasResponse0 = false; + if (mako_ghast_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_92"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: There are four targets working in the facility. These four have proved elusive for Nym and have meddled in his affairs for long enough. + + //-- [RESPONSE NOTE] + //-- PLAYER: They will be dealt with. + if (response == "s_92") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + mako_ghast_action_grantLabKill (player, npc); + + //-- NPC: Nym will consider this a personal favor if you manage to eliminate these targets. Be quick about it, and let this be a message to anyone who opposes Nym. + string_id message = new string_id (c_stringFile, "s_93"); + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch13 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Are the rumors true? Were successful in your task? + + //-- [RESPONSE NOTE] + //-- PLAYER: Indeed. + if (response == "s_27") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + mako_ghast_action_completeCaveKill (player, npc); + + //-- NPC: You are proving to be a very useful asset to us. Nym will be very pleased to hear this. This could provide us with the necessary opening to take control of the mining operation. We'll talk again when you are ready for your last task. + string_id message = new string_id (c_stringFile, "s_28"); + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch16 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: That was quick... + + //-- [RESPONSE NOTE] + //-- PLAYER: I forgot what I was supposed to do. + if (response == "s_41") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + //-- NPC: Get to the mine cave, and help us with our little problem. Stop wasting time! + string_id message = new string_id (c_stringFile, "s_43"); + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch18 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Glad you're back. Are you interested in performing another task for Nym? + + //-- [RESPONSE NOTE] + //-- PLAYER: I am. Let's hear it. + if (response == "s_47") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + //-- NPC: There is a mining operation in a cave not far from here. The miners should not pose too much of a problem, but they aren't the main targets. + string_id message = new string_id (c_stringFile, "s_49"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: There is more than one target? + boolean hasResponse0 = false; + if (mako_ghast_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_67"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 19); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch19 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: There is a mining operation in a cave not far from here. The miners should not pose too much of a problem, but they aren't the main targets. + + //-- [RESPONSE NOTE] + //-- PLAYER: There is more than one target? + if (response == "s_67") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + //-- NPC: I'm getting to that! + string_id message = new string_id (c_stringFile, "s_68"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm sorry, please continue. + boolean hasResponse0 = false; + if (mako_ghast_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.mako_ghast.branchId", 20); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch20 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I'm getting to that! + + //-- [RESPONSE NOTE] + //-- PLAYER: I'm sorry, please continue. + if (response == "s_69") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + //-- NPC: As I was saying, there are two high priority targets in this mining cave that Nym would like... Lets just say, they wouldn't be missed. + string_id message = new string_id (c_stringFile, "s_70"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Who or what are the targets? + boolean hasResponse0 = false; + if (mako_ghast_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_71"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 21); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch21 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: As I was saying, there are two high priority targets in this mining cave that Nym would like... Lets just say, they wouldn't be missed. + + //-- [RESPONSE NOTE] + //-- PLAYER: Who or what are the targets? + if (response == "s_71") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + //-- NPC: A Rodian named Raynar Cath and a Sullustan named Wes Riggers. + string_id message = new string_id (c_stringFile, "s_72"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Any particular reason these two need to go away? + boolean hasResponse0 = false; + if (mako_ghast_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_73"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 22); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch22 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: A Rodian named Raynar Cath and a Sullustan named Wes Riggers. + + //-- [RESPONSE NOTE] + //-- PLAYER: Any particular reason these two need to go away? + if (response == "s_73") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + //-- NPC: Lets just say they were a bit too vocal for their own good. You don't need to know the details. + string_id message = new string_id (c_stringFile, "s_74"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'll take care of it. + boolean hasResponse0 = false; + if (mako_ghast_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.mako_ghast.branchId", 23); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch23 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Lets just say they were a bit too vocal for their own good. You don't need to know the details. + + //-- [RESPONSE NOTE] + //-- PLAYER: I'll take care of it. + if (response == "s_75") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + mako_ghast_action_grantCaveKill (player, npc); + + //-- NPC: Excellent. Head to the mine cave and take care of this little problem. Do this for us and I may have more work for you in the future. + string_id message = new string_id (c_stringFile, "s_76"); + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch26 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Nice job taking down that bridge troll. I thought it might prove impossible for you. + + //-- [RESPONSE NOTE] + //-- PLAYER: Just like bull's-eyeing womp rats back home. + if (response == "s_64") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + mako_ghast_action_completeHideoutKill (player, npc); + + //-- NPC: Great kid, but don't get cocky. This was only a minor victory against one of Nym's enemies. But, you did provide a good service for Nym today. Come talk to me when you're up for something a little more challenging. + string_id message = new string_id (c_stringFile, "s_66"); + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch29 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Is it dead? + + //-- [RESPONSE NOTE] + //-- PLAYER: Where was I supposed to go again? + if (response == "s_81") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + //-- NPC: To the Sulfur Lake Pirate hideout! + string_id message = new string_id (c_stringFile, "s_83"); + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch31 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: %TU, I am looking for someone who can handle themselves in a fight. If that isn't you then please leave me to my work. + + //-- [RESPONSE NOTE] + //-- PLAYER: I've been known to get my hands dirty from time to time. + if (response == "s_87") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + //-- NPC: That is just what I wanted to hear. Ready for the details? + string_id message = new string_id (c_stringFile, "s_97"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm ready, willing, and able. What do you need done? + boolean hasResponse0 = false; + if (mako_ghast_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_99"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 32); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch32 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: That is just what I wanted to hear. Ready for the details? + + //-- [RESPONSE NOTE] + //-- PLAYER: I'm ready, willing, and able. What do you need done? + if (response == "s_99") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + //-- NPC: The word around the stronghold is that the local Sulfur Lake Pirates have a pretty nasty beast under their control. I want you to travel to their hideout and take it down. + string_id message = new string_id (c_stringFile, "s_101"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Any particular reason? + boolean hasResponse0 = false; + if (mako_ghast_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_103"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 33); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mako_ghast_handleBranch33 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: The word around the stronghold is that the local Sulfur Lake Pirates have a pretty nasty beast under their control. I want you to travel to their hideout and take it down. + + //-- [RESPONSE NOTE] + //-- PLAYER: Any particular reason? + if (response == "s_103") + { + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + mako_ghast_action_grantHideoutKill (player, npc); + + //-- NPC: It's very simple. The Sulfur Lake Pirates and Nym never exactly saw eye to eye. We want to let them know who still runs this planet. + string_id message = new string_id (c_stringFile, "s_107"); + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.mako_ghast"); + + setCondition (self, CONDITION_CONVERSABLE); + setCondition( self, CONDITION_INTERESTING ); + + return SCRIPT_CONTINUE; +} + +trigger OnAttach () +{ + setCondition (self, CONDITION_CONVERSABLE); + setCondition( self, CONDITION_INTERESTING ); + + 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.mako_ghast"); + + 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 (mako_ghast_condition_hasReturnedEliteLab (player, npc)) + { + //-- NPC: Congratulations! You've managed to do what no other scum or villain around here has been able to. + string_id message = new string_id (c_stringFile, "s_31"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Nothing I couldn't handle. + boolean hasResponse0 = false; + if (mako_ghast_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_36"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 1); + + npcStartConversation (player, npc, "mako_ghast", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mako_ghast_condition_hasCompletedLabEliteCollection (player, npc)) + { + mako_ghast_action_BruteForceCompleteLabElite (player, npc); + + //-- NPC: Looks like things got a little bit mixed up with those Imperial Research Facility Elites. Let me help. + string_id message = new string_id (c_stringFile, "s_109"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mako_ghast_condition_hasEliteLabNotComplete (player, npc)) + { + //-- NPC: Perhaps I did not stress enough the urgency of this task. What are you still doing here? + string_id message = new string_id (c_stringFile, "s_30"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sorry, i'll get right on it. + boolean hasResponse0 = false; + if (mako_ghast_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_34"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 5); + + npcStartConversation (player, npc, "mako_ghast", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mako_ghast_condition_canDoEliteLab (player, npc)) + { + //-- NPC: %TU, I have one last mission for you. This could prove much more dangerous than your last assignment. Are you ready? + string_id message = new string_id (c_stringFile, "s_29"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sign me up. + boolean hasResponse0 = false; + if (mako_ghast_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.mako_ghast.branchId", 7); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "mako_ghast", 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 (mako_ghast_condition_hasntDoneLab (player, npc)) + { + //-- NPC: Get cleared by Kole and come back to me. + string_id message = new string_id (c_stringFile, "s_105"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mako_ghast_condition_hasReturnedEliteCave (player, npc)) + { + //-- NPC: Are the rumors true? Were successful in your task? + string_id message = new string_id (c_stringFile, "s_23"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Indeed. + boolean hasResponse0 = false; + if (mako_ghast_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_27"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 13); + + npcStartConversation (player, npc, "mako_ghast", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mako_ghast_condition_hasCompletedMinerEliteCollection (player, npc)) + { + mako_ghast_action_BruteForceCompleteMinerElite (player, npc); + + //-- NPC: Looks like things got a little bit mixed up with those Mining Cave Elites. Let me help. + string_id message = new string_id (c_stringFile, "s_110"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mako_ghast_condition_hasEliteCaveNotComplete (player, npc)) + { + //-- NPC: That was quick... + string_id message = new string_id (c_stringFile, "s_39"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I forgot what I was supposed to do. + boolean hasResponse0 = false; + if (mako_ghast_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_41"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 16); + + npcStartConversation (player, npc, "mako_ghast", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mako_ghast_condition_canDoEliteCave (player, npc)) + { + //-- NPC: Glad you're back. Are you interested in performing another task for Nym? + string_id message = new string_id (c_stringFile, "s_45"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I am. Let's hear it. + boolean hasResponse0 = false; + if (mako_ghast_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_47"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 18); + + npcStartConversation (player, npc, "mako_ghast", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mako_ghast_condition_hasntDoneCave (player, npc)) + { + //-- NPC: Get cleared by Jinkins and come back to me. + string_id message = new string_id (c_stringFile, "s_104"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mako_ghast_condition_hasReturnedEliteHideout (player, npc)) + { + //-- NPC: Nice job taking down that bridge troll. I thought it might prove impossible for you. + string_id message = new string_id (c_stringFile, "s_62"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Just like bull's-eyeing womp rats back home. + boolean hasResponse0 = false; + if (mako_ghast_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_64"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 26); + + npcStartConversation (player, npc, "mako_ghast", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mako_ghast_condition_hasCompletedPirateEliteCollection (player, npc)) + { + mako_ghast_action_BruteForceCompletePirateElite (player, npc); + + //-- NPC: Looks like things got a little bit mixed up with the Bridge Troll. Let me help. + string_id message = new string_id (c_stringFile, "s_111"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mako_ghast_condition_hasEliteHideoutNotComplete (player, npc)) + { + //-- NPC: Is it dead? + string_id message = new string_id (c_stringFile, "s_79"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Where was I supposed to go again? + boolean hasResponse0 = false; + if (mako_ghast_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_81"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 29); + + npcStartConversation (player, npc, "mako_ghast", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mako_ghast_condition_canDoEliteHideout (player, npc)) + { + //-- NPC: %TU, I am looking for someone who can handle themselves in a fight. If that isn't you then please leave me to my work. + string_id message = new string_id (c_stringFile, "s_85"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I've been known to get my hands dirty from time to time. + boolean hasResponse0 = false; + if (mako_ghast_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_87"); + + utils.setScriptVar (player, "conversation.mako_ghast.branchId", 31); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "mako_ghast", 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 (mako_ghast_condition_hasntDoneHideout (player, npc)) + { + //-- NPC: Get cleared by Vana and come back to me. + string_id message = new string_id (c_stringFile, "s_112"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mako_ghast_condition__defaultCondition (player, npc)) + { + //-- NPC: I don't have time for this right now. + string_id message = new string_id (c_stringFile, "s_114"); + 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 != "mako_ghast") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.mako_ghast.branchId"); + + if (branchId == 1 && mako_ghast_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && mako_ghast_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && mako_ghast_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && mako_ghast_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && mako_ghast_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && mako_ghast_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && mako_ghast_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 13 && mako_ghast_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 16 && mako_ghast_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 18 && mako_ghast_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 19 && mako_ghast_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 20 && mako_ghast_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 21 && mako_ghast_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 22 && mako_ghast_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 23 && mako_ghast_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 26 && mako_ghast_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 29 && mako_ghast_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 31 && mako_ghast_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 32 && mako_ghast_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 33 && mako_ghast_handleBranch33 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/moore_lok_cantina.script b/sku.0/sys.server/compiled/game/script/conversation/moore_lok_cantina.script index b9e800076..8eff0ea1c 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/moore_lok_cantina.script +++ b/sku.0/sys.server/compiled/game/script/conversation/moore_lok_cantina.script @@ -1,2617 +1,2617 @@ -// ====================================================================== -// -// moore_lok_cantina.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.money; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/moore_lok_cantina"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean moore_lok_cantina_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean moore_lok_cantina_condition_hasMooreTask (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_interview_moore", "findSgtMoore"); -} - -// ---------------------------------------------------------------------- - -boolean moore_lok_cantina_condition_has2ndInterviewTask (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_second_interview_moore", "findSgtMoore2nd"); -} - -// ---------------------------------------------------------------------- - -boolean moore_lok_cantina_condition_hasCompletedMoore (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return (groundquests.isTaskActive(player, "u16_nym_themepark_interview_moore", "tellJinkinsMoore") - || groundquests.hasCompletedQuest(player, "u16_nym_themepark_interview_moore")); -} - -// ---------------------------------------------------------------------- - -boolean moore_lok_cantina_condition_hasCompleted2ndMoore (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return (groundquests.isTaskActive(player, "u16_nym_themepark_second_interview_moore", "tellKoleMoore") - || groundquests.hasCompletedQuest(player, "u16_nym_themepark_second_interview_moore")); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void moore_lok_cantina_action_pay50 (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(!utils.hasScriptVar(player, "pay50")) - { - faceTo(npc, player); - dictionary params = new dictionary(); - money.requestPayment(player, npc, 50, "pass_fail", params, true); - utils.setScriptVar(player, "pay50", true); - } -} - -// ---------------------------------------------------------------------- - -void moore_lok_cantina_action_finishMooreInterview (obj_id player, obj_id npc) -{ - faceTo(npc, player); - groundquests.sendSignal(player, "hasSpokenSgtMoore"); -} - -// ---------------------------------------------------------------------- - -void moore_lok_cantina_action_pay100 (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(!utils.hasScriptVar(player, "pay100")) - { - dictionary params = new dictionary(); - money.requestPayment(player, npc, 100, "pass_fail", params, true); - utils.setScriptVar(player, "pay100", true); - } -} - -// ---------------------------------------------------------------------- - -void moore_lok_cantina_action_pay150 (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(!utils.hasScriptVar(player, "payLast")) - { - faceTo(npc, player); - dictionary params = new dictionary(); - money.requestPayment(player, npc, 150, "pass_fail", params, true); - utils.setScriptVar(player, "payLast", true); - } -} - -// ---------------------------------------------------------------------- - -void moore_lok_cantina_action_pay200 (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(!utils.hasScriptVar(player, "payLast")) - { - faceTo(npc, player); - dictionary params = new dictionary(); - money.requestPayment(player, npc, 200, "pass_fail", params, true); - utils.setScriptVar(player, "payLast", true); - } -} - -// ---------------------------------------------------------------------- - -void moore_lok_cantina_action_finish2ndMooreInterview (obj_id player, obj_id npc) -{ - faceTo(npc, player); - groundquests.sendSignal(player, "hasSpokenSgtMoore2nd"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int moore_lok_cantina_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: What are you, a stalker? Go away! - - //-- [RESPONSE NOTE] - //-- PLAYER: Kole sent me. Tell me... - if (response == "s_32") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: That will be 200 credits. - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Fine, here. - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Make it 100? - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: No. You'll tell me, or answer to Nym. - boolean hasResponse2 = false; - if (moore_lok_cantina_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_34"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_38"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_35"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: That will be 200 credits. - - //-- [RESPONSE NOTE] - //-- PLAYER: Fine, here. - if (response == "s_34") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_pay200 (player, npc); - - //-- NPC: Good. Now that that is settled. What was your question? - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: The Imperial Research Facility. - boolean hasResponse0 = false; - if (moore_lok_cantina_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.moore_lok_cantina.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Make it 100? - if (response == "s_38") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: 150...take it or leave it. - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Fine, here. - boolean hasResponse0 = false; - if (moore_lok_cantina_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.moore_lok_cantina.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: No. You'll tell me, or answer to Nym. - if (response == "s_35") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: You mean the pirate who's henchman sent you to see me? - string_id message = new string_id (c_stringFile, "s_37"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Make it 100? - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Yes, the pirate you owe money. - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: This is a waste. I'll see you in the dungeon. - boolean hasResponse2 = false; - if (moore_lok_cantina_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_42"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_43"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_52"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Good. Now that that is settled. What was your question? - - //-- [RESPONSE NOTE] - //-- PLAYER: The Imperial Research Facility. - if (response == "s_49") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: Alright. I can tell you that I worked for an Imperial Research Facility, but that we didn't use requisitioned Imperial soldiers for guards. Instead, we hired the most dangerous mercenaries we could find. The base is also guarded by reprogrammed droidekas, the same you saw in the mine. - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Go on. - boolean hasResponse0 = false; - if (moore_lok_cantina_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_51"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: 150...take it or leave it. - - //-- [RESPONSE NOTE] - //-- PLAYER: Fine, here. - if (response == "s_40") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_pay150 (player, npc); - - //-- NPC: Good. Now that that is settled. What was your question? - string_id message = new string_id (c_stringFile, "s_41"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: The Imperial Research Facility. - boolean hasResponse0 = false; - if (moore_lok_cantina_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.moore_lok_cantina.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Good. Now that that is settled. What was your question? - - //-- [RESPONSE NOTE] - //-- PLAYER: The Imperial Research Facility. - if (response == "s_49") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: Alright. I can tell you that I worked for an Imperial Research Facility, but that we didn't use requisitioned Imperial soldiers for guards. Instead, we hired the most dangerous mercenaries we could find. The base is also guarded by reprogrammed droidekas, the same you saw in the mine. - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Go on. - boolean hasResponse0 = false; - if (moore_lok_cantina_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_51"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Alright. I can tell you that I worked for an Imperial Research Facility, but that we didn't use requisitioned Imperial soldiers for guards. Instead, we hired the most dangerous mercenaries we could find. The base is also guarded by reprogrammed droidekas, the same you saw in the mine. - - //-- [RESPONSE NOTE] - //-- PLAYER: Go on. - if (response == "s_51") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: The facility is primarily used for weapons research and hidden, for the most part, from the prying eyes of Imperial General Otto. - string_id message = new string_id (c_stringFile, "s_62"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: You've mention him before... - boolean hasResponse0 = false; - if (moore_lok_cantina_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_63"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: The facility is primarily used for weapons research and hidden, for the most part, from the prying eyes of Imperial General Otto. - - //-- [RESPONSE NOTE] - //-- PLAYER: You've mention him before... - if (response == "s_63") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: He's the ranking officer at the Imperial Outpost on this planet. I don't have time to talk about him. Do you want to know about him or about the Research Facility or not? - string_id message = new string_id (c_stringFile, "s_64"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Tell me about the facility. - boolean hasResponse0 = false; - if (moore_lok_cantina_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.moore_lok_cantina.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: He's the ranking officer at the Imperial Outpost on this planet. I don't have time to talk about him. Do you want to know about him or about the Research Facility or not? - - //-- [RESPONSE NOTE] - //-- PLAYER: Tell me about the facility. - if (response == "s_65") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: The base is responsible for manufacturing high-grade explosives for the Empire, including grenades. But like I mentioned, there is no obvious Imperial presence at the base. No Imperial soldiers, no guards. The entire base is staffed by trigger happy freelance mercenaries and Droidekas. - string_id message = new string_id (c_stringFile, "s_66"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Anything else? - boolean hasResponse0 = false; - if (moore_lok_cantina_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_67"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: The base is responsible for manufacturing high-grade explosives for the Empire, including grenades. But like I mentioned, there is no obvious Imperial presence at the base. No Imperial soldiers, no guards. The entire base is staffed by trigger happy freelance mercenaries and Droidekas. - - //-- [RESPONSE NOTE] - //-- PLAYER: Anything else? - if (response == "s_67") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: The facility houses a lot of research and prototype grenades. I'm sure Nym would like to get his hands on both. - string_id message = new string_id (c_stringFile, "s_68"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Anything specific? - boolean hasResponse0 = false; - if (moore_lok_cantina_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_100"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch11 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: The facility houses a lot of research and prototype grenades. I'm sure Nym would like to get his hands on both. - - //-- [RESPONSE NOTE] - //-- PLAYER: Anything specific? - if (response == "s_100") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: I'm sure all the research can be backed up to holodisk from the lab's computers. As far as the grenades, there are some Imperial Military Grade Grenade Casing Units. The Imps call them IMGGCUs. Just one of these would be very valuable. - string_id message = new string_id (c_stringFile, "s_102"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What else? - boolean hasResponse0 = false; - if (moore_lok_cantina_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_103"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch12 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I'm sure all the research can be backed up to holodisk from the lab's computers. As far as the grenades, there are some Imperial Military Grade Grenade Casing Units. The Imps call them IMGGCUs. Just one of these would be very valuable. - - //-- [RESPONSE NOTE] - //-- PLAYER: What else? - if (response == "s_103") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_finish2ndMooreInterview (player, npc); - - //-- NPC: That's all I can reveal. I haven't worked there for months but I know what I said is true. - string_id message = new string_id (c_stringFile, "s_105"); - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch14 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You mean the pirate who's henchman sent you to see me? - - //-- [RESPONSE NOTE] - //-- PLAYER: Make it 100? - if (response == "s_42") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: 150...take it or leave it. - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Fine, here. - boolean hasResponse0 = false; - if (moore_lok_cantina_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.moore_lok_cantina.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes, the pirate you owe money. - if (response == "s_43") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: And you are the guy that will help me. Now that we both know our place, you can pay up. - string_id message = new string_id (c_stringFile, "s_47"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Make it 100? - boolean hasResponse0 = false; - if (moore_lok_cantina_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.moore_lok_cantina.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: This is a waste. I'll see you in the dungeon. - if (response == "s_52") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: Oh, the Stronghold has a dungeon now? Did you dig that yourself. You're a real sharp one. - string_id message = new string_id (c_stringFile, "s_54"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Make it 100? - boolean hasResponse0 = false; - if (moore_lok_cantina_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.moore_lok_cantina.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch15 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: And you are the guy that will help me. Now that we both know our place, you can pay up. - - //-- [RESPONSE NOTE] - //-- PLAYER: Make it 100? - if (response == "s_48") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: 150...take it or leave it. - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Fine, here. - boolean hasResponse0 = false; - if (moore_lok_cantina_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.moore_lok_cantina.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch16 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Oh, the Stronghold has a dungeon now? Did you dig that yourself. You're a real sharp one. - - //-- [RESPONSE NOTE] - //-- PLAYER: Make it 100? - if (response == "s_56") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: 150...take it or leave it. - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Fine, here. - boolean hasResponse0 = false; - if (moore_lok_cantina_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.moore_lok_cantina.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch18 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Go away. I'm not talking to anyone today. - - //-- [RESPONSE NOTE] - //-- PLAYER: Jinkins sent me. You like credits? - if (response == "s_60") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: Credits, eh? I am a bit light in the pocket today. Obviously if Jinkins sent you, you need information. But the price of knowledge is steep. What are you offering? - string_id message = new string_id (c_stringFile, "s_71"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: How about 50 credits? - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Who are you? - boolean hasResponse1 = false; - if (moore_lok_cantina_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_73"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_122"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch19 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Credits, eh? I am a bit light in the pocket today. Obviously if Jinkins sent you, you need information. But the price of knowledge is steep. What are you offering? - - //-- [RESPONSE NOTE] - //-- PLAYER: How about 50 credits? - if (response == "s_73") - { - moore_lok_cantina_action_pay50 (player, npc); - - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: A modest fee. You'll probably want to know about the Imperial mine where I once served the Empire. The mine is guarded by droidekas? Is that what you're here for? - string_id message = new string_id (c_stringFile, "s_75"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Droidekas? - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Tell me about the Imperial mine. - boolean hasResponse1 = false; - if (moore_lok_cantina_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_77"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_86"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Who are you? - if (response == "s_122") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: Who are you? Some sort of Imperial assassin? I'm not going to make your job easier by confirming my identity. Now leave me alone. - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: How about 50 credits? - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Who are you? - boolean hasResponse1 = false; - if (moore_lok_cantina_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_73"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_122"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch20 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: A modest fee. You'll probably want to know about the Imperial mine where I once served the Empire. The mine is guarded by droidekas? Is that what you're here for? - - //-- [RESPONSE NOTE] - //-- PLAYER: Droidekas? - if (response == "s_77") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: Yes, the so-called 'destroyer droids' used by the Trade Federation during the Clone Wars. The Empire has a stockpile of the droids and has reprogrammed them to guard various installations across the galaxy, including a research station and the mine here on Lok. The droidekas are programmed to attack anyone who shouldn't be there. - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Tell me about the Imperial mine. - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: What about Imperials in the mine? - boolean hasResponse1 = false; - if (moore_lok_cantina_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_82"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_115"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Tell me about the Imperial mine. - if (response == "s_86") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: It's a mine. Minerals and gasses are mined and used by the Empire or sold for profit. There is limited Imperial presence at the base. Mainly Droidekas. - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: You mentioned Droidekas? - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: No Imperials at the base? Explain. - boolean hasResponse1 = false; - if (moore_lok_cantina_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_109"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_112"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch21 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yes, the so-called 'destroyer droids' used by the Trade Federation during the Clone Wars. The Empire has a stockpile of the droids and has reprogrammed them to guard various installations across the galaxy, including a research station and the mine here on Lok. The droidekas are programmed to attack anyone who shouldn't be there. - - //-- [RESPONSE NOTE] - //-- PLAYER: Tell me about the Imperial mine. - if (response == "s_82") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: It's a mine. Minerals and gasses are mined and used by the Empire or sold for profit. There is limited Imperial presence at the base. Mainly Droidekas. - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: You mentioned Droidekas? - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: No Imperials at the base? Explain. - boolean hasResponse1 = false; - if (moore_lok_cantina_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_109"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_112"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: What about Imperials in the mine? - if (response == "s_115") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: That kind of information requires credits, my friend. - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I could spare 100 credits... - boolean hasResponse0 = false; - if (moore_lok_cantina_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_117"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch22 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: That kind of information requires credits, my friend. - - //-- [RESPONSE NOTE] - //-- PLAYER: I could spare 100 credits... - if (response == "s_117") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_pay100 (player, npc); - - //-- NPC: There's a feud between an Imperial General Otto and other Imperials. To keep Otto from meddling in the affairs of the Lok research facility and mine, it was built in relative secrecy and staffed with mercenaries and droids rather than requisitioned soldiers. - string_id message = new string_id (c_stringFile, "s_118"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I guess that's all I need. - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: How can I get past the Droideka? - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Who is General Otto? - boolean hasResponse2 = false; - if (moore_lok_cantina_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_119"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_120"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_108"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch23 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: It's a mine. Minerals and gasses are mined and used by the Empire or sold for profit. There is limited Imperial presence at the base. Mainly Droidekas. - - //-- [RESPONSE NOTE] - //-- PLAYER: You mentioned Droidekas? - if (response == "s_109") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: Yes, the so-called 'destroyer droids' used by the Trade Federation during the Clone Wars. The Empire has a stockpile of the droids and has reprogrammed them to guard various installations across the galaxy, including a research station and the mine here on Lok. The droidekas are programmed to attack anyone who shouldn't be there. - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Tell me about the Imperial mine. - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: What about Imperials in the mine? - boolean hasResponse1 = false; - if (moore_lok_cantina_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_82"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_115"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: No Imperials at the base? Explain. - if (response == "s_112") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: I'll need more credits to divulge that information. - string_id message = new string_id (c_stringFile, "s_113"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I could spare 100 credits... - boolean hasResponse0 = false; - if (moore_lok_cantina_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_114"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 24); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch24 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I'll need more credits to divulge that information. - - //-- [RESPONSE NOTE] - //-- PLAYER: I could spare 100 credits... - if (response == "s_114") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_pay100 (player, npc); - - //-- NPC: There's a feud between an Imperial General Otto and other Imperials. To keep Otto from meddling in the affairs of the Lok research facility and mine, it was built in relative secrecy and staffed with mercenaries and droids rather than requisitioned soldiers. - string_id message = new string_id (c_stringFile, "s_118"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I guess that's all I need. - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: How can I get past the Droideka? - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Who is General Otto? - boolean hasResponse2 = false; - if (moore_lok_cantina_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_119"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_120"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_108"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch25 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: There's a feud between an Imperial General Otto and other Imperials. To keep Otto from meddling in the affairs of the Lok research facility and mine, it was built in relative secrecy and staffed with mercenaries and droids rather than requisitioned soldiers. - - //-- [RESPONSE NOTE] - //-- PLAYER: I guess that's all I need. - if (response == "s_119") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_finishMooreInterview (player, npc); - - //-- NPC: Good, because that's all I'm saying. You don't need to know any more than that. - string_id message = new string_id (c_stringFile, "s_121"); - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: How can I get past the Droideka? - if (response == "s_120") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: That's all I'm saying. You don't need to know any more than that. - string_id message = new string_id (c_stringFile, "s_124"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: But.. - boolean hasResponse0 = false; - if (moore_lok_cantina_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_125"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Who is General Otto? - if (response == "s_108") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: He is an Imperial General on Lok. That is all you need to know. - string_id message = new string_id (c_stringFile, "s_110"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I guess that's all I need. - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: How can I get past the Droideka? - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Who is General Otto? - boolean hasResponse2 = false; - if (moore_lok_cantina_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_119"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_120"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_108"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch27 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: That's all I'm saying. You don't need to know any more than that. - - //-- [RESPONSE NOTE] - //-- PLAYER: But.. - if (response == "s_125") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_finishMooreInterview (player, npc); - - //-- NPC: Now go. I can't be seen talking to the likes of you. - string_id message = new string_id (c_stringFile, "s_126"); - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch29 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: He is an Imperial General on Lok. That is all you need to know. - - //-- [RESPONSE NOTE] - //-- PLAYER: I guess that's all I need. - if (response == "s_119") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_finishMooreInterview (player, npc); - - //-- NPC: Good, because that's all I'm saying. You don't need to know any more than that. - string_id message = new string_id (c_stringFile, "s_121"); - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: How can I get past the Droideka? - if (response == "s_120") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: That's all I'm saying. You don't need to know any more than that. - string_id message = new string_id (c_stringFile, "s_124"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: But.. - boolean hasResponse0 = false; - if (moore_lok_cantina_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_125"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Who is General Otto? - if (response == "s_108") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: He is an Imperial General on Lok. That is all you need to know. - string_id message = new string_id (c_stringFile, "s_110"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I guess that's all I need. - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: How can I get past the Droideka? - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Who is General Otto? - boolean hasResponse2 = false; - if (moore_lok_cantina_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_119"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_120"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_108"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int moore_lok_cantina_handleBranch30 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Who are you? Some sort of Imperial assassin? I'm not going to make your job easier by confirming my identity. Now leave me alone. - - //-- [RESPONSE NOTE] - //-- PLAYER: How about 50 credits? - if (response == "s_73") - { - moore_lok_cantina_action_pay50 (player, npc); - - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: A modest fee. You'll probably want to know about the Imperial mine where I once served the Empire. The mine is guarded by droidekas? Is that what you're here for? - string_id message = new string_id (c_stringFile, "s_75"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Droidekas? - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Tell me about the Imperial mine. - boolean hasResponse1 = false; - if (moore_lok_cantina_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_77"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_86"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Who are you? - if (response == "s_122") - { - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: Who are you? Some sort of Imperial assassin? I'm not going to make your job easier by confirming my identity. Now leave me alone. - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: How about 50 credits? - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Who are you? - boolean hasResponse1 = false; - if (moore_lok_cantina_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_73"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_122"); - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.moore_lok_cantina"); - - 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.moore_lok_cantina"); - - 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 (moore_lok_cantina_condition_hasCompleted2ndMoore (player, npc)) - { - //-- NPC: Your next visit is really going to cost you. - string_id message = new string_id (c_stringFile, "s_69"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (moore_lok_cantina_condition_has2ndInterviewTask (player, npc)) - { - //-- NPC: What are you, a stalker? Go away! - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Kole sent me. Tell me... - boolean hasResponse0 = false; - if (moore_lok_cantina_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.moore_lok_cantina.branchId", 2); - - npcStartConversation (player, npc, "moore_lok_cantina", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (moore_lok_cantina_condition_hasCompletedMoore (player, npc)) - { - //-- NPC: You are starting to make me angry. - string_id message = new string_id (c_stringFile, "s_127"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (moore_lok_cantina_condition_hasMooreTask (player, npc)) - { - //-- NPC: Go away. I'm not talking to anyone today. - string_id message = new string_id (c_stringFile, "s_61"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Jinkins sent me. You like credits? - boolean hasResponse0 = false; - if (moore_lok_cantina_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.moore_lok_cantina.branchId", 18); - - npcStartConversation (player, npc, "moore_lok_cantina", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - //-- NPC: Go away. I'm not talking to anyone today. - string_id message = new string_id (c_stringFile, "s_128"); - 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 != "moore_lok_cantina") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - if (branchId == 2 && moore_lok_cantina_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && moore_lok_cantina_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && moore_lok_cantina_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && moore_lok_cantina_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && moore_lok_cantina_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && moore_lok_cantina_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && moore_lok_cantina_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && moore_lok_cantina_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && moore_lok_cantina_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 11 && moore_lok_cantina_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 12 && moore_lok_cantina_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 14 && moore_lok_cantina_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 15 && moore_lok_cantina_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 16 && moore_lok_cantina_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 18 && moore_lok_cantina_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 19 && moore_lok_cantina_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 20 && moore_lok_cantina_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 21 && moore_lok_cantina_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 22 && moore_lok_cantina_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 23 && moore_lok_cantina_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 24 && moore_lok_cantina_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 25 && moore_lok_cantina_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 27 && moore_lok_cantina_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 29 && moore_lok_cantina_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 30 && moore_lok_cantina_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// moore_lok_cantina.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.money; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/moore_lok_cantina"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean moore_lok_cantina_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean moore_lok_cantina_condition_hasMooreTask (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_interview_moore", "findSgtMoore"); +} + +// ---------------------------------------------------------------------- + +boolean moore_lok_cantina_condition_has2ndInterviewTask (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_second_interview_moore", "findSgtMoore2nd"); +} + +// ---------------------------------------------------------------------- + +boolean moore_lok_cantina_condition_hasCompletedMoore (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return (groundquests.isTaskActive(player, "u16_nym_themepark_interview_moore", "tellJinkinsMoore") + || groundquests.hasCompletedQuest(player, "u16_nym_themepark_interview_moore")); +} + +// ---------------------------------------------------------------------- + +boolean moore_lok_cantina_condition_hasCompleted2ndMoore (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return (groundquests.isTaskActive(player, "u16_nym_themepark_second_interview_moore", "tellKoleMoore") + || groundquests.hasCompletedQuest(player, "u16_nym_themepark_second_interview_moore")); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void moore_lok_cantina_action_pay50 (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(!utils.hasScriptVar(player, "pay50")) + { + faceTo(npc, player); + dictionary params = new dictionary(); + money.requestPayment(player, npc, 50, "pass_fail", params, true); + utils.setScriptVar(player, "pay50", true); + } +} + +// ---------------------------------------------------------------------- + +void moore_lok_cantina_action_finishMooreInterview (obj_id player, obj_id npc) +{ + faceTo(npc, player); + groundquests.sendSignal(player, "hasSpokenSgtMoore"); +} + +// ---------------------------------------------------------------------- + +void moore_lok_cantina_action_pay100 (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(!utils.hasScriptVar(player, "pay100")) + { + dictionary params = new dictionary(); + money.requestPayment(player, npc, 100, "pass_fail", params, true); + utils.setScriptVar(player, "pay100", true); + } +} + +// ---------------------------------------------------------------------- + +void moore_lok_cantina_action_pay150 (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(!utils.hasScriptVar(player, "payLast")) + { + faceTo(npc, player); + dictionary params = new dictionary(); + money.requestPayment(player, npc, 150, "pass_fail", params, true); + utils.setScriptVar(player, "payLast", true); + } +} + +// ---------------------------------------------------------------------- + +void moore_lok_cantina_action_pay200 (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(!utils.hasScriptVar(player, "payLast")) + { + faceTo(npc, player); + dictionary params = new dictionary(); + money.requestPayment(player, npc, 200, "pass_fail", params, true); + utils.setScriptVar(player, "payLast", true); + } +} + +// ---------------------------------------------------------------------- + +void moore_lok_cantina_action_finish2ndMooreInterview (obj_id player, obj_id npc) +{ + faceTo(npc, player); + groundquests.sendSignal(player, "hasSpokenSgtMoore2nd"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int moore_lok_cantina_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: What are you, a stalker? Go away! + + //-- [RESPONSE NOTE] + //-- PLAYER: Kole sent me. Tell me... + if (response == "s_32") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: That will be 200 credits. + string_id message = new string_id (c_stringFile, "s_33"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Fine, here. + boolean hasResponse0 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Make it 100? + boolean hasResponse1 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: No. You'll tell me, or answer to Nym. + boolean hasResponse2 = false; + if (moore_lok_cantina_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_34"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_38"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_35"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: That will be 200 credits. + + //-- [RESPONSE NOTE] + //-- PLAYER: Fine, here. + if (response == "s_34") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + moore_lok_cantina_action_pay200 (player, npc); + + //-- NPC: Good. Now that that is settled. What was your question? + string_id message = new string_id (c_stringFile, "s_36"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: The Imperial Research Facility. + boolean hasResponse0 = false; + if (moore_lok_cantina_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.moore_lok_cantina.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Make it 100? + if (response == "s_38") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: 150...take it or leave it. + string_id message = new string_id (c_stringFile, "s_39"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Fine, here. + boolean hasResponse0 = false; + if (moore_lok_cantina_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.moore_lok_cantina.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: No. You'll tell me, or answer to Nym. + if (response == "s_35") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: You mean the pirate who's henchman sent you to see me? + string_id message = new string_id (c_stringFile, "s_37"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Make it 100? + boolean hasResponse0 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Yes, the pirate you owe money. + boolean hasResponse1 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: This is a waste. I'll see you in the dungeon. + boolean hasResponse2 = false; + if (moore_lok_cantina_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_42"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_43"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_52"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 14); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Good. Now that that is settled. What was your question? + + //-- [RESPONSE NOTE] + //-- PLAYER: The Imperial Research Facility. + if (response == "s_49") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: Alright. I can tell you that I worked for an Imperial Research Facility, but that we didn't use requisitioned Imperial soldiers for guards. Instead, we hired the most dangerous mercenaries we could find. The base is also guarded by reprogrammed droidekas, the same you saw in the mine. + string_id message = new string_id (c_stringFile, "s_50"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Go on. + boolean hasResponse0 = false; + if (moore_lok_cantina_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_51"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: 150...take it or leave it. + + //-- [RESPONSE NOTE] + //-- PLAYER: Fine, here. + if (response == "s_40") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + moore_lok_cantina_action_pay150 (player, npc); + + //-- NPC: Good. Now that that is settled. What was your question? + string_id message = new string_id (c_stringFile, "s_41"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: The Imperial Research Facility. + boolean hasResponse0 = false; + if (moore_lok_cantina_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.moore_lok_cantina.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Good. Now that that is settled. What was your question? + + //-- [RESPONSE NOTE] + //-- PLAYER: The Imperial Research Facility. + if (response == "s_49") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: Alright. I can tell you that I worked for an Imperial Research Facility, but that we didn't use requisitioned Imperial soldiers for guards. Instead, we hired the most dangerous mercenaries we could find. The base is also guarded by reprogrammed droidekas, the same you saw in the mine. + string_id message = new string_id (c_stringFile, "s_50"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Go on. + boolean hasResponse0 = false; + if (moore_lok_cantina_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_51"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Alright. I can tell you that I worked for an Imperial Research Facility, but that we didn't use requisitioned Imperial soldiers for guards. Instead, we hired the most dangerous mercenaries we could find. The base is also guarded by reprogrammed droidekas, the same you saw in the mine. + + //-- [RESPONSE NOTE] + //-- PLAYER: Go on. + if (response == "s_51") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: The facility is primarily used for weapons research and hidden, for the most part, from the prying eyes of Imperial General Otto. + string_id message = new string_id (c_stringFile, "s_62"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: You've mention him before... + boolean hasResponse0 = false; + if (moore_lok_cantina_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_63"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: The facility is primarily used for weapons research and hidden, for the most part, from the prying eyes of Imperial General Otto. + + //-- [RESPONSE NOTE] + //-- PLAYER: You've mention him before... + if (response == "s_63") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: He's the ranking officer at the Imperial Outpost on this planet. I don't have time to talk about him. Do you want to know about him or about the Research Facility or not? + string_id message = new string_id (c_stringFile, "s_64"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Tell me about the facility. + boolean hasResponse0 = false; + if (moore_lok_cantina_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.moore_lok_cantina.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: He's the ranking officer at the Imperial Outpost on this planet. I don't have time to talk about him. Do you want to know about him or about the Research Facility or not? + + //-- [RESPONSE NOTE] + //-- PLAYER: Tell me about the facility. + if (response == "s_65") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: The base is responsible for manufacturing high-grade explosives for the Empire, including grenades. But like I mentioned, there is no obvious Imperial presence at the base. No Imperial soldiers, no guards. The entire base is staffed by trigger happy freelance mercenaries and Droidekas. + string_id message = new string_id (c_stringFile, "s_66"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Anything else? + boolean hasResponse0 = false; + if (moore_lok_cantina_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_67"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: The base is responsible for manufacturing high-grade explosives for the Empire, including grenades. But like I mentioned, there is no obvious Imperial presence at the base. No Imperial soldiers, no guards. The entire base is staffed by trigger happy freelance mercenaries and Droidekas. + + //-- [RESPONSE NOTE] + //-- PLAYER: Anything else? + if (response == "s_67") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: The facility houses a lot of research and prototype grenades. I'm sure Nym would like to get his hands on both. + string_id message = new string_id (c_stringFile, "s_68"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Anything specific? + boolean hasResponse0 = false; + if (moore_lok_cantina_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_100"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 11); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch11 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: The facility houses a lot of research and prototype grenades. I'm sure Nym would like to get his hands on both. + + //-- [RESPONSE NOTE] + //-- PLAYER: Anything specific? + if (response == "s_100") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: I'm sure all the research can be backed up to holodisk from the lab's computers. As far as the grenades, there are some Imperial Military Grade Grenade Casing Units. The Imps call them IMGGCUs. Just one of these would be very valuable. + string_id message = new string_id (c_stringFile, "s_102"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What else? + boolean hasResponse0 = false; + if (moore_lok_cantina_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_103"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 12); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch12 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I'm sure all the research can be backed up to holodisk from the lab's computers. As far as the grenades, there are some Imperial Military Grade Grenade Casing Units. The Imps call them IMGGCUs. Just one of these would be very valuable. + + //-- [RESPONSE NOTE] + //-- PLAYER: What else? + if (response == "s_103") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + moore_lok_cantina_action_finish2ndMooreInterview (player, npc); + + //-- NPC: That's all I can reveal. I haven't worked there for months but I know what I said is true. + string_id message = new string_id (c_stringFile, "s_105"); + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch14 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You mean the pirate who's henchman sent you to see me? + + //-- [RESPONSE NOTE] + //-- PLAYER: Make it 100? + if (response == "s_42") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: 150...take it or leave it. + string_id message = new string_id (c_stringFile, "s_39"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Fine, here. + boolean hasResponse0 = false; + if (moore_lok_cantina_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.moore_lok_cantina.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes, the pirate you owe money. + if (response == "s_43") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: And you are the guy that will help me. Now that we both know our place, you can pay up. + string_id message = new string_id (c_stringFile, "s_47"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Make it 100? + boolean hasResponse0 = false; + if (moore_lok_cantina_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.moore_lok_cantina.branchId", 15); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: This is a waste. I'll see you in the dungeon. + if (response == "s_52") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: Oh, the Stronghold has a dungeon now? Did you dig that yourself. You're a real sharp one. + string_id message = new string_id (c_stringFile, "s_54"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Make it 100? + boolean hasResponse0 = false; + if (moore_lok_cantina_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.moore_lok_cantina.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch15 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: And you are the guy that will help me. Now that we both know our place, you can pay up. + + //-- [RESPONSE NOTE] + //-- PLAYER: Make it 100? + if (response == "s_48") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: 150...take it or leave it. + string_id message = new string_id (c_stringFile, "s_39"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Fine, here. + boolean hasResponse0 = false; + if (moore_lok_cantina_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.moore_lok_cantina.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch16 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Oh, the Stronghold has a dungeon now? Did you dig that yourself. You're a real sharp one. + + //-- [RESPONSE NOTE] + //-- PLAYER: Make it 100? + if (response == "s_56") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: 150...take it or leave it. + string_id message = new string_id (c_stringFile, "s_39"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Fine, here. + boolean hasResponse0 = false; + if (moore_lok_cantina_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.moore_lok_cantina.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch18 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Go away. I'm not talking to anyone today. + + //-- [RESPONSE NOTE] + //-- PLAYER: Jinkins sent me. You like credits? + if (response == "s_60") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: Credits, eh? I am a bit light in the pocket today. Obviously if Jinkins sent you, you need information. But the price of knowledge is steep. What are you offering? + string_id message = new string_id (c_stringFile, "s_71"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: How about 50 credits? + boolean hasResponse0 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Who are you? + boolean hasResponse1 = false; + if (moore_lok_cantina_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_73"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_122"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 19); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch19 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Credits, eh? I am a bit light in the pocket today. Obviously if Jinkins sent you, you need information. But the price of knowledge is steep. What are you offering? + + //-- [RESPONSE NOTE] + //-- PLAYER: How about 50 credits? + if (response == "s_73") + { + moore_lok_cantina_action_pay50 (player, npc); + + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: A modest fee. You'll probably want to know about the Imperial mine where I once served the Empire. The mine is guarded by droidekas? Is that what you're here for? + string_id message = new string_id (c_stringFile, "s_75"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Droidekas? + boolean hasResponse0 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Tell me about the Imperial mine. + boolean hasResponse1 = false; + if (moore_lok_cantina_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_77"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_86"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 20); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Who are you? + if (response == "s_122") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: Who are you? Some sort of Imperial assassin? I'm not going to make your job easier by confirming my identity. Now leave me alone. + string_id message = new string_id (c_stringFile, "s_123"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: How about 50 credits? + boolean hasResponse0 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Who are you? + boolean hasResponse1 = false; + if (moore_lok_cantina_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_73"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_122"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 19); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch20 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: A modest fee. You'll probably want to know about the Imperial mine where I once served the Empire. The mine is guarded by droidekas? Is that what you're here for? + + //-- [RESPONSE NOTE] + //-- PLAYER: Droidekas? + if (response == "s_77") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: Yes, the so-called 'destroyer droids' used by the Trade Federation during the Clone Wars. The Empire has a stockpile of the droids and has reprogrammed them to guard various installations across the galaxy, including a research station and the mine here on Lok. The droidekas are programmed to attack anyone who shouldn't be there. + string_id message = new string_id (c_stringFile, "s_79"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Tell me about the Imperial mine. + boolean hasResponse0 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: What about Imperials in the mine? + boolean hasResponse1 = false; + if (moore_lok_cantina_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_82"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_115"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 21); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Tell me about the Imperial mine. + if (response == "s_86") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: It's a mine. Minerals and gasses are mined and used by the Empire or sold for profit. There is limited Imperial presence at the base. Mainly Droidekas. + string_id message = new string_id (c_stringFile, "s_88"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: You mentioned Droidekas? + boolean hasResponse0 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: No Imperials at the base? Explain. + boolean hasResponse1 = false; + if (moore_lok_cantina_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_109"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_112"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 23); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch21 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yes, the so-called 'destroyer droids' used by the Trade Federation during the Clone Wars. The Empire has a stockpile of the droids and has reprogrammed them to guard various installations across the galaxy, including a research station and the mine here on Lok. The droidekas are programmed to attack anyone who shouldn't be there. + + //-- [RESPONSE NOTE] + //-- PLAYER: Tell me about the Imperial mine. + if (response == "s_82") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: It's a mine. Minerals and gasses are mined and used by the Empire or sold for profit. There is limited Imperial presence at the base. Mainly Droidekas. + string_id message = new string_id (c_stringFile, "s_88"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: You mentioned Droidekas? + boolean hasResponse0 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: No Imperials at the base? Explain. + boolean hasResponse1 = false; + if (moore_lok_cantina_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_109"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_112"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 23); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: What about Imperials in the mine? + if (response == "s_115") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: That kind of information requires credits, my friend. + string_id message = new string_id (c_stringFile, "s_116"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I could spare 100 credits... + boolean hasResponse0 = false; + if (moore_lok_cantina_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_117"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 22); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch22 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: That kind of information requires credits, my friend. + + //-- [RESPONSE NOTE] + //-- PLAYER: I could spare 100 credits... + if (response == "s_117") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + moore_lok_cantina_action_pay100 (player, npc); + + //-- NPC: There's a feud between an Imperial General Otto and other Imperials. To keep Otto from meddling in the affairs of the Lok research facility and mine, it was built in relative secrecy and staffed with mercenaries and droids rather than requisitioned soldiers. + string_id message = new string_id (c_stringFile, "s_118"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I guess that's all I need. + boolean hasResponse0 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: How can I get past the Droideka? + boolean hasResponse1 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Who is General Otto? + boolean hasResponse2 = false; + if (moore_lok_cantina_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_119"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_120"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_108"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 25); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch23 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: It's a mine. Minerals and gasses are mined and used by the Empire or sold for profit. There is limited Imperial presence at the base. Mainly Droidekas. + + //-- [RESPONSE NOTE] + //-- PLAYER: You mentioned Droidekas? + if (response == "s_109") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: Yes, the so-called 'destroyer droids' used by the Trade Federation during the Clone Wars. The Empire has a stockpile of the droids and has reprogrammed them to guard various installations across the galaxy, including a research station and the mine here on Lok. The droidekas are programmed to attack anyone who shouldn't be there. + string_id message = new string_id (c_stringFile, "s_79"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Tell me about the Imperial mine. + boolean hasResponse0 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: What about Imperials in the mine? + boolean hasResponse1 = false; + if (moore_lok_cantina_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_82"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_115"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 21); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: No Imperials at the base? Explain. + if (response == "s_112") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: I'll need more credits to divulge that information. + string_id message = new string_id (c_stringFile, "s_113"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I could spare 100 credits... + boolean hasResponse0 = false; + if (moore_lok_cantina_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_114"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 24); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch24 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I'll need more credits to divulge that information. + + //-- [RESPONSE NOTE] + //-- PLAYER: I could spare 100 credits... + if (response == "s_114") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + moore_lok_cantina_action_pay100 (player, npc); + + //-- NPC: There's a feud between an Imperial General Otto and other Imperials. To keep Otto from meddling in the affairs of the Lok research facility and mine, it was built in relative secrecy and staffed with mercenaries and droids rather than requisitioned soldiers. + string_id message = new string_id (c_stringFile, "s_118"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I guess that's all I need. + boolean hasResponse0 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: How can I get past the Droideka? + boolean hasResponse1 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Who is General Otto? + boolean hasResponse2 = false; + if (moore_lok_cantina_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_119"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_120"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_108"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 25); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch25 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: There's a feud between an Imperial General Otto and other Imperials. To keep Otto from meddling in the affairs of the Lok research facility and mine, it was built in relative secrecy and staffed with mercenaries and droids rather than requisitioned soldiers. + + //-- [RESPONSE NOTE] + //-- PLAYER: I guess that's all I need. + if (response == "s_119") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + moore_lok_cantina_action_finishMooreInterview (player, npc); + + //-- NPC: Good, because that's all I'm saying. You don't need to know any more than that. + string_id message = new string_id (c_stringFile, "s_121"); + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: How can I get past the Droideka? + if (response == "s_120") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: That's all I'm saying. You don't need to know any more than that. + string_id message = new string_id (c_stringFile, "s_124"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: But.. + boolean hasResponse0 = false; + if (moore_lok_cantina_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_125"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 27); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Who is General Otto? + if (response == "s_108") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: He is an Imperial General on Lok. That is all you need to know. + string_id message = new string_id (c_stringFile, "s_110"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I guess that's all I need. + boolean hasResponse0 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: How can I get past the Droideka? + boolean hasResponse1 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Who is General Otto? + boolean hasResponse2 = false; + if (moore_lok_cantina_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_119"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_120"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_108"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 25); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch27 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: That's all I'm saying. You don't need to know any more than that. + + //-- [RESPONSE NOTE] + //-- PLAYER: But.. + if (response == "s_125") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + moore_lok_cantina_action_finishMooreInterview (player, npc); + + //-- NPC: Now go. I can't be seen talking to the likes of you. + string_id message = new string_id (c_stringFile, "s_126"); + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch29 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: He is an Imperial General on Lok. That is all you need to know. + + //-- [RESPONSE NOTE] + //-- PLAYER: I guess that's all I need. + if (response == "s_119") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + moore_lok_cantina_action_finishMooreInterview (player, npc); + + //-- NPC: Good, because that's all I'm saying. You don't need to know any more than that. + string_id message = new string_id (c_stringFile, "s_121"); + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: How can I get past the Droideka? + if (response == "s_120") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: That's all I'm saying. You don't need to know any more than that. + string_id message = new string_id (c_stringFile, "s_124"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: But.. + boolean hasResponse0 = false; + if (moore_lok_cantina_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_125"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 27); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Who is General Otto? + if (response == "s_108") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: He is an Imperial General on Lok. That is all you need to know. + string_id message = new string_id (c_stringFile, "s_110"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I guess that's all I need. + boolean hasResponse0 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: How can I get past the Droideka? + boolean hasResponse1 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Who is General Otto? + boolean hasResponse2 = false; + if (moore_lok_cantina_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_119"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_120"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_108"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 25); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int moore_lok_cantina_handleBranch30 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Who are you? Some sort of Imperial assassin? I'm not going to make your job easier by confirming my identity. Now leave me alone. + + //-- [RESPONSE NOTE] + //-- PLAYER: How about 50 credits? + if (response == "s_73") + { + moore_lok_cantina_action_pay50 (player, npc); + + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: A modest fee. You'll probably want to know about the Imperial mine where I once served the Empire. The mine is guarded by droidekas? Is that what you're here for? + string_id message = new string_id (c_stringFile, "s_75"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Droidekas? + boolean hasResponse0 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Tell me about the Imperial mine. + boolean hasResponse1 = false; + if (moore_lok_cantina_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_77"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_86"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 20); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Who are you? + if (response == "s_122") + { + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: Who are you? Some sort of Imperial assassin? I'm not going to make your job easier by confirming my identity. Now leave me alone. + string_id message = new string_id (c_stringFile, "s_123"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: How about 50 credits? + boolean hasResponse0 = false; + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Who are you? + boolean hasResponse1 = false; + if (moore_lok_cantina_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_73"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_122"); + + utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 19); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.moore_lok_cantina"); + + 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.moore_lok_cantina"); + + 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 (moore_lok_cantina_condition_hasCompleted2ndMoore (player, npc)) + { + //-- NPC: Your next visit is really going to cost you. + string_id message = new string_id (c_stringFile, "s_69"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (moore_lok_cantina_condition_has2ndInterviewTask (player, npc)) + { + //-- NPC: What are you, a stalker? Go away! + string_id message = new string_id (c_stringFile, "s_31"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Kole sent me. Tell me... + boolean hasResponse0 = false; + if (moore_lok_cantina_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.moore_lok_cantina.branchId", 2); + + npcStartConversation (player, npc, "moore_lok_cantina", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (moore_lok_cantina_condition_hasCompletedMoore (player, npc)) + { + //-- NPC: You are starting to make me angry. + string_id message = new string_id (c_stringFile, "s_127"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (moore_lok_cantina_condition_hasMooreTask (player, npc)) + { + //-- NPC: Go away. I'm not talking to anyone today. + string_id message = new string_id (c_stringFile, "s_61"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Jinkins sent me. You like credits? + boolean hasResponse0 = false; + if (moore_lok_cantina_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.moore_lok_cantina.branchId", 18); + + npcStartConversation (player, npc, "moore_lok_cantina", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (moore_lok_cantina_condition__defaultCondition (player, npc)) + { + //-- NPC: Go away. I'm not talking to anyone today. + string_id message = new string_id (c_stringFile, "s_128"); + 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 != "moore_lok_cantina") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + if (branchId == 2 && moore_lok_cantina_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && moore_lok_cantina_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && moore_lok_cantina_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && moore_lok_cantina_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && moore_lok_cantina_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && moore_lok_cantina_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && moore_lok_cantina_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && moore_lok_cantina_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && moore_lok_cantina_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 11 && moore_lok_cantina_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 12 && moore_lok_cantina_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 14 && moore_lok_cantina_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 15 && moore_lok_cantina_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 16 && moore_lok_cantina_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 18 && moore_lok_cantina_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 19 && moore_lok_cantina_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 20 && moore_lok_cantina_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 21 && moore_lok_cantina_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 22 && moore_lok_cantina_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 23 && moore_lok_cantina_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 24 && moore_lok_cantina_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 25 && moore_lok_cantina_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 27 && moore_lok_cantina_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 29 && moore_lok_cantina_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 30 && moore_lok_cantina_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/mtp_corsec_intelligence_officer.script b/sku.0/sys.server/compiled/game/script/conversation/mtp_corsec_intelligence_officer.script index 48e990b10..f0d7f111d 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/mtp_corsec_intelligence_officer.script +++ b/sku.0/sys.server/compiled/game/script/conversation/mtp_corsec_intelligence_officer.script @@ -1,809 +1,809 @@ -// ====================================================================== -// -// mtp_corsec_intelligence_officer.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.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/mtp_corsec_intelligence_officer"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean mtp_corsec_intelligence_officer_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int mtp_corsec_intelligence_officer_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Thank you for meeting with me such short notice. - - //-- [RESPONSE NOTE] - //-- PLAYER: What can I do for you? - if (response == "s_4") - { - //-- [NOTE] - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: My sources say that you have had intimate dealings with the notorious Meatlump Gang. Since you are obviously someone that possesses, uh, the skills needed, I was hoping to enlist your assistence. - string_id message = new string_id (c_stringFile, "s_5"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Can't the CorSec handle their own dirty work? - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_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_6"); - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mtp_corsec_intelligence_officer_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: My sources say that you have had intimate dealings with the notorious Meatlump Gang. Since you are obviously someone that possesses, uh, the skills needed, I was hoping to enlist your assistence. - - //-- [RESPONSE NOTE] - //-- PLAYER: Can't the CorSec handle their own dirty work? - if (response == "s_6") - { - //-- [NOTE] - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: Well. Let's just say this type of help doesn't fall under the authority of the CorSec and as a result the pay is unusually higher than any mundane police work. - string_id message = new string_id (c_stringFile, "s_7"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm listening. - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_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_8"); - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mtp_corsec_intelligence_officer_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Well. Let's just say this type of help doesn't fall under the authority of the CorSec and as a result the pay is unusually higher than any mundane police work. - - //-- [RESPONSE NOTE] - //-- PLAYER: I'm listening. - if (response == "s_8") - { - //-- [NOTE] - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: And of course, if anything were to happen the CorSec would disavow any knowledge of you and deny any connection. - string_id message = new string_id (c_stringFile, "s_9"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: You said pay was unusually high? - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_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_10"); - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mtp_corsec_intelligence_officer_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: And of course, if anything were to happen the CorSec would disavow any knowledge of you and deny any connection. - - //-- [RESPONSE NOTE] - //-- PLAYER: You said pay was unusually high? - if (response == "s_10") - { - //-- [NOTE] - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: Yes...I did. I also mentioned the Meatlumps. If you decide to take the missions, you would no doubt come head to head with more of these thugs. - string_id message = new string_id (c_stringFile, "s_11"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Pffft! I feel sorry for them already. - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_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_12"); - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mtp_corsec_intelligence_officer_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yes...I did. I also mentioned the Meatlumps. If you decide to take the missions, you would no doubt come head to head with more of these thugs. - - //-- [RESPONSE NOTE] - //-- PLAYER: Pffft! I feel sorry for them already. - if (response == "s_12") - { - //-- [NOTE] - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: Very well. Your missions are easy enough. Find the Meatlump Forward Outposts found on different planets throughout the galaxy, sabotage their supplies and gather intelligence. - string_id message = new string_id (c_stringFile, "s_13"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Forward Outposts? On other planets other than Corellia? - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_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_14"); - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mtp_corsec_intelligence_officer_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Very well. Your missions are easy enough. Find the Meatlump Forward Outposts found on different planets throughout the galaxy, sabotage their supplies and gather intelligence. - - //-- [RESPONSE NOTE] - //-- PLAYER: Forward Outposts? On other planets other than Corellia? - if (response == "s_14") - { - //-- [NOTE] - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: I have reason to believe there are 10 outposts. Some are here on Corellia, others on other planets. They are basically camps not far from towns and cities used to launch attacks, resupply and recruit. Interested? - string_id message = new string_id (c_stringFile, "s_15"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Doesn't sound too difficult. - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_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_16"); - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mtp_corsec_intelligence_officer_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I have reason to believe there are 10 outposts. Some are here on Corellia, others on other planets. They are basically camps not far from towns and cities used to launch attacks, resupply and recruit. Interested? - - //-- [RESPONSE NOTE] - //-- PLAYER: Doesn't sound too difficult. - if (response == "s_16") - { - //-- [NOTE] - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: Search Meatlump Safes - string_id message = new string_id (c_stringFile, "s_17"); - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: Search Meatlump Locked Containers - string_id message = new string_id (c_stringFile, "s_19"); - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: Gather Meatlump Target Map Information - string_id message = new string_id (c_stringFile, "s_20"); - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: Destroy Meatlump Weapons Cache - string_id message = new string_id (c_stringFile, "s_21"); - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: Destroy Meatlump Food Supplies - string_id message = new string_id (c_stringFile, "s_22"); - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: There is one other mission, but it is someone...uh, more difficult. - string_id message = new string_id (c_stringFile, "s_23"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What is it? - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_24"); - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mtp_corsec_intelligence_officer_handleBranch13 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: There is one other mission, but it is someone...uh, more difficult. - - //-- [RESPONSE NOTE] - //-- PLAYER: What is it? - if (response == "s_24") - { - //-- [NOTE] - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: Disarming Meatlump bombs before they explode. - string_id message = new string_id (c_stringFile, "s_25"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Huh? You mean, find their bombs and defuse them before they explode...after the Meatlumps have set their timers? - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_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_26"); - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mtp_corsec_intelligence_officer_handleBranch14 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Disarming Meatlump bombs before they explode. - - //-- [RESPONSE NOTE] - //-- PLAYER: Huh? You mean, find their bombs and defuse them before they explode...after the Meatlumps have set their timers? - if (response == "s_26") - { - //-- [NOTE] - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: Yes actually. That is exactly what I mean. - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Lady...I'm your type of crazy. Sign me up. - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_28"); - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int mtp_corsec_intelligence_officer_handleBranch15 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yes actually. That is exactly what I mean. - - //-- [RESPONSE NOTE] - //-- PLAYER: Lady...I'm your type of crazy. Sign me up. - if (response == "s_28") - { - //-- [NOTE] - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: Defuse Meatlump Bombs - string_id message = new string_id (c_stringFile, "s_29"); - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.mtp_corsec_intelligence_officer"); - - 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.mtp_corsec_intelligence_officer"); - - 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 (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - //-- NPC: Thank you for meeting with me such short notice. - string_id message = new string_id (c_stringFile, "s_3"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What can I do for you? - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_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_4"); - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 1); - - npcStartConversation (player, npc, "mtp_corsec_intelligence_officer", 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 != "mtp_corsec_intelligence_officer") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - if (branchId == 1 && mtp_corsec_intelligence_officer_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 2 && mtp_corsec_intelligence_officer_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && mtp_corsec_intelligence_officer_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && mtp_corsec_intelligence_officer_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && mtp_corsec_intelligence_officer_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && mtp_corsec_intelligence_officer_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && mtp_corsec_intelligence_officer_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 13 && mtp_corsec_intelligence_officer_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 14 && mtp_corsec_intelligence_officer_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 15 && mtp_corsec_intelligence_officer_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// mtp_corsec_intelligence_officer.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.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/mtp_corsec_intelligence_officer"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean mtp_corsec_intelligence_officer_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int mtp_corsec_intelligence_officer_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Thank you for meeting with me such short notice. + + //-- [RESPONSE NOTE] + //-- PLAYER: What can I do for you? + if (response == "s_4") + { + //-- [NOTE] + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: My sources say that you have had intimate dealings with the notorious Meatlump Gang. Since you are obviously someone that possesses, uh, the skills needed, I was hoping to enlist your assistence. + string_id message = new string_id (c_stringFile, "s_5"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Can't the CorSec handle their own dirty work? + boolean hasResponse0 = false; + if (mtp_corsec_intelligence_officer_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_6"); + + utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 2); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mtp_corsec_intelligence_officer_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: My sources say that you have had intimate dealings with the notorious Meatlump Gang. Since you are obviously someone that possesses, uh, the skills needed, I was hoping to enlist your assistence. + + //-- [RESPONSE NOTE] + //-- PLAYER: Can't the CorSec handle their own dirty work? + if (response == "s_6") + { + //-- [NOTE] + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: Well. Let's just say this type of help doesn't fall under the authority of the CorSec and as a result the pay is unusually higher than any mundane police work. + string_id message = new string_id (c_stringFile, "s_7"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm listening. + boolean hasResponse0 = false; + if (mtp_corsec_intelligence_officer_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_8"); + + utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mtp_corsec_intelligence_officer_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Well. Let's just say this type of help doesn't fall under the authority of the CorSec and as a result the pay is unusually higher than any mundane police work. + + //-- [RESPONSE NOTE] + //-- PLAYER: I'm listening. + if (response == "s_8") + { + //-- [NOTE] + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: And of course, if anything were to happen the CorSec would disavow any knowledge of you and deny any connection. + string_id message = new string_id (c_stringFile, "s_9"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: You said pay was unusually high? + boolean hasResponse0 = false; + if (mtp_corsec_intelligence_officer_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_10"); + + utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mtp_corsec_intelligence_officer_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: And of course, if anything were to happen the CorSec would disavow any knowledge of you and deny any connection. + + //-- [RESPONSE NOTE] + //-- PLAYER: You said pay was unusually high? + if (response == "s_10") + { + //-- [NOTE] + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: Yes...I did. I also mentioned the Meatlumps. If you decide to take the missions, you would no doubt come head to head with more of these thugs. + string_id message = new string_id (c_stringFile, "s_11"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Pffft! I feel sorry for them already. + boolean hasResponse0 = false; + if (mtp_corsec_intelligence_officer_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_12"); + + utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mtp_corsec_intelligence_officer_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yes...I did. I also mentioned the Meatlumps. If you decide to take the missions, you would no doubt come head to head with more of these thugs. + + //-- [RESPONSE NOTE] + //-- PLAYER: Pffft! I feel sorry for them already. + if (response == "s_12") + { + //-- [NOTE] + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: Very well. Your missions are easy enough. Find the Meatlump Forward Outposts found on different planets throughout the galaxy, sabotage their supplies and gather intelligence. + string_id message = new string_id (c_stringFile, "s_13"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Forward Outposts? On other planets other than Corellia? + boolean hasResponse0 = false; + if (mtp_corsec_intelligence_officer_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_14"); + + utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mtp_corsec_intelligence_officer_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Very well. Your missions are easy enough. Find the Meatlump Forward Outposts found on different planets throughout the galaxy, sabotage their supplies and gather intelligence. + + //-- [RESPONSE NOTE] + //-- PLAYER: Forward Outposts? On other planets other than Corellia? + if (response == "s_14") + { + //-- [NOTE] + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: I have reason to believe there are 10 outposts. Some are here on Corellia, others on other planets. They are basically camps not far from towns and cities used to launch attacks, resupply and recruit. Interested? + string_id message = new string_id (c_stringFile, "s_15"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Doesn't sound too difficult. + boolean hasResponse0 = false; + if (mtp_corsec_intelligence_officer_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_16"); + + utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mtp_corsec_intelligence_officer_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I have reason to believe there are 10 outposts. Some are here on Corellia, others on other planets. They are basically camps not far from towns and cities used to launch attacks, resupply and recruit. Interested? + + //-- [RESPONSE NOTE] + //-- PLAYER: Doesn't sound too difficult. + if (response == "s_16") + { + //-- [NOTE] + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: Search Meatlump Safes + string_id message = new string_id (c_stringFile, "s_17"); + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: Search Meatlump Locked Containers + string_id message = new string_id (c_stringFile, "s_19"); + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: Gather Meatlump Target Map Information + string_id message = new string_id (c_stringFile, "s_20"); + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: Destroy Meatlump Weapons Cache + string_id message = new string_id (c_stringFile, "s_21"); + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: Destroy Meatlump Food Supplies + string_id message = new string_id (c_stringFile, "s_22"); + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: There is one other mission, but it is someone...uh, more difficult. + string_id message = new string_id (c_stringFile, "s_23"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What is it? + boolean hasResponse0 = false; + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_24"); + + utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 13); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mtp_corsec_intelligence_officer_handleBranch13 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: There is one other mission, but it is someone...uh, more difficult. + + //-- [RESPONSE NOTE] + //-- PLAYER: What is it? + if (response == "s_24") + { + //-- [NOTE] + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: Disarming Meatlump bombs before they explode. + string_id message = new string_id (c_stringFile, "s_25"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Huh? You mean, find their bombs and defuse them before they explode...after the Meatlumps have set their timers? + boolean hasResponse0 = false; + if (mtp_corsec_intelligence_officer_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_26"); + + utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 14); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mtp_corsec_intelligence_officer_handleBranch14 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Disarming Meatlump bombs before they explode. + + //-- [RESPONSE NOTE] + //-- PLAYER: Huh? You mean, find their bombs and defuse them before they explode...after the Meatlumps have set their timers? + if (response == "s_26") + { + //-- [NOTE] + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: Yes actually. That is exactly what I mean. + string_id message = new string_id (c_stringFile, "s_27"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Lady...I'm your type of crazy. Sign me up. + boolean hasResponse0 = false; + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_28"); + + utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 15); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int mtp_corsec_intelligence_officer_handleBranch15 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yes actually. That is exactly what I mean. + + //-- [RESPONSE NOTE] + //-- PLAYER: Lady...I'm your type of crazy. Sign me up. + if (response == "s_28") + { + //-- [NOTE] + if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: Defuse Meatlump Bombs + string_id message = new string_id (c_stringFile, "s_29"); + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.mtp_corsec_intelligence_officer"); + + 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.mtp_corsec_intelligence_officer"); + + 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 (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) + { + //-- NPC: Thank you for meeting with me such short notice. + string_id message = new string_id (c_stringFile, "s_3"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What can I do for you? + boolean hasResponse0 = false; + if (mtp_corsec_intelligence_officer_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_4"); + + utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 1); + + npcStartConversation (player, npc, "mtp_corsec_intelligence_officer", 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 != "mtp_corsec_intelligence_officer") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + if (branchId == 1 && mtp_corsec_intelligence_officer_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 2 && mtp_corsec_intelligence_officer_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && mtp_corsec_intelligence_officer_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && mtp_corsec_intelligence_officer_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && mtp_corsec_intelligence_officer_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && mtp_corsec_intelligence_officer_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && mtp_corsec_intelligence_officer_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 13 && mtp_corsec_intelligence_officer_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 14 && mtp_corsec_intelligence_officer_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 15 && mtp_corsec_intelligence_officer_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/nym_arena_referee.script b/sku.0/sys.server/compiled/game/script/conversation/nym_arena_referee.script index 26f5ef2f1..c9a02b7d5 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/nym_arena_referee.script +++ b/sku.0/sys.server/compiled/game/script/conversation/nym_arena_referee.script @@ -1,658 +1,658 @@ -// ====================================================================== -// -// nym_arena_referee.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/nym_arena_referee"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean nym_arena_referee_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean nym_arena_referee_condition_hasFirstArenaTask (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasFirstArenaFight"); -} - -// ---------------------------------------------------------------------- - -boolean nym_arena_referee_condition_hasSecondArenaTask (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasSecondArenaFight"); -} - -// ---------------------------------------------------------------------- - -boolean nym_arena_referee_condition_hasThirdArenaTask (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasThirdArenaFight"); -} - -// ---------------------------------------------------------------------- - -boolean nym_arena_referee_condition_hasFourthArenaTask (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasFourthArenaFight"); -} - -// ---------------------------------------------------------------------- - -boolean nym_arena_referee_condition_hasFifthAreanaTask (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasFifthArenaFight"); -} - -// ---------------------------------------------------------------------- - -boolean nym_arena_referee_condition_hasCompletedArenaTask (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasCompletedArenaForNym") - || groundquests.hasCompletedQuest(player, "u16_nym_themepark_nym_arena"); -} - -// ---------------------------------------------------------------------- - -boolean nym_arena_referee_condition_wave_event_active (obj_id player, obj_id npc) -{ - faceTo(npc, player); - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void nym_arena_referee_action_spawnOpponent (obj_id player, obj_id npc) -{ - dictionary webster = new dictionary(); - webster.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", webster, 0, false); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int nym_arena_referee_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Ready for your final opponent, %TU? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes. - if (response == "s_34") - { - //-- [NOTE] - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute2"); - - nym_arena_referee_action_spawnOpponent (player, npc); - - //-- NPC: Good luck! - string_id message = new string_id (c_stringFile, "s_36"); - utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_arena_referee_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Ready for your fourth opponent, %TU? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes. - if (response == "s_32") - { - //-- [NOTE] - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "clap_rousing"); - - nym_arena_referee_action_spawnOpponent (player, npc); - - //-- NPC: Good luck! - string_id message = new string_id (c_stringFile, "s_33"); - utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_arena_referee_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Ready for your third opponent, %TU? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes. - if (response == "s_30") - { - //-- [NOTE] - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "bow3"); - - nym_arena_referee_action_spawnOpponent (player, npc); - - //-- NPC: Good luck! - string_id message = new string_id (c_stringFile, "s_31"); - utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_arena_referee_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Ready for your second opponent, %TU? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes. - if (response == "s_28") - { - //-- [NOTE] - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "applause_polite"); - - nym_arena_referee_action_spawnOpponent (player, npc); - - //-- NPC: Good luck! - string_id message = new string_id (c_stringFile, "s_29"); - utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_arena_referee_handleBranch11 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You must be %TU. Are you ready for your first fight? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes. - if (response == "s_22") - { - //-- [NOTE] - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "celebrate1"); - - nym_arena_referee_action_spawnOpponent (player, npc); - - //-- NPC: Good luck! - string_id message = new string_id (c_stringFile, "s_23"); - utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.nym_arena_referee"); - - 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.nym_arena_referee"); - - 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 (nym_arena_referee_condition_wave_event_active (player, npc)) - { - //-- NPC: The Arena is busy at the moment. Come back later. - string_id message = new string_id (c_stringFile, "s_20"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (nym_arena_referee_condition_hasCompletedArenaTask (player, npc)) - { - //-- NPC: Great show, %TU. That is all I have for you. - string_id message = new string_id (c_stringFile, "s_37"); - 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 (nym_arena_referee_condition_hasFifthAreanaTask (player, npc)) - { - //-- NPC: Ready for your final opponent, %TU? - string_id message = new string_id (c_stringFile, "s_24"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes. - boolean hasResponse0 = false; - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_34"); - - utils.setScriptVar (player, "conversation.nym_arena_referee.branchId", 3); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "nym_arena_referee", 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 (nym_arena_referee_condition_hasFourthArenaTask (player, npc)) - { - //-- NPC: Ready for your fourth opponent, %TU? - string_id message = new string_id (c_stringFile, "s_25"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes. - boolean hasResponse0 = false; - if (nym_arena_referee_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.nym_arena_referee.branchId", 5); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "nym_arena_referee", 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 (nym_arena_referee_condition_hasThirdArenaTask (player, npc)) - { - //-- NPC: Ready for your third opponent, %TU? - string_id message = new string_id (c_stringFile, "s_26"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes. - boolean hasResponse0 = false; - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_30"); - - utils.setScriptVar (player, "conversation.nym_arena_referee.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "nym_arena_referee", 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 (nym_arena_referee_condition_hasSecondArenaTask (player, npc)) - { - //-- NPC: Ready for your second opponent, %TU? - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes. - boolean hasResponse0 = false; - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_28"); - - utils.setScriptVar (player, "conversation.nym_arena_referee.branchId", 9); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "nym_arena_referee", 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 (nym_arena_referee_condition_hasFirstArenaTask (player, npc)) - { - //-- NPC: You must be %TU. Are you ready for your first fight? - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes. - boolean hasResponse0 = false; - if (nym_arena_referee_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_22"); - - utils.setScriptVar (player, "conversation.nym_arena_referee.branchId", 11); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "nym_arena_referee", 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 (nym_arena_referee_condition__defaultCondition (player, npc)) - { - //-- NPC: There is no %TU on my list of arena fighters. You're out of luck. - string_id message = new string_id (c_stringFile, "s_100"); - 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; - } - - 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 != "nym_arena_referee") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.nym_arena_referee.branchId"); - - if (branchId == 3 && nym_arena_referee_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && nym_arena_referee_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && nym_arena_referee_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && nym_arena_referee_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 11 && nym_arena_referee_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// nym_arena_referee.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/nym_arena_referee"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean nym_arena_referee_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean nym_arena_referee_condition_hasFirstArenaTask (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasFirstArenaFight"); +} + +// ---------------------------------------------------------------------- + +boolean nym_arena_referee_condition_hasSecondArenaTask (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasSecondArenaFight"); +} + +// ---------------------------------------------------------------------- + +boolean nym_arena_referee_condition_hasThirdArenaTask (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasThirdArenaFight"); +} + +// ---------------------------------------------------------------------- + +boolean nym_arena_referee_condition_hasFourthArenaTask (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasFourthArenaFight"); +} + +// ---------------------------------------------------------------------- + +boolean nym_arena_referee_condition_hasFifthAreanaTask (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasFifthArenaFight"); +} + +// ---------------------------------------------------------------------- + +boolean nym_arena_referee_condition_hasCompletedArenaTask (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasCompletedArenaForNym") + || groundquests.hasCompletedQuest(player, "u16_nym_themepark_nym_arena"); +} + +// ---------------------------------------------------------------------- + +boolean nym_arena_referee_condition_wave_event_active (obj_id player, obj_id npc) +{ + faceTo(npc, player); + int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); + return wave > 0; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void nym_arena_referee_action_spawnOpponent (obj_id player, obj_id npc) +{ + dictionary webster = new dictionary(); + webster.put("player", player); + messageTo(npc, "waveEventControllerNPCStart", webster, 0, false); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int nym_arena_referee_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Ready for your final opponent, %TU? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes. + if (response == "s_34") + { + //-- [NOTE] + if (nym_arena_referee_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "salute2"); + + nym_arena_referee_action_spawnOpponent (player, npc); + + //-- NPC: Good luck! + string_id message = new string_id (c_stringFile, "s_36"); + utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_arena_referee_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Ready for your fourth opponent, %TU? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes. + if (response == "s_32") + { + //-- [NOTE] + if (nym_arena_referee_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "clap_rousing"); + + nym_arena_referee_action_spawnOpponent (player, npc); + + //-- NPC: Good luck! + string_id message = new string_id (c_stringFile, "s_33"); + utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_arena_referee_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Ready for your third opponent, %TU? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes. + if (response == "s_30") + { + //-- [NOTE] + if (nym_arena_referee_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "bow3"); + + nym_arena_referee_action_spawnOpponent (player, npc); + + //-- NPC: Good luck! + string_id message = new string_id (c_stringFile, "s_31"); + utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_arena_referee_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Ready for your second opponent, %TU? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes. + if (response == "s_28") + { + //-- [NOTE] + if (nym_arena_referee_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "applause_polite"); + + nym_arena_referee_action_spawnOpponent (player, npc); + + //-- NPC: Good luck! + string_id message = new string_id (c_stringFile, "s_29"); + utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_arena_referee_handleBranch11 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You must be %TU. Are you ready for your first fight? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes. + if (response == "s_22") + { + //-- [NOTE] + if (nym_arena_referee_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "celebrate1"); + + nym_arena_referee_action_spawnOpponent (player, npc); + + //-- NPC: Good luck! + string_id message = new string_id (c_stringFile, "s_23"); + utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.nym_arena_referee"); + + 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.nym_arena_referee"); + + 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 (nym_arena_referee_condition_wave_event_active (player, npc)) + { + //-- NPC: The Arena is busy at the moment. Come back later. + string_id message = new string_id (c_stringFile, "s_20"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (nym_arena_referee_condition_hasCompletedArenaTask (player, npc)) + { + //-- NPC: Great show, %TU. That is all I have for you. + string_id message = new string_id (c_stringFile, "s_37"); + 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 (nym_arena_referee_condition_hasFifthAreanaTask (player, npc)) + { + //-- NPC: Ready for your final opponent, %TU? + string_id message = new string_id (c_stringFile, "s_24"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes. + boolean hasResponse0 = false; + if (nym_arena_referee_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_34"); + + utils.setScriptVar (player, "conversation.nym_arena_referee.branchId", 3); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "nym_arena_referee", 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 (nym_arena_referee_condition_hasFourthArenaTask (player, npc)) + { + //-- NPC: Ready for your fourth opponent, %TU? + string_id message = new string_id (c_stringFile, "s_25"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes. + boolean hasResponse0 = false; + if (nym_arena_referee_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.nym_arena_referee.branchId", 5); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "nym_arena_referee", 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 (nym_arena_referee_condition_hasThirdArenaTask (player, npc)) + { + //-- NPC: Ready for your third opponent, %TU? + string_id message = new string_id (c_stringFile, "s_26"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes. + boolean hasResponse0 = false; + if (nym_arena_referee_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_30"); + + utils.setScriptVar (player, "conversation.nym_arena_referee.branchId", 7); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "nym_arena_referee", 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 (nym_arena_referee_condition_hasSecondArenaTask (player, npc)) + { + //-- NPC: Ready for your second opponent, %TU? + string_id message = new string_id (c_stringFile, "s_27"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes. + boolean hasResponse0 = false; + if (nym_arena_referee_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_28"); + + utils.setScriptVar (player, "conversation.nym_arena_referee.branchId", 9); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "nym_arena_referee", 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 (nym_arena_referee_condition_hasFirstArenaTask (player, npc)) + { + //-- NPC: You must be %TU. Are you ready for your first fight? + string_id message = new string_id (c_stringFile, "s_21"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes. + boolean hasResponse0 = false; + if (nym_arena_referee_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_22"); + + utils.setScriptVar (player, "conversation.nym_arena_referee.branchId", 11); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "nym_arena_referee", 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 (nym_arena_referee_condition__defaultCondition (player, npc)) + { + //-- NPC: There is no %TU on my list of arena fighters. You're out of luck. + string_id message = new string_id (c_stringFile, "s_100"); + 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; + } + + 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 != "nym_arena_referee") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.nym_arena_referee.branchId"); + + if (branchId == 3 && nym_arena_referee_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && nym_arena_referee_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && nym_arena_referee_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && nym_arena_referee_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 11 && nym_arena_referee_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/nym_themepark_quatermaster.script b/sku.0/sys.server/compiled/game/script/conversation/nym_themepark_quatermaster.script index bb9e841e5..0202f2105 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/nym_themepark_quatermaster.script +++ b/sku.0/sys.server/compiled/game/script/conversation/nym_themepark_quatermaster.script @@ -1,1385 +1,1385 @@ -// ====================================================================== -// -// nym_themepark_quatermaster.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/nym_themepark_quatermaster"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean nym_themepark_quatermaster_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean nym_themepark_quatermaster_condition_isOnFirstQuest (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_parts_1", "findQuartermaster") - || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_1") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_smuggler_01")); -} - -// ---------------------------------------------------------------------- - -boolean nym_themepark_quatermaster_condition_isOnSecondQuest (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_parts_2", "goQuartermaster") - || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_2") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_under_pressure")); -} - -// ---------------------------------------------------------------------- - -boolean nym_themepark_quatermaster_condition_isOnThridQuest (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_parts_3", "goQuartermasterAgain") - || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_3") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_save_agent")); -} - -// ---------------------------------------------------------------------- - -boolean nym_themepark_quatermaster_condition_isAlmostDone (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_safe", "backQuartermaster") - || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_safe") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_repair_flocculation_chamber")); -} - -// ---------------------------------------------------------------------- - -boolean nym_themepark_quatermaster_condition_hasFailedDelivery (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_save_agent_fail", "returnRaliaFail"); -} - -// ---------------------------------------------------------------------- - -boolean nym_themepark_quatermaster_condition_hasSmugglerQuestNotComplete (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_smuggler_01"); -} - -// ---------------------------------------------------------------------- - -boolean nym_themepark_quatermaster_condition_hasAgentQuestNotComplete (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_save_agent"); -} - -// ---------------------------------------------------------------------- - -boolean nym_themepark_quatermaster_condition_hasPressureQuestNotComplete (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_under_pressure"); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void nym_themepark_quatermaster_action_signalFirstJumperQuestDone (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundQuartermaster"); -} - -// ---------------------------------------------------------------------- - -void nym_themepark_quatermaster_action_signalSecondJumperQuestDone (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasGoneQuartermaster"); -} - -// ---------------------------------------------------------------------- - -void nym_themepark_quatermaster_action_signalAgentSafe (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasGoneBackQuartermaster"); -} - -// ---------------------------------------------------------------------- - -void nym_themepark_quatermaster_action_grantSmugglerQuest (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_smuggler_01"); -} - -// ---------------------------------------------------------------------- - -void nym_themepark_quatermaster_action_grantAgentQuest (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_save_agent"); -} - -// ---------------------------------------------------------------------- - -void nym_themepark_quatermaster_action_grantPressureQuest (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_under_pressure"); -} - -// ---------------------------------------------------------------------- - -void nym_themepark_quatermaster_action_sendPlayerToFixChamber (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_repair_flocculation_chamber"); -} - -// ---------------------------------------------------------------------- - -void nym_themepark_quatermaster_action_clearDeliveryFailQuest (obj_id player, obj_id npc) -{ - groundquests.clearQuest(player, "u16_nym_themepark_save_agent_fail"); - groundquests.clearQuest(player, "u16_nym_themepark_save_agent"); - nym_themepark_quatermaster_action_grantAgentQuest(player, npc); -} - -// ---------------------------------------------------------------------- - -void nym_themepark_quatermaster_action_signalThirdJumperQuestDone (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasGoneQuartermasterAgain"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int nym_themepark_quatermaster_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I just heard from Rei and it was a close thing but the supplies made it to him in time. I owe you my thanks. - - //-- [RESPONSE NOTE] - //-- PLAYER: That's what he said. The thanks is welcome but the part would be more so... - if (response == "s_17") - { - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "thank"); - - nym_themepark_quatermaster_action_sendPlayerToFixChamber (player, npc); - - //-- NPC: Oh! Yes, of course, of course! Here it is. Tell Phor that I am looking forward to a cold glass and a bath; not necessarily in that order. - string_id message = new string_id (c_stringFile, "s_18"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_themepark_quatermaster_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I just heard from Rei and he's still waiting! What are you doing back here?! - - //-- [RESPONSE NOTE] - //-- PLAYER: I didn't make it in time and the supplies expired. - if (response == "s_20") - { - doAnimationAction (player, "shake_head_disgust"); - - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_down"); - - nym_themepark_quatermaster_action_clearDeliveryFailQuest (player, npc); - - //-- NPC: Here are some more; you need to move faster this time! - string_id message = new string_id (c_stringFile, "s_21"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_themepark_quatermaster_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: What are you still doing here?! - - //-- [RESPONSE NOTE] - //-- PLAYER: I... um... I... - if (response == "s_74") - { - doAnimationAction (player, "taken_aback"); - - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_away"); - - //-- NPC: You're wasting time you don't have, now GO! - string_id message = new string_id (c_stringFile, "s_75"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_themepark_quatermaster_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Oh for Nym's sake, what now?! - - //-- [RESPONSE NOTE] - //-- PLAYER: Motor Power Regulator. I need one. - if (response == "s_15") - { - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "wave_finger_warning"); - - //-- NPC: Hold that thought, I'm getting a comm... - string_id message = new string_id (c_stringFile, "s_23"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sure, take your time, it's not like anyone's dying of thirst or anything... - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_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_46"); - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_themepark_quatermaster_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Hold that thought, I'm getting a comm... - - //-- [RESPONSE NOTE] - //-- PLAYER: Sure, take your time, it's not like anyone's dying of thirst or anything... - if (response == "s_46") - { - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: Well for once, I'm glad to see you. That was from one of our field agents and a clanmate of mine. He's been injured and needs help. - string_id message = new string_id (c_stringFile, "s_47"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: So I forget about the thirsty people and rush to help this guy? - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_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.nym_themepark_quatermaster.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_themepark_quatermaster_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Well for once, I'm glad to see you. That was from one of our field agents and a clanmate of mine. He's been injured and needs help. - - //-- [RESPONSE NOTE] - //-- PLAYER: So I forget about the thirsty people and rush to help this guy? - if (response == "s_48") - { - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - //-- NPC: Look, I've got the part you need, but Rei needs help NOW! I need you to rush these medical supplies to him. Hurry, they have an exceptionally short viability in this environment! - string_id message = new string_id (c_stringFile, "s_49"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Okay, okay, hand over the supplies and point the way. - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_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.nym_themepark_quatermaster.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_themepark_quatermaster_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Look, I've got the part you need, but Rei needs help NOW! I need you to rush these medical supplies to him. Hurry, they have an exceptionally short viability in this environment! - - //-- [RESPONSE NOTE] - //-- PLAYER: Okay, okay, hand over the supplies and point the way. - if (response == "s_50") - { - doAnimationAction (player, "taken_aback"); - - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_away"); - - nym_themepark_quatermaster_action_grantAgentQuest (player, npc); - - //-- NPC: Already in your datapad, now please hurry! - string_id message = new string_id (c_stringFile, "s_51"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_themepark_quatermaster_handleBranch12 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Couldn't take the pressure, eh? - - //-- [RESPONSE NOTE] - //-- PLAYER: That was bad. No just taking a break. - if (response == "s_71") - { - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "tap_foot"); - - //-- NPC: Hope you're not getting thirsty... - string_id message = new string_id (c_stringFile, "s_72"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_themepark_quatermaster_handleBranch14 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Back again? Need more chemicals? - - //-- [RESPONSE NOTE] - //-- PLAYER: No chemicals; Flow Control Valves, this time. - if (response == "s_36") - { - doAnimationAction (player, "shake_head_no"); - - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "rub_chin_thoughtful"); - - //-- NPC: Huh, I don't have anything like that, sorry. I do know where you might get some but it may be risky... - string_id message = new string_id (c_stringFile, "s_38"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: And where's that? - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_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.nym_themepark_quatermaster.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_themepark_quatermaster_handleBranch15 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Huh, I don't have anything like that, sorry. I do know where you might get some but it may be risky... - - //-- [RESPONSE NOTE] - //-- PLAYER: And where's that? - if (response == "s_40") - { - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - //-- NPC: There is a Pressurized Liquid Storage Unit not too far from here that is sure to have the valves you need... - string_id message = new string_id (c_stringFile, "s_42"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: And how is that risky? - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_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_44"); - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_themepark_quatermaster_handleBranch16 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: There is a Pressurized Liquid Storage Unit not too far from here that is sure to have the valves you need... - - //-- [RESPONSE NOTE] - //-- PLAYER: And how is that risky? - if (response == "s_44") - { - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: Well, it IS pressurized, after all... remove the flow control valves or tamper with it in any way and the whole thing might go boom! - string_id message = new string_id (c_stringFile, "s_52"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'll be careful... - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_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_54"); - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_themepark_quatermaster_handleBranch17 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Well, it IS pressurized, after all... remove the flow control valves or tamper with it in any way and the whole thing might go boom! - - //-- [RESPONSE NOTE] - //-- PLAYER: I'll be careful... - if (response == "s_54") - { - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - nym_themepark_quatermaster_action_grantPressureQuest (player, npc); - - //-- NPC: You'll be dead, but it's your funeral. Here's the location. - string_id message = new string_id (c_stringFile, "s_56"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_themepark_quatermaster_handleBranch19 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I doubt you've been all the way out to Mt. Chaolt already... - - //-- [RESPONSE NOTE] - //-- PLAYER: Yeah, just going there now. - if (response == "s_68") - { - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "tap_foot"); - - //-- NPC: Of course. - string_id message = new string_id (c_stringFile, "s_69"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_themepark_quatermaster_handleBranch21 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: What? Can't you see I'm busy? - - //-- [RESPONSE NOTE] - //-- PLAYER: I've come to ask about a requisition for supplies. - if (response == "s_63") - { - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - //-- NPC: Well, that's what a Quartermaster is for, after all. But I'm afriad that I don't have much on-hand. What do you need? - string_id message = new string_id (c_stringFile, "s_65"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Nym's Water Treatment Technician needs Cationic Chemical Coagulant. - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_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_76"); - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_themepark_quatermaster_handleBranch22 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Well, that's what a Quartermaster is for, after all. But I'm afriad that I don't have much on-hand. What do you need? - - //-- [RESPONSE NOTE] - //-- PLAYER: Nym's Water Treatment Technician needs Cationic Chemical Coagulant. - if (response == "s_76") - { - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "rub_chin_thoughtful"); - - //-- NPC: Hmm... clean water would be nice for a change. Tell you what, I don't have it, but I know someone who owes Nym a favor who does. - string_id message = new string_id (c_stringFile, "s_78"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Just tell me who and where. - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_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_80"); - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int nym_themepark_quatermaster_handleBranch23 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Hmm... clean water would be nice for a change. Tell you what, I don't have it, but I know someone who owes Nym a favor who does. - - //-- [RESPONSE NOTE] - //-- PLAYER: Just tell me who and where. - if (response == "s_80") - { - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - nym_themepark_quatermaster_action_grantSmugglerQuest (player, npc); - - //-- NPC: Here's the location to a Smuggler by the name of Dak. I'm afraid he's way out by Mt. Chaolt... - string_id message = new string_id (c_stringFile, "s_82"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.nym_themepark_quatermaster"); - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; -} - -trigger OnAttach () -{ - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - 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.nym_themepark_quatermaster"); - - 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 (nym_themepark_quatermaster_condition_isAlmostDone (player, npc)) - { - doAnimationAction (npc, "celebrate"); - - nym_themepark_quatermaster_action_signalAgentSafe (player, npc); - - //-- NPC: I just heard from Rei and it was a close thing but the supplies made it to him in time. I owe you my thanks. - string_id message = new string_id (c_stringFile, "s_16"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: That's what he said. The thanks is welcome but the part would be more so... - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_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.nym_themepark_quatermaster.branchId", 1); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (nym_themepark_quatermaster_condition_hasFailedDelivery (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - //-- NPC: I just heard from Rei and he's still waiting! What are you doing back here?! - string_id message = new string_id (c_stringFile, "s_19"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I didn't make it in time and the supplies expired. - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_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_20"); - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 3); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (nym_themepark_quatermaster_condition_hasAgentQuestNotComplete (player, npc)) - { - doAnimationAction (npc, "point_accusingly"); - - //-- NPC: What are you still doing here?! - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I... um... I... - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_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_74"); - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 5); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (nym_themepark_quatermaster_condition_isOnThridQuest (player, npc)) - { - doAnimationAction (npc, "tap_foot"); - - nym_themepark_quatermaster_action_signalThirdJumperQuestDone (player, npc); - - //-- NPC: Oh for Nym's sake, what now?! - string_id message = new string_id (c_stringFile, "s_13"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Motor Power Regulator. I need one. - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_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_15"); - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 7); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (nym_themepark_quatermaster_condition_hasPressureQuestNotComplete (player, npc)) - { - doAnimationAction (npc, "cover_mouth"); - - //-- NPC: Couldn't take the pressure, eh? - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: That was bad. No just taking a break. - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_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_71"); - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 12); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (nym_themepark_quatermaster_condition_isOnSecondQuest (player, npc)) - { - nym_themepark_quatermaster_action_signalSecondJumperQuestDone (player, npc); - - //-- NPC: Back again? Need more chemicals? - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: No chemicals; Flow Control Valves, this time. - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_36"); - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 14); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (nym_themepark_quatermaster_condition_hasSmugglerQuestNotComplete (player, npc)) - { - doAnimationAction (npc, "tap_foot"); - - //-- NPC: I doubt you've been all the way out to Mt. Chaolt already... - string_id message = new string_id (c_stringFile, "s_67"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yeah, just going there now. - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_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_68"); - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 19); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (nym_themepark_quatermaster_condition_isOnFirstQuest (player, npc)) - { - doAnimationAction (npc, "tap_foot"); - - nym_themepark_quatermaster_action_signalFirstJumperQuestDone (player, npc); - - //-- NPC: What? Can't you see I'm busy? - string_id message = new string_id (c_stringFile, "s_61"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I've come to ask about a requisition for supplies. - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_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_63"); - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 21); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_away"); - - //-- NPC: I'm too busy for idle chit-chat. Go talk to someone in the Stronghold proper. - string_id message = new string_id (c_stringFile, "s_84"); - 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 != "nym_themepark_quatermaster") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - if (branchId == 1 && nym_themepark_quatermaster_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && nym_themepark_quatermaster_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && nym_themepark_quatermaster_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && nym_themepark_quatermaster_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && nym_themepark_quatermaster_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && nym_themepark_quatermaster_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && nym_themepark_quatermaster_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 12 && nym_themepark_quatermaster_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 14 && nym_themepark_quatermaster_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 15 && nym_themepark_quatermaster_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 16 && nym_themepark_quatermaster_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 17 && nym_themepark_quatermaster_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 19 && nym_themepark_quatermaster_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 21 && nym_themepark_quatermaster_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 22 && nym_themepark_quatermaster_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 23 && nym_themepark_quatermaster_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// nym_themepark_quatermaster.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/nym_themepark_quatermaster"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean nym_themepark_quatermaster_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean nym_themepark_quatermaster_condition_isOnFirstQuest (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_themepark_parts_1", "findQuartermaster") + || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_1") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_smuggler_01")); +} + +// ---------------------------------------------------------------------- + +boolean nym_themepark_quatermaster_condition_isOnSecondQuest (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_themepark_parts_2", "goQuartermaster") + || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_2") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_under_pressure")); +} + +// ---------------------------------------------------------------------- + +boolean nym_themepark_quatermaster_condition_isOnThridQuest (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_themepark_parts_3", "goQuartermasterAgain") + || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_3") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_save_agent")); +} + +// ---------------------------------------------------------------------- + +boolean nym_themepark_quatermaster_condition_isAlmostDone (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_themepark_safe", "backQuartermaster") + || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_safe") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_repair_flocculation_chamber")); +} + +// ---------------------------------------------------------------------- + +boolean nym_themepark_quatermaster_condition_hasFailedDelivery (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_themepark_save_agent_fail", "returnRaliaFail"); +} + +// ---------------------------------------------------------------------- + +boolean nym_themepark_quatermaster_condition_hasSmugglerQuestNotComplete (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "u16_nym_themepark_smuggler_01"); +} + +// ---------------------------------------------------------------------- + +boolean nym_themepark_quatermaster_condition_hasAgentQuestNotComplete (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "u16_nym_themepark_save_agent"); +} + +// ---------------------------------------------------------------------- + +boolean nym_themepark_quatermaster_condition_hasPressureQuestNotComplete (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "u16_nym_themepark_under_pressure"); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void nym_themepark_quatermaster_action_signalFirstJumperQuestDone (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundQuartermaster"); +} + +// ---------------------------------------------------------------------- + +void nym_themepark_quatermaster_action_signalSecondJumperQuestDone (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasGoneQuartermaster"); +} + +// ---------------------------------------------------------------------- + +void nym_themepark_quatermaster_action_signalAgentSafe (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasGoneBackQuartermaster"); +} + +// ---------------------------------------------------------------------- + +void nym_themepark_quatermaster_action_grantSmugglerQuest (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_smuggler_01"); +} + +// ---------------------------------------------------------------------- + +void nym_themepark_quatermaster_action_grantAgentQuest (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_save_agent"); +} + +// ---------------------------------------------------------------------- + +void nym_themepark_quatermaster_action_grantPressureQuest (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_under_pressure"); +} + +// ---------------------------------------------------------------------- + +void nym_themepark_quatermaster_action_sendPlayerToFixChamber (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_repair_flocculation_chamber"); +} + +// ---------------------------------------------------------------------- + +void nym_themepark_quatermaster_action_clearDeliveryFailQuest (obj_id player, obj_id npc) +{ + groundquests.clearQuest(player, "u16_nym_themepark_save_agent_fail"); + groundquests.clearQuest(player, "u16_nym_themepark_save_agent"); + nym_themepark_quatermaster_action_grantAgentQuest(player, npc); +} + +// ---------------------------------------------------------------------- + +void nym_themepark_quatermaster_action_signalThirdJumperQuestDone (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasGoneQuartermasterAgain"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int nym_themepark_quatermaster_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I just heard from Rei and it was a close thing but the supplies made it to him in time. I owe you my thanks. + + //-- [RESPONSE NOTE] + //-- PLAYER: That's what he said. The thanks is welcome but the part would be more so... + if (response == "s_17") + { + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "thank"); + + nym_themepark_quatermaster_action_sendPlayerToFixChamber (player, npc); + + //-- NPC: Oh! Yes, of course, of course! Here it is. Tell Phor that I am looking forward to a cold glass and a bath; not necessarily in that order. + string_id message = new string_id (c_stringFile, "s_18"); + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_themepark_quatermaster_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I just heard from Rei and he's still waiting! What are you doing back here?! + + //-- [RESPONSE NOTE] + //-- PLAYER: I didn't make it in time and the supplies expired. + if (response == "s_20") + { + doAnimationAction (player, "shake_head_disgust"); + + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "point_down"); + + nym_themepark_quatermaster_action_clearDeliveryFailQuest (player, npc); + + //-- NPC: Here are some more; you need to move faster this time! + string_id message = new string_id (c_stringFile, "s_21"); + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_themepark_quatermaster_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: What are you still doing here?! + + //-- [RESPONSE NOTE] + //-- PLAYER: I... um... I... + if (response == "s_74") + { + doAnimationAction (player, "taken_aback"); + + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "point_away"); + + //-- NPC: You're wasting time you don't have, now GO! + string_id message = new string_id (c_stringFile, "s_75"); + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_themepark_quatermaster_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Oh for Nym's sake, what now?! + + //-- [RESPONSE NOTE] + //-- PLAYER: Motor Power Regulator. I need one. + if (response == "s_15") + { + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "wave_finger_warning"); + + //-- NPC: Hold that thought, I'm getting a comm... + string_id message = new string_id (c_stringFile, "s_23"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sure, take your time, it's not like anyone's dying of thirst or anything... + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_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_46"); + + utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 8); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_themepark_quatermaster_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Hold that thought, I'm getting a comm... + + //-- [RESPONSE NOTE] + //-- PLAYER: Sure, take your time, it's not like anyone's dying of thirst or anything... + if (response == "s_46") + { + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: Well for once, I'm glad to see you. That was from one of our field agents and a clanmate of mine. He's been injured and needs help. + string_id message = new string_id (c_stringFile, "s_47"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: So I forget about the thirsty people and rush to help this guy? + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_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.nym_themepark_quatermaster.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_themepark_quatermaster_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Well for once, I'm glad to see you. That was from one of our field agents and a clanmate of mine. He's been injured and needs help. + + //-- [RESPONSE NOTE] + //-- PLAYER: So I forget about the thirsty people and rush to help this guy? + if (response == "s_48") + { + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "gesticulate_wildly"); + + //-- NPC: Look, I've got the part you need, but Rei needs help NOW! I need you to rush these medical supplies to him. Hurry, they have an exceptionally short viability in this environment! + string_id message = new string_id (c_stringFile, "s_49"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Okay, okay, hand over the supplies and point the way. + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_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.nym_themepark_quatermaster.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_themepark_quatermaster_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Look, I've got the part you need, but Rei needs help NOW! I need you to rush these medical supplies to him. Hurry, they have an exceptionally short viability in this environment! + + //-- [RESPONSE NOTE] + //-- PLAYER: Okay, okay, hand over the supplies and point the way. + if (response == "s_50") + { + doAnimationAction (player, "taken_aback"); + + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "point_away"); + + nym_themepark_quatermaster_action_grantAgentQuest (player, npc); + + //-- NPC: Already in your datapad, now please hurry! + string_id message = new string_id (c_stringFile, "s_51"); + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_themepark_quatermaster_handleBranch12 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Couldn't take the pressure, eh? + + //-- [RESPONSE NOTE] + //-- PLAYER: That was bad. No just taking a break. + if (response == "s_71") + { + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "tap_foot"); + + //-- NPC: Hope you're not getting thirsty... + string_id message = new string_id (c_stringFile, "s_72"); + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_themepark_quatermaster_handleBranch14 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Back again? Need more chemicals? + + //-- [RESPONSE NOTE] + //-- PLAYER: No chemicals; Flow Control Valves, this time. + if (response == "s_36") + { + doAnimationAction (player, "shake_head_no"); + + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "rub_chin_thoughtful"); + + //-- NPC: Huh, I don't have anything like that, sorry. I do know where you might get some but it may be risky... + string_id message = new string_id (c_stringFile, "s_38"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: And where's that? + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_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.nym_themepark_quatermaster.branchId", 15); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_themepark_quatermaster_handleBranch15 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Huh, I don't have anything like that, sorry. I do know where you might get some but it may be risky... + + //-- [RESPONSE NOTE] + //-- PLAYER: And where's that? + if (response == "s_40") + { + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + //-- NPC: There is a Pressurized Liquid Storage Unit not too far from here that is sure to have the valves you need... + string_id message = new string_id (c_stringFile, "s_42"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: And how is that risky? + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_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_44"); + + utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_themepark_quatermaster_handleBranch16 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: There is a Pressurized Liquid Storage Unit not too far from here that is sure to have the valves you need... + + //-- [RESPONSE NOTE] + //-- PLAYER: And how is that risky? + if (response == "s_44") + { + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: Well, it IS pressurized, after all... remove the flow control valves or tamper with it in any way and the whole thing might go boom! + string_id message = new string_id (c_stringFile, "s_52"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'll be careful... + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_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_54"); + + utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 17); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_themepark_quatermaster_handleBranch17 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Well, it IS pressurized, after all... remove the flow control valves or tamper with it in any way and the whole thing might go boom! + + //-- [RESPONSE NOTE] + //-- PLAYER: I'll be careful... + if (response == "s_54") + { + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + nym_themepark_quatermaster_action_grantPressureQuest (player, npc); + + //-- NPC: You'll be dead, but it's your funeral. Here's the location. + string_id message = new string_id (c_stringFile, "s_56"); + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_themepark_quatermaster_handleBranch19 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I doubt you've been all the way out to Mt. Chaolt already... + + //-- [RESPONSE NOTE] + //-- PLAYER: Yeah, just going there now. + if (response == "s_68") + { + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "tap_foot"); + + //-- NPC: Of course. + string_id message = new string_id (c_stringFile, "s_69"); + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_themepark_quatermaster_handleBranch21 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: What? Can't you see I'm busy? + + //-- [RESPONSE NOTE] + //-- PLAYER: I've come to ask about a requisition for supplies. + if (response == "s_63") + { + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + //-- NPC: Well, that's what a Quartermaster is for, after all. But I'm afriad that I don't have much on-hand. What do you need? + string_id message = new string_id (c_stringFile, "s_65"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Nym's Water Treatment Technician needs Cationic Chemical Coagulant. + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_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_76"); + + utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 22); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_themepark_quatermaster_handleBranch22 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Well, that's what a Quartermaster is for, after all. But I'm afriad that I don't have much on-hand. What do you need? + + //-- [RESPONSE NOTE] + //-- PLAYER: Nym's Water Treatment Technician needs Cationic Chemical Coagulant. + if (response == "s_76") + { + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "rub_chin_thoughtful"); + + //-- NPC: Hmm... clean water would be nice for a change. Tell you what, I don't have it, but I know someone who owes Nym a favor who does. + string_id message = new string_id (c_stringFile, "s_78"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Just tell me who and where. + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_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_80"); + + utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 23); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int nym_themepark_quatermaster_handleBranch23 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Hmm... clean water would be nice for a change. Tell you what, I don't have it, but I know someone who owes Nym a favor who does. + + //-- [RESPONSE NOTE] + //-- PLAYER: Just tell me who and where. + if (response == "s_80") + { + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + nym_themepark_quatermaster_action_grantSmugglerQuest (player, npc); + + //-- NPC: Here's the location to a Smuggler by the name of Dak. I'm afraid he's way out by Mt. Chaolt... + string_id message = new string_id (c_stringFile, "s_82"); + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.nym_themepark_quatermaster"); + + setCondition (self, CONDITION_CONVERSABLE); + setCondition( self, CONDITION_INTERESTING ); + + return SCRIPT_CONTINUE; +} + +trigger OnAttach () +{ + setCondition (self, CONDITION_CONVERSABLE); + setCondition( self, CONDITION_INTERESTING ); + + 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.nym_themepark_quatermaster"); + + 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 (nym_themepark_quatermaster_condition_isAlmostDone (player, npc)) + { + doAnimationAction (npc, "celebrate"); + + nym_themepark_quatermaster_action_signalAgentSafe (player, npc); + + //-- NPC: I just heard from Rei and it was a close thing but the supplies made it to him in time. I owe you my thanks. + string_id message = new string_id (c_stringFile, "s_16"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: That's what he said. The thanks is welcome but the part would be more so... + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_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.nym_themepark_quatermaster.branchId", 1); + + npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (nym_themepark_quatermaster_condition_hasFailedDelivery (player, npc)) + { + doAnimationAction (npc, "gesticulate_wildly"); + + //-- NPC: I just heard from Rei and he's still waiting! What are you doing back here?! + string_id message = new string_id (c_stringFile, "s_19"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I didn't make it in time and the supplies expired. + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_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_20"); + + utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 3); + + npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (nym_themepark_quatermaster_condition_hasAgentQuestNotComplete (player, npc)) + { + doAnimationAction (npc, "point_accusingly"); + + //-- NPC: What are you still doing here?! + string_id message = new string_id (c_stringFile, "s_73"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I... um... I... + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_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_74"); + + utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 5); + + npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (nym_themepark_quatermaster_condition_isOnThridQuest (player, npc)) + { + doAnimationAction (npc, "tap_foot"); + + nym_themepark_quatermaster_action_signalThirdJumperQuestDone (player, npc); + + //-- NPC: Oh for Nym's sake, what now?! + string_id message = new string_id (c_stringFile, "s_13"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Motor Power Regulator. I need one. + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_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_15"); + + utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 7); + + npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (nym_themepark_quatermaster_condition_hasPressureQuestNotComplete (player, npc)) + { + doAnimationAction (npc, "cover_mouth"); + + //-- NPC: Couldn't take the pressure, eh? + string_id message = new string_id (c_stringFile, "s_70"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: That was bad. No just taking a break. + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_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_71"); + + utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 12); + + npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (nym_themepark_quatermaster_condition_isOnSecondQuest (player, npc)) + { + nym_themepark_quatermaster_action_signalSecondJumperQuestDone (player, npc); + + //-- NPC: Back again? Need more chemicals? + string_id message = new string_id (c_stringFile, "s_34"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: No chemicals; Flow Control Valves, this time. + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_36"); + + utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 14); + + npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (nym_themepark_quatermaster_condition_hasSmugglerQuestNotComplete (player, npc)) + { + doAnimationAction (npc, "tap_foot"); + + //-- NPC: I doubt you've been all the way out to Mt. Chaolt already... + string_id message = new string_id (c_stringFile, "s_67"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yeah, just going there now. + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_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_68"); + + utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 19); + + npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (nym_themepark_quatermaster_condition_isOnFirstQuest (player, npc)) + { + doAnimationAction (npc, "tap_foot"); + + nym_themepark_quatermaster_action_signalFirstJumperQuestDone (player, npc); + + //-- NPC: What? Can't you see I'm busy? + string_id message = new string_id (c_stringFile, "s_61"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I've come to ask about a requisition for supplies. + boolean hasResponse0 = false; + if (nym_themepark_quatermaster_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_63"); + + utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 21); + + npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "point_away"); + + //-- NPC: I'm too busy for idle chit-chat. Go talk to someone in the Stronghold proper. + string_id message = new string_id (c_stringFile, "s_84"); + 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 != "nym_themepark_quatermaster") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + if (branchId == 1 && nym_themepark_quatermaster_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && nym_themepark_quatermaster_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && nym_themepark_quatermaster_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && nym_themepark_quatermaster_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && nym_themepark_quatermaster_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && nym_themepark_quatermaster_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && nym_themepark_quatermaster_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 12 && nym_themepark_quatermaster_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 14 && nym_themepark_quatermaster_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 15 && nym_themepark_quatermaster_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 16 && nym_themepark_quatermaster_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 17 && nym_themepark_quatermaster_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 19 && nym_themepark_quatermaster_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 21 && nym_themepark_quatermaster_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 22 && nym_themepark_quatermaster_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 23 && nym_themepark_quatermaster_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/radio_delivery_deathtrooper_conversation.script b/sku.0/sys.server/compiled/game/script/conversation/radio_delivery_deathtrooper_conversation.script index 4c8299908..b3796f72f 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/radio_delivery_deathtrooper_conversation.script +++ b/sku.0/sys.server/compiled/game/script/conversation/radio_delivery_deathtrooper_conversation.script @@ -1,1452 +1,1452 @@ -// ====================================================================== -// -// radio_delivery_deathtrooper_conversation.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.features; -include library.groundquests; -include library.space_quest; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/radio_delivery_deathtrooper_conversation"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean radio_delivery_deathtrooper_conversation_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean radio_delivery_deathtrooper_conversation_condition_hasDeliveryQuestActive (obj_id player, obj_id npc) -{ - boolean returnVal = false; - - for(int i = 1; i <= 3; i++) - { - if(groundquests.isTaskActive(player, "outbreak_radio_delivery_0"+i, "findCamp") - || groundquests.isTaskActive(player, "outbreak_radio_delivery_0"+i, "hiddenSearchArea") - || groundquests.isTaskActive(player, "outbreak_radio_delivery_0"+i, "findBossInCharge") - || groundquests.isTaskActive(player, "outbreak_radio_delivery_0"+i, "goodWork")) - { - returnVal = true; - } - if(i == 3 && !returnVal) - { - if(groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "findEpsilonContact") - || groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "comGoodWork2")) - returnVal = true; - } - } - return returnVal; -} - -// ---------------------------------------------------------------------- - -boolean radio_delivery_deathtrooper_conversation_condition_hasRadioQuest1Complete (obj_id player, obj_id npc) -{ - return groundquests.hasCompletedQuest(player, "outbreak_radio_delivery_01"); -} - -// ---------------------------------------------------------------------- - -boolean radio_delivery_deathtrooper_conversation_condition_hasNeverSpoken (obj_id player, obj_id npc) -{ - return !groundquests.isQuestActiveOrComplete(player, "outbreak_radio_delivery_01"); -} - -// ---------------------------------------------------------------------- - -boolean radio_delivery_deathtrooper_conversation_condition_hasRadioOneDelivered (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "outbreak_radio_delivery_01", "talkToMaris"); -} - -// ---------------------------------------------------------------------- - -boolean radio_delivery_deathtrooper_conversation_condition_hasRadioTwoDelivered (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "outbreak_radio_delivery_02", "talkToMaris"); -} - -// ---------------------------------------------------------------------- - -boolean radio_delivery_deathtrooper_conversation_condition_hasRadioQuest2Complete (obj_id player, obj_id npc) -{ - return groundquests.hasCompletedQuest(player, "outbreak_radio_delivery_02"); -} - -// ---------------------------------------------------------------------- - -boolean radio_delivery_deathtrooper_conversation_condition_noAntiVirus (obj_id player, obj_id npc) -{ - return !groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") - && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") - && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral"); -} - -// ---------------------------------------------------------------------- - -boolean radio_delivery_deathtrooper_conversation_condition_hasLastRadiosDelivered (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "talkToMaris"); -} - -// ---------------------------------------------------------------------- - -boolean radio_delivery_deathtrooper_conversation_condition_hasCompletedAll (obj_id player, obj_id npc) -{ - return groundquests.hasCompletedQuest(player, "outbreak_radio_delivery_03"); -} - -// ---------------------------------------------------------------------- - -boolean radio_delivery_deathtrooper_conversation_condition_hasHelmet (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "outbreak_bomber_helmet_hidden_content", "hasHelmet"); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void radio_delivery_deathtrooper_conversation_action_giveFirstDeliveryQuest (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_radio_delivery_01"); -} - -// ---------------------------------------------------------------------- - -void radio_delivery_deathtrooper_conversation_action_deliveryOneCompleted (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "spokenToZebMaris"); -} - -// ---------------------------------------------------------------------- - -void radio_delivery_deathtrooper_conversation_action_giveSecondDeliveryQuest (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_radio_delivery_02"); -} - -// ---------------------------------------------------------------------- - -void radio_delivery_deathtrooper_conversation_action_giveThirdDeliveryQuest (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "outbreak_radio_delivery_03"); -} - -// ---------------------------------------------------------------------- - -void radio_delivery_deathtrooper_conversation_action_deliverTwoCompleted (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "spokenToZebMarisGamma"); -} - -// ---------------------------------------------------------------------- - -void radio_delivery_deathtrooper_conversation_action_deliverThreeCompleted (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "spokenToZebMarisDelta"); -} - -// ---------------------------------------------------------------------- - -void radio_delivery_deathtrooper_conversation_action_hasDeliveredHelmet (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasDeliveredHelmet"); - if(!hasCompletedCollectionSlot(player, "hidden_content_tie_helmet")) - { - modifyCollectionSlotValue(player, "hidden_content_tie_helmet", 1); - } -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int radio_delivery_deathtrooper_conversation_handleBranch1 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Hello. - - //-- [RESPONSE NOTE] - //-- PLAYER: I have something for you. - if (response == "s_92") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "celebrate1"); - - radio_delivery_deathtrooper_conversation_action_hasDeliveredHelmet (player, npc); - - //-- NPC: My helmet? Where did you find it. This is the best thing to happen since this nightmare started! Thank you, %TU! - string_id message = new string_id (c_stringFile, "s_93"); - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Well, well. You did it. I guess I am a few thousand credits poorer, but it'll be worth it if we can save a few lives and coordinate supply drops. - - //-- [RESPONSE NOTE] - //-- PLAYER: You seem a little to altruistic for an Imperial. - if (response == "s_71") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - radio_delivery_deathtrooper_conversation_action_deliverThreeCompleted (player, npc); - - //-- NPC: And you seem to care a lot about your credits or you wouldn't have come back. Good luck to you. - string_id message = new string_id (c_stringFile, "s_72"); - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: I don't want your credits. I just came back to see the look on your face. - if (response == "s_73") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - radio_delivery_deathtrooper_conversation_action_deliverThreeCompleted (player, npc); - - //-- NPC: Well, too bad...you get the credits anyway. I don't plan on using them...maybe you can. - string_id message = new string_id (c_stringFile, "s_74"); - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: That is 2 for 2. You are really doing better than I expected. - - //-- [RESPONSE NOTE] - //-- PLAYER: Thanks for the vote of confidence. - if (response == "s_41") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - //-- NPC: I'll tell you what. I'll give you the last two radios I have. Unfortunately I only have one other location that I know of, so you are on your own for finding the last camp. Trig Longo thinks it is in the research and prison facility...but I don't think anyone would have lived at that location long after the virus outbreak. - string_id message = new string_id (c_stringFile, "s_53"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: So I don't have to come back here again? Great! - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_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_64"); - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I'll tell you what. I'll give you the last two radios I have. Unfortunately I only have one other location that I know of, so you are on your own for finding the last camp. Trig Longo thinks it is in the research and prison facility...but I don't think anyone would have lived at that location long after the virus outbreak. - - //-- [RESPONSE NOTE] - //-- PLAYER: So I don't have to come back here again? Great! - if (response == "s_64") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - //-- NPC: Oh you don't have to, but if you want to be paid, then yeah...you might want to come back. - string_id message = new string_id (c_stringFile, "s_65"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: ... - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_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_66"); - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Oh you don't have to, but if you want to be paid, then yeah...you might want to come back. - - //-- [RESPONSE NOTE] - //-- PLAYER: ... - if (response == "s_66") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - radio_delivery_deathtrooper_conversation_action_giveThirdDeliveryQuest (player, npc); - - //-- NPC: Here is the last location I know of. Happy hunting. - string_id message = new string_id (c_stringFile, "s_67"); - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch13 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: So you ready to deliver more radios? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes. - if (response == "s_55") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - //-- NPC: Okay your next location is Camp Gamma. It should be North West of here. - string_id message = new string_id (c_stringFile, "s_56"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I thought you said I'd get the rest of the radios. - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_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_57"); - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch14 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Okay your next location is Camp Gamma. It should be North West of here. - - //-- [RESPONSE NOTE] - //-- PLAYER: I thought you said I'd get the rest of the radios. - if (response == "s_57") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - //-- NPC: Yeah, about that...it isn't that I don't trust you, it's just...these are the only radios I have. You understand right? - string_id message = new string_id (c_stringFile, "s_58"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: You worry too much. - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_59"); - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch15 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yeah, about that...it isn't that I don't trust you, it's just...these are the only radios I have. You understand right? - - //-- [RESPONSE NOTE] - //-- PLAYER: You worry too much. - if (response == "s_59") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - //-- NPC: You still want to do it right? I'll sweeten the deal. - string_id message = new string_id (c_stringFile, "s_60"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sure. - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_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.radio_delivery_deathtrooper_conversation.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch16 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You still want to do it right? I'll sweeten the deal. - - //-- [RESPONSE NOTE] - //-- PLAYER: Sure. - if (response == "s_62") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - radio_delivery_deathtrooper_conversation_action_giveSecondDeliveryQuest (player, npc); - - //-- NPC: I put the expected coordinates in your datapad. Hope you have an easier time with this one. - string_id message = new string_id (c_stringFile, "s_63"); - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch20 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You look new. - - //-- [RESPONSE NOTE] - //-- PLAYER: I am, actually. - if (response == "s_37") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - //-- NPC: I lost count of the days I have been here. Gets harder to count when you don't sleep much. - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Aren't you a pilot? - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_42"); - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch21 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I lost count of the days I have been here. Gets harder to count when you don't sleep much. - - //-- [RESPONSE NOTE] - //-- PLAYER: Aren't you a pilot? - if (response == "s_42") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - //-- NPC: Yes, a Tie-Bomber pilot to be exact. - string_id message = new string_id (c_stringFile, "s_44"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: How did you get here? - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_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_46"); - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch22 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yes, a Tie-Bomber pilot to be exact. - - //-- [RESPONSE NOTE] - //-- PLAYER: How did you get here? - if (response == "s_46") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - //-- NPC: A rookie tie pilot clipped my wing and we lost altitude. I hate atmospheric flight...and gravity for that matter. - string_id message = new string_id (c_stringFile, "s_48"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What are you doing now, sending distress signals? - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_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.radio_delivery_deathtrooper_conversation.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch23 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: A rookie tie pilot clipped my wing and we lost altitude. I hate atmospheric flight...and gravity for that matter. - - //-- [RESPONSE NOTE] - //-- PLAYER: What are you doing now, sending distress signals? - if (response == "s_50") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - //-- NPC: Actually the Empire knows our location, and anyone else who is listening. I'm actually trying to establish a communication network with other hold out camps in the quarantine zone. That way if anyone else goes down, we can direct them to the closest defensive position. - string_id message = new string_id (c_stringFile, "s_52"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: That is a good idea. - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_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.radio_delivery_deathtrooper_conversation.branchId", 24); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch24 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Actually the Empire knows our location, and anyone else who is listening. I'm actually trying to establish a communication network with other hold out camps in the quarantine zone. That way if anyone else goes down, we can direct them to the closest defensive position. - - //-- [RESPONSE NOTE] - //-- PLAYER: That is a good idea. - if (response == "s_77") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - //-- NPC: I think so too. I have some radios but I can only get people on the outside of the quarantine zone. I want to talk to survivors in the quarantine zone. - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What makes you so certain there are other survivor camps? - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_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_81"); - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch25 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I think so too. I have some radios but I can only get people on the outside of the quarantine zone. I want to talk to survivors in the quarantine zone. - - //-- [RESPONSE NOTE] - //-- PLAYER: What makes you so certain there are other survivor camps? - if (response == "s_81") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - //-- NPC: Every once in a while a survivor will show up and report that there are other camps. Some of them are in bad shape and they send runners in search of medical and food supplies. It is really risky without knowing exact locations. Radio communication sure would help. - string_id message = new string_id (c_stringFile, "s_83"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Would you like me to deliver the radios? - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_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.radio_delivery_deathtrooper_conversation.branchId", 26); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch26 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Every once in a while a survivor will show up and report that there are other camps. Some of them are in bad shape and they send runners in search of medical and food supplies. It is really risky without knowing exact locations. Radio communication sure would help. - - //-- [RESPONSE NOTE] - //-- PLAYER: Would you like me to deliver the radios? - if (response == "s_85") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - //-- NPC: I'll tell you what. If you deliver this radio, I'll give you more. Between the two of us we could really save some lives. Are you serious about this? - string_id message = new string_id (c_stringFile, "s_87"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yeah, give me the first radio. - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_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.radio_delivery_deathtrooper_conversation.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int radio_delivery_deathtrooper_conversation_handleBranch27 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I'll tell you what. If you deliver this radio, I'll give you more. Between the two of us we could really save some lives. Are you serious about this? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yeah, give me the first radio. - if (response == "s_89") - { - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - radio_delivery_deathtrooper_conversation_action_giveFirstDeliveryQuest (player, npc); - - //-- NPC: Here you go. The first location, I call it Camp Beta, is south west of here. I gave you a waypoint of where I think it is. Good luck. - string_id message = new string_id (c_stringFile, "s_94"); - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - return SCRIPT_CONTINUE; -} - -trigger OnAttach () -{ - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - 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 (radio_delivery_deathtrooper_conversation_condition_hasHelmet (player, npc)) - { - //-- NPC: Hello. - string_id message = new string_id (c_stringFile, "s_91"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I have something for you. - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_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_92"); - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 1); - - npcStartConversation (player, npc, "radio_delivery_deathtrooper_conversation", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition_hasCompletedAll (player, npc)) - { - //-- NPC: All camps check in once an hour. We're coordinating high altitude supply drops. - string_id message = new string_id (c_stringFile, "s_75"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition_hasDeliveryQuestActive (player, npc)) - { - //-- NPC: Come back when you are done delivering the radio. We'll talk then. - string_id message = new string_id (c_stringFile, "s_31"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition_hasLastRadiosDelivered (player, npc)) - { - //-- NPC: Well, well. You did it. I guess I am a few thousand credits poorer, but it'll be worth it if we can save a few lives and coordinate supply drops. - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: You seem a little to altruistic for an Imperial. - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: I don't want your credits. I just came back to see the look on your face. - boolean hasResponse1 = false; - if (radio_delivery_deathtrooper_conversation_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_71"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_73"); - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 5); - - npcStartConversation (player, npc, "radio_delivery_deathtrooper_conversation", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition_hasRadioQuest2Complete (player, npc)) - { - //-- NPC: That is 2 for 2. You are really doing better than I expected. - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Thanks for the vote of confidence. - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_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_41"); - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 8); - - npcStartConversation (player, npc, "radio_delivery_deathtrooper_conversation", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition_hasRadioTwoDelivered (player, npc)) - { - radio_delivery_deathtrooper_conversation_action_deliverTwoCompleted (player, npc); - - //-- NPC: Great work on delivering the radio to camp gamma. As promised, here is the same amount plus extra. Come back when you are ready to do the others. - string_id message = new string_id (c_stringFile, "s_68"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition_hasRadioQuest1Complete (player, npc)) - { - //-- NPC: So you ready to deliver more radios? - string_id message = new string_id (c_stringFile, "s_54"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes. - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_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_55"); - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 13); - - npcStartConversation (player, npc, "radio_delivery_deathtrooper_conversation", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition_hasRadioOneDelivered (player, npc)) - { - radio_delivery_deathtrooper_conversation_action_deliveryOneCompleted (player, npc); - - //-- NPC: Great work on delivering that radio. Here is some credits to make the deal even sweeter. Come back when you are ready to do the others. - string_id message = new string_id (c_stringFile, "s_61"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition_noAntiVirus (player, npc)) - { - //-- NPC: You should speak with Doctor Cody. She can get you the anti-virus. - string_id message = new string_id (c_stringFile, "s_69"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition_hasNeverSpoken (player, npc)) - { - //-- NPC: You look new. - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I am, actually. - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_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_37"); - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 20); - - npcStartConversation (player, npc, "radio_delivery_deathtrooper_conversation", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - //-- NPC: Sorry. I've got work to do. - 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 != "radio_delivery_deathtrooper_conversation") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - if (branchId == 1 && radio_delivery_deathtrooper_conversation_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && radio_delivery_deathtrooper_conversation_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && radio_delivery_deathtrooper_conversation_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && radio_delivery_deathtrooper_conversation_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && radio_delivery_deathtrooper_conversation_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 13 && radio_delivery_deathtrooper_conversation_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 14 && radio_delivery_deathtrooper_conversation_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 15 && radio_delivery_deathtrooper_conversation_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 16 && radio_delivery_deathtrooper_conversation_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 20 && radio_delivery_deathtrooper_conversation_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 21 && radio_delivery_deathtrooper_conversation_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 22 && radio_delivery_deathtrooper_conversation_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 23 && radio_delivery_deathtrooper_conversation_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 24 && radio_delivery_deathtrooper_conversation_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 25 && radio_delivery_deathtrooper_conversation_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 26 && radio_delivery_deathtrooper_conversation_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 27 && radio_delivery_deathtrooper_conversation_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.radio_delivery_deathtrooper_conversation.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// radio_delivery_deathtrooper_conversation.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.features; +include library.groundquests; +include library.space_quest; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/radio_delivery_deathtrooper_conversation"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean radio_delivery_deathtrooper_conversation_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean radio_delivery_deathtrooper_conversation_condition_hasDeliveryQuestActive (obj_id player, obj_id npc) +{ + boolean returnVal = false; + + for(int i = 1; i <= 3; i++) + { + if(groundquests.isTaskActive(player, "outbreak_radio_delivery_0"+i, "findCamp") + || groundquests.isTaskActive(player, "outbreak_radio_delivery_0"+i, "hiddenSearchArea") + || groundquests.isTaskActive(player, "outbreak_radio_delivery_0"+i, "findBossInCharge") + || groundquests.isTaskActive(player, "outbreak_radio_delivery_0"+i, "goodWork")) + { + returnVal = true; + } + if(i == 3 && !returnVal) + { + if(groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "findEpsilonContact") + || groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "comGoodWork2")) + returnVal = true; + } + } + return returnVal; +} + +// ---------------------------------------------------------------------- + +boolean radio_delivery_deathtrooper_conversation_condition_hasRadioQuest1Complete (obj_id player, obj_id npc) +{ + return groundquests.hasCompletedQuest(player, "outbreak_radio_delivery_01"); +} + +// ---------------------------------------------------------------------- + +boolean radio_delivery_deathtrooper_conversation_condition_hasNeverSpoken (obj_id player, obj_id npc) +{ + return !groundquests.isQuestActiveOrComplete(player, "outbreak_radio_delivery_01"); +} + +// ---------------------------------------------------------------------- + +boolean radio_delivery_deathtrooper_conversation_condition_hasRadioOneDelivered (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "outbreak_radio_delivery_01", "talkToMaris"); +} + +// ---------------------------------------------------------------------- + +boolean radio_delivery_deathtrooper_conversation_condition_hasRadioTwoDelivered (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "outbreak_radio_delivery_02", "talkToMaris"); +} + +// ---------------------------------------------------------------------- + +boolean radio_delivery_deathtrooper_conversation_condition_hasRadioQuest2Complete (obj_id player, obj_id npc) +{ + return groundquests.hasCompletedQuest(player, "outbreak_radio_delivery_02"); +} + +// ---------------------------------------------------------------------- + +boolean radio_delivery_deathtrooper_conversation_condition_noAntiVirus (obj_id player, obj_id npc) +{ + return !groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") + && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") + && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral"); +} + +// ---------------------------------------------------------------------- + +boolean radio_delivery_deathtrooper_conversation_condition_hasLastRadiosDelivered (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "talkToMaris"); +} + +// ---------------------------------------------------------------------- + +boolean radio_delivery_deathtrooper_conversation_condition_hasCompletedAll (obj_id player, obj_id npc) +{ + return groundquests.hasCompletedQuest(player, "outbreak_radio_delivery_03"); +} + +// ---------------------------------------------------------------------- + +boolean radio_delivery_deathtrooper_conversation_condition_hasHelmet (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "outbreak_bomber_helmet_hidden_content", "hasHelmet"); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void radio_delivery_deathtrooper_conversation_action_giveFirstDeliveryQuest (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_radio_delivery_01"); +} + +// ---------------------------------------------------------------------- + +void radio_delivery_deathtrooper_conversation_action_deliveryOneCompleted (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "spokenToZebMaris"); +} + +// ---------------------------------------------------------------------- + +void radio_delivery_deathtrooper_conversation_action_giveSecondDeliveryQuest (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_radio_delivery_02"); +} + +// ---------------------------------------------------------------------- + +void radio_delivery_deathtrooper_conversation_action_giveThirdDeliveryQuest (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "outbreak_radio_delivery_03"); +} + +// ---------------------------------------------------------------------- + +void radio_delivery_deathtrooper_conversation_action_deliverTwoCompleted (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "spokenToZebMarisGamma"); +} + +// ---------------------------------------------------------------------- + +void radio_delivery_deathtrooper_conversation_action_deliverThreeCompleted (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "spokenToZebMarisDelta"); +} + +// ---------------------------------------------------------------------- + +void radio_delivery_deathtrooper_conversation_action_hasDeliveredHelmet (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasDeliveredHelmet"); + if(!hasCompletedCollectionSlot(player, "hidden_content_tie_helmet")) + { + modifyCollectionSlotValue(player, "hidden_content_tie_helmet", 1); + } +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int radio_delivery_deathtrooper_conversation_handleBranch1 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Hello. + + //-- [RESPONSE NOTE] + //-- PLAYER: I have something for you. + if (response == "s_92") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "celebrate1"); + + radio_delivery_deathtrooper_conversation_action_hasDeliveredHelmet (player, npc); + + //-- NPC: My helmet? Where did you find it. This is the best thing to happen since this nightmare started! Thank you, %TU! + string_id message = new string_id (c_stringFile, "s_93"); + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Well, well. You did it. I guess I am a few thousand credits poorer, but it'll be worth it if we can save a few lives and coordinate supply drops. + + //-- [RESPONSE NOTE] + //-- PLAYER: You seem a little to altruistic for an Imperial. + if (response == "s_71") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + radio_delivery_deathtrooper_conversation_action_deliverThreeCompleted (player, npc); + + //-- NPC: And you seem to care a lot about your credits or you wouldn't have come back. Good luck to you. + string_id message = new string_id (c_stringFile, "s_72"); + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: I don't want your credits. I just came back to see the look on your face. + if (response == "s_73") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + radio_delivery_deathtrooper_conversation_action_deliverThreeCompleted (player, npc); + + //-- NPC: Well, too bad...you get the credits anyway. I don't plan on using them...maybe you can. + string_id message = new string_id (c_stringFile, "s_74"); + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: That is 2 for 2. You are really doing better than I expected. + + //-- [RESPONSE NOTE] + //-- PLAYER: Thanks for the vote of confidence. + if (response == "s_41") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + //-- NPC: I'll tell you what. I'll give you the last two radios I have. Unfortunately I only have one other location that I know of, so you are on your own for finding the last camp. Trig Longo thinks it is in the research and prison facility...but I don't think anyone would have lived at that location long after the virus outbreak. + string_id message = new string_id (c_stringFile, "s_53"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: So I don't have to come back here again? Great! + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_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_64"); + + utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I'll tell you what. I'll give you the last two radios I have. Unfortunately I only have one other location that I know of, so you are on your own for finding the last camp. Trig Longo thinks it is in the research and prison facility...but I don't think anyone would have lived at that location long after the virus outbreak. + + //-- [RESPONSE NOTE] + //-- PLAYER: So I don't have to come back here again? Great! + if (response == "s_64") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + //-- NPC: Oh you don't have to, but if you want to be paid, then yeah...you might want to come back. + string_id message = new string_id (c_stringFile, "s_65"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: ... + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_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_66"); + + utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Oh you don't have to, but if you want to be paid, then yeah...you might want to come back. + + //-- [RESPONSE NOTE] + //-- PLAYER: ... + if (response == "s_66") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + radio_delivery_deathtrooper_conversation_action_giveThirdDeliveryQuest (player, npc); + + //-- NPC: Here is the last location I know of. Happy hunting. + string_id message = new string_id (c_stringFile, "s_67"); + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch13 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: So you ready to deliver more radios? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes. + if (response == "s_55") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + //-- NPC: Okay your next location is Camp Gamma. It should be North West of here. + string_id message = new string_id (c_stringFile, "s_56"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I thought you said I'd get the rest of the radios. + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_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_57"); + + utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 14); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch14 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Okay your next location is Camp Gamma. It should be North West of here. + + //-- [RESPONSE NOTE] + //-- PLAYER: I thought you said I'd get the rest of the radios. + if (response == "s_57") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + //-- NPC: Yeah, about that...it isn't that I don't trust you, it's just...these are the only radios I have. You understand right? + string_id message = new string_id (c_stringFile, "s_58"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: You worry too much. + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_59"); + + utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 15); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch15 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yeah, about that...it isn't that I don't trust you, it's just...these are the only radios I have. You understand right? + + //-- [RESPONSE NOTE] + //-- PLAYER: You worry too much. + if (response == "s_59") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + //-- NPC: You still want to do it right? I'll sweeten the deal. + string_id message = new string_id (c_stringFile, "s_60"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sure. + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_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.radio_delivery_deathtrooper_conversation.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch16 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You still want to do it right? I'll sweeten the deal. + + //-- [RESPONSE NOTE] + //-- PLAYER: Sure. + if (response == "s_62") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + radio_delivery_deathtrooper_conversation_action_giveSecondDeliveryQuest (player, npc); + + //-- NPC: I put the expected coordinates in your datapad. Hope you have an easier time with this one. + string_id message = new string_id (c_stringFile, "s_63"); + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch20 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You look new. + + //-- [RESPONSE NOTE] + //-- PLAYER: I am, actually. + if (response == "s_37") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + //-- NPC: I lost count of the days I have been here. Gets harder to count when you don't sleep much. + string_id message = new string_id (c_stringFile, "s_39"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Aren't you a pilot? + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_42"); + + utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 21); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch21 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I lost count of the days I have been here. Gets harder to count when you don't sleep much. + + //-- [RESPONSE NOTE] + //-- PLAYER: Aren't you a pilot? + if (response == "s_42") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + //-- NPC: Yes, a Tie-Bomber pilot to be exact. + string_id message = new string_id (c_stringFile, "s_44"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: How did you get here? + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_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_46"); + + utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 22); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch22 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yes, a Tie-Bomber pilot to be exact. + + //-- [RESPONSE NOTE] + //-- PLAYER: How did you get here? + if (response == "s_46") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + //-- NPC: A rookie tie pilot clipped my wing and we lost altitude. I hate atmospheric flight...and gravity for that matter. + string_id message = new string_id (c_stringFile, "s_48"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What are you doing now, sending distress signals? + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_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.radio_delivery_deathtrooper_conversation.branchId", 23); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch23 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: A rookie tie pilot clipped my wing and we lost altitude. I hate atmospheric flight...and gravity for that matter. + + //-- [RESPONSE NOTE] + //-- PLAYER: What are you doing now, sending distress signals? + if (response == "s_50") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + //-- NPC: Actually the Empire knows our location, and anyone else who is listening. I'm actually trying to establish a communication network with other hold out camps in the quarantine zone. That way if anyone else goes down, we can direct them to the closest defensive position. + string_id message = new string_id (c_stringFile, "s_52"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: That is a good idea. + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_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.radio_delivery_deathtrooper_conversation.branchId", 24); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch24 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Actually the Empire knows our location, and anyone else who is listening. I'm actually trying to establish a communication network with other hold out camps in the quarantine zone. That way if anyone else goes down, we can direct them to the closest defensive position. + + //-- [RESPONSE NOTE] + //-- PLAYER: That is a good idea. + if (response == "s_77") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + //-- NPC: I think so too. I have some radios but I can only get people on the outside of the quarantine zone. I want to talk to survivors in the quarantine zone. + string_id message = new string_id (c_stringFile, "s_79"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What makes you so certain there are other survivor camps? + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_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_81"); + + utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 25); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch25 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I think so too. I have some radios but I can only get people on the outside of the quarantine zone. I want to talk to survivors in the quarantine zone. + + //-- [RESPONSE NOTE] + //-- PLAYER: What makes you so certain there are other survivor camps? + if (response == "s_81") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + //-- NPC: Every once in a while a survivor will show up and report that there are other camps. Some of them are in bad shape and they send runners in search of medical and food supplies. It is really risky without knowing exact locations. Radio communication sure would help. + string_id message = new string_id (c_stringFile, "s_83"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Would you like me to deliver the radios? + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_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.radio_delivery_deathtrooper_conversation.branchId", 26); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch26 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Every once in a while a survivor will show up and report that there are other camps. Some of them are in bad shape and they send runners in search of medical and food supplies. It is really risky without knowing exact locations. Radio communication sure would help. + + //-- [RESPONSE NOTE] + //-- PLAYER: Would you like me to deliver the radios? + if (response == "s_85") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + //-- NPC: I'll tell you what. If you deliver this radio, I'll give you more. Between the two of us we could really save some lives. Are you serious about this? + string_id message = new string_id (c_stringFile, "s_87"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yeah, give me the first radio. + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_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.radio_delivery_deathtrooper_conversation.branchId", 27); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int radio_delivery_deathtrooper_conversation_handleBranch27 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I'll tell you what. If you deliver this radio, I'll give you more. Between the two of us we could really save some lives. Are you serious about this? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yeah, give me the first radio. + if (response == "s_89") + { + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + radio_delivery_deathtrooper_conversation_action_giveFirstDeliveryQuest (player, npc); + + //-- NPC: Here you go. The first location, I call it Camp Beta, is south west of here. I gave you a waypoint of where I think it is. Good luck. + string_id message = new string_id (c_stringFile, "s_94"); + utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + setCondition (self, CONDITION_CONVERSABLE); + setCondition (self, CONDITION_INTERESTING); + + return SCRIPT_CONTINUE; +} + +trigger OnAttach () +{ + setCondition (self, CONDITION_CONVERSABLE); + setCondition (self, CONDITION_INTERESTING); + + 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 (radio_delivery_deathtrooper_conversation_condition_hasHelmet (player, npc)) + { + //-- NPC: Hello. + string_id message = new string_id (c_stringFile, "s_91"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I have something for you. + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_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_92"); + + utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 1); + + npcStartConversation (player, npc, "radio_delivery_deathtrooper_conversation", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition_hasCompletedAll (player, npc)) + { + //-- NPC: All camps check in once an hour. We're coordinating high altitude supply drops. + string_id message = new string_id (c_stringFile, "s_75"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition_hasDeliveryQuestActive (player, npc)) + { + //-- NPC: Come back when you are done delivering the radio. We'll talk then. + string_id message = new string_id (c_stringFile, "s_31"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition_hasLastRadiosDelivered (player, npc)) + { + //-- NPC: Well, well. You did it. I guess I am a few thousand credits poorer, but it'll be worth it if we can save a few lives and coordinate supply drops. + string_id message = new string_id (c_stringFile, "s_70"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: You seem a little to altruistic for an Imperial. + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: I don't want your credits. I just came back to see the look on your face. + boolean hasResponse1 = false; + if (radio_delivery_deathtrooper_conversation_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_71"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_73"); + + utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 5); + + npcStartConversation (player, npc, "radio_delivery_deathtrooper_conversation", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition_hasRadioQuest2Complete (player, npc)) + { + //-- NPC: That is 2 for 2. You are really doing better than I expected. + string_id message = new string_id (c_stringFile, "s_33"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Thanks for the vote of confidence. + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_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_41"); + + utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 8); + + npcStartConversation (player, npc, "radio_delivery_deathtrooper_conversation", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition_hasRadioTwoDelivered (player, npc)) + { + radio_delivery_deathtrooper_conversation_action_deliverTwoCompleted (player, npc); + + //-- NPC: Great work on delivering the radio to camp gamma. As promised, here is the same amount plus extra. Come back when you are ready to do the others. + string_id message = new string_id (c_stringFile, "s_68"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition_hasRadioQuest1Complete (player, npc)) + { + //-- NPC: So you ready to deliver more radios? + string_id message = new string_id (c_stringFile, "s_54"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes. + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_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_55"); + + utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 13); + + npcStartConversation (player, npc, "radio_delivery_deathtrooper_conversation", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition_hasRadioOneDelivered (player, npc)) + { + radio_delivery_deathtrooper_conversation_action_deliveryOneCompleted (player, npc); + + //-- NPC: Great work on delivering that radio. Here is some credits to make the deal even sweeter. Come back when you are ready to do the others. + string_id message = new string_id (c_stringFile, "s_61"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition_noAntiVirus (player, npc)) + { + //-- NPC: You should speak with Doctor Cody. She can get you the anti-virus. + string_id message = new string_id (c_stringFile, "s_69"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition_hasNeverSpoken (player, npc)) + { + //-- NPC: You look new. + string_id message = new string_id (c_stringFile, "s_35"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I am, actually. + boolean hasResponse0 = false; + if (radio_delivery_deathtrooper_conversation_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_37"); + + utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 20); + + npcStartConversation (player, npc, "radio_delivery_deathtrooper_conversation", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) + { + //-- NPC: Sorry. I've got work to do. + 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 != "radio_delivery_deathtrooper_conversation") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); + + if (branchId == 1 && radio_delivery_deathtrooper_conversation_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && radio_delivery_deathtrooper_conversation_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && radio_delivery_deathtrooper_conversation_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && radio_delivery_deathtrooper_conversation_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && radio_delivery_deathtrooper_conversation_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 13 && radio_delivery_deathtrooper_conversation_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 14 && radio_delivery_deathtrooper_conversation_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 15 && radio_delivery_deathtrooper_conversation_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 16 && radio_delivery_deathtrooper_conversation_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 20 && radio_delivery_deathtrooper_conversation_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 21 && radio_delivery_deathtrooper_conversation_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 22 && radio_delivery_deathtrooper_conversation_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 23 && radio_delivery_deathtrooper_conversation_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 24 && radio_delivery_deathtrooper_conversation_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 25 && radio_delivery_deathtrooper_conversation_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 26 && radio_delivery_deathtrooper_conversation_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 27 && radio_delivery_deathtrooper_conversation_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.radio_delivery_deathtrooper_conversation.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/rebel_pilot_rescue.script b/sku.0/sys.server/compiled/game/script/conversation/rebel_pilot_rescue.script index b7f222edd..cdd311015 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/rebel_pilot_rescue.script +++ b/sku.0/sys.server/compiled/game/script/conversation/rebel_pilot_rescue.script @@ -1,331 +1,331 @@ -// ====================================================================== -// -// rebel_pilot_rescue.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.badge; -include library.buff; -include library.chat; -include library.collection; -include library.conversation; -include library.create; -include library.factions; -include library.groundquests; -include library.holiday; -include library.static_item; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/rebel_pilot_rescue"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean rebel_pilot_rescue_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean rebel_pilot_rescue_condition_hasTheMisionActiveAndIsMyRescuer (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(!hasObjVar(npc, "rescuer") || !hasObjVar(npc, "rescuerQuest")) - { - return false; - } - - obj_id rescuer = getObjIdObjVar(npc, "rescuer"); - if(!isValidId(rescuer) || !exists(rescuer)) - { - return false; - } - - if(rescuer != player) - { - return false; - } - - string activeQuest = getStringObjVar(npc, "rescuerQuest"); - if(activeQuest == null || activeQuest.length() <= 0) - { - return false; - } - - if(!groundquests.isQuestActive(player, activeQuest)) - { - return false; - } - - return true; -} - -// ---------------------------------------------------------------------- - -boolean rebel_pilot_rescue_condition_isNotMyRescuer (obj_id player, obj_id npc) -{ - faceTo(npc, player); - if(!hasObjVar(npc, "rescuer") || !hasObjVar(npc, "rescuerQuest")) - { - return true; - } - - obj_id rescuer = getObjIdObjVar(npc, "rescuer"); - if(!isValidId(rescuer) || !exists(rescuer)) - { - return true; - } - - if(rescuer != player) - { - return true; - } - - return false; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void rebel_pilot_rescue_action_changeIntoDisguise (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_01); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -string rebel_pilot_rescue_tokenTO_timeLeftRecruitment (obj_id player, obj_id npc) -{ - string returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP); - if(returnString == null || returnString.equals("")) - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - return returnString; -} - -// ---------------------------------------------------------------------- - -string rebel_pilot_rescue_tokenTO_timeLeftPropaganda (obj_id player, obj_id npc) -{ - string returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP); - if(returnString == null || returnString.equals("")) - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - return returnString; -} - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -int rebel_pilot_rescue_tokenDI_notUsed (obj_id player, obj_id npc) -{ - return 0; -} - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int rebel_pilot_rescue_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I sure am glad to see you, %TU! - - //-- [RESPONSE NOTE] - //-- PLAYER: Here is your disguise. - if (response == "s_79") - { - //-- [NOTE] - if (rebel_pilot_rescue_condition__defaultCondition (player, npc)) - { - //-- NPC: Great. Let me make the change. - string_id message = new string_id (c_stringFile, "s_80"); - utils.removeScriptVar (player, "conversation.rebel_pilot_rescue.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.rebel_pilot_rescue"); - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; -} - -trigger OnAttach () -{ - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - 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.rebel_pilot_rescue"); - - return SCRIPT_CONTINUE; -} - -trigger OnDetach () -{ - clearCondition (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 (rebel_pilot_rescue_condition_isNotMyRescuer (player, npc)) - { - //-- NPC: I'm wating for someone else. - string_id message = new string_id (c_stringFile, "s_81"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (rebel_pilot_rescue_condition_hasTheMisionActiveAndIsMyRescuer (player, npc)) - { - //-- NPC: I sure am glad to see you, %TU! - string_id message = new string_id (c_stringFile, "s_78"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Here is your disguise. - boolean hasResponse0 = false; - if (rebel_pilot_rescue_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_79"); - - utils.setScriptVar (player, "conversation.rebel_pilot_rescue.branchId", 2); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rebel_pilot_rescue", 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; - } - - 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 != "rebel_pilot_rescue") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.rebel_pilot_rescue.branchId"); - - if (branchId == 2 && rebel_pilot_rescue_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.rebel_pilot_rescue.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// rebel_pilot_rescue.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.badge; +include library.buff; +include library.chat; +include library.collection; +include library.conversation; +include library.create; +include library.factions; +include library.groundquests; +include library.holiday; +include library.static_item; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/rebel_pilot_rescue"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean rebel_pilot_rescue_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean rebel_pilot_rescue_condition_hasTheMisionActiveAndIsMyRescuer (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(!hasObjVar(npc, "rescuer") || !hasObjVar(npc, "rescuerQuest")) + { + return false; + } + + obj_id rescuer = getObjIdObjVar(npc, "rescuer"); + if(!isValidId(rescuer) || !exists(rescuer)) + { + return false; + } + + if(rescuer != player) + { + return false; + } + + string activeQuest = getStringObjVar(npc, "rescuerQuest"); + if(activeQuest == null || activeQuest.length() <= 0) + { + return false; + } + + if(!groundquests.isQuestActive(player, activeQuest)) + { + return false; + } + + return true; +} + +// ---------------------------------------------------------------------- + +boolean rebel_pilot_rescue_condition_isNotMyRescuer (obj_id player, obj_id npc) +{ + faceTo(npc, player); + if(!hasObjVar(npc, "rescuer") || !hasObjVar(npc, "rescuerQuest")) + { + return true; + } + + obj_id rescuer = getObjIdObjVar(npc, "rescuer"); + if(!isValidId(rescuer) || !exists(rescuer)) + { + return true; + } + + if(rescuer != player) + { + return true; + } + + return false; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void rebel_pilot_rescue_action_changeIntoDisguise (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_01); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +string rebel_pilot_rescue_tokenTO_timeLeftRecruitment (obj_id player, obj_id npc) +{ + string returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP); + if(returnString == null || returnString.equals("")) + return "might have to contact Customer Service. I can't seem to get any time data off your character."; + return returnString; +} + +// ---------------------------------------------------------------------- + +string rebel_pilot_rescue_tokenTO_timeLeftPropaganda (obj_id player, obj_id npc) +{ + string returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP); + if(returnString == null || returnString.equals("")) + return "might have to contact Customer Service. I can't seem to get any time data off your character."; + return returnString; +} + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +int rebel_pilot_rescue_tokenDI_notUsed (obj_id player, obj_id npc) +{ + return 0; +} + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int rebel_pilot_rescue_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I sure am glad to see you, %TU! + + //-- [RESPONSE NOTE] + //-- PLAYER: Here is your disguise. + if (response == "s_79") + { + //-- [NOTE] + if (rebel_pilot_rescue_condition__defaultCondition (player, npc)) + { + //-- NPC: Great. Let me make the change. + string_id message = new string_id (c_stringFile, "s_80"); + utils.removeScriptVar (player, "conversation.rebel_pilot_rescue.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.rebel_pilot_rescue"); + + setCondition (self, CONDITION_CONVERSABLE); + setCondition (self, CONDITION_INTERESTING); + return SCRIPT_CONTINUE; +} + +trigger OnAttach () +{ + + setCondition (self, CONDITION_CONVERSABLE); + setCondition (self, CONDITION_INTERESTING); + 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.rebel_pilot_rescue"); + + return SCRIPT_CONTINUE; +} + +trigger OnDetach () +{ + clearCondition (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 (rebel_pilot_rescue_condition_isNotMyRescuer (player, npc)) + { + //-- NPC: I'm wating for someone else. + string_id message = new string_id (c_stringFile, "s_81"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (rebel_pilot_rescue_condition_hasTheMisionActiveAndIsMyRescuer (player, npc)) + { + //-- NPC: I sure am glad to see you, %TU! + string_id message = new string_id (c_stringFile, "s_78"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Here is your disguise. + boolean hasResponse0 = false; + if (rebel_pilot_rescue_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_79"); + + utils.setScriptVar (player, "conversation.rebel_pilot_rescue.branchId", 2); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "rebel_pilot_rescue", 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; + } + + 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 != "rebel_pilot_rescue") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.rebel_pilot_rescue.branchId"); + + if (branchId == 2 && rebel_pilot_rescue_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.rebel_pilot_rescue.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_wedge.script b/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_wedge.script index 104e73cf1..200433eec 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_wedge.script +++ b/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_wedge.script @@ -1,538 +1,538 @@ -// ====================================================================== -// -// rebel_remembrance_day_wedge.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.badge; -include library.buff; -include library.chat; -include library.collection; -include library.conversation; -include library.create; -include library.factions; -include library.groundquests; -include library.holiday; -include library.static_item; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/rebel_remembrance_day_wedge"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean rebel_remembrance_day_wedge_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean rebel_remembrance_day_wedge_condition_isImperialPlayer (obj_id player, obj_id npc) -{ - rebel_remembrance_day_wedge_action_faceTo(npc, player); - return (factions.isImperial(player)); -} - -// ---------------------------------------------------------------------- - -boolean rebel_remembrance_day_wedge_condition_isNeutralPlayer (obj_id player, obj_id npc) -{ - return(!factions.isImperial(player) && !factions.isRebel(player)); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void rebel_remembrance_day_wedge_action_faceTo (obj_id player, obj_id npc) -{ - rebel_remembrance_day_wedge_action_faceTo(npc, player); -} - -// ---------------------------------------------------------------------- - -void rebel_remembrance_day_wedge_action_spawnTroopers (obj_id player, obj_id npc) -{ - //spawn some mean enemies - for (int i = 0; i < 3; i++) - { - location guardLocation = groundquests.getRandom2DLocationAroundLocation(npc, 1, 1, 5, 12); - int mobLevel = getLevel(player); - obj_id guard = create.object("rebel_emperorsday_ceremony_sentry", guardLocation, mobLevel); - attachScript(guard, "event.emp_day.factional_guard_self_destruct"); - startCombat(guard, player); - } -} - -// ---------------------------------------------------------------------- - -void rebel_remembrance_day_wedge_action_grantFirstMission (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_01); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int rebel_remembrance_day_wedge_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: ... - - //-- [RESPONSE NOTE] - //-- PLAYER: Aren't you the Wedge Antilles? - if (response == "s_8") - { - //-- [NOTE] - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_once"); - - rebel_remembrance_day_wedge_action_faceTo (player, npc); - - //-- NPC: Uh yes...please don't tell me you want my autograph. - string_id message = new string_id (c_stringFile, "s_9"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Well uh...actually... - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_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_10"); - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int rebel_remembrance_day_wedge_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Uh yes...please don't tell me you want my autograph. - - //-- [RESPONSE NOTE] - //-- PLAYER: Well uh...actually... - if (response == "s_10") - { - //-- [NOTE] - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "rub_chin_thoughtful"); - - rebel_remembrance_day_wedge_action_faceTo (player, npc); - - //-- NPC: Hold that thought. I just received a priority message from the Chief of Intelligence. - string_id message = new string_id (c_stringFile, "s_12"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: ... - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_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.rebel_remembrance_day_wedge.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int rebel_remembrance_day_wedge_handleBranch5 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Hold that thought. I just received a priority message from the Chief of Intelligence. - - //-- [RESPONSE NOTE] - //-- PLAYER: ... - if (response == "s_17") - { - //-- [NOTE] - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_action_faceTo (player, npc); - - //-- NPC: Uh oh. I need someone competent immediately. - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: *Clear Throat* - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_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_20"); - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int rebel_remembrance_day_wedge_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Uh oh. I need someone competent immediately. - - //-- [RESPONSE NOTE] - //-- PLAYER: *Clear Throat* - if (response == "s_20") - { - //-- [NOTE] - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_action_faceTo (player, npc); - - //-- NPC: I suppose you might due. An Imperial Lambda shuttle has just crash landed on Yavin IV. I need you to investigate the location and recover any intelligence. Does this seem like something you can handle? - string_id message = new string_id (c_stringFile, "s_22"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes sir! - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_24"); - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int rebel_remembrance_day_wedge_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I suppose you might due. An Imperial Lambda shuttle has just crash landed on Yavin IV. I need you to investigate the location and recover any intelligence. Does this seem like something you can handle? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes sir! - if (response == "s_24") - { - //-- [NOTE] - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_action_faceTo (player, npc); - - //-- NPC: Here are the coordinates. - string_id message = new string_id (c_stringFile, "s_25"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.rebel_remembrance_day_wedge"); - - 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.rebel_remembrance_day_wedge"); - - 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 (rebel_remembrance_day_wedge_condition_isImperialPlayer (player, npc)) - { - rebel_remembrance_day_wedge_action_spawnTroopers (player, npc); - - //-- NPC: Guards!! I have an Imperial combatant at my location! - string_id message = new string_id (c_stringFile, "s_26"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (rebel_remembrance_day_wedge_condition_isNeutralPlayer (player, npc)) - { - rebel_remembrance_day_wedge_action_faceTo (player, npc); - - //-- NPC: Hello citizen. - string_id message = new string_id (c_stringFile, "s_27"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_action_faceTo (player, npc); - - //-- NPC: ... - string_id message = new string_id (c_stringFile, "s_7"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Aren't you the Wedge Antilles? - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_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_8"); - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId", 3); - - npcStartConversation (player, npc, "rebel_remembrance_day_wedge", 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 != "rebel_remembrance_day_wedge") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); - - if (branchId == 3 && rebel_remembrance_day_wedge_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && rebel_remembrance_day_wedge_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 5 && rebel_remembrance_day_wedge_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && rebel_remembrance_day_wedge_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && rebel_remembrance_day_wedge_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// rebel_remembrance_day_wedge.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.badge; +include library.buff; +include library.chat; +include library.collection; +include library.conversation; +include library.create; +include library.factions; +include library.groundquests; +include library.holiday; +include library.static_item; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/rebel_remembrance_day_wedge"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean rebel_remembrance_day_wedge_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean rebel_remembrance_day_wedge_condition_isImperialPlayer (obj_id player, obj_id npc) +{ + rebel_remembrance_day_wedge_action_faceTo(npc, player); + return (factions.isImperial(player)); +} + +// ---------------------------------------------------------------------- + +boolean rebel_remembrance_day_wedge_condition_isNeutralPlayer (obj_id player, obj_id npc) +{ + return(!factions.isImperial(player) && !factions.isRebel(player)); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void rebel_remembrance_day_wedge_action_faceTo (obj_id player, obj_id npc) +{ + rebel_remembrance_day_wedge_action_faceTo(npc, player); +} + +// ---------------------------------------------------------------------- + +void rebel_remembrance_day_wedge_action_spawnTroopers (obj_id player, obj_id npc) +{ + //spawn some mean enemies + for (int i = 0; i < 3; i++) + { + location guardLocation = groundquests.getRandom2DLocationAroundLocation(npc, 1, 1, 5, 12); + int mobLevel = getLevel(player); + obj_id guard = create.object("rebel_emperorsday_ceremony_sentry", guardLocation, mobLevel); + attachScript(guard, "event.emp_day.factional_guard_self_destruct"); + startCombat(guard, player); + } +} + +// ---------------------------------------------------------------------- + +void rebel_remembrance_day_wedge_action_grantFirstMission (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_01); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int rebel_remembrance_day_wedge_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: ... + + //-- [RESPONSE NOTE] + //-- PLAYER: Aren't you the Wedge Antilles? + if (response == "s_8") + { + //-- [NOTE] + if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "nod_head_once"); + + rebel_remembrance_day_wedge_action_faceTo (player, npc); + + //-- NPC: Uh yes...please don't tell me you want my autograph. + string_id message = new string_id (c_stringFile, "s_9"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Well uh...actually... + boolean hasResponse0 = false; + if (rebel_remembrance_day_wedge_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_10"); + + utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int rebel_remembrance_day_wedge_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Uh yes...please don't tell me you want my autograph. + + //-- [RESPONSE NOTE] + //-- PLAYER: Well uh...actually... + if (response == "s_10") + { + //-- [NOTE] + if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "rub_chin_thoughtful"); + + rebel_remembrance_day_wedge_action_faceTo (player, npc); + + //-- NPC: Hold that thought. I just received a priority message from the Chief of Intelligence. + string_id message = new string_id (c_stringFile, "s_12"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: ... + boolean hasResponse0 = false; + if (rebel_remembrance_day_wedge_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.rebel_remembrance_day_wedge.branchId", 5); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int rebel_remembrance_day_wedge_handleBranch5 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Hold that thought. I just received a priority message from the Chief of Intelligence. + + //-- [RESPONSE NOTE] + //-- PLAYER: ... + if (response == "s_17") + { + //-- [NOTE] + if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) + { + rebel_remembrance_day_wedge_action_faceTo (player, npc); + + //-- NPC: Uh oh. I need someone competent immediately. + string_id message = new string_id (c_stringFile, "s_18"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: *Clear Throat* + boolean hasResponse0 = false; + if (rebel_remembrance_day_wedge_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_20"); + + utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId", 6); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int rebel_remembrance_day_wedge_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Uh oh. I need someone competent immediately. + + //-- [RESPONSE NOTE] + //-- PLAYER: *Clear Throat* + if (response == "s_20") + { + //-- [NOTE] + if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) + { + rebel_remembrance_day_wedge_action_faceTo (player, npc); + + //-- NPC: I suppose you might due. An Imperial Lambda shuttle has just crash landed on Yavin IV. I need you to investigate the location and recover any intelligence. Does this seem like something you can handle? + string_id message = new string_id (c_stringFile, "s_22"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes sir! + boolean hasResponse0 = false; + if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_24"); + + utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId", 7); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int rebel_remembrance_day_wedge_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I suppose you might due. An Imperial Lambda shuttle has just crash landed on Yavin IV. I need you to investigate the location and recover any intelligence. Does this seem like something you can handle? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes sir! + if (response == "s_24") + { + //-- [NOTE] + if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) + { + rebel_remembrance_day_wedge_action_faceTo (player, npc); + + //-- NPC: Here are the coordinates. + string_id message = new string_id (c_stringFile, "s_25"); + utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.rebel_remembrance_day_wedge"); + + 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.rebel_remembrance_day_wedge"); + + 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 (rebel_remembrance_day_wedge_condition_isImperialPlayer (player, npc)) + { + rebel_remembrance_day_wedge_action_spawnTroopers (player, npc); + + //-- NPC: Guards!! I have an Imperial combatant at my location! + string_id message = new string_id (c_stringFile, "s_26"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (rebel_remembrance_day_wedge_condition_isNeutralPlayer (player, npc)) + { + rebel_remembrance_day_wedge_action_faceTo (player, npc); + + //-- NPC: Hello citizen. + string_id message = new string_id (c_stringFile, "s_27"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) + { + rebel_remembrance_day_wedge_action_faceTo (player, npc); + + //-- NPC: ... + string_id message = new string_id (c_stringFile, "s_7"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Aren't you the Wedge Antilles? + boolean hasResponse0 = false; + if (rebel_remembrance_day_wedge_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_8"); + + utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId", 3); + + npcStartConversation (player, npc, "rebel_remembrance_day_wedge", 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 != "rebel_remembrance_day_wedge") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); + + if (branchId == 3 && rebel_remembrance_day_wedge_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && rebel_remembrance_day_wedge_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 5 && rebel_remembrance_day_wedge_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && rebel_remembrance_day_wedge_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && rebel_remembrance_day_wedge_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/scientist_collection.script b/sku.0/sys.server/compiled/game/script/conversation/scientist_collection.script index 22a7d8f03..c5e05c851 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/scientist_collection.script +++ b/sku.0/sys.server/compiled/game/script/conversation/scientist_collection.script @@ -1,899 +1,899 @@ -// ====================================================================== -// -// scientist_collection.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.collection; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/scientist_collection"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean scientist_collection_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean scientist_collection_condition_isSlotOne (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_1"); -} - -// ---------------------------------------------------------------------- - -boolean scientist_collection_condition_isSlotTen (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_10"); -} - -// ---------------------------------------------------------------------- - -boolean scientist_collection_condition_isSlotNine (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_9"); -} - -// ---------------------------------------------------------------------- - -boolean scientist_collection_condition_isSlotEight (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_8"); -} - -// ---------------------------------------------------------------------- - -boolean scientist_collection_condition_isSlotSeven (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_7"); -} - -// ---------------------------------------------------------------------- - -boolean scientist_collection_condition_isSlotSix (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_6"); -} - -// ---------------------------------------------------------------------- - -boolean scientist_collection_condition_isSlotFive (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_5"); -} - -// ---------------------------------------------------------------------- - -boolean scientist_collection_condition_isSlotFour (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_4"); -} - -// ---------------------------------------------------------------------- - -boolean scientist_collection_condition_isSlotThree (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_3"); -} - -// ---------------------------------------------------------------------- - -boolean scientist_collection_condition_isSlotTwo (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_2"); -} - -// ---------------------------------------------------------------------- - -boolean scientist_collection_condition_playerHasQuestAndCollection (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_question_scientist_collection") - && getCollectionSlotValue(player, "nym_question_scientist_activation") > 0; -} - -// ---------------------------------------------------------------------- - -boolean scientist_collection_condition_ifNothing (obj_id player, obj_id npc) -{ - return (!scientist_collection_condition_isSlotEight(player, npc) && !scientist_collection_condition_isSlotNine(player, npc) && !scientist_collection_condition_isSlotTen(player, npc) && !scientist_collection_condition_isSlotOne(player, npc) - && !scientist_collection_condition_isSlotTwo(player, npc) && !scientist_collection_condition_isSlotThree(player, npc) && !scientist_collection_condition_isSlotFour(player, npc) && !scientist_collection_condition_isSlotFive(player, npc) - && !scientist_collection_condition_isSlotSix(player, npc) && !scientist_collection_condition_isSlotSeven(player, npc)); -} - -// ---------------------------------------------------------------------- - -boolean scientist_collection_condition_playerAlreadyQuestioned (obj_id player, obj_id npc) -{ - if(!scientist_collection_condition_playerHasQuestAndCollection(player, npc)) - return false; - - string baseSlotName = getStringObjVar(npc, "collection.slotName"); - if(baseSlotName == null || baseSlotName.length() <= 0) - return false; - - string[] splitSlotNames = split(baseSlotName, ':'); - if(splitSlotNames == null || splitSlotNames.length < 0) - return false; - - string slotName = splitSlotNames[1]; - if(slotName == null || slotName.length() <= 0) - return false; - - return hasCompletedCollectionSlot(player, slotName); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void scientist_collection_action_awardSlotOne (obj_id player, obj_id npc) -{ - if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_1")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_1", 1); - } -} - -// ---------------------------------------------------------------------- - -void scientist_collection_action_awardSlotTwo (obj_id player, obj_id npc) -{ - if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_2")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_2", 1); - } -} - -// ---------------------------------------------------------------------- - -void scientist_collection_action_awardSlotThree (obj_id player, obj_id npc) -{ if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_3")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_3", 1); - } -} - -// ---------------------------------------------------------------------- - -void scientist_collection_action_awardSlotFour (obj_id player, obj_id npc) -{ - if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_4")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_4", 1); - } -} - -// ---------------------------------------------------------------------- - -void scientist_collection_action_awardSlotFive (obj_id player, obj_id npc) -{ - if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_5")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_5", 1); - } -} - -// ---------------------------------------------------------------------- - -void scientist_collection_action_awardSlotSix (obj_id player, obj_id npc) -{ - if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_6")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_6", 1); - } -} - -// ---------------------------------------------------------------------- - -void scientist_collection_action_awardSlotSeven (obj_id player, obj_id npc) -{ - if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_7")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_7", 1); - } -} - -// ---------------------------------------------------------------------- - -void scientist_collection_action_awardSlotEight (obj_id player, obj_id npc) -{ - if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_8")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_8", 1); - } -} - -// ---------------------------------------------------------------------- - -void scientist_collection_action_awardSlotNine (obj_id player, obj_id npc) -{ - if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_9")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_9", 1); - } -} - -// ---------------------------------------------------------------------- - -void scientist_collection_action_awardSlotTen (obj_id player, obj_id npc) -{ - if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_10")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_10", 1); - } -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int scientist_collection_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I'm not telling you anything. - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes, you are. - if (response == "s_6") - { - doAnimationAction (player, "backhand_threaten"); - - //-- [NOTE] - if (scientist_collection_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "taken_aback"); - - //-- NPC: Uh... - string_id message = new string_id (c_stringFile, "s_8"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Tell me about the facility. - boolean hasResponse0 = false; - if (scientist_collection_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_10"); - - utils.setScriptVar (player, "conversation.scientist_collection.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int scientist_collection_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Uh... - - //-- [RESPONSE NOTE] - //-- PLAYER: Tell me about the facility. - if (response == "s_10") - { - doAnimationAction (player, "point_accusingly"); - - //-- [NOTE] - if (scientist_collection_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "scared"); - - //-- NPC: We make weapons...don't hurt me! - string_id message = new string_id (c_stringFile, "s_12"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What do you do? - boolean hasResponse0 = false; - if (scientist_collection_condition_isSlotOne (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Where is the main computer system? - boolean hasResponse1 = false; - if (scientist_collection_condition_isSlotTwo (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Who is in charge here? - boolean hasResponse2 = false; - if (scientist_collection_condition_isSlotThree (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - //-- PLAYER: Who programmed the Droidekas? - boolean hasResponse3 = false; - if (scientist_collection_condition_isSlotFour (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - //-- PLAYER: Where are the IMGGCU? - boolean hasResponse4 = false; - if (scientist_collection_condition_isSlotFive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - //-- PLAYER: Tell me about grenades. - boolean hasResponse5 = false; - if (scientist_collection_condition_isSlotSix (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - //-- PLAYER: Tell me about rifles. - boolean hasResponse6 = false; - if (scientist_collection_condition_isSlotSeven (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse6 = true; - } - - //-- PLAYER: Tell me about carbines. - boolean hasResponse7 = false; - if (scientist_collection_condition_isSlotEight (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse7 = true; - } - - //-- PLAYER: Tell me about melee weapons. - boolean hasResponse8 = false; - if (scientist_collection_condition_isSlotNine (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse8 = true; - } - - //-- PLAYER: Tell me about experimental weapons. - boolean hasResponse9 = false; - if (scientist_collection_condition_isSlotTen (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse9 = true; - } - - //-- PLAYER: Well, you aren't helpful are you? - boolean hasResponse10 = false; - if (scientist_collection_condition_ifNothing (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse10 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_14"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_17"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_20"); - - if (hasResponse3) - responses [responseIndex++] = new string_id (c_stringFile, "s_26"); - - if (hasResponse4) - responses [responseIndex++] = new string_id (c_stringFile, "s_30"); - - if (hasResponse5) - responses [responseIndex++] = new string_id (c_stringFile, "s_54"); - - if (hasResponse6) - responses [responseIndex++] = new string_id (c_stringFile, "s_58"); - - if (hasResponse7) - responses [responseIndex++] = new string_id (c_stringFile, "s_62"); - - if (hasResponse8) - responses [responseIndex++] = new string_id (c_stringFile, "s_66"); - - if (hasResponse9) - responses [responseIndex++] = new string_id (c_stringFile, "s_70"); - - if (hasResponse10) - responses [responseIndex++] = new string_id (c_stringFile, "s_73"); - - utils.setScriptVar (player, "conversation.scientist_collection.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int scientist_collection_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: We make weapons...don't hurt me! - - //-- [RESPONSE NOTE] - //-- PLAYER: What do you do? - if (response == "s_14") - { - //-- [NOTE] - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotOne (player, npc); - - //-- NPC: I'm a scientist, that is why I wear a lab coat. We specialize in different areas such as explosives, chemicals, gasses and so on. We're all here to develop weaponry. - string_id message = new string_id (c_stringFile, "s_21"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Where is the main computer system? - if (response == "s_17") - { - //-- [NOTE] - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotTwo (player, npc); - - //-- NPC: The main computer system? It is down on the bottom level. Please don't hurt it. Many of us have several months of research on it. - string_id message = new string_id (c_stringFile, "s_22"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Who is in charge here? - if (response == "s_20") - { - //-- [NOTE] - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotThree (player, npc); - - //-- NPC: Udo Barnet of the mercenaries is probably the person that most likely fills those shoes. The scientists have their own rank based on seniority, but even the most senior still defer to Barnet. - string_id message = new string_id (c_stringFile, "s_24"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Who programmed the Droidekas? - if (response == "s_26") - { - //-- [NOTE] - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotFour (player, npc); - - //-- NPC: I, I don't know. The Imperials? They are just delivered. Even repairs and maintenance is done off site. I swear it is the truth! - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Where are the IMGGCU? - if (response == "s_30") - { - //-- [NOTE] - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotFive (player, npc); - - //-- NPC: We just finished a new prototype. There is a container full of them in a storage room below. - string_id message = new string_id (c_stringFile, "s_32"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Tell me about grenades. - if (response == "s_54") - { - //-- [NOTE] - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotSix (player, npc); - - //-- NPC: We develop new grenade technologies at this facility. Recently, we received orders to research a new non-lethal gas grenade. - string_id message = new string_id (c_stringFile, "s_56"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Tell me about rifles. - if (response == "s_58") - { - //-- [NOTE] - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotSeven (player, npc); - - //-- NPC: We have received the funding to research a new blaster sniper rifle that consists of 3 separate pieces that can be much easier to conceal. Probably a special operations type weapon. - string_id message = new string_id (c_stringFile, "s_60"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Tell me about carbines. - if (response == "s_62") - { - //-- [NOTE] - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotEight (player, npc); - - //-- NPC: We aren't currently working on carbines here. We have a grant for rifle development and another to reverse engineer a Gungan Assault Cannon. - string_id message = new string_id (c_stringFile, "s_64"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Tell me about melee weapons. - if (response == "s_66") - { - //-- [NOTE] - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotNine (player, npc); - - //-- NPC: There are no melee weapons in development at this facility. - string_id message = new string_id (c_stringFile, "s_68"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Tell me about experimental weapons. - if (response == "s_70") - { - //-- [NOTE] - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotTen (player, npc); - - //-- NPC: We worked on something we called the 'Anti-Fear Virus'. Basically an airborne pathogen that would make Tie Fighter pilots and Stormtroopers fearless. Unfortunately, it affected their motor skills, making them slow to react. Despite it being deemed as complete scientific failure, the Empire still uses it on its personnel. - string_id message = new string_id (c_stringFile, "s_72"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Well, you aren't helpful are you? - if (response == "s_73") - { - //-- [NOTE] - if (scientist_collection_condition__defaultCondition (player, npc)) - { - //-- NPC: No...my conversation is broken....and it is Jaskell that did it! - string_id message = new string_id (c_stringFile, "s_74"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.scientist_collection"); - - 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.scientist_collection"); - - 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 (scientist_collection_condition_playerAlreadyQuestioned (player, npc)) - { - doAnimationAction (npc, "apologize"); - - //-- NPC: I've already told you everything I know. - string_id message = new string_id (c_stringFile, "s_49"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (scientist_collection_condition_playerHasQuestAndCollection (player, npc)) - { - doAnimationAction (npc, "blame"); - - //-- NPC: I'm not telling you anything. - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes, you are. - boolean hasResponse0 = false; - if (scientist_collection_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_6"); - - utils.setScriptVar (player, "conversation.scientist_collection.branchId", 2); - - npcStartConversation (player, npc, "scientist_collection", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (scientist_collection_condition__defaultCondition (player, npc)) - { - //-- NPC: I don't have to tell you anything! - string_id message = new string_id (c_stringFile, "s_46"); - 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 != "scientist_collection") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.scientist_collection.branchId"); - - if (branchId == 2 && scientist_collection_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && scientist_collection_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && scientist_collection_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// scientist_collection.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.collection; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/scientist_collection"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean scientist_collection_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean scientist_collection_condition_isSlotOne (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_1"); +} + +// ---------------------------------------------------------------------- + +boolean scientist_collection_condition_isSlotTen (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_10"); +} + +// ---------------------------------------------------------------------- + +boolean scientist_collection_condition_isSlotNine (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_9"); +} + +// ---------------------------------------------------------------------- + +boolean scientist_collection_condition_isSlotEight (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_8"); +} + +// ---------------------------------------------------------------------- + +boolean scientist_collection_condition_isSlotSeven (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_7"); +} + +// ---------------------------------------------------------------------- + +boolean scientist_collection_condition_isSlotSix (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_6"); +} + +// ---------------------------------------------------------------------- + +boolean scientist_collection_condition_isSlotFive (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_5"); +} + +// ---------------------------------------------------------------------- + +boolean scientist_collection_condition_isSlotFour (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_4"); +} + +// ---------------------------------------------------------------------- + +boolean scientist_collection_condition_isSlotThree (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_3"); +} + +// ---------------------------------------------------------------------- + +boolean scientist_collection_condition_isSlotTwo (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_2"); +} + +// ---------------------------------------------------------------------- + +boolean scientist_collection_condition_playerHasQuestAndCollection (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "u16_nym_themepark_question_scientist_collection") + && getCollectionSlotValue(player, "nym_question_scientist_activation") > 0; +} + +// ---------------------------------------------------------------------- + +boolean scientist_collection_condition_ifNothing (obj_id player, obj_id npc) +{ + return (!scientist_collection_condition_isSlotEight(player, npc) && !scientist_collection_condition_isSlotNine(player, npc) && !scientist_collection_condition_isSlotTen(player, npc) && !scientist_collection_condition_isSlotOne(player, npc) + && !scientist_collection_condition_isSlotTwo(player, npc) && !scientist_collection_condition_isSlotThree(player, npc) && !scientist_collection_condition_isSlotFour(player, npc) && !scientist_collection_condition_isSlotFive(player, npc) + && !scientist_collection_condition_isSlotSix(player, npc) && !scientist_collection_condition_isSlotSeven(player, npc)); +} + +// ---------------------------------------------------------------------- + +boolean scientist_collection_condition_playerAlreadyQuestioned (obj_id player, obj_id npc) +{ + if(!scientist_collection_condition_playerHasQuestAndCollection(player, npc)) + return false; + + string baseSlotName = getStringObjVar(npc, "collection.slotName"); + if(baseSlotName == null || baseSlotName.length() <= 0) + return false; + + string[] splitSlotNames = split(baseSlotName, ':'); + if(splitSlotNames == null || splitSlotNames.length < 0) + return false; + + string slotName = splitSlotNames[1]; + if(slotName == null || slotName.length() <= 0) + return false; + + return hasCompletedCollectionSlot(player, slotName); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void scientist_collection_action_awardSlotOne (obj_id player, obj_id npc) +{ + if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_1")) + { + modifyCollectionSlotValue(player, "icon_nyms_question_scientist_1", 1); + } +} + +// ---------------------------------------------------------------------- + +void scientist_collection_action_awardSlotTwo (obj_id player, obj_id npc) +{ + if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_2")) + { + modifyCollectionSlotValue(player, "icon_nyms_question_scientist_2", 1); + } +} + +// ---------------------------------------------------------------------- + +void scientist_collection_action_awardSlotThree (obj_id player, obj_id npc) +{ if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_3")) + { + modifyCollectionSlotValue(player, "icon_nyms_question_scientist_3", 1); + } +} + +// ---------------------------------------------------------------------- + +void scientist_collection_action_awardSlotFour (obj_id player, obj_id npc) +{ + if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_4")) + { + modifyCollectionSlotValue(player, "icon_nyms_question_scientist_4", 1); + } +} + +// ---------------------------------------------------------------------- + +void scientist_collection_action_awardSlotFive (obj_id player, obj_id npc) +{ + if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_5")) + { + modifyCollectionSlotValue(player, "icon_nyms_question_scientist_5", 1); + } +} + +// ---------------------------------------------------------------------- + +void scientist_collection_action_awardSlotSix (obj_id player, obj_id npc) +{ + if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_6")) + { + modifyCollectionSlotValue(player, "icon_nyms_question_scientist_6", 1); + } +} + +// ---------------------------------------------------------------------- + +void scientist_collection_action_awardSlotSeven (obj_id player, obj_id npc) +{ + if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_7")) + { + modifyCollectionSlotValue(player, "icon_nyms_question_scientist_7", 1); + } +} + +// ---------------------------------------------------------------------- + +void scientist_collection_action_awardSlotEight (obj_id player, obj_id npc) +{ + if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_8")) + { + modifyCollectionSlotValue(player, "icon_nyms_question_scientist_8", 1); + } +} + +// ---------------------------------------------------------------------- + +void scientist_collection_action_awardSlotNine (obj_id player, obj_id npc) +{ + if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_9")) + { + modifyCollectionSlotValue(player, "icon_nyms_question_scientist_9", 1); + } +} + +// ---------------------------------------------------------------------- + +void scientist_collection_action_awardSlotTen (obj_id player, obj_id npc) +{ + if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_10")) + { + modifyCollectionSlotValue(player, "icon_nyms_question_scientist_10", 1); + } +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int scientist_collection_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I'm not telling you anything. + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes, you are. + if (response == "s_6") + { + doAnimationAction (player, "backhand_threaten"); + + //-- [NOTE] + if (scientist_collection_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "taken_aback"); + + //-- NPC: Uh... + string_id message = new string_id (c_stringFile, "s_8"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Tell me about the facility. + boolean hasResponse0 = false; + if (scientist_collection_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_10"); + + utils.setScriptVar (player, "conversation.scientist_collection.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int scientist_collection_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Uh... + + //-- [RESPONSE NOTE] + //-- PLAYER: Tell me about the facility. + if (response == "s_10") + { + doAnimationAction (player, "point_accusingly"); + + //-- [NOTE] + if (scientist_collection_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "scared"); + + //-- NPC: We make weapons...don't hurt me! + string_id message = new string_id (c_stringFile, "s_12"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What do you do? + boolean hasResponse0 = false; + if (scientist_collection_condition_isSlotOne (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Where is the main computer system? + boolean hasResponse1 = false; + if (scientist_collection_condition_isSlotTwo (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Who is in charge here? + boolean hasResponse2 = false; + if (scientist_collection_condition_isSlotThree (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse2 = true; + } + + //-- PLAYER: Who programmed the Droidekas? + boolean hasResponse3 = false; + if (scientist_collection_condition_isSlotFour (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse3 = true; + } + + //-- PLAYER: Where are the IMGGCU? + boolean hasResponse4 = false; + if (scientist_collection_condition_isSlotFive (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse4 = true; + } + + //-- PLAYER: Tell me about grenades. + boolean hasResponse5 = false; + if (scientist_collection_condition_isSlotSix (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse5 = true; + } + + //-- PLAYER: Tell me about rifles. + boolean hasResponse6 = false; + if (scientist_collection_condition_isSlotSeven (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse6 = true; + } + + //-- PLAYER: Tell me about carbines. + boolean hasResponse7 = false; + if (scientist_collection_condition_isSlotEight (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse7 = true; + } + + //-- PLAYER: Tell me about melee weapons. + boolean hasResponse8 = false; + if (scientist_collection_condition_isSlotNine (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse8 = true; + } + + //-- PLAYER: Tell me about experimental weapons. + boolean hasResponse9 = false; + if (scientist_collection_condition_isSlotTen (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse9 = true; + } + + //-- PLAYER: Well, you aren't helpful are you? + boolean hasResponse10 = false; + if (scientist_collection_condition_ifNothing (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse10 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_14"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_17"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_20"); + + if (hasResponse3) + responses [responseIndex++] = new string_id (c_stringFile, "s_26"); + + if (hasResponse4) + responses [responseIndex++] = new string_id (c_stringFile, "s_30"); + + if (hasResponse5) + responses [responseIndex++] = new string_id (c_stringFile, "s_54"); + + if (hasResponse6) + responses [responseIndex++] = new string_id (c_stringFile, "s_58"); + + if (hasResponse7) + responses [responseIndex++] = new string_id (c_stringFile, "s_62"); + + if (hasResponse8) + responses [responseIndex++] = new string_id (c_stringFile, "s_66"); + + if (hasResponse9) + responses [responseIndex++] = new string_id (c_stringFile, "s_70"); + + if (hasResponse10) + responses [responseIndex++] = new string_id (c_stringFile, "s_73"); + + utils.setScriptVar (player, "conversation.scientist_collection.branchId", 4); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int scientist_collection_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: We make weapons...don't hurt me! + + //-- [RESPONSE NOTE] + //-- PLAYER: What do you do? + if (response == "s_14") + { + //-- [NOTE] + if (scientist_collection_condition__defaultCondition (player, npc)) + { + scientist_collection_action_awardSlotOne (player, npc); + + //-- NPC: I'm a scientist, that is why I wear a lab coat. We specialize in different areas such as explosives, chemicals, gasses and so on. We're all here to develop weaponry. + string_id message = new string_id (c_stringFile, "s_21"); + utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Where is the main computer system? + if (response == "s_17") + { + //-- [NOTE] + if (scientist_collection_condition__defaultCondition (player, npc)) + { + scientist_collection_action_awardSlotTwo (player, npc); + + //-- NPC: The main computer system? It is down on the bottom level. Please don't hurt it. Many of us have several months of research on it. + string_id message = new string_id (c_stringFile, "s_22"); + utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Who is in charge here? + if (response == "s_20") + { + //-- [NOTE] + if (scientist_collection_condition__defaultCondition (player, npc)) + { + scientist_collection_action_awardSlotThree (player, npc); + + //-- NPC: Udo Barnet of the mercenaries is probably the person that most likely fills those shoes. The scientists have their own rank based on seniority, but even the most senior still defer to Barnet. + string_id message = new string_id (c_stringFile, "s_24"); + utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Who programmed the Droidekas? + if (response == "s_26") + { + //-- [NOTE] + if (scientist_collection_condition__defaultCondition (player, npc)) + { + scientist_collection_action_awardSlotFour (player, npc); + + //-- NPC: I, I don't know. The Imperials? They are just delivered. Even repairs and maintenance is done off site. I swear it is the truth! + string_id message = new string_id (c_stringFile, "s_28"); + utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Where are the IMGGCU? + if (response == "s_30") + { + //-- [NOTE] + if (scientist_collection_condition__defaultCondition (player, npc)) + { + scientist_collection_action_awardSlotFive (player, npc); + + //-- NPC: We just finished a new prototype. There is a container full of them in a storage room below. + string_id message = new string_id (c_stringFile, "s_32"); + utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Tell me about grenades. + if (response == "s_54") + { + //-- [NOTE] + if (scientist_collection_condition__defaultCondition (player, npc)) + { + scientist_collection_action_awardSlotSix (player, npc); + + //-- NPC: We develop new grenade technologies at this facility. Recently, we received orders to research a new non-lethal gas grenade. + string_id message = new string_id (c_stringFile, "s_56"); + utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Tell me about rifles. + if (response == "s_58") + { + //-- [NOTE] + if (scientist_collection_condition__defaultCondition (player, npc)) + { + scientist_collection_action_awardSlotSeven (player, npc); + + //-- NPC: We have received the funding to research a new blaster sniper rifle that consists of 3 separate pieces that can be much easier to conceal. Probably a special operations type weapon. + string_id message = new string_id (c_stringFile, "s_60"); + utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Tell me about carbines. + if (response == "s_62") + { + //-- [NOTE] + if (scientist_collection_condition__defaultCondition (player, npc)) + { + scientist_collection_action_awardSlotEight (player, npc); + + //-- NPC: We aren't currently working on carbines here. We have a grant for rifle development and another to reverse engineer a Gungan Assault Cannon. + string_id message = new string_id (c_stringFile, "s_64"); + utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Tell me about melee weapons. + if (response == "s_66") + { + //-- [NOTE] + if (scientist_collection_condition__defaultCondition (player, npc)) + { + scientist_collection_action_awardSlotNine (player, npc); + + //-- NPC: There are no melee weapons in development at this facility. + string_id message = new string_id (c_stringFile, "s_68"); + utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Tell me about experimental weapons. + if (response == "s_70") + { + //-- [NOTE] + if (scientist_collection_condition__defaultCondition (player, npc)) + { + scientist_collection_action_awardSlotTen (player, npc); + + //-- NPC: We worked on something we called the 'Anti-Fear Virus'. Basically an airborne pathogen that would make Tie Fighter pilots and Stormtroopers fearless. Unfortunately, it affected their motor skills, making them slow to react. Despite it being deemed as complete scientific failure, the Empire still uses it on its personnel. + string_id message = new string_id (c_stringFile, "s_72"); + utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Well, you aren't helpful are you? + if (response == "s_73") + { + //-- [NOTE] + if (scientist_collection_condition__defaultCondition (player, npc)) + { + //-- NPC: No...my conversation is broken....and it is Jaskell that did it! + string_id message = new string_id (c_stringFile, "s_74"); + utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.scientist_collection"); + + 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.scientist_collection"); + + 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 (scientist_collection_condition_playerAlreadyQuestioned (player, npc)) + { + doAnimationAction (npc, "apologize"); + + //-- NPC: I've already told you everything I know. + string_id message = new string_id (c_stringFile, "s_49"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (scientist_collection_condition_playerHasQuestAndCollection (player, npc)) + { + doAnimationAction (npc, "blame"); + + //-- NPC: I'm not telling you anything. + string_id message = new string_id (c_stringFile, "s_4"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes, you are. + boolean hasResponse0 = false; + if (scientist_collection_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_6"); + + utils.setScriptVar (player, "conversation.scientist_collection.branchId", 2); + + npcStartConversation (player, npc, "scientist_collection", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (scientist_collection_condition__defaultCondition (player, npc)) + { + //-- NPC: I don't have to tell you anything! + string_id message = new string_id (c_stringFile, "s_46"); + 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 != "scientist_collection") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.scientist_collection.branchId"); + + if (branchId == 2 && scientist_collection_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && scientist_collection_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && scientist_collection_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/sheeli.script b/sku.0/sys.server/compiled/game/script/conversation/sheeli.script index aba54076c..03aac53d7 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/sheeli.script +++ b/sku.0/sys.server/compiled/game/script/conversation/sheeli.script @@ -1,471 +1,471 @@ -// ====================================================================== -// -// sheeli.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.create; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/sheeli"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean sheeli_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean sheeli_condition_isRescuer (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "u16_nym_themepark_rescue_sheeli", "rescueSheeli"); -} - -// ---------------------------------------------------------------------- - -boolean sheeli_condition_hasArrived (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "u16_nym_themepark_rescue_sheeli", "waitingForShuttle"); -} - -// ---------------------------------------------------------------------- - -boolean sheeli_condition_isTraveling (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return hasObjVar(npc, "traveling") - && getIntObjVar(npc, "traveling") == 1 - && groundquests.isTaskActive(player, "u16_nym_themepark_rescue_sheeli", "getToPickUp"); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void sheeli_action_startEscort (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasRescuedSheeli"); - ai_lib.aiFollow(npc, player, 1.0f, 3.0f); - - setMovementRun(npc); - setBaseRunSpeed(npc, (getBaseRunSpeed(npc)-8)); - setObjVar(npc, "traveling", 1); - setObjVar(npc, "playerOwner", player); - setInvulnerable(npc, false); - setMaster(npc, player); - messageTo(npc, "checkArrivalLoopHandler", null, 5, false); -} - -// ---------------------------------------------------------------------- - -void sheeli_action_walkFaster (obj_id player, obj_id npc) -{ - setMovementRun(npc); - setBaseRunSpeed(npc, (getBaseRunSpeed(npc)-8)); - ai_lib.aiFollow(npc, player, 1.0f, 3.0f); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int sheeli_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Who are you? You aren't a Sulfur Lake Pirate! - - //-- [RESPONSE NOTE] - //-- PLAYER: No, I'm here to rescue you. - if (response == "s_8") - { - //-- [NOTE] - if (sheeli_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "thank"); - - sheeli_action_startEscort (player, npc); - - //-- NPC: Oh thank you. I thought for sure they were going to kill me. I'll follow you! - string_id message = new string_id (c_stringFile, "s_10"); - utils.removeScriptVar (player, "conversation.sheeli.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.sheeli"); - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; -} - -trigger OnAttach () -{ - setCondition (self, CONDITION_CONVERSABLE); - CustomerServiceLog("nyms_themepark","OnAttach - init."); - messageTo(self, "startFollowingOwner", null, 3, false); - - return SCRIPT_CONTINUE; -} - -trigger OnObjectMenuRequest (obj_id player, menu_info menuInfo) -{ - if(!hasObjVar(self, "quest.owner")) - { - CustomerServiceLog("nyms_themepark","OnObjectMenuRequest - quest.owner not valid."); - messageTo(self, "handleDestroySelf", null, 0, false); - return SCRIPT_OVERRIDE; - } - - if(player != getObjIdObjVar(self, "quest.owner")) - { - CustomerServiceLog("nyms_themepark","OnObjectMenuRequest - quest.owner var found but not valid."); - return SCRIPT_OVERRIDE; - } - - 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.sheeli"); - - return SCRIPT_CONTINUE; -} - -messageHandler handleDestroySelf() -{ - destroyObject(self); - return SCRIPT_CONTINUE; -} - -messageHandler startFollowingOwner() -{ - if(!hasObjVar(self, "quest.owner")) - { - CustomerServiceLog("nyms_themepark","startFollowingOwner - quest.owner not valid."); - messageTo(self, "handleDestroySelf", null, 0, false); - return SCRIPT_CONTINUE; - } - - obj_id owner = getObjIdObjVar(self, "quest.owner"); - if(!isValidId(owner) || !exists(owner)) - { - messageTo(self, "handleDestroySelf", null, 0, false); - return SCRIPT_CONTINUE; - } - setInvulnerable(self, true); - ai_lib.aiFollow(self, owner, 1.0f, 3.0f); - - setMovementRun(self); - setBaseRunSpeed(self, (getBaseRunSpeed(self)-8)); - setObjVar(self, "traveling", 1); - setInvulnerable(self, false); - setMaster(self, owner); - messageTo(self, "checkArrivalLoopHandler", null, 5, false); - - //messageTo(self, "loopForSpeakingTask", null, 0, false); - return SCRIPT_CONTINUE; -} - -messageHandler checkArrivalLoopHandler() -{ - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - Setting move to run."); - setMovementRun(self); - setBaseRunSpeed(self, (getBaseRunSpeed(self)-8)); - - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - init."); - obj_id player = getObjIdObjVar(self, "quest.owner"); - if(!isValidId(player)) - { - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - could not get valid player OID."); - messageTo(self, "handleDestroySelf", null, 1, false); - return SCRIPT_CONTINUE; - } - - if(isDead(player)) - { - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - Player Died."); - failRescueQuest(self); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - player: "+ player); - //The player has failed the quest - if(!groundquests.isQuestActive(player, "u16_nym_themepark_rescue_sheeli")) - { - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - player no longer had required quest active!"); - failRescueQuest(self); - return SCRIPT_CONTINUE; - } - else if(groundquests.isTaskActive(player, "u16_nym_themepark_rescue_sheeli", "waitingForShuttle")) - { - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - Calling SHuttle!"); - callShuttle(self, player); - return SCRIPT_CONTINUE; - } - - ai_lib.aiFollow(self, player, 1.0f, 3.0f); - messageTo(self, "checkArrivalLoopHandler", null, 1, false); - return SCRIPT_CONTINUE; -} - -messageHandler handleUpdatePrisonerRescueQuest() -{ - //NPC could be destroyed or on the way to being destroyed - if(!isValidId(self)) - { - CustomerServiceLog("nyms_themepark","handleUpdatePrisonerRescueQuest - NPC is not a valid OID."); - return SCRIPT_CONTINUE; - } - - obj_id player = getObjIdObjVar(self, "quest.owner"); - if(!isValidId(player)) - { - messageTo(self, "handleDestroySelf", null, 1, false); - CustomerServiceLog("nyms_themepark","handleUpdatePrisonerRescueQuest - could not get valid player OID."); - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(player, "shuttleHasArrived"); - return SCRIPT_CONTINUE; -} - -boolean callShuttle(obj_id self, obj_id player) -{ - CustomerServiceLog("nyms_themepark","callShuttle - Shuttle Called"); - if(!isValidId(player)) - return false; - if(!isValidId(self)) - return false; - - ai_lib.aiStopFollowing(self); - removeObjVar(self, "traveling"); - - location[] prisonerPath = new location[1]; - prisonerPath[0] = new location(-42, 11, 2741, "lok", null); - setYaw(self, 27.0f); - setMovementRun(self); - setBaseRunSpeed(self, (getBaseRunSpeed(self)-8)); - utils.setScriptVar(self, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, prisonerPath); - utils.setScriptVar(self, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - patrolOnce(self, prisonerPath, 0); - - location landLocation = new location(-28, 11, 2759, "lok", null); - obj_id shuttle = create.object("object/creature/npc/theme_park/player_shuttle.iff", landLocation); - if(!isIdValid(shuttle)) - return false; - - //THIS WILL CHANGE THE SHUTTLE TRAJECTORY!!!! - setYaw(shuttle, -140); - detachScript(shuttle, "ai.ai"); - detachScript(shuttle, "ai.creature_combat"); - detachScript(shuttle, "skeleton.humanoid"); - detachScript(shuttle, "systems.combat.combat_actions"); - detachScript(shuttle, "systems.combat.combat_actions_creature"); - detachScript(shuttle, "systems.combat.credit_for_kills"); - stop(shuttle); - - utils.setScriptVar(shuttle, "prisoner", self); - utils.setScriptVar(shuttle, "playerOwner", player); - setPosture(shuttle, POSTURE_PRONE); - attachScript(shuttle, "systems.spawning.dropship.player_shuttle"); - //Land Shuttle - messageTo(shuttle, "landShuttle", null, 0, false); - messageTo(shuttle, "takeOff", null, 37, false); - messageTo(self, "handleUpdatePrisonerRescueQuest", null, 30, false); - messageTo(self, "handleDestroySelf", null, 32, false); - return true; -} - -boolean failRescueQuest(obj_id self) -{ - obj_id player = getObjIdObjVar(self, "quest.owne"); - if(!isValidId(player)) - { - messageTo(self, "handleDestroySelf", null, 1, false); - return false; - } - - groundquests.sendSignal(player, "hasFailedQuest"); - messageTo(self, "handleDestroySelf", null, 1, false); - return true; -} - -// ====================================================================== -// 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 (sheeli_condition_hasArrived (player, npc)) - { - doAnimationAction (npc, "scream"); - - //-- NPC: They are sending a shuttle? Hope it gets here soon. - string_id message = new string_id (c_stringFile, "s_11"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (sheeli_condition_isTraveling (player, npc)) - { - sheeli_action_walkFaster (player, npc); - - //-- NPC: I'm coming, sorry! - string_id message = new string_id (c_stringFile, "s_13"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (sheeli_condition_isRescuer (player, npc)) - { - doAnimationAction (npc, "nervous"); - - //-- NPC: Who are you? You aren't a Sulfur Lake Pirate! - string_id message = new string_id (c_stringFile, "s_6"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: No, I'm here to rescue you. - boolean hasResponse0 = false; - if (sheeli_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_8"); - - utils.setScriptVar (player, "conversation.sheeli.branchId", 3); - - npcStartConversation (player, npc, "sheeli", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (sheeli_condition__defaultCondition (player, npc)) - { - //-- NPC: I'm sorry. I'm busy at the moment. - string_id message = new string_id (c_stringFile, "s_14"); - 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 != "sheeli") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.sheeli.branchId"); - - if (branchId == 3 && sheeli_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.sheeli.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// sheeli.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.create; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/sheeli"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean sheeli_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean sheeli_condition_isRescuer (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "u16_nym_themepark_rescue_sheeli", "rescueSheeli"); +} + +// ---------------------------------------------------------------------- + +boolean sheeli_condition_hasArrived (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "u16_nym_themepark_rescue_sheeli", "waitingForShuttle"); +} + +// ---------------------------------------------------------------------- + +boolean sheeli_condition_isTraveling (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return hasObjVar(npc, "traveling") + && getIntObjVar(npc, "traveling") == 1 + && groundquests.isTaskActive(player, "u16_nym_themepark_rescue_sheeli", "getToPickUp"); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void sheeli_action_startEscort (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasRescuedSheeli"); + ai_lib.aiFollow(npc, player, 1.0f, 3.0f); + + setMovementRun(npc); + setBaseRunSpeed(npc, (getBaseRunSpeed(npc)-8)); + setObjVar(npc, "traveling", 1); + setObjVar(npc, "playerOwner", player); + setInvulnerable(npc, false); + setMaster(npc, player); + messageTo(npc, "checkArrivalLoopHandler", null, 5, false); +} + +// ---------------------------------------------------------------------- + +void sheeli_action_walkFaster (obj_id player, obj_id npc) +{ + setMovementRun(npc); + setBaseRunSpeed(npc, (getBaseRunSpeed(npc)-8)); + ai_lib.aiFollow(npc, player, 1.0f, 3.0f); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int sheeli_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Who are you? You aren't a Sulfur Lake Pirate! + + //-- [RESPONSE NOTE] + //-- PLAYER: No, I'm here to rescue you. + if (response == "s_8") + { + //-- [NOTE] + if (sheeli_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "thank"); + + sheeli_action_startEscort (player, npc); + + //-- NPC: Oh thank you. I thought for sure they were going to kill me. I'll follow you! + string_id message = new string_id (c_stringFile, "s_10"); + utils.removeScriptVar (player, "conversation.sheeli.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.sheeli"); + + setCondition (self, CONDITION_CONVERSABLE); + + return SCRIPT_CONTINUE; +} + +trigger OnAttach () +{ + setCondition (self, CONDITION_CONVERSABLE); + CustomerServiceLog("nyms_themepark","OnAttach - init."); + messageTo(self, "startFollowingOwner", null, 3, false); + + return SCRIPT_CONTINUE; +} + +trigger OnObjectMenuRequest (obj_id player, menu_info menuInfo) +{ + if(!hasObjVar(self, "quest.owner")) + { + CustomerServiceLog("nyms_themepark","OnObjectMenuRequest - quest.owner not valid."); + messageTo(self, "handleDestroySelf", null, 0, false); + return SCRIPT_OVERRIDE; + } + + if(player != getObjIdObjVar(self, "quest.owner")) + { + CustomerServiceLog("nyms_themepark","OnObjectMenuRequest - quest.owner var found but not valid."); + return SCRIPT_OVERRIDE; + } + + 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.sheeli"); + + return SCRIPT_CONTINUE; +} + +messageHandler handleDestroySelf() +{ + destroyObject(self); + return SCRIPT_CONTINUE; +} + +messageHandler startFollowingOwner() +{ + if(!hasObjVar(self, "quest.owner")) + { + CustomerServiceLog("nyms_themepark","startFollowingOwner - quest.owner not valid."); + messageTo(self, "handleDestroySelf", null, 0, false); + return SCRIPT_CONTINUE; + } + + obj_id owner = getObjIdObjVar(self, "quest.owner"); + if(!isValidId(owner) || !exists(owner)) + { + messageTo(self, "handleDestroySelf", null, 0, false); + return SCRIPT_CONTINUE; + } + setInvulnerable(self, true); + ai_lib.aiFollow(self, owner, 1.0f, 3.0f); + + setMovementRun(self); + setBaseRunSpeed(self, (getBaseRunSpeed(self)-8)); + setObjVar(self, "traveling", 1); + setInvulnerable(self, false); + setMaster(self, owner); + messageTo(self, "checkArrivalLoopHandler", null, 5, false); + + //messageTo(self, "loopForSpeakingTask", null, 0, false); + return SCRIPT_CONTINUE; +} + +messageHandler checkArrivalLoopHandler() +{ + CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - Setting move to run."); + setMovementRun(self); + setBaseRunSpeed(self, (getBaseRunSpeed(self)-8)); + + CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - init."); + obj_id player = getObjIdObjVar(self, "quest.owner"); + if(!isValidId(player)) + { + CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - could not get valid player OID."); + messageTo(self, "handleDestroySelf", null, 1, false); + return SCRIPT_CONTINUE; + } + + if(isDead(player)) + { + CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - Player Died."); + failRescueQuest(self); + return SCRIPT_CONTINUE; + } + + CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - player: "+ player); + //The player has failed the quest + if(!groundquests.isQuestActive(player, "u16_nym_themepark_rescue_sheeli")) + { + CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - player no longer had required quest active!"); + failRescueQuest(self); + return SCRIPT_CONTINUE; + } + else if(groundquests.isTaskActive(player, "u16_nym_themepark_rescue_sheeli", "waitingForShuttle")) + { + CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - Calling SHuttle!"); + callShuttle(self, player); + return SCRIPT_CONTINUE; + } + + ai_lib.aiFollow(self, player, 1.0f, 3.0f); + messageTo(self, "checkArrivalLoopHandler", null, 1, false); + return SCRIPT_CONTINUE; +} + +messageHandler handleUpdatePrisonerRescueQuest() +{ + //NPC could be destroyed or on the way to being destroyed + if(!isValidId(self)) + { + CustomerServiceLog("nyms_themepark","handleUpdatePrisonerRescueQuest - NPC is not a valid OID."); + return SCRIPT_CONTINUE; + } + + obj_id player = getObjIdObjVar(self, "quest.owner"); + if(!isValidId(player)) + { + messageTo(self, "handleDestroySelf", null, 1, false); + CustomerServiceLog("nyms_themepark","handleUpdatePrisonerRescueQuest - could not get valid player OID."); + return SCRIPT_CONTINUE; + } + + groundquests.sendSignal(player, "shuttleHasArrived"); + return SCRIPT_CONTINUE; +} + +boolean callShuttle(obj_id self, obj_id player) +{ + CustomerServiceLog("nyms_themepark","callShuttle - Shuttle Called"); + if(!isValidId(player)) + return false; + if(!isValidId(self)) + return false; + + ai_lib.aiStopFollowing(self); + removeObjVar(self, "traveling"); + + location[] prisonerPath = new location[1]; + prisonerPath[0] = new location(-42, 11, 2741, "lok", null); + setYaw(self, 27.0f); + setMovementRun(self); + setBaseRunSpeed(self, (getBaseRunSpeed(self)-8)); + utils.setScriptVar(self, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, prisonerPath); + utils.setScriptVar(self, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); + patrolOnce(self, prisonerPath, 0); + + location landLocation = new location(-28, 11, 2759, "lok", null); + obj_id shuttle = create.object("object/creature/npc/theme_park/player_shuttle.iff", landLocation); + if(!isIdValid(shuttle)) + return false; + + //THIS WILL CHANGE THE SHUTTLE TRAJECTORY!!!! + setYaw(shuttle, -140); + detachScript(shuttle, "ai.ai"); + detachScript(shuttle, "ai.creature_combat"); + detachScript(shuttle, "skeleton.humanoid"); + detachScript(shuttle, "systems.combat.combat_actions"); + detachScript(shuttle, "systems.combat.combat_actions_creature"); + detachScript(shuttle, "systems.combat.credit_for_kills"); + stop(shuttle); + + utils.setScriptVar(shuttle, "prisoner", self); + utils.setScriptVar(shuttle, "playerOwner", player); + setPosture(shuttle, POSTURE_PRONE); + attachScript(shuttle, "systems.spawning.dropship.player_shuttle"); + //Land Shuttle + messageTo(shuttle, "landShuttle", null, 0, false); + messageTo(shuttle, "takeOff", null, 37, false); + messageTo(self, "handleUpdatePrisonerRescueQuest", null, 30, false); + messageTo(self, "handleDestroySelf", null, 32, false); + return true; +} + +boolean failRescueQuest(obj_id self) +{ + obj_id player = getObjIdObjVar(self, "quest.owne"); + if(!isValidId(player)) + { + messageTo(self, "handleDestroySelf", null, 1, false); + return false; + } + + groundquests.sendSignal(player, "hasFailedQuest"); + messageTo(self, "handleDestroySelf", null, 1, false); + return true; +} + +// ====================================================================== +// 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 (sheeli_condition_hasArrived (player, npc)) + { + doAnimationAction (npc, "scream"); + + //-- NPC: They are sending a shuttle? Hope it gets here soon. + string_id message = new string_id (c_stringFile, "s_11"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (sheeli_condition_isTraveling (player, npc)) + { + sheeli_action_walkFaster (player, npc); + + //-- NPC: I'm coming, sorry! + string_id message = new string_id (c_stringFile, "s_13"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (sheeli_condition_isRescuer (player, npc)) + { + doAnimationAction (npc, "nervous"); + + //-- NPC: Who are you? You aren't a Sulfur Lake Pirate! + string_id message = new string_id (c_stringFile, "s_6"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: No, I'm here to rescue you. + boolean hasResponse0 = false; + if (sheeli_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_8"); + + utils.setScriptVar (player, "conversation.sheeli.branchId", 3); + + npcStartConversation (player, npc, "sheeli", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (sheeli_condition__defaultCondition (player, npc)) + { + //-- NPC: I'm sorry. I'm busy at the moment. + string_id message = new string_id (c_stringFile, "s_14"); + 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 != "sheeli") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.sheeli.branchId"); + + if (branchId == 3 && sheeli_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.sheeli.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/shuttle_control_terminal.script b/sku.0/sys.server/compiled/game/script/conversation/shuttle_control_terminal.script index 6d4c1804c..b9f241521 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/shuttle_control_terminal.script +++ b/sku.0/sys.server/compiled/game/script/conversation/shuttle_control_terminal.script @@ -1,566 +1,566 @@ -// ====================================================================== -// -// shuttle_control_terminal.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.create; -include library.features; -include library.groundquests; -include library.space_quest; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/shuttle_control_terminal"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean shuttle_control_terminal_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean shuttle_control_terminal_condition_hasQuest (obj_id player, obj_id npc) -{ - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); -} - -// ---------------------------------------------------------------------- - -boolean shuttle_control_terminal_condition_hasGroup (obj_id player, obj_id npc) -{ - obj_id groupid = getGroupObject(player); - if(!isValidId(groupid)) - { - //systemMessageTestingOnly(player, "no group"); - return false; - } - return true; -} - -// ---------------------------------------------------------------------- - -boolean shuttle_control_terminal_condition_grantPermissionLandTask (obj_id player, obj_id npc) -{ - return groundquests.isTaskActive(player, "u16_nym_themepark_shuttle_ambush", "grantPermissionToLand"); -} - -// ---------------------------------------------------------------------- - -boolean shuttle_control_terminal_condition_hasQuestAndGroup (obj_id player, obj_id npc) -{ - if(!shuttle_control_terminal_condition_hasGroup(player,npc)) - return false; - if(!shuttle_control_terminal_condition_hasQuest(player,npc)) - return false; - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); -} - -// ---------------------------------------------------------------------- - -boolean shuttle_control_terminal_condition_wave_event_active (obj_id player, obj_id npc) -{ - if(utils.hasScriptVar(npc, "terminalLocked")) - return true; - - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void shuttle_control_terminal_action_createShuttleSendSignal (obj_id player, obj_id npc) -{ - //Tell the controller we are busy. - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 0, false); - - //Force the terminal to be occupied. - utils.setScriptVar(npc, "terminalLocked", 1); - messageTo(npc, "removeTerminalLock", null, 90, false); - - location landLocation = new location( 475.3f, 12.3f, 4867.6f, "lok", null); - obj_id shuttle = create.object("object/creature/npc/theme_park/player_shuttle.iff", landLocation); - if(!isIdValid(shuttle)) - return; - - //THIS WILL CHANGE THE SHUTTLE TRAJECTORY!!!! - setYaw(shuttle, 75); - detachScript(shuttle, "ai.ai"); - detachScript(shuttle, "ai.creature_combat"); - detachScript(shuttle, "skeleton.humanoid"); - detachScript(shuttle, "systems.combat.combat_actions"); - detachScript(shuttle, "systems.combat.combat_actions_creature"); - detachScript(shuttle, "systems.combat.credit_for_kills"); - stop(shuttle); - - utils.setScriptVar(shuttle, "terminal", npc); - utils.setScriptVar(shuttle, "owner", player); - setPosture(shuttle, POSTURE_PRONE); - attachScript(shuttle, "systems.spawning.dropship.player_shuttle"); - - messageTo(shuttle, "landShuttle", null, 2, false); - groundquests.sendSignal(player, "hasGrantedPermissionToLand"); - - location explosionLocaitonList[] = new location[6]; - explosionLocaitonList[0] = new location(475, 12, 4867, "lok", null); - explosionLocaitonList[1] = new location(469, 12, 4867, "lok", null); - explosionLocaitonList[2] = new location(471, 12, 4864, "lok", null); - explosionLocaitonList[3] = new location(477, 12, 4864, "lok", null); - explosionLocaitonList[4] = new location(480, 12, 4871, "lok", null); - explosionLocaitonList[5] = new location(472, 12, 4872, "lok", null); - - dictionary webster = new dictionary(); - webster.put("player", player); - webster.put("explosionLocaitonList", explosionLocaitonList); - - /* - PROGRESS PLAYER TO NEXT TASK - */ - messageTo(npc, "signalPlayerEnvoy", webster, 32, false); - - /* - THIS IS WHERE THE WAVE EVENT STARTS (IN TRIGGERS) - */ - messageTo(npc, "spawnEnemies", webster, 35, false); - - /* - THIS IS WHERE NYM SPAWNS - */ - messageTo(npc, "spawnHeroes", webster, 42, false); - - /* - TELL THE SHUTTLE TO BLOW UP - */ - messageTo(shuttle, "explodeThenDestroySelf", webster, 120, false); - - -} - -// ---------------------------------------------------------------------- - -void shuttle_control_terminal_action_unauthorizedUse (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); -} - -// ---------------------------------------------------------------------- - -void shuttle_control_terminal_action_busyWithOtherPlayer (obj_id player, obj_id npc) -{ - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int shuttle_control_terminal_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Authorization accepted. Landing Clearance Control. Select operation. - - //-- [RESPONSE NOTE] - //-- PLAYER: Disable Defenses for Landing - if (response == "s_36") - { - //-- [NOTE] - if (shuttle_control_terminal_condition__defaultCondition (player, npc)) - { - shuttle_control_terminal_action_createShuttleSendSignal (player, npc); - - //-- NPC: Command accepted. Lowering defenses for shuttle landing. - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.shuttle_control_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int shuttle_control_terminal_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Unauthorized access. Security notified. - - //-- [RESPONSE NOTE] - //-- PLAYER: Log Off - if (response == "s_9") - { - //-- [NOTE] - if (shuttle_control_terminal_condition__defaultCondition (player, npc)) - { - //-- NPC: Have a nice day! - string_id message = new string_id (c_stringFile, "s_10"); - utils.removeScriptVar (player, "conversation.shuttle_control_terminal.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; -} - -messageHandler signalPlayerEnvoy() -{ - if(params == null) - { - return SCRIPT_CONTINUE; - } - obj_id player = params.getObjId("player"); - if(!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - if(!groundquests.isTaskActive(player, "u16_nym_themepark_shuttle_ambush", "greetEnvoy")) - { - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(player, "hasGreetedEnvoy"); - return SCRIPT_CONTINUE; -} - -messageHandler spawnEnemies() -{ - if(params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; -} - -messageHandler handleQuestFlavorObjectCleanup() -{ - if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if(objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for(int i = 0; 1 < objList.length; i++) - { - if(!isValidId(objList[i])) - continue; - - messageTo(objList[i], "destroySelf", null, 0, false); - } - return SCRIPT_CONTINUE; -} - -messageHandler spawnHeroes() -{ - LOG("nym_themepark_log", "spawnHeroes: init"); - obj_id player = utils.getObjIdScriptVar(self, "waveEventPlayer"); - if(!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - LOG("nym_themepark_log", "spawnHeroes: player OID received: "+player); - location locNymSpawn = new location(471, 13, 4833, "lok", null); - obj_id nym = create.object("nym_themepark_nym_ambush", locNymSpawn); - if(isValidId(nym)) - { - LOG("nym_themepark_log", "spawnHeroes: Nym Created: "+nym); - setObjVar(nym, "parent", self); - location[] locNymPath = new location[1]; - locNymPath[0] = new location(459, 12, 4854, "lok", null); - setYaw(nym, -6.0f); - setMovementRun(nym); - setBaseRunSpeed(nym, (getBaseRunSpeed(nym)-8)); - setInvulnerable(nym, false); - utils.setScriptVar(nym, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, locNymPath); - utils.setScriptVar(nym, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - patrolOnce(nym, locNymPath, 0); - //LOG("nym_themepark_log", "spawnHeroes: Nym set to follow: "+player); - //ai_lib.aiFollow(nym, player, 1.0f, 8.0f); - } - - location locKoleSpawn = new location(465, 13, 4832, "lok", null); - obj_id kole = create.object("nym_themepark_kole_ambush", locKoleSpawn); - if(isValidId(kole)) - { - setObjVar(kole, "parent", self); - location[] locKolePath = new location[1]; - locKolePath[0] = new location(469, 12, 4851, "lok", null); - setYaw(kole, -6.0f); - setMovementRun(kole); - setBaseRunSpeed(kole, (getBaseRunSpeed(kole)-8)); - setInvulnerable(kole, false); - utils.setScriptVar(kole, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, locKolePath); - utils.setScriptVar(kole, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - patrolOnce(kole, locKolePath, 0); - //ai_lib.aiFollow(kole, target, 1.0f, 8.0f); - } - - location locVanaSpawn = new location(480, 13, 4833, "lok", null); - obj_id vana = create.object("nym_themepark_vana_ambush", locVanaSpawn); - if(isValidId(vana)) - { - setObjVar(vana, "parent", self); - location[] locVanaPath = new location[1]; - locVanaPath[0] = new location(469, 12, 4851, "lok", null); - setYaw(vana, -6.0f); - setMovementRun(vana); - setBaseRunSpeed(vana, (getBaseRunSpeed(vana)-8)); - setInvulnerable(vana, false); - utils.setScriptVar(vana, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, locVanaPath); - utils.setScriptVar(vana, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - patrolOnce(vana, locVanaPath, 0); - } - - location locJinkinsSpawn = new location(487, 13, 4831, "lok", null); - obj_id jinkins = create.object("nym_themepark_jinkins_ambush", locJinkinsSpawn); - if(isValidId(jinkins)) - { - setObjVar(jinkins, "parent", self); - location[] locJinkinsPath = new location[1]; - locJinkinsPath[0] = new location(484, 12, 4852, "lok", null); - setYaw(jinkins, -6.0f); - setMovementRun(jinkins); - setBaseRunSpeed(jinkins, (getBaseRunSpeed(jinkins)-8)); - setInvulnerable(jinkins, false); - utils.setScriptVar(jinkins, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, locJinkinsPath); - utils.setScriptVar(jinkins, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - patrolOnce(jinkins, locJinkinsPath, 0); - } - - obj_id objectList[] = new obj_id[4]; - objectList[0] = vana; - objectList[1] = jinkins; - objectList[2] = kole; - objectList[3] = nym; - - utils.setScriptVar(self, "handleQuestFlavorObjectCleanup", objectList); - - return SCRIPT_CONTINUE; -} - -messageHandler removeTerminalLock() -{ - utils.removeScriptVar(self, "terminalLocked"); - 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 (shuttle_control_terminal_condition_wave_event_active (player, npc)) - { - //-- NPC: Terminal busy. - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (shuttle_control_terminal_condition_grantPermissionLandTask (player, npc)) - { - //-- NPC: Authorization accepted. Landing Clearance Control. Select operation. - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Disable Defenses for Landing - boolean hasResponse0 = false; - if (shuttle_control_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_36"); - - utils.setScriptVar (player, "conversation.shuttle_control_terminal.branchId", 2); - - npcStartConversation (player, npc, "shuttle_control_terminal", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (shuttle_control_terminal_condition__defaultCondition (player, npc)) - { - shuttle_control_terminal_action_unauthorizedUse (player, npc); - - //-- NPC: Unauthorized access. Security notified. - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Log Off - boolean hasResponse0 = false; - if (shuttle_control_terminal_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_9"); - - utils.setScriptVar (player, "conversation.shuttle_control_terminal.branchId", 4); - - npcStartConversation (player, npc, "shuttle_control_terminal", 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 != "shuttle_control_terminal") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.shuttle_control_terminal.branchId"); - - if (branchId == 2 && shuttle_control_terminal_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 4 && shuttle_control_terminal_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.shuttle_control_terminal.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// shuttle_control_terminal.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.create; +include library.features; +include library.groundquests; +include library.space_quest; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/shuttle_control_terminal"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean shuttle_control_terminal_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean shuttle_control_terminal_condition_hasQuest (obj_id player, obj_id npc) +{ + return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); +} + +// ---------------------------------------------------------------------- + +boolean shuttle_control_terminal_condition_hasGroup (obj_id player, obj_id npc) +{ + obj_id groupid = getGroupObject(player); + if(!isValidId(groupid)) + { + //systemMessageTestingOnly(player, "no group"); + return false; + } + return true; +} + +// ---------------------------------------------------------------------- + +boolean shuttle_control_terminal_condition_grantPermissionLandTask (obj_id player, obj_id npc) +{ + return groundquests.isTaskActive(player, "u16_nym_themepark_shuttle_ambush", "grantPermissionToLand"); +} + +// ---------------------------------------------------------------------- + +boolean shuttle_control_terminal_condition_hasQuestAndGroup (obj_id player, obj_id npc) +{ + if(!shuttle_control_terminal_condition_hasGroup(player,npc)) + return false; + if(!shuttle_control_terminal_condition_hasQuest(player,npc)) + return false; + return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); +} + +// ---------------------------------------------------------------------- + +boolean shuttle_control_terminal_condition_wave_event_active (obj_id player, obj_id npc) +{ + if(utils.hasScriptVar(npc, "terminalLocked")) + return true; + + int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); + return wave > 0; +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void shuttle_control_terminal_action_createShuttleSendSignal (obj_id player, obj_id npc) +{ + //Tell the controller we are busy. + dictionary dict = new dictionary(); + dict.put("player", player); + messageTo(npc, "waveEventControllerNPCStart", dict, 0, false); + + //Force the terminal to be occupied. + utils.setScriptVar(npc, "terminalLocked", 1); + messageTo(npc, "removeTerminalLock", null, 90, false); + + location landLocation = new location( 475.3f, 12.3f, 4867.6f, "lok", null); + obj_id shuttle = create.object("object/creature/npc/theme_park/player_shuttle.iff", landLocation); + if(!isIdValid(shuttle)) + return; + + //THIS WILL CHANGE THE SHUTTLE TRAJECTORY!!!! + setYaw(shuttle, 75); + detachScript(shuttle, "ai.ai"); + detachScript(shuttle, "ai.creature_combat"); + detachScript(shuttle, "skeleton.humanoid"); + detachScript(shuttle, "systems.combat.combat_actions"); + detachScript(shuttle, "systems.combat.combat_actions_creature"); + detachScript(shuttle, "systems.combat.credit_for_kills"); + stop(shuttle); + + utils.setScriptVar(shuttle, "terminal", npc); + utils.setScriptVar(shuttle, "owner", player); + setPosture(shuttle, POSTURE_PRONE); + attachScript(shuttle, "systems.spawning.dropship.player_shuttle"); + + messageTo(shuttle, "landShuttle", null, 2, false); + groundquests.sendSignal(player, "hasGrantedPermissionToLand"); + + location explosionLocaitonList[] = new location[6]; + explosionLocaitonList[0] = new location(475, 12, 4867, "lok", null); + explosionLocaitonList[1] = new location(469, 12, 4867, "lok", null); + explosionLocaitonList[2] = new location(471, 12, 4864, "lok", null); + explosionLocaitonList[3] = new location(477, 12, 4864, "lok", null); + explosionLocaitonList[4] = new location(480, 12, 4871, "lok", null); + explosionLocaitonList[5] = new location(472, 12, 4872, "lok", null); + + dictionary webster = new dictionary(); + webster.put("player", player); + webster.put("explosionLocaitonList", explosionLocaitonList); + + /* + PROGRESS PLAYER TO NEXT TASK + */ + messageTo(npc, "signalPlayerEnvoy", webster, 32, false); + + /* + THIS IS WHERE THE WAVE EVENT STARTS (IN TRIGGERS) + */ + messageTo(npc, "spawnEnemies", webster, 35, false); + + /* + THIS IS WHERE NYM SPAWNS + */ + messageTo(npc, "spawnHeroes", webster, 42, false); + + /* + TELL THE SHUTTLE TO BLOW UP + */ + messageTo(shuttle, "explodeThenDestroySelf", webster, 120, false); + + +} + +// ---------------------------------------------------------------------- + +void shuttle_control_terminal_action_unauthorizedUse (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); + chat.chat(npc, barkString); +} + +// ---------------------------------------------------------------------- + +void shuttle_control_terminal_action_busyWithOtherPlayer (obj_id player, obj_id npc) +{ + string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); + chat.chat(npc, barkString); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int shuttle_control_terminal_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Authorization accepted. Landing Clearance Control. Select operation. + + //-- [RESPONSE NOTE] + //-- PLAYER: Disable Defenses for Landing + if (response == "s_36") + { + //-- [NOTE] + if (shuttle_control_terminal_condition__defaultCondition (player, npc)) + { + shuttle_control_terminal_action_createShuttleSendSignal (player, npc); + + //-- NPC: Command accepted. Lowering defenses for shuttle landing. + string_id message = new string_id (c_stringFile, "s_37"); + utils.removeScriptVar (player, "conversation.shuttle_control_terminal.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int shuttle_control_terminal_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Unauthorized access. Security notified. + + //-- [RESPONSE NOTE] + //-- PLAYER: Log Off + if (response == "s_9") + { + //-- [NOTE] + if (shuttle_control_terminal_condition__defaultCondition (player, npc)) + { + //-- NPC: Have a nice day! + string_id message = new string_id (c_stringFile, "s_10"); + utils.removeScriptVar (player, "conversation.shuttle_control_terminal.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; +} + +messageHandler signalPlayerEnvoy() +{ + if(params == null) + { + return SCRIPT_CONTINUE; + } + obj_id player = params.getObjId("player"); + if(!isValidId(player)) + { + return SCRIPT_CONTINUE; + } + + if(!groundquests.isTaskActive(player, "u16_nym_themepark_shuttle_ambush", "greetEnvoy")) + { + return SCRIPT_CONTINUE; + } + + groundquests.sendSignal(player, "hasGreetedEnvoy"); + return SCRIPT_CONTINUE; +} + +messageHandler spawnEnemies() +{ + if(params == null) + { + return SCRIPT_CONTINUE; + } + + messageTo(self, "waveEventControllerNPCStart", params, 0, false); + return SCRIPT_CONTINUE; +} + +messageHandler handleQuestFlavorObjectCleanup() +{ + if(!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) + { + return SCRIPT_CONTINUE; + } + + obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); + if(objList == null || objList.length <= 0) + { + return SCRIPT_CONTINUE; + } + + for(int i = 0; 1 < objList.length; i++) + { + if(!isValidId(objList[i])) + continue; + + messageTo(objList[i], "destroySelf", null, 0, false); + } + return SCRIPT_CONTINUE; +} + +messageHandler spawnHeroes() +{ + LOG("nym_themepark_log", "spawnHeroes: init"); + obj_id player = utils.getObjIdScriptVar(self, "waveEventPlayer"); + if(!isValidId(player)) + { + return SCRIPT_CONTINUE; + } + + LOG("nym_themepark_log", "spawnHeroes: player OID received: "+player); + location locNymSpawn = new location(471, 13, 4833, "lok", null); + obj_id nym = create.object("nym_themepark_nym_ambush", locNymSpawn); + if(isValidId(nym)) + { + LOG("nym_themepark_log", "spawnHeroes: Nym Created: "+nym); + setObjVar(nym, "parent", self); + location[] locNymPath = new location[1]; + locNymPath[0] = new location(459, 12, 4854, "lok", null); + setYaw(nym, -6.0f); + setMovementRun(nym); + setBaseRunSpeed(nym, (getBaseRunSpeed(nym)-8)); + setInvulnerable(nym, false); + utils.setScriptVar(nym, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, locNymPath); + utils.setScriptVar(nym, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); + patrolOnce(nym, locNymPath, 0); + //LOG("nym_themepark_log", "spawnHeroes: Nym set to follow: "+player); + //ai_lib.aiFollow(nym, player, 1.0f, 8.0f); + } + + location locKoleSpawn = new location(465, 13, 4832, "lok", null); + obj_id kole = create.object("nym_themepark_kole_ambush", locKoleSpawn); + if(isValidId(kole)) + { + setObjVar(kole, "parent", self); + location[] locKolePath = new location[1]; + locKolePath[0] = new location(469, 12, 4851, "lok", null); + setYaw(kole, -6.0f); + setMovementRun(kole); + setBaseRunSpeed(kole, (getBaseRunSpeed(kole)-8)); + setInvulnerable(kole, false); + utils.setScriptVar(kole, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, locKolePath); + utils.setScriptVar(kole, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); + patrolOnce(kole, locKolePath, 0); + //ai_lib.aiFollow(kole, target, 1.0f, 8.0f); + } + + location locVanaSpawn = new location(480, 13, 4833, "lok", null); + obj_id vana = create.object("nym_themepark_vana_ambush", locVanaSpawn); + if(isValidId(vana)) + { + setObjVar(vana, "parent", self); + location[] locVanaPath = new location[1]; + locVanaPath[0] = new location(469, 12, 4851, "lok", null); + setYaw(vana, -6.0f); + setMovementRun(vana); + setBaseRunSpeed(vana, (getBaseRunSpeed(vana)-8)); + setInvulnerable(vana, false); + utils.setScriptVar(vana, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, locVanaPath); + utils.setScriptVar(vana, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); + patrolOnce(vana, locVanaPath, 0); + } + + location locJinkinsSpawn = new location(487, 13, 4831, "lok", null); + obj_id jinkins = create.object("nym_themepark_jinkins_ambush", locJinkinsSpawn); + if(isValidId(jinkins)) + { + setObjVar(jinkins, "parent", self); + location[] locJinkinsPath = new location[1]; + locJinkinsPath[0] = new location(484, 12, 4852, "lok", null); + setYaw(jinkins, -6.0f); + setMovementRun(jinkins); + setBaseRunSpeed(jinkins, (getBaseRunSpeed(jinkins)-8)); + setInvulnerable(jinkins, false); + utils.setScriptVar(jinkins, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, locJinkinsPath); + utils.setScriptVar(jinkins, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); + patrolOnce(jinkins, locJinkinsPath, 0); + } + + obj_id objectList[] = new obj_id[4]; + objectList[0] = vana; + objectList[1] = jinkins; + objectList[2] = kole; + objectList[3] = nym; + + utils.setScriptVar(self, "handleQuestFlavorObjectCleanup", objectList); + + return SCRIPT_CONTINUE; +} + +messageHandler removeTerminalLock() +{ + utils.removeScriptVar(self, "terminalLocked"); + 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 (shuttle_control_terminal_condition_wave_event_active (player, npc)) + { + //-- NPC: Terminal busy. + string_id message = new string_id (c_stringFile, "s_7"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (shuttle_control_terminal_condition_grantPermissionLandTask (player, npc)) + { + //-- NPC: Authorization accepted. Landing Clearance Control. Select operation. + string_id message = new string_id (c_stringFile, "s_35"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Disable Defenses for Landing + boolean hasResponse0 = false; + if (shuttle_control_terminal_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_36"); + + utils.setScriptVar (player, "conversation.shuttle_control_terminal.branchId", 2); + + npcStartConversation (player, npc, "shuttle_control_terminal", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (shuttle_control_terminal_condition__defaultCondition (player, npc)) + { + shuttle_control_terminal_action_unauthorizedUse (player, npc); + + //-- NPC: Unauthorized access. Security notified. + string_id message = new string_id (c_stringFile, "s_34"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Log Off + boolean hasResponse0 = false; + if (shuttle_control_terminal_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_9"); + + utils.setScriptVar (player, "conversation.shuttle_control_terminal.branchId", 4); + + npcStartConversation (player, npc, "shuttle_control_terminal", 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 != "shuttle_control_terminal") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.shuttle_control_terminal.branchId"); + + if (branchId == 2 && shuttle_control_terminal_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 4 && shuttle_control_terminal_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.shuttle_control_terminal.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/vana_sage.script b/sku.0/sys.server/compiled/game/script/conversation/vana_sage.script index 36253cce8..27724111f 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/vana_sage.script +++ b/sku.0/sys.server/compiled/game/script/conversation/vana_sage.script @@ -1,2433 +1,2433 @@ -// ====================================================================== -// -// vana_sage.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.collection; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/vana_sage"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean vana_sage_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean vana_sage_condition_hasInitialQuestTask (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, "u16_nym_themepark_pointer_01") - || groundquests.hasCompletedQuest(player, "u16_nym_themepark_pointer_02") - && !groundquests.isQuestActive(player, "u16_nym_themepark_interview_choster")) - || (groundquests.isTaskActive(player, "u16_nym_themepark_pointer_01", "findVanaSage") - || groundquests.isTaskActive(player, "u16_nym_themepark_pointer_02", "findVanaSage")); -} - -// ---------------------------------------------------------------------- - -boolean vana_sage_condition_hasntSpokenChosterHasQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, "u16_nym_themepark_pointer_01") - || groundquests.hasCompletedQuest(player, "u16_nym_themepark_pointer_02")) - && (groundquests.isQuestActive(player, "u16_nym_themepark_interview_choster")); -} - -// ---------------------------------------------------------------------- - -boolean vana_sage_condition_hasNotCompletedChoster (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_interview_choster"); -} - -// ---------------------------------------------------------------------- - -boolean vana_sage_condition_playerIsHighLvl (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return getLevel(player) >= 56; -} - -// ---------------------------------------------------------------------- - -boolean vana_sage_condition_hasMetChoster (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_interview_choster", "tellVanaChosterMsg"); -} - -// ---------------------------------------------------------------------- - -boolean vana_sage_condition_metChosterNoPirateQuest (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_interview_choster") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_hideout"); -} - -// ---------------------------------------------------------------------- - -boolean vana_sage_condition_hasntCompletedPirate (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_pirate_hideout"); -} - -// ---------------------------------------------------------------------- - -boolean vana_sage_condition_hasReturnedWithDroid (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "returnPirateComplete"); -} - -// ---------------------------------------------------------------------- - -boolean vana_sage_condition_hasCompletedPirate (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout"); -} - -// ---------------------------------------------------------------------- - -boolean vana_sage_condition_allQuestsComplete (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_vana_to_jinkins"); -} - -// ---------------------------------------------------------------------- - -boolean vana_sage_condition_hasCompletedThemePark (obj_id player, obj_id npc) -{ - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_shuttle_ambush"); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void vana_sage_action_giveChosterQuest (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_interview_choster"); -} - -// ---------------------------------------------------------------------- - -void vana_sage_action_finishInitialQuest (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundVanaSage"); -} - -// ---------------------------------------------------------------------- - -void vana_sage_action_givePirateQuest (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_pirate_hideout"); - - if(!hasCompletedCollectionSlot(player, "kill_nyms_themepark_sulfur_lake_pirate_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_sulfur_lake_pirate_activate", 1); - } -} - -// ---------------------------------------------------------------------- - -void vana_sage_action_finishChoster (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasToldVanaChosterMsg"); -} - -// ---------------------------------------------------------------------- - -void vana_sage_action_finishPirateQuest (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasCompletedPirate"); -} - -// ---------------------------------------------------------------------- - -void vana_sage_action_gotoJinkins (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_vana_to_jinkins"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int vana_sage_handleBranch4 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: One of our operatives, a slicer who has infiltrated the Sulfur Pirate lair, said that he worked with you to slice the back room. Did you retrieve the module? - - //-- [RESPONSE NOTE] - //-- PLAYER: Yes, I have it right here. - if (response == "s_90") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "thumb_up"); - - vana_sage_action_finishPirateQuest (player, npc); - - //-- NPC: Securing that memory module proves that you have the makings of a true pirate. I'm sure you'll go far with the Lok Revenants. Return to me when you are ready for more work. - string_id message = new string_id (c_stringFile, "s_91"); - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch7 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: What happened? Looks like you don't have your next mission. - - //-- [RESPONSE NOTE] - //-- PLAYER: What was I supposed to do again? - if (response == "s_101") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: Our scouts learned that the Sulfur Lake Pirates have already taken the cargo - including the droid - from the crashed starship, so you won't need to look through the wreckage. Just head to the pirates' lair, locate the droid, and grab the memory module. Oh, and watch out for the pirates' 'bridge troll.' I'm not sure what that is, but it sounds dangerous. I've placed a new waypoint in your datapad. - string_id message = new string_id (c_stringFile, "s_71"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm on my way. - boolean hasResponse0 = false; - if (vana_sage_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_95"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: How was your meeting with Choster? - - //-- [RESPONSE NOTE] - //-- PLAYER: How do you know...? - if (response == "s_68") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - //-- NPC: I'm the head of security. You'll be glad to know that my intuition was correct and you didn't waste your time speaking with Choster. - string_id message = new string_id (c_stringFile, "s_69"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Oh? - boolean hasResponse0 = false; - if (vana_sage_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_70"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I'm the head of security. You'll be glad to know that my intuition was correct and you didn't waste your time speaking with Choster. - - //-- [RESPONSE NOTE] - //-- PLAYER: Oh? - if (response == "s_70") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: Our scouts learned that the Sulfur Lake Pirates have already taken the cargo - including the droid - from the crashed starship, so you won't need to look through the wreckage. Just head to the pirates' lair, locate the droid, and grab the memory module. Oh, and watch out for the pirates' 'bridge troll.' I'm not sure what that is, but it sounds dangerous. I've placed a new waypoint in your datapad. - string_id message = new string_id (c_stringFile, "s_71"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'm on my way. - boolean hasResponse0 = false; - if (vana_sage_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_95"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch10 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Our scouts learned that the Sulfur Lake Pirates have already taken the cargo - including the droid - from the crashed starship, so you won't need to look through the wreckage. Just head to the pirates' lair, locate the droid, and grab the memory module. Oh, and watch out for the pirates' 'bridge troll.' I'm not sure what that is, but it sounds dangerous. I've placed a new waypoint in your datapad. - - //-- [RESPONSE NOTE] - //-- PLAYER: I'm on my way. - if (response == "s_95") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - vana_sage_action_givePirateQuest (player, npc); - - //-- NPC: Good. Before you go you might try asking around to see if anyone else has business with the Sulfur Lake Pirates. - string_id message = new string_id (c_stringFile, "s_97"); - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch12 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yes? - - //-- [RESPONSE NOTE] - //-- PLAYER: What was I supposed to do again? - if (response == "s_33") - { - doAnimationAction (player, "embarrassed"); - - //-- [NOTE] - if (vana_sage_condition_hasntSpokenChosterHasQuest (player, npc)) - { - doAnimationAction (npc, "point_away"); - - vana_sage_action_giveChosterQuest (player, npc); - - //-- NPC: I sent you to meet Choster in the Stronghold Cantina. - string_id message = new string_id (c_stringFile, "s_34"); - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_accusingly"); - - vana_sage_action_giveChosterQuest (player, npc); - - //-- NPC: What happened? I sent you to meet Choster in the Stronghold Cantina. - string_id message = new string_id (c_stringFile, "s_35"); - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch15 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Thanks for coming, %TU. The Lok Revenants are always in need of competent individuals. - - //-- [RESPONSE NOTE] - //-- PLAYER: Who are you? - if (response == "s_26") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute1"); - - //-- NPC: I'm Vana Sage, I work for Nym as his Head of Security. - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Who is Nym? - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_30"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: You have a job? - if (response == "s_38") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: There is something I'd like you to look into, if you can. I recently intercepted a distress call from a starship that crashed-landed on Lok. Ships nose-dive into the planet all the time, but this one took off from an Imperial mining installation on Lok and never made it into the atmosphere. I think it slammed down near the hideout of the Sulfur Lake Pirates. I'm very interested in this vessel... - string_id message = new string_id (c_stringFile, "s_40"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: You intercepted a distress call? - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Who are you? - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Who are the Sulfur Lake Pirates? - boolean hasResponse2 = false; - if (vana_sage_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_42"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_77"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_79"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch16 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I'm Vana Sage, I work for Nym as his Head of Security. - - //-- [RESPONSE NOTE] - //-- PLAYER: Who is Nym? - if (response == "s_30") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: You must be joking... Nym is the most feared pirate in the Maramere system. He routed the Trade Federation from Lok and its neighboring planets right around the start of the Clone Wars, and he's maintained complete control over the spacelanes in this region ever since. There's nobody with more power on Lok. And except for Jabba the Hutt, he's probably the most powerful alien in the Outer Rim. - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Who are you? - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: You have a job? - boolean hasResponse1 = false; - if (vana_sage_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_26"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_38"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch17 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You must be joking... Nym is the most feared pirate in the Maramere system. He routed the Trade Federation from Lok and its neighboring planets right around the start of the Clone Wars, and he's maintained complete control over the spacelanes in this region ever since. There's nobody with more power on Lok. And except for Jabba the Hutt, he's probably the most powerful alien in the Outer Rim. - - //-- [RESPONSE NOTE] - //-- PLAYER: Who are you? - if (response == "s_26") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute1"); - - //-- NPC: I'm Vana Sage, I work for Nym as his Head of Security. - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Who is Nym? - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_30"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: You have a job? - if (response == "s_38") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: There is something I'd like you to look into, if you can. I recently intercepted a distress call from a starship that crashed-landed on Lok. Ships nose-dive into the planet all the time, but this one took off from an Imperial mining installation on Lok and never made it into the atmosphere. I think it slammed down near the hideout of the Sulfur Lake Pirates. I'm very interested in this vessel... - string_id message = new string_id (c_stringFile, "s_40"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: You intercepted a distress call? - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Who are you? - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Who are the Sulfur Lake Pirates? - boolean hasResponse2 = false; - if (vana_sage_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_42"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_77"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_79"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch18 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: There is something I'd like you to look into, if you can. I recently intercepted a distress call from a starship that crashed-landed on Lok. Ships nose-dive into the planet all the time, but this one took off from an Imperial mining installation on Lok and never made it into the atmosphere. I think it slammed down near the hideout of the Sulfur Lake Pirates. I'm very interested in this vessel... - - //-- [RESPONSE NOTE] - //-- PLAYER: You intercepted a distress call? - if (response == "s_42") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - //-- NPC: Yes. As part of my duties, I monitor comlink and transceiver activity around the system. We don't want a Star Destroyer sneaking up on us, do we? Anyway, this particular starship interests me because it was carrying Imperial cargo. A droid, in fact, that was once owned by General Otto at an Imperial base here on Lok. - string_id message = new string_id (c_stringFile, "s_44"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What's so special about this droid? - boolean hasResponse0 = false; - if (vana_sage_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_46"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Who are you? - if (response == "s_77") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute1"); - - //-- NPC: I'm Vana Sage, I work for Nym as his Head of Security. - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Who is Nym? - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_30"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Who are the Sulfur Lake Pirates? - if (response == "s_79") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: Probably the most bloodthirsty, least-intelligent pirates on Lok. Like all the other pirate bands, they are constantly trying to dethrone Nym as Lok's reigning pirate king. They hate Nym for taking control of all the nearby hyperspace routes and claim that he's working with the Imperials. The gravel maggots have been looking for an excuse to go to war with us for years... - string_id message = new string_id (c_stringFile, "s_81"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Who are you? - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: You have a job? - boolean hasResponse1 = false; - if (vana_sage_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_26"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_38"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch19 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yes. As part of my duties, I monitor comlink and transceiver activity around the system. We don't want a Star Destroyer sneaking up on us, do we? Anyway, this particular starship interests me because it was carrying Imperial cargo. A droid, in fact, that was once owned by General Otto at an Imperial base here on Lok. - - //-- [RESPONSE NOTE] - //-- PLAYER: What's so special about this droid? - if (response == "s_46") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shrug_hands"); - - //-- NPC: Probably nothing, but as an Imperial droid, it might be carrying some very interesting data. Shipping schedules, guard rosters, prisoner transfer information, schematics for some terrifying super weapon... Anything the droid knows could be sold on the black market or traded back to Otto for a favor down the road. It might also tell us something about that Imperial mining facility, which we haven't been able to infiltrate. - string_id message = new string_id (c_stringFile, "s_48"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: And the reward? - boolean hasResponse0 = false; - if (vana_sage_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.vana_sage.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch20 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Probably nothing, but as an Imperial droid, it might be carrying some very interesting data. Shipping schedules, guard rosters, prisoner transfer information, schematics for some terrifying super weapon... Anything the droid knows could be sold on the black market or traded back to Otto for a favor down the road. It might also tell us something about that Imperial mining facility, which we haven't been able to infiltrate. - - //-- [RESPONSE NOTE] - //-- PLAYER: And the reward? - if (response == "s_50") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - //-- NPC: You'd be rewarded a fair rate if you could secure that droid's memory module. - string_id message = new string_id (c_stringFile, "s_52"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'll recover the module. Where can I find this droid? - boolean hasResponse0 = false; - if (vana_sage_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_54"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch21 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: You'd be rewarded a fair rate if you could secure that droid's memory module. - - //-- [RESPONSE NOTE] - //-- PLAYER: I'll recover the module. Where can I find this droid? - if (response == "s_54") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - //-- NPC: I have scouts out now. I have a feeling the Sulfur Lake Pirates may get their hands on the droid before us. If so, this easy scavenge job will turn into an infiltration of their hideout. Still interested? - string_id message = new string_id (c_stringFile, "s_56"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sure. - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Who are the Sulfur Lake Pirates? - boolean hasResponse1 = false; - if (vana_sage_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_58"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_66"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch22 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I have scouts out now. I have a feeling the Sulfur Lake Pirates may get their hands on the droid before us. If so, this easy scavenge job will turn into an infiltration of their hideout. Still interested? - - //-- [RESPONSE NOTE] - //-- PLAYER: Sure. - if (response == "s_58") - { - doAnimationAction (player, "nod"); - - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - //-- NPC: I am sending you to meet with a person who used to work with the pirates. See if you can glean any inside information. - string_id message = new string_id (c_stringFile, "s_60"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Where to? - boolean hasResponse0 = false; - if (vana_sage_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.vana_sage.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Who are the Sulfur Lake Pirates? - if (response == "s_66") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: Probably the most bloodthirsty, least-intelligent pirates on Lok. Like all the other pirate bands, they are constantly trying to dethrone Nym as Lok's reigning pirate king. They hate Nym for taking control of all the nearby hyperspace routes and claim that he's working with the Imperials. The gravel maggots have been looking for an excuse to go to war with us for years... - string_id message = new string_id (c_stringFile, "s_75"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sure. - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Who are the Sulfur Lake Pirates? - boolean hasResponse1 = false; - if (vana_sage_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_58"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_66"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch23 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I am sending you to meet with a person who used to work with the pirates. See if you can glean any inside information. - - //-- [RESPONSE NOTE] - //-- PLAYER: Where to? - if (response == "s_62") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_away"); - - vana_sage_action_giveChosterQuest (player, npc); - - //-- NPC: Not too far. Meet Choster at the Stronghold Cantina. In case you haven't been there, I've placed a waypoint in your datapad. - string_id message = new string_id (c_stringFile, "s_64"); - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch25 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Probably the most bloodthirsty, least-intelligent pirates on Lok. Like all the other pirate bands, they are constantly trying to dethrone Nym as Lok's reigning pirate king. They hate Nym for taking control of all the nearby hyperspace routes and claim that he's working with the Imperials. The gravel maggots have been looking for an excuse to go to war with us for years... - - //-- [RESPONSE NOTE] - //-- PLAYER: Sure. - if (response == "s_58") - { - doAnimationAction (player, "nod"); - - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - //-- NPC: I am sending you to meet with a person who used to work with the pirates. See if you can glean any inside information. - string_id message = new string_id (c_stringFile, "s_60"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Where to? - boolean hasResponse0 = false; - if (vana_sage_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.vana_sage.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Who are the Sulfur Lake Pirates? - if (response == "s_66") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: Probably the most bloodthirsty, least-intelligent pirates on Lok. Like all the other pirate bands, they are constantly trying to dethrone Nym as Lok's reigning pirate king. They hate Nym for taking control of all the nearby hyperspace routes and claim that he's working with the Imperials. The gravel maggots have been looking for an excuse to go to war with us for years... - string_id message = new string_id (c_stringFile, "s_75"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Sure. - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Who are the Sulfur Lake Pirates? - boolean hasResponse1 = false; - if (vana_sage_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_58"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_66"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch26 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Probably the most bloodthirsty, least-intelligent pirates on Lok. Like all the other pirate bands, they are constantly trying to dethrone Nym as Lok's reigning pirate king. They hate Nym for taking control of all the nearby hyperspace routes and claim that he's working with the Imperials. The gravel maggots have been looking for an excuse to go to war with us for years... - - //-- [RESPONSE NOTE] - //-- PLAYER: Who are you? - if (response == "s_26") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute1"); - - //-- NPC: I'm Vana Sage, I work for Nym as his Head of Security. - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Who is Nym? - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_30"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: You have a job? - if (response == "s_38") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: There is something I'd like you to look into, if you can. I recently intercepted a distress call from a starship that crashed-landed on Lok. Ships nose-dive into the planet all the time, but this one took off from an Imperial mining installation on Lok and never made it into the atmosphere. I think it slammed down near the hideout of the Sulfur Lake Pirates. I'm very interested in this vessel... - string_id message = new string_id (c_stringFile, "s_40"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: You intercepted a distress call? - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Who are you? - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Who are the Sulfur Lake Pirates? - boolean hasResponse2 = false; - if (vana_sage_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_42"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_77"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_79"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch27 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Do I know you? - - //-- [RESPONSE NOTE] - //-- PLAYER: No, but I am looking for work. - if (response == "s_85") - { - doAnimationAction (player, "shake_head_no"); - - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - //-- NPC: Well, you look like you can handle yourself and I just happen to have something... - string_id message = new string_id (c_stringFile, "s_87"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What is it? - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Wait, who are you? - boolean hasResponse1 = false; - if (vana_sage_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_98"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 28); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch28 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Well, you look like you can handle yourself and I just happen to have something... - - //-- [RESPONSE NOTE] - //-- PLAYER: What is it? - if (response == "s_92") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: There is something I'd like you to look into, if you can. I recently intercepted a distress call from a starship that crashed-landed on Lok. Ships nose-dive into the planet all the time, but this one took off from an Imperial mining installation on Lok and never made it into the atmosphere. I think it slammed down near the hideout of the Sulfur Lake Pirates. I'm very interested in this vessel... - string_id message = new string_id (c_stringFile, "s_94"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: You intercepted a distress call? - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: Who are you? - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - //-- PLAYER: Who are the Sulfur Lake Pirates? - boolean hasResponse2 = false; - if (vana_sage_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_42"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_77"); - - if (hasResponse2) - responses [responseIndex++] = new string_id (c_stringFile, "s_79"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Wait, who are you? - if (response == "s_98") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute1"); - - //-- NPC: I'm Vana Sage, I work for Nym as his Head of Security. - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Who is Nym? - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_30"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int vana_sage_handleBranch29 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: There is something I'd like you to look into, if you can. I recently intercepted a distress call from a starship that crashed-landed on Lok. Ships nose-dive into the planet all the time, but this one took off from an Imperial mining installation on Lok and never made it into the atmosphere. I think it slammed down near the hideout of the Sulfur Lake Pirates. I'm very interested in this vessel... - - //-- [RESPONSE NOTE] - //-- PLAYER: You intercepted a distress call? - if (response == "s_42") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - //-- NPC: Yes. As part of my duties, I monitor comlink and transceiver activity around the system. We don't want a Star Destroyer sneaking up on us, do we? Anyway, this particular starship interests me because it was carrying Imperial cargo. A droid, in fact, that was once owned by General Otto at an Imperial base here on Lok. - string_id message = new string_id (c_stringFile, "s_44"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What's so special about this droid? - boolean hasResponse0 = false; - if (vana_sage_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_46"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Who are you? - if (response == "s_77") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute1"); - - //-- NPC: I'm Vana Sage, I work for Nym as his Head of Security. - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Who is Nym? - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_30"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - //-- [RESPONSE NOTE] - //-- PLAYER: Who are the Sulfur Lake Pirates? - if (response == "s_79") - { - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: Probably the most bloodthirsty, least-intelligent pirates on Lok. Like all the other pirate bands, they are constantly trying to dethrone Nym as Lok's reigning pirate king. They hate Nym for taking control of all the nearby hyperspace routes and claim that he's working with the Imperials. The gravel maggots have been looking for an excuse to go to war with us for years... - string_id message = new string_id (c_stringFile, "s_81"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Who are you? - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: You have a job? - boolean hasResponse1 = false; - if (vana_sage_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_26"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_38"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.vana_sage"); - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - return SCRIPT_CONTINUE; -} - -trigger OnAttach () -{ - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - 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.vana_sage"); - - 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 (vana_sage_condition_hasCompletedThemePark (player, npc)) - { - //-- NPC: What a fight, %TU! We really showed those Sulfur Lake Pirates didn't we?! That was just like old times, except we had a new face. Hope you stick around. - string_id message = new string_id (c_stringFile, "s_105"); - 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 (vana_sage_condition_allQuestsComplete (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - //-- NPC: Great job with the Sulfur Lake Pirates. I look forward to working with you again in the future. - string_id message = new string_id (c_stringFile, "s_99"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (vana_sage_condition_hasCompletedPirate (player, npc)) - { - vana_sage_action_gotoJinkins (player, npc); - - //-- NPC: Welcome back, %TU. Jinkins has something for you. Speak with him about your next assignment. - string_id message = new string_id (c_stringFile, "s_103"); - 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 (vana_sage_condition_hasReturnedWithDroid (player, npc)) - { - doAnimationAction (npc, "expect_tip"); - - //-- NPC: One of our operatives, a slicer who has infiltrated the Sulfur Pirate lair, said that he worked with you to slice the back room. Did you retrieve the module? - string_id message = new string_id (c_stringFile, "s_89"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Yes, I have it right here. - boolean hasResponse0 = false; - if (vana_sage_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_90"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 4); - - npcStartConversation (player, npc, "vana_sage", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (vana_sage_condition_hasntCompletedPirate (player, npc)) - { - doAnimationAction (npc, "point_away"); - - //-- NPC: Was something not clear? Get to the Sulfur Lake Pirate Hideout. - string_id message = new string_id (c_stringFile, "s_73"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (vana_sage_condition_metChosterNoPirateQuest (player, npc)) - { - //-- NPC: What happened? Looks like you don't have your next mission. - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What was I supposed to do again? - boolean hasResponse0 = false; - if (vana_sage_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.vana_sage.branchId", 7); - - npcStartConversation (player, npc, "vana_sage", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (vana_sage_condition_hasMetChoster (player, npc)) - { - vana_sage_action_finishChoster (player, npc); - - //-- NPC: How was your meeting with Choster? - string_id message = new string_id (c_stringFile, "s_67"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: How do you know...? - boolean hasResponse0 = false; - if (vana_sage_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_68"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 8); - - npcStartConversation (player, npc, "vana_sage", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (vana_sage_condition_hasNotCompletedChoster (player, npc)) - { - //-- NPC: Yes? - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What was I supposed to do again? - boolean hasResponse0 = false; - if (vana_sage_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_33"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 12); - - npcStartConversation (player, npc, "vana_sage", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (vana_sage_condition_hasInitialQuestTask (player, npc)) - { - doAnimationAction (npc, "nod"); - - vana_sage_action_finishInitialQuest (player, npc); - - //-- NPC: Thanks for coming, %TU. The Lok Revenants are always in need of competent individuals. - string_id message = new string_id (c_stringFile, "s_24"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Who are you? - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - //-- PLAYER: You have a job? - boolean hasResponse1 = false; - if (vana_sage_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_26"); - - if (hasResponse1) - responses [responseIndex++] = new string_id (c_stringFile, "s_38"); - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 15); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "vana_sage", 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 (vana_sage_condition_playerIsHighLvl (player, npc)) - { - doAnimationAction (npc, "point_accusingly"); - - //-- NPC: Do I know you? - string_id message = new string_id (c_stringFile, "s_83"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: No, but I am looking for work. - boolean hasResponse0 = false; - if (vana_sage_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.vana_sage.branchId", 27); - - npcStartConversation (player, npc, "vana_sage", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (!vana_sage_condition_playerIsHighLvl (player, npc)) - { - doAnimationAction (npc, "shake_head_no"); - - //-- NPC: Sorry, we have work to do here. You seem a little green to be on Lok anyway. Come back when you have experience. - string_id message = new string_id (c_stringFile, "s_102"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_no"); - - //-- NPC: Sorry, we have work to do here. Not interested. - string_id message = new string_id (c_stringFile, "s_106"); - 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 != "vana_sage") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.vana_sage.branchId"); - - if (branchId == 4 && vana_sage_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 7 && vana_sage_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && vana_sage_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && vana_sage_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 10 && vana_sage_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 12 && vana_sage_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 15 && vana_sage_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 16 && vana_sage_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 17 && vana_sage_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 18 && vana_sage_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 19 && vana_sage_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 20 && vana_sage_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 21 && vana_sage_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 22 && vana_sage_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 23 && vana_sage_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 25 && vana_sage_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 26 && vana_sage_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 27 && vana_sage_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 28 && vana_sage_handleBranch28 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 29 && vana_sage_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// vana_sage.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.collection; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/vana_sage"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean vana_sage_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean vana_sage_condition_hasInitialQuestTask (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return (groundquests.hasCompletedQuest(player, "u16_nym_themepark_pointer_01") + || groundquests.hasCompletedQuest(player, "u16_nym_themepark_pointer_02") + && !groundquests.isQuestActive(player, "u16_nym_themepark_interview_choster")) + || (groundquests.isTaskActive(player, "u16_nym_themepark_pointer_01", "findVanaSage") + || groundquests.isTaskActive(player, "u16_nym_themepark_pointer_02", "findVanaSage")); +} + +// ---------------------------------------------------------------------- + +boolean vana_sage_condition_hasntSpokenChosterHasQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return (groundquests.hasCompletedQuest(player, "u16_nym_themepark_pointer_01") + || groundquests.hasCompletedQuest(player, "u16_nym_themepark_pointer_02")) + && (groundquests.isQuestActive(player, "u16_nym_themepark_interview_choster")); +} + +// ---------------------------------------------------------------------- + +boolean vana_sage_condition_hasNotCompletedChoster (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "u16_nym_themepark_interview_choster"); +} + +// ---------------------------------------------------------------------- + +boolean vana_sage_condition_playerIsHighLvl (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return getLevel(player) >= 56; +} + +// ---------------------------------------------------------------------- + +boolean vana_sage_condition_hasMetChoster (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_interview_choster", "tellVanaChosterMsg"); +} + +// ---------------------------------------------------------------------- + +boolean vana_sage_condition_metChosterNoPirateQuest (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedQuest(player, "u16_nym_themepark_interview_choster") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_hideout"); +} + +// ---------------------------------------------------------------------- + +boolean vana_sage_condition_hasntCompletedPirate (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isQuestActive(player, "u16_nym_themepark_pirate_hideout"); +} + +// ---------------------------------------------------------------------- + +boolean vana_sage_condition_hasReturnedWithDroid (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "returnPirateComplete"); +} + +// ---------------------------------------------------------------------- + +boolean vana_sage_condition_hasCompletedPirate (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout"); +} + +// ---------------------------------------------------------------------- + +boolean vana_sage_condition_allQuestsComplete (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedQuest(player, "u16_nym_themepark_vana_to_jinkins"); +} + +// ---------------------------------------------------------------------- + +boolean vana_sage_condition_hasCompletedThemePark (obj_id player, obj_id npc) +{ + faceTo(npc, player); + return groundquests.hasCompletedQuest(player, "u16_nym_themepark_shuttle_ambush"); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void vana_sage_action_giveChosterQuest (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_interview_choster"); +} + +// ---------------------------------------------------------------------- + +void vana_sage_action_finishInitialQuest (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundVanaSage"); +} + +// ---------------------------------------------------------------------- + +void vana_sage_action_givePirateQuest (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_pirate_hideout"); + + if(!hasCompletedCollectionSlot(player, "kill_nyms_themepark_sulfur_lake_pirate_activate")) + { + modifyCollectionSlotValue(player, "kill_nyms_themepark_sulfur_lake_pirate_activate", 1); + } +} + +// ---------------------------------------------------------------------- + +void vana_sage_action_finishChoster (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasToldVanaChosterMsg"); +} + +// ---------------------------------------------------------------------- + +void vana_sage_action_finishPirateQuest (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasCompletedPirate"); +} + +// ---------------------------------------------------------------------- + +void vana_sage_action_gotoJinkins (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_vana_to_jinkins"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int vana_sage_handleBranch4 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: One of our operatives, a slicer who has infiltrated the Sulfur Pirate lair, said that he worked with you to slice the back room. Did you retrieve the module? + + //-- [RESPONSE NOTE] + //-- PLAYER: Yes, I have it right here. + if (response == "s_90") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "thumb_up"); + + vana_sage_action_finishPirateQuest (player, npc); + + //-- NPC: Securing that memory module proves that you have the makings of a true pirate. I'm sure you'll go far with the Lok Revenants. Return to me when you are ready for more work. + string_id message = new string_id (c_stringFile, "s_91"); + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch7 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: What happened? Looks like you don't have your next mission. + + //-- [RESPONSE NOTE] + //-- PLAYER: What was I supposed to do again? + if (response == "s_101") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: Our scouts learned that the Sulfur Lake Pirates have already taken the cargo - including the droid - from the crashed starship, so you won't need to look through the wreckage. Just head to the pirates' lair, locate the droid, and grab the memory module. Oh, and watch out for the pirates' 'bridge troll.' I'm not sure what that is, but it sounds dangerous. I've placed a new waypoint in your datapad. + string_id message = new string_id (c_stringFile, "s_71"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm on my way. + boolean hasResponse0 = false; + if (vana_sage_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_95"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: How was your meeting with Choster? + + //-- [RESPONSE NOTE] + //-- PLAYER: How do you know...? + if (response == "s_68") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "nod"); + + //-- NPC: I'm the head of security. You'll be glad to know that my intuition was correct and you didn't waste your time speaking with Choster. + string_id message = new string_id (c_stringFile, "s_69"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Oh? + boolean hasResponse0 = false; + if (vana_sage_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_70"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I'm the head of security. You'll be glad to know that my intuition was correct and you didn't waste your time speaking with Choster. + + //-- [RESPONSE NOTE] + //-- PLAYER: Oh? + if (response == "s_70") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: Our scouts learned that the Sulfur Lake Pirates have already taken the cargo - including the droid - from the crashed starship, so you won't need to look through the wreckage. Just head to the pirates' lair, locate the droid, and grab the memory module. Oh, and watch out for the pirates' 'bridge troll.' I'm not sure what that is, but it sounds dangerous. I've placed a new waypoint in your datapad. + string_id message = new string_id (c_stringFile, "s_71"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'm on my way. + boolean hasResponse0 = false; + if (vana_sage_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_95"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 10); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch10 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Our scouts learned that the Sulfur Lake Pirates have already taken the cargo - including the droid - from the crashed starship, so you won't need to look through the wreckage. Just head to the pirates' lair, locate the droid, and grab the memory module. Oh, and watch out for the pirates' 'bridge troll.' I'm not sure what that is, but it sounds dangerous. I've placed a new waypoint in your datapad. + + //-- [RESPONSE NOTE] + //-- PLAYER: I'm on my way. + if (response == "s_95") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + vana_sage_action_givePirateQuest (player, npc); + + //-- NPC: Good. Before you go you might try asking around to see if anyone else has business with the Sulfur Lake Pirates. + string_id message = new string_id (c_stringFile, "s_97"); + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch12 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yes? + + //-- [RESPONSE NOTE] + //-- PLAYER: What was I supposed to do again? + if (response == "s_33") + { + doAnimationAction (player, "embarrassed"); + + //-- [NOTE] + if (vana_sage_condition_hasntSpokenChosterHasQuest (player, npc)) + { + doAnimationAction (npc, "point_away"); + + vana_sage_action_giveChosterQuest (player, npc); + + //-- NPC: I sent you to meet Choster in the Stronghold Cantina. + string_id message = new string_id (c_stringFile, "s_34"); + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "point_accusingly"); + + vana_sage_action_giveChosterQuest (player, npc); + + //-- NPC: What happened? I sent you to meet Choster in the Stronghold Cantina. + string_id message = new string_id (c_stringFile, "s_35"); + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch15 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Thanks for coming, %TU. The Lok Revenants are always in need of competent individuals. + + //-- [RESPONSE NOTE] + //-- PLAYER: Who are you? + if (response == "s_26") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "salute1"); + + //-- NPC: I'm Vana Sage, I work for Nym as his Head of Security. + string_id message = new string_id (c_stringFile, "s_28"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Who is Nym? + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_30"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: You have a job? + if (response == "s_38") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: There is something I'd like you to look into, if you can. I recently intercepted a distress call from a starship that crashed-landed on Lok. Ships nose-dive into the planet all the time, but this one took off from an Imperial mining installation on Lok and never made it into the atmosphere. I think it slammed down near the hideout of the Sulfur Lake Pirates. I'm very interested in this vessel... + string_id message = new string_id (c_stringFile, "s_40"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: You intercepted a distress call? + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Who are you? + boolean hasResponse1 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Who are the Sulfur Lake Pirates? + boolean hasResponse2 = false; + if (vana_sage_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_42"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_77"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_79"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 18); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch16 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I'm Vana Sage, I work for Nym as his Head of Security. + + //-- [RESPONSE NOTE] + //-- PLAYER: Who is Nym? + if (response == "s_30") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: You must be joking... Nym is the most feared pirate in the Maramere system. He routed the Trade Federation from Lok and its neighboring planets right around the start of the Clone Wars, and he's maintained complete control over the spacelanes in this region ever since. There's nobody with more power on Lok. And except for Jabba the Hutt, he's probably the most powerful alien in the Outer Rim. + string_id message = new string_id (c_stringFile, "s_36"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Who are you? + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: You have a job? + boolean hasResponse1 = false; + if (vana_sage_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_26"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_38"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 15); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch17 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You must be joking... Nym is the most feared pirate in the Maramere system. He routed the Trade Federation from Lok and its neighboring planets right around the start of the Clone Wars, and he's maintained complete control over the spacelanes in this region ever since. There's nobody with more power on Lok. And except for Jabba the Hutt, he's probably the most powerful alien in the Outer Rim. + + //-- [RESPONSE NOTE] + //-- PLAYER: Who are you? + if (response == "s_26") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "salute1"); + + //-- NPC: I'm Vana Sage, I work for Nym as his Head of Security. + string_id message = new string_id (c_stringFile, "s_28"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Who is Nym? + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_30"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: You have a job? + if (response == "s_38") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: There is something I'd like you to look into, if you can. I recently intercepted a distress call from a starship that crashed-landed on Lok. Ships nose-dive into the planet all the time, but this one took off from an Imperial mining installation on Lok and never made it into the atmosphere. I think it slammed down near the hideout of the Sulfur Lake Pirates. I'm very interested in this vessel... + string_id message = new string_id (c_stringFile, "s_40"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: You intercepted a distress call? + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Who are you? + boolean hasResponse1 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Who are the Sulfur Lake Pirates? + boolean hasResponse2 = false; + if (vana_sage_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_42"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_77"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_79"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 18); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch18 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: There is something I'd like you to look into, if you can. I recently intercepted a distress call from a starship that crashed-landed on Lok. Ships nose-dive into the planet all the time, but this one took off from an Imperial mining installation on Lok and never made it into the atmosphere. I think it slammed down near the hideout of the Sulfur Lake Pirates. I'm very interested in this vessel... + + //-- [RESPONSE NOTE] + //-- PLAYER: You intercepted a distress call? + if (response == "s_42") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "nod"); + + //-- NPC: Yes. As part of my duties, I monitor comlink and transceiver activity around the system. We don't want a Star Destroyer sneaking up on us, do we? Anyway, this particular starship interests me because it was carrying Imperial cargo. A droid, in fact, that was once owned by General Otto at an Imperial base here on Lok. + string_id message = new string_id (c_stringFile, "s_44"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What's so special about this droid? + boolean hasResponse0 = false; + if (vana_sage_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_46"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 19); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Who are you? + if (response == "s_77") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "salute1"); + + //-- NPC: I'm Vana Sage, I work for Nym as his Head of Security. + string_id message = new string_id (c_stringFile, "s_28"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Who is Nym? + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_30"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Who are the Sulfur Lake Pirates? + if (response == "s_79") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: Probably the most bloodthirsty, least-intelligent pirates on Lok. Like all the other pirate bands, they are constantly trying to dethrone Nym as Lok's reigning pirate king. They hate Nym for taking control of all the nearby hyperspace routes and claim that he's working with the Imperials. The gravel maggots have been looking for an excuse to go to war with us for years... + string_id message = new string_id (c_stringFile, "s_81"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Who are you? + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: You have a job? + boolean hasResponse1 = false; + if (vana_sage_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_26"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_38"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 15); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch19 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yes. As part of my duties, I monitor comlink and transceiver activity around the system. We don't want a Star Destroyer sneaking up on us, do we? Anyway, this particular starship interests me because it was carrying Imperial cargo. A droid, in fact, that was once owned by General Otto at an Imperial base here on Lok. + + //-- [RESPONSE NOTE] + //-- PLAYER: What's so special about this droid? + if (response == "s_46") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "shrug_hands"); + + //-- NPC: Probably nothing, but as an Imperial droid, it might be carrying some very interesting data. Shipping schedules, guard rosters, prisoner transfer information, schematics for some terrifying super weapon... Anything the droid knows could be sold on the black market or traded back to Otto for a favor down the road. It might also tell us something about that Imperial mining facility, which we haven't been able to infiltrate. + string_id message = new string_id (c_stringFile, "s_48"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: And the reward? + boolean hasResponse0 = false; + if (vana_sage_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.vana_sage.branchId", 20); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch20 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Probably nothing, but as an Imperial droid, it might be carrying some very interesting data. Shipping schedules, guard rosters, prisoner transfer information, schematics for some terrifying super weapon... Anything the droid knows could be sold on the black market or traded back to Otto for a favor down the road. It might also tell us something about that Imperial mining facility, which we haven't been able to infiltrate. + + //-- [RESPONSE NOTE] + //-- PLAYER: And the reward? + if (response == "s_50") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + //-- NPC: You'd be rewarded a fair rate if you could secure that droid's memory module. + string_id message = new string_id (c_stringFile, "s_52"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'll recover the module. Where can I find this droid? + boolean hasResponse0 = false; + if (vana_sage_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_54"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 21); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch21 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: You'd be rewarded a fair rate if you could secure that droid's memory module. + + //-- [RESPONSE NOTE] + //-- PLAYER: I'll recover the module. Where can I find this droid? + if (response == "s_54") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + //-- NPC: I have scouts out now. I have a feeling the Sulfur Lake Pirates may get their hands on the droid before us. If so, this easy scavenge job will turn into an infiltration of their hideout. Still interested? + string_id message = new string_id (c_stringFile, "s_56"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sure. + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Who are the Sulfur Lake Pirates? + boolean hasResponse1 = false; + if (vana_sage_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_58"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_66"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 22); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch22 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I have scouts out now. I have a feeling the Sulfur Lake Pirates may get their hands on the droid before us. If so, this easy scavenge job will turn into an infiltration of their hideout. Still interested? + + //-- [RESPONSE NOTE] + //-- PLAYER: Sure. + if (response == "s_58") + { + doAnimationAction (player, "nod"); + + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + //-- NPC: I am sending you to meet with a person who used to work with the pirates. See if you can glean any inside information. + string_id message = new string_id (c_stringFile, "s_60"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Where to? + boolean hasResponse0 = false; + if (vana_sage_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.vana_sage.branchId", 23); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Who are the Sulfur Lake Pirates? + if (response == "s_66") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: Probably the most bloodthirsty, least-intelligent pirates on Lok. Like all the other pirate bands, they are constantly trying to dethrone Nym as Lok's reigning pirate king. They hate Nym for taking control of all the nearby hyperspace routes and claim that he's working with the Imperials. The gravel maggots have been looking for an excuse to go to war with us for years... + string_id message = new string_id (c_stringFile, "s_75"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sure. + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Who are the Sulfur Lake Pirates? + boolean hasResponse1 = false; + if (vana_sage_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_58"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_66"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 22); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch23 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I am sending you to meet with a person who used to work with the pirates. See if you can glean any inside information. + + //-- [RESPONSE NOTE] + //-- PLAYER: Where to? + if (response == "s_62") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "point_away"); + + vana_sage_action_giveChosterQuest (player, npc); + + //-- NPC: Not too far. Meet Choster at the Stronghold Cantina. In case you haven't been there, I've placed a waypoint in your datapad. + string_id message = new string_id (c_stringFile, "s_64"); + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch25 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Probably the most bloodthirsty, least-intelligent pirates on Lok. Like all the other pirate bands, they are constantly trying to dethrone Nym as Lok's reigning pirate king. They hate Nym for taking control of all the nearby hyperspace routes and claim that he's working with the Imperials. The gravel maggots have been looking for an excuse to go to war with us for years... + + //-- [RESPONSE NOTE] + //-- PLAYER: Sure. + if (response == "s_58") + { + doAnimationAction (player, "nod"); + + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + //-- NPC: I am sending you to meet with a person who used to work with the pirates. See if you can glean any inside information. + string_id message = new string_id (c_stringFile, "s_60"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Where to? + boolean hasResponse0 = false; + if (vana_sage_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.vana_sage.branchId", 23); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Who are the Sulfur Lake Pirates? + if (response == "s_66") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: Probably the most bloodthirsty, least-intelligent pirates on Lok. Like all the other pirate bands, they are constantly trying to dethrone Nym as Lok's reigning pirate king. They hate Nym for taking control of all the nearby hyperspace routes and claim that he's working with the Imperials. The gravel maggots have been looking for an excuse to go to war with us for years... + string_id message = new string_id (c_stringFile, "s_75"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Sure. + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Who are the Sulfur Lake Pirates? + boolean hasResponse1 = false; + if (vana_sage_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_58"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_66"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 22); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch26 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Probably the most bloodthirsty, least-intelligent pirates on Lok. Like all the other pirate bands, they are constantly trying to dethrone Nym as Lok's reigning pirate king. They hate Nym for taking control of all the nearby hyperspace routes and claim that he's working with the Imperials. The gravel maggots have been looking for an excuse to go to war with us for years... + + //-- [RESPONSE NOTE] + //-- PLAYER: Who are you? + if (response == "s_26") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "salute1"); + + //-- NPC: I'm Vana Sage, I work for Nym as his Head of Security. + string_id message = new string_id (c_stringFile, "s_28"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Who is Nym? + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_30"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: You have a job? + if (response == "s_38") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: There is something I'd like you to look into, if you can. I recently intercepted a distress call from a starship that crashed-landed on Lok. Ships nose-dive into the planet all the time, but this one took off from an Imperial mining installation on Lok and never made it into the atmosphere. I think it slammed down near the hideout of the Sulfur Lake Pirates. I'm very interested in this vessel... + string_id message = new string_id (c_stringFile, "s_40"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: You intercepted a distress call? + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Who are you? + boolean hasResponse1 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Who are the Sulfur Lake Pirates? + boolean hasResponse2 = false; + if (vana_sage_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_42"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_77"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_79"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 18); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch27 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Do I know you? + + //-- [RESPONSE NOTE] + //-- PLAYER: No, but I am looking for work. + if (response == "s_85") + { + doAnimationAction (player, "shake_head_no"); + + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + //-- NPC: Well, you look like you can handle yourself and I just happen to have something... + string_id message = new string_id (c_stringFile, "s_87"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What is it? + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Wait, who are you? + boolean hasResponse1 = false; + if (vana_sage_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_98"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 28); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch28 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Well, you look like you can handle yourself and I just happen to have something... + + //-- [RESPONSE NOTE] + //-- PLAYER: What is it? + if (response == "s_92") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: There is something I'd like you to look into, if you can. I recently intercepted a distress call from a starship that crashed-landed on Lok. Ships nose-dive into the planet all the time, but this one took off from an Imperial mining installation on Lok and never made it into the atmosphere. I think it slammed down near the hideout of the Sulfur Lake Pirates. I'm very interested in this vessel... + string_id message = new string_id (c_stringFile, "s_94"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: You intercepted a distress call? + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: Who are you? + boolean hasResponse1 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse1 = true; + } + + //-- PLAYER: Who are the Sulfur Lake Pirates? + boolean hasResponse2 = false; + if (vana_sage_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_42"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_77"); + + if (hasResponse2) + responses [responseIndex++] = new string_id (c_stringFile, "s_79"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 18); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Wait, who are you? + if (response == "s_98") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "salute1"); + + //-- NPC: I'm Vana Sage, I work for Nym as his Head of Security. + string_id message = new string_id (c_stringFile, "s_28"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Who is Nym? + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_30"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int vana_sage_handleBranch29 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: There is something I'd like you to look into, if you can. I recently intercepted a distress call from a starship that crashed-landed on Lok. Ships nose-dive into the planet all the time, but this one took off from an Imperial mining installation on Lok and never made it into the atmosphere. I think it slammed down near the hideout of the Sulfur Lake Pirates. I'm very interested in this vessel... + + //-- [RESPONSE NOTE] + //-- PLAYER: You intercepted a distress call? + if (response == "s_42") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "nod"); + + //-- NPC: Yes. As part of my duties, I monitor comlink and transceiver activity around the system. We don't want a Star Destroyer sneaking up on us, do we? Anyway, this particular starship interests me because it was carrying Imperial cargo. A droid, in fact, that was once owned by General Otto at an Imperial base here on Lok. + string_id message = new string_id (c_stringFile, "s_44"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What's so special about this droid? + boolean hasResponse0 = false; + if (vana_sage_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_46"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 19); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Who are you? + if (response == "s_77") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "salute1"); + + //-- NPC: I'm Vana Sage, I work for Nym as his Head of Security. + string_id message = new string_id (c_stringFile, "s_28"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Who is Nym? + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_30"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + //-- [RESPONSE NOTE] + //-- PLAYER: Who are the Sulfur Lake Pirates? + if (response == "s_79") + { + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: Probably the most bloodthirsty, least-intelligent pirates on Lok. Like all the other pirate bands, they are constantly trying to dethrone Nym as Lok's reigning pirate king. They hate Nym for taking control of all the nearby hyperspace routes and claim that he's working with the Imperials. The gravel maggots have been looking for an excuse to go to war with us for years... + string_id message = new string_id (c_stringFile, "s_81"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Who are you? + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: You have a job? + boolean hasResponse1 = false; + if (vana_sage_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_26"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_38"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 15); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.vana_sage"); + + setCondition (self, CONDITION_CONVERSABLE); + setCondition( self, CONDITION_INTERESTING ); + return SCRIPT_CONTINUE; +} + +trigger OnAttach () +{ + setCondition (self, CONDITION_CONVERSABLE); + setCondition( self, CONDITION_INTERESTING ); + 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.vana_sage"); + + 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 (vana_sage_condition_hasCompletedThemePark (player, npc)) + { + //-- NPC: What a fight, %TU! We really showed those Sulfur Lake Pirates didn't we?! That was just like old times, except we had a new face. Hope you stick around. + string_id message = new string_id (c_stringFile, "s_105"); + 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 (vana_sage_condition_allQuestsComplete (player, npc)) + { + doAnimationAction (npc, "handshake_tandem"); + + //-- NPC: Great job with the Sulfur Lake Pirates. I look forward to working with you again in the future. + string_id message = new string_id (c_stringFile, "s_99"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (vana_sage_condition_hasCompletedPirate (player, npc)) + { + vana_sage_action_gotoJinkins (player, npc); + + //-- NPC: Welcome back, %TU. Jinkins has something for you. Speak with him about your next assignment. + string_id message = new string_id (c_stringFile, "s_103"); + 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 (vana_sage_condition_hasReturnedWithDroid (player, npc)) + { + doAnimationAction (npc, "expect_tip"); + + //-- NPC: One of our operatives, a slicer who has infiltrated the Sulfur Pirate lair, said that he worked with you to slice the back room. Did you retrieve the module? + string_id message = new string_id (c_stringFile, "s_89"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Yes, I have it right here. + boolean hasResponse0 = false; + if (vana_sage_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_90"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 4); + + npcStartConversation (player, npc, "vana_sage", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (vana_sage_condition_hasntCompletedPirate (player, npc)) + { + doAnimationAction (npc, "point_away"); + + //-- NPC: Was something not clear? Get to the Sulfur Lake Pirate Hideout. + string_id message = new string_id (c_stringFile, "s_73"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (vana_sage_condition_metChosterNoPirateQuest (player, npc)) + { + //-- NPC: What happened? Looks like you don't have your next mission. + string_id message = new string_id (c_stringFile, "s_72"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What was I supposed to do again? + boolean hasResponse0 = false; + if (vana_sage_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.vana_sage.branchId", 7); + + npcStartConversation (player, npc, "vana_sage", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (vana_sage_condition_hasMetChoster (player, npc)) + { + vana_sage_action_finishChoster (player, npc); + + //-- NPC: How was your meeting with Choster? + string_id message = new string_id (c_stringFile, "s_67"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: How do you know...? + boolean hasResponse0 = false; + if (vana_sage_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_68"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 8); + + npcStartConversation (player, npc, "vana_sage", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (vana_sage_condition_hasNotCompletedChoster (player, npc)) + { + //-- NPC: Yes? + string_id message = new string_id (c_stringFile, "s_32"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What was I supposed to do again? + boolean hasResponse0 = false; + if (vana_sage_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_33"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 12); + + npcStartConversation (player, npc, "vana_sage", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (vana_sage_condition_hasInitialQuestTask (player, npc)) + { + doAnimationAction (npc, "nod"); + + vana_sage_action_finishInitialQuest (player, npc); + + //-- NPC: Thanks for coming, %TU. The Lok Revenants are always in need of competent individuals. + string_id message = new string_id (c_stringFile, "s_24"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Who are you? + boolean hasResponse0 = false; + if (vana_sage_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + //-- PLAYER: You have a job? + boolean hasResponse1 = false; + if (vana_sage_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_26"); + + if (hasResponse1) + responses [responseIndex++] = new string_id (c_stringFile, "s_38"); + + utils.setScriptVar (player, "conversation.vana_sage.branchId", 15); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcStartConversation (player, npc, "vana_sage", 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 (vana_sage_condition_playerIsHighLvl (player, npc)) + { + doAnimationAction (npc, "point_accusingly"); + + //-- NPC: Do I know you? + string_id message = new string_id (c_stringFile, "s_83"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: No, but I am looking for work. + boolean hasResponse0 = false; + if (vana_sage_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.vana_sage.branchId", 27); + + npcStartConversation (player, npc, "vana_sage", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (!vana_sage_condition_playerIsHighLvl (player, npc)) + { + doAnimationAction (npc, "shake_head_no"); + + //-- NPC: Sorry, we have work to do here. You seem a little green to be on Lok anyway. Come back when you have experience. + string_id message = new string_id (c_stringFile, "s_102"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (vana_sage_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "shake_head_no"); + + //-- NPC: Sorry, we have work to do here. Not interested. + string_id message = new string_id (c_stringFile, "s_106"); + 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 != "vana_sage") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.vana_sage.branchId"); + + if (branchId == 4 && vana_sage_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 7 && vana_sage_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && vana_sage_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && vana_sage_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 10 && vana_sage_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 12 && vana_sage_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 15 && vana_sage_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 16 && vana_sage_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 17 && vana_sage_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 18 && vana_sage_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 19 && vana_sage_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 20 && vana_sage_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 21 && vana_sage_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 22 && vana_sage_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 23 && vana_sage_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 25 && vana_sage_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 26 && vana_sage_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 27 && vana_sage_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 28 && vana_sage_handleBranch28 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 29 && vana_sage_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + + utils.removeScriptVar (player, "conversation.vana_sage.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/conversation/water_treatment.script b/sku.0/sys.server/compiled/game/script/conversation/water_treatment.script index 76d608c84..a13e8b9ec 100644 --- a/sku.0/sys.server/compiled/game/script/conversation/water_treatment.script +++ b/sku.0/sys.server/compiled/game/script/conversation/water_treatment.script @@ -1,1207 +1,1207 @@ -// ====================================================================== -// -// water_treatment.script -// Copyright 2004, Sony Online Entertainment -// All Rights Reserved. -// -// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! -// -// ====================================================================== - -// ====================================================================== -// Library Includes -// ====================================================================== - -include library.ai_lib; -include library.chat; -include library.conversation; -include library.groundquests; -include library.utils; - -// ====================================================================== -// Script Constants -// ====================================================================== - -string c_stringFile = "conversation/water_treatment"; - -// ====================================================================== -// Script Conditions -// ====================================================================== - -boolean water_treatment_condition__defaultCondition (obj_id player, obj_id npc) -{ - return true; -} - -// ---------------------------------------------------------------------- - -boolean water_treatment_condition_hasInitialQuest (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_meet_townspeople", "findFiltrationGuy") - || (groundquests.hasCompletedQuest(player, "u16_nym_meet_townspeople") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_parts_1")); -} - -// ---------------------------------------------------------------------- - -boolean water_treatment_condition_isFinishingFirstQuest (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_repair_mixing_chamber", "returnChemical") - || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_repair_mixing_chamber") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_parts_2")); -} - -// ---------------------------------------------------------------------- - -boolean water_treatment_condition_isFinishingSecondQuest (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_under_pressure", "returnValves") - || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_under_pressure") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_parts_3")); -} - -// ---------------------------------------------------------------------- - -boolean water_treatment_condition_isFinishingThirdQuest (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_repair_flocculation_chamber", "returnRegulator") - || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_repair_flocculation_chamber") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_return_townsperson")); -} - -// ---------------------------------------------------------------------- - -boolean water_treatment_condition_hasFinishedAllQuests (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isQuestActiveOrComplete(player, "u16_nym_return_townsperson"); - -} - -// ---------------------------------------------------------------------- - -boolean water_treatment_condition_hasFirstQuest (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_parts_1", "findQuartermaster") - || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_1") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_repair_mixing_chamber")); -} - -// ---------------------------------------------------------------------- - -boolean water_treatment_condition_hasSecondQuest (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_parts_2", "goQuartermaster") - || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_2") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_under_pressure")); -} - -// ---------------------------------------------------------------------- - -boolean water_treatment_condition_hasThirdQuest (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_parts_3", "goQuartermasterAgain") - || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_3") - && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_save_agent")); -} - -// ---------------------------------------------------------------------- - -boolean water_treatment_condition_hasNotFixedMixer (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_repair_mixing_chamber", "fixMixingChamber"); -} - -// ---------------------------------------------------------------------- - -boolean water_treatment_condition_hasNotFixedSediment (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_under_pressure", "fixSedimentation"); -} - -// ---------------------------------------------------------------------- - -boolean water_treatment_condition_hasNotFixedFlocculation (obj_id player, obj_id npc) -{ - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_repair_flocculation_chamber", "fixFlocculation"); -} - -// ====================================================================== -// Script Actions -// ====================================================================== - -void water_treatment_action_signalMeetingFirstTime (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasFoundFiltrationGuy"); -} - -// ---------------------------------------------------------------------- - -void water_treatment_action_giveFirstQuest (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_parts_1"); -} - -// ---------------------------------------------------------------------- - -void water_treatment_action_giveSecondQuest (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_parts_2"); -} - -// ---------------------------------------------------------------------- - -void water_treatment_action_giveThirdQuest (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_themepark_parts_3"); -} - -// ---------------------------------------------------------------------- - -void water_treatment_action_finishUpMixingChamber (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasReturnedChemical"); -} - -// ---------------------------------------------------------------------- - -void water_treatment_action_grantReturnTownPerson (obj_id player, obj_id npc) -{ - groundquests.grantQuest(player, "u16_nym_return_townsperson"); -} - -// ---------------------------------------------------------------------- - -void water_treatment_action_finishUpFloc (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasReturnedRegulator"); -} - -// ---------------------------------------------------------------------- - -void water_treatment_action_finishUpPressure (obj_id player, obj_id npc) -{ - groundquests.sendSignal(player, "hasReturnedValves"); -} - -// ====================================================================== -// Script %TO Tokens -// ====================================================================== - -// ====================================================================== -// Script %DI Tokens -// ====================================================================== - -// ====================================================================== -// Script %DF Tokens -// ====================================================================== - -// ====================================================================== -// handleBranch Functions -// ====================================================================== - -int water_treatment_handleBranch2 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Wonderful! The Flocculation Chamber is operating at near peak efficiency! - - //-- [RESPONSE NOTE] - //-- PLAYER: Great, great, now what else do I need to get? - if (response == "s_18") - { - //-- [NOTE] - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shrug_shoulders"); - - //-- NPC: A drink of water. - string_id message = new string_id (c_stringFile, "s_19"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Well, yeah, that's what this is all abou... oh, you mean...? - boolean hasResponse0 = false; - if (water_treatment_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_42"); - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int water_treatment_handleBranch3 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: A drink of water. - - //-- [RESPONSE NOTE] - //-- PLAYER: Well, yeah, that's what this is all abou... oh, you mean...? - if (response == "s_42") - { - //-- [NOTE] - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "thank"); - - water_treatment_action_grantReturnTownPerson (player, npc); - - //-- NPC: Yes, my friend, you've done it! Let the people know that Nym's Stronghold will have pure clear drinking water in no time; all thanks to %TU! - string_id message = new string_id (c_stringFile, "s_43"); - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int water_treatment_handleBranch6 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Those are still in the box! Excellent! Just follow the instruction and install them. The Focculation Chamber is between the Mixing Chamber and the Sedimentation tank on the shore... - - //-- [RESPONSE NOTE] - //-- PLAYER: I know, just follow the pipes, right? - if (response == "s_66") - { - doAnimationAction (player, "standing_placate"); - - //-- [NOTE] - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "udaman"); - - //-- NPC: How did you guess? - string_id message = new string_id (c_stringFile, "s_67"); - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int water_treatment_handleBranch8 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Great job on those Valves! The flow is being regulated perfectly within the Sedimentation Chamber, now. - - //-- [RESPONSE NOTE] - //-- PLAYER: And that means there will be clean water, now, too, yes? - if (response == "s_16") - { - //-- [NOTE] - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_no"); - - //-- NPC: Uh.. no, not quite yet. The Flocculation Chamber needs to be stirred at just the right speed and time but the Motor Power Regulator is glitching badly... - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I'll go back to Ralia for a Motor Power Regulator. - boolean hasResponse0 = false; - if (water_treatment_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.water_treatment.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int water_treatment_handleBranch9 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Uh.. no, not quite yet. The Flocculation Chamber needs to be stirred at just the right speed and time but the Motor Power Regulator is glitching badly... - - //-- [RESPONSE NOTE] - //-- PLAYER: I'll go back to Ralia for a Motor Power Regulator. - if (response == "s_40") - { - //-- [NOTE] - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - water_treatment_action_giveThirdQuest (player, npc); - - //-- NPC: Thanks. - string_id message = new string_id (c_stringFile, "s_41"); - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int water_treatment_handleBranch13 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Excellent work with the Cationic Chemical Coagulant! - - //-- [RESPONSE NOTE] - //-- PLAYER: Thanks. So there will be fresh water now? - if (response == "s_29") - { - //-- [NOTE] - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_no"); - - //-- NPC: I wish! No, not yet. The Flow Control Valves in the Sedimentation Tank are all either completely stopped up or nearly so. Replacing them is the only way to get the water flowing again. - string_id message = new string_id (c_stringFile, "s_37"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: So you need Ralia to give you some Flow Control Valves? - boolean hasResponse0 = false; - if (water_treatment_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.water_treatment.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int water_treatment_handleBranch14 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I wish! No, not yet. The Flow Control Valves in the Sedimentation Tank are all either completely stopped up or nearly so. Replacing them is the only way to get the water flowing again. - - //-- [RESPONSE NOTE] - //-- PLAYER: So you need Ralia to give you some Flow Control Valves? - if (response == "s_38") - { - //-- [NOTE] - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_once"); - - water_treatment_action_giveSecondQuest (player, npc); - - //-- NPC: Yes. Good luck, they seem to be in short supply... as in non-existent! - string_id message = new string_id (c_stringFile, "s_39"); - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int water_treatment_handleBranch18 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: So much water and it's all useless! Yes? You need something? - - //-- [RESPONSE NOTE] - //-- PLAYER: Are you Nym's Water Treatment Technician? - if (response == "s_45") - { - //-- [NOTE] - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - //-- NPC: I am, for all the good it does me. Why? - string_id message = new string_id (c_stringFile, "s_47"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: What are you doing out here so far from the Treatment Facility on shore? - boolean hasResponse0 = false; - if (water_treatment_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.water_treatment.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int water_treatment_handleBranch19 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: I am, for all the good it does me. Why? - - //-- [RESPONSE NOTE] - //-- PLAYER: What are you doing out here so far from the Treatment Facility on shore? - if (response == "s_49") - { - //-- [NOTE] - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "sigh_deeply"); - - //-- NPC: Trying to think. I had to get away for a while from that broken-down piece of bantha... I mean, the Treatment Facility. - string_id message = new string_id (c_stringFile, "s_51"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: So the water treatment stuff is broken? - boolean hasResponse0 = false; - if (water_treatment_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_53"); - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int water_treatment_handleBranch20 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Trying to think. I had to get away for a while from that broken-down piece of bantha... I mean, the Treatment Facility. - - //-- [RESPONSE NOTE] - //-- PLAYER: So the water treatment stuff is broken? - if (response == "s_53") - { - //-- [NOTE] - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "slump_head"); - - //-- NPC: Yes. Things wear out, you know? And I can't get the Quartermaster to get me any of the supplies I need to fix it. - string_id message = new string_id (c_stringFile, "s_55"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Maybe I can help, what do you need? - boolean hasResponse0 = false; - if (water_treatment_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses [] = new string_id [numberOfResponses]; - - if (hasResponse0) - responses [responseIndex++] = new string_id (c_stringFile, "s_59"); - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int water_treatment_handleBranch21 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Yes. Things wear out, you know? And I can't get the Quartermaster to get me any of the supplies I need to fix it. - - //-- [RESPONSE NOTE] - //-- PLAYER: Maybe I can help, what do you need? - if (response == "s_59") - { - //-- [NOTE] - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - //-- NPC: Well the first thing I need is a new supply of Cationic Chemical Coagulant for the Mixing Chamber, but... - string_id message = new string_id (c_stringFile, "s_68"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Got it, now point me to the Quartermaster and I'll see what I can do. - boolean hasResponse0 = false; - if (water_treatment_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_70"); - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -int water_treatment_handleBranch22 (obj_id player, obj_id npc, string_id response) -{ - //-- [BRANCH NOTE] - //-- NPC: Well the first thing I need is a new supply of Cationic Chemical Coagulant for the Mixing Chamber, but... - - //-- [RESPONSE NOTE] - //-- PLAYER: Got it, now point me to the Quartermaster and I'll see what I can do. - if (response == "s_70") - { - //-- [NOTE] - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "wave1"); - - water_treatment_action_giveFirstQuest (player, npc); - - //-- NPC: Okay, I've noted it on your datapad. Good luck, you'll need it! - string_id message = new string_id (c_stringFile, "s_72"); - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; -} - -// ---------------------------------------------------------------------- - -// ====================================================================== -// User Script Triggers -// ====================================================================== - -trigger OnInitialize () -{ - if ((!isTangible (self)) || (isPlayer (self))) - detachScript(self, "conversation.water_treatment"); - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; -} - -trigger OnAttach () -{ - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - 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.water_treatment"); - - 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 (water_treatment_condition_hasFinishedAllQuests (player, npc)) - { - doAnimationAction (player, "udaman"); - - //-- NPC: The cistern is filling nicely with pure, clean water, thanks to all your hard work! - string_id message = new string_id (c_stringFile, "s_57"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (water_treatment_condition_isFinishingThirdQuest (player, npc)) - { - doAnimationAction (npc, "celebrate1"); - - water_treatment_action_finishUpFloc (player, npc); - - //-- NPC: Wonderful! The Flocculation Chamber is operating at near peak efficiency! - string_id message = new string_id (c_stringFile, "s_17"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Great, great, now what else do I need to get? - boolean hasResponse0 = false; - if (water_treatment_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_18"); - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 2); - - npcStartConversation (player, npc, "water_treatment", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (water_treatment_condition_hasThirdQuest (player, npc)) - { - doAnimationAction (npc, "yawn"); - - doAnimationAction (player, "explain"); - - //-- NPC: The motors need to operate smoothly and consistently to provide sufficient turbulence of the mixture to maintain the constituents in suspension and promote flocculation. - string_id message = new string_id (c_stringFile, "s_62"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (water_treatment_condition_hasNotFixedFlocculation (player, npc)) - { - doAnimationAction (npc, "applause_excited"); - - //-- NPC: Those are still in the box! Excellent! Just follow the instruction and install them. The Focculation Chamber is between the Mixing Chamber and the Sedimentation tank on the shore... - string_id message = new string_id (c_stringFile, "s_65"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: I know, just follow the pipes, right? - boolean hasResponse0 = false; - if (water_treatment_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_66"); - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 6); - - npcStartConversation (player, npc, "water_treatment", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (water_treatment_condition_isFinishingSecondQuest (player, npc)) - { - doAnimationAction (npc, "thank"); - - water_treatment_action_finishUpPressure (player, npc); - - //-- NPC: Great job on those Valves! The flow is being regulated perfectly within the Sedimentation Chamber, now. - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: And that means there will be clean water, now, too, yes? - boolean hasResponse0 = false; - if (water_treatment_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_16"); - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 8); - - npcStartConversation (player, npc, "water_treatment", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (water_treatment_condition_hasSecondQuest (player, npc)) - { - doAnimationAction (player, "slump_head"); - - //-- NPC: I wish the existing valves could just be cleaned, but it's gotten so bad that they really need to be replaced. - string_id message = new string_id (c_stringFile, "s_61"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (water_treatment_condition_hasNotFixedSediment (player, npc)) - { - doAnimationAction (npc, "nod_head_multiple"); - - //-- NPC: Yes those are the correct valves; they should be simple for you to install. The Sedimentation Tank is the last in line over there on the shore; just follow the pipes. - string_id message = new string_id (c_stringFile, "s_64"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (water_treatment_condition_isFinishingFirstQuest (player, npc)) - { - doAnimationAction (npc, "applause_polite"); - - water_treatment_action_finishUpMixingChamber (player, npc); - - //-- NPC: Excellent work with the Cationic Chemical Coagulant! - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Thanks. So there will be fresh water now? - boolean hasResponse0 = false; - if (water_treatment_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_29"); - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 13); - - npcStartConversation (player, npc, "water_treatment", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (water_treatment_condition_hasFirstQuest (player, npc)) - { - doAnimationAction (npc, "shrug_hands"); - - //-- NPC: That Mixing Chamber is not going to resupply itself with Cationic Chemical Coagulant, you know. If you haven't talked to her yet then you really should go see if Ralia Reeven has any. - string_id message = new string_id (c_stringFile, "s_58"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (water_treatment_condition_hasNotFixedMixer (player, npc)) - { - doAnimationAction (npc, "standing_placate"); - - //-- NPC: That's okay, you don't have to give the Cationic Chemical Coagulant to me! Just dump it in the Mixing Chamber over on the shore; follow the pipes and you can't miss it. - string_id message = new string_id (c_stringFile, "s_63"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (water_treatment_condition_hasInitialQuest (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - water_treatment_action_signalMeetingFirstTime (player, npc); - - //-- NPC: So much water and it's all useless! Yes? You need something? - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - //-- PLAYER: Are you Nym's Water Treatment Technician? - boolean hasResponse0 = false; - if (water_treatment_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_45"); - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 18); - - npcStartConversation (player, npc, "water_treatment", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - //-- [NOTE] - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "sneeze"); - - //-- NPC: So much sulphur in the water! But at least we don't have an insect problem. - string_id message = new string_id (c_stringFile, "s_74"); - 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 != "water_treatment") - return SCRIPT_CONTINUE; - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.water_treatment.branchId"); - - if (branchId == 2 && water_treatment_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 3 && water_treatment_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 6 && water_treatment_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 8 && water_treatment_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 9 && water_treatment_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 13 && water_treatment_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 14 && water_treatment_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 18 && water_treatment_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 19 && water_treatment_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 20 && water_treatment_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 21 && water_treatment_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - return SCRIPT_CONTINUE; - - if (branchId == 22 && water_treatment_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.water_treatment.branchId"); - - return SCRIPT_CONTINUE; -} - -// ====================================================================== - +// ====================================================================== +// +// water_treatment.script +// Copyright 2004, Sony Online Entertainment +// All Rights Reserved. +// +// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE! +// +// ====================================================================== + +// ====================================================================== +// Library Includes +// ====================================================================== + +include library.ai_lib; +include library.chat; +include library.conversation; +include library.groundquests; +include library.utils; + +// ====================================================================== +// Script Constants +// ====================================================================== + +string c_stringFile = "conversation/water_treatment"; + +// ====================================================================== +// Script Conditions +// ====================================================================== + +boolean water_treatment_condition__defaultCondition (obj_id player, obj_id npc) +{ + return true; +} + +// ---------------------------------------------------------------------- + +boolean water_treatment_condition_hasInitialQuest (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_meet_townspeople", "findFiltrationGuy") + || (groundquests.hasCompletedQuest(player, "u16_nym_meet_townspeople") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_parts_1")); +} + +// ---------------------------------------------------------------------- + +boolean water_treatment_condition_isFinishingFirstQuest (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_themepark_repair_mixing_chamber", "returnChemical") + || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_repair_mixing_chamber") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_parts_2")); +} + +// ---------------------------------------------------------------------- + +boolean water_treatment_condition_isFinishingSecondQuest (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_themepark_under_pressure", "returnValves") + || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_under_pressure") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_parts_3")); +} + +// ---------------------------------------------------------------------- + +boolean water_treatment_condition_isFinishingThirdQuest (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_themepark_repair_flocculation_chamber", "returnRegulator") + || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_repair_flocculation_chamber") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_return_townsperson")); +} + +// ---------------------------------------------------------------------- + +boolean water_treatment_condition_hasFinishedAllQuests (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isQuestActiveOrComplete(player, "u16_nym_return_townsperson"); + +} + +// ---------------------------------------------------------------------- + +boolean water_treatment_condition_hasFirstQuest (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_themepark_parts_1", "findQuartermaster") + || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_1") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_repair_mixing_chamber")); +} + +// ---------------------------------------------------------------------- + +boolean water_treatment_condition_hasSecondQuest (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_themepark_parts_2", "goQuartermaster") + || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_2") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_under_pressure")); +} + +// ---------------------------------------------------------------------- + +boolean water_treatment_condition_hasThirdQuest (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_themepark_parts_3", "goQuartermasterAgain") + || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_3") + && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_save_agent")); +} + +// ---------------------------------------------------------------------- + +boolean water_treatment_condition_hasNotFixedMixer (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_themepark_repair_mixing_chamber", "fixMixingChamber"); +} + +// ---------------------------------------------------------------------- + +boolean water_treatment_condition_hasNotFixedSediment (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_themepark_under_pressure", "fixSedimentation"); +} + +// ---------------------------------------------------------------------- + +boolean water_treatment_condition_hasNotFixedFlocculation (obj_id player, obj_id npc) +{ + faceTo(npc,player); + return groundquests.isTaskActive(player, "u16_nym_themepark_repair_flocculation_chamber", "fixFlocculation"); +} + +// ====================================================================== +// Script Actions +// ====================================================================== + +void water_treatment_action_signalMeetingFirstTime (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasFoundFiltrationGuy"); +} + +// ---------------------------------------------------------------------- + +void water_treatment_action_giveFirstQuest (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_parts_1"); +} + +// ---------------------------------------------------------------------- + +void water_treatment_action_giveSecondQuest (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_parts_2"); +} + +// ---------------------------------------------------------------------- + +void water_treatment_action_giveThirdQuest (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_themepark_parts_3"); +} + +// ---------------------------------------------------------------------- + +void water_treatment_action_finishUpMixingChamber (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasReturnedChemical"); +} + +// ---------------------------------------------------------------------- + +void water_treatment_action_grantReturnTownPerson (obj_id player, obj_id npc) +{ + groundquests.grantQuest(player, "u16_nym_return_townsperson"); +} + +// ---------------------------------------------------------------------- + +void water_treatment_action_finishUpFloc (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasReturnedRegulator"); +} + +// ---------------------------------------------------------------------- + +void water_treatment_action_finishUpPressure (obj_id player, obj_id npc) +{ + groundquests.sendSignal(player, "hasReturnedValves"); +} + +// ====================================================================== +// Script %TO Tokens +// ====================================================================== + +// ====================================================================== +// Script %DI Tokens +// ====================================================================== + +// ====================================================================== +// Script %DF Tokens +// ====================================================================== + +// ====================================================================== +// handleBranch Functions +// ====================================================================== + +int water_treatment_handleBranch2 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Wonderful! The Flocculation Chamber is operating at near peak efficiency! + + //-- [RESPONSE NOTE] + //-- PLAYER: Great, great, now what else do I need to get? + if (response == "s_18") + { + //-- [NOTE] + if (water_treatment_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "shrug_shoulders"); + + //-- NPC: A drink of water. + string_id message = new string_id (c_stringFile, "s_19"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Well, yeah, that's what this is all abou... oh, you mean...? + boolean hasResponse0 = false; + if (water_treatment_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_42"); + + utils.setScriptVar (player, "conversation.water_treatment.branchId", 3); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.water_treatment.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int water_treatment_handleBranch3 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: A drink of water. + + //-- [RESPONSE NOTE] + //-- PLAYER: Well, yeah, that's what this is all abou... oh, you mean...? + if (response == "s_42") + { + //-- [NOTE] + if (water_treatment_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "thank"); + + water_treatment_action_grantReturnTownPerson (player, npc); + + //-- NPC: Yes, my friend, you've done it! Let the people know that Nym's Stronghold will have pure clear drinking water in no time; all thanks to %TU! + string_id message = new string_id (c_stringFile, "s_43"); + utils.removeScriptVar (player, "conversation.water_treatment.branchId"); + + prose_package pp = new prose_package (); + pp.stringId = message; + pp.actor.set (player); + pp.target.set (npc); + + npcEndConversationWithMessage (player, pp); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int water_treatment_handleBranch6 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Those are still in the box! Excellent! Just follow the instruction and install them. The Focculation Chamber is between the Mixing Chamber and the Sedimentation tank on the shore... + + //-- [RESPONSE NOTE] + //-- PLAYER: I know, just follow the pipes, right? + if (response == "s_66") + { + doAnimationAction (player, "standing_placate"); + + //-- [NOTE] + if (water_treatment_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "udaman"); + + //-- NPC: How did you guess? + string_id message = new string_id (c_stringFile, "s_67"); + utils.removeScriptVar (player, "conversation.water_treatment.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int water_treatment_handleBranch8 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Great job on those Valves! The flow is being regulated perfectly within the Sedimentation Chamber, now. + + //-- [RESPONSE NOTE] + //-- PLAYER: And that means there will be clean water, now, too, yes? + if (response == "s_16") + { + //-- [NOTE] + if (water_treatment_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "shake_head_no"); + + //-- NPC: Uh.. no, not quite yet. The Flocculation Chamber needs to be stirred at just the right speed and time but the Motor Power Regulator is glitching badly... + string_id message = new string_id (c_stringFile, "s_21"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I'll go back to Ralia for a Motor Power Regulator. + boolean hasResponse0 = false; + if (water_treatment_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.water_treatment.branchId", 9); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.water_treatment.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int water_treatment_handleBranch9 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Uh.. no, not quite yet. The Flocculation Chamber needs to be stirred at just the right speed and time but the Motor Power Regulator is glitching badly... + + //-- [RESPONSE NOTE] + //-- PLAYER: I'll go back to Ralia for a Motor Power Regulator. + if (response == "s_40") + { + //-- [NOTE] + if (water_treatment_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "nod"); + + water_treatment_action_giveThirdQuest (player, npc); + + //-- NPC: Thanks. + string_id message = new string_id (c_stringFile, "s_41"); + utils.removeScriptVar (player, "conversation.water_treatment.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int water_treatment_handleBranch13 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Excellent work with the Cationic Chemical Coagulant! + + //-- [RESPONSE NOTE] + //-- PLAYER: Thanks. So there will be fresh water now? + if (response == "s_29") + { + //-- [NOTE] + if (water_treatment_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "shake_head_no"); + + //-- NPC: I wish! No, not yet. The Flow Control Valves in the Sedimentation Tank are all either completely stopped up or nearly so. Replacing them is the only way to get the water flowing again. + string_id message = new string_id (c_stringFile, "s_37"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: So you need Ralia to give you some Flow Control Valves? + boolean hasResponse0 = false; + if (water_treatment_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.water_treatment.branchId", 14); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.water_treatment.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int water_treatment_handleBranch14 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I wish! No, not yet. The Flow Control Valves in the Sedimentation Tank are all either completely stopped up or nearly so. Replacing them is the only way to get the water flowing again. + + //-- [RESPONSE NOTE] + //-- PLAYER: So you need Ralia to give you some Flow Control Valves? + if (response == "s_38") + { + //-- [NOTE] + if (water_treatment_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "nod_head_once"); + + water_treatment_action_giveSecondQuest (player, npc); + + //-- NPC: Yes. Good luck, they seem to be in short supply... as in non-existent! + string_id message = new string_id (c_stringFile, "s_39"); + utils.removeScriptVar (player, "conversation.water_treatment.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int water_treatment_handleBranch18 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: So much water and it's all useless! Yes? You need something? + + //-- [RESPONSE NOTE] + //-- PLAYER: Are you Nym's Water Treatment Technician? + if (response == "s_45") + { + //-- [NOTE] + if (water_treatment_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "nod"); + + //-- NPC: I am, for all the good it does me. Why? + string_id message = new string_id (c_stringFile, "s_47"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: What are you doing out here so far from the Treatment Facility on shore? + boolean hasResponse0 = false; + if (water_treatment_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.water_treatment.branchId", 19); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.water_treatment.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int water_treatment_handleBranch19 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: I am, for all the good it does me. Why? + + //-- [RESPONSE NOTE] + //-- PLAYER: What are you doing out here so far from the Treatment Facility on shore? + if (response == "s_49") + { + //-- [NOTE] + if (water_treatment_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "sigh_deeply"); + + //-- NPC: Trying to think. I had to get away for a while from that broken-down piece of bantha... I mean, the Treatment Facility. + string_id message = new string_id (c_stringFile, "s_51"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: So the water treatment stuff is broken? + boolean hasResponse0 = false; + if (water_treatment_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_53"); + + utils.setScriptVar (player, "conversation.water_treatment.branchId", 20); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.water_treatment.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int water_treatment_handleBranch20 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Trying to think. I had to get away for a while from that broken-down piece of bantha... I mean, the Treatment Facility. + + //-- [RESPONSE NOTE] + //-- PLAYER: So the water treatment stuff is broken? + if (response == "s_53") + { + //-- [NOTE] + if (water_treatment_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "slump_head"); + + //-- NPC: Yes. Things wear out, you know? And I can't get the Quartermaster to get me any of the supplies I need to fix it. + string_id message = new string_id (c_stringFile, "s_55"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Maybe I can help, what do you need? + boolean hasResponse0 = false; + if (water_treatment_condition__defaultCondition (player, npc)) + { + ++numberOfResponses; + hasResponse = true; + hasResponse0 = true; + } + + if (hasResponse) + { + int responseIndex = 0; + string_id responses [] = new string_id [numberOfResponses]; + + if (hasResponse0) + responses [responseIndex++] = new string_id (c_stringFile, "s_59"); + + utils.setScriptVar (player, "conversation.water_treatment.branchId", 21); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.water_treatment.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int water_treatment_handleBranch21 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Yes. Things wear out, you know? And I can't get the Quartermaster to get me any of the supplies I need to fix it. + + //-- [RESPONSE NOTE] + //-- PLAYER: Maybe I can help, what do you need? + if (response == "s_59") + { + //-- [NOTE] + if (water_treatment_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "explain"); + + //-- NPC: Well the first thing I need is a new supply of Cationic Chemical Coagulant for the Mixing Chamber, but... + string_id message = new string_id (c_stringFile, "s_68"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Got it, now point me to the Quartermaster and I'll see what I can do. + boolean hasResponse0 = false; + if (water_treatment_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_70"); + + utils.setScriptVar (player, "conversation.water_treatment.branchId", 22); + + npcSpeak (player, message); + npcSetConversationResponses (player, responses); + } + else + { + utils.removeScriptVar (player, "conversation.water_treatment.branchId"); + + npcEndConversationWithMessage (player, message); + } + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +int water_treatment_handleBranch22 (obj_id player, obj_id npc, string_id response) +{ + //-- [BRANCH NOTE] + //-- NPC: Well the first thing I need is a new supply of Cationic Chemical Coagulant for the Mixing Chamber, but... + + //-- [RESPONSE NOTE] + //-- PLAYER: Got it, now point me to the Quartermaster and I'll see what I can do. + if (response == "s_70") + { + //-- [NOTE] + if (water_treatment_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "wave1"); + + water_treatment_action_giveFirstQuest (player, npc); + + //-- NPC: Okay, I've noted it on your datapad. Good luck, you'll need it! + string_id message = new string_id (c_stringFile, "s_72"); + utils.removeScriptVar (player, "conversation.water_treatment.branchId"); + + npcEndConversationWithMessage (player, message); + + return SCRIPT_CONTINUE; + } + + } + + return SCRIPT_DEFAULT; +} + +// ---------------------------------------------------------------------- + +// ====================================================================== +// User Script Triggers +// ====================================================================== + +trigger OnInitialize () +{ + if ((!isTangible (self)) || (isPlayer (self))) + detachScript(self, "conversation.water_treatment"); + + setCondition (self, CONDITION_CONVERSABLE); + setCondition( self, CONDITION_INTERESTING ); + + return SCRIPT_CONTINUE; +} + +trigger OnAttach () +{ + setCondition (self, CONDITION_CONVERSABLE); + setCondition( self, CONDITION_INTERESTING ); + + 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.water_treatment"); + + 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 (water_treatment_condition_hasFinishedAllQuests (player, npc)) + { + doAnimationAction (player, "udaman"); + + //-- NPC: The cistern is filling nicely with pure, clean water, thanks to all your hard work! + string_id message = new string_id (c_stringFile, "s_57"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (water_treatment_condition_isFinishingThirdQuest (player, npc)) + { + doAnimationAction (npc, "celebrate1"); + + water_treatment_action_finishUpFloc (player, npc); + + //-- NPC: Wonderful! The Flocculation Chamber is operating at near peak efficiency! + string_id message = new string_id (c_stringFile, "s_17"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Great, great, now what else do I need to get? + boolean hasResponse0 = false; + if (water_treatment_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_18"); + + utils.setScriptVar (player, "conversation.water_treatment.branchId", 2); + + npcStartConversation (player, npc, "water_treatment", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (water_treatment_condition_hasThirdQuest (player, npc)) + { + doAnimationAction (npc, "yawn"); + + doAnimationAction (player, "explain"); + + //-- NPC: The motors need to operate smoothly and consistently to provide sufficient turbulence of the mixture to maintain the constituents in suspension and promote flocculation. + string_id message = new string_id (c_stringFile, "s_62"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (water_treatment_condition_hasNotFixedFlocculation (player, npc)) + { + doAnimationAction (npc, "applause_excited"); + + //-- NPC: Those are still in the box! Excellent! Just follow the instruction and install them. The Focculation Chamber is between the Mixing Chamber and the Sedimentation tank on the shore... + string_id message = new string_id (c_stringFile, "s_65"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: I know, just follow the pipes, right? + boolean hasResponse0 = false; + if (water_treatment_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_66"); + + utils.setScriptVar (player, "conversation.water_treatment.branchId", 6); + + npcStartConversation (player, npc, "water_treatment", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (water_treatment_condition_isFinishingSecondQuest (player, npc)) + { + doAnimationAction (npc, "thank"); + + water_treatment_action_finishUpPressure (player, npc); + + //-- NPC: Great job on those Valves! The flow is being regulated perfectly within the Sedimentation Chamber, now. + string_id message = new string_id (c_stringFile, "s_14"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: And that means there will be clean water, now, too, yes? + boolean hasResponse0 = false; + if (water_treatment_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_16"); + + utils.setScriptVar (player, "conversation.water_treatment.branchId", 8); + + npcStartConversation (player, npc, "water_treatment", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (water_treatment_condition_hasSecondQuest (player, npc)) + { + doAnimationAction (player, "slump_head"); + + //-- NPC: I wish the existing valves could just be cleaned, but it's gotten so bad that they really need to be replaced. + string_id message = new string_id (c_stringFile, "s_61"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (water_treatment_condition_hasNotFixedSediment (player, npc)) + { + doAnimationAction (npc, "nod_head_multiple"); + + //-- NPC: Yes those are the correct valves; they should be simple for you to install. The Sedimentation Tank is the last in line over there on the shore; just follow the pipes. + string_id message = new string_id (c_stringFile, "s_64"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (water_treatment_condition_isFinishingFirstQuest (player, npc)) + { + doAnimationAction (npc, "applause_polite"); + + water_treatment_action_finishUpMixingChamber (player, npc); + + //-- NPC: Excellent work with the Cationic Chemical Coagulant! + string_id message = new string_id (c_stringFile, "s_27"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Thanks. So there will be fresh water now? + boolean hasResponse0 = false; + if (water_treatment_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_29"); + + utils.setScriptVar (player, "conversation.water_treatment.branchId", 13); + + npcStartConversation (player, npc, "water_treatment", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (water_treatment_condition_hasFirstQuest (player, npc)) + { + doAnimationAction (npc, "shrug_hands"); + + //-- NPC: That Mixing Chamber is not going to resupply itself with Cationic Chemical Coagulant, you know. If you haven't talked to her yet then you really should go see if Ralia Reeven has any. + string_id message = new string_id (c_stringFile, "s_58"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (water_treatment_condition_hasNotFixedMixer (player, npc)) + { + doAnimationAction (npc, "standing_placate"); + + //-- NPC: That's okay, you don't have to give the Cationic Chemical Coagulant to me! Just dump it in the Mixing Chamber over on the shore; follow the pipes and you can't miss it. + string_id message = new string_id (c_stringFile, "s_63"); + chat.chat (npc, player, message); + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (water_treatment_condition_hasInitialQuest (player, npc)) + { + doAnimationAction (npc, "gesticulate_wildly"); + + water_treatment_action_signalMeetingFirstTime (player, npc); + + //-- NPC: So much water and it's all useless! Yes? You need something? + string_id message = new string_id (c_stringFile, "s_36"); + int numberOfResponses = 0; + + boolean hasResponse = false; + + //-- PLAYER: Are you Nym's Water Treatment Technician? + boolean hasResponse0 = false; + if (water_treatment_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_45"); + + utils.setScriptVar (player, "conversation.water_treatment.branchId", 18); + + npcStartConversation (player, npc, "water_treatment", message, responses); + } + else + { + chat.chat (npc, player, message); + } + + return SCRIPT_CONTINUE; + } + + //-- [NOTE] + if (water_treatment_condition__defaultCondition (player, npc)) + { + doAnimationAction (npc, "sneeze"); + + //-- NPC: So much sulphur in the water! But at least we don't have an insect problem. + string_id message = new string_id (c_stringFile, "s_74"); + 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 != "water_treatment") + return SCRIPT_CONTINUE; + + obj_id npc = self; + + int branchId = utils.getIntScriptVar (player, "conversation.water_treatment.branchId"); + + if (branchId == 2 && water_treatment_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 3 && water_treatment_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 6 && water_treatment_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 8 && water_treatment_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 9 && water_treatment_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 13 && water_treatment_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 14 && water_treatment_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 18 && water_treatment_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 19 && water_treatment_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 20 && water_treatment_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 21 && water_treatment_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) + return SCRIPT_CONTINUE; + + if (branchId == 22 && water_treatment_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.water_treatment.branchId"); + + return SCRIPT_CONTINUE; +} + +// ====================================================================== + diff --git a/sku.0/sys.server/compiled/game/script/csr/get_resource_crate.script b/sku.0/sys.server/compiled/game/script/csr/get_resource_crate.script index e492c74e3..5a1ef70b7 100644 --- a/sku.0/sys.server/compiled/game/script/csr/get_resource_crate.script +++ b/sku.0/sys.server/compiled/game/script/csr/get_resource_crate.script @@ -1,125 +1,125 @@ -/** - * Copyright (c)2000-2002 Sony Online Entertainment Inc. - * All Rights Reserved - * - * Title: getResourceCrate.script - * Description: CSR tool to get an arbitrary amount of an arbitrary resource - * @author $Author:$ - * @version $Revision:$ - */ - -/***** INCLUDES ********************************************************/ - -include library.utils; - -/***** INHERITS ********************************************************/ - - -/***** CONSTANTS *******************************************************/ - -const int MAX_AMOUNT = 100000; - -/***** TRIGGERS ********************************************************/ - -trigger OnSpeaking(String text) -{ - //make sure caller is a God - if ( isPlayer(self) && !isGod(self) ) - { - return SCRIPT_CONTINUE; - } - - java.util.StringTokenizer tok = new java.util.StringTokenizer (text); - - //check for command name: getResourceCrate - if (tok.hasMoreTokens ()) - { - String command = tok.nextToken (); - - boolean notEnoughParams = false; - - if (command.equals ("getResourceCrate") ) - { - if(tok.hasMoreTokens ()) - { - String resourceName = tok.nextToken (); - if(tok.hasMoreTokens ()) - { - int amount = utils.stringToInt(tok.nextToken ()); - - if(amount < 0) - { - sendSystemMessage(self, "getResourceCrate: FAILURE - Negative amounts of resources not allowed", ""); - return SCRIPT_CONTINUE; - } - if(amount > MAX_AMOUNT) - { - sendSystemMessage(self, "getResourceCrate: FAILURE - Requested amount greater than the " + MAX_AMOUNT + " maximum.", ""); - return SCRIPT_CONTINUE; - } - - getResourceCrate(self, resourceName, amount); - } - else - notEnoughParams = true; - } - else - notEnoughParams = true; - - if(notEnoughParams) - { - debugConsoleMsg(self, "Usage: getResourceCrate . Example: getResourceCrate Evom 4000"); - } - } - } - return SCRIPT_CONTINUE; -} - -/***** FUNCTIONS *******************************************************/ - -/** Given a name and amount, create a filled resource crate in the caller's inventory -*/ -void getResourceCrate(obj_id player, String resourceName, int amount) -{ - obj_id resourceType = getResourceTypeByName(resourceName); - - if(isIdValid(resourceType)) - { - string crateTemplate = getResourceContainerForType(resourceType); - if ( !crateTemplate.equals("") ) - { - obj_id pInv = utils.getInventoryContainer(player); - if ( pInv != null ) - { - obj_id crate = createObject(crateTemplate, pInv, ""); - if ( (crate == null) || (crate == obj_id.NULL_ID) ) - { - sendSystemMessage(player, "getResourceCrate: FAILURE - Could not create crate.", ""); - } - else - { - if ( addResourceToContainer (crate, resourceType, amount, player) ) - { - sendSystemMessage(player, "getResourceCrate: Crate of " + resourceName + " created and filled with " + amount + " units. It has been placed in your inventory.", ""); - } - else - { - sendSystemMessage(player, "getResourceCrate: FAILURE - Crate created, but could not be filled.", ""); - } - } - } - else - { - sendSystemMessage(player, "getResourceCrate: FAILURE - Could not get your inventroy to put the container in.", ""); - } - } - else - { - sendSystemMessage(player, "getResourceCrate: FAILURE - Could not get the crate template.", ""); - } - } - else - { - sendSystemMessage(player, "getResourceCrate: FAILURE - Could not find resource type by name, check resource name.", ""); - } -} +/** + * Copyright (c)2000-2002 Sony Online Entertainment Inc. + * All Rights Reserved + * + * Title: getResourceCrate.script + * Description: CSR tool to get an arbitrary amount of an arbitrary resource + * @author $Author:$ + * @version $Revision:$ + */ + +/***** INCLUDES ********************************************************/ + +include library.utils; + +/***** INHERITS ********************************************************/ + + +/***** CONSTANTS *******************************************************/ + +const int MAX_AMOUNT = 100000; + +/***** TRIGGERS ********************************************************/ + +trigger OnSpeaking(String text) +{ + //make sure caller is a God + if ( isPlayer(self) && !isGod(self) ) + { + return SCRIPT_CONTINUE; + } + + java.util.StringTokenizer tok = new java.util.StringTokenizer (text); + + //check for command name: getResourceCrate + if (tok.hasMoreTokens ()) + { + String command = tok.nextToken (); + + boolean notEnoughParams = false; + + if (command.equals ("getResourceCrate") ) + { + if(tok.hasMoreTokens ()) + { + String resourceName = tok.nextToken (); + if(tok.hasMoreTokens ()) + { + int amount = utils.stringToInt(tok.nextToken ()); + + if(amount < 0) + { + sendSystemMessage(self, "getResourceCrate: FAILURE - Negative amounts of resources not allowed", ""); + return SCRIPT_CONTINUE; + } + if(amount > MAX_AMOUNT) + { + sendSystemMessage(self, "getResourceCrate: FAILURE - Requested amount greater than the " + MAX_AMOUNT + " maximum.", ""); + return SCRIPT_CONTINUE; + } + + getResourceCrate(self, resourceName, amount); + } + else + notEnoughParams = true; + } + else + notEnoughParams = true; + + if(notEnoughParams) + { + debugConsoleMsg(self, "Usage: getResourceCrate . Example: getResourceCrate Evom 4000"); + } + } + } + return SCRIPT_CONTINUE; +} + +/***** FUNCTIONS *******************************************************/ + +/** Given a name and amount, create a filled resource crate in the caller's inventory +*/ +void getResourceCrate(obj_id player, String resourceName, int amount) +{ + obj_id resourceType = getResourceTypeByName(resourceName); + + if(isIdValid(resourceType)) + { + string crateTemplate = getResourceContainerForType(resourceType); + if ( !crateTemplate.equals("") ) + { + obj_id pInv = utils.getInventoryContainer(player); + if ( pInv != null ) + { + obj_id crate = createObject(crateTemplate, pInv, ""); + if ( (crate == null) || (crate == obj_id.NULL_ID) ) + { + sendSystemMessage(player, "getResourceCrate: FAILURE - Could not create crate.", ""); + } + else + { + if ( addResourceToContainer (crate, resourceType, amount, player) ) + { + sendSystemMessage(player, "getResourceCrate: Crate of " + resourceName + " created and filled with " + amount + " units. It has been placed in your inventory.", ""); + } + else + { + sendSystemMessage(player, "getResourceCrate: FAILURE - Crate created, but could not be filled.", ""); + } + } + } + else + { + sendSystemMessage(player, "getResourceCrate: FAILURE - Could not get your inventroy to put the container in.", ""); + } + } + else + { + sendSystemMessage(player, "getResourceCrate: FAILURE - Could not get the crate template.", ""); + } + } + else + { + sendSystemMessage(player, "getResourceCrate: FAILURE - Could not find resource type by name, check resource name.", ""); + } +} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/stringsBestine.txt b/sku.0/sys.server/compiled/game/script/systems/gcw/stringsBestine.txt index 97a848959..be2234b24 100644 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/stringsBestine.txt +++ b/sku.0/sys.server/compiled/game/script/systems/gcw/stringsBestine.txt @@ -1,28 +1,28 @@ -gcw_announcement_construct_defenses_imperial_tatooine_bestine -gcw_announcement_construct_defenses_rebel_tatooine_bestine -gcw_announcement_building_almost_complete_imperial_tatooine_bestine -gcw_announcement_building_almost_complete_rebel_tatooine_bestine -gcw_announcement_man_defenses_imperial_tatooine_bestine -gcw_announcement_man_defenses_rebel_tatooine_bestine -gcw_announcement_defense_half_done_imperial_tatooine_bestine -gcw_announcement_defense_half_done_rebel_tatooine_bestine -gcw_announcement_invasion_almost_defeated_imperial_tatooine_bestine -gcw_announcement_invasion_almost_defeated_rebel_tatooine_bestine -gcw_announcement_city_safe_imperial_tatooine_bestine -gcw_announcement_city_safe_rebel_tatooine_bestine -gcw_announcement_city_lost_imperial_tatooine_bestine -gcw_announcement_city_lost_rebel_tatooine_bestine -gcw_announcement_rally_for_invasion_imperial_tatooine_bestine -gcw_announcement_rally_for_invasion_rebel_tatooine_bestine -gcw_announcement_call_to_arms_imperial_tatooine_bestine -gcw_announcement_call_to_arms_rebel_tatooine_bestine -gcw_announcement_attack_city_imperial_tatooine_bestine -gcw_announcement_attack_city_rebel_tatooine_bestine -gcw_announcement_attack_half_done_imperial_tatooine_bestine -gcw_announcement_attack_half_done_rebel_tatooine_bestine -gcw_announcement_invasion_almost_lost_imperial_tatooine_bestine -gcw_announcement_invasion_almost_lost_rebel_tatooine_bestine -gcw_announcement_city_won_imperial_tatooine_bestine -gcw_announcement_city_won_rebel_tatooine_bestine -gcw_announcement_attack_unsuccessful_imperial_tatooine_bestine -gcw_announcement_attack_unsuccessful_rebel_tatooine_bestine +gcw_announcement_construct_defenses_imperial_tatooine_bestine +gcw_announcement_construct_defenses_rebel_tatooine_bestine +gcw_announcement_building_almost_complete_imperial_tatooine_bestine +gcw_announcement_building_almost_complete_rebel_tatooine_bestine +gcw_announcement_man_defenses_imperial_tatooine_bestine +gcw_announcement_man_defenses_rebel_tatooine_bestine +gcw_announcement_defense_half_done_imperial_tatooine_bestine +gcw_announcement_defense_half_done_rebel_tatooine_bestine +gcw_announcement_invasion_almost_defeated_imperial_tatooine_bestine +gcw_announcement_invasion_almost_defeated_rebel_tatooine_bestine +gcw_announcement_city_safe_imperial_tatooine_bestine +gcw_announcement_city_safe_rebel_tatooine_bestine +gcw_announcement_city_lost_imperial_tatooine_bestine +gcw_announcement_city_lost_rebel_tatooine_bestine +gcw_announcement_rally_for_invasion_imperial_tatooine_bestine +gcw_announcement_rally_for_invasion_rebel_tatooine_bestine +gcw_announcement_call_to_arms_imperial_tatooine_bestine +gcw_announcement_call_to_arms_rebel_tatooine_bestine +gcw_announcement_attack_city_imperial_tatooine_bestine +gcw_announcement_attack_city_rebel_tatooine_bestine +gcw_announcement_attack_half_done_imperial_tatooine_bestine +gcw_announcement_attack_half_done_rebel_tatooine_bestine +gcw_announcement_invasion_almost_lost_imperial_tatooine_bestine +gcw_announcement_invasion_almost_lost_rebel_tatooine_bestine +gcw_announcement_city_won_imperial_tatooine_bestine +gcw_announcement_city_won_rebel_tatooine_bestine +gcw_announcement_attack_unsuccessful_imperial_tatooine_bestine +gcw_announcement_attack_unsuccessful_rebel_tatooine_bestine diff --git a/sku.0/sys.server/compiled/game/script/systems/missions/base/mission_dynamic_base.script b/sku.0/sys.server/compiled/game/script/systems/missions/base/mission_dynamic_base.script index 18a9b0585..2fc3a29f1 100644 --- a/sku.0/sys.server/compiled/game/script/systems/missions/base/mission_dynamic_base.script +++ b/sku.0/sys.server/compiled/game/script/systems/missions/base/mission_dynamic_base.script @@ -144,7 +144,7 @@ const string_id SID_MISSION_YAVIN_ENDOR_DATHOMIR = new string_id("spam", "missi const string_id SID_MISSION_TARGET_IN_WATER = new string_id("spam", "target_in_water"); const string[] CITIES_WITH_STARPORTS = { - "bestine", + "bestine", "mos_eisley", "mos_entha", "mos_espa", @@ -152,7 +152,7 @@ const string[] CITIES_WITH_STARPORTS = { "keren", "moenia", "kaadara", - "coronet", + "coronet", "tyrena", "kor_vella", "doaba_guerfel", @@ -787,7 +787,7 @@ obj_id createDynamicBountyMission(obj_id objMissionData, obj_id objCreator, int { strColumnName = "strHard"; intMissionDifficulty = MISSION_DIFFICULTY_HARD; - + if((intDifficulty == 90) && (21 > rand(1, 100))) { strColumnName = "strBoss"; @@ -1962,7 +1962,7 @@ dictionary getDestructionMissionSpawnList(obj_id objCreator, int intDifficulty, int minReward = dataTableGetInt(strRewardFileName, intDifficulty, "intMinReward"); int maxReward = dataTableGetInt(strRewardFileName, intDifficulty, "intMaxReward"); int intGCWPoints = 0; - + if(strFaction != "" && strFaction.length() > 0) { intGCWPoints = dataTableGetInt(strRewardFileName, intDifficulty, "intGCWPoints"); @@ -4924,13 +4924,13 @@ void doIncorrectPlayerBlurb(obj_id objNPC) int lastBlurb = utils.getIntScriptVar(objNPC, "mission.blurbTime"); int gameTime = getGameTime(); - + if(gameTime - lastBlurb < 6) { return; } - utils.setScriptVar(objNPC, "mission.blurbTime", gameTime); + utils.setScriptVar(objNPC, "mission.blurbTime", gameTime); const int NUMBER_OF_RESPONSES = 4; const string[] ANIMATIONS = { anims.PLAYER_POINT_TO_SELF, anims.PLAYER_REFUSE_OFFER_FORMAL, anims.PLAYER_RUB_CHIN_THOUGHTFUL, anims.PLAYER_SHAKE_HEAD_DISGUST, anims.PLAYER_SHUSH }; @@ -5132,7 +5132,7 @@ obj_id createHuntingMission(obj_id objMissionData, obj_id objCreator, int intDif int[] intRewardPerKill = new int[intLength]; obj_id groupObject = getGroupObject(objCreator); - + int maximumDifficultyInColumn = 0; if(isIdValid(groupObject)) @@ -5320,27 +5320,27 @@ boolean isPlanetHuntingViable(obj_id player, string area) { return false; } - + if((area.equals("naboo") || area.equals("corelia")) && (playerLevel < 20 || playerLevel > 40)) { return false; } - + if((area.equals("rori") || area.equals("talus")) && (playerLevel < 40 || playerLevel > 60)) { return false; } - + if((area.equals("dantooine") || area.equals("lok")) && (playerLevel < 50 || playerLevel > 70)) { return false; } - + if((area.equals("yavin4") || area.equals("endor")) && (playerLevel < 70)) { return false; } - + if(area.equals("dathomir") && playerLevel < 80) { return false; @@ -5369,4 +5369,4 @@ void msgWrongHuntingPlanet(obj_id player) return; sendSystemMessage(player, missionPlanets[msgIndex]); -} \ No newline at end of file +} diff --git a/sku.0/sys.server/compiled/game/script/systems/spawning/spawn_base.script b/sku.0/sys.server/compiled/game/script/systems/spawning/spawn_base.script index f17dd0b2c..2f65fa1c1 100644 --- a/sku.0/sys.server/compiled/game/script/systems/spawning/spawn_base.script +++ b/sku.0/sys.server/compiled/game/script/systems/spawning/spawn_base.script @@ -107,7 +107,7 @@ int[] getValidSpawn(dictionary dctPlayerStats) strFileName = "datatables/spawning/spawn_lists/" + strPlanet + "/" + strPlanet + "_" + strRegion + ".iff"; } - + if(strFileName == null) return null; @@ -119,13 +119,13 @@ int[] getValidSpawn(dictionary dctPlayerStats) int[] intGcwThresholds = null; int[] intGcwScoreTypes = null; string[] strGcwSpecificRegions = null; - + if(dataTableHasColumn(strFileName, "intGCWFaction")) { - intGcwFactions = dataTableGetIntColumn(strFileName, "intGCWFaction"); + intGcwFactions = dataTableGetIntColumn(strFileName, "intGCWFaction"); intGcwThresholds = dataTableGetIntColumn(strFileName, "intGCWThreshold"); intGcwScoreTypes = dataTableGetIntColumn(strFileName, "intGCWScoreType"); - strGcwSpecificRegions = dataTableGetStringColumn(strFileName, "strGCWSpecificRegion"); + strGcwSpecificRegions = dataTableGetStringColumn(strFileName, "strGCWSpecificRegion"); } boolean checkGCWStats = true; @@ -136,31 +136,31 @@ int[] getValidSpawn(dictionary dctPlayerStats) return null; } - + location currentLoc = getLocation(objPlayer); - + if(intGcwFactions == null || intGcwThresholds == null || intGcwScoreTypes == null) { checkGCWStats = false; } resizeable int[] validTemplateIndices = new int[0]; - + if(validTemplateIndices == null) return null; - + for(int i = 0; i < strTemplates.length; ++i) { int intMinDifficulty = intMinDifficulties[i]; int intMaxDifficulty = intMaxDifficulties[i]; - + if(checkGCWStats) { int intGcwFaction = intGcwFactions[i]; int intGcwThreshold = intGcwThresholds[i]; int intGcwScoreType = intGcwScoreTypes[i]; string strSpecificRegion = strGcwSpecificRegions == null || strGcwSpecificRegions.length == 0 ? "" : strGcwSpecificRegions[i]; - + if(!checkGalacticCivilWarStandings(intGcwFaction, intGcwThreshold, intGcwScoreType, strSpecificRegion, currentLoc)) continue; } @@ -171,9 +171,9 @@ int[] getValidSpawn(dictionary dctPlayerStats) // Skip any theaters we shouldn't be spawning. if(!boolTheatersAllowed && strTemplates[i].indexOf("theater") > 0) continue; - + validTemplateIndices = utils.addElement(validTemplateIndices, i); - } + } } return validTemplateIndices; @@ -402,7 +402,7 @@ dictionary chooseWeightedSpawnTemplate(int[] intDataIndex, string strRegionName, dictionary dctSpawnInformation = new dictionary(); dctSpawnInformation.put("intIndex", intIndex); - + dctSpawnInformation.put("strTemplate", strTemplates[intIndex]); dctSpawnInformation.put("intMinDifficulty", intMinDifficulties[intIndex]); dctSpawnInformation.put("intMaxDifficulty", intMaxDifficulties[intIndex]); @@ -566,7 +566,7 @@ boolean canSpawn(obj_id objPlayer, location locSpawnLocation, boolean boolCheckF return false; } - + if(hasObjVar(objPlayer, "spawning.locSpawnLocation")) { // check quantitities @@ -625,7 +625,7 @@ boolean canSpawn(obj_id objPlayer, location locSpawnLocation, boolean boolCheckF // LOG("spawn_base", "battlefield.getBattlefield In a city returning false from canspawn"); return false; } - + } return true; @@ -714,7 +714,7 @@ boolean isSpawningAllowed(location locTest) if(locTest.area == INVALID_SPAWNING_AREAS[i]) return false; } - + return true; } @@ -753,7 +753,7 @@ void doSpawnEvent(dictionary params) { return; } - + obj_id objPlayer = params.getObjId("objPlayer"); if(!isIdValid(objPlayer)) @@ -818,7 +818,7 @@ void doSpawnEvent(dictionary params) void doSpawnTemplate(obj_id self, dictionary params) { - + string strTemplate = params.getString("strTemplate"); int intIndex = params.getInt("intIndex"); @@ -919,14 +919,14 @@ boolean isGalaticCivilWarWinner(int faction, int threshold, int imperialScore) return true; else if (faction == 2 && threshold < (100 - imperialScore)) // Rebel return true; - - return false; + + return false; } boolean checkGalacticCivilWarStandings(int gcwFaction, int gcwThreshold, int gcwScoreType, String gcwSpecificRegion, location loc) { if(gcwFaction > 0 && gcwThreshold > 0) - { + { if(gcwScoreType == 0) // Based on Planet Score. { int ImperialScore = getGcwGroupImperialScorePercentile(toLower(getCurrentSceneName())); @@ -965,7 +965,7 @@ boolean checkGalacticCivilWarStandings(int gcwFaction, int gcwThreshold, int gcw int ImperialScore = getGcwImperialScorePercentile(toLower(gcwSpecificRegion)); - return isGalaticCivilWarWinner(gcwFaction, gcwThreshold, ImperialScore); + return isGalaticCivilWarWinner(gcwFaction, gcwThreshold, ImperialScore); } else @@ -974,6 +974,6 @@ boolean checkGalacticCivilWarStandings(int gcwFaction, int gcwThreshold, int gcw } } - + return true; }