generated from Jaysyn/ModuleTemplate
Initial Commit
Initial Commit.
This commit is contained in:
26
_module/nss/gt_exit_snptrgr.nss
Normal file
26
_module/nss/gt_exit_snptrgr.nss
Normal file
@@ -0,0 +1,26 @@
|
||||
//******************************************************************************
|
||||
// This is the onExit script for a SnoopTrigger. This script cancels the attack
|
||||
// if one has begun and sets up some stuff so it won't start an attack until the
|
||||
// the PC moves back into the trigger.
|
||||
// Created By: Jeremiah Teague
|
||||
//******************************************************************************
|
||||
void main()
|
||||
{
|
||||
object oPC = GetLocalObject(OBJECT_SELF, "PC");
|
||||
object oAttacker = GetLocalObject(OBJECT_SELF, "ATTACKER");
|
||||
object oExiter = GetExitingObject();
|
||||
location lPost = GetLocalLocation(OBJECT_SELF, "GUARD_POST");
|
||||
if(oPC == oExiter)//the exiting object is the PC
|
||||
{
|
||||
//once the PC leaves the trigger, the fight is stopped
|
||||
AdjustReputation(oPC, oAttacker, 100);
|
||||
AdjustReputation(oAttacker, oPC, 100);
|
||||
AssignCommand(oAttacker, ClearAllActions(TRUE));
|
||||
AssignCommand(oPC, ClearAllActions(TRUE));
|
||||
AdjustReputation(oPC, oAttacker, 100);
|
||||
AdjustReputation(oAttacker, oPC, 100);
|
||||
SetLocalInt(OBJECT_SELF, "IS_PC_IN_TRIGGER", FALSE);
|
||||
//oAttacker moves back to his/her post
|
||||
AssignCommand(oAttacker, ActionForceMoveToLocation(lPost));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user