// ====================================================================== // // itp_loam_courier.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.space_quest; include library.utils; // ====================================================================== // Script Constants // ====================================================================== string c_stringFile = "conversation/itp_loam_courier"; // ====================================================================== // Script Conditions // ====================================================================== boolean itp_loam_courier_condition__defaultCondition (obj_id player, obj_id npc) { return true; } // ---------------------------------------------------------------------- boolean itp_loam_courier_condition_loamTaskActive (obj_id player, obj_id npc) { return groundquests.isTaskActive(player, "itp_loam_02", "itp_loam_02_02"); } // ====================================================================== // Script Actions // ====================================================================== void itp_loam_courier_action_loamSignal (obj_id player, obj_id npc) { groundquests.sendSignal(player, "itp_loam_02_02"); } // ====================================================================== // Script %TO Tokens // ====================================================================== // ====================================================================== // Script %DI Tokens // ====================================================================== // ====================================================================== // Script %DF Tokens // ====================================================================== // ====================================================================== // handleBranch Functions // ====================================================================== // ====================================================================== // User Script Triggers // ====================================================================== trigger OnInitialize () { if ((!isMob (self)) || (isPlayer (self))) detachScript(self, "conversation.itp_loam_courier"); 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); faceTo( self, player ); return SCRIPT_CONTINUE; } trigger OnIncapacitated (obj_id killer) { clearCondition (self, CONDITION_CONVERSABLE); detachScript (self, "conversation.itp_loam_courier"); 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 (itp_loam_courier_condition_loamTaskActive (player, npc)) { itp_loam_courier_action_loamSignal (player, npc); //-- NPC: Inquisitor Loam sent you! No! There was nothing I could do. They came out of nowhere and took the missive. There were too many. Wait, I know. You can go take care of them. Teach them a lesson about messing with an Imperial courier. That's my only hope. string_id message = new string_id (c_stringFile, "s_32"); chat.chat (npc, player, message); return SCRIPT_CONTINUE; } //-- [NOTE] if (itp_loam_courier_condition__defaultCondition (player, npc)) { //-- NPC: Huh...what was that? Please go away. He might find me. 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 != "itp_loam_courier") return SCRIPT_CONTINUE; obj_id npc = self; int branchId = utils.getIntScriptVar (player, "conversation.itp_loam_courier.branchId"); chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); utils.removeScriptVar (player, "conversation.itp_loam_courier.branchId"); return SCRIPT_CONTINUE; } // ======================================================================