Initial upload
Initial upload
This commit is contained in:
31
_module/nss/torchburn.nss
Normal file
31
_module/nss/torchburn.nss
Normal file
@@ -0,0 +1,31 @@
|
||||
void main()
|
||||
{
|
||||
object oMod = GetModule();
|
||||
object oPlayer = OBJECT_SELF;
|
||||
|
||||
if(GetLocalInt(oMod,"BURNTORCH"))
|
||||
{
|
||||
if ( !GetIsDM(oPlayer) )
|
||||
{
|
||||
object oTorch = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPlayer);
|
||||
string sTag=GetTag(oTorch);
|
||||
if (sTag == "NW_IT_TORCH001")
|
||||
{
|
||||
int nC;
|
||||
if ( (nC=(GetLocalInt(oTorch,"BURNCOUNT")+1)) >=
|
||||
GetLocalInt(oMod,"BURNTORCH")*(FloatToInt(HoursToSeconds(1)/6.0)))
|
||||
{
|
||||
if(sTag=="NW_IT_TORCH001" ||
|
||||
sTag=="hc_torch")
|
||||
{
|
||||
DestroyObject(oTorch);
|
||||
SendMessageToPC(oPlayer,"Your torch has burned out");
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
SetLocalInt(oTorch,"BURNCOUNT", nC);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user