Files
Anphillia_PRC8/_module/nss/hc_act_oilflask.nss
Jaysyn904 28cdb617b3 Initial commit
Adding all of the current content for Anphillia Unlimited.
2024-01-04 07:49:38 -05:00

60 lines
2.0 KiB
Plaintext

#include "hc_inc"
#include "hc_text_activate"
void main()
{
object oUser=OBJECT_SELF;
object oOther=GetLocalObject(oUser,"OTHER");
object oItem=GetLocalObject(oUser,"ITEM");
DeleteLocalObject(oUser,"ITEM");
DeleteLocalObject(oUser,"OTHER");
if(oOther==OBJECT_INVALID)
{
location lWhere=GetItemActivatedTargetLocation();
if(GetDistanceBetween(oUser, oOther) > 3.0)
{
SendMessageToPC(oUser,MOVECLOSER);
return;
}
AssignCommand(oUser,ActionMoveToLocation(GetLocation(oOther)));
DelayCommand(0.8,AssignCommand(oUser,ActionPlayAnimation(
ANIMATION_LOOPING_GET_LOW)));
SendMessageToPC(oUser,STARTFIRE);
CreateObject(OBJECT_TYPE_PLACEABLE,"campfr001",lWhere);
DelayCommand(1.0, RecomputeStaticLighting(GetArea(oUser)));
DestroyObject(oItem);
return;
}
if(GetTag(oOther)=="hc_campfire")
{
SetLocalInt(oOther,"BURNCOUNT",
GetLocalInt(oOther,"BURNCOUNT")+
(-1*GetLocalInt(oMod,"BURNTORCH")*(FloatToInt(HoursToSeconds(3)/6.0))));
SendMessageToPC(oUser,FUELFIRE);
DestroyObject(oItem);
return;
}
if(GetTag(oOther)=="hc_lantern")
{
if(GetLocalInt(oOther,"BURNCOUNT") >
(-6*GetLocalInt(oMod,"BURNTORCH")*(FloatToInt(HoursToSeconds(1)/6.0))))
{
SetLocalInt(oOther,"BURNCOUNT",
(-6*GetLocalInt(oMod,"BURNTORCH")*(FloatToInt(HoursToSeconds(1)/6.0))));
SendMessageToPC(oUser,REFILL);
DestroyObject(oItem);
return;
}
else
{
SendMessageToPC(oUser,ALREADYFULL);
return;
}
}
else
{
SetLocalObject(oUser,"GRENADE",oItem);
SetLocalObject(oUser,"GRENADETARGET",oOther);
ExecuteScript("hc_grenade", oUser);
}
}