include library.buff; include library.callable; include library.pet_lib; //constants const int BUFF_TICK_TIME = 20; trigger OnInitialize() { messageTo(self, "handlerApplySamplerBuff", null, 3, false); return SCRIPT_CONTINUE; } trigger OnAttach() { messageTo(self, "handlerApplySamplerBuff", null, 3, false); return SCRIPT_CONTINUE; } messageHandler handlerApplySamplerBuff() { obj_id petControlDevice = callable.getCallableCD(self); int powerLevel = getIntObjVar(petControlDevice, "ai.pet.powerLevel"); if(powerLevel >= pet_lib.OUT_OF_POWER) { messageTo(self, "handlerApplySamplerBuff", null, BUFF_TICK_TIME, false); return SCRIPT_CONTINUE; } obj_id master = getMaster(self); int buffValue = getIntObjVar(self, "module_data.sampling_power"); //buff.applyBuff(master, self, "droid_hand_sample"); buff.applyBuff(master, "droid_hand_sample", 30, buffValue); messageTo(self, "handlerApplySamplerBuff", null, BUFF_TICK_TIME, false); return SCRIPT_CONTINUE; }