Tweaked several areas, mobs, and added

the codi ai to some mobs.
This commit is contained in:
EpicValor
2023-09-28 23:01:25 -05:00
parent 9c38ad9c6b
commit f6270c3cb8
310 changed files with 31410 additions and 4885 deletions

View File

@@ -0,0 +1,62 @@
//::///////////////////////////////////////////////
//:: Default: End of Combat Round
//:: NW_C2_DEFAULT3
//:: Copyright (c) 2008 Bioware Corp.
//:://////////////////////////////////////////////
/*
Calls the end of combat script every round
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 16, 2001
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
//:: Modified By: Deva Winblood
//:: Modified On: Feb 16th, 2008
//:: Added Support for Mounted Combat Feat Support
//:://////////////////////////////////////////////
#include "NW_I0_GENERIC"
void main()
{
AssignCommand (OBJECT_SELF, ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND)));
AssignCommand (OBJECT_SELF, ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND)));
ExecuteScript("usecreatureweap", OBJECT_SELF);
ExecuteScript("prc_npc_combat", OBJECT_SELF);
if (!GetLocalInt(GetModule(),"X3_NO_MOUNTED_COMBAT_FEAT"))
{ // set variables on target for mounted combat
DeleteLocalInt(OBJECT_SELF,"bX3_LAST_ATTACK_PHYSICAL");
DeleteLocalInt(OBJECT_SELF,"nX3_HP_BEFORE");
DeleteLocalInt(OBJECT_SELF,"bX3_ALREADY_MOUNTED_COMBAT");
if (GetHasFeat(FEAT_MOUNTED_COMBAT,OBJECT_SELF))
{ // check for AC increase
int nRoll=d20()+GetSkillRank(SKILL_RIDE);
nRoll=nRoll-10;
if (nRoll>4)
{ // ac increase
nRoll=nRoll/5;
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectACIncrease(nRoll),OBJECT_SELF,8.5);
} // ac increase
} // check for AC increase
} // set variables on target for mounted combat
if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL))
{
DetermineSpecialBehavior();
}
else if(!GetSpawnInCondition(NW_FLAG_SET_WARNINGS))
{
DetermineCombatRound();
}
if(GetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT))
{
SignalEvent(OBJECT_SELF, EventUserDefined(1003));
}
AssignCommand (OBJECT_SELF, ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND)));
}

View File

@@ -5,7 +5,7 @@ void main()
{
ActionPauseConversation();
object oPC = GetPCSpeaker();
TakeGoldFromCreature(1500000, oPC, TRUE);
TakeGoldFromCreature(1000000, oPC, TRUE);
object oForge = GetNearestObjectByTag ("WeaponForge", OBJECT_SELF, 1);
object oOldWeapon = GetFirstItemInInventory(oForge);
string sItemTemplate1 = "aheavymace";

38
_module/nss/no_ai_atk.nss Normal file
View File

@@ -0,0 +1,38 @@
//::///////////////////////////////////////////////
//:: 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()
{
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));
}
}

36
_module/nss/no_ai_blk.nss Normal file
View File

@@ -0,0 +1,36 @@
//::///////////////////////////////////////////////
//:: Default On Heartbeat
//:: NW_C2_DEFAULTE
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This will cause blocked creatures to open
or smash down doors depending on int and
str.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Nov 23, 2001
//:://////////////////////////////////////////////
/*
NOTE: Unmodified except for this comment. Makes this
script show up as a script for this module for completeness.
*/
void main()
{
object oDoor = GetBlockingDoor();
if(GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 5)
{
if(GetIsDoorActionPossible(oDoor, DOOR_ACTION_OPEN) && GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 7 )
{
DoDoorAction(oDoor, DOOR_ACTION_OPEN);
}
else if(GetIsDoorActionPossible(oDoor, DOOR_ACTION_BASH))
{
DoDoorAction(oDoor, DOOR_ACTION_BASH);
}
}
}

20
_module/nss/no_ai_cmb.nss Normal file
View File

@@ -0,0 +1,20 @@
//::///////////////////////////////////////////////
//:: End of Combat Round
//::
//:://////////////////////////////////////////////
/*
Calls the end of combat script every round
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
void main()
{
//SetReadyStatus();
//DoCombat();
InitCombat();
//signal combat to userdef
SignalEvent( OBJECT_SELF, EventUserDefined( 1003 ) );
}

162
_module/nss/no_ai_cnv.nss Normal file
View File

@@ -0,0 +1,162 @@
//::///////////////////////////////////////////////
//:: On Conversation
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
by the generic script after dialogue or a
shout is initiated.
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
void main()
{
object oT = OBJECT_INVALID;
object oM = GetMaster( OBJECT_SELF );
object oBroadcaster = GetLastSpeaker();
int iBroadcast = GetListenPatternNumber();
int iR = 0;
if ( iBroadcast == -1 )
{
ClearAllActions();
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//ActionStartConversation( oBroadcaster );
BeginConversation();
//DoQueueShutdown( 6.0 );
}
else
{
if ( GetIsObjectValid( oM ) && oBroadcaster == oM )
{
if ( iBroadcast == ASSOCIATE_COMMAND_STANDGROUND )
{
//stand ground
SetLocalLocation( OBJECT_SELF, "#SGLOC", GetLocation( OBJECT_SELF ) );
SetLocalInt( OBJECT_SELF, "#STANDGROUND", 1 );
ClearAllActions();
PlayVoiceChat( VOICE_CHAT_TASKCOMPLETE );
ActionMoveToLocation( GetLocation( OBJECT_SELF ) ); //stop here
}
else if ( iBroadcast == ASSOCIATE_COMMAND_ATTACKNEAREST )
{
//attack nearest
DeleteLocalInt( OBJECT_SELF, "#STANDGROUND" );
oT = GetTarget();
if ( GetIsObjectValid( oT ) )
{
PlayVoiceChat( VOICE_CHAT_GOODIDEA );
//DoQueueCombat( 8.0, 8.0 );
InitCombat();
SignalEvent( OBJECT_SELF, EventUserDefined( 1003 ) );
}
else
{
PlayVoiceChat( VOICE_CHAT_CANTDO );
}
}
else if ( iBroadcast == ASSOCIATE_COMMAND_HEALMASTER )
{
//heal master
DeleteLocalInt( OBJECT_SELF, "#STANDGROUND" );
if ( DoSpellHeal( oM ) )
{
PlayVoiceChat( VOICE_CHAT_CANDO );
}
else
{
PlayVoiceChat( VOICE_CHAT_CANTDO );
}
}
else if ( iBroadcast == ASSOCIATE_COMMAND_FOLLOWMASTER )
{
//follow master
DeleteLocalLocation( OBJECT_SELF, "#STANDGROUND" );
ClearAllActions();
ActionForceFollowObject( oM, 3.0 );
}
else if ( iBroadcast == ASSOCIATE_COMMAND_GUARDMASTER )
{
//guard master
DeleteLocalInt( OBJECT_SELF, "#STANDGROUND" );
if ( !GetIsObjectValid( oT = GetLastHostileActor( oM ) ) )
{
if ( !GetIsObjectValid( oT = GetLastAttacker( oM ) ) )
{
PlayVoiceChat( VOICE_CHAT_CANTDO );
}
}
//list of actions to try against oT
if ( GetIsObjectValid( oT ) && ( GetObjectSeen( oT ) || GetObjectHeard( oT ) ) )
{
if ( !( iR = DoSpellDirect( oT ) ) )
{
if ( !( iR = DoTouch( oT ) ) )
{
if ( !( iR = DoAttackRanged( oT ) ) )
{
if ( !( iR = DoAttackMelee( oT ) ) )
{
PlayVoiceChat( VOICE_CHAT_CANTDO );
}
}
}
}
if ( iR )
{
PlayVoiceChat( VOICE_CHAT_CANDO );
}
}
}
}
if ( iBroadcast == 699 ) //COMBAT going on nearby
{
//respond
if ( GetArea( oBroadcaster ) == GetArea( OBJECT_SELF ) && GetDistanceBetween( oBroadcaster, OBJECT_SELF ) <= GetResponseRange( BC_FIGHTING ) )
{
object oE = GetTarget();
if ( !GetIsObjectValid( oE ) )
{
//I've heard combat but I can't see the combat or any enemies
//PrintString( "CHM: " + GetName( OBJECT_SELF ) + " moving to support " + GetName( oBroadcaster ) );
DoMoveToObject( oBroadcaster, TRUE, 5.0 );
DoFightBroadcast();
}
else
{
//DoQueueCombat( 8.0, 8.0 );
InitCombat();
}
}
else
{
//hearing something from another area or from out of our response range
//SpeakString( "Ignoring combat sounds" );
}
}
else if ( iBroadcast == 691 ) //DEAD
{
//if ( GetIsFriend( oBroadcaster ) )
if ( GetFactionEqual( oBroadcaster ) )
{
DoVoiceChat( VOICE_CHAT_CUSS );
}
else if ( GetIsEnemy( oBroadcaster ) )
{
if ( Random( 2 ) )
{
DoVoiceChat( VOICE_CHAT_CHEER );
}
else
{
DoVoiceChat( VOICE_CHAT_LAUGH );
}
}
}
}
//signal conversation to userdef
SignalEvent( OBJECT_SELF, EventUserDefined( 1004 ) );
}

54
_module/nss/no_ai_dam.nss Normal file
View File

@@ -0,0 +1,54 @@
//::///////////////////////////////////////////////
//:: On Damaged
//::
//:://////////////////////////////////////////////
/*
Set damager 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()
{
float fHP;
object oDam = GetLastDamager();
object oT = OBJECT_INVALID;
//if timestamp has elapsed and there is a friendly nearby
if ( !GetLocalInt( OBJECT_SELF, "#HEALDEL" ) &&
GetIsObjectValid( GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, OBJECT_SELF, 1, CREATURE_TYPE_IS_ALIVE, TRUE ) ) )
{
fHP = IntToFloat( GetCurrentHitPoints( OBJECT_SELF ) ) / GetMaxHitPoints( OBJECT_SELF );
//only start calling for healing once we've taken 50%
if ( fHP < 0.51 )
{
//broadcast request for healing for display purposes
DoVoiceChat( VOICE_CHAT_HEALME );
//do not broadcast again until next combat round event when this int is cleared
SetLocalInt( OBJECT_SELF, "#HEALDEL", 1 );
DelayCommand( 3.0, DeleteLocalInt( OBJECT_SELF, "#HEALDEL" ) );
}
}
if ( GetIsObjectValid( oDam ) )
{
/*
if ( GetIsFriend( oDam ) )
{
PrintString( GetName( OBJECT_SELF ) + " damaged by friend " + GetName( oDam ) );
}
*/
if ( !GetIsFriend( oDam ) && !GetIsEnemy( oDam ) && GetMaster( OBJECT_SELF ) != oDam )
{
//neutrals
SetIsTemporaryEnemy( oDam, OBJECT_SELF, TRUE, 300.0 );
}
//DoQueueCombat( 8.0, 8.0 );
InitCombat();
//signal damage to userdef
SignalEvent( OBJECT_SELF, EventUserDefined( 1006 ) );
}
}

38
_module/nss/no_ai_dis.nss Normal file
View File

@@ -0,0 +1,38 @@
//::///////////////////////////////////////////////
//:: Default: On Disturbed
//:: NW_C2_DEFAULT8
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Calls the end of combat script every round
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 16, 2001
//::///////////////////////////////////////////
// * Make me hostile the faction of my last attacker (TEMP)
// AdjustReputation(OBJECT_SELF,GetFaction(GetLastAttacker()),-100);
// * Determined Combat Round
/*
NOTE: Blocked to stop interference.
Update coming in next version.
*/
//#include "NW_I0_GENERIC"
#include "no_lib_data"
#include "no_inc"
void main()
{
object oT = GetLastDisturbed();
if ( GetIsObjectValid( oT ) )
{
SetIsTemporaryEnemy( oT, OBJECT_SELF, TRUE, 300.0 );
//DoQueueCombat( 8.0, 8.0 );
InitCombat();
SignalEvent(OBJECT_SELF, EventUserDefined(1008));
}
}

32
_module/nss/no_ai_dth.nss Normal file
View File

@@ -0,0 +1,32 @@
//::///////////////////////////////////////////////
//:: On Death
//::
//:://////////////////////////////////////////////
/*
Shouts to allies that they have been killed
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
void main()
{
//float fDieDelay = GetLocalFloat( OBJECT_SELF, "#DECAYDELAY" );
//corpse decay deactivated for Murray module
float fDieDelay = 10.0;
ClearAllActions();
//broadcast death
SpeakString( "BC_DEAD", TALKVOLUME_SILENT_TALK );
//PrintString( GetName( OBJECT_SELF ) + " killed by " + GetName( GetLastKiller() ) );
if ( GetName( GetItemInSlot( INVENTORY_SLOT_CARMOUR, OBJECT_SELF ) ) == "Balor Properties" )
{
ExecuteScript( "nw_s3_balordeth", OBJECT_SELF );
}
DelayCommand( fDieDelay, ExecuteScript( "no_scr_cleanvars", OBJECT_SELF ) );
DelayCommand( fDieDelay + 0.5, ExecuteScript( "no_scr_excorpse", OBJECT_SELF ) );
//signal death to userdef
SignalEvent( OBJECT_SELF, EventUserDefined( 1007 ) );
}

121
_module/nss/no_ai_hrt.nss Normal file
View File

@@ -0,0 +1,121 @@
//::///////////////////////////////////////////////
//:: On Heartbeat
//::
//:://////////////////////////////////////////////
/*
This script will have people perform default
animations.
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
void main()
{
//if the AI level is very low and the combat AI is not active do nothing
//need this change so that combat AI can shut itself down properly before ignoring heartbeats
if ( GetAILevel() == AI_LEVEL_VERY_LOW && !IsActive() )
{
return;
}
if ( IsActive() )
{
//if combat AI is active this is the only segment of the heartbeat that will run
int iE = GetHostileCount( 50.0 );
if ( iE == 0 )
{
object oA = GetFurthestActiveAlly( 50.0 );
if ( GetIsObjectValid( oA ) && GetDistanceBetween( OBJECT_SELF, oA ) > 20.0 && !GetIsPerceived( oA ) )
{
DoMoveToObject( oA, TRUE );
}
else
{
ExecuteScript( "no_scr_shutdown", OBJECT_SELF );
}
}
}
else
{
//combat AI isn't active
if( GetSpawnInCondition( NW_FLAG_DAY_NIGHT_POSTING ) )
{
int nDay = FALSE;
if( GetIsDay() || GetIsDawn() )
{
nDay = TRUE;
}
if( GetLocalInt( OBJECT_SELF, "NW_GENERIC_DAY_NIGHT" ) != nDay )
{
if( nDay == TRUE )
{
SetLocalInt( OBJECT_SELF, "NW_GENERIC_DAY_NIGHT", TRUE );
}
else
{
SetLocalInt( OBJECT_SELF, "NW_GENERIC_DAY_NIGHT", FALSE );
}
WalkWayPoints();
}
}
if( CanAct() )
{
object oE = GetTarget();
if( !GetIsPostOrWalking() )
{
if( !GetIsObjectValid( GetAttemptedAttackTarget() ) && !GetIsObjectValid( GetAttemptedSpellTarget() ) )
{
//if( !GetIsObjectValid( GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN) ) )
if ( !GetIsObjectValid( oE ) )
{
if( /*!GetBehaviorState( NW_FLAG_BEHAVIOR_SPECIAL ) &&*/ !IsInConversation( OBJECT_SELF ) )
{
if( GetSpawnInCondition( NW_FLAG_AMBIENT_ANIMATIONS ) || GetSpawnInCondition( NW_FLAG_AMBIENT_ANIMATIONS_AVIAN ) )
{
PlayMobileAmbientAnimations();
}
else if( GetIsEncounterCreature() )
//won't be here unless this next condition is true so it is redundant to check it
//!GetIsObjectValid( GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN ) ) )
{
PlayMobileAmbientAnimations();
}
else if( GetSpawnInCondition( NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS ) )
//won't be in here unless this next condition is true so it is redundant to check it
//!GetIsObjectValid( GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN ) ) )
{
PlayImmobileAmbientAnimations();
}
}
else
{
DetermineSpecialBehavior();
}
}
else
{
//DetermineCombatRound()
InitCombat();
}
}
}
}
else
{
if( GetSpawnInCondition( NW_FLAG_SLEEPING_AT_NIGHT ) )
{
effect eVis = EffectVisualEffect( VFX_IMP_SLEEP );
if( d10() > 6 )
{
ApplyEffectToObject( DURATION_TYPE_INSTANT, eVis, OBJECT_SELF );
}
}
}
}
//Signal heart beat event to userdef
SignalEvent( OBJECT_SELF, EventUserDefined( 1001 ) );
}

98
_module/nss/no_ai_per.nss Normal file
View File

@@ -0,0 +1,98 @@
//::///////////////////////////////////////////////
//:: On Percieve
//::
//:://////////////////////////////////////////////
/*
Checks to see if the perceived target is an
enemy and if so fires the Determine Combat
Round function
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
void main()
{
object oPer = GetLastPerceived();
if ( !GetIsObjectValid( oPer ) )
{
//invalid object, do nothing
return;
}
//for associates
if ( !GetLocalInt( OBJECT_SELF, "#ACTIVE" ) && GetIsMaster( oPer ) )
{
ActionForceFollowObject( oPer, GetFollowDist() );
}
//main
if ( GetLastPerceptionSeen() && GetIsPerceived( oPer, NO_PERCEPTION_SEEN ) )
{
if ( GetIsEnemy( oPer ) && !GetIsDead( oPer ) )
{
//trigger combat
//PrintString( "ENEMY: " + GetName( OBJECT_SELF ) + " -> " + GetName( oPer ) );
DoVoiceChat( VOICE_CHAT_ENEMIES );
if ( GetIsFastBuffer() == TRUE && GetIsFastBuffed() == FALSE )
{
//only to this once per start up
ClearAllActions();
if ( DoFastBuffs() )
{
//PrintString( "FASTBUFF: " + GetName( OBJECT_SELF ) );
}
SetIsFastBuffed( TRUE );
}
//DoQueueCombat( 8.0, 8.0 );
DelayCommand( 0.5, InitCombat() );
}
else if ( !GetLocalInt( OBJECT_SELF, "#ACTIVE" ) )
{
if ( GetIsFriend( oPer ) && GetIsDead( oPer ) && GetHasRaisingAbility() )
{
ClearAllActions();
if ( DoSpellRaise( oPer ) )
{
SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
DoQueueShutdown( 12.0 );
}
}
}
}
else if ( GetLastPerceptionHeard() && GetIsPerceived( oPer, NO_PERCEPTION_HEARD ) )
{
if ( !GetIsObjectValid( GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_IS_ALIVE, TRUE ) ) )
{
if ( GetIsEnemy( oPer ) && GetObjectType( oPer ) == OBJECT_TYPE_CREATURE && !GetIsDead( oPer ) )
{
//check perceptions
if ( !GetIsPerceived( oPer, NO_PERCEPTION_SEEN ) )
{
//heard something that is not visible, no visible enemies, respond
//SetLocalInt( OBJECT_SELF, "#VANISHED", 1 );
//DoQueueCombat( 8.0, 8.0 );
DelayCommand( 0.5, InitCombat() );
}
}
}
}
else if ( GetLastPerceptionVanished() && GetIsPerceived( oPer, NO_PERCEPTION_VANISHED ) )
{
//make sure it isn't a corpse that just faded out
//report vanished enemies who have not just died
if ( GetIsEnemy( oPer ) )
{
if( !GetIsDead( oPer ) )
{
DoVoiceChat( VOICE_CHAT_CUSS );
SetLocalInt( OBJECT_SELF, "#VANISHED", 1 );
}
}
}
//signal perception to userdef
SignalEvent( OBJECT_SELF, EventUserDefined( 1002 ) );
}

26
_module/nss/no_ai_rst.nss Normal file
View File

@@ -0,0 +1,26 @@
//::///////////////////////////////////////////////
//:: Default: On Rested
//:: NW_C2_DEFAULTA
//:: Copyright (c) 2002 Bioware Corp.
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just rested.
*/
//:://////////////////////////////////////////////
//:: Created By: Don Moar
//:: Created On: April 28, 2002
//:://////////////////////////////////////////////
/*
NOTE: Unmodified except for this comment. Makes this
script show up as a script for this module for completeness.
*/
void main()
{
// enter desired behaviour here
return;
}

