mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-13 22:01:04 -04:00
45 lines
988 B
Plaintext
45 lines
988 B
Plaintext
|
|
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;
|
|
}
|