// ====================================================================== // // bounty_check_reset.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.utils; // ====================================================================== // Script Constants // ====================================================================== string c_stringFile = "conversation/bounty_check_reset"; // ====================================================================== // Script Conditions // ====================================================================== boolean bounty_check_reset_condition__defaultCondition (obj_id player, obj_id npc) { return true; } // ---------------------------------------------------------------------- boolean bounty_check_reset_condition_bountyHunter (obj_id player, obj_id npc) { return utils.isProfession(player, utils.BOUNTY_HUNTER); } // ---------------------------------------------------------------------- boolean bounty_check_reset_condition_completedCollection (obj_id player, obj_id npc) { return hasCompletedCollection(player, "bounty_check_kill"); } // ====================================================================== // Script Actions // ====================================================================== void bounty_check_reset_action_resetCollection (obj_id player, obj_id npc) { collection.removeCompletedCollection(player, "bounty_check_kill"); } // ====================================================================== // Script %TO Tokens // ====================================================================== // ====================================================================== // Script %DI Tokens // ====================================================================== // ====================================================================== // Script %DF Tokens // ====================================================================== // ====================================================================== // handleBranch Functions // ====================================================================== int bounty_check_reset_handleBranch1 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Fancy meeting you here %TU. What can the Guild do for you today? //-- [RESPONSE NOTE] //-- PLAYER: I was just in the neighborhood, anything going on? if (response == "s_6") { doAnimationAction (player, "shrug_shoulders"); //-- [NOTE] if (bounty_check_reset_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "shake_head_no"); //-- NPC: No it's been pretty slow. That bastard Fett has cornered all the good marks usually supplied by Jabba. Someone really needs to end his career one of these days. If I were you I'd move on to a better system, Tatooine is dead now a days for someone of your caliber. string_id message = new string_id (c_stringFile, "s_8"); utils.removeScriptVar (player, "conversation.bounty_check_reset.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: You hear about the top 10 fugitive list? if (response == "s_10") { //-- [NOTE] if (bounty_check_reset_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "nod_head_once"); //-- NPC: Yeah I heard you took care of every mark on the list, mighty impressive! string_id message = new string_id (c_stringFile, "s_12"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Thank you. So what's new here, anything going on? boolean hasResponse0 = false; if (bounty_check_reset_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: Thank you. I'd like to start over though, go at it again. boolean hasResponse1 = false; if (bounty_check_reset_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_14"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_16"); utils.setScriptVar (player, "conversation.bounty_check_reset.branchId", 3); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.bounty_check_reset.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int bounty_check_reset_handleBranch3 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: Yeah I heard you took care of every mark on the list, mighty impressive! //-- [RESPONSE NOTE] //-- PLAYER: Thank you. So what's new here, anything going on? if (response == "s_14") { doAnimationAction (player, "nod_head_once"); //-- [NOTE] if (bounty_check_reset_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "shake_head_no"); //-- NPC: No it's been pretty slow. That bastard Fett has cornered all the good marks usually supplied by Jabba. Someone really needs to end his career one of these days. If I were you I'd move on to a better system, Tatooine is dead now a days for someone of your caliber. string_id message = new string_id (c_stringFile, "s_8"); utils.removeScriptVar (player, "conversation.bounty_check_reset.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: Thank you. I'd like to start over though, go at it again. if (response == "s_16") { doAnimationAction (player, "nod_head_once"); //-- [NOTE] if (bounty_check_reset_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "rub_chin_thoughtful"); //-- NPC: You sure %TU? You'd have to start over the whole collection of marks again. string_id message = new string_id (c_stringFile, "s_18"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: I'm sure. Things are slow and the rewards are good. boolean hasResponse0 = false; if (bounty_check_reset_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: On second thought, that might be too much work. boolean hasResponse1 = false; if (bounty_check_reset_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_32"); utils.setScriptVar (player, "conversation.bounty_check_reset.branchId", 4); 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.bounty_check_reset.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 bounty_check_reset_handleBranch4 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: You sure %TU? You'd have to start over the whole collection of marks again. //-- [RESPONSE NOTE] //-- PLAYER: I'm sure. Things are slow and the rewards are good. if (response == "s_20") { doAnimationAction (player, "nod"); //-- [NOTE] if (bounty_check_reset_condition__defaultCondition (player, npc)) { //-- NPC: If that's what you want, I will file the necessary paperwork to clean out your Bounty Collection. Last chance to change your mind? string_id message = new string_id (c_stringFile, "s_22"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: You heard me, I'm sure. boolean hasResponse0 = false; if (bounty_check_reset_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: On second thought, that might be too much work. boolean hasResponse1 = false; if (bounty_check_reset_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_24"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_28"); utils.setScriptVar (player, "conversation.bounty_check_reset.branchId", 5); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { utils.removeScriptVar (player, "conversation.bounty_check_reset.branchId"); npcEndConversationWithMessage (player, message); } return SCRIPT_CONTINUE; } } //-- [RESPONSE NOTE] //-- PLAYER: On second thought, that might be too much work. if (response == "s_32") { doAnimationAction (player, "shake_head_no"); //-- [NOTE] if (bounty_check_reset_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "nod"); //-- NPC: Yeah agreed. Get a drink and relax for a bit friend, you've earned. string_id message = new string_id (c_stringFile, "s_34"); utils.removeScriptVar (player, "conversation.bounty_check_reset.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- int bounty_check_reset_handleBranch5 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: If that's what you want, I will file the necessary paperwork to clean out your Bounty Collection. Last chance to change your mind? //-- [RESPONSE NOTE] //-- PLAYER: You heard me, I'm sure. if (response == "s_24") { doAnimationAction (player, "nod_head_once"); //-- [NOTE] if (bounty_check_reset_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "goodbye"); doAnimationAction (player, "goodbye"); bounty_check_reset_action_resetCollection (player, npc); //-- NPC: You're something else %TU. Very well, the paperwork is filed, good hunting! string_id message = new string_id (c_stringFile, "s_26"); utils.removeScriptVar (player, "conversation.bounty_check_reset.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: On second thought, that might be too much work. if (response == "s_28") { //-- [NOTE] if (bounty_check_reset_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "nod"); //-- NPC: Yeah agreed. Get a drink and relax for a bit friend, you've earned. string_id message = new string_id (c_stringFile, "s_30"); utils.removeScriptVar (player, "conversation.bounty_check_reset.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- // ====================================================================== // User Script Triggers // ====================================================================== trigger OnInitialize () { if ((!isTangible (self)) || (isPlayer (self))) detachScript(self, "conversation.bounty_check_reset"); setCondition (self, CONDITION_CONVERSABLE); obj_id cup1 = createObject ("object/tangible/item/con_drinking_glass_01.iff", self, ""); equip (cup1, self); return SCRIPT_CONTINUE; } trigger OnAttach () { setCondition (self, CONDITION_CONVERSABLE); obj_id cup1 = createObject ("object/tangible/item/con_drinking_glass_01.iff", self, ""); equip (cup1, self); 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.bounty_check_reset"); 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 (bounty_check_reset_condition_bountyHunter (player, npc)) { doAnimationAction (npc, "greet"); doAnimationAction (player, "greet"); //-- NPC: Fancy meeting you here %TU. What can the Guild do for you today? string_id message = new string_id (c_stringFile, "s_4"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: I was just in the neighborhood, anything going on? boolean hasResponse0 = false; if (bounty_check_reset_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: You hear about the top 10 fugitive list? boolean hasResponse1 = false; if (bounty_check_reset_condition_completedCollection (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_6"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_10"); utils.setScriptVar (player, "conversation.bounty_check_reset.branchId", 1); prose_package pp = new prose_package (); pp.stringId = message; pp.actor.set (player); pp.target.set (npc); npcStartConversation (player, npc, "bounty_check_reset", 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 (bounty_check_reset_condition__defaultCondition (player, npc)) { doAnimationAction (npc, "threaten"); //-- NPC: Careful who you bump in to stranger, if you want to leave this place in one piece! string_id message = new string_id (c_stringFile, "s_36"); 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 != "bounty_check_reset") return SCRIPT_CONTINUE; obj_id npc = self; int branchId = utils.getIntScriptVar (player, "conversation.bounty_check_reset.branchId"); if (branchId == 1 && bounty_check_reset_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 3 && bounty_check_reset_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 4 && bounty_check_reset_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; if (branchId == 5 && bounty_check_reset_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.bounty_check_reset.branchId"); return SCRIPT_CONTINUE; } // ======================================================================