PRC8/trunk/scripts/prc_rapid_metab.nss
Jaysyn904 1662218bb4 Initial upload.
Adding base PRC 4.19a files to repository.
2022-10-07 13:51:24 -04:00

38 lines
1.2 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Rapid Metabolism evaluation and execution script
//:: prc_rapid_metab
//:://////////////////////////////////////////////
/*
Heals the possessor by 1 + ConMod HP every
turn, or HD + ConMod per day if the PnP
version is active.
*/
//:://////////////////////////////////////////////
//:: Created By: Ornedan
//:: Created On: 24.03.2005
//:://////////////////////////////////////////////
#include "prc_alterations"
void main()
{
object oCreature = OBJECT_SELF;
if(GetCurrentThread() == "")
{
float fInterval = TurnsToSeconds(1);
if(GetPRCSwitch(PRC_PNP_RAPID_METABOLISM))
fInterval = HoursToSeconds(24);
if(!SpawnNewThread("RapidMetabolism", "prc_rapid_metab", fInterval, oCreature))
WriteTimestampedLogEntry("Failed to spawn thread for Rapid Metabolism on " + GetName(oCreature));
}
else
{
int nHP = 1;
if(GetPRCSwitch(PRC_PNP_RAPID_METABOLISM))
nHP = GetHitDice(oCreature);
effect eHeal = EffectHeal(nHP + GetAbilityModifier(ABILITY_CONSTITUTION, oCreature));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oCreature);
}
}