Horsefly Swamp update
Creatures & encounter tables to support Horsefly swamp expansion.
This commit is contained in:
55
_module/nss/howl_ai.nss
Normal file
55
_module/nss/howl_ai.nss
Normal file
@@ -0,0 +1,55 @@
|
||||
|
||||
#include "nw_i0_generic"
|
||||
#include "x2_inc_switches"
|
||||
#include "inc_AI"
|
||||
|
||||
void main()
|
||||
{
|
||||
// The following two lines should not be touched
|
||||
object oIntruder = GetCreatureOverrideAIScriptTarget();
|
||||
ClearCreatureOverrideAIScriptTarget();
|
||||
if ( !GetCanAct(OBJECT_SELF) )
|
||||
{
|
||||
SetCreatureOverrideAIScriptFinished();
|
||||
return;
|
||||
}
|
||||
|
||||
int bAura = GetLocalInt(OBJECT_SELF,"aura");
|
||||
if ( !bAura )
|
||||
{
|
||||
string sScript = GetLocalString(OBJECT_SELF,"Aura_Script");
|
||||
if ( sScript != "" )
|
||||
ExecuteScript(sScript,OBJECT_SELF);
|
||||
|
||||
SetLocalInt(OBJECT_SELF,"aura",1);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( GetCurrentAction() == ACTION_CASTSPELL )
|
||||
{
|
||||
SetCreatureOverrideAIScriptFinished();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
object oTarget = oIntruder;
|
||||
|
||||
if ( !GetIsObjectValid(oTarget) || !GetIsEnemy(oTarget) )
|
||||
{
|
||||
oTarget = GetNearestEnemy();
|
||||
if ( !GetIsObjectValid(oTarget) )
|
||||
return;
|
||||
}
|
||||
if ( !GetLocalInt(OBJECT_SELF,"HowlDelay") && d4() == 4 )
|
||||
{
|
||||
ClearAllActions();
|
||||
ActionCastSpellAtObject(SPELLABILITY_HOWL_STUN,oTarget,METAMAGIC_ANY,TRUE);
|
||||
SetLocalInt(OBJECT_SELF,"HowlDelay",1);
|
||||
DelayCommand(6.0*d4(),SetLocalInt(OBJECT_SELF,"HowlDelay",0));
|
||||
SetCreatureOverrideAIScriptFinished();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user