62 lines
1.9 KiB
Plaintext
62 lines
1.9 KiB
Plaintext
// This include will do the On Activate Item burning of a troll
|
|
|
|
void DoTrollBurn(object oTroll)
|
|
{
|
|
effect eVFX1 = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_ORANGE);
|
|
effect eVFX2 = EffectVisualEffect(VFX_IMP_FLAME_M);
|
|
|
|
object oFIRE = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_flamemedium",GetLocation(oTroll),TRUE);
|
|
DestroyObject(oFIRE,7.5);
|
|
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVFX2,oTroll);
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVFX1,oTroll,3.0);
|
|
int iTrollHP = GetCurrentHitPoints(oTroll);
|
|
effect eDmg = EffectDamage(iTrollHP,DAMAGE_TYPE_FIRE);
|
|
DelayCommand(3.5,ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,oTroll));
|
|
}
|
|
|
|
|
|
void DoTrollTorch(object oPC, object oTroll, object oItem)
|
|
{
|
|
if (GetTag(oItem) == "TROLL_TORCH")
|
|
{
|
|
if(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC) == oItem ||
|
|
GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC) == oItem)
|
|
{
|
|
if (GetTag(oTroll) == "i420_TROLL")
|
|
{
|
|
if(GetDistanceBetween(oPC,oTroll) <= 3.0)
|
|
{
|
|
int iSubDmg = GetLocalInt(oTroll,"AMOUNT_SUBDMG");
|
|
if (iSubDmg >= GetMaxHitPoints(oTroll))
|
|
{
|
|
AssignCommand(oPC,ClearAllActions(TRUE));
|
|
AssignCommand(oPC,ActionAttack(oTroll));
|
|
DelayCommand(2.0,DoTrollBurn(oTroll));
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oPC,"The troll must be unconscious if you want to burn it.");
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oPC,"You must get closer to the troll to burn it.");
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oPC,"You must target a troll with the torch.");
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oPC,"The torch must be equipped to burn the troll.");
|
|
}
|
|
}
|
|
return;
|
|
}
|