Gaming
 

Ultimate archery target

From NWNWiki


Contents

[edit] Ultimate Archery Target

Script names: uarch_target_od , uarch_target_hb, uarch_target_sp


[edit] What it does

Adds an AC bonus at medium to long ranges and adds an attack bonus at short range. Gives different experience according to range.

[edit] Notes

For anyone who does not know, an Archery Target is a creature not a placeable. Strip it of all skills and feats, make all attributes 3 and give it 10,000 hit points. Under advanced change movement rate to immobile. If you want to score critical hits, edit it's armor (creature item) and remove the immunity to criticals.

After you have your target made, put the uarch_target_od in the OnDamage event. Put the uarch_target_hb in the HeartBeat event and put the uarch_target_sp in the OnSpawn event. Happy shooting!

[edit] The Scripts

[edit] uarch_target_od

// uarch_target_od
/*
Put this in the archery target's OnDamage event.
    I was getting tired of missing a target at like 3 feet, and getting bull's
eyes at 300. What it does is add attack bonuses at point blank range (range 1 )
and add an AC bonus to the target at the other two ranges (range 2,3). These
effects are removed every time "ranged" is set to false. It also adjust Exp
by range. Range 1 = 1/3, Range 2 = 1/2, and Range 3 = full.
The heart beat file "uarch_target_hb" Checks to see if the effect should be applied.
SetLocalInt(oPC,"arch_t1",iDex); This is the int for the attack bonus.
SetLocalInt(OBJECT_SELF,"ac",16); This is the int for the AC bonus.
If either is not 0, it checks for the effect, if effect is not present it
applies it. The HeartBeat also checks for end of session to strip the effects.
*/
void main()
{
object oPC = GetLastHostileActor(OBJECT_SELF);
object oTarget = GetAttackTarget(oPC);
float fRange = GetDistanceToObject(oPC);
int iRange = 1;
effect eEffect = GetFirstEffect(OBJECT_SELF);
effect eAC = EffectACIncrease(0,AC_DEFLECTION_BONUS,AC_VS_DAMAGE_TYPE_ALL);
effect nEffect = GetFirstEffect(oPC);
effect eAtt = EffectAttackIncrease(0,ATTACK_BONUS_MISC);
int iDex = GetAbilityModifier(ABILITY_DEXTERITY,oPC);
int iAdd = GetLocalInt(oPC,"arch_t1");
int iAC = GetLocalInt(OBJECT_SELF,"ac");
int iDamage = GetLocalInt(oPC,"a_damage");
int iStrip = FALSE;
int iCur = GetCurrentHitPoints(OBJECT_SELF);
int iHit = 1;
int iRound = 1;
int iCheck = 1;
int iGive = 1;
float iChange = 1.0;
// Set the check in the HeartBeat.
SetLocalInt(OBJECT_SELF,"flip",FALSE);
SetLocalInt(OBJECT_SELF,"attack",TRUE);
// Valid weapon check, start.
object oItem = GetLastWeaponUsed(oPC);
// iWeap = GetBaseItemType(GetLastWeaponUsed(oPC));
int iWeap = 1;
oItem = GetLastWeaponUsed(oPC);
iWeap = GetWeaponRanged(oItem);
if(iWeap == TRUE)
{
SetLocalInt(oPC,"w_invalid",FALSE);
fRange = GetDistanceToObject(oPC);
iRange = FloatToInt(fRange);
// Check for range change, if so set range.
        if(iRange < 10 && GetLocalInt(oPC,"pc_range") != 1)
        {
        SetLocalInt(oPC,"pc_range",1);
        SetLocalInt(OBJECT_SELF,"ranged",FALSE);
        }
        else if(iRange > 9 && iRange < 20 && GetLocalInt(oPC,"pc_range") != 2)
        {
        SetLocalInt(oPC,"pc_range",2);
        SetLocalInt(OBJECT_SELF,"ranged",FALSE);
        }
        else if(iRange > 19 && GetLocalInt(oPC,"pc_range") != 3)
        {
        SetLocalInt(oPC,"pc_range",3);
        SetLocalInt(OBJECT_SELF,"ranged",FALSE);
        }
iStrip = FALSE;
    // Strip the effects, if any, from the previous round. Careful, two layers in loop.
    if(GetLocalInt(OBJECT_SELF,"ranged") == FALSE)
    {
      while(iStrip == FALSE)
      {
        eEffect = GetFirstEffect(OBJECT_SELF);
        while(GetIsEffectValid(eEffect))
        {
            if ((GetEffectType(eEffect) == EFFECT_TYPE_AC_INCREASE) &&
            (GetEffectCreator(eEffect) == OBJECT_SELF))
            {
            RemoveEffect(OBJECT_SELF,eEffect);
            }
            eEffect = GetNextEffect(OBJECT_SELF);
       }
       if(GetIsEffectValid(eEffect) != TRUE)
       {
            nEffect = GetFirstEffect(oPC);
            while (GetIsEffectValid(nEffect))
            {
                    if ((GetEffectType(nEffect) == EFFECT_TYPE_ATTACK_INCREASE) &&
                    (GetEffectCreator(nEffect) == OBJECT_SELF))
                    {
                    RemoveEffect(oPC,nEffect);
                    }
                    nEffect = GetNextEffect(oPC);
            }
            if(GetIsEffectValid(nEffect) != TRUE)
            {
            iStrip = TRUE;
            }
        }
      } //The strip routine ends here. You might know that, but I keep forgeting.
    // Check for weapon focus and specialization.
    int fHC = GetHasFeat(FEAT_WEAPON_FOCUS_HEAVY_CROSSBOW,oPC);
    int fLC = GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_CROSSBOW,oPC);
    int fLB = GetHasFeat(FEAT_WEAPON_FOCUS_LONGBOW,oPC);
    int fSB = GetHasFeat(FEAT_WEAPON_FOCUS_SHORTBOW,oPC);
    int sHC = GetHasFeat(FEAT_WEAPON_SPECIALIZATION_HEAVY_CROSSBOW,oPC);
    int sLC = GetHasFeat(FEAT_WEAPON_SPECIALIZATION_LIGHT_CROSSBOW,oPC);
    int sLB = GetHasFeat(FEAT_WEAPON_SPECIALIZATION_LONGBOW,oPC);
    int sSB = GetHasFeat(FEAT_WEAPON_SPECIALIZATION_SHORTBOW,oPC);
        // Stripped, now set range effects.
        // Bonus for weapon focus, specialization and Dex, due to extremely short range.
        if(iStrip == TRUE && GetLocalInt(oPC,"pc_range") == 1)
        {
        FloatingTextStringOnCreature("Finding Range 1",oPC,TRUE);
        iDex = GetAbilityModifier(ABILITY_DEXTERITY,oPC);
        eAtt = EffectAttackIncrease(iDex,ATTACK_BONUS_MISC);
            if(sHC || sLC || sLB || sSB == TRUE)
            {
            DelayCommand(1.0,FloatingTextStringOnCreature("Weapon Specialization",oPC,TRUE));
            iDex = iDex + 4;
            // Specialized
            eAtt = EffectAttackIncrease(iDex,ATTACK_BONUS_MISC);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAtt,oPC,90.0);
            // Store the attack bonus for the HeartBeat check.
            SetLocalInt(oPC,"arch_t1",iDex);
            SetLocalInt(OBJECT_SELF,"ac",0);
            SetLocalInt(OBJECT_SELF,"ranged",TRUE);
            }
            else if(fHC || fLC || fLB || fSB == TRUE)
            {
            DelayCommand(2.0,FloatingTextStringOnCreature("Weapon Focus",oPC,TRUE));
            iDex = iDex + 2;
            // Weapon Focus
            eAtt = EffectAttackIncrease(iDex,ATTACK_BONUS_MISC);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAtt,oPC,90.0);
            // Store the attack bonus for the HeartBeat check.
            SetLocalInt(oPC,"arch_t1",iDex);
            SetLocalInt(OBJECT_SELF,"ac",0);
            SetLocalInt(OBJECT_SELF,"ranged",TRUE);
            }
            else if(fHC || fLC || fLB || fSB != TRUE && sHC || sLC || sLB || sSB != TRUE)
            {
            DelayCommand(3.0,FloatingTextStringOnCreature("Point Blank Range",oPC,TRUE));
            // No specialization, just dex modifier.
            eAtt = EffectAttackIncrease(iDex,ATTACK_BONUS_MISC);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAtt,oPC,90.0);
            // Store the attack bonus for the HeartBeat check.
            SetLocalInt(oPC,"arch_t1",iDex);
            SetLocalInt(OBJECT_SELF,"ac",0);
            SetLocalInt(OBJECT_SELF,"ranged",TRUE);
            }
        }
        // Medium range make it a little harder to hit.
        else if(iStrip == TRUE && GetLocalInt(oPC,"pc_range") == 2)
        {
        eAC = EffectACIncrease(8,AC_DEFLECTION_BONUS,AC_VS_DAMAGE_TYPE_ALL);
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAC,OBJECT_SELF,90.0);
        FloatingTextStringOnCreature("Finding Range 2",oPC,TRUE);
        // Store the AC bonus for the HeartBeat check.
        SetLocalInt(OBJECT_SELF,"ac",8);
        SetLocalInt(oPC,"arch_t1",0);
        SetLocalInt(OBJECT_SELF,"ranged",TRUE);
        }
        // Long range, make it a bit harder to hit.
        else if(iStrip == TRUE && GetLocalInt(oPC,"pc_range") == 3)
        {
        eAC = EffectACIncrease(12,AC_DEFLECTION_BONUS,AC_VS_DAMAGE_TYPE_ALL);
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAC,OBJECT_SELF,90.0);
        FloatingTextStringOnCreature("Finding Range 3",oPC,TRUE);
        // Store the AC bonus for the HeartBeat check. 16 was to hard change to 12
        SetLocalInt(OBJECT_SELF,"ac",12);
        SetLocalInt(oPC,"arch_t1",0);
        SetLocalInt(OBJECT_SELF,"ranged",TRUE);
        }
    } // Ranged is FALSE
  else if(GetLocalInt(OBJECT_SELF,"ranged") == TRUE)
  {
      if(GetLocalInt(oPC,"pc_range") < 2)
       {
       nEffect = GetFirstEffect(oPC);
       // Check for effects, if not there apply them.
                if(GetIsEffectValid(nEffect) != TRUE)
                {
                SetLocalInt(OBJECT_SELF,"ac",0);
                // The stored attack bonus.
                iAdd = GetLocalInt(oPC,"arch_t1");
                eAtt = EffectAttackIncrease(iAdd,ATTACK_BONUS_MISC);
                ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAtt,oPC,90.0);
                }
        }
        else if(GetLocalInt(OBJECT_SELF,"ac") != 0)
        {
        eEffect = GetFirstEffect(OBJECT_SELF);
        // Check for effects, if not there apply them.
                if(GetIsEffectValid(eEffect) != TRUE)
                {
                SetLocalInt(oPC,"arch_t1",0);
                // The stored AC bonus.
                iAC = GetLocalInt(OBJECT_SELF,"ac");
                eAC = EffectACIncrease(iAC,AC_DEFLECTION_BONUS,AC_VS_DAMAGE_TYPE_ALL);
                ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAC,OBJECT_SELF,90.0);
                }
        }