70
_module/nss/no_ai_spt.nss Normal file
View File

@@ -0,0 +1,70 @@
//::///////////////////////////////////////////////
//:: On Spell Cast At
//::
//:://////////////////////////////////////////////
/*
This determines if the spell just cast at the
target is harmful or not.
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
void main()
{
int iS = GetLastSpell();
int iH = GetLastSpellHarmful();
object oC = GetLastSpellCaster();
if ( !iH )
{
if ( iS == SPELL_RAISE_DEAD || iS == SPELL_RESURRECTION )
{
SetCommandable( TRUE, OBJECT_SELF );
DeleteLocalObject( OBJECT_SELF, "#RAISER" );
}
else if ( iS == SPELL_HEAL || iS == SPELL_CURE_CRITICAL_WOUNDS ||
iS == SPELL_CURE_SERIOUS_WOUNDS || iS == SPELL_CURE_MODERATE_WOUNDS ||
iS == SPELL_CURE_LIGHT_WOUNDS || iS == SPELL_CURE_MINOR_WOUNDS )
{
if ( oC != OBJECT_SELF && GetIsFriend( oC ) )
{
DoVoiceChat( VOICE_CHAT_THANKS );
}
DeleteLocalObject( OBJECT_SELF, "#HEALER" );
}
else if ( iS == SPELL_DARKVISION )
{
DeleteLocalInt( OBJECT_SELF, "#DARKNESS" );
DeleteLocalObject( OBJECT_SELF, "#VISION" );
}
else if ( iS == SPELL_SEE_INVISIBILITY )
{
DeleteLocalInt( OBJECT_SELF, "#VANISHED" );
DeleteLocalObject( OBJECT_SELF, "#VISION" );
}
else if ( iS == SPELL_TRUE_SEEING )
{
DeleteLocalInt( OBJECT_SELF, "#DARKNESS" );
DeleteLocalInt( OBJECT_SELF, "#VANISHED" );
DeleteLocalObject( OBJECT_SELF, "#VISION" );
}
}
if ( iS == SPELL_DARKNESS )
{
SetLocalInt( OBJECT_SELF, "#DARKNESS", 1 );
}
if ( iH )
{
if ( !GetIsFriend( oC ) && !GetIsEnemy( oC ) && GetMaster( OBJECT_SELF ) != oC )
{
//neutrals
SetIsTemporaryEnemy( oC, OBJECT_SELF, TRUE, 300.0 );
}
//DoQueueCombat( 8.0, 8.0 );
InitCombat();
}
//signal spell at to userdef
SignalEvent( OBJECT_SELF, EventUserDefined( 1011 ) );
}

10
_module/nss/no_inc.nss Normal file
View File

@@ -0,0 +1,10 @@
//#include "no_lib_data"
#include "no_inc_ptypes"
#include "no_lib_bio"
#include "no_lib_priority"
#include "no_lib_magic"
#include "no_lib_analysis"
#include "no_lib_feat"
#include "no_lib_melee"
#include "no_lib_ranged"
#include "no_lib_actions"

View File

@@ -0,0 +1,406 @@
//constants
//can broadcasting use DM channel
const int NO_CAN_USE_DM_CHANNEL = 1;
//broadcast constants
const int BC_FIGHTING = 699;
//effect weights
const int NO_EFFECT_GENERIC = 1;
const int NO_EFFECT_DISEASE = 2;
const int NO_EFFECT_CURSE = 4;
const int NO_EFFECT_POISON = 8;
const int NO_EFFECT_DEAF = 16;
const int NO_EFFECT_BLINDNESS = 32;
const int NO_EFFECT_SILENCE = 64;
const int NO_EFFECT_NEGATIVELEVEL = 128;
const int NO_EFFECT_DAZED = 256;
const int NO_EFFECT_FRIGHTENED = 512;
const int NO_EFFECT_CONFUSED = 1024;
const int NO_EFFECT_CHARMED = 2048;
const int NO_EFFECT_SLEEP = 4096;
const int NO_EFFECT_STUNNED = 8192;
const int NO_EFFECT_DOMINATED = 16384;
const int NO_EFFECT_PETRIFY = 32768;
const int NO_EFFECT_PARALYZE = 65536;
//spell level cut offs
const int NO_LVL8_MIN_LVL = 24;
const int NO_LVL7_MIN_LVL = 21;
const int NO_LVL6_MIN_LVL = 18;
const int NO_LVL5_MIN_LVL = 15;
const int NO_LVL4_MIN_LVL = 12;
const int NO_LVL3_MIN_LVL = 9;
const int NO_LVL2_MIN_LVL = 6;
const int NO_LVL1_MIN_LVL = 3;
//associate orders
const int NO_ORDER_ATTACK = 1;
const int NO_ORDER_FOLLOW = 2;
const int NO_ORDER_GUARD = 4;
const int NO_ORDER_HEAL = 8;
const int NO_ORDER_STANDGROUND = 16;
//voice chat defines
const int NO_VC_DEFAULT = 1000;
const int NO_VC_MELEE = 1001;
const int NO_VC_RANGED = 1003;
const int NO_VC_MELEEASSIST = 1004;
//perception types
const int NO_PERCEPTION_SEEN = 1;
const int NO_PERCEPTION_HEARD = 2;
const int NO_PERCEPTION_VANISHED = 4;
//special attack minimum hit dice ratios
const float NO_THRESH_SMITE = 0.75;
const float NO_THRESH_STUNNING_FIST = 0.5;
const float NO_THRESH_QUIVERING_PALM = 0.75;
const float NO_THRESH_ARROW_SLAYING = 0.75;
const float NO_THRESH_KI_DAMAGE = 0.5;
//illithid abilities
const int CODI_MIND_BLAST = 1522;
const int CODI_BRAIN_EXTRACT = 1523;
//beholder constants
const int BEHOLDER_MAX_RAYS = 10;
const int SPELL_BEHRAY_FINGER_OF_DEATH = 776;
const int SPELL_BEHRAY_TELEKINESIS = 777;
const int SPELL_BEHRAY_FLESH_TO_STONE = 778;
const int SPELL_BEHRAY_CHARM = 779;
const int SPELL_BEHRAY_SLOW = 780;
const int SPELL_BEHRAY_INFLICT_WOUNDS = 783;
const int SPELL_BEHRAY_FEAR = 784;
const int SPELL_BEH_ANTIMAGIC_CONE = 727;
//missing epic spell definition
const int SPELL_EPIC_WARDING = 695;
//miscellaneous missing constants
const int SPELLABILITY_DRAGON_BREATH_RDD = 690;
const int SPELLABILITY_DRAGON_BREATH_PRISMATIC = 771;
const int SPELLABILITY_DEFLECTING_FORCE = 774;
//string constants
const string s_BEHOLDER_CENTRAL_EYE_FLAG = "#BEHCENEYE";
//Master prototype list
// NO_LIB_ACTIONS
// support functions
void NO_ActionCastSpellAtLocation( int iSpell, location lTargetLocation, int iMetaMagic=METAMAGIC_ANY, int iCheat=FALSE, int iProjectilePathType=PROJECTILE_PATH_TYPE_DEFAULT, int iInstantSpell=FALSE, int iDefensive=TRUE );
void NO_ActionCastSpellAtObject( int iSpell, object oTarget, int iMetaMagic=METAMAGIC_ANY, int iCheat=FALSE, int iDomainLevel=0, int iProjectilePathType=PROJECTILE_PATH_TYPE_DEFAULT, int iInstantSpell=FALSE, int iDefensive=TRUE );
void NO_ActionUseTalentAtLocation( talent tChosenTalent, location lTargetLocation, int iDefensive=TRUE );
void NO_ActionUseTalentOnObject( talent tChosenTalent, object oTarget, int iDefensive=TRUE );
void ActivateCombatMode( int iMode=0, object oE=OBJECT_SELF );
void DeactivateCombatModes( int iException=0, object oE=OBJECT_SELF );
int DoHideInPlainSight( object oE=OBJECT_SELF );
void DoFireBeholderRay( int iS, object oT );
void DoMoveToLocation( location lDest, int bRun=FALSE );
void DoMoveToObject( object oDest, int bRun=FALSE, float fDist=1.0f );
void DoTeleport( location lLoc );
object GetTarget();
float DotProduct( vector v1, vector v2 );
location GetFlankLoc( object oT, location lL );
void DoEquipMelee( object oT );
talent GetTalentSpell( int iCat, int iD );
void DoFightBroadcast();
int GetTimeSinceLastCombat();
void DoConditionalRestart( float fT=6.0 );
void DoQueueShutdown( float fT=0.0 );
void DoQueueCombat( float fD=6.0, float fT=6.0 );
void InitCombat( object oE=OBJECT_INVALID );
void DoVoiceChat( int iV=-1 );
void DoMainCombatLoop();
void DoCombat();
// action functions
int DoAttackMelee( object oT=OBJECT_INVALID );
int DoAttackRanged( object oT=OBJECT_INVALID );
int DoCounterSpell( object oT=OBJECT_INVALID );
int DoEvacAOE();
int DoRegroup( object oT=OBJECT_INVALID );
int DoDefendSelf();
int DoDefendSingle( object oT=OBJECT_INVALID );
int DoEnhanceSelf();
int DoEnhanceSingle( object oT=OBJECT_INVALID );
int DoSpellHelp( object oT=OBJECT_INVALID );
int DoSpellHeal( object oT=OBJECT_INVALID );
int DoSpellRaise( object oT=OBJECT_INVALID );
int DoSpellBreach( object oT=OBJECT_INVALID );
int DoSpellDirect( object oT=OBJECT_INVALID );
int DoTouch( object oT=OBJECT_INVALID );
int DoSpellArea();
int DoSpellSummon();
int DoSpellCharm();
int DoFeatEnhance();
int DoAvoidMelee();
int DoTimeStop();
int DoVision();
int DoBreathWeapon();
int DoTurning();
int DoSpellCone();
int DoHealSelf();
int DoSpellGroupEnhance();
int DoSpellGroupHeal();
int DoDispelPersAOE();
int DoDispelSingle();
int DoDismissal();
int DoFastBuffs();
int DoMeleeAssist();
int DoFlank( object oE=OBJECT_INVALID );
int DoMindBlast();
int DoBrainExtraction();
int DoAvoidEnemies();
int DoGrenade();
int DoBeholderRays();
int DoBeholderCentralEye();
// NO_LIB_ANALYSIS
int GetAOEThreat( object oArea, object oEnt=OBJECT_SELF );
int GetAOECount( float fRad=10.0f, object oEnt=OBJECT_SELF );
vector GetAOEVector( float fRad=10.0f, object oEnt=OBJECT_SELF );
int GetHostileAOECount( float fRad=10.0f, object oEnt=OBJECT_SELF );
vector GetHostileAOEVector( float fRad=10.0f, object oEnt=OBJECT_SELF );
vector GetAOEEvacVector( vector vS, object oEnt=OBJECT_SELF );
object GetMostDamagedAlly( float fRad=15.0f, object oEnt=OBJECT_SELF, int iSee=FALSE );
object GetLowestHPAlly( float fRad=15.0, int iLim=0, object oEnt=OBJECT_SELF, int iSee=FALSE );
object GetLowestHPAllyNoHealer( float fRad=15.0, int iLim=0, object oEnt=OBJECT_SELF, int iSee=FALSE, int iLive=TRUE );
object GetNearestDeadAlly( float fRad=15.0f, object oEnt=OBJECT_SELF, int iSee=FALSE );
object GetNearestDeadAllyNoRaiser( float fRad=15.0f, object oEnt=OBJECT_SELF, int iSee=FALSE );
object GetNearestPetrifiedAllyNoHelper( float fRad=15.0f, object oEnt=OBJECT_SELF, int iSee=FALSE );
int GetEffectsOnObject( object oEnt=OBJECT_SELF );
object GetMostHamperedAlly( float fRad=15.0f, object oEnt=OBJECT_SELF, int iSee=FALSE );
vector GetAreaTarget( int iS, float fRad, float fMinRad=7.5, float fMaxRad=30.0, int iEffChk=TRUE, object oCaster=OBJECT_SELF );
vector GetFriendlyAreaTarget( float fRad, int iSpell=0, int iType=0, object oCaster=OBJECT_SELF );
int CanAct( object oSelf=OBJECT_SELF );
int GetIsWeapon( object oWeapon );
int GetIsLightWeapon( object oWeapon, int iCanBeInvalid=FALSE );
int GetIsDoubleWeapon( object oWeapon );
int GetCasterCount( float fRad=5.0, object oEnt=OBJECT_SELF );
int GetAttackerCount( float fRad=5.0, object oEnt=OBJECT_SELF, object oS=OBJECT_SELF );
int GetHostileCount( float fRad=5.0, object oEnt=OBJECT_SELF, object oS=OBJECT_SELF );
int GetOmniscientHostileCount( float fRad=5.0, object oEnt=OBJECT_SELF, object oS=OBJECT_SELF );
int GetAllyCount( float fRad=5.0, object oEnt=OBJECT_SELF, object oS=OBJECT_SELF );
int GetAttackerHD( float fRad=5.0, object oEnt=OBJECT_SELF, object oS=OBJECT_SELF );
int GetHostileHD( float fRad=5.0, object oEnt=OBJECT_SELF, object oS=OBJECT_SELF );
int GetAllyHD( float fRad=5.0, object oEnt=OBJECT_SELF, object oS=OBJECT_SELF );
vector GetHostileVector( float fRad=10.0f, object oEnt=OBJECT_SELF );
vector GetHostileEvacVector( vector vS, object oEnt=OBJECT_SELF );
int GetIsCaster( object oEnt=OBJECT_SELF );
int DoAbilityCheck( int iAbil, int iDC, object oEnt=OBJECT_SELF );
int DoCombatKnowledgeCheck( int iBAB=FALSE, int iDC=10, object oE=OBJECT_SELF );
float GetFriendFoeRatio( location lLoc, float fRad, object oEnt=OBJECT_SELF );
float GetFriendFoeTolerance( object oEnt=OBJECT_SELF );
object GetNearestEnemyCaster( int iMaxLvl=20, int iMinLvl=1, object oEnt=OBJECT_SELF );
int GetAverageEnemyLevel( float fRad=60.0, object oEnt=OBJECT_SELF );
int GetSafeAverageEnemyLevel( float fRad=40.0, object oEnt=OBJECT_SELF );
object GetLeastMagicDefendedEnemy( float fRad=5.0, object oEnt=OBJECT_SELF );
vector GetTurningVector( object oEnt=OBJECT_SELF );
int GetIsValidTurnTarget( object oT, int iL=0, object oEnt=OBJECT_SELF );
int GetPotionHealAmount( object oP );
int GetTalentPotionHealAmount( talent tP );
vector GetAreaHealTarget( float fRad=0.0, int iH=0, object oEnt=OBJECT_SELF );
float GetAllyDamageStats( location lT, float fRad=0.0, object oEnt=OBJECT_SELF );
object GetMostBuffedEnemy( float fRad=10.0, object oEnt=OBJECT_SELF );
object GetLeastBuffedAlly( float fRad=10.0, int iMelee=FALSE, object oEnt=OBJECT_SELF );
int GetIsBuffEffect( effect eT );
int GetAverageEffectCasterLevel( object oT=OBJECT_SELF );
object GetStrongestEnemySummonedAssociateOwner( float fRad=10.0, object oEnt=OBJECT_SELF );
vector GetEnemySummonedAssociatesVector( float fRad=10.0, object oEnt=OBJECT_SELF );
vector GetEnemyPlanarVector( float fRad=10.0, object oEnt=OBJECT_SELF );
object GetVisionDeprived( float fRad=10.0, object oT=OBJECT_SELF );
object GetLeastDefendedAlly( float fRad=10.0, object oC=OBJECT_SELF );
int GetHasRangedCapability( object oEnt=OBJECT_SELF );
int GetIsRangedWeapon( object oW=OBJECT_INVALID );
object GetMostDistantEnemy( float fR=30.0, int iS=TRUE, object oC=OBJECT_SELF );
vector GetSaves( object oT=OBJECT_SELF );
vector GetBaseSavesByClass( int iC, int iL );
vector GetAverageEnemySaveInArea( vector vP, float fR=5.0, object oC=OBJECT_SELF );
int IsImmuneToPetrification(object oCreature);
object GetNearestAddledEnemy( float fRange=10.0, object oE=OBJECT_SELF );
object GetNearestAddledEnemyNoExtractor( float fRange=10.0, object oE=OBJECT_SELF );
int IsBrainExtractable( object oT );
int GetCreatureAttackBonus( object oC=OBJECT_SELF );
int GetGrappleBonus( object oC=OBJECT_SELF );
int GetIsMaster( object oM, object oE=OBJECT_SELF );
int GetIsPerceived( object oP, int iP=0, object oE=OBJECT_SELF );
object GetNearestPerceivedCreature( int iP=NO_PERCEPTION_SEEN, object oE=OBJECT_SELF );
object GetNearestActiveAlly( object oE=OBJECT_SELF );
object GetFurthestActiveAlly( float fD=50.0, object oE=OBJECT_SELF );
int EstimateAttackBonus( object oC=OBJECT_SELF );
int GetDualWieldingPenalty( object oC=OBJECT_SELF, object oR=OBJECT_INVALID, object oL=OBJECT_INVALID );
int GetHasWeaponFocus( object oR, object oC=OBJECT_SELF );
int GetIsArmed( object oEnt=OBJECT_SELF );
int GetRelativeEnemyWeaponSize( object oT, object oEnt=OBJECT_SELF );
int GetWeaponSize( object oEnt=OBJECT_SELF );
float GetAverageDistanceToEnemy( float fRad=60.0, object oEnt=OBJECT_SELF );
int GetCombatModeModifier( int iMode=0 );
int GetCombatConcentration( object oE=OBJECT_SELF );
int GetTurningLevel( object oC=OBJECT_SELF );
void SetIsCentralEyeOpen( int iS=FALSE, object oB=OBJECT_SELF );
int GetIsCentralEyeOpen( object oB=OBJECT_SELF );
// NO_LIB_FEAT
int GetEnhanceFeat( object oEnt=OBJECT_SELF );
int GetGroupEnhanceFeat( object oEnt=OBJECT_SELF );
float GetGroupEnhanceFeatRadius( int iFeat );
// NO_LIB_MAGIC
int GetBestMagicDefenseSelf( object oEnt=OBJECT_SELF );
int GetBestMagicDefenseSingle( object oEnt=OBJECT_SELF, object oC=OBJECT_SELF );
int GetBestPhysDefenseSelf( object oEnt=OBJECT_SELF );
int GetBestPhysDefenseSingle( object oEnt=OBJECT_SELF, object oC=OBJECT_SELF );
int GetBestGenericProtection( object oEnt=OBJECT_SELF );
struct sSpellDefStatus EvaluateSpellDefenses( object oTarget=OBJECT_SELF );
struct sPhysDefStatus EvaluatePhysicalDefenses( object oTarget=OBJECT_SELF );
int GetBestHeal( object oEnt=OBJECT_SELF, int iMin=10 );
int GetGroupHealSpell( int iMinLvl=0, object oCaster=OBJECT_SELF );
int GetGroupHealSpellAmount( int iH=0, object oCaster=OBJECT_SELF );
float GetGroupHealSpellRadius( int iH=0 );
int GetBestRaise( int iCombat=FALSE );
int GetHasHealingAbility( object oCaster=OBJECT_SELF );
int GetHasRaisingAbility( object oCaster=OBJECT_SELF );
int GetHasHelpingAbility( object oCaster=OBJECT_SELF );
int GetBestHelp( object oEnt, object oCaster=OBJECT_SELF );
int GetAreaSpell( vector vS, int iDisc=FALSE, int iMinLvl=0, float fR=40.0, object oCaster=OBJECT_SELF );
float GetAreaSpellRadius( int iSpell );
int GetDirectSpell( object oT, int iDisc=FALSE, int iMinLvl=0, object oCaster=OBJECT_SELF );
int GetTouchSpell( object oT, int iMinLvl=0, object oCaster=OBJECT_SELF );
int GetSummonSpell( int iMinLvl=1, object oCaster=OBJECT_SELF );
int GetEnhanceSpellSelf( int iMinLvl=1, object oCaster=OBJECT_SELF );
int GetEnhanceSpellSingle( int iMinLvl=1, object oEnt=OBJECT_SELF, object oCaster=OBJECT_SELF );
int GetBestBreach( int iLim=30, object oEnt=OBJECT_SELF );
int GetBestDispel( int iCLvl=20, int iDLvl=20, object oEnt=OBJECT_SELF );
int GetIsDiscriminantSpell( int iSpell );
int GetBreathWeapon( object oEnt=OBJECT_SELF );
int GetConeSpell( int iMinLvl = 1, object oCaster=OBJECT_SELF );
int GetGroupEnhanceSpell( int iMinLvl = 1, object oCaster=OBJECT_SELF );
float GetGroupEnhanceSpellRadius( int iSpell );
int GetDispelSpell( object oEnt=OBJECT_SELF );
int GetMaxDispelCasterLevel( object oEnt=OBJECT_SELF );
int GetVisionSpellNeeded( object oS=OBJECT_SELF, object oC=OBJECT_SELF );
int GetHasVisionSpells( object oC=OBJECT_SELF );
int GenerateFastBuffList( object oC=OBJECT_SELF );
float GetSpellRange( int iS );
int IsCone( int iS=0 );
int IsDragonBreath( int iS=0 );
int IsHowl( int iS=0 );
int IsPulse( int iS=0 );
void InitializeBeholderRaySelection( object oB=OBJECT_SELF );
void ClearBeholderRaySelection( object oB=OBJECT_SELF );
void RemoveBeholderRayFromSelection( int iS=0, object oB=OBJECT_SELF );
int MatchRayToTarget( object oT, object oB=OBJECT_SELF );
// NO_LIB_MELEE
int GetBestMeleeSpecial( object oTarget, int iPenalty=0, int iChance=50, object oEnt=OBJECT_SELF );
int SelectMeleeCombatModes( object oT, int iC=50, object oEnt=OBJECT_SELF );
// NO_LIB_RANGED
int GetBestRangedSpecial( object oTarget, int iPenalty=0, int iChance=50, object oEnt=OBJECT_SELF );
int SelectRangedCombatModes( object oT, int iC=50, object oEnt=OBJECT_SELF );
// NO_LIB_PRIORITY
void AddBehaviour( string sB, int iC, object oEnt=OBJECT_SELF );
string GetPriority( int iP=1, object oEnt=OBJECT_SELF );
int GetPriorityChance( int iP=1, object oEnt=OBJECT_SELF );
void SetVoiceChat( int iV, int iC, object oE=OBJECT_SELF );
float GetFollowDist( object oE=OBJECT_SELF );
void SetPerceptionRange( int iP, float fP=50.0, object oE=OBJECT_SELF );
void SetPerceptionRanges( float fS=50.0, float fH=50.0, float fV=50.0, object oE=OBJECT_SELF );
float GetPerceptionRange( int iP, object oE=OBJECT_SELF );
void SetReadyStatus( int iS=1, object oE=OBJECT_SELF );
int IsReadyToAct( object oE=OBJECT_SELF );
int ShortAction( object oE=OBJECT_SELF );
int IsActive( object oE=OBJECT_SELF );
void SetActive( object oE=OBJECT_SELF );
void SetIsActive( int iA=TRUE, object oE=OBJECT_SELF );
float GetResponseRange( int iT, object oE=OBJECT_SELF );
void SetResponseRange( int iT, float fR=50.0, object oE=OBJECT_SELF );
void SetIsTeleporter( object oE=OBJECT_SELF );
int GetIsTeleporter( object oE=OBJECT_SELF );
void SetIsFastBuffer( int iS, object oE=OBJECT_SELF );
int GetIsFastBuffer( object oE=OBJECT_SELF );
void SetIsFastBuffed( int iS, object oE=OBJECT_SELF );
int GetIsFastBuffed( object oE=OBJECT_SELF );
void AddFastBuff( int iS, object oE=OBJECT_SELF );
int CountFastBuffs( object oE=OBJECT_SELF );
void SetLastAction( string sA, object oE=OBJECT_SELF );
string GetLastAction( object oE=OBJECT_SELF );
void SetLastActionTimestamp( object oE=OBJECT_SELF );
int GetLastActionTimestamp( object oE=OBJECT_SELF );
void SetCorpseDelay( int iT=60, object oC=OBJECT_SELF );
void SetIsFlier( int iF=FALSE, object oF=OBJECT_SELF );
int GetIsFlier( object oF=OBJECT_SELF );
// NO_LIB_BIO
void SetSpawnInCondition(int nCondition, int bValid = TRUE);
int GetSpawnInCondition(int nCondition);
void SetSpawnInLocals(int nCondition);
void SetListeningPatterns();
void WalkWayPoints(int nRun = FALSE, float fPause = 1.0);
void RunNextCircuit(int nRun = FALSE, float fPause = 1.0);
void RunCircuit(int nTens, int nNum, int nRun = FALSE, float fPause = 1.0);
int CheckWayPoints(object oWalker = OBJECT_SELF);
int GetIsPostOrWalking(object oWalker = OBJECT_SELF);
//void SetBehaviorState(int nCondition, int bValid = TRUE);
//int GetBehaviorState(int nCondition);
void PlayMobileAmbientAnimations();
//void PlayImmobileAmbientAnimations();
void DetermineSpecialBehavior(object oIntruder = OBJECT_INVALID);
void ClearActions(int nClearConstant=0, int bClearCombat=FALSE);
//SoU animation craziness
void AnimDebug(string sMsg);
int GetAnimationCondition(int nCondition, object oCreature=OBJECT_SELF);
void SetAnimationCondition(int nCondition, int bValid=TRUE, object oCreature=OBJECT_SELF);
int GetIsBusyWithAnimation(object oCreature);
object GetRandomFriend(float fMaxDistance);
object GetRandomObjectByTag(string sTag, float fMaxDistance);
object GetRandomObjectByType(int nObjType, float fMaxDistance);
object GetRandomStop(float fMaxDistance);
void SetCreatureHomeWaypoint();
object GetCreatureHomeWaypoint();
void SetCurrentFriend(object oFriend);
object GetCurrentFriend();
void SetCurrentInteractionTarget(object oTarget);
object GetCurrentInteractionTarget();
void CheckIsCivilized();
void CheckCurrentModes();
int CheckIsAnimActive(object oCreature);
int CheckCurrentAction();
void AnimInitialization();
void PlayMobileAmbientAnimations_NonAvian();
void PlayMobileAmbientAnimations_Avian();
void PlayImmobileAmbientAnimations();
void AnimActionPlayRandomImmobile();
void AnimActionPlayRandomCloseRange();
void AnimActionPlayRandomMobile();
void AnimActionPlayRandomUncivilized();
void AnimActionStartInteracting(object oPlaceable);
void AnimActionStopInteracting();
void AnimActionStartTalking(object oFriend, int nHDiff=0);
void AnimActionStopTalking(object oFriend, int nHDiff=0);
void AnimActionPlayRandomGreeting(int nHDiff=0);
void AnimActionPlayRandomGoodbye(int nHDiff);
void AnimActionRandomMoveAway(object oSource, float fDistance);
void AnimActionShakeHead();
void AnimActionLookAround();
void AnimActionTurnAround();
void AnimActionGoThroughDoor(object oDoor);
int AnimActionCloseRandomDoor();
int AnimActionSitInChair(float fMaxDistance);
int AnimActionGetUpFromChair();
int AnimActionGoInside();
int AnimActionGoOutside();
int AnimActionGoToStop(float fMaxDistance);
int AnimActionFindFriend(float fMaxDistance);
int AnimActionFindPlaceable(float fMaxDistance);
int AnimActionRest();
int AnimActionGoHome();
int AnimActionLeaveHome();
int AnimActionChallengeIntruder();
void AnimActionPlayRandomInteractAnimation(object oPlaceable);
void AnimActionPlayRandomTalkAnimation(int nHDiff);
void AnimActionPlayRandomBasicAnimation();
void AnimActionPlayRandomAnimation();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2173
_module/nss/no_lib_bio.nss Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
struct sSpellDefStatus {
int iTotal;
int iMantle;
int iElem;
int iDeath;
int iMind;
int iInvis;
int iBlocker;
};
struct sPhysDefStatus {
int iTotal;
int iDamred;
int iConceal;
};

View File

@@ -0,0 +1,95 @@
#include "no_inc_ptypes"
//functions
int GetEnhanceFeat( object oEnt=OBJECT_SELF )
{
int iCnt = 0;
int iFeat = 0;
if ( GetHasFeat( FEAT_EMPTY_BODY, oEnt ) && !GetHasFeatEffect( FEAT_EMPTY_BODY, oEnt ) )
{
SetLocalInt( oEnt, "#FEAT_" + IntToString( ++iCnt ), FEAT_EMPTY_BODY );
}
if ( GetHasFeat( FEAT_MIGHTY_RAGE, oEnt ) )
{
if ( !GetHasFeatEffect( FEAT_MIGHTY_RAGE, oEnt ) )
{
SetLocalInt( oEnt, "#FEAT_" + IntToString( ++iCnt ), FEAT_MIGHTY_RAGE );
}
}
else if ( GetHasFeat( FEAT_BARBARIAN_RAGE, oEnt ) && !GetHasFeatEffect( FEAT_BARBARIAN_RAGE, oEnt ) )
{
SetLocalInt( oEnt, "#FEAT_" + IntToString( ++iCnt ), FEAT_BARBARIAN_RAGE );
}
if ( GetHasFeat( FEAT_BARD_SONGS, oEnt ) && !GetHasFeatEffect( FEAT_BARD_SONGS, oEnt ) )
{
SetLocalInt( oEnt, "#FEAT_" + IntToString( ++iCnt ), FEAT_BARD_SONGS );
}
if ( GetHasFeat( FEAT_CURSE_SONG, oEnt ) && !GetHasFeatEffect( FEAT_CURSE_SONG, oEnt ) )
{
SetLocalInt( oEnt, "#FEAT_" + IntToString( ++iCnt ), FEAT_CURSE_SONG );
}
if ( GetHasFeat( FEAT_DIVINE_WRATH, oEnt ) && GetAbilityModifier( ABILITY_CHARISMA, oEnt ) > 0 && !GetHasFeatEffect( FEAT_DIVINE_WRATH, oEnt ) )
{
SetLocalInt( oEnt, "#FEAT_" + IntToString( ++iCnt ), FEAT_DIVINE_WRATH );
}
if ( GetHasFeat( FEAT_DWARVEN_DEFENDER_DEFENSIVE_STANCE, oEnt ) && !GetHasFeatEffect( FEAT_DWARVEN_DEFENDER_DEFENSIVE_STANCE, oEnt ) )
{
SetLocalInt( oEnt, "#FEAT_" + IntToString( ++iCnt ), FEAT_DWARVEN_DEFENDER_DEFENSIVE_STANCE );
}
if ( GetHasFeat( FEAT_EPIC_BLINDING_SPEED, oEnt ) && !GetHasFeatEffect( FEAT_EPIC_BLINDING_SPEED, oEnt ) &&
!GetHasSpellEffect( SPELL_HASTE, oEnt ) && !GetHasSpellEffect( SPELL_MASS_HASTE, oEnt ) )
{
SetLocalInt( oEnt, "#FEAT_" + IntToString( ++iCnt ), FEAT_EPIC_BLINDING_SPEED );
}
if ( GetHasFeat( FEAT_SHADOW_EVADE, oEnt ) && !GetHasFeatEffect( FEAT_SHADOW_EVADE, oEnt ) )
{
SetLocalInt( oEnt, "#FEAT_" + IntToString( ++iCnt ), FEAT_SHADOW_EVADE );
}
if ( GetHasFeat( FEAT_DIVINE_MIGHT, oEnt ) && GetHasFeat( FEAT_TURN_UNDEAD, oEnt ) && !GetHasFeatEffect( FEAT_DIVINE_MIGHT, oEnt ) )
{
SetLocalInt( oEnt, "#FEAT_" + IntToString( ++iCnt ), FEAT_DIVINE_MIGHT );
}
if ( GetHasFeat( FEAT_DIVINE_SHIELD, oEnt ) && GetHasFeat( FEAT_TURN_UNDEAD, oEnt ) && !GetHasFeatEffect( FEAT_DIVINE_SHIELD, oEnt ) )
{
SetLocalInt( oEnt, "#FEAT_" + IntToString( ++iCnt ), FEAT_DIVINE_SHIELD );
}
if ( GetHasFeat( FEAT_TYMORAS_SMILE, oEnt ) && !GetHasFeatEffect( FEAT_TYMORAS_SMILE, oEnt ) )
{
SetLocalInt( oEnt, "#FEAT_" + IntToString( ++iCnt ), FEAT_TYMORAS_SMILE );
}
iFeat = GetLocalInt( oEnt, "#FEAT_" + IntToString( Random( iCnt ) + 1 ) );
while ( iCnt )
{
DeleteLocalInt( oEnt, "#FEAT_" + IntToString( iCnt-- ) );
}
return iFeat;
}
int GetGroupEnhanceFeat( object oEnt=OBJECT_SELF )
{
int iCnt = 0;
int iFeat = 0;
if ( GetHasFeat( FEAT_BARD_SONGS, oEnt ) && !GetHasFeatEffect( FEAT_BARD_SONGS, oEnt ) )
{
SetLocalInt( oEnt, "#FEAT_" + IntToString( ++iCnt ), FEAT_BARD_SONGS );
}
iFeat = GetLocalInt( oEnt, "#FEAT_" + IntToString( Random( iCnt ) + 1 ) );
while ( iCnt )
{
DeleteLocalInt( oEnt, "#FEAT_" + IntToString( iCnt-- ) );
}
return iFeat;
}
float GetGroupEnhanceFeatRadius( int iFeat )
{
if ( iFeat == FEAT_BARD_SONGS )
{
return RADIUS_SIZE_COLOSSAL;
}
return 0.0;
}

3982
_module/nss/no_lib_magic.nss Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,300 @@
#include "no_inc_ptypes"
//functions
int GetBestMeleeSpecial( object oTarget, int iPenalty=0, int iChance=50, object oEnt=OBJECT_SELF )
{
int iCnt = 0;
int iFeat;
int iMyAtk;
int iEnemyAtk;
int iMyAC;
int iEnemyAC;
int iF1;
int iF2;
int iD;
int iT;
if ( !GetIsObjectValid( oTarget ) || Random( 100 ) > iChance )
{
return 0;
}
//get target's discipline skill as it opposes some melee specials
iD = GetSkillRank( SKILL_DISCIPLINE, oTarget ) + GetAbilityModifier( ABILITY_STRENGTH, oTarget ) + 3 * GetHasFeat( FEAT_SKILL_FOCUS_DISCIPLINE, oTarget );
//use either my intelligence or BAB to check for creature knowledge on some of these, whichever is better
//if iT == TRUE we will use BAB, otherwise use intelligence modifier
iT = GetBaseAttackBonus( OBJECT_SELF ) < GetAbilityModifier( ABILITY_INTELLIGENCE ) ? FALSE : TRUE;
iMyAtk = EstimateAttackBonus( oEnt ) + iPenalty; //include penalty from active combat mode if any
//iEnemyAtk = EstimateAttackBonus( oTarget );
//iMyAC = GetAC( oEnt ) - 10;
iEnemyAC = GetAC( oTarget ) - 10;
//KNOCKDOWN
iF1 = GetHasFeat( FEAT_KNOCKDOWN, oEnt );
iF2 = GetHasFeat( FEAT_IMPROVED_KNOCKDOWN, oEnt );
if ( iF1 || iF2 )
{
iFeat = 0;
if ( !GetHasFeatEffect( FEAT_KNOCKDOWN, oTarget ) && !GetHasFeatEffect( FEAT_IMPROVED_KNOCKDOWN, oTarget ) )
{
//figure out target's discipline
if ( iF2 ) //improved knockdown
{
//compare my improved knockdown attack roll to target's AC and Discipline check
if ( iMyAtk >= iEnemyAC && iMyAtk > iD )
{
iFeat = FEAT_IMPROVED_KNOCKDOWN;
}
}
else //no iF2 means we must have iF1
{
//compare my knockdown attack roll to target's AC and Discipline check
if ( DoCombatKnowledgeCheck( iT, 10 ) == FALSE || ( iMyAtk - 4 >= iEnemyAC && iMyAtk - 4 > iD ) )
{
iFeat = FEAT_KNOCKDOWN;
}
}
}
if ( iFeat )
{
SetLocalInt( oEnt, "#FEAT" + IntToString( ++iCnt ), iFeat );
}
}
//CALLED SHOT
if ( GetHasFeat( FEAT_CALLED_SHOT, oEnt ) )
{
iFeat = 0;
if ( DoCombatKnowledgeCheck( iT, 10 ) == FALSE || ( iMyAtk - 4 >= iEnemyAC && iMyAtk - 4 > iD ) )
{
iFeat = FEAT_CALLED_SHOT;
}
if ( iFeat )
{
SetLocalInt( oEnt, "#FEAT" + IntToString( ++iCnt ), iFeat );
}
}
//DISARM
iF1 = GetHasFeat( FEAT_DISARM, oEnt );
iF2 = GetHasFeat( FEAT_IMPROVED_DISARM, oEnt );
if ( iF1 || iF2 )
{
int iMod = 4 * GetRelativeEnemyWeaponSize( oTarget );
iFeat = 0;
if ( GetIsArmed( oTarget) )
{
if ( iF2 ) //improved disarm
{
if ( DoCombatKnowledgeCheck( iT, 10 ) == FALSE || ( iMyAtk - 4 + iMod >= iEnemyAC && iMyAtk - 4 + iMod > iD ) )
{
iFeat = FEAT_IMPROVED_DISARM;
}
}
else //disarm
{
if ( DoCombatKnowledgeCheck( iT, 10 ) == FALSE || ( iMyAtk - 6 + iMod >= iEnemyAC && iMyAtk - 6 + iMod > iD ) )
{
iFeat = FEAT_DISARM;
}
}
}
if ( iFeat )
{
SetLocalInt( oEnt, "#FEAT" + IntToString( ++iCnt ), iFeat );
}
}
//STUNNING FIST
if ( GetHasFeat( FEAT_STUNNING_FIST, oEnt ) && !GetHasFeatEffect( FEAT_STUNNING_FIST, oTarget ) &&
FloatToInt( NO_THRESH_STUNNING_FIST * GetHitDice( oEnt ) ) < GetHitDice( oTarget ) &&
( DoAbilityCheck( ABILITY_INTELLIGENCE, 10 ) == FALSE || !GetIsImmune( oTarget, IMMUNITY_TYPE_STUN ) ) )
{
iFeat = 0;
if ( DoCombatKnowledgeCheck( iT, 10 ) == FALSE || iMyAtk - 4 >= iEnemyAC )
{
iFeat = FEAT_STUNNING_FIST;
}
if ( iFeat )
{
SetLocalInt( oEnt, "#FEAT" + IntToString( ++iCnt ), iFeat );
}
}
//QUIVERING PALM
if ( GetHasFeat( FEAT_QUIVERING_PALM, oEnt ) &&
FloatToInt( NO_THRESH_QUIVERING_PALM * GetHitDice( oEnt ) ) < GetHitDice( oTarget ) &&
( DoAbilityCheck( ABILITY_INTELLIGENCE, 10 ) == FALSE || !GetIsImmune( oTarget, IMMUNITY_TYPE_DEATH ) ) )
{
iFeat = FEAT_QUIVERING_PALM;
SetLocalInt( oEnt, "#FEAT" + IntToString( ++iCnt ), iFeat );
}
//SMITE EVIL
if ( GetHasFeat( FEAT_SMITE_EVIL, oEnt ) && FloatToInt( NO_THRESH_SMITE * GetHitDice( oEnt ) ) < GetHitDice( oTarget ) &&
( DoAbilityCheck( ABILITY_INTELLIGENCE, 2 ) == FALSE || GetAlignmentGoodEvil( oTarget ) == ALIGNMENT_EVIL ) )
{
iFeat = FEAT_SMITE_EVIL;
SetLocalInt( oEnt, "#FEAT" + IntToString( ++iCnt ), iFeat );
}
//SMITE GOOD
//This feat definition was missing in nwscript pre-HotU, now it's in, uncommenting this block
if ( GetHasFeat( FEAT_SMITE_GOOD, oEnt ) && FloatToInt( NO_THRESH_SMITE * GetHitDice( oEnt ) ) < GetHitDice( oTarget ) &&
( DoAbilityCheck( ABILITY_INTELLIGENCE, 2 ) == FALSE || GetAlignmentGoodEvil( oTarget ) == ALIGNMENT_GOOD ) )
{
iFeat = FEAT_SMITE_GOOD;
SetLocalInt( oEnt, "#FEAT" + IntToString( ++iCnt ), iFeat );
}
//WHIRLWIND
iF1 = GetHasFeat( FEAT_WHIRLWIND_ATTACK, oEnt );
iF2 = GetHasFeat( FEAT_IMPROVED_WHIRLWIND, oEnt );
if ( iF1 || iF2 )
{
iFeat = 0;
if ( iF2 ) //improved whirlwind
{
//check to see if there are multiple enemies in melee range
//if so, check to see if there are at least as many as our number of attacks divided by 2
//tail end attacks probably miss anyway, so only count the top end of the attack sequence
//if there are enough, use whirlwind as we get full BAB on every attack with whirlwind
if ( GetHostileCount( 3.0 ) > GetBaseAttackBonus( oEnt ) / 10 )
{
iFeat = FEAT_IMPROVED_WHIRLWIND;
}
}
else //whirlwind
{
if ( GetHostileCount( 3.0 ) > GetBaseAttackBonus( oEnt ) / 10 )
{
iFeat = FEAT_WHIRLWIND_ATTACK;
}
}
if ( iFeat )
{
SetLocalInt( oEnt, "#FEAT" + IntToString( ++iCnt ), iFeat );
}
}
//KI DAMAGE
if ( GetHasFeat( FEAT_KI_DAMAGE, oEnt ) && FloatToInt( NO_THRESH_KI_DAMAGE * GetHitDice( oEnt ) ) < GetHitDice( oTarget ) )
{
iFeat = FEAT_KI_DAMAGE;
SetLocalInt( oEnt, "#FEAT" + IntToString( ++iCnt ), iFeat );
}
iFeat = GetLocalInt( oEnt, "#FEAT" + IntToString( Random( iCnt ) + 1 ) );
while ( iCnt )
{
DeleteLocalInt( oEnt, "#FEAT" + IntToString( iCnt-- ) );
}
return iFeat;
}
int SelectMeleeCombatModes( object oT, int iC=50, object oEnt=OBJECT_SELF )
{
int iPenalty = 0; //accumulate penalty from attack modes
int iMyAtk;
int iEnemyAtk;
int iMyAC;
int iEnemyAC;
int iF1;
int iF2;
int iCnt = 0;
int iMode;
int iT;
if ( !GetIsObjectValid( oT ) || Random( 100 ) > iC )
{
return 0;
}
iMyAtk = EstimateAttackBonus( oEnt );
iEnemyAtk = EstimateAttackBonus( oT );
iMyAC = GetAC( oEnt ) - 10;
iEnemyAC = GetAC( oT ) - 10;
//use either my intelligence or BAB to check for creature knowledge on some of these, whichever is better
//if iT == TRUE we will use BAB, otherwise use intelligence modifier
iT = GetBaseAttackBonus( OBJECT_SELF ) < GetAbilityModifier( ABILITY_INTELLIGENCE ) ? FALSE : TRUE;
//POWER ATTACK, IMPROVED POWER ATTACK
iF1 = GetHasFeat( FEAT_POWER_ATTACK, oEnt );
iF2 = GetHasFeat( FEAT_IMPROVED_POWER_ATTACK, oEnt );
if ( iF1 || iF2 )
{
iMode = 0;
if ( iF2 ) //improved power attack
{
if ( DoCombatKnowledgeCheck( iT, 10 ) == FALSE || iMyAtk - 10 >= iEnemyAC )
{
iMode = FEAT_IMPROVED_POWER_ATTACK;
}
}
if ( iF1 && iMode == 0 ) //we don't have or didn't choose improved power attack
{
if ( DoCombatKnowledgeCheck( iT, 10 ) == FALSE || iMyAtk - 5 >= iEnemyAC )
{
iMode = FEAT_POWER_ATTACK;
}
}
if ( iMode )
{
SetLocalInt( oEnt, "#COMBATMODE" + IntToString( ++iCnt ), iMode );
}
}
//FLURRY OF BLOWS
if ( GetHasFeat( FEAT_FLURRY_OF_BLOWS, oEnt ) )
{
iMode = 0;
if ( DoCombatKnowledgeCheck( iT, 10 ) == FALSE || iMyAtk - 2 >= iEnemyAC )
{
iMode = FEAT_FLURRY_OF_BLOWS;
}
if ( iMode )
{
SetLocalInt( oEnt, "#COMBATMODE" + IntToString( ++iCnt ), iMode );
}
}
//EXPERTISE, IMPROVED EXPERTISE
iF1 = GetHasFeat( FEAT_EXPERTISE, oEnt );
iF2 = GetHasFeat( FEAT_IMPROVED_EXPERTISE, oEnt );
if ( iF1 || iF2 )
{
iMode = 0;
if ( iF2 ) //improved expertise
{
//check if I can afford a -10 on attack, and if my enemy has a high enough attack to bother
if ( DoCombatKnowledgeCheck( iT, 10 ) == FALSE || ( iMyAtk - 10 >= iEnemyAC && iEnemyAtk >= iMyAC ) )
{
iMode = FEAT_IMPROVED_EXPERTISE;
}
}
if ( iF1 && iMode == 0 ) //we don't have or didn't choose improved expertise
{
//check if I can afford a -5 on attack, and if my enemy has a high enough attack to bother
if ( DoCombatKnowledgeCheck( iT, 10 ) == FALSE || ( iMyAtk - 5 >= iEnemyAC && iEnemyAtk >= iMyAC ) )
{
iMode = FEAT_EXPERTISE;
}
}
if ( iMode )
{
SetLocalInt( oEnt, "#COMBATMODE" + IntToString( ++iCnt ), iMode );
}
}
iMode = GetLocalInt( oEnt, "#COMBATMODE" + IntToString( Random( iCnt ) + 1 ) );
while ( iCnt )
{
DeleteLocalInt( oEnt, "#COMBATMODE" + IntToString( iCnt-- ) );
}
return iMode;
}

View File

@@ -0,0 +1,320 @@
#include "no_inc_ptypes"
//functions
void AddBehaviour( string sB, int iC, object oEnt=OBJECT_SELF )
{
int iL = GetLocalInt( oEnt, "PRITOTAL" ) + 1;
//update count
SetLocalInt( oEnt, "PRITOTAL", iL );
//make sure the chance is valid
iC = iC < 0 ? 0 : iC;
iC = iC > 100 ? 100 : iC;
//set up the behaviour
SetLocalString( oEnt, "PRID_" + IntToString( iL ), sB );
SetLocalInt( oEnt, "PRIC_" + IntToString( iL ), iC );
}
string GetPriority( int iP=1, object oEnt=OBJECT_SELF )
{
//retrieve priority iP
return GetLocalString( oEnt, "PRID_" + IntToString( iP ) );
}
int GetPriorityChance( int iP=1, object oEnt=OBJECT_SELF )
{
//retrieve priority chance iP
return GetLocalInt( oEnt, "PRIC_" + IntToString( iP ) );
}
void SetVoiceChat( int iV, int iC, object oE=OBJECT_SELF )
{
if ( iC < 0 )
{
iC = -1;
}
else if ( iC > 100 )
{
iC = 100;
}
if ( iV == NO_VC_DEFAULT )
{
if ( iC == 0 )
{
//delete the config for default voicechat chance
DeleteLocalInt( oE, "#VCC" );
}
else
{
//set the config for default voicechat chance
SetLocalInt( oE, "#VCC", iC );
}
}
else
{
if ( iC == 0 )
{
//delete the config for this voicechat chance
DeleteLocalInt( oE, "#VCC_" + IntToString( iV ) );
}
else
{
//set the config for this voicechat chance
SetLocalInt( oE, "#VCC_" + IntToString( iV ), iC );
}
}
}
float GetFollowDist( object oE=OBJECT_SELF )
{
float fF = -1.0;
if ( GetIsObjectValid( oE ) )
{
fF = GetLocalFloat( OBJECT_SELF, "#FOLLOWDIST" );
if ( fF == 0.0 )
{
//default distance if none is set
fF = 3.0;
}
}
return fF;
}
void SetPerceptionRange( int iP, float fP=50.0, object oE=OBJECT_SELF )
{
if ( iP == NO_PERCEPTION_SEEN )
{
SetLocalFloat( oE, "#PER_SEEN_RANGE", fP );
}
else if ( iP == NO_PERCEPTION_HEARD )
{
SetLocalFloat( oE, "#PER_HEARD_RANGE", fP );
}
else if ( iP == NO_PERCEPTION_VANISHED )
{
SetLocalFloat( oE, "#PER_VANISHED_RANGE", fP );
}
}
void SetPerceptionRanges( float fS=50.0, float fH=50.0, float fV=50.0, object oE=OBJECT_SELF )
{
if ( fS != -1.0 )
{
SetLocalFloat( oE, "#PER_SEEN_RANGE", fS );
}
if ( fH != -1.0 )
{
SetLocalFloat( oE, "#PER_HEARD_RANGE", fH );
}
if ( fV != -1.0 )
{
SetLocalFloat( oE, "#PER_VANISHED_RANGE", fV );
}
}
float GetPerceptionRange( int iP, object oE=OBJECT_SELF )
{
float fP = 0.0;
if ( iP == NO_PERCEPTION_SEEN )
{
fP = GetLocalFloat( oE, "#PER_SEEN_RANGE" );
}
else if ( iP == NO_PERCEPTION_HEARD )
{
fP = GetLocalFloat( oE, "#PER_HEARD_RANGE" );
}
else if ( iP == NO_PERCEPTION_VANISHED )
{
fP = GetLocalFloat( oE, "#PER_VANISHED_RANGE" );
}
//set max range if no setting found
if ( fP == 0.0 )
{
fP = 50.0;
}
return fP;
}
void SetReadyStatus( int iS=1, object oE=OBJECT_SELF )
{
SetLocalInt( oE, "#READYTOACT", iS );
}
int IsReadyToAct( object oE=OBJECT_SELF )
{
return GetLocalInt( oE, "#READYTOACT" );
}
int ShortAction( object oE=OBJECT_SELF )
{
string sAct = GetLastAction( oE );
if ( sAct == "+EVACAOE" || sAct == "+REGROUP" || sAct == "+AVOIDMELEE" || sAct == "+FLANK" || sAct == "+AVOIDENEMY" )
//|| sAct == "+EYERAYS" )
{
return TRUE;
}
return FALSE;
}
int IsActive( object oE=OBJECT_SELF )
{
return GetLocalInt( oE, "#ACTIVE" );
}
void SetActive( object oE=OBJECT_SELF )
{
SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
}
void SetIsActive( int iA=TRUE, object oE=OBJECT_SELF )
{
if ( iA == TRUE )
{
SetLocalInt( oE, "#ACTIVE", 1 );
}
else
{
DeleteLocalInt( oE, "#ACTIVE" );
}
}
float GetResponseRange( int iT, object oE=OBJECT_SELF )
{
float fR = GetLocalFloat( oE, "#RESPOND_RANGE_" + IntToString( iT ) );
if ( fR == 0.0 )
{
//default range
fR = 50.0;
}
return fR;
}
void SetResponseRange( int iT, float fR=50.0, object oE=OBJECT_SELF )
{
float fRange = fR > 0.0 ? fR : 0.0;
SetLocalFloat( oE, "#RESPOND_RANGE_" + IntToString( iT ), fRange );
}
void SetIsTeleporter( object oE=OBJECT_SELF )
{
SetLocalInt( OBJECT_SELF, "TELEPORTER", 1 );
}
int GetIsTeleporter( object oE=OBJECT_SELF )
{
return GetLocalInt( OBJECT_SELF, "TELEPORTER" );
}
void SetIsFastBuffer( int iS, object oE=OBJECT_SELF )
{
if ( iS == 1 )
{
SetLocalInt( oE, "#FASTBUFFER", 1 );
}
else
{
DeleteLocalInt( oE, "#FASTBUFFER" );
}
}
int GetIsFastBuffer( object oE=OBJECT_SELF )
{
return GetLocalInt( oE, "#FASTBUFFER" );
}
void SetIsFastBuffed( int iS, object oE=OBJECT_SELF )
{
if ( iS == 1 )
{
SetLocalInt( oE, "#FASTBUFFED", 1 );
}
else
{
DeleteLocalInt( oE, "#FASTBUFFED" );
}
}
int GetIsFastBuffed( object oE=OBJECT_SELF )
{
return GetLocalInt( oE, "#FASTBUFFED" );
}
void AddFastBuff( int iS, object oE=OBJECT_SELF )
{
int iC = CountFastBuffs( oE ) + 1;
SetLocalInt( oE, "#SPN_FB" + IntToString( iC ), iS );
}
int CountFastBuffs( object oE=OBJECT_SELF )
{
int iC = 0;
int iS = 1;
while ( GetLocalInt( oE, "#SPN_FB" + IntToString( iS++ ) ) != 0 )
{
iC++;
}
return iC;
}
void SetLastAction( string sA, object oE=OBJECT_SELF )
{
SetLocalString( oE, "#LASTACTION", sA );
}
string GetLastAction( object oE=OBJECT_SELF )
{
return GetLocalString( oE, "#LASTACTION" );
}
void SetLastActionTimestamp( object oE=OBJECT_SELF )
{
SetLocalInt( oE, "#LASTACTIONTIME", GetTimeSecond() );
}
int GetLastActionTimestamp( object oE=OBJECT_SELF )
{
int iS = GetLocalInt( oE, "#LASTACTIONTIME" );
int iT = GetTimeSecond();
int iL = iT < iS ? iT + 60 : iT;
return iL - iS;
}
void SetCorpseDelay( int iT=60, object oC=OBJECT_SELF )
{
if ( GetRacialType( oC ) != RACIAL_TYPE_UNDEAD && GetStringLeft( GetTag( oC ), 6 ) != "NO_AI_" &&
GetName( GetItemInSlot( INVENTORY_SLOT_CARMOUR, oC ) ) != "Gargoyle Properties" )
{
//not summoned, not undead, default decay time
AssignCommand( oC, SetIsDestroyable( FALSE, TRUE, TRUE ) );
SetLocalFloat( oC, "#DECAYDELAY", 60.0 ); //default corpse decay time
}
}
void SetIsFlier( int iF=FALSE, object oF=OBJECT_SELF )
{
if ( iF == TRUE || GetRacialType( oF ) == RACIAL_TYPE_DRAGON )
{
SetLocalInt( oF, "FLIER", 1 );
}
else
{
DeleteLocalInt( oF, "FLIER" );
}
}
int GetIsFlier( object oF=OBJECT_SELF )
{
return GetLocalInt( oF, "FLIER" );
}

View File

@@ -0,0 +1,172 @@
#include "no_inc_ptypes"
//functions
int GetBestRangedSpecial( object oTarget, int iPenalty=0, int iChance=50, object oEnt=OBJECT_SELF )
{
int iCnt = 0;
int iFeat;
int iMyAtk;
int iEnemyAtk;
int iMyAC;
int iEnemyAC;
int iF1;
int iF2;
int iD;
int iT;
if ( !GetIsObjectValid( oTarget ) || Random( 100 ) > iChance )
{
return 0;
}
iD = GetSkillRank( SKILL_DISCIPLINE, oTarget ) + GetAbilityModifier( ABILITY_STRENGTH, oTarget ) + 3 * GetHasFeat( FEAT_SKILL_FOCUS_DISCIPLINE, oTarget );
iMyAtk = EstimateAttackBonus( oEnt ) + iPenalty; //include penalty from active combat mode if any
//iEnemyAtk = EstimateAttackBonus( oTarget );
//iMyAC = GetAC( oEnt ) - 10;
iEnemyAC = GetAC( oTarget ) - 10;
//use either my intelligence or BAB to check for creature knowledge on some of these, whichever is better
//if iT == TRUE we will use BAB, otherwise use intelligence modifier
iT = GetBaseAttackBonus( OBJECT_SELF ) < GetAbilityModifier( ABILITY_INTELLIGENCE ) ? FALSE : TRUE;
//CALLED SHOT
if ( GetHasFeat( FEAT_CALLED_SHOT, oEnt ) )
{
iFeat = 0;
if ( DoCombatKnowledgeCheck( iT, 10 ) == FALSE || ( iMyAtk - 4 >= iEnemyAC && iMyAtk - 4 > iD ) )
{
iFeat = FEAT_CALLED_SHOT;
}
if ( iFeat )
{
SetLocalInt( oEnt, "#FEAT" + IntToString( ++iCnt ), iFeat );
}
}
//SEEKER ARROW
// Arcane Archer feats are not defined in nwscript?
// FIX: They are in HotU but not SoU. When updating these for HotU update this block and add the rest.
iF1 = GetHasFeat( FEAT_PRESTIGE_SEEKER_ARROW_1, oEnt );
iF2 = GetHasFeat( FEAT_PRESTIGE_SEEKER_ARROW_2, oEnt );
if ( iF1 || iF2 )
{
iFeat = 0;
if ( iMyAtk + 8 < iEnemyAC ) //if I can't hit even with a high roll use a seeker arrow
{
if ( iF2 )
{
iFeat = FEAT_PRESTIGE_SEEKER_ARROW_2;
}
else
{
iFeat = FEAT_PRESTIGE_SEEKER_ARROW_1;
}
}
if ( iFeat )
{
SetLocalInt( oEnt, "#FEAT" + IntToString( ++iCnt ), iFeat );
}
}
//IMBUE ARROW
if ( GetHasFeat( FEAT_PRESTIGE_IMBUE_ARROW, oEnt ) )
{
iFeat = 0;
if ( GetAllyCount( RADIUS_SIZE_HUGE, oTarget, oEnt ) > GetHostileCount( RADIUS_SIZE_HUGE, oTarget, oEnt ) )
{
iFeat = FEAT_PRESTIGE_IMBUE_ARROW;
}
if ( iFeat )
{
SetLocalInt( oEnt, "#FEAT" + IntToString( ++iCnt ), iFeat );
}
}
//HAIL OF ARROWS
if ( GetHasFeat( FEAT_PRESTIGE_HAIL_OF_ARROWS, oEnt ) )
{
iFeat = 0;
if ( GetHostileCount( 30.0 ) > GetBaseAttackBonus( oEnt ) / 10 )
{
iFeat = FEAT_PRESTIGE_HAIL_OF_ARROWS;
}
if ( iFeat )
{
SetLocalInt( oEnt, "#FEAT" + IntToString( ++iCnt ), iFeat );
}
}
//ARROW OF SLAYING
if ( GetHasFeat( FEAT_PRESTIGE_ARROW_OF_DEATH, oEnt ) )
{
iFeat = 0;
if ( FloatToInt( NO_THRESH_ARROW_SLAYING * GetHitDice( oEnt ) ) < GetHitDice( oTarget ) &&
( DoAbilityCheck( ABILITY_INTELLIGENCE, 10 ) == FALSE || GetIsImmune( oTarget, IMMUNITY_TYPE_DEATH ) == FALSE ) )
{
//target has sufficient hit dice to warrant use of an arrow of death
//either oEnt failed its intelligence check or it passed and determined that target is not immune to death effects
iFeat = FEAT_PRESTIGE_ARROW_OF_DEATH;
}
if ( iFeat )
{
SetLocalInt( oEnt, "#FEAT" + IntToString( ++iCnt ), iFeat );
}
}
//randomly select one of the feats that was deemed suitable for use
iFeat = GetLocalInt( oEnt, "#FEAT" + IntToString( Random( iCnt ) + 1 ) );
while ( iCnt )
{
DeleteLocalInt( oEnt, "#FEAT" + IntToString( iCnt-- ) );
}
return iFeat;
}
int SelectRangedCombatModes( object oT, int iC=50, object oEnt=OBJECT_SELF )
{
int iPenalty = 0; //accumulate penalty from attack modes
int iMyAtk;
//int iEnemyAtk;
//int iMyAC;
int iEnemyAC;
int iF1;
int iF2;
int iCnt = 0;
int iMode;
int iT;
if ( !GetIsObjectValid( oT ) || Random( 100 ) > iC )
{
return 0;
}
iMyAtk = EstimateAttackBonus( oEnt );
//iEnemyAtk = EstimateAttackBonus( oT );
//iMyAC = GetAC( oEnt ) - 10;
iEnemyAC = GetAC( oT ) - 10;
//use either my intelligence or BAB to check for creature knowledge on some of these, whichever is better
//if iT == TRUE we will use BAB, otherwise use intelligence modifier
iT = GetBaseAttackBonus( OBJECT_SELF ) < GetAbilityModifier( ABILITY_INTELLIGENCE ) ? FALSE : TRUE;
//RAPID SHOT
if ( GetHasFeat( FEAT_RAPID_SHOT, oEnt ) )
{
iMode = 0;
if ( DoCombatKnowledgeCheck( iT, 10 ) == FALSE || ( iMyAtk - 2 >= iEnemyAC ) )
{
iMode = FEAT_RAPID_SHOT;
}
if ( iMode )
{
SetLocalInt( oEnt, "#COMBATMODE" + IntToString( ++iCnt ), iMode );
}
}
iMode = GetLocalInt( oEnt, "#COMBATMODE" + IntToString( Random( iCnt ) + 1 ) );
while ( iCnt )
{
DeleteLocalInt( oEnt, "#COMBATMODE" + IntToString( iCnt-- ) );
}
return iMode;
}

View File

@@ -0,0 +1,5 @@
void main()
{
SetListening( OBJECT_SELF, TRUE );
SetAssociateListenPatterns( OBJECT_SELF );
}

View File

@@ -0,0 +1,109 @@
#include "no_lib_priority"
#include "no_lib_data"
void main()
{
//clean up variables on dying creature
int iCnt;
//don't proceed if we're alive again
if ( GetIsDead( OBJECT_SELF ) || GetLocalInt( OBJECT_SELF, "TEMPDIE" ) )
{
//clear teleporter status variable
DeleteLocalInt( OBJECT_SELF, "TELEPORTER" );
//clear balor death throes variable
DeleteLocalInt( OBJECT_SELF, "BALORDEATH" );
//clear dragon flight variables
DeleteLocalInt( OBJECT_SELF, "FLIER" );
DeleteLocalInt( OBJECT_SELF, "DRAGONFLIGHTDEL" );
//dragon fear variable
DeleteLocalInt( OBJECT_SELF, "#DRAGFEAR" );
//clear caster flag
DeleteLocalInt( OBJECT_SELF, "#CASTER" );
//clear avoid melee trackers
DeleteLocalLocation( OBJECT_SELF, "#LASTHOTSPOT" );
DeleteLocalFloat( OBJECT_SELF, "#LASTAMANGLE" );
DeleteLocalInt( OBJECT_SELF, "#LASTHSRETRIES" );
DeleteLocalInt( OBJECT_SELF, "#LASTDEST" );
DeleteLocalLocation( OBJECT_SELF, "#LASTDEST" );
//clear dragon breath weapon delay flag
DeleteLocalInt( OBJECT_SELF, "#BDEL" );
//clear BC_HEAL anti-spam flag
DeleteLocalInt( OBJECT_SELF, "#HEALDEL" );
//delete combat setting
DeleteLocalInt( OBJECT_SELF, "#INCOMBAT" );
//delete last combat round end broadcast timestamp
DeleteLocalInt( OBJECT_SELF, "#LASTCREBC" );
//clear tail of summon chain variable
DeleteLocalObject( OBJECT_SELF, "MASTCHAIN" );
//clear vision flags
DeleteLocalInt( OBJECT_SELF, "#DARKNESS" );
DeleteLocalInt( OBJECT_SELF, "#VANISHED" );
DeleteLocalObject( OBJECT_SELF, "#VISION" );
//clear last rest marker
DeleteLocalInt( OBJECT_SELF, "#LASTREST" );
//clear fast buffer markers
DeleteLocalInt( OBJECT_SELF, "#FASTBUFFER" );
DeleteLocalInt( OBJECT_SELF, "#FASTBUFFED" );
//delete activity marker
DeleteLocalInt( OBJECT_SELF, "#ACTIVE" );
DeleteLocalInt( OBJECT_SELF, "#QUEUESHUTDOWN" );
//delete logged spawn point
DeleteLocalInt( OBJECT_SELF, "#RETSPNLOC" );
DeleteLocalLocation( OBJECT_SELF, "#SPAWNLOC" );
//delete stand ground variables
DeleteLocalInt( OBJECT_SELF, "#STANDGROUND" );
DeleteLocalLocation( OBJECT_SELF, "#SGLOC" );
//delete corpse decay delay variable
DeleteLocalFloat( OBJECT_SELF, "#DECAYDELAY" );
//clear spell list and fastbuff list
//these shouldn't be necessary, but just in case there is an interruption
iCnt = 1;
while ( GetLocalInt( OBJECT_SELF, "#SPL_" + IntToString( iCnt ) ) )
{
DeleteLocalInt( OBJECT_SELF, "#SPL_" + IntToString( iCnt++ ) );
}
iCnt = 1;
while ( GetLocalInt( OBJECT_SELF, "#SPL_FB" + IntToString( iCnt ) ) )
{
DeleteLocalInt( OBJECT_SELF, "#SPL_FB" + IntToString( iCnt++ ) );
}
iCnt = 1;
while ( GetLocalInt( OBJECT_SELF, "#SPN_FB" + IntToString( iCnt ) ) )
{
DeleteLocalInt( OBJECT_SELF, "#SPN_FB" + IntToString( iCnt++ ) );
}
iCnt = 1;
while ( GetLocalInt( OBJECT_SELF, "#FEAT_" + IntToString( iCnt ) ) )
{
DeleteLocalInt( OBJECT_SELF, "#FEAT_" + IntToString( iCnt++ ) );
}
//clear priority lists
DeleteLocalInt( OBJECT_SELF, "PRITOTAL" );
iCnt = 1;
while ( GetLocalInt( OBJECT_SELF, "PRIC_" + IntToString( iCnt ) ) )
{
DeleteLocalString( OBJECT_SELF, "PRID_" + IntToString( iCnt ) );
DeleteLocalInt( OBJECT_SELF, "PRIC_" + IntToString( iCnt++ ) );
}
}
}

View File

@@ -0,0 +1,13 @@
void main()
{
//don't proceed if we're alive again
if ( GetIsDead( OBJECT_SELF ) || GetLocalInt( OBJECT_SELF, "TEMPDIE" ) )
{
//clear death marker
DeleteLocalInt( OBJECT_SELF, "TEMPDIE" );
//time to die
SetIsDestroyable( TRUE, FALSE, FALSE );
DestroyObject( OBJECT_SELF );
}
}

View File

@@ -0,0 +1,14 @@
void main()
{
object oL = GetItemInSlot( INVENTORY_SLOT_LEFTHAND );
object oR = GetItemInSlot( INVENTORY_SLOT_RIGHTHAND );
if ( GetIsObjectValid( oL ) )
{
SetLocalObject( OBJECT_SELF, "LHAND", oL );
}
if ( GetIsObjectValid( oR ) )
{
SetLocalObject( OBJECT_SELF, "RHAND", oR );
}
}

View File

@@ -0,0 +1,5 @@
void main()
{
SetLocalInt( OBJECT_SELF, "#RETSPNLOC", 1 );
SetLocalLocation( OBJECT_SELF, "#SPAWNLOC", GetLocation( OBJECT_SELF ) );
}

View File

@@ -0,0 +1,72 @@
//::///////////////////////////////////////////////
//:: Shutdown
//::
//:://////////////////////////////////////////////
/*
This script will shutdown the combat AI.
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
void main()
{
int iCnt = GetLocalInt( OBJECT_SELF, "#QUEUESHUTDOWN" );
int iCombat = 0;
//object oEnemy;
int iRestWait = 30;
//delete queue marker
DeleteLocalInt( OBJECT_SELF, "#QUEUESHUTDOWN" );
//SpeakString( "CFS" );
//if ( !GetIsInCombat() && GetLocalInt( OBJECT_SELF, "#ACTIVE" ) && !IsInConversation( OBJECT_SELF ) )
if ( !IsInConversation( OBJECT_SELF ) )
{
//oEnemy = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_IS_ALIVE, TRUE );
int iE = GetHostileCount( 50.0 );
if ( iE )
{
InitCombat();
}
else
{
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
DeleteLocalInt( OBJECT_SELF, "#FASTBUFFED" );
DeleteLocalInt( OBJECT_SELF, "#QUEUESHUTDOWN" );
DeleteLocalInt( OBJECT_SELF, "#ACTIVE" );
DeleteLocalInt( OBJECT_SELF, "#VANISHED" );
//SetReadyStatus();
ActionForceFollowObject( GetMaster( OBJECT_SELF ), 3.0 );
return;
}
//else if ( !GetLocalInt( OBJECT_SELF, "#LASTREST" ) && GetTimeSinceLastCombat() > iRestWait )
else if ( GetTimeSinceLastCombat() > iRestWait )
{
//PrintString( "RESTING: " + GetName( OBJECT_SELF ) );
DeleteLocalInt( OBJECT_SELF, "#FASTBUFFED" );
DeleteLocalInt( OBJECT_SELF, "#QUEUESHUTDOWN" );
DeleteLocalInt( OBJECT_SELF, "#ACTIVE" ); //shutdown AI heartbeats until an opponent shows up
DeleteLocalInt( OBJECT_SELF, "#VANISHED" );
//SetReadyStatus();
if ( !GetLocalInt( OBJECT_SELF, "#LASTREST" ) )
{
ActionRest(); //no enemies seen for 30 seconds, rest
SetLocalInt( OBJECT_SELF, "#LASTREST", 1 );
}
ActionDoCommand( WalkWayPoints() ); //start walking waypoints if applicable
return;
}
if ( !GetLocalInt( OBJECT_SELF, "#QUEUESHUTDOWN" ) && GetLocalInt( OBJECT_SELF, "#ACTIVE" ) )
{
//DelayCommand( 12.0, ExecuteScript( "no_scr_shutdown", OBJECT_SELF ) );
DoQueueShutdown( 12.0 );
return;
}
}
}
}

121
_module/nss/no_spn_beh.nss Normal file
View File

@@ -0,0 +1,121 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+AVOIDMELEE", 50 ); //avoid melee
AddBehaviour( "+EVACAOE", 80 ); //evac AOEs
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+REGROUP", 20 ); //regroup
AddBehaviour( "+FEATENHANCE", 10 ); //enhance self via feats
AddBehaviour( "+CENTRALEYE", 10 ); //beholder antimagic cone
AddBehaviour( "+EYERAYS", 100 ); //beholder eye rays
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//set response range for fighting broadcast
SetResponseRange( BC_FIGHTING, 50.0 );
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

157
_module/nss/no_spn_clr.nss Normal file
View File

@@ -0,0 +1,157 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 );
AddBehaviour( "+REGROUP", 80 );
AddBehaviour( "+FLANK", 20 );
AddBehaviour( "+SUMMON", 40 );
AddBehaviour( "+RAISE", 60 );
AddBehaviour( "+GROUPHEAL", 60 );
AddBehaviour( "+HELP", 60 );
AddBehaviour( "+HEAL", 60 );
AddBehaviour( "+VIS", 60 );
AddBehaviour( "+DEFSELF", 40 );
AddBehaviour( "+DEFSING", 40 );
AddBehaviour( "+GROUPENHANCE", 40 );
AddBehaviour( "+ENHANCESING", 40 );
AddBehaviour( "+ENHANCESELF", 40 );
AddBehaviour( "+FEATENHANCE", 40 );
AddBehaviour( "+DISPEL", 40 );
AddBehaviour( "+DISPELAOE", 40 );
AddBehaviour( "+DISMISSAL", 40 );
AddBehaviour( "+TURN", 40 );
AddBehaviour( "+AREA", 40 );
AddBehaviour( "+DIRECT", 40 );
AddBehaviour( "+TOUCH", 40 );
AddBehaviour( "+EVACAOE", 50 );
AddBehaviour( "+ATKMELEE", 100 );
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
/*
if ( GetRacialType( OBJECT_SELF ) != RACIAL_TYPE_UNDEAD && GetStringLeft( GetTag( OBJECT_SELF ), 6 ) != "NO_AI_" &&
GetName( GetItemInSlot( INVENTORY_SLOT_CARMOUR, OBJECT_SELF ) ) != "Gargoyle Properties" )
{
//not summoned, not undead, default decay time
SetIsDestroyable( FALSE, TRUE, TRUE );
SetLocalFloat( OBJECT_SELF, "#DECAYDELAY", 60.0 ); //default corpse decay time
}
*/
/*
SetListening( OBJECT_SELF, TRUE );
SetListenPattern( OBJECT_SELF, "BC_DEAD", 691 );
SetListenPattern( OBJECT_SELF, "BC_FIGHTING", 699 );
*/
if ( GetName( GetItemInSlot( INVENTORY_SLOT_CARMOUR, OBJECT_SELF ) ) == "Balor Properties" )
{
SetLocalInt( OBJECT_SELF, "BALORDEATH", 1 );
}
if ( GetRacialType( OBJECT_SELF ) == RACIAL_TYPE_DRAGON )
{
SetLocalInt( OBJECT_SELF, "FLIER", 1 );
}
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//set response range for fighting broadcast
SetResponseRange( BC_FIGHTING, 50.0 );
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature
}

