32 lines
1005 B
Plaintext
32 lines
1005 B
Plaintext
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|