int bExp = FALSE;
bExp = FALSE;
    while(bExp == FALSE) // Check the damage
    {
    iCur = GetCurrentHitPoints(OBJECT_SELF);
    iRound = GetLocalInt(OBJECT_SELF,"last_round");
     // Remember the damage done, store previous round's hit points in "last_round".
        if(GetLocalInt(OBJECT_SELF,"used") == TRUE)
        {
        iHit = iRound - iCur;
        SetLocalInt(oPC,"a_damage",iHit);
            // Less than three points damage, I really don't want to divide it by three.
            // Put it on the next round's damage, then divide it.
            if(GetLocalInt(oPC,"a_damage") < 3)
            {
            bExp = TRUE;
            }
            else if(GetLocalInt(oPC,"a_damage") > 2)
            {
            SetLocalInt(OBJECT_SELF,"last_round",iCur);
            bExp = TRUE;
            }
        }
        else if(GetLocalInt(OBJECT_SELF,"used") == FALSE)
        {
        iHit = 1;
        SetLocalInt(oPC,"a_damage",iHit);
        SetLocalInt(OBJECT_SELF,"last_round",iCur);
        SetLocalInt(OBJECT_SELF,"used",TRUE);
        bExp = TRUE;
        }
    } // == bExp is false
// Ranged with a valid weapon, now covert damage to exp.
// At least 3 points damage, change to float, divide it and change it back.
    if(GetLocalInt(oPC,"a_damage") > 2)
    {
    iDamage = GetLocalInt(oPC,"a_damage");
// Change to float for division, then change it back to round it off.
    iChange = IntToFloat(iDamage);
        if(GetLocalInt(oPC,"pc_range") == 1)
        {
        iChange = iChange / 3;
        iGive = FloatToInt(iChange);
        GiveXPToCreature(oPC,iGive);
        }
        else if(GetLocalInt(oPC,"pc_range") == 2)
        {
        iChange = iChange / 2;
        iGive = FloatToInt(iChange);
        GiveXPToCreature(oPC,iGive);
        }
        else if(GetLocalInt(oPC,"pc_range") == 3)
        {
        iGive = FloatToInt(iChange);
        GiveXPToCreature(oPC,iGive);
        }
     }
   } // Ranged is true
  }// = Weapon type valid
  // Invalid weapon type.
  else if(iWeap == FALSE)
  {
        if(GetLocalInt(oPC,"w_invalid") == FALSE)
        {
  SpeakString("I'M AN ARCHERY TARGET, STUPID!",TALKVOLUME_SHOUT);
  DelayCommand(2.0,SpeakString("DOES THAT LOOK LIKE A BOW TO YOU!",TALKVOLUME_SHOUT));
  DelayCommand(4.0,FloatingTextStringOnCreature("Hmmm....",oPC,TRUE));
  DelayCommand(6.0,FloatingTextStringOnCreature("PERHAPS IT'S AN ARCHERY TARGET?",oPC,TRUE));
        SetLocalInt(oPC,"w_invalid",TRUE);
        }
  iCur = GetCurrentHitPoints(OBJECT_SELF);
  SetLocalInt(OBJECT_SELF,"last_round",iCur);
  SetLocalInt(oPC,"a_damage",0);
  SetLocalInt(OBJECT_SELF,"ranged",TRUE);
  }
}

