generated from Jaysyn/ModuleTemplate
23 lines
795 B
Plaintext
23 lines
795 B
Plaintext
//******************************************************************************
|
|
// This is the script that is put on the onUsed slot of a placeable. This script
|
|
// causes the closest SnoopChecker to attack the PC that used it.
|
|
// Created By: Jeremiah Teague
|
|
//******************************************************************************
|
|
#include "nw_i0_generic"
|
|
void main()
|
|
{
|
|
string sNPCTag = "SnoopChecker";
|
|
|
|
object oPC = GetLastUsedBy();
|
|
object oAttacker = GetNearestObjectByTag(sNPCTag);
|
|
if(GetIsPC(oPC))
|
|
{
|
|
if(GetObjectSeen(oPC, oAttacker) == TRUE || GetObjectHeard(oPC, oAttacker) == TRUE)
|
|
{
|
|
AdjustReputation(oPC, oAttacker, -100);
|
|
AssignCommand(oAttacker, DetermineCombatRound(oPC));
|
|
AssignCommand(oAttacker, ActionAttack(oPC));
|
|
}
|
|
}
|
|
}
|