Files
dsrc/sku.0/sys.server/compiled/game/script/ai/hand_sampling.script
T
2013-09-10 23:17:15 -07:00

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;
}