Initial commit
Initial commit.
This commit is contained in:
47
_module/nss/drink.nss
Normal file
47
_module/nss/drink.nss
Normal file
@@ -0,0 +1,47 @@
|
||||
void main()
|
||||
{
|
||||
object oPC = GetItemActivator();
|
||||
string sName = GetName(GetItemActivated());
|
||||
int iThirsty = GetLocalInt(oPC,"drank");
|
||||
int iDrinks = GetLocalInt(GetItemActivated(),"drinks");
|
||||
int iFill = GetLocalInt(oPC,"refill");
|
||||
|
||||
if (iFill == 1)
|
||||
{
|
||||
if (sName == "Water Canteen")
|
||||
{
|
||||
SetLocalInt(GetItemActivated(),"drinks",3);
|
||||
SendMessageToPC(oPC,sName+" is full.");
|
||||
return;
|
||||
}
|
||||
if (sName == "Water Bottle")
|
||||
{
|
||||
SetLocalInt(GetItemActivated(),"drinks",1);
|
||||
SendMessageToPC(oPC,sName+" is full.");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
if (iDrinks >= 1)
|
||||
{
|
||||
|
||||
|
||||
if (iThirsty <= 0)
|
||||
{
|
||||
SetLocalInt(oPC,"drank",1);
|
||||
FloatingTextStringOnCreature("You drink from the "+ sName +" and are no longer thirsty.",oPC,TRUE);
|
||||
SetLocalInt(GetItemActivated(),"drinks",iDrinks-1);
|
||||
return;
|
||||
}
|
||||
if (iThirsty == 1)
|
||||
{
|
||||
FloatingTextStringOnCreature("You aren't thirsty, but you drink from the "+ sName +" anyway.",oPC,TRUE);
|
||||
SetLocalInt(GetItemActivated(),"drinks",iDrinks-1);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
if (iDrinks == 0)
|
||||
FloatingTextStringOnCreature("This "+ sName +" is empty.",oPC,TRUE);
|
||||
return;
|
||||
}
|
Reference in New Issue
Block a user