generated from Jaysyn/ModuleTemplate
Initial commit
Initial commit
This commit is contained in:
62
_module/nss/oai_default5.nss
Normal file
62
_module/nss/oai_default5.nss
Normal file
@@ -0,0 +1,62 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Olander's AI
|
||||
// nw_c2_default5
|
||||
// by Don Anderson
|
||||
// dandersonru@msn.com
|
||||
//
|
||||
// OnPhysicalAttacked
|
||||
// Original script by Fallen
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "oai_inc_ai"
|
||||
|
||||
void main()
|
||||
{
|
||||
if (GetAttemptedAttackTarget() != OBJECT_INVALID || GetAttackTarget() != OBJECT_INVALID) return;
|
||||
object oAttacker = GetLastAttacker();
|
||||
|
||||
/******************************************************************************/
|
||||
//: CUSTOM ATTACKED ADDITONS BELOW HERE
|
||||
|
||||
|
||||
//Custom Scripts you Need to Execute
|
||||
ExecuteScript("oai_cust_atck", OBJECT_SELF);
|
||||
|
||||
|
||||
//: CUSTOM ATTACKED ADDITONS ABOVE HERE
|
||||
/******************************************************************************/
|
||||
|
||||
//Trolls
|
||||
if(GetBattleCondition(OAI_ROLE_TROLL)) TrollAttacked();
|
||||
|
||||
if(GetBehaviorState(NW_FLAG_BEHAVIOR_OMNIVORE) || GetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE))
|
||||
{
|
||||
OAI_DetermineSpecialBehavior(oAttacker);
|
||||
}
|
||||
else if(GetIsObjectValid(oAttacker)
|
||||
&& !GetFactionEqual(oAttacker)
|
||||
&& !GetIsDM(oAttacker))
|
||||
{
|
||||
if(OAI_GetIsAlly(oAttacker))
|
||||
{
|
||||
ClearPersonalReputation(oAttacker, OBJECT_SELF);
|
||||
ClearAllActions(TRUE);
|
||||
DelayCommand(1.2, ActionDoCommand(OAI_DetermineCombatRound()));
|
||||
}
|
||||
else OAI_DetermineCombatRound(oAttacker);
|
||||
}
|
||||
|
||||
//Shout Attack my target, only works with the On Spawn In setup
|
||||
SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK);
|
||||
|
||||
//Shout that I was attacked
|
||||
SpeakString("NW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK);
|
||||
|
||||
if(GetSpawnInCondition(NW_FLAG_ATTACK_EVENT))
|
||||
{
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(1005));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user