Files
HeroesStone_PRC8/_module/nss/tome_heartbeat.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

32 lines
930 B
Plaintext

#include "nw_i0_generic"
void main()
{
string sText;
object oSpawn;
object oTarget;
object oMaster;
oMaster = GetObjectByTag("TheMaster");
location lTarget;
lTarget = GetLocation(OBJECT_SELF);
int nRandom = d12(1);
if (nRandom == 1){
sText = "skeleton001";}
else if (nRandom == 2){
sText = "nw_zombie01";}
else if (nRandom == 3){
sText = "nw_ghoul";}
else if (nRandom == 4){
sText = "nw_zombie01";}
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC);
if (GetIsObjectValid(oPC) == TRUE && GetDistanceToObject(oPC) < 25.0 && nRandom <6)
{
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, sText, lTarget, TRUE);
oTarget = oSpawn;
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
AssignCommand(oTarget, DetermineCombatRound(oPC));
ActionCastSpellAtObject (SPELL_NEGATIVE_ENERGY_RAY, oMaster, TRUE, 5, TRUE);
}
}