generated from Jaysyn/ModuleTemplate
27 lines
1.2 KiB
Plaintext
27 lines
1.2 KiB
Plaintext
//******************************************************************************
|
|
// 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));
|
|
}
|
|
}
|
|
}
|