[edit] uarch_target_hb

// uarch_target_hb
/*
   This heart beat file goes with the "uarch_target_od" file.
It checks to see if an attack or AC bonus should be applied.
If so, simply apply the effect.
SetLocalInt(oPC,"arch_t1",iDex); This is the int for the attack bonus.
SetLocalInt(OBJECT_SELF,"ac",16); This is the int for the AC bonus.
*/
void main()
{
object oPC = GetLastHostileActor(OBJECT_SELF);
object oTarget = GetAttackTarget(oPC);
int iDex = GetLocalInt(oPC,"arch_t1");
int iAC = GetLocalInt(OBJECT_SELF,"ac");
int iRound = 1;
int iStrip = FALSE;
int iRange = 1;
float fRange = GetDistanceToObject(oPC);
effect nEffect = GetFirstEffect(oPC);
effect eAtt = EffectAttackIncrease(0,ATTACK_BONUS_MISC);
effect eEffect = GetFirstEffect(OBJECT_SELF);
effect eAC = EffectACIncrease(0,AC_DEFLECTION_BONUS,AC_VS_DAMAGE_TYPE_ALL);

    if(GetLocalInt(OBJECT_SELF,"attack") == TRUE)
    {
        // Don't want to give them a bonus of they are not attacking us.
        if(oTarget == OBJECT_SELF)
        {
            if(GetLocalInt(OBJECT_SELF,"ranged") == TRUE)
            {
                if(GetLocalInt(OBJECT_SELF,"flip") == FALSE)
                {
                iRound = 0;
                SetLocalInt(OBJECT_SELF,"flip",TRUE);
                }
                else if(GetLocalInt(OBJECT_SELF,"flip") == TRUE)
                {
                iRound ++;
                fRange = GetDistanceToObject(oPC);
                iRange = FloatToInt(fRange);
                // They are trying to hit us, but didn't in the last
                // 12 seconds, better check range.
                   while(iRound == 2)
                   {
                        if(iRange < 10 && GetLocalInt(oPC,"pc_range") != 1)
                        {
                        SetLocalInt(OBJECT_SELF,"ranged",FALSE);
                        iRound = 0;
                        }
                        else if(iRange > 9 && iRange < 20 && GetLocalInt(oPC,"pc_range") != 2)
                        {
                        SetLocalInt(OBJECT_SELF,"ranged",FALSE);
                        iRound = 0;
                        }
                        else if(iRange > 19 && GetLocalInt(oPC,"pc_range") != 3)
                        {
                        SetLocalInt(OBJECT_SELF,"ranged",FALSE);
                        iRound = 0;
                        }
                        else if(GetLocalInt(OBJECT_SELF,"ranged") == TRUE)
                        {
                        iRound = 0;
                        // Nope, the're ranged ok, they just have bad aim.
                        }
                    }// While
                } // Flip is true
                if(GetLocalInt(oPC,"pc_range") == 1)
                {
                 nEffect = GetFirstEffect(oPC);
                // Attacker at close range add attack bonus to the attacker.
                if(GetIsEffectValid(nEffect) != TRUE)
                {
                SetLocalInt(OBJECT_SELF,"ac",0);
                // The stored attack bonus created in the OnDamage script.
                iDex = GetLocalInt(oPC,"arch_t1");
                eAtt = EffectAttackIncrease(iDex,ATTACK_BONUS_MISC);
                ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAtt,oPC,90.0);
                }
            }
            else if(GetLocalInt(OBJECT_SELF,"ac") != 0)
            {
                eEffect = GetFirstEffect(OBJECT_SELF);
                // Attacker at long range, add AC bonus to the target.
                if(GetIsEffectValid(eEffect) != TRUE)
                {
                SetLocalInt(oPC,"arch_t1",0);
                // The stored AC bonus created by the OnDamage script due to range.
                iAC = GetLocalInt(OBJECT_SELF,"ac");
                eAC = EffectACIncrease(iAC,AC_DEFLECTION_BONUS,AC_VS_DAMAGE_TYPE_ALL);
                ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAC,OBJECT_SELF,90.0);
                }
            }
        } // Ranged is true.
     } // Target us is true.
 if(oTarget != OBJECT_SELF)
 {
    if(GetLocalInt(OBJECT_SELF,"flip") == FALSE)
    {
    SetLocalInt(OBJECT_SELF,"flip",TRUE);
    }
    else if(GetLocalInt(OBJECT_SELF,"flip") == TRUE)
    {
     iStrip = FALSE;
     // It's been six seconds without even targeting us, I think they are done.
     // Strip previous effects. Careful, two layers in loop.
      while(iStrip == FALSE)
      {
        eEffect = GetFirstEffect(OBJECT_SELF);
        while(GetIsEffectValid(eEffect))
        {
            if ((GetEffectType(eEffect) == EFFECT_TYPE_AC_INCREASE) &&
            (GetEffectCreator(eEffect) == OBJECT_SELF))
            {
            RemoveEffect(OBJECT_SELF,eEffect);
            }
            eEffect = GetNextEffect(OBJECT_SELF);
        }
        if(GetIsEffectValid(eEffect) != TRUE)
        {
            nEffect = GetFirstEffect(oPC);
            while (GetIsEffectValid(nEffect))
            {
                    if ((GetEffectType(nEffect) == EFFECT_TYPE_ATTACK_INCREASE) &&
                    (GetEffectCreator(nEffect) == OBJECT_SELF))
                    {
                    RemoveEffect(oPC,nEffect);
                    }
                    nEffect = GetNextEffect(oPC);
            }
            if(GetIsEffectValid(nEffect) != TRUE)
            {
            SetLocalInt(OBJECT_SELF,"ranged",FALSE);
            SetLocalInt(oPC,"pc_range",0);
            SetLocalInt(OBJECT_SELF,"ac",0);
            SetLocalInt(oPC,"arch_t1",0);
            SetLocalInt(OBJECT_SELF,"attack",FALSE);
            SetLocalInt(oPC,"a_damage", 0);
            SetLocalInt(oPC,"used",FALSE);
            SetLocalInt(OBJECT_SELF,"flip",FALSE);
            // We're done here, close the loop and wait for the next customer.
            iStrip = TRUE;
            }
         }
      } // The nasty while loop
     } // If flip switch is true
   } // If Target is not us
 } // if attack is true

} // EOS

[edit] uarch_target_sp

// uarch_target_sp
//::///////////////////////////////////////////////
//:: Default: On Spawn In
//:: NW_C2_HERBIVORE
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Determines the course of action to be taken
    after having just been spawned in for Herbivores
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Dec 21, 2001
//:://////////////////////////////////////////////
#include "NW_I0_GENERIC"
#include "NW_O2_CONINCLUDE"
void main()
{
effect eBlnd = EffectBlindness();
effect eDeaf = EffectDeaf();
effect eOpt = EffectSkillDecrease(FEAT_OPPORTUNIST,100);
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eBlnd,OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eDeaf,OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eOpt,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_AMBIENT_ANIMATIONS);
                //This will play Ambient Animations until the NPC sees an enemy or is cleared.
                //NOTE that these animations will play automatically for Encounter Creatures.
     //SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
                //This will play Ambient Animations until the NPC sees an enemy or is cleared.
                //NOTE that NPCs using this form of ambient animations will not move to other NPCs.
    // 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.)
// SPECIAL BEHAVIOR SECTION
/*
    The following section outlines the various special behaviors that can be placed on a creature.  To activate one of the special
    behaviors:
        1.  Comment in  SetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL);
        2.  Comment in one other special behavior setting (ONLY ONE).
*/
    SetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL);
    //SetBehaviorState(NW_FLAG_BEHAVIOR_OMNIVORE); //Creature will only attack those that close within 5m and are not friends,
                                                   //Rangers or Druids.
    SetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE);//Creature will flee those that close within 7m if they are not friends,
                                                   //Rangers or Druids.
// 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
// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) *****************************************************************************************
    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
}