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.

Constants

NameValueBrief Description
COND_ABILITY0x00000008
COND_BLINDDEAF0x00000020
COND_CURSE0x00000001
COND_DISEASE0x00000004
COND_DRAINED0x00000010
COND_POISON0x00000002
TALENT_ANY20
WHIRL_DISTANCE3.0

Functions

NameBrief Description
genericAttemptHarmfulRangedWill return TRUE if it successfully used a harmful ranged talent.
genericDoHarmfulRangedAttackSpell-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.
GetCreatureTalentWrapper 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.)
GetCurrentNegativeConditionsUtility function for TalentCureCondition.

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

Checks to see if the creature has the given condition in the given condition value.
GetOKToWhirlInternal function. Returns TRUE if the creature's variable set on it rolled against a d100 says it is okay to whirlwind.
StartProtectionLoopFinds a protection talent to use.
TalentAdvancedBuffCauses the NPC/Creature to buff themselves using a priority aligned list of spells if they have them.
TalentAdvancedProtectSelfAI quickly scans nearby enemies and determines the most beneficial protective talents to use on itself against the type of enemies it faces.
TalentBardSongIf the AI has the Bard Song Feat, use it.
TalentBuffSelfUsed for Potions of Enhancement and Protection.
TalentCureConditionCure Disease, Poison, Curse and Blindness and Deafness of nearest friendly target.
TalentDragonCombatDetermines the talent a dragon chooses during combat.
TalentEnhanceOthersUsed by NPC or creatures to determine the best feat, spell or skill to use to assist others in same faction.
TalentFleeMake the calling object flee from another object.
TalentHealDetermines if a creature's master (as a henchman) or fellow party members are damaged. If so, attempts to heal if has that ability.
TalentHealingSelfChecks to see if NPC or creature is damaged. If so, tries to heal either with a spell or a potion.
TalentMeleeAttackDetermines course of action while in melee combat for all NPCs.
TalentMeleeAttackedDetermines best course of action for NPC spell-caster when in melee combat.
TalentPersistentAbilitiesDetermines if current creature has capability to project an aura, and activates it if so.
TalentRangedAttackersDetermines course of action for spell-casting NPC while being attacked by ranged foes.
TalentRangedEnemiesReturns TRUE on successful use of such a talent, FALSE otherwise.
TalentSeeInvisibleDetermines if the NPC has the ability to see invisible creatures through feat or spell.
TalentSelfProtectionMantleOrGlobeCast a spell mantle or globe of invulnerability protection on yourself.
TalentSneakAttackReturns TRUE on successful use of such a talent, FALSE otherwise.
TalentSpellAttackReturns TRUE on successful use of such a talent, FALSE otherwise.
TalentSummonAlliesReturns TRUE on successful use of such a talent, FALSE otherwise.
TalentUseEnhancementOnSelfReturns TRUE on successful use of such a talent, FALSE otherwise.
TalentUseProtectionOnSelfReturns TRUE on successful use of such a talent, FALSE otherwise.
TalentUseProtectionOthersReturns TRUE on successful use of such a talent, FALSE otherwise.
TalentUseTurningReturns TRUE on successful use of such a talent, FALSE otherwise.
TryKiDamageInternal function. Tries to do the Ki Damage ability.
TrySpellTry 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.
TrySpellForEffectTry 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.
TryTalentTry 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.
WhirlwindGetNumberOfMeleeAttackersInternal function.


  author: Mistress, contributor: Graewerld