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

26 lines
1.4 KiB
Plaintext

//******************************************************************************
// This is the onHeartBeat slot of a generic trigger. This is part of the
// Snoop Checker System. This script holds the counter and starts the attack
// on the PC if the PC is in the trigger (with the Attacker knowing this) and
// he/she hangs around for more than the set number of heartbeats.
// Created By: Jeremiah Teague
//******************************************************************************
#include "nw_i0_generic"
void main()
{
string sHB = GetName(OBJECT_SELF);
int nHB = StringToInt(sHB);
object oPC = GetLocalObject(OBJECT_SELF, "PC");
object oAttacker = GetLocalObject(OBJECT_SELF, "ATTACKER");
if(GetLocalInt(OBJECT_SELF, "HRTBT_COUNTER") == nHB && GetLocalInt(OBJECT_SELF, "IS_PC_IN_TRIGGER") == TRUE && GetLocalInt(oAttacker, "PC_WARNED") == TRUE)
{//oAttacker attacks the PC for remaining in the tigger's area
AdjustReputation(oPC, oAttacker, -100);
AssignCommand(oAttacker, DetermineCombatRound(oPC));
AssignCommand(oAttacker, ActionAttack(oPC));
}
else if(GetLocalInt(OBJECT_SELF, "HRTBT_COUNTER") < nHB && GetLocalInt(OBJECT_SELF, "IS_PC_IN_TRIGGER") == TRUE && GetLocalInt(oAttacker, "PC_WARNED") == TRUE)
{//the counter hasn't hit the desired number of heartbeats to wait, yet: add 1 to counter
SetLocalInt(OBJECT_SELF, "HRTBT_COUNTER", GetLocalInt(OBJECT_SELF, "HRTBT_COUNTER") + 1);
}
}