X0 i0 talent

From NWN Lexicon



[edit] x0_i0_talent

Library for talent functions.

All of these functions attempt to use a particular category of skill, and return TRUE on success, FALSE on failure. This allows for building up fall-through chains where one talent after another is attempted, with the order determined by the creature's particular tactics.

NOTE: This file includes x0_inc_generic .

[edit] Constants

Name Value Brief Description
COND_ABILITY 0x00000008
COND_BLINDDEAF 0x00000020
COND_CURSE 0x00000001
COND_DISEASE 0x00000004
COND_DRAINED 0x00000010
COND_POISON 0x00000002
TALENT_ANY 20
WHIRL_DISTANCE 3.0


[edit] Functions

Name Brief Description
genericAttemptHarmfulRanged Will return TRUE if it successfully used a harmful ranged talent.
genericDoHarmfulRangedAttack

Spell-caster melee attacked. Do further checks such as making them not cast Dispel Magic.

Possible Issue: It may get stuck on dispel magics, trying to cast them and not proceed down Area Of Effect Discriminants.

Solution: If this function returns TRUE the TalentMeleeAttacked routine will exit, however if it returns FALSE, it will try and find some other ability to use.

GetCreatureTalent Wrapper function to add a variable to allow randomization to the AI.

WARNING: This will make the AI cast spells badly if they have a bad spell selection (i.e., only turn randomization on if you know what you are doing.)
GetCurrentNegativeConditions

Utility function for TalentCureCondition .

Returns an integer with bitwise flags set that represent the current negative conditions on the creature. To be used with GetHasNegativeCondition.

GetHasNegativeCondition

Utility function for TalentCureCondition .

Checks to see if the creature has the given condition in the given condition value.

GetOKToWhirl Internal function. Returns TRUE if the creature's variable set on it rolled against a d100 says it is okay to whirlwind.

StartProtectionLoop

Finds a protection talent to use.

TalentAdvancedBuff

Causes the NPC/Creature to buff themselves using a priority aligned list of spells if they have them.

TalentAdvancedProtectSelf

AI quickly scans nearby enemies and determines the most beneficial protective talents to use on itself against the type of enemies it faces.

TalentBardSong

If the AI has the Bard Song Feat, use it.

TalentBuffSelf

Used for Potions of Enhancement and Protection.

TalentCureCondition

Cure Disease, Poison, Curse and Blindness and Deafness of nearest friendly target.

TalentDragonCombat

Determines the talent a dragon chooses during combat.

TalentEnhanceOthers

Used by NPC or creatures to determine the best feat, spell or skill to use to assist others in same faction.

TalentFlee

Make the calling object flee from another object.

TalentHeal

Determines if a creature's master (as a henchman) or fellow party members are damaged. If so, attempts to heal if has that ability.

TalentHealingSelf

Checks to see if NPC or creature is damaged. If so, tries to heal either with a spell or a potion.

TalentMeleeAttack

Determines course of action while in melee combat for all NPCs.

TalentMeleeAttacked

Determines best course of action for NPC spell-caster when in melee combat.

TalentPersistentAbilities

Determines if current creature has capability to project an aura, and activates it if so.

TalentRangedAttackers

Determines course of action for spell-casting NPC while being attacked by ranged foes.

TalentRangedEnemies

Returns TRUE on successful use of such a talent, FALSE otherwise.

TalentSeeInvisible

Determines if the NPC has the ability to see invisible creatures through feat or spell.
TalentSelfProtectionMantleOrGlobe Cast a spell mantle or globe of invulnerability protection on yourself.

TalentSneakAttack

Returns TRUE on successful use of such a talent, FALSE otherwise.

TalentSpellAttack

Returns TRUE on successful use of such a talent, FALSE otherwise.

TalentSummonAllies

Returns TRUE on successful use of such a talent, FALSE otherwise.

TalentUseEnhancementOnSelf

Returns TRUE on successful use of such a talent, FALSE otherwise.

TalentUseProtectionOnSelf

Returns TRUE on successful use of such a talent, FALSE otherwise.

TalentUseProtectionOthers

Returns TRUE on successful use of such a talent, FALSE otherwise.

TalentUseTurning

Returns TRUE on successful use of such a talent, FALSE otherwise.
TryKiDamage Internal function. Tries to do the Ki Damage ability.
TrySpell Try a spell to produce a particular spell effect. This will only cast the spell if the target DOES NOT already have the given spell effect, and the caster possesses the spell. Returns TRUE on success, FALSE on failure.
TrySpellForEffect Try a spell corresponding to a particular effect. This will only cast the spell if the target DOES have the given effect, and the caster possesses the spell. Returns TRUE on success, FALSE on failure.
TryTalent Try a given talent. This will only cast spells and feats if the targets do not already have the effects of those feats, and will funnel all talents through bkTalentFilter for a final check.
WhirlwindGetNumberOfMeleeAttackers Internal function.



  author: Mistress, contributor: Graewerld

Personal tools
Categories