View File

@@ -0,0 +1,135 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+REGROUP", 40 ); //regroup
AddBehaviour( "+FLANK", 10 ); //flank
AddBehaviour( "+AVOIDMELEE", 10 ); //avoid melee
AddBehaviour( "+EVACAOE", 20 ); //evac AOEs
AddBehaviour( "+SUMMON", 20 ); //summon spells
AddBehaviour( "+HELP", 40 ); //help
AddBehaviour( "+VIS", 40 ); //vision
AddBehaviour( "+DEFSING", 10 ); //defend single
AddBehaviour( "+DEFSELF", 10 ); //defend self
AddBehaviour( "+GROUPENHANCE", 10 ); //enhance group
AddBehaviour( "+ENHANCESING", 10 ); //enhance single
AddBehaviour( "+ENHANCESELF", 10 ); //enhance self
AddBehaviour( "+FEATENHANCE", 10 ); //enhance self via feats
AddBehaviour( "+DISPEL", 10 ); //dispel single
AddBehaviour( "+DISPELAOE", 10 ); //dispel AOEs
AddBehaviour( "+DISMISSAL", 10 ); //dismiss summons
AddBehaviour( "+BREACH", 10 ); //breach
AddBehaviour( "+TIMESTOP", 10 ); //time stop
AddBehaviour( "+AREA", 25 ); //area attack spells
AddBehaviour( "+DIRECT", 20 ); //direct attack spells
AddBehaviour( "+TOUCH", 20 ); //touch attack spells
//AddBehaviour( "+MELEEASSIST", 50 ); //assist allies in melee
//AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
//CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

