SpecialTacticsCowardly

From NWN Lexicon


Contents

[edit] SpecialTacticsCowardly(object)

Special tactics for cowardly creatures.

[edit] Parameters

oTarget

The "enemy" object we wish to perform special tactics against.


[edit] Description

Special tactics for cowardly creatures.

Cowards act as follows:
- If you and your friends outnumber the enemy by 6:1 or by more than 10, fall through to normal combat.
- If you are currently being attacked by a melee attacker, fight defensively (see SpecialTacticsDefensive ).
- If there is a "NW_SAFE" waypoint in your area that is out of sight of the target, run to it.
- Otherwise, run away randomly from the target.

Returns TRUE on success, FALSE on failure.



[edit] Requirements

#include " x0_i0_combat "


[edit] Version

???

[edit] Example

// Lets' check to see if our "cowardly tactics" passes or fails.
#include "x0_i0_combat"
 
void main()
{
   // We assume we have previously flagged the caller with the X0_COMBAT_FLAG_COWARDLY setting using SetCombatCondition.
 
   // Establish our target.
   object oEnemy = GetLastHostileActor();
 
   // Run the tactic function on oEnemy, we know the flag is set so if this returns FALSE,
   // it is because the tactics check failed. 
   int nTactic = SpecialTacticsCowardly(oEnemy);
 
   //The tactic succeeded.
   if(nTactic == TRUE)
   {
      // Do stuff.
   }
 
   //The tactic failed.
   else
   {
      // Do stuff.
   }
}

[edit] See Also

functions: 

SpecialTacticsRanged



author: Baragg, editor: Mistress

Personal tools
Categories