//****************************************************************************** // 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); } }