123
_module/nss/no_spn_ftr.nss Normal file
View File

@@ -0,0 +1,123 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+FEATENHANCE", 80 ); //enhance self via feats
AddBehaviour( "+REGROUP", 80 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
AddBehaviour( "+MELEEASSIST", 100 ); //assist allies in melee
AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//set response range for fighting broadcast
SetResponseRange( BC_FIGHTING, 50.0 );
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
//ExecuteScript( "scalesize", OBJECT_SELF );
DelayCommand(2.0, ExecuteScript( "random_drop", OBJECT_SELF ));
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
//CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

View File

@@ -0,0 +1,123 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+FEATENHANCE", 80 ); //enhance self via feats
AddBehaviour( "+REGROUP", 80 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
AddBehaviour( "+MELEEASSIST", 100 ); //assist allies in melee
AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//set response range for fighting broadcast
SetResponseRange( BC_FIGHTING, 50.0 );
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
ExecuteScript( "scalesize", OBJECT_SELF );
DelayCommand(2.0, ExecuteScript( "random_drop", OBJECT_SELF ));
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
//CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

View File

@@ -0,0 +1,123 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+FEATENHANCE", 80 ); //enhance self via feats
AddBehaviour( "+REGROUP", 80 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
AddBehaviour( "+MELEEASSIST", 100 ); //assist allies in melee
AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//set response range for fighting broadcast
SetResponseRange( BC_FIGHTING, 50.0 );
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
ExecuteScript( "scalesize", OBJECT_SELF );
DelayCommand(2.0, ExecuteScript( "random_drop", OBJECT_SELF ));
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
//CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

View File

@@ -0,0 +1,123 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+FEATENHANCE", 80 ); //enhance self via feats
AddBehaviour( "+REGROUP", 80 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
AddBehaviour( "+MELEEASSIST", 100 ); //assist allies in melee
AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//set response range for fighting broadcast
SetResponseRange( BC_FIGHTING, 50.0 );
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
ExecuteScript( "scalesize", OBJECT_SELF );
ExecuteScript( "watervfx", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
DelayCommand(2.0, ExecuteScript( "random_drop", OBJECT_SELF ));
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
//CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

View File

@@ -0,0 +1,136 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+REGROUP", 40 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
//AddBehaviour( "+AVOIDMELEE", 20 ); //avoid melee
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
//AddBehaviour( "+SUMMON", 60 ); //summon spells
AddBehaviour( "+HELP", 40 ); //help
AddBehaviour( "+VIS", 40 ); //vision
AddBehaviour( "+DEFSING", 20 ); //defend single
AddBehaviour( "+DEFSELF", 20 ); //defend self
AddBehaviour( "+GROUPENHANCE", 20 ); //enhance group
AddBehaviour( "+ENHANCESING", 20 ); //enhance single
AddBehaviour( "+ENHANCESELF", 20 ); //enhance self
AddBehaviour( "+FEATENHANCE", 20 ); //enhance self via feats
//AddBehaviour( "+DISPEL", 40 ); //dispel single
//AddBehaviour( "+DISPELAOE", 40 ); //dispel AOEs
//AddBehaviour( "+DISMISSAL", 40 ); //dismiss summons
//AddBehaviour( "+BREACH", 40 ); //breach
//AddBehaviour( "+TIMESTOP", 20 ); //time stop
AddBehaviour( "+AREA", 20 ); //area attack spells
AddBehaviour( "+BREATH", 40 ); //area attack spells
AddBehaviour( "+DIRECT", 20 ); //direct attack spells
AddBehaviour( "+TOUCH", 20 ); //touch attack spells
AddBehaviour( "+MELEEASSIST", 50 ); //assist allies in melee
//AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

View File

@@ -0,0 +1,136 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+REGROUP", 40 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
//AddBehaviour( "+AVOIDMELEE", 20 ); //avoid melee
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
//AddBehaviour( "+SUMMON", 60 ); //summon spells
AddBehaviour( "+HELP", 40 ); //help
AddBehaviour( "+VIS", 40 ); //vision
AddBehaviour( "+DEFSING", 20 ); //defend single
AddBehaviour( "+DEFSELF", 20 ); //defend self
AddBehaviour( "+GROUPENHANCE", 20 ); //enhance group
AddBehaviour( "+ENHANCESING", 20 ); //enhance single
AddBehaviour( "+ENHANCESELF", 20 ); //enhance self
AddBehaviour( "+FEATENHANCE", 20 ); //enhance self via feats
AddBehaviour( "+DISPEL", 20 ); //dispel single
AddBehaviour( "+DISPELAOE", 20 ); //dispel AOEs
//AddBehaviour( "+DISMISSAL", 40 ); //dismiss summons
//AddBehaviour( "+BREACH", 40 ); //breach
//AddBehaviour( "+TIMESTOP", 20 ); //time stop
AddBehaviour( "+AREA", 20 ); //area attack spells
AddBehaviour( "+BREATH", 40 ); //area attack spells
AddBehaviour( "+DIRECT", 20 ); //direct attack spells
AddBehaviour( "+TOUCH", 20 ); //touch attack spells
AddBehaviour( "+MELEEASSIST", 50 ); //assist allies in melee
//AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

View File

@@ -0,0 +1,136 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+REGROUP", 40 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
//AddBehaviour( "+AVOIDMELEE", 20 ); //avoid melee
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
AddBehaviour( "+SUMMON", 60 ); //summon spells
AddBehaviour( "+HELP", 40 ); //help
AddBehaviour( "+VIS", 40 ); //vision
AddBehaviour( "+DEFSING", 20 ); //defend single
AddBehaviour( "+DEFSELF", 20 ); //defend self
AddBehaviour( "+GROUPENHANCE", 20 ); //enhance group
AddBehaviour( "+ENHANCESING", 20 ); //enhance single
AddBehaviour( "+ENHANCESELF", 20 ); //enhance self
AddBehaviour( "+FEATENHANCE", 20 ); //enhance self via feats
AddBehaviour( "+DISPEL", 20 ); //dispel single
AddBehaviour( "+DISPELAOE", 20 ); //dispel AOEs
AddBehaviour( "+DISMISSAL", 20 ); //dismiss summons
AddBehaviour( "+BREACH", 20 ); //breach
AddBehaviour( "+TIMESTOP", 20 ); //time stop
AddBehaviour( "+AREA", 20 ); //area attack spells
AddBehaviour( "+BREATH", 40 ); //area attack spells
AddBehaviour( "+DIRECT", 20 ); //direct attack spells
AddBehaviour( "+TOUCH", 20 ); //touch attack spells
AddBehaviour( "+MELEEASSIST", 50 ); //assist allies in melee
//AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

View File

@@ -0,0 +1,136 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+REGROUP", 40 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
//AddBehaviour( "+AVOIDMELEE", 20 ); //avoid melee
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
//AddBehaviour( "+SUMMON", 60 ); //summon spells
//AddBehaviour( "+HELP", 40 ); //help
AddBehaviour( "+VIS", 40 ); //vision
AddBehaviour( "+DEFSING", 40 ); //defend single
AddBehaviour( "+DEFSELF", 40 ); //defend self
AddBehaviour( "+GROUPENHANCE", 40 ); //enhance group
AddBehaviour( "+ENHANCESING", 40 ); //enhance single
AddBehaviour( "+ENHANCESELF", 40 ); //enhance self
AddBehaviour( "+FEATENHANCE", 40 ); //enhance self via feats
//AddBehaviour( "+DISPEL", 40 ); //dispel single
//AddBehaviour( "+DISPELAOE", 40 ); //dispel AOEs
//AddBehaviour( "+DISMISSAL", 40 ); //dismiss summons
//AddBehaviour( "+BREACH", 40 ); //breach
//AddBehaviour( "+TIMESTOP", 20 ); //time stop
//AddBehaviour( "+AREA", 80 ); //area attack spells
//AddBehaviour( "+BREATH", 40 ); //area attack spells
//AddBehaviour( "+DIRECT", 80 ); //direct attack spells
//AddBehaviour( "+TOUCH", 80 ); //touch attack spells
AddBehaviour( "+MELEEASSIST", 50 ); //assist allies in melee
//AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

121
_module/nss/no_spn_rftr.nss Normal file
View File

@@ -0,0 +1,121 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+FEATENHANCE", 80 ); //enhance self via feats
AddBehaviour( "+REGROUP", 80 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
AddBehaviour( "+MELEEASSIST", 100 ); //assist allies in melee
AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//set response range for fighting broadcast
SetResponseRange( BC_FIGHTING, 50.0 );
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

View File

@@ -0,0 +1,136 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+REGROUP", 40 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
//AddBehaviour( "+AVOIDMELEE", 20 ); //avoid melee
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
//AddBehaviour( "+SUMMON", 60 ); //summon spells
AddBehaviour( "+HELP", 40 ); //help
AddBehaviour( "+VIS", 40 ); //vision
AddBehaviour( "+DEFSING", 40 ); //defend single
AddBehaviour( "+DEFSELF", 40 ); //defend self
AddBehaviour( "+GROUPENHANCE", 40 ); //enhance group
AddBehaviour( "+ENHANCESING", 40 ); //enhance single
AddBehaviour( "+ENHANCESELF", 40 ); //enhance self
AddBehaviour( "+FEATENHANCE", 40 ); //enhance self via feats
//AddBehaviour( "+DISPEL", 40 ); //dispel single
//AddBehaviour( "+DISPELAOE", 40 ); //dispel AOEs
//AddBehaviour( "+DISMISSAL", 40 ); //dismiss summons
//AddBehaviour( "+BREACH", 40 ); //breach
//AddBehaviour( "+TIMESTOP", 20 ); //time stop
AddBehaviour( "+AREA", 80 ); //area attack spells
AddBehaviour( "+BREATH", 40 ); //area attack spells
AddBehaviour( "+DIRECT", 80 ); //direct attack spells
AddBehaviour( "+TOUCH", 80 ); //touch attack spells
AddBehaviour( "+MELEEASSIST", 50 ); //assist allies in melee
AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

View File

@@ -0,0 +1,136 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+AVOIDMELEE", 80 ); //avoid melee
AddBehaviour( "+REGROUP", 40 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
AddBehaviour( "+SUMMON", 60 ); //summon spells
AddBehaviour( "+HELP", 40 ); //help
AddBehaviour( "+VIS", 40 ); //vision
AddBehaviour( "+DEFSING", 20 ); //defend single
AddBehaviour( "+DEFSELF", 20 ); //defend self
AddBehaviour( "+GROUPENHANCE", 20 ); //enhance group
AddBehaviour( "+ENHANCESING", 20 ); //enhance single
AddBehaviour( "+ENHANCESELF", 20 ); //enhance self
AddBehaviour( "+FEATENHANCE", 20 ); //enhance self via feats
AddBehaviour( "+DISPEL", 20 ); //dispel single
AddBehaviour( "+DISPELAOE", 20 ); //dispel AOEs
AddBehaviour( "+DISMISSAL", 20 ); //dismiss summons
AddBehaviour( "+BREACH", 20 ); //breach
AddBehaviour( "+TIMESTOP", 20 ); //time stop
AddBehaviour( "+AREA", 20 ); //area attack spells
AddBehaviour( "+BREATH", 40 ); //area attack spells
AddBehaviour( "+DIRECT", 20 ); //direct attack spells
AddBehaviour( "+TOUCH", 20 ); //touch attack spells
//AddBehaviour( "+MELEEASSIST", 50 ); //assist allies in melee
AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

122
_module/nss/no_spn_rog.nss Normal file
View File

@@ -0,0 +1,122 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+FEATENHANCE", 80 ); //enhance self via feats
AddBehaviour( "+REGROUP", 80 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
AddBehaviour( "+AREA", 60 ); //area attack spells
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
AddBehaviour( "+MELEEASSIST", 100 ); //assist allies in melee
AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//set response range for fighting broadcast
SetResponseRange( BC_FIGHTING, 50.0 );
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

View File

@@ -0,0 +1,136 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+REGROUP", 40 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
//AddBehaviour( "+AVOIDMELEE", 20 ); //avoid melee
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
//AddBehaviour( "+SUMMON", 60 ); //summon spells
AddBehaviour( "+HELP", 40 ); //help
AddBehaviour( "+VIS", 40 ); //vision
AddBehaviour( "+DEFSING", 40 ); //defend single
AddBehaviour( "+DEFSELF", 40 ); //defend self
AddBehaviour( "+GROUPENHANCE", 40 ); //enhance group
AddBehaviour( "+ENHANCESING", 40 ); //enhance single
AddBehaviour( "+ENHANCESELF", 40 ); //enhance self
AddBehaviour( "+FEATENHANCE", 40 ); //enhance self via feats
//AddBehaviour( "+DISPEL", 40 ); //dispel single
//AddBehaviour( "+DISPELAOE", 40 ); //dispel AOEs
//AddBehaviour( "+DISMISSAL", 40 ); //dismiss summons
//AddBehaviour( "+BREACH", 40 ); //breach
//AddBehaviour( "+TIMESTOP", 20 ); //time stop
AddBehaviour( "+AREA", 80 ); //area attack spells
AddBehaviour( "+BREATH", 40 ); //area attack spells
AddBehaviour( "+DIRECT", 80 ); //direct attack spells
AddBehaviour( "+TOUCH", 80 ); //touch attack spells
AddBehaviour( "+MELEEASSIST", 50 ); //assist allies in melee
AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

View File

@@ -0,0 +1,136 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+REGROUP", 40 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
//AddBehaviour( "+AVOIDMELEE", 20 ); //avoid melee
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
AddBehaviour( "+SUMMON", 60 ); //summon spells
AddBehaviour( "+HELP", 40 ); //help
AddBehaviour( "+VIS", 40 ); //vision
AddBehaviour( "+DEFSING", 20 ); //defend single
AddBehaviour( "+DEFSELF", 20 ); //defend self
AddBehaviour( "+GROUPENHANCE", 20 ); //enhance group
AddBehaviour( "+ENHANCESING", 20 ); //enhance single
AddBehaviour( "+ENHANCESELF", 20 ); //enhance self
AddBehaviour( "+FEATENHANCE", 20 ); //enhance self via feats
AddBehaviour( "+DISPEL", 20 ); //dispel single
AddBehaviour( "+DISPELAOE", 20 ); //dispel AOEs
AddBehaviour( "+DISMISSAL", 20 ); //dismiss summons
AddBehaviour( "+BREACH", 20 ); //breach
AddBehaviour( "+TIMESTOP", 20 ); //time stop
AddBehaviour( "+AREA", 20 ); //area attack spells
AddBehaviour( "+BREATH", 40 ); //area attack spells
AddBehaviour( "+DIRECT", 20 ); //direct attack spells
AddBehaviour( "+TOUCH", 20 ); //touch attack spells
AddBehaviour( "+MELEEASSIST", 50 ); //assist allies in melee
AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

View File

@@ -0,0 +1,136 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+REGROUP", 40 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
//AddBehaviour( "+AVOIDMELEE", 20 ); //avoid melee
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
//AddBehaviour( "+SUMMON", 60 ); //summon spells
//AddBehaviour( "+HELP", 40 ); //help
AddBehaviour( "+VIS", 40 ); //vision
AddBehaviour( "+DEFSING", 40 ); //defend single
AddBehaviour( "+DEFSELF", 40 ); //defend self
AddBehaviour( "+GROUPENHANCE", 40 ); //enhance group
AddBehaviour( "+ENHANCESING", 40 ); //enhance single
AddBehaviour( "+ENHANCESELF", 40 ); //enhance self
AddBehaviour( "+FEATENHANCE", 40 ); //enhance self via feats
//AddBehaviour( "+DISPEL", 40 ); //dispel single
//AddBehaviour( "+DISPELAOE", 40 ); //dispel AOEs
//AddBehaviour( "+DISMISSAL", 40 ); //dismiss summons
//AddBehaviour( "+BREACH", 40 ); //breach
//AddBehaviour( "+TIMESTOP", 20 ); //time stop
//AddBehaviour( "+AREA", 80 ); //area attack spells
//AddBehaviour( "+BREATH", 40 ); //area attack spells
//AddBehaviour( "+DIRECT", 80 ); //direct attack spells
//AddBehaviour( "+TOUCH", 80 ); //touch attack spells
AddBehaviour( "+MELEEASSIST", 50 ); //assist allies in melee
//AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creatureed Event 1007
}

View File

@@ -0,0 +1,125 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+FEATENHANCE", 80 ); //enhance self via feats
AddBehaviour( "+REGROUP", 80 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
AddBehaviour( "+AREA", 60 ); //area attack spells
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
AddBehaviour( "+MELEEASSIST", 100 ); //assist allies in melee
AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//set response range for fighting broadcast
SetResponseRange( BC_FIGHTING, 50.0 );
//tell creature it is ready to act
//SetReadyStatus();
//flag as a teleport capable creature
SetIsTeleporter();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

136
_module/nss/no_spn_summ.nss Normal file
View File

@@ -0,0 +1,136 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+REGROUP", 40 ); //regroup
AddBehaviour( "+FLANK", 20 ); //flank
AddBehaviour( "+AVOIDMELEE", 20 ); //avoid melee
AddBehaviour( "+EVACAOE", 50 ); //evac AOEs
AddBehaviour( "+SUMMON", 60 ); //summon spells
AddBehaviour( "+HELP", 40 ); //help
AddBehaviour( "+VIS", 40 ); //vision
AddBehaviour( "+DEFSING", 40 ); //defend single
AddBehaviour( "+DEFSELF", 40 ); //defend self
AddBehaviour( "+GROUPENHANCE", 40 ); //enhance group
AddBehaviour( "+ENHANCESING", 40 ); //enhance single
AddBehaviour( "+ENHANCESELF", 40 ); //enhance self
AddBehaviour( "+FEATENHANCE", 40 ); //enhance self via feats
AddBehaviour( "+DISPEL", 40 ); //dispel single
AddBehaviour( "+DISPELAOE", 40 ); //dispel AOEs
AddBehaviour( "+DISMISSAL", 40 ); //dismiss summons
AddBehaviour( "+BREACH", 40 ); //breach
AddBehaviour( "+TIMESTOP", 20 ); //time stop
AddBehaviour( "+AREA", 80 ); //area attack spells
AddBehaviour( "+BREATH", 40 ); //area attack spells
AddBehaviour( "+DIRECT", 80 ); //direct attack spells
AddBehaviour( "+TOUCH", 80 ); //touch attack spells
AddBehaviour( "+MELEEASSIST", 50 ); //assist allies in melee
AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
AddBehaviour( "+ATKMELEE", 100 ); //melee attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

136
_module/nss/no_spn_wiz.nss Normal file
View File

@@ -0,0 +1,136 @@
//::///////////////////////////////////////////////
//:: On Spawn In
//::
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
#include "no_lib_data"
#include "no_inc"
#include "nw_o2_coninclude"
#include "x0_i0_treasure"
void main()
{
//Behaviour config
AddBehaviour( "+AVOIDMELEE", 50 ); //avoid melee
AddBehaviour( "+EVACAOE", 80 ); //evac AOEs
AddBehaviour( "+HEALSELF", 100 ); //heal self
AddBehaviour( "+REGROUP", 20 ); //regroup
AddBehaviour( "+SUMMON", 50 ); //summon spells
AddBehaviour( "+HELP", 50 ); //help
AddBehaviour( "+VIS", 50 ); //vision
AddBehaviour( "+DEFSELF", 10 ); //defend self
AddBehaviour( "+DEFSING", 5 ); //defend single
AddBehaviour( "+ENHANCESELF", 10 ); //enhance self
AddBehaviour( "+GROUPENHANCE", 5 ); //enhance group
AddBehaviour( "+ENHANCESING", 5 ); //enhance single
AddBehaviour( "+FEATENHANCE", 10 ); //enhance self via feats
AddBehaviour( "+DISPEL", 10 ); //dispel single
AddBehaviour( "+DISPELAOE", 10 ); //dispel AOEs
AddBehaviour( "+DISMISSAL", 10 ); //dismiss summons
AddBehaviour( "+BREACH", 10 ); //breach
AddBehaviour( "+TIMESTOP", 20 ); //time stop
AddBehaviour( "+AREA", 80 ); //area attack spells
AddBehaviour( "+DIRECT", 80 ); //direct attack spells
AddBehaviour( "+TOUCH", 80 ); //touch attack spells
AddBehaviour( "+ATKRANGED", 100 ); //ranged attack
//Other config
//Corpse decay set up and exclusions
SetCorpseDelay();
//Set whether the creature can use EffectDisappearAppear when moving
SetIsFlier();
if ( GetIsObjectValid( GetMaster( OBJECT_SELF ) ) )
{
//I am probably a summoned creature, possibly a henchman
SetAssociateListenPatterns();
}
//set voice chat config
SetVoiceChat( NO_VC_DEFAULT, 10 );
//configure perception ranges
SetPerceptionRanges();
//set response range for fighting broadcast
SetResponseRange( BC_FIGHTING, 50.0 );
//tell creature it is ready to act
//SetReadyStatus();
//set fastbuffer status, should always be left on
SetIsFastBuffer( TRUE );
//SetLocalInt( OBJECT_SELF, "#FASTBUFFER", 1 );
//SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 );
//log starting location
ExecuteScript( "no_scr_logspnloc", OBJECT_SELF );
//log loaded melee weapons
ExecuteScript( "no_scr_logeq", OBJECT_SELF );
DelayCommand(2.0, ExecuteScript( "random_drop", OBJECT_SELF ));
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking
//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
//CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); //* Use this to create a small amount of treasure on the creature
}

View File

@@ -0,0 +1,107 @@
//:://////////////////////////////////////////////////
//:: NW_C2_DEFAULT1
/*
Default OnHeartbeat script for NPCs.
This script causes NPCs to perform default animations
while not otherwise engaged.
This script duplicates the behavior of the default
script and just cleans up the code and removes
redundant conditional checks.
*/
//:://////////////////////////////////////////////////
//:: Copyright (c) 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 12/22/2002
//:://////////////////////////////////////////////////
#include "nw_i0_generic"
void main()
{
// * if not runnning normal or better Ai then exit for performance reasons
if (GetAILevel() == AI_LEVEL_VERY_LOW) return;
//ExecuteScript("prc_npc_hb", OBJECT_SELF);
// Buff ourselves up right away if we should
if(GetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY))
{
// This will return TRUE if an enemy was within 40.0 m
// and we buffed ourselves up instantly to respond --
// simulates a spellcaster with protections enabled
// already.
if(TalentAdvancedBuff(40.0))
{
// This is a one-shot deal
SetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY, FALSE);
// This return means we skip sending the user-defined
// heartbeat signal in this one case.
return;
}
}
if(GetHasEffect(EFFECT_TYPE_SLEEP))
{
// If we're asleep and this is the result of sleeping
// at night, apply the floating 'z's visual effect
// every so often
if(GetSpawnInCondition(NW_FLAG_SLEEPING_AT_NIGHT))
{
effect eVis = EffectVisualEffect(VFX_IMP_SLEEP);
if(d10() > 6)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
}
}
}
// If we have the 'constant' waypoints flag set, walk to the next
// waypoint.
else if ( GetWalkCondition(NW_WALK_FLAG_CONSTANT) )
{
WalkWayPoints();
}
// Check to see if we should be playing default animations
// - make sure we don't have any current targets
else if ( !GetIsObjectValid(GetAttemptedAttackTarget())
&& !GetIsObjectValid(GetAttemptedSpellTarget())
// && !GetIsPostOrWalking())
&& !GetIsObjectValid(GetNearestSeenEnemy()))
{
if (GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL) || GetBehaviorState(NW_FLAG_BEHAVIOR_OMNIVORE) ||
GetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE))
{
// This handles special attacking/fleeing behavior
// for omnivores & herbivores.
DetermineSpecialBehavior();
}
else if (!IsInConversation(OBJECT_SELF))
{
if (GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS)
|| GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN)
|| GetIsEncounterCreature())
{
PlayMobileAmbientAnimations();
}
else if (GetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS))
{
PlayImmobileAmbientAnimations();
}
}
}
// Send the user-defined event signal if specified
if(GetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT))
{
SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_HEARTBEAT));
}
}

