generated from Jaysyn/ModuleTemplate
Initial Commit
Initial Commit
This commit is contained in:
26
_module/nss/sleep.nss
Normal file
26
_module/nss/sleep.nss
Normal file
@@ -0,0 +1,26 @@
|
||||
#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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user