// ====================================================================== // // station_rodian_base.script // Copyright 2004, Sony Online Entertainment // All Rights Reserved. // // Created with SwgConversationEditor 1.30 - DO NOT EDIT THIS AUTO-GENERATED FILE! // // ====================================================================== // ====================================================================== // Library Includes // ====================================================================== include library.ai_lib; include library.chat; include library.groundquests; include library.space_battlefield; include library.space_combat; include library.space_content; include library.space_crafting; include library.space_flags; include library.space_quest; include library.space_transition; include library.utils; // ====================================================================== // Script Constants // ====================================================================== string c_stringFile = "conversation/station_rodian_base"; // ====================================================================== // Script Conditions // ====================================================================== boolean station_rodian_base_condition__defaultCondition (obj_id player, obj_id npc) { return true; } // ---------------------------------------------------------------------- boolean station_rodian_base_condition_hasWon_assassinations (obj_id player, obj_id npc) { // Has the player won any of the three ASSASSINATION missions he can take at this point? return ( space_quest.hasReceivedReward(player, "assassinate", "ep3_kash_station_assassinate_neutral") || space_quest.hasReceivedReward(player, "assassinate", "ep3_kash_station_assassinate_rebel") || space_quest.hasReceivedReward(player, "assassinate", "ep3_kash_station_assassinate_imperial")); } // ---------------------------------------------------------------------- boolean station_rodian_base_condition_isTooFar (obj_id player, obj_id npc) { space_combat.playCombatTauntSound( player ); obj_id containingShip = space_transition.getContainingShip(player); return ( getDistance( npc, containingShip ) > space_transition.STATION_COMM_MAX_DISTANCE ); } // ====================================================================== // Script Actions // ====================================================================== void station_rodian_base_action_grantDuty_destroy (obj_id player, obj_id npc) { space_quest.grantQuest(player, "destroy_duty", "ep3_kash_station_destroy_duty_rodian"); } // ====================================================================== // Script %TO Tokens // ====================================================================== // ====================================================================== // Script %DI Tokens // ====================================================================== // ====================================================================== // Script %DF Tokens // ====================================================================== // ====================================================================== // handleBranch Functions // ====================================================================== int station_rodian_base_handleBranch2 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Acknowledged. This is Rodian Security Command. You here to do business with Sordaan? //-- [RESPONSE NOTE] //-- PLAYER: Yes. What've you got? if (response == "s_180") { //-- [NOTE] if (station_rodian_base_condition_hasWon_assassinations (player, npc)) { //-- NPC: I have an outstanding deal for you, my friend. See, the Gotal Bandits have been a problem for us ever since we came to Kashyyyk. No idea why they picked a fight with us... I don't think they have respect for anything! string_id message = new string_id (c_stringFile, "s_185"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: And? boolean hasResponse0 = false; if (station_rodian_base_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_186"); utils.setScriptVar (player, "conversation.station_rodian_base.branchId", 3); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.station_rodian_base.branchId"); chat.chat (npc, player, message); npcEndConversation (player); } return SCRIPT_CONTINUE; } //-- [NOTE] if (station_rodian_base_condition__defaultCondition (player, npc)) { //-- NPC: Hmm. I don't have anything for you right now. For better or for worse, we only hire Civilian Protection Guild pilots. They're the only ones we can trust. string_id message = new string_id (c_stringFile, "s_199"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: You can trust me! boolean hasResponse0 = false; if (station_rodian_base_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_200"); utils.setScriptVar (player, "conversation.station_rodian_base.branchId", 10); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.station_rodian_base.branchId"); chat.chat (npc, player, message); npcEndConversation (player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int station_rodian_base_handleBranch3 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: I have an outstanding deal for you, my friend. See, the Gotal Bandits have been a problem for us ever since we came to Kashyyyk. No idea why they picked a fight with us... I don't think they have respect for anything! //-- [RESPONSE NOTE] //-- PLAYER: And? if (response == "s_186") { //-- [NOTE] if (station_rodian_base_condition__defaultCondition (player, npc)) { //-- NPC: Master Sordaan would really enjoy seeing the Gotals lose a significant portion of their fighting force! You get me? You think you can help us with this problem? string_id message = new string_id (c_stringFile, "s_188"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: You got it! boolean hasResponse0 = false; if (station_rodian_base_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: What's in it for me? boolean hasResponse1 = false; if (station_rodian_base_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } //-- PLAYER: No thanks. boolean hasResponse2 = false; if (station_rodian_base_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_189"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_190"); if (hasResponse2) responses [responseIndex++] = new string_id (c_stringFile, "s_191"); utils.setScriptVar (player, "conversation.station_rodian_base.branchId", 4); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.station_rodian_base.branchId"); chat.chat (npc, player, message); npcEndConversation (player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int station_rodian_base_handleBranch4 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Master Sordaan would really enjoy seeing the Gotals lose a significant portion of their fighting force! You get me? You think you can help us with this problem? //-- [RESPONSE NOTE] //-- PLAYER: You got it! if (response == "s_189") { //-- [NOTE] if (station_rodian_base_condition__defaultCondition (player, npc)) { station_rodian_base_action_grantDuty_destroy (player, npc); //-- NPC: Don't let me down, pilot! string_id message = new string_id (c_stringFile, "s_194"); utils.removeScriptVar (player, "conversation.station_rodian_base.branchId"); chat.chat (npc, player, message); npcEndConversation (player); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: What's in it for me? if (response == "s_190") { //-- [NOTE] if (station_rodian_base_condition__defaultCondition (player, npc)) { //-- NPC: This is an excellent credit opportunity for a pilot such as you. What do you say to three hundred cred per kill... and a tiny bit of my respect when you're finished? string_id message = new string_id (c_stringFile, "s_193"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: I'll take it. boolean hasResponse0 = false; if (station_rodian_base_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: You can do better than that. boolean hasResponse1 = false; if (station_rodian_base_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_195"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_196"); utils.setScriptVar (player, "conversation.station_rodian_base.branchId", 6); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.station_rodian_base.branchId"); chat.chat (npc, player, message); npcEndConversation (player); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: No thanks. if (response == "s_191") { //-- [NOTE] if (station_rodian_base_condition__defaultCondition (player, npc)) { //-- NPC: You'll be back! string_id message = new string_id (c_stringFile, "s_192"); utils.removeScriptVar (player, "conversation.station_rodian_base.branchId"); chat.chat (npc, player, message); npcEndConversation (player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int station_rodian_base_handleBranch6 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: This is an excellent credit opportunity for a pilot such as you. What do you say to three hundred cred per kill... and a tiny bit of my respect when you're finished? //-- [RESPONSE NOTE] //-- PLAYER: I'll take it. if (response == "s_195") { //-- [NOTE] if (station_rodian_base_condition__defaultCondition (player, npc)) { station_rodian_base_action_grantDuty_destroy (player, npc); //-- NPC: Good! Don't let me down, pilot! string_id message = new string_id (c_stringFile, "s_198"); utils.removeScriptVar (player, "conversation.station_rodian_base.branchId"); chat.chat (npc, player, message); npcEndConversation (player); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: You can do better than that. if (response == "s_196") { //-- [NOTE] if (station_rodian_base_condition__defaultCondition (player, npc)) { //-- NPC: Maybe I can do better than you? string_id message = new string_id (c_stringFile, "s_197"); utils.removeScriptVar (player, "conversation.station_rodian_base.branchId"); chat.chat (npc, player, message); npcEndConversation (player); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int station_rodian_base_handleBranch10 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Hmm. I don't have anything for you right now. For better or for worse, we only hire Civilian Protection Guild pilots. They're the only ones we can trust. //-- [RESPONSE NOTE] //-- PLAYER: You can trust me! if (response == "s_200") { //-- [NOTE] if (station_rodian_base_condition__defaultCondition (player, npc)) { //-- NPC: Oh, I'm sure. However, I can't offer contracts to any pilot who has yet to prove themselves as a strong Civilian Protector. Sorry about that. string_id message = new string_id (c_stringFile, "s_201"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: How do I become a Civilian Protector? boolean hasResponse0 = false; if (station_rodian_base_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_203"); utils.setScriptVar (player, "conversation.station_rodian_base.branchId", 11); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.station_rodian_base.branchId"); chat.chat (npc, player, message); npcEndConversation (player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int station_rodian_base_handleBranch11 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Oh, I'm sure. However, I can't offer contracts to any pilot who has yet to prove themselves as a strong Civilian Protector. Sorry about that. //-- [RESPONSE NOTE] //-- PLAYER: How do I become a Civilian Protector? if (response == "s_203") { //-- [NOTE] if (station_rodian_base_condition__defaultCondition (player, npc)) { //-- NPC: The Kashyyyk space station is run by a Civilian Protector named Rian Ry. Work with her for a while. When she runs out of errands for you, stop by and we'll talk. string_id message = new string_id (c_stringFile, "s_207"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: I will. boolean hasResponse0 = false; if (station_rodian_base_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_209"); utils.setScriptVar (player, "conversation.station_rodian_base.branchId", 12); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.station_rodian_base.branchId"); chat.chat (npc, player, message); npcEndConversation (player); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int station_rodian_base_handleBranch12 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: The Kashyyyk space station is run by a Civilian Protector named Rian Ry. Work with her for a while. When she runs out of errands for you, stop by and we'll talk. //-- [RESPONSE NOTE] //-- PLAYER: I will. if (response == "s_209") { //-- [NOTE] if (station_rodian_base_condition__defaultCondition (player, npc)) { //-- NPC: Rodian Protectors out. string_id message = new string_id (c_stringFile, "s_211"); utils.removeScriptVar (player, "conversation.station_rodian_base.branchId"); chat.chat (npc, player, message); npcEndConversation (player); 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; } trigger OnIncapacitated (obj_id killer) { clearCondition (self, CONDITION_CONVERSABLE); detachScript (self, "conversation.station_rodian_base"); 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 (station_rodian_base_condition_isTooFar (player, npc)) { //-- NPC: What? You're breaking up! Come closer if you want to do business! string_id message = new string_id (c_stringFile, "s_204"); chat.chat (npc, player, message); return SCRIPT_CONTINUE; } //-- [NOTE] if (station_rodian_base_condition__defaultCondition (player, npc)) { //-- NPC: Acknowledged. This is Rodian Security Command. You here to do business with Sordaan? string_id message = new string_id (c_stringFile, "s_578"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Yes. What've you got? boolean hasResponse0 = false; if (station_rodian_base_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_180"); utils.setScriptVar (player, "conversation.station_rodian_base.branchId", 2); npcStartConversation (player, npc, "station_rodian_base", 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 != "station_rodian_base") return SCRIPT_CONTINUE; obj_id npc = self; int branchId = utils.getIntScriptVar (player, "conversation.station_rodian_base.branchId"); if (branchId == 2 && station_rodian_base_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 3 && station_rodian_base_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 4 && station_rodian_base_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 6 && station_rodian_base_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 10 && station_rodian_base_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 11 && station_rodian_base_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 12 && station_rodian_base_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.station_rodian_base.branchId"); return SCRIPT_CONTINUE; } // ======================================================================