void main()
{

object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;

SetLocalInt(oPC, "nRestIsSafe", 1);

int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));

if (DoOnce==TRUE) return;

SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);

StopFade(oPC);

if (GetHitDice(oPC) <  7)
 {
 // Set XP for level 7
 int nHD = 7;
 int nXP = ((nHD) * nHD * 500) + 500;
 SetXP(oPC, nXP);
 }

}
