/********************************************************************** * Copyright (c)2000-2002 Sony Online Entertainment Inc. * All Rights Reserved * * Title: * Description: <description> * @author $Author:$ * @version $Revision:$ **********************************************************************/ /***** INCLUDES ********************************************************/ include library.ai_lib; include library.chat; include library.utils; include library.prose; /***** CONSTANTS *******************************************************/ const string PP_FILE_LOC = "quest/legacy/legacy_sick"; const string RESPONSE_TEXT = "datatables/npc/legacy/legacy_sick.iff"; int INITIAL_DELAY = 10; /***** TRIGGERS ********************************************************/ trigger OnAttach() { if (hasScript(self, "ai.creature_combat")) { detachScript(self, "ai.creature_combat"); } if (hasScript(self, "systems.combat.credit_for_kills")) { detachScript(self, "systems.combat.credit_for_kills"); } if (hasScript(self, "systems.combat.combat_actions")) { detachScript(self, "systems.combat.combat_actions"); } ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_STOP ); messageTo (self, "legSick", null, INITIAL_DELAY, false); return SCRIPT_CONTINUE; } /***** MESSAGEHANDLERS *************************************************/ messageHandler legSick() { int randSick = rand(0, 6); chat.publicChat(self, null, null, null, getRandSick(self, randSick)); ai_lib.doAction(self, "heavy_cough_vomit"); int randRepeatMsg = rand(90, 300); messageTo (self, "legSick", null, randRepeatMsg, false); return SCRIPT_CONTINUE; } /***** COMMANDHANDLERS *************************************************/ /***** FUNCTIONS *******************************************************/ prose_package getRandSick(obj_id target, int sickRow) { string_id response = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, sickRow, 1)); prose_package pp = prose.getPackage(response, target); return pp; }