113 lines
3.0 KiB
Plaintext
113 lines
3.0 KiB
Plaintext
|
|
#include "nw_i0_generic"
|
|
#include "x2_inc_switches"
|
|
#include "inc_AI"
|
|
|
|
void DoPhysical( object oTarget, object oCaster )
|
|
{
|
|
if ( !GetIsObjectValid(oTarget) || !GetIsEnemy(oTarget) )
|
|
{
|
|
oTarget = GetNearestEnemy();
|
|
if ( !GetIsObjectValid(oTarget) )
|
|
return;
|
|
}
|
|
TalentMeleeAttack(oTarget);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
// The following two lines should not be touched
|
|
object oIntruder = GetCreatureOverrideAIScriptTarget();
|
|
ClearCreatureOverrideAIScriptTarget();
|
|
int bAura = GetLocalInt(OBJECT_SELF,"aura");
|
|
if ( !bAura )
|
|
{
|
|
string sScript = GetLocalString(OBJECT_SELF,"Aura_Script");
|
|
ExecuteScript(sScript,OBJECT_SELF);
|
|
SetLocalInt(OBJECT_SELF,"aura",1);
|
|
}
|
|
if ( !GetCanAct(OBJECT_SELF) )
|
|
{
|
|
SetCreatureOverrideAIScriptFinished();
|
|
return;
|
|
}
|
|
if ( GetLocalInt(OBJECT_SELF,"Acting") )
|
|
{
|
|
SetCreatureOverrideAIScriptFinished();
|
|
return;
|
|
}
|
|
/* if ( d6() == 1 ) // in case they get busy-stuck, also to add randomness
|
|
{
|
|
SetLocalInt(OBJECT_SELF,"busy",FALSE);
|
|
return;
|
|
} */
|
|
// Don't inturupt actions in progress
|
|
|
|
|
|
if ( GetCurrentAction() == ACTION_CASTSPELL )
|
|
{
|
|
SetCreatureOverrideAIScriptFinished();
|
|
return;
|
|
}
|
|
|
|
if ( GetLocalInt(OBJECT_SELF,"physical") )
|
|
{
|
|
ClearAllActions();
|
|
DoPhysical(oIntruder,OBJECT_SELF);
|
|
return;
|
|
}
|
|
// Haste = Super awesome;
|
|
// Get those summons in there!
|
|
int nSummonCount = GetLocalInt(OBJECT_SELF,"SummonCount");
|
|
if ( !GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_SUMMONED)) && nSummonCount < 6 )
|
|
{
|
|
nSummonCount++;
|
|
SetLocalInt(OBJECT_SELF,"SummonCount",nSummonCount);
|
|
ClearAllActions();
|
|
ActionCastFakeSpellAtLocation(SPELL_SUMMON_CREATURE_IX,GetLocation(OBJECT_SELF));
|
|
effect eSummon = EffectSummonCreature("nightwalker",VFX_FNF_SUMMON_MONSTER_3,1.0);
|
|
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,eSummon,GetLocation(OBJECT_SELF),HoursToSeconds(24));
|
|
SetCreatureOverrideAIScriptFinished();
|
|
return;
|
|
}
|
|
|
|
|
|
// Hostile targeting actions
|
|
if ( !GetIsObjectValid(oIntruder) || !GetIsReactionTypeHostile(oIntruder) )
|
|
{
|
|
oIntruder = GetNearestPerceivedEnemy();
|
|
if ( !GetIsObjectValid(oIntruder) )
|
|
return;
|
|
}
|
|
|
|
// Melee up sometimes!
|
|
|
|
if ( d6() == 6 )
|
|
{
|
|
switch ( d4() )
|
|
{
|
|
case 1:
|
|
PlayVoiceChat(VOICE_CHAT_BATTLECRY1);
|
|
break;
|
|
case 2:
|
|
PlayVoiceChat(VOICE_CHAT_ATTACK);
|
|
break;
|
|
case 3:
|
|
PlayVoiceChat(VOICE_CHAT_BATTLECRY2);
|
|
break;
|
|
case 4:
|
|
PlayVoiceChat(VOICE_CHAT_BATTLECRY3);
|
|
break;
|
|
}
|
|
|
|
SetLocalInt(OBJECT_SELF,"physical",1);
|
|
DelayCommand(24.0,SetLocalInt(OBJECT_SELF,"physical",0));
|
|
ClearAllActions();
|
|
DoPhysical(oIntruder,OBJECT_SELF);
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|