Regeneration work

Regeneration work.  Full compile.
This commit is contained in:
Jaysyn904
2023-01-24 21:20:53 -05:00
parent 300e3252fb
commit edb3ec4afe
39 changed files with 135 additions and 16 deletions

View File

@@ -15,7 +15,34 @@ void main()
{
object oNPC = OBJECT_SELF;
object oAttacker;
string sResRef = GetResRef(oNPC);
effect eSleep = EffectSleep();
//:: Handles troll regen
if(sResRef == "ra_troll001" || sResRef == "TROLL_FEDORLA")
{
if(GetLocalInt(oNPC, "nSubDual") > 0)
{
SetLocalInt(oNPC, "nSubDual", GetLocalInt(oNPC, "nSubDual") - 5);
if(GetLocalInt(oNPC, "nSubDual") < GetCurrentHitPoints(oNPC))
{
RemoveEffect(oNPC, eSleep);
}
if(GetLocalInt(oNPC, "nSubDual") > GetCurrentHitPoints(oNPC))
{
SpeakString("I am still unconscious!");
SetIsDestroyable(FALSE, TRUE, TRUE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSleep, OBJECT_SELF, 6.5f);
}
SpeakString("My Subdual is now " + IntToString(GetLocalInt(oNPC, "nSubDual")));
}
}
//:: Equips best armor
if ((!GetIsInCombat(oNPC) && (GetItemInSlot(INVENTORY_SLOT_CHEST) == OBJECT_INVALID)))