include library.utils; include library.healing; include library.consumable; include library.player_stomach; const string SCRIPT_BETA_MEDICINE = "beta.medicine"; trigger OnAttach() { int type = rand(1,3); int numItems = rand(1,4); attrib_mod[] am = new attrib_mod[numItems]; for (int i = 0; i < numItems; i++ ) { attrib_mod tmp = new attrib_mod(0, 0, 0.0f, 0.0f, 0.0f); switch (type) { case 1: //heal damage tmp = utils.createHealDamageAttribMod(rand(0,2) * 3, rand(50,200)); break; case 2: //clear attrib mods on the specified attrib tmp = utils.createAntidoteAttribMod(rand(HEALTH, WILLPOWER)); break; case 3: //heal wound tmp = utils.createHealWoundAttribMod(rand(HEALTH, WILLPOWER),rand(10,35)); break; case 4: //heal shock tmp = utils.createHealShockAttribMod(rand(10,35)); break; } am[i] = tmp; } if ( (am == null) || (am.length ==0) ) { return SCRIPT_CONTINUE; } setObjVar(self, consumable.VAR_CONSUMABLE_MODS, am); int[] stomach = new int[player_stomach.STOMACH_MAX]; for (int i = 0; i < player_stomach.STOMACH_MAX; i++ ) { stomach[i] = rand(1,50); } if(stomach != null && stomach.length > 0) { // Check for zero length array setObjVar(self, consumable.VAR_CONSUMABLE_STOMACH_VALUES, stomach); } /* string[] skillReq = new string[1]; skillReq[0] = "LightRifleAccuracy"; setObjVar(self, consumable.VAR_SKILL_MOD_REQUIRED, skillReq); int[] skillMin = new int[1]; skillMin[0] = 20; setObjVar(self, consumable.VAR_SKILL_MOD_MIN, skillMin); */ return SCRIPT_CONTINUE; }