generated from Jaysyn/ModuleTemplate
Initial Commit
Initial Commit.
This commit is contained in:
26
_module/nss/gt_enter_snptrgr.nss
Normal file
26
_module/nss/gt_enter_snptrgr.nss
Normal file
@@ -0,0 +1,26 @@
|
||||
//******************************************************************************
|
||||
// This is the onEnter script for a SnoopTrigger. This script sets up the
|
||||
// heartbeat counter and sets the objects so everything runs with only the
|
||||
// specific characters and objects.
|
||||
// Created By: Jeremiah Teague
|
||||
//******************************************************************************
|
||||
void main()
|
||||
{
|
||||
string sNPCTag = "SnoopChecker";
|
||||
object oPC = GetEnteringObject();
|
||||
object oAttacker = GetNearestObjectByTag(sNPCTag);
|
||||
SetLocalObject(OBJECT_SELF, "ATTACKER", oAttacker);
|
||||
SetLocalLocation(OBJECT_SELF, "GUARD_POST", GetLocation(oAttacker));
|
||||
if(GetIsPC(oPC))
|
||||
{
|
||||
if(GetObjectSeen(oPC, oAttacker) == TRUE || GetObjectHeard(oPC, oAttacker) == TRUE)
|
||||
{//only approach the PC if oAttacker can see or hear oPC
|
||||
//this makes the PC use stealth or be a rogue because checks are made
|
||||
SetLocalObject(OBJECT_SELF, "PC", oPC);
|
||||
SetLocalObject(oPC, "ATTACKER", oAttacker);
|
||||
SetLocalInt(OBJECT_SELF, "IS_PC_IN_TRIGGER", TRUE);
|
||||
SetLocalInt(OBJECT_SELF, "HRTBT_COUNTER", 0);//reset counter
|
||||
AssignCommand(oAttacker, ActionStartConversation(oPC));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user