Jaysyn904 fcafa53a7b AI update.
Minor AI update, Module switch update.  Full compile.
2023-04-06 23:20:50 -04:00

33 lines
975 B
Plaintext

//::///////////////////////////////////////////////
//:: Vanilla NWN On Disturbed
//:: nw_ai_ondisturb
//:: Copyright (c) 2002 Bioware Corp.
//:://////////////////////////////////////////////
/*
Default OnDisturbed event handler for NPCs.
*/
//:://////////////////////////////////////////////////
//:: Copyright (c) 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 12/22/2002
//:://////////////////////////////////////////////////
#include "nw_i0_generic"
void main()
{
object oTarget = GetLastDisturbed();
// If we've been disturbed and are not already fighting,
// attack our disturber.
if (GetIsObjectValid(oTarget) && !GetIsFighting(OBJECT_SELF)) {
DetermineCombatRound(oTarget);
}
// Send the disturbed flag if appropriate.
if(GetSpawnInCondition(NW_FLAG_DISTURBED_EVENT)) {
SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_DISTURBED));
}
ExecuteScript("prc_npc_disturb", OBJECT_SELF);
}