// ====================================================================== // // bounty_probot.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.utils; // ====================================================================== // Script Constants // ====================================================================== string c_stringFile = "conversation/bounty_probot"; // ====================================================================== // Script Conditions // ====================================================================== boolean bounty_probot_condition__defaultCondition (obj_id player, obj_id npc) { return true; } // ---------------------------------------------------------------------- boolean bounty_probot_condition_notMyHunter (obj_id player, obj_id npc) { obj_id objPlayer = getObjIdObjVar(npc, "objPlayer"); obj_id objBountyMission = null; obj_id objMission = getObjIdObjVar(npc, "objMission"); if(player != null) //Hooray copy and paste of getBountyMission() from systems.mission.base.mission_dynamic_base { obj_id[] objMissionArray = getMissionObjects(objPlayer); if(objMissionArray!=null) { for(int intI = 0; intI Functions // ====================================================================== int bounty_probot_handleBranch3 (obj_id player, obj_id npc, string_id response) { //-- [BRANCH NOTE] //-- NPC: (Awaiting Command) //-- [RESPONSE NOTE] //-- PLAYER: Transmit Biological Signature if (response == "s_8") { bounty_probot_action_takeOff (player, npc); //-- [NOTE] if (bounty_probot_condition__defaultCondition (player, npc)) { //-- NPC: (Acknowledged) string_id message = new string_id (c_stringFile, "s_9"); utils.removeScriptVar (player, "conversation.bounty_probot.branchId"); npcEndConversationWithMessage (player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } // ---------------------------------------------------------------------- // ====================================================================== // User Script Triggers // ====================================================================== trigger OnInitialize () { if ((!isTangible (self)) || (isPlayer (self))) detachScript(self, "conversation.bounty_probot"); 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.bounty_probot"); 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_probot_condition_notMyHunter (player, npc)) { //-- NPC: (Command Refused) string_id message = new string_id (c_stringFile, "s_3"); chat.chat (npc, player, message); return SCRIPT_CONTINUE; } //-- [NOTE] if (bounty_probot_condition_noBioSig (player, npc)) { //-- NPC: (Insufficient Data) string_id message = new string_id (c_stringFile, "s_4"); chat.chat (npc, player, message); return SCRIPT_CONTINUE; } //-- [NOTE] if (bounty_probot_condition_readyToTrack (player, npc)) { //-- NPC: (Awaiting Command) string_id message = new string_id (c_stringFile, "s_5"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Transmit Biological Signature boolean hasResponse0 = false; if (bounty_probot_condition__defaultCondition (player, npc)) { ++numberOfResponses; hasResponse = true; 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.bounty_probot.branchId", 3); npcStartConversation (player, npc, "bounty_probot", message, responses); } else { chat.chat (npc, player, message); } return SCRIPT_CONTINUE; } //-- [NOTE] if (bounty_probot_condition__defaultCondition (player, npc)) { //-- NPC: (The droid ignores you) string_id message = new string_id (c_stringFile, "s_6"); 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_probot") return SCRIPT_CONTINUE; obj_id npc = self; int branchId = utils.getIntScriptVar (player, "conversation.bounty_probot.branchId"); if (branchId == 3 && bounty_probot_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.bounty_probot.branchId"); return SCRIPT_CONTINUE; } // ======================================================================