Files
HeroesStone_PRC8/_module/nss/pri_bedyesno.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

58 lines
1.4 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Asking if the Player Wishes to Rest
//:: pri_bedyesno.nns
//:: Copyright (c) 2002 Shepherd Software Inc.
//:://////////////////////////////////////////////
/*
This script should be attached to any bed that you
wish to allow the player to sleep on. Make the bed
usable and then place this script on the event "OnUsed."
A conversation is started with the player that asks them
if they wish to rest.
*/
//:://////////////////////////////////////////////
//:: Created By: Russell S. Ahlstrom
//:: Created On: June 26, 2002
//:://////////////////////////////////////////////
void main()
{
object oBed = OBJECT_SELF;
string sName = GetTag(oBed);
if (sName == "KingSizeBed")
{
object oPC = GetClickingObject();
int iRenter = GetLocalInt(oPC, "RSA_BoughtSuite");
if (iRenter > 0)
{
ActionStartConversation(oPC, "pri_bed", TRUE);
}
else
{
FloatingTextStringOnCreature("Only the renter of the suite may sleep here!", oPC, FALSE);
return;
}
}
else if (sName == "suitebed")
{
object oPC = GetLastUsedBy();
int iRenter = GetLocalInt(oPC, "RSA_BoughtSuite");
if (iRenter == 0)
{
ActionStartConversation(oPC, "pri_bed", TRUE);
}
else
{
FloatingTextStringOnCreature("This bed is for the guests. You should sleep on the King Size Bed.", oPC, FALSE);
return;
}
}
else
{
ActionStartConversation(GetLastUsedBy(), "pri_bed", TRUE);
}
}