View File

@@ -0,0 +1,19 @@
//::///////////////////////////////////////////////
//:: Default: On User Defined
//:: NW_C2_DEFAULTD
//:: Copyright (c) 2002 Bioware Corp.
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
on a user defined event.
*/
//:://////////////////////////////////////////////
//:: Created By: Don Moar
//:: Created On: April 28, 2002
//:://////////////////////////////////////////////
void main()
{
// enter desired behaviour here
//ExecuteScript("prc_onuserdef", OBJECT_SELF);
}

View File

@@ -0,0 +1,327 @@
//:://////////////////////////////////////////////////
//:: NW_C2_DEFAULT9
/*
* Default OnSpawn handler with XP1 revisions.
* This corresponds to and produces the same results
* as the default OnSpawn handler in the OC.
*
* This can be used to customize creature behavior in three main ways:
*
* - Uncomment the existing lines of code to activate certain
* common desired behaviors from the moment when the creature
* spawns in.
*
* - Uncomment the user-defined event signals to cause the
* creature to fire events that you can then handle with
* a custom OnUserDefined event handler script.
*
* - Add new code _at the end_ to alter the initial
* behavior in a more customized way.
*/
//:://////////////////////////////////////////////////
//:: Copyright (c) 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 12/11/2002
//:://////////////////////////////////////////////////
//:: Updated 2003-08-20 Georg Zoeller: Added check for variables to active spawn in conditions without changing the spawnscript
#include "x0_i0_anims"
// #include "x0_i0_walkway" - in x0_i0_anims
#include "x0_i0_treasure"
#include "x2_inc_switches"
void main()
{
// ***** Spawn-In Conditions ***** //
// * REMOVE COMMENTS (// ) before the "Set..." functions to activate
// * them. Do NOT touch lines commented out with // *, those are
// * real comments for information.
// * This causes the creature to say a one-line greeting in their
// * conversation file upon perceiving the player. Put [NW_D2_GenCheck]
// * in the "Text Seen When" field of the greeting in the conversation
// * file. Don't attach any player responses.
// *
// SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
// * Same as above, but for hostile creatures to make them say
// * a line before attacking.
// *
SetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY);
// * This NPC will attack when its allies call for help
// *
// SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// * If the NPC has the Hide skill they will go into stealth mode
// * while doing WalkWayPoints().
// *
// SetSpawnInCondition(NW_FLAG_STEALTH);
//--------------------------------------------------------------------------
// Enable stealth mode by setting a variable on the creature
// Great for ambushes
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_STEALTH) == TRUE)
{
SetSpawnInCondition(NW_FLAG_STEALTH);
}
// * Same, but for Search mode
// *
// SetSpawnInCondition(NW_FLAG_SEARCH);
//--------------------------------------------------------------------------
// Make creature enter search mode after spawning by setting a variable
// Great for guards, etc
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_SEARCH) == TRUE)
{
SetSpawnInCondition(NW_FLAG_SEARCH);
}
// * This will set the NPC to give a warning to non-enemies
// * before attacking.
// * NN -- no clue what this really does yet
// *
// SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// * Separate the NPC's waypoints into day & night.
// * See comment on WalkWayPoints() for use.
// *
// SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
// * If this is set, the NPC will appear using the "EffectAppear"
// * animation instead of fading in, *IF* SetListeningPatterns()
// * is called below.
// *
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
// * This will cause an NPC to use common animations it possesses,
// * and use social ones to any other nearby friendly NPCs.
// *
// SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
//--------------------------------------------------------------------------
// Enable immobile ambient animations by setting a variable
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_AMBIENT_IMMOBILE) == TRUE)
{
SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
}
// * Same as above, except NPC will wander randomly around the
// * area.
// *
// SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
//--------------------------------------------------------------------------
// Enable mobile ambient animations by setting a variable
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_AMBIENT) == TRUE)
{
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
}
// **** Animation Conditions **** //
// * These are extra conditions you can put on creatures with ambient
// * animations.
// * Civilized creatures interact with placeables in
// * their area that have the tag "NW_INTERACTIVE"
// * and "talk" to each other.
// *
// * Humanoid races are civilized by default, so only
// * set this flag for monster races that you want to
// * behave the same way.
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
// * If this flag is set, this creature will constantly
// * be acting. Otherwise, creatures will only start
// * performing their ambient animations when they
// * first perceive a player, and they will stop when
// * the player moves away.
// SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// * Civilized creatures with this flag set will
// * randomly use a few voicechats. It's a good
// * idea to avoid putting this on multiple
// * creatures using the same voiceset.
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// * Creatures with _immobile_ ambient animations
// * can have this flag set to make them mobile in a
// * close range. They will never leave their immediate
// * area, but will move around in it, frequently
// * returning to their starting point.
// *
// * Note that creatures spawned inside interior areas
// * that contain a waypoint with one of the tags
// * "NW_HOME", "NW_TAVERN", "NW_SHOP" will automatically
// * have this condition set.
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
// **** Special Combat Tactics *****//
// * These are special flags that can be set on creatures to
// * make them follow certain specialized combat tactics.
// * NOTE: ONLY ONE OF THESE SHOULD BE SET ON A SINGLE CREATURE.
// * Ranged attacker
// * Will attempt to stay at ranged distance from their
// * target.
// SetCombatCondition(X0_COMBAT_FLAG_RANGED);
// * Defensive attacker
// * Will use defensive combat feats and parry
// SetCombatCondition(X0_COMBAT_FLAG_DEFENSIVE);
// * Ambusher
// * Will go stealthy/invisible and attack, then
// * run away and try to go stealthy again before
// * attacking anew.
// SetCombatCondition(X0_COMBAT_FLAG_AMBUSHER);
// * Cowardly
// * Cowardly creatures will attempt to flee
// * attackers.
// SetCombatCondition(X0_COMBAT_FLAG_COWARDLY);
// **** Escape Commands ***** //
// * NOTE: ONLY ONE OF THE FOLLOWING SHOULD EVER BE SET AT ONE TIME.
// * NOTE2: Not clear that these actually work. -- NN
// * Flee to a way point and return a short time later.
// *
// SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN);
// * Flee to a way point and do not return.
// *
// SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE);
// * Teleport to safety and do not return.
// *
// SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE);
// * Teleport to safety and return a short time later.
// *
// SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN);
// ***** CUSTOM USER DEFINED EVENTS ***** /
/*
If you uncomment any of these conditions, the creature will fire
a specific user-defined event number on each event. That will then
allow you to write custom code in the "OnUserDefinedEvent" handler
script to go on top of the default NPC behaviors for that event.
Example: I want to add some custom behavior to my NPC when they
are damaged. I uncomment the "NW_FLAG_DAMAGED_EVENT", then create
a new user-defined script that has something like this in it:
if (GetUserDefinedEventNumber() == 1006) {
// Custom code for my NPC to execute when it's damaged
}
These user-defined events are in the range 1001-1007.
*/
// * Fire User Defined Event 1001 in the OnHeartbeat
// *
// SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT);
// * Fire User Defined Event 1002
// *
// SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT);
// * Fire User Defined Event 1005
// *
// SetSpawnInCondition(NW_FLAG_ATTACK_EVENT);
// * Fire User Defined Event 1006
// *
SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT);
// * Fire User Defined Event 1008
// *
// SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT);
// * Fire User Defined Event 1003
// *
// SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT);
// * Fire User Defined Event 1004
// *
// SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT);
// ***** DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***** //
// * Goes through and sets up which shouts the NPC will listen to.
// *
SetListeningPatterns();
// * Walk among a set of waypoints.
// * 1. Find waypoints with the tag "WP_" + NPC TAG + "_##" and walk
// * among them in order.
// * 2. If the tag of the Way Point is "POST_" + NPC TAG, stay there
// * and return to it after combat.
//
// * Optional Parameters:
// * void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
//
// * If "NW_FLAG_DAY_NIGHT_POSTING" is set above, you can also
// * create waypoints with the tags "WN_" + NPC Tag + "_##"
// * and those will be walked at night. (The standard waypoints
// * will be walked during the day.)
// * The night "posting" waypoint tag is simply "NIGHT_" + NPC tag.
WalkWayPoints();
//* Create a small amount of treasure on the creature
if ((GetLocalInt(GetModule(), "X2_L_NOTREASURE") == FALSE) &&
(GetLocalInt(OBJECT_SELF, "X2_L_NOTREASURE") == FALSE) )
{
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF);
}
// ***** ADD ANY SPECIAL ON-SPAWN CODE HERE ***** //
// * If Incorporeal, apply changes
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_IS_INCORPOREAL) == TRUE)
{
effect eConceal = EffectConcealment(50, MISS_CHANCE_TYPE_NORMAL);
eConceal = ExtraordinaryEffect(eConceal);
effect eGhost = EffectCutsceneGhost();
eGhost = ExtraordinaryEffect(eGhost);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eConceal, OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, OBJECT_SELF);
}
// * Give the create a random name.
// * If you create a script named x3_name_gen in your module, you can
// * set the value of the variable X3_S_RANDOM_NAME on OBJECT_SELF inside
// * the script to override the creature's default name.
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_RANDOMIZE_NAME) == TRUE)
{
ExecuteScript("x3_name_gen",OBJECT_SELF);
string sName = GetLocalString(OBJECT_SELF,"X3_S_RANDOM_NAME");
if ( sName == "" )
{
sName = RandomName();
}
SetName(OBJECT_SELF,sName);
}
ExecuteScript("prc_pwonspawn", OBJECT_SELF);
}

