#include "x0_i0_petrify" void main() { int oHour = GetTimeHour(); int oSec = GetTimeSecond(); int oMin = GetTimeMinute(); int oMil = GetTimeMillisecond(); object oPC = GetLastPCRested(); effect eSnore = EffectVisualEffect(VFX_IMP_SLEEP); effect eBlind = EffectBlindness(); if (GetLastRestEventType() == REST_EVENTTYPE_REST_STARTED) { oHour = oHour+8; SetTime(oHour, oMin, oSec, oMil); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSnore, oPC, 10.0); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBlind, oPC, 30.0); DelayCommand(8.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSnore, oPC, 10.0)); } int nLastRestType=GetLastRestEventType(); if (nLastRestType == REST_EVENTTYPE_REST_FINISHED ||nLastRestType == REST_EVENTTYPE_REST_CANCELLED ) { RemoveEffectOfType(oPC, GetEffectType(eBlind)); FloatingTextStringOnCreature("You slept for 8 hours", oPC); } }