AOC_PRC8/_module/nss/instant_rest.nss
Jaysyn904 5e558169a0 Initial Commit
Initial Commit
2025-04-03 11:24:16 -04:00

42 lines
1.2 KiB
Plaintext

#include "x0_i0_petrify"
#include "prc_inc_util"
void DeathCheck (object oPC)
{
if (GetIsDead(oPC)==TRUE)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPC);
}
}
void main()
{
object oPC = GetLastUsedBy();
object oMod = GetModule();
object oCaster;
oCaster = OBJECT_SELF;
object oTarget;
oTarget = oPC;
int nInt = GetObjectType(oTarget);
int oState = GetLocalInt(oMod, "pool_state");
int iCurrent = GetCurrentHitPoints(oPC);
int iMax = GetMaxHitPoints(oPC);
int iHeal = iMax - iCurrent;
if (oState !=1)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_DUR_PIXIEDUST), oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_NATURES_BALANCE), oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(iMax), oTarget);
//AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_GREATER_RESTORATION, oTarget, METAMAGIC_ANY, TRUE, 20, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
DelayCommand(0.2, PRCForceRest(oPC));
//DelayCommand(2.0, DeathCheck(oPC));
DelayCommand(1.0, FloatingTextStringOnCreature("You feel rested", oPC));
}
else
{
PlaySound("sim_cntresist");
//FloatingTextStringOnCreature("You can't reach the pool", oPC);
}
}