View File

@@ -0,0 +1,328 @@
//:://////////////////////////////////////////////////
//:: NW_C2_DEFAULT9
/*
* Default OnSpawn handler with XP1 revisions.
* This corresponds to and produces the same results
* as the default OnSpawn handler in the OC.
*
* This can be used to customize creature behavior in three main ways:
*
* - Uncomment the existing lines of code to activate certain
* common desired behaviors from the moment when the creature
* spawns in.
*
* - Uncomment the user-defined event signals to cause the
* creature to fire events that you can then handle with
* a custom OnUserDefined event handler script.
*
* - Add new code _at the end_ to alter the initial
* behavior in a more customized way.
*/
//:://////////////////////////////////////////////////
//:: Copyright (c) 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 12/11/2002
//:://////////////////////////////////////////////////
//:: Updated 2003-08-20 Georg Zoeller: Added check for variables to active spawn in conditions without changing the spawnscript
#include "x0_i0_anims"
// #include "x0_i0_walkway" - in x0_i0_anims
#include "x0_i0_treasure"
#include "x2_inc_switches"
void main()
{
// ***** Spawn-In Conditions ***** //
// * REMOVE COMMENTS (// ) before the "Set..." functions to activate
// * them. Do NOT touch lines commented out with // *, those are
// * real comments for information.
// * This causes the creature to say a one-line greeting in their
// * conversation file upon perceiving the player. Put [NW_D2_GenCheck]
// * in the "Text Seen When" field of the greeting in the conversation
// * file. Don't attach any player responses.
// *
// SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
// * Same as above, but for hostile creatures to make them say
// * a line before attacking.
// *
// SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// * This NPC will attack when its allies call for help
// *
// SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// * If the NPC has the Hide skill they will go into stealth mode
// * while doing WalkWayPoints().
// *
// SetSpawnInCondition(NW_FLAG_STEALTH);
//--------------------------------------------------------------------------
// Enable stealth mode by setting a variable on the creature
// Great for ambushes
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_STEALTH) == TRUE)
{
SetSpawnInCondition(NW_FLAG_STEALTH);
}
// * Same, but for Search mode
// *
// SetSpawnInCondition(NW_FLAG_SEARCH);
//--------------------------------------------------------------------------
// Make creature enter search mode after spawning by setting a variable
// Great for guards, etc
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_SEARCH) == TRUE)
{
SetSpawnInCondition(NW_FLAG_SEARCH);
}
// * This will set the NPC to give a warning to non-enemies
// * before attacking.
// * NN -- no clue what this really does yet
// *
// SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// * Separate the NPC's waypoints into day & night.
// * See comment on WalkWayPoints() for use.
// *
// SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
// * If this is set, the NPC will appear using the "EffectAppear"
// * animation instead of fading in, *IF* SetListeningPatterns()
// * is called below.
// *
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
// * This will cause an NPC to use common animations it possesses,
// * and use social ones to any other nearby friendly NPCs.
// *
// SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
//--------------------------------------------------------------------------
// Enable immobile ambient animations by setting a variable
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_AMBIENT_IMMOBILE) == TRUE)
{
SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
}
// * Same as above, except NPC will wander randomly around the
// * area.
// *
// SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
//--------------------------------------------------------------------------
// Enable mobile ambient animations by setting a variable
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_AMBIENT) == TRUE)
{
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
}
// **** Animation Conditions **** //
// * These are extra conditions you can put on creatures with ambient
// * animations.
// * Civilized creatures interact with placeables in
// * their area that have the tag "NW_INTERACTIVE"
// * and "talk" to each other.
// *
// * Humanoid races are civilized by default, so only
// * set this flag for monster races that you want to
// * behave the same way.
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
// * If this flag is set, this creature will constantly
// * be acting. Otherwise, creatures will only start
// * performing their ambient animations when they
// * first perceive a player, and they will stop when
// * the player moves away.
// SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// * Civilized creatures with this flag set will
// * randomly use a few voicechats. It's a good
// * idea to avoid putting this on multiple
// * creatures using the same voiceset.
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// * Creatures with _immobile_ ambient animations
// * can have this flag set to make them mobile in a
// * close range. They will never leave their immediate
// * area, but will move around in it, frequently
// * returning to their starting point.
// *
// * Note that creatures spawned inside interior areas
// * that contain a waypoint with one of the tags
// * "NW_HOME", "NW_TAVERN", "NW_SHOP" will automatically
// * have this condition set.
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
// **** Special Combat Tactics *****//
// * These are special flags that can be set on creatures to
// * make them follow certain specialized combat tactics.
// * NOTE: ONLY ONE OF THESE SHOULD BE SET ON A SINGLE CREATURE.
// * Ranged attacker
// * Will attempt to stay at ranged distance from their
// * target.
// SetCombatCondition(X0_COMBAT_FLAG_RANGED);
// * Defensive attacker
// * Will use defensive combat feats and parry
// SetCombatCondition(X0_COMBAT_FLAG_DEFENSIVE);
// * Ambusher
// * Will go stealthy/invisible and attack, then
// * run away and try to go stealthy again before
// * attacking anew.
// SetCombatCondition(X0_COMBAT_FLAG_AMBUSHER);
// * Cowardly
// * Cowardly creatures will attempt to flee
// * attackers.
// SetCombatCondition(X0_COMBAT_FLAG_COWARDLY);
// **** Escape Commands ***** //
// * NOTE: ONLY ONE OF THE FOLLOWING SHOULD EVER BE SET AT ONE TIME.
// * NOTE2: Not clear that these actually work. -- NN
// * Flee to a way point and return a short time later.
// *
// SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN);
// * Flee to a way point and do not return.
// *
// SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE);
// * Teleport to safety and do not return.
// *
// SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE);
// * Teleport to safety and return a short time later.
// *
// SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN);
// ***** CUSTOM USER DEFINED EVENTS ***** /
/*
If you uncomment any of these conditions, the creature will fire
a specific user-defined event number on each event. That will then
allow you to write custom code in the "OnUserDefinedEvent" handler
script to go on top of the default NPC behaviors for that event.
Example: I want to add some custom behavior to my NPC when they
are damaged. I uncomment the "NW_FLAG_DAMAGED_EVENT", then create
a new user-defined script that has something like this in it:
if (GetUserDefinedEventNumber() == 1006) {
// Custom code for my NPC to execute when it's damaged
}
These user-defined events are in the range 1001-1007.
*/
// * Fire User Defined Event 1001 in the OnHeartbeat
// *
// SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT);
// * Fire User Defined Event 1002
// *
// SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT);
// * Fire User Defined Event 1005
// *
// SetSpawnInCondition(NW_FLAG_ATTACK_EVENT);
// * Fire User Defined Event 1006
// *
SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT);
// * Fire User Defined Event 1008
// *
// SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT);
// * Fire User Defined Event 1003
// *
// SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT);
// * Fire User Defined Event 1004
// *
// SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT);
// ***** DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***** //
// * Goes through and sets up which shouts the NPC will listen to.
// *
SetListeningPatterns();
// * Walk among a set of waypoints.
// * 1. Find waypoints with the tag "WP_" + NPC TAG + "_##" and walk
// * among them in order.
// * 2. If the tag of the Way Point is "POST_" + NPC TAG, stay there
// * and return to it after combat.
//
// * Optional Parameters:
// * void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
//
// * If "NW_FLAG_DAY_NIGHT_POSTING" is set above, you can also
// * create waypoints with the tags "WN_" + NPC Tag + "_##"
// * and those will be walked at night. (The standard waypoints
// * will be walked during the day.)
// * The night "posting" waypoint tag is simply "NIGHT_" + NPC tag.
WalkWayPoints();
//* Create a small amount of treasure on the creature
if ((GetLocalInt(GetModule(), "X2_L_NOTREASURE") == FALSE) &&
(GetLocalInt(OBJECT_SELF, "X2_L_NOTREASURE") == FALSE) )
{
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF);
}
// ***** ADD ANY SPECIAL ON-SPAWN CODE HERE ***** //
// * If Incorporeal, apply changes
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_IS_INCORPOREAL) == TRUE)
{
effect eConceal = EffectConcealment(50, MISS_CHANCE_TYPE_NORMAL);
eConceal = ExtraordinaryEffect(eConceal);
effect eGhost = EffectCutsceneGhost();
eGhost = ExtraordinaryEffect(eGhost);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eConceal, OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, OBJECT_SELF);
}
// * Give the create a random name.
// * If you create a script named x3_name_gen in your module, you can
// * set the value of the variable X3_S_RANDOM_NAME on OBJECT_SELF inside
// * the script to override the creature's default name.
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_RANDOMIZE_NAME) == TRUE)
{
ExecuteScript("x3_name_gen",OBJECT_SELF);
string sName = GetLocalString(OBJECT_SELF,"X3_S_RANDOM_NAME");
if ( sName == "" )
{
sName = RandomName();
}
SetName(OBJECT_SELF,sName);
}
ExecuteScript("usecreatureweap", OBJECT_SELF);
ExecuteScript("prc_pwonspawn", OBJECT_SELF);
ExecuteScript("watervfx", OBJECT_SELF);
}

View File

@@ -0,0 +1,328 @@
//:://////////////////////////////////////////////////
//:: NW_C2_DEFAULT9
/*
* Default OnSpawn handler with XP1 revisions.
* This corresponds to and produces the same results
* as the default OnSpawn handler in the OC.
*
* This can be used to customize creature behavior in three main ways:
*
* - Uncomment the existing lines of code to activate certain
* common desired behaviors from the moment when the creature
* spawns in.
*
* - Uncomment the user-defined event signals to cause the
* creature to fire events that you can then handle with
* a custom OnUserDefined event handler script.
*
* - Add new code _at the end_ to alter the initial
* behavior in a more customized way.
*/
//:://////////////////////////////////////////////////
//:: Copyright (c) 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 12/11/2002
//:://////////////////////////////////////////////////
//:: Updated 2003-08-20 Georg Zoeller: Added check for variables to active spawn in conditions without changing the spawnscript
#include "x0_i0_anims"
// #include "x0_i0_walkway" - in x0_i0_anims
#include "x0_i0_treasure"
#include "x2_inc_switches"
void main()
{
// ***** Spawn-In Conditions ***** //
// * REMOVE COMMENTS (// ) before the "Set..." functions to activate
// * them. Do NOT touch lines commented out with // *, those are
// * real comments for information.
// * This causes the creature to say a one-line greeting in their
// * conversation file upon perceiving the player. Put [NW_D2_GenCheck]
// * in the "Text Seen When" field of the greeting in the conversation
// * file. Don't attach any player responses.
// *
// SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
// * Same as above, but for hostile creatures to make them say
// * a line before attacking.
// *
// SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// * This NPC will attack when its allies call for help
// *
// SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// * If the NPC has the Hide skill they will go into stealth mode
// * while doing WalkWayPoints().
// *
// SetSpawnInCondition(NW_FLAG_STEALTH);
//--------------------------------------------------------------------------
// Enable stealth mode by setting a variable on the creature
// Great for ambushes
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_STEALTH) == TRUE)
{
SetSpawnInCondition(NW_FLAG_STEALTH);
}
// * Same, but for Search mode
// *
// SetSpawnInCondition(NW_FLAG_SEARCH);
//--------------------------------------------------------------------------
// Make creature enter search mode after spawning by setting a variable
// Great for guards, etc
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_SEARCH) == TRUE)
{
SetSpawnInCondition(NW_FLAG_SEARCH);
}
// * This will set the NPC to give a warning to non-enemies
// * before attacking.
// * NN -- no clue what this really does yet
// *
// SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// * Separate the NPC's waypoints into day & night.
// * See comment on WalkWayPoints() for use.
// *
// SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
// * If this is set, the NPC will appear using the "EffectAppear"
// * animation instead of fading in, *IF* SetListeningPatterns()
// * is called below.
// *
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
// * This will cause an NPC to use common animations it possesses,
// * and use social ones to any other nearby friendly NPCs.
// *
// SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
//--------------------------------------------------------------------------
// Enable immobile ambient animations by setting a variable
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_AMBIENT_IMMOBILE) == TRUE)
{
SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
}
// * Same as above, except NPC will wander randomly around the
// * area.
// *
// SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
//--------------------------------------------------------------------------
// Enable mobile ambient animations by setting a variable
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_AMBIENT) == TRUE)
{
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
}
// **** Animation Conditions **** //
// * These are extra conditions you can put on creatures with ambient
// * animations.
// * Civilized creatures interact with placeables in
// * their area that have the tag "NW_INTERACTIVE"
// * and "talk" to each other.
// *
// * Humanoid races are civilized by default, so only
// * set this flag for monster races that you want to
// * behave the same way.
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
// * If this flag is set, this creature will constantly
// * be acting. Otherwise, creatures will only start
// * performing their ambient animations when they
// * first perceive a player, and they will stop when
// * the player moves away.
// SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// * Civilized creatures with this flag set will
// * randomly use a few voicechats. It's a good
// * idea to avoid putting this on multiple
// * creatures using the same voiceset.
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// * Creatures with _immobile_ ambient animations
// * can have this flag set to make them mobile in a
// * close range. They will never leave their immediate
// * area, but will move around in it, frequently
// * returning to their starting point.
// *
// * Note that creatures spawned inside interior areas
// * that contain a waypoint with one of the tags
// * "NW_HOME", "NW_TAVERN", "NW_SHOP" will automatically
// * have this condition set.
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
// **** Special Combat Tactics *****//
// * These are special flags that can be set on creatures to
// * make them follow certain specialized combat tactics.
// * NOTE: ONLY ONE OF THESE SHOULD BE SET ON A SINGLE CREATURE.
// * Ranged attacker
// * Will attempt to stay at ranged distance from their
// * target.
// SetCombatCondition(X0_COMBAT_FLAG_RANGED);
// * Defensive attacker
// * Will use defensive combat feats and parry
// SetCombatCondition(X0_COMBAT_FLAG_DEFENSIVE);
// * Ambusher
// * Will go stealthy/invisible and attack, then
// * run away and try to go stealthy again before
// * attacking anew.
// SetCombatCondition(X0_COMBAT_FLAG_AMBUSHER);
// * Cowardly
// * Cowardly creatures will attempt to flee
// * attackers.
// SetCombatCondition(X0_COMBAT_FLAG_COWARDLY);
// **** Escape Commands ***** //
// * NOTE: ONLY ONE OF THE FOLLOWING SHOULD EVER BE SET AT ONE TIME.
// * NOTE2: Not clear that these actually work. -- NN
// * Flee to a way point and return a short time later.
// *
// SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN);
// * Flee to a way point and do not return.
// *
// SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE);
// * Teleport to safety and do not return.
// *
// SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE);
// * Teleport to safety and return a short time later.
// *
// SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN);
// ***** CUSTOM USER DEFINED EVENTS ***** /
/*
If you uncomment any of these conditions, the creature will fire
a specific user-defined event number on each event. That will then
allow you to write custom code in the "OnUserDefinedEvent" handler
script to go on top of the default NPC behaviors for that event.
Example: I want to add some custom behavior to my NPC when they
are damaged. I uncomment the "NW_FLAG_DAMAGED_EVENT", then create
a new user-defined script that has something like this in it:
if (GetUserDefinedEventNumber() == 1006) {
// Custom code for my NPC to execute when it's damaged
}
These user-defined events are in the range 1001-1007.
*/
// * Fire User Defined Event 1001 in the OnHeartbeat
// *
// SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT);
// * Fire User Defined Event 1002
// *
// SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT);
// * Fire User Defined Event 1005
// *
// SetSpawnInCondition(NW_FLAG_ATTACK_EVENT);
// * Fire User Defined Event 1006
// *
SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT);
// * Fire User Defined Event 1008
// *
// SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT);
// * Fire User Defined Event 1003
// *
// SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT);
// * Fire User Defined Event 1004
// *
// SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT);
// ***** DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***** //
// * Goes through and sets up which shouts the NPC will listen to.
// *
SetListeningPatterns();
// * Walk among a set of waypoints.
// * 1. Find waypoints with the tag "WP_" + NPC TAG + "_##" and walk
// * among them in order.
// * 2. If the tag of the Way Point is "POST_" + NPC TAG, stay there
// * and return to it after combat.
//
// * Optional Parameters:
// * void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
//
// * If "NW_FLAG_DAY_NIGHT_POSTING" is set above, you can also
// * create waypoints with the tags "WN_" + NPC Tag + "_##"
// * and those will be walked at night. (The standard waypoints
// * will be walked during the day.)
// * The night "posting" waypoint tag is simply "NIGHT_" + NPC tag.
WalkWayPoints();
//* Create a small amount of treasure on the creature
if ((GetLocalInt(GetModule(), "X2_L_NOTREASURE") == FALSE) &&
(GetLocalInt(OBJECT_SELF, "X2_L_NOTREASURE") == FALSE) )
{
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF);
}
// ***** ADD ANY SPECIAL ON-SPAWN CODE HERE ***** //
// * If Incorporeal, apply changes
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_IS_INCORPOREAL) == TRUE)
{
effect eConceal = EffectConcealment(50, MISS_CHANCE_TYPE_NORMAL);
eConceal = ExtraordinaryEffect(eConceal);
effect eGhost = EffectCutsceneGhost();
eGhost = ExtraordinaryEffect(eGhost);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eConceal, OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, OBJECT_SELF);
}
// * Give the create a random name.
// * If you create a script named x3_name_gen in your module, you can
// * set the value of the variable X3_S_RANDOM_NAME on OBJECT_SELF inside
// * the script to override the creature's default name.
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_RANDOMIZE_NAME) == TRUE)
{
ExecuteScript("x3_name_gen",OBJECT_SELF);
string sName = GetLocalString(OBJECT_SELF,"X3_S_RANDOM_NAME");
if ( sName == "" )
{
sName = RandomName();
}
SetName(OBJECT_SELF,sName);
}
//ExecuteScript("prc_pwonspawn", OBJECT_SELF);
ExecuteScript("watervfx", OBJECT_SELF);
}

View File

@@ -29,5 +29,5 @@ void main()
// ***** ADD ANY SPECIAL ON-SPAWN CODE HERE ***** //
DelayCommand(30.0, ExecuteScript("random_drop", OBJECT_SELF));
DelayCommand(2.0, ExecuteScript("random_drop", OBJECT_SELF));
}

View File

@@ -11,8 +11,8 @@ void MakeItemsDroppable(object oNPC)
if (GetLocalInt(oItem, "notdroppable") == TRUE)
{
// 9% chance to drop item from inventory not already set as droppable
if (d100() <= 9)
// 10% chance to drop item from inventory not already set as droppable
if (d100() <= 10)
{
SetDroppableFlag(oItem, TRUE);
@@ -26,5 +26,5 @@ void MakeItemsDroppable(object oNPC)
void main()
{
object oNPC = OBJECT_SELF;
DelayCommand(0.0f,MakeItemsDroppable(oNPC));
DelayCommand(0.2, MakeItemsDroppable(oNPC));
}

View File

@@ -1,24 +1,30 @@
void main()
void MakeItemsDroppable(object oNPC)
{
object oNPC = OBJECT_SELF;
object oItem = GetFirstItemInInventory(oNPC);
while (GetIsObjectValid(oItem))
oItem = GetNextItemInInventory(oNPC);
{
if (GetDroppableFlag(oItem) == FALSE)
{
SetLocalInt(oItem, "notdroppable", 1);
}
{
if (GetDroppableFlag(oItem) == FALSE)
{
SetLocalInt (oItem, "notdroppable", 1);
}
if (GetLocalInt(oItem, "notdroppable") == 1)
{
//20% chance to drop item inventory not already set as droppable
//object oDrop = GetLocalObject(oItem, "notdroppable");
int bDroppable = d100()>50;
SetDroppableFlag(oItem, bDroppable);
if (GetLocalInt(oItem, "notdroppable") == TRUE)
{
// 20% chance to drop item from inventory not already set as droppable
if (d100() <= 20)
{
SetDroppableFlag(oItem, TRUE);
}
}
}
oItem = GetNextItemInInventory(oNPC);
}
}
void main()
{
object oNPC = OBJECT_SELF;
DelayCommand(0.2, MakeItemsDroppable(oNPC));
}

View File

@@ -1,25 +1,30 @@
//RANDOM DROP
// Ginge McDaggart
void MakeItemsDroppable(object oNPC)
{
object oItem = GetFirstItemInInventory(oNPC);
while (GetIsObjectValid(oItem))
{
if (GetDroppableFlag(oItem) == FALSE)
{
SetLocalInt(oItem, "notdroppable", 1);
}
if (GetLocalInt(oItem, "notdroppable") == TRUE)
{
// 10% chance to drop item from inventory not already set as droppable
if (d100() <= 40)
{
SetDroppableFlag(oItem, TRUE);
}
}
oItem = GetNextItemInInventory(oNPC);
}
}
void main()
{
object oNPC = OBJECT_SELF;
object oItem = GetFirstItemInInventory(oNPC);
while (GetIsObjectValid(oItem))
{
if(GetDroppableFlag(oItem)== TRUE)
{
SetDroppableFlag(oItem, TRUE);
}
if(GetDroppableFlag(oItem)== FALSE)
{
int bDroppable=d100()>55;
SetDroppableFlag(oItem, bDroppable);
}
oItem = GetNextItemInInventory(oNPC);
}
DelayCommand(0.2, MakeItemsDroppable(oNPC));
}

15
_module/nss/scalesize.nss Normal file
View File

@@ -0,0 +1,15 @@
///scalesize.nss
///Set variable on creature SCALE_SIZE float -> 0.0 to size desired
void main()
{
if (GetLocalInt(OBJECT_SELF,"NO_SCALE")!=1)
{
float fScaleSize=GetLocalFloat(OBJECT_SELF,"SCALE_SIZE");
if (fScaleSize==0.0)
{
fScaleSize=1.0+(IntToFloat(Random(11))/100.0)*IntToFloat(Random(3)-1);
}
SetObjectVisualTransform(OBJECT_SELF,OBJECT_VISUAL_TRANSFORM_SCALE,fScaleSize);
}
}

View File

@@ -0,0 +1,18 @@
void main()
{
// Have us perform a sequence of actions.
ActionEquipMostDamagingMelee(OBJECT_INVALID, FALSE);
AssignCommand (OBJECT_SELF, ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND)));
AssignCommand (OBJECT_SELF, ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND)));
object oLeft = GetItemInSlot (INVENTORY_SLOT_CWEAPON_L, OBJECT_SELF);
object oRight = GetItemInSlot (INVENTORY_SLOT_CWEAPON_R, OBJECT_SELF);
object oBite = GetItemInSlot (INVENTORY_SLOT_CWEAPON_B, OBJECT_SELF);
AssignCommand (OBJECT_SELF, ActionEquipItem(GetItemPossessedBy(OBJECT_SELF, "oLeft"), INVENTORY_SLOT_CWEAPON_L));
AssignCommand (OBJECT_SELF, ActionEquipItem(GetItemPossessedBy(OBJECT_SELF, "oRight"), INVENTORY_SLOT_CWEAPON_R));
AssignCommand (OBJECT_SELF, ActionEquipItem(GetItemPossessedBy(OBJECT_SELF, "oBite"), INVENTORY_SLOT_CWEAPON_B));
DelayCommand (0.2, ExecuteScript("usecreatureweap", OBJECT_SELF));
}

11
_module/nss/watervfx.nss Normal file
View File

@@ -0,0 +1,11 @@
void main()
{
object oTarget = OBJECT_SELF;
effect eMind = EffectVisualEffect(VFX_DUR_ICESKIN);
eMind = UnyieldingEffect(eMind);
effect eMind2 = EffectVisualEffect(VFX_DUR_GHOST_TRANSPARENT);
eMind2 = UnyieldingEffect(eMind2);
DelayCommand(1.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT, eMind, oTarget));
DelayCommand(1.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT, eMind2, oTarget));
SetLocalInt(OBJECT_SELF, "X1_L_IMMUNE_TO_DISPEL", 10);
}