Files
dsrc/sku.0/sys.server/compiled/game/script/beta/medicine_buff.script
T
2013-09-10 23:17:15 -07:00

77 lines
2.6 KiB
Plaintext

/**********************************************************************
* Copyright (c)2000-2002 Sony Online Entertainment Inc.
* All Rights Reserved
*
* Title: buff_medicine
* Description: creates a buff medicine. For testing only.
* @author $Author:$
* @version $Revision:$
**********************************************************************/
/***** INCLUDES ********************************************************/
include library.utils;
include library.healing;
include library.consumable;
include library.player_stomach;
/***** CONSTANTS *******************************************************/
/***** TRIGGERS ********************************************************/
trigger OnAttach()
{
if (hasObjVar(self, consumable.VAR_CONSUMABLE_MODS))
removeObjVar(self, consumable.VAR_CONSUMABLE_MODS);
string template_name = getTemplateName(self);
int buff_type = -1;
// Each template corresponds to a wound_type
if (template_name.equals("object/tangible/medicine/medpack_enhance_health.iff")) buff_type = 0;
if (template_name.equals("object/tangible/medicine/medpack_enhance_constitution.iff")) buff_type = 2;
if (template_name.equals("object/tangible/medicine/medpack_enhance_action.iff")) buff_type = 3;
if (template_name.equals("object/tangible/medicine/medpack_enhance_stamina.iff")) buff_type = 5;
int power = rand(25,150);
int charges = rand(1,3);
int duration = rand(300, 1800);
if (buff_type == -1)
buff_type = rand(0,NUM_ATTRIBUTES-NUM_ATTRIBUTES_PER_GROUP-1);
attrib_mod[] am = new attrib_mod[1];
attrib_mod tmp = new attrib_mod(buff_type, power, duration, healing.VAR_BUFF_MOD_ATTACK, healing.VAR_BUFF_MOD_DECAY);
am[0] = tmp;
setObjVar(self, consumable.VAR_CONSUMABLE_MODS, am);
setObjVar(self, consumable.VAR_CONSUMABLE_MEDICINE, true);
setCount(self, charges);
//setObjVar(self, consumable.VAR_CONSUMABLE_CHARGES, charges);
// Set all stomachs to zero since we aren't currently using the stomach for medicine
int[] stomach = {0, 0, 0};
setObjVar(self, consumable.VAR_CONSUMABLE_STOMACH_VALUES, stomach);
// Add in skill mod required data
string[] skill_mod = {"healing_ability"};
setObjVar(self, consumable.VAR_SKILL_MOD_REQUIRED, skill_mod);
// Add in min mod value data
int skill_req = rand(1, 25);
int[] skill_value = {skill_req};
setObjVar(self, consumable.VAR_SKILL_MOD_MIN, skill_value);
return SCRIPT_CONTINUE;
}
/***** MESSAGEHANDLERS *************************************************/
/***** COMMANDHANDLERS *************************************************/
/***** FUNCTIONS *******************************************************/