Initial Commit
Initial Commit [v1.32PRC8]
This commit is contained in:
46
_module/nss/no_ai_atk.nss
Normal file
46
_module/nss/no_ai_atk.nss
Normal file
@@ -0,0 +1,46 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: On Attacked
|
||||
//:: NW_C2_DEFAULT5
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Set attacker as an enemy if they are not a friend
|
||||
or enemy (ie/ neutral), and initiate combat AI if
|
||||
it is not already running.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "no_lib_data"
|
||||
#include "no_inc"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
if (GetLocalInt(OBJECT_SELF,"NoAI") == 1)
|
||||
{
|
||||
ExecuteScript("nw_c2_default5",OBJECT_SELF);
|
||||
} else {
|
||||
|
||||
object oA = GetLastAttacker();
|
||||
|
||||
if ( GetIsObjectValid( oA ) )
|
||||
{
|
||||
/*
|
||||
if ( GetIsFriend( oA ) )
|
||||
{
|
||||
PrintString( GetName( OBJECT_SELF ) + " attacked by friend " + GetName( oA ) );
|
||||
}
|
||||
*/
|
||||
if ( !GetIsFriend( oA ) && !GetIsEnemy( oA ) && GetMaster( OBJECT_SELF ) != oA )
|
||||
{
|
||||
//neutrals
|
||||
SetIsTemporaryEnemy( oA, OBJECT_SELF, TRUE, 300.0 );
|
||||
}
|
||||
//DoQueueCombat( 8.0, 8.0 );
|
||||
InitCombat();
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(1005));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user