// ====================================================================== // // huff_darklighter.script // Copyright 2004, Sony Online Entertainment // All Rights Reserved. // // Created with SwgConversationEditor 1.36 - DO NOT EDIT THIS AUTO-GENERATED FILE! // // ====================================================================== // ====================================================================== // Library Includes // ====================================================================== include library.ai_lib; include library.chat; include library.groundquests; include library.utils; // ====================================================================== // Script Constants // ====================================================================== string c_stringFile = "conversation/huff_darklighter"; // ====================================================================== // Script Conditions // ====================================================================== boolean huff_darklighter_condition__defaultCondition (obj_id player, obj_id npc) { return true; } // ---------------------------------------------------------------------- boolean huff_darklighter_condition_startWithHuff (obj_id player, obj_id npc) { return groundquests.hasCompletedQuest(player, "huffs_guard_rifle"); } // ---------------------------------------------------------------------- boolean huff_darklighter_condition_workingOnHuffDera (obj_id player, obj_id npc) { return groundquests.isQuestActive(player, "huff_darklighter_dera"); } // ---------------------------------------------------------------------- boolean huff_darklighter_condition_returningFromDera (obj_id player, obj_id npc) { return ( groundquests.isTaskActive(player, "huff_darklighter_dera", "finishedDera") || groundquests.hasCompletedQuest(player, "huff_darklighter_dera") ); } // ---------------------------------------------------------------------- boolean huff_darklighter_condition_workingOnHuffSennex (obj_id player, obj_id npc) { return groundquests.isQuestActive(player, "huff_darklighter_sennex"); } // ---------------------------------------------------------------------- boolean huff_darklighter_condition_returningFromSennex (obj_id player, obj_id npc) { return ( groundquests.isTaskActive(player, "huff_darklighter_sennex", "finishedSennex") || groundquests.hasCompletedQuest(player, "huff_darklighter_sennex") ); } // ====================================================================== // Script Actions // ====================================================================== void huff_darklighter_action_quest_HuffDera (obj_id player, obj_id npc) { groundquests.requestGrantQuest(player, "huff_darklighter_dera"); } // ---------------------------------------------------------------------- void huff_darklighter_action_signal_endHuffDera (obj_id player, obj_id npc) { groundquests.sendSignal(player, "finishedDera"); } // ---------------------------------------------------------------------- void huff_darklighter_action_grant_HuffSennex (obj_id player, obj_id npc) { groundquests.requestGrantQuest(player, "huff_darklighter_sennex"); } // ---------------------------------------------------------------------- void huff_darklighter_action_signal_endHuffSennex (obj_id player, obj_id npc) { groundquests.sendSignal(player, "finishedSennex"); } // ====================================================================== // Script %TO Tokens // ====================================================================== // ====================================================================== // Script %DI Tokens // ====================================================================== // ====================================================================== // Script %DF Tokens // ====================================================================== // ====================================================================== // handleBranch Functions // ====================================================================== int huff_darklighter_handleBranch3 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Thank you for aiding my daughter. Perhaps she is correct about the threat posed by those Sandpeople. It is good that steps have been taken to neutralize them. I have another request of you, should you be interested? //-- [RESPONSE NOTE] //-- PLAYER: How can I help? if (response == "s_15") { //-- [NOTE] if (huff_darklighter_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "explain"); huff_darklighter_action_grant_HuffSennex (player, npc); //-- NPC: The Sennex pirates have established a slave trade in the area. I will not stand for this. I know that they are using a bunker near Anchorhead that poses as a research facility. I ask your help to go there and end their slave trade. string_id message = new string_id (c_stringFile, "s_17"); utils.removeScriptVar (player, "conversation.huff_darklighter.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: No thank you. I think I'm done with you people. if (response == "s_16") { //-- [NOTE] if (huff_darklighter_condition__defaultCondition (player, npc)) { //-- NPC: Very well. Again, I thank you for the assistance you've given. Please travel safely. string_id message = new string_id (c_stringFile, "s_18"); utils.removeScriptVar (player, "conversation.huff_darklighter.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int huff_darklighter_handleBranch7 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: So you are the one who found my rifle, eh? I thank you. Perhaps I could convince you to aid me once again? //-- [RESPONSE NOTE] //-- PLAYER: What is it you would like me to do? if (response == "s_37") { //-- [NOTE] if (huff_darklighter_condition__defaultCondition (player, npc)) { huff_darklighter_action_quest_HuffDera (player, npc); //-- NPC: My daughter, Dera, has become obsessed with some Tusken Raiders that recently took up residence in a nearby cave. Please do me the favor of checking on her and ensuring that she is okay. string_id message = new string_id (c_stringFile, "s_38"); utils.removeScriptVar (player, "conversation.huff_darklighter.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: No thanks. I'm not interested. if (response == "s_39") { //-- [NOTE] if (huff_darklighter_condition__defaultCondition (player, npc)) { //-- NPC: I see. Well, I cannot fault you. You've done more than most. string_id message = new string_id (c_stringFile, "s_40"); utils.removeScriptVar (player, "conversation.huff_darklighter.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- // ====================================================================== // User Script Triggers // ====================================================================== trigger OnInitialize () { if ((!isMob (self)) || (isPlayer (self))) detachScript(self, "conversation.huff_darklighter"); 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.huff_darklighter"); 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 (huff_darklighter_condition_returningFromSennex (player, npc)) { doAnimationAction (npc, "udaman"); huff_darklighter_action_signal_endHuffSennex (player, npc); //-- NPC: Nicely done. Your work should set the Sennex pirates back quite a bit in this area. You have my thanks. string_id message = new string_id (c_stringFile, "s_20"); chat.chat (npc, player, message); return SCRIPT_CONTINUE; } //-- [NOTE] if (huff_darklighter_condition_workingOnHuffSennex (player, npc)) { doAnimationAction (npc, "stamp_feet"); //-- NPC: Slave trade is an abomination, and I will not stand for it. string_id message = new string_id (c_stringFile, "s_35"); chat.chat (npc, player, message); return SCRIPT_CONTINUE; } //-- [NOTE] if (huff_darklighter_condition_returningFromDera (player, npc)) { doAnimationAction (npc, "bow"); huff_darklighter_action_signal_endHuffDera (player, npc); //-- NPC: Thank you for aiding my daughter. Perhaps she is correct about the threat posed by those Sandpeople. It is good that steps have been taken to neutralize them. I have another request of you, should you be interested? string_id message = new string_id (c_stringFile, "s_36"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: How can I help? boolean hasResponse0 = false; if (huff_darklighter_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: No thank you. I think I'm done with you people. boolean hasResponse1 = false; if (huff_darklighter_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_15"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_16"); utils.setScriptVar (player, "conversation.huff_darklighter.branchId", 3); npcStartConversation (player, npc, "huff_darklighter", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (huff_darklighter_condition_workingOnHuffDera (player, npc)) { doAnimationAction (npc, "implore"); //-- NPC: If you would, please check on my daughter, Dera, for me. And perhaps aid her as well. string_id message = new string_id (c_stringFile, "s_11"); chat.chat (npc, player, message); return SCRIPT_CONTINUE; } //-- [NOTE] if (huff_darklighter_condition_startWithHuff (player, npc)) { doAnimationAction (npc, "offer_affection"); //-- NPC: So you are the one who found my rifle, eh? I thank you. Perhaps I could convince you to aid me once again? string_id message = new string_id (c_stringFile, "s_13"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: What is it you would like me to do? boolean hasResponse0 = false; if (huff_darklighter_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: No thanks. I'm not interested. boolean hasResponse1 = false; if (huff_darklighter_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_37"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_39"); utils.setScriptVar (player, "conversation.huff_darklighter.branchId", 7); npcStartConversation (player, npc, "huff_darklighter", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (huff_darklighter_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "wave_on_dismissing"); //-- NPC: Please, I am preoccupied at the moment. I must ask your indulgence. My guard outside will see to you if need be. string_id message = new string_id (c_stringFile, "s_24"); 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 != "huff_darklighter") return SCRIPT_CONTINUE; obj_id npc = self; int branchId = utils.getIntScriptVar (player, "conversation.huff_darklighter.branchId"); if (branchId == 3 && huff_darklighter_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 7 && huff_darklighter_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.huff_darklighter.branchId"); return SCRIPT_CONTINUE; } // ======================================================================