Files
dsrc/sku.0/sys.server/compiled/game/script/beta/medicine_wound.script
T

66 lines
2.0 KiB
Plaintext

/**
* Title: medicine_maker.script
* Description: Testing script that adds wound medicine attributes to an object
*/
/***** INCLUDES ********************************************************/
include library.utils;
include library.healing;
include library.consumable;
include library.player_stomach;
/***** TRIGGERS ********************************************************/
trigger OnAttach()
{
string template_name = getTemplateName(self);
int wound_type = -1;
// Each template corresponds to a wound_type
if (template_name.equals("object/tangible/medicine/medpack_wound_health.iff")) wound_type = 0;
if (template_name.equals("object/tangible/medicine/medpack_wound_constitution.iff")) wound_type = 2;
if (template_name.equals("object/tangible/medicine/medpack_wound_action.iff")) wound_type = 3;
if (template_name.equals("object/tangible/medicine/medpack_wound_stamina.iff")) wound_type = 5;
int power = rand(25,150);
int charges = rand(1,3);
//LOG("LOG_CHANNEL", "template_name ->" + template_name + " wound_type ->" + wound_type + " power ->" + power + " charges ->" + charges);
if (wound_type == -1)
{
wound_type = rand(0,NUM_ATTRIBUTES-NUM_ATTRIBUTES_PER_GROUP-1);
}
attrib_mod[] am = new attrib_mod[1];
am[0] = utils.createHealWoundAttribMod(wound_type, power);
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(25, 100);
int[] skill_value = {skill_req};
setObjVar(self, consumable.VAR_SKILL_MOD_MIN, skill_value);
LOG("LOG_CHANNEL", "Medicine created!");
return SCRIPT_CONTINUE;
}