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

64 lines
1.7 KiB
Plaintext

/**
* Title: medicine_damage.script
* Description: Testing script that makes a random damage medicine
*/
/***** INCLUDES ********************************************************/
include library.utils;
include library.healing;
include library.consumable;
include library.player_stomach;
/***** TRIGGERS ********************************************************/
trigger OnAttach()
{
int power = rand(50,300);
int charges = rand(1,10);
// Ranged medicines only have 1 charge.
if (healing.isRangedMedicine(self))
charges = 1;
attrib_mod[] am = createHealDamageMedicineMod(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(10, 50);
int[] skill_value = {skill_req};
setObjVar(self, consumable.VAR_SKILL_MOD_MIN, skill_value);
LOG("LOG_CHANNEL", "Medicine created!");
return SCRIPT_CONTINUE;
}
/***** FUNCTIONS *************************************************/
attrib_mod[] createHealDamageMedicineMod(int power)
{
attrib_mod[] am = new attrib_mod[3];
//create attribute mods for HEALTH 0, ACTION 3, and MIND 6
for (int i = 0; i < 3; i++)
{
am[i] = utils.createHealDamageAttribMod(i * 3, power);
}
return am;
}