X0 i0 enemy

From NWN Lexicon



Contents

[edit] x0_i0_enemy

Library with functions for finding and identifying enemies.

NOTE: This file includes x0_i0_match .

[edit] Constants

Name Value Brief Description
MELEE_DISTANCE 3.0


[edit] Structures

Name Variables Brief Description
sEnemies int FIGHTERS
int FIGHTER_LEVELS
int CLERICS
int CLERIC_LEVELS
int MAGES
int MAGE_LEVELS
int MONSTERS
int MONTERS_LEVELS
int TOTAL
int TOTAL_LEVELS
int ENEMY_NUM
int ALLY_NUM
int ENEMY_CR
int ALLY_CR
Used to collect the number of enemies and allies in a situation and their respective challenge rating.


[edit] Functions

Name Brief Description

CheckEnemyGroupingOnTarget

Gets the number of enemies in a sphere shape around a target.

CheckFriendlyFireOnTarget

Gets how many friendly creatures are within a spherical range of a target object.
CountEnemiesAndAllies Count the number of enemies and allies in a given radius and their respective total CRs (slightly rounded, since we use integers instead of floats).

This returns a "struct sSituation" type value.

DetermineEnemies

Returns number of enemies perceived and their combined levels.

FindSingleRangedTarget

Seeks out an enemy more than 3 meters away.
GetIsMeleeAttacker Returns TRUE if the given opponent is a melee attacker, meaning they are in melee range and equipped with a melee weapon.
GetIsRangedAttacker Returns TRUE if the given opponent is a ranged attacker, meaning they are outside melee range.
GetIsWieldingRanged Returns TRUE if the given opponent is wielding a ranged weapon.

GetMostDangerousClass

Use the four archetypes to determine the most dangerous group type facing the NPC.
GetNearestEnemy Gets the nearest enemy.
GetNearestPerceivedEnemy

Returns the nearest object that can be seen, then checks for he nearest heard target.

You may pass in any of the CREATURE_TYPE_* constants used in GetNearestCreature as nCriteriaType, with corresponding values for nCriteriaValue, to get a more specific result.

KLUDGE: Huge default values used here for nCriteriaType/Value because -1 cannot be passed in at the moment due to a compiler bug. Should be changed to -1 once that's fixed.

GetNearestSeenEnemy Get the nearest seen enemy. This will NOT return an enemy that is heard but not seen; for that, use GetNearestPerceivedEnemy instead.
GetNearestSeenFriend Get the nearest seen friend.

GetNearestSeenOrHeardEnemy

Determines closest visual creature and determines the closest heard creature.

GetNumberOfMeleeAttackers

Determines the number of enemies within a 5 meter radius of the target object.

GetNumberOfRangedAttackers

Determines the number of enemies outside a 5 meter radius of the target object.

GetRacialTypeCount

Determine the number of targets within 20 meters that are of the specified racial-type



  author: Mistress

Personal tools
Categories