func void Start_Trigger_Attribute_TimeBonus(var c_npc slf,var int attribute,var int value,var int time)
{
SelfTrigger = Oxbow_Cycle_Func("Trigger_Attribute_TimeBonus", 1, slf, null, null);
SelfTrigger.AIVariables[0] = time;
SelfTrigger.AIVariables[1] = attribute;
SelfTrigger.AIVariables[2] = value;
SelfTrigger.Delay = 0;
};
func int Trigger_Attribute_TimeBonus()
{
if (SelfTrigger.Delay == 0)
{
if (Npc_HasItems(hero,ItPo_Bonus_Active) == true)
{
SelfTrigger.Delay = 1000;
AI_Wait(hero,3);
AI_PlayAni(self,"S_FIRE_VICTIM");
Wld_PlayEffect("VOB_MAGICBURN",hero,hero,0,0,0,FALSE);
B_Say(self,self,"$Dead");
AI_StopFX(self,"VOB_MAGICBURN");
Npc_ChangeAttribute(self,ATR_HITPOINTS,-self.attribute[ATR_HITPOINTS_MAX]);
Npc_StopAni(self,"S_FIRE_VICTIM");
//return LOOP_END;
};
if (Npc_HasItems(hero,ItPo_Bonus_Active) == false)
{
SelfTrigger.Delay = 1000;
B_RaiseAttribute(self,SelfTrigger.AIVariables[1],SelfTrigger.AIVariables[2]);
CreateInvItem(self,ItPo_Bonus_Active);
};
};
SelfTrigger.AIVariables[0] -= 1;
if (SelfTrigger.AIVariables[0] <= 0)
{
B_RaiseAttribute(self,SelfTrigger.AIVariables[1], -SelfTrigger.AIVariables[2]);
Npc_RemoveInvItems(hero,ItPo_Bonus_Active,1);
return LOOP_END;
};
return LOOP_CONTINUE;
};