Initial commit. Updated release archive.
This commit is contained in:
55
_module/nss/troll_on_heart.nss
Normal file
55
_module/nss/troll_on_heart.nss
Normal file
@@ -0,0 +1,55 @@
|
||||
////////////////////////////////
|
||||
//
|
||||
// Troll (Acurate for 3E)
|
||||
//
|
||||
// By\ Invizible420
|
||||
// Created\ 11.28.04
|
||||
//
|
||||
// ScriptName\ troll_on_heart
|
||||
//
|
||||
// Location for script\
|
||||
// To be placed in the
|
||||
// Heartbeat event of the
|
||||
// troll.
|
||||
//
|
||||
//
|
||||
// See troll_on_dmg for mor
|
||||
//
|
||||
////////////////////////////////
|
||||
#include "NW_I0_GENERIC"
|
||||
#include "inc_utility"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oSelf = OBJECT_SELF;
|
||||
|
||||
// Get the Amount of SD then regen -5 each turn
|
||||
if (GetLocalInt(oSelf,"AMOUNT_SUBDMG") > 0)
|
||||
{
|
||||
int oSDMG = GetLocalInt(oSelf,"AMOUNT_SUBDMG")-5;
|
||||
SetLocalInt(oSelf,"AMOUNT_SUBDMG",oSDMG);
|
||||
}
|
||||
|
||||
// Check that creature is ready for restore
|
||||
if (GetLocalInt(oSelf,"AMOUNT_SUBDMG") <= GetMaxHitPoints())
|
||||
{
|
||||
// Get the Sleep effect (sleep meaning unconsciouseness)
|
||||
if (PRCGetHasEffect(EFFECT_TYPE_SLEEP))
|
||||
{
|
||||
effect eSleep = GetFirstEffect(oSelf);
|
||||
while (GetIsEffectValid(eSleep))
|
||||
{
|
||||
// Remove the sleep effects and immobility
|
||||
if ((GetEffectType(eSleep) == EFFECT_TYPE_SLEEP &&
|
||||
GetEffectSpellId(eSleep) != SPELL_SLEEP) ||
|
||||
GetEffectType(eSleep) == EFFECT_TYPE_CUTSCENEIMMOBILIZE)
|
||||
{
|
||||
|
||||
RemoveEffect(oSelf, eSleep);
|
||||
}
|
||||
eSleep = GetNextEffect(oSelf);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user