PRC8_fork/nwn/trunk/scripts/animobj_hb.nss
Jaysyn904 5914ed2ab5 Updated Release Archive
Updated Release Archive.  Fixed Mage-killer prereqs.  Removed old LETO & ConvoCC related files.  Added organized spell scroll store.  Fixed Gloura spellbook. Various TLK fixes.  Reorganized Repo.  Removed invalid user folders. Added DocGen back in.
2023-08-22 10:00:21 -04:00

25 lines
655 B
Plaintext

//:://////////////////////////////////////////////////
//:: animobj_hb.nss
/*
OnHeartbeat event handler for animated objects.
*/
//:://////////////////////////////////////////////////
#include "X0_INC_HENAI"
void main()
{
object oSelf = OBJECT_SELF;
//animated objects stop animating after casterlvl rounds
int iRoundsToGo = GetLocalInt(oSelf, "Rounds");
if(iRoundsToGo <= 0 || !GetIsObjectValid(GetMaster()))
{
ExecuteScript("animobj_killself", oSelf);
return;
}
SetLocalInt(oSelf, "Rounds", iRoundsToGo - 1);
// Schedule next HeartBeat
DelayCommand(6.0f, ExecuteScript("animobj_hb", oSelf));
}