NWNX:EE  8193.36.12
Creature

Readme

Functions exposing additional creature properties.

Files

file  nwnx_creature.nss
 

Classes

struct  NWNX_Creature_SpecialAbility
 A creature special ability. More...
 

Functions

void NWNX_Creature_AddFeat (object creature, int feat)
 Gives the creature a feat. More...
 
void NWNX_Creature_AddFeatByLevel (object creature, int feat, int level)
 Gives the creature a feat assigned at a level. More...
 
void NWNX_Creature_RemoveFeat (object creature, int feat)
 Removes a feat from a creature. More...
 
void NWNX_Creature_RemoveFeatByLevel (object creature, int feat, int level)
 Removes the creature a feat assigned at a level. More...
 
int NWNX_Creature_GetKnowsFeat (object creature, int feat)
 Determines if the creature knows a feat. More...
 
int NWNX_Creature_GetFeatCountByLevel (object creature, int level)
 Returns the count of feats learned at the provided level. More...
 
int NWNX_Creature_GetFeatByLevel (object creature, int level, int index)
 Returns the feat learned at the level and index. More...
 
int NWNX_Creature_GetFeatGrantLevel (object creature, int feat)
 Returns the creature level where the specified feat was learned. More...
 
int NWNX_Creature_GetFeatCount (object creature)
 Get the total number of feats known by creature. More...
 
int NWNX_Creature_GetFeatByIndex (object creature, int index)
 Returns the creature's feat at a given index. More...
 
int NWNX_Creature_GetMeetsFeatRequirements (object creature, int feat)
 Gets if creature meets feat requirements. More...
 
int NWNX_Creature_GetSpecialAbilityCount (object creature)
 Gets the count of special abilities of the creature. More...
 
struct NWNX_Creature_SpecialAbility NWNX_Creature_GetSpecialAbility (object creature, int index)
 Returns the creature's special ability at a given index. More...
 
void NWNX_Creature_AddSpecialAbility (object creature, struct NWNX_Creature_SpecialAbility ability)
 Adds a special ability to a creature. More...
 
void NWNX_Creature_RemoveSpecialAbility (object creature, int index)
 Removes a special ability from a creature. More...
 
void NWNX_Creature_SetSpecialAbility (object creature, int index, struct NWNX_Creature_SpecialAbility ability)
 Sets a special ability at the index for the creature. More...
 
int NWNX_Creature_GetClassByLevel (object creature, int level)
 Get the class taken by the creature at the provided level. More...
 
void NWNX_Creature_SetBaseAC (object creature, int ac)
 Sets the base AC for the creature. More...
 
int NWNX_Creature_GetBaseAC (object creature)
 Get the base AC for the creature. More...
 
void NWNX_Creature_SetRawAbilityScore (object creature, int ability, int value)
 Sets the ability score of the creature to the provided value. More...
 
int NWNX_Creature_GetRawAbilityScore (object creature, int ability)
 Gets the ability score of the creature. More...
 
void NWNX_Creature_ModifyRawAbilityScore (object creature, int ability, int modifier)
 Adjusts the ability score of a creature. More...
 
int NWNX_Creature_GetPrePolymorphAbilityScore (object creature, int ability)
 Gets the raw ability score a polymorphed creature had prior to polymorphing. More...
 
int NWNX_Creature_GetRemainingSpellSlots (object creature, int class, int level)
 Gets the remaining spell slots (innate casting) at a class level's index. More...
 
void NWNX_Creature_SetRemainingSpellSlots (object creature, int class, int level, int slots)
 Sets the remaining spell slots (innate casting) at a class level. More...
 
int NWNX_Creature_GetMaxSpellSlots (object creature, int class, int level)
 Gets the maximum spell slots (innate casting) at a class level. More...
 
void NWNX_Creature_AddKnownSpell (object creature, int class, int level, int spellId)
 Add a spell to a creature's spellbook for class. More...
 
void NWNX_Creature_RemoveKnownSpell (object creature, int class, int level, int spellId)
 Remove a spell from creature's spellbook for class. More...
 
int NWNX_Creature_GetMaxHitPointsByLevel (object creature, int level)
 Gets the maximum hit points for creature for level. More...
 
void NWNX_Creature_SetMaxHitPointsByLevel (object creature, int level, int value)
 Sets the maximum hit points for creature. More...
 
void NWNX_Creature_SetMovementRate (object creature, int rate)
 Set creature's movement rate. More...
 
float NWNX_Creature_GetMovementRateFactor (object creature)
 Returns the creature's current movement rate factor. More...
 
void NWNX_Creature_SetMovementRateFactor (object creature, float rate)
 Sets the creature's current movement rate factor. More...
 
float NWNX_Creature_GetMovementRateFactorCap (object creature)
 Returns the creature's maximum movement rate cap. More...
 
void NWNX_Creature_SetMovementRateFactorCap (object creature, float cap)
 Sets the creature's maximum movement rate cap. More...
 
int NWNX_Creature_GetMovementType (object creature)
 Returns the creature's current movement type. More...
 
void NWNX_Creature_SetWalkRateCap (object creature, float fWalkRate=2000.0f)
 Sets the maximum movement rate a creature can have while walking (not running) More...
 
void NWNX_Creature_SetAlignmentGoodEvil (object creature, int value)
 Set creature's raw good/evil alignment value. More...
 
void NWNX_Creature_SetAlignmentLawChaos (object creature, int value)
 Set creature's raw law/chaos alignment value. More...
 
void NWNX_Creature_SetSkillRank (object creature, int skill, int rank)
 Set the base ranks in a skill for creature. More...
 
int NWNX_Creature_GetSkillRankByLevel (object creature, int skill, int level)
 Get the ranks in a skill for creature assigned at a level. More...
 
void NWNX_Creature_SetSkillRankByLevel (object creature, int skill, int rank, int level)
 Set the ranks in a skill for creature assigned at a level. More...
 
void NWNX_Creature_SetClassByPosition (object creature, int position, int classID, int bUpdateLevels=TRUE)
 Set the class ID in a particular position for a creature. More...
 
void NWNX_Creature_SetLevelByPosition (object creature, int position, int level)
 Set the level at the given position for a creature. More...
 
void NWNX_Creature_SetBaseAttackBonus (object creature, int bab)
 Set creature's base attack bonus (BAB). More...
 
int NWNX_Creature_GetAttacksPerRound (object creature, int bBaseAPR=FALSE)
 Gets the creatures current attacks per round (using equipped weapon). More...
 
void NWNX_Creature_RestoreFeats (object creature)
 Restore all creature feat uses. More...
 
void NWNX_Creature_RestoreSpecialAbilities (object creature)
 Restore all creature special ability uses. More...
 
void NWNX_Creature_RestoreItems (object creature)
 Restore uses for all items carried by the creature. More...
 
void NWNX_Creature_SetSize (object creature, int size)
 Sets the creature size. More...
 
int NWNX_Creature_GetSkillPointsRemaining (object creature)
 Gets the creature's remaining unspent skill points. More...
 
void NWNX_Creature_SetSkillPointsRemaining (object creature, int skillpoints)
 Sets the creature's remaining unspent skill points. More...
 
int NWNX_Creature_GetSkillPointsRemainingByLevel (object creature, int level)
 Gets the creature's remaining unspent skill points for level. More...
 
void NWNX_Creature_SetSkillPointsRemainingByLevel (object creature, int level, int value)
 Sets the creature's remaining unspent skill points for level. More...
 
void NWNX_Creature_SetRacialType (object creature, int racialtype)
 Sets the creature's racial type. More...
 
void NWNX_Creature_SetGold (object creature, int gold)
 Sets the creature's gold without sending a feedback message. More...
 
void NWNX_Creature_SetCorpseDecayTime (object creature, int nDecayTime)
 Sets corpse decay time in milliseconds. More...
 
int NWNX_Creature_GetBaseSavingThrow (object creature, int which)
 Gets the creature's base save. More...
 
void NWNX_Creature_SetBaseSavingThrow (object creature, int which, int value)
 Sets the creature's base save. More...
 
void NWNX_Creature_LevelUp (object creature, int class, int count=1, int package=PACKAGE_INVALID)
 Add levels of class to the creature, bypassing all validation. More...
 
void NWNX_Creature_LevelDown (object creature, int count=1)
 Remove last levels from a creature. More...
 
void NWNX_Creature_SetChallengeRating (object creature, float fCR)
 Sets the creature's challenge rating. More...
 
int NWNX_Creature_GetAttackBonus (object creature, int isMelee=-1, int isTouchAttack=FALSE, int isOffhand=FALSE, int includeBaseAttackBonus=TRUE)
 Returns the creature's highest attack bonus based on its own stats. More...
 
int NWNX_Creature_GetHighestLevelOfFeat (object creature, int feat)
 Get highest level version of feat possessed by creature. More...
 
int NWNX_Creature_GetFeatRemainingUses (object creature, int feat)
 Get feat remaining uses. More...
 
int NWNX_Creature_GetFeatTotalUses (object creature, int feat)
 Get feat total uses. More...
 
void NWNX_Creature_SetFeatRemainingUses (object creature, int feat, int uses)
 Set feat remaining uses. More...
 
int NWNX_Creature_GetTotalEffectBonus (object creature, int bonusType=NWNX_CREATURE_BONUS_TYPE_ATTACK, object target=OBJECT_INVALID, int isElemental=0, int isForceMax=0, int savetype=-1, int saveSpecificType=-1, int skill=-1, int abilityScore=-1, int isOffhand=FALSE)
 Get total effect bonus. More...
 
void NWNX_Creature_SetOriginalName (object creature, string name, int isLastName)
 Set the original first or last name of creature. More...
 
string NWNX_Creature_GetOriginalName (object creature, int isLastName)
 Get the original first or last name of creature. More...
 
void NWNX_Creature_SetSpellResistance (object creature, int sr)
 Set creature's spell resistance. More...
 
void NWNX_Creature_SetAnimalCompanionCreatureType (object creature, int type)
 Set creature's animal companion creature type. More...
 
void NWNX_Creature_SetFamiliarCreatureType (object creature, int type)
 Set creature's familiar creature type. More...
 
void NWNX_Creature_SetAnimalCompanionName (object creature, string name)
 Set creature's animal companion's name. More...
 
void NWNX_Creature_SetFamiliarName (object creature, string name)
 Set creature's familiar's name. More...
 
int NWNX_Creature_GetDisarmable (object creature)
 Get whether the creature can be disarmed. More...
 
void NWNX_Creature_SetDisarmable (object creature, int disarmable)
 Set whether a creature can be disarmed. More...
 
void NWNX_Creature_SetDomain (object creature, int class, int index, int domain)
 Sets one of creature's domains. More...
 
void NWNX_Creature_SetSpecialization (object creature, int class, int school)
 Sets creature's specialist school. More...
 
void NWNX_Creature_SetFaction (object oCreature, int nFactionId)
 Sets oCreatures faction to be the faction with id nFactionId. More...
 
int NWNX_Creature_GetFaction (object oCreature)
 Gets the faction id from oCreature. More...
 
int NWNX_Creature_GetFlatFooted (object oCreature)
 Get whether a creature is flat-footed. More...
 
string NWNX_Creature_SerializeQuickbar (object oCreature)
 Serialize oCreature's quickbar to a base64 string. More...
 
int NWNX_Creature_DeserializeQuickbar (object oCreature, string sSerializedQuickbar)
 Deserialize sSerializedQuickbar for oCreature. More...
 
void NWNX_Creature_SetCasterLevelModifier (object oCreature, int nClass, int nModifier, int bPersist=FALSE)
 Sets a caster level modifier for oCreature. More...
 
int NWNX_Creature_GetCasterLevelModifier (object oCreature, int nClass)
 Gets the current caster level modifier for oCreature. More...
 
void NWNX_Creature_SetCasterLevelOverride (object oCreature, int nClass, int nCasterLevel, int bPersist=FALSE)
 Sets a caster level override for oCreature. More...
 
int NWNX_Creature_GetCasterLevelOverride (object oCreature, int nClass)
 Gets the current caster level override for oCreature. More...
 
void NWNX_Creature_JumpToLimbo (object oCreature)
 Move a creature to limbo. More...
 
void NWNX_Creature_SetCriticalMultiplierModifier (object oCreature, int nModifier, int nHand=0, int bPersist=FALSE, int nBaseItem=-1)
 Sets the critical hit multiplier modifier for the Creature. More...
 
int NWNX_Creature_GetCriticalMultiplierModifier (object oCreature, int nHand=0, int nBaseItem=-1)
 Gets the critical hit multiplier modifier for the Creature. More...
 
void NWNX_Creature_SetCriticalMultiplierOverride (object oCreature, int nOverride, int nHand=0, int bPersist=FALSE, int nBaseItem=-1)
 Sets the critical hit multiplier override for the Creature. More...
 
int NWNX_Creature_GetCriticalMultiplierOverride (object oCreature, int nHand=0, int nBaseItem=-1)
 Gets the critical hit multiplier override for the Creature. More...
 
void NWNX_Creature_SetCriticalRangeModifier (object oCreature, int nModifier, int nHand=0, int bPersist=FALSE, int nBaseItem=-1)
 Sets the critical hit range modifier for the creature. More...
 
int NWNX_Creature_GetCriticalRangeModifier (object oCreature, int nHand=0, int nBaseItem=-1)
 Gets the critical hit range modifier for the creature. More...
 
void NWNX_Creature_SetCriticalRangeOverride (object oCreature, int nOverride, int nHand=0, int bPersist=FALSE, int nBaseItem=-1)
 Sets the critical hit range Override for the creature. More...
 
int NWNX_Creature_GetCriticalRangeOverride (object oCreature, int nHand=0, int nBaseItem=-1)
 Sets the critical hit range Override for the creature. More...
 
void NWNX_Creature_AddAssociate (object oCreature, object oAssociate, int nAssociateType)
 Add oAssociate as nAssociateType to oCreature. More...
 
void NWNX_Creature_OverrideDamageLevel (object oCreature, int nDamageLevel)
 Override the damage level of oCreature. More...
 
void NWNX_Creature_SetEncounter (object oCreature, object oEncounter)
 Set the encounter source of oCreature. More...
 
object NWNX_Creature_GetEncounter (object oCreature)
 Get the encounter source of oCreature. More...
 
int NWNX_Creature_GetIsBartering (object oCreature)
 Get if oCreature is currently bartering. More...
 
void NWNX_Creature_SetLastItemCasterLevel (object oCreature, int nCasterLvl)
 Sets caster level for the last item used. Use in a spellhook or spell event before to set caster level for any spells cast from the item. More...
 
int NWNX_Creature_GetLastItemCasterLevel (object oCreature)
 Gets the caster level of the last item used. More...
 
int NWNX_Creature_GetArmorClassVersus (object oAttacked, object oVersus, int nTouch=FALSE)
 Gets the Armor classed of attacked against versus. More...
 
int NWNX_Creature_GetWalkAnimation (object oCreature)
 Gets the current walk animation of oCreature. More...
 
void NWNX_Creature_SetWalkAnimation (object oCreature, int nAnimation)
 Sets the current walk animation of oCreature. More...
 
void NWNX_Creature_SetAttackRollOverride (object oCreature, int nRoll, int nModifier)
 Changes the attack modifier depending on the dice roll. Used to skip autofail on 1 and autosucceed on 20 as well. More...
 
void NWNX_Creature_SetParryAllAttacks (object oCreature, int bParry)
 Works like the tweak but can be turned on and off for all creatures or single ones. More...
 
int NWNX_Creature_GetNoPermanentDeath (object oCreature)
 Gets the NoPermanentDeath flag of oCreature. More...
 
void NWNX_Creature_SetNoPermanentDeath (object oCreature, int bNoPermanentDeath)
 Sets the NoPermanentDeath flag of oCreature. More...
 
vector NWNX_Creature_ComputeSafeLocation (object oCreature, vector vPosition, float fRadius=20.0f, int bWalkStraightLineRequired=TRUE)
 Compute a safe location for oCreature. More...
 
void NWNX_Creature_DoPerceptionUpdateOnCreature (object oCreature, object oTargetCreature)
 Update oCreature's perception of oTargetCreature. More...
 
float NWNX_Creature_GetPersonalSpace (object oCreature)
 Get a creatures personal space (meters from center to non-creature objects). More...
 
void NWNX_Creature_SetPersonalSpace (object oCreature, float fPerspace)
 Set a creatures personal space (meters from center to non-creature objects). More...
 
float NWNX_Creature_GetCreaturePersonalSpace (object oCreature)
 Get a creatures creature personal space (meters from center to other creatures). More...
 
void NWNX_Creature_SetCreaturePersonalSpace (object oCreature, float fCrePerspace)
 Set a creatures creature personal space (meters from center to other creatures). More...
 
float NWNX_Creature_GetHeight (object oCreature)
 Get a creatures height. More...
 
void NWNX_Creature_SetHeight (object oCreature, float fHeight)
 Set a creatures height. More...
 
float NWNX_Creature_GetHitDistance (object oCreature)
 Get a creatures hit distance. More...
 
void NWNX_Creature_SetHitDistance (object oCreature, float fHitDist)
 Set a creatures hit distance. More...
 
float NWNX_Creature_GetPreferredAttackDistance (object oCreature)
 Get a creatures preferred attack distance. More...
 
void NWNX_Creature_SetPreferredAttackDistance (object oCreature, float fPrefAtckDist)
 Set a creatures preferred attack distance. More...
 
int NWNX_Creature_GetArmorCheckPenalty (object oCreature)
 Get the skill penalty from wearing armor. More...
 
int NWNX_Creature_GetShieldCheckPenalty (object oCreature)
 Get the skill penalty from wearing a shield. More...
 
void NWNX_Creature_SetBypassEffectImmunity (object oCreature, int nImmunityType, int nChance=100, int bPersist=FALSE)
 Sets a chance for normal Effect Immunities to be bypassed. More...
 
int NWNX_Creature_GetBypassEffectImmunity (object oCreature, int nImmunityType)
 Gets a chance for normal Effect Immunities to be bypassed. More...
 
void NWNX_Creature_SetLastKiller (object oCreature, object oKiller)
 Sets the killer of oCreature to oKiller. More...
 
void NWNX_Creature_DoItemCastSpell (object oCreature, object oTarget, location locTarget, int nSpellID, int nCasterLevel, float fProjectileTime, int nProjectilePathType=PROJECTILE_PATH_TYPE_DEFAULT, int nProjectileSpellID=-1, object oItem=OBJECT_INVALID, string sImpactScript="")
 Instantly cast a spell at a target or location. More...
 
int NWNX_Creature_RunEquip (object oCreature, object oItem, int nInventorySlot)
 Have oCreature instantly equip oItem to nInventorySlot. More...
 
int NWNX_Creature_RunUnequip (object oCreature, object oItem)
 Have oCreature instantly unequip oItem. More...
 
void NWNX_Creature_OverrideRangedProjectileVFX (object oCreature, int nProjectileVFX, int bPersist=FALSE)
 Override the elemental projectile visual effect of ranged/throwing weapons. More...
 
void NWNX_Creature_SetInitiativeModifier (object oCreature, int nMod, int bPersist=FALSE)
 Sets a custom Initiative modifier. More...
 
int NWNX_Creature_GetInitiativeModifier (object oCreature)
 Gets the custom Initiative modifier. More...
 
object NWNX_Creature_GetBodyBag (object oCreature)
 Gets the Body Bag of a creature. More...
 
int NWNX_Creature_AddCastSpellActions (object oCreature, object oTarget, vector vTargetLocation, int nSpellID, int nMultiClass, int nMetaMagic=METAMAGIC_NONE, int nDomainLevel=0, int nProjectilePathType=PROJECTILE_PATH_TYPE_DEFAULT, int bInstant=FALSE, int bClearActions=FALSE, int bAddToFront=FALSE)
 Add a cast spell action to oCreature's action queue. More...
 
int NWNX_Creature_GetIsFlanking (object oCreature, object oTargetCreature)
 Get whether oCreature is flanking oTargetCreature. More...
 
void NWNX_Creature_DecrementRemainingSpellSlots (object oCreature, int nClass, int nSpellLevel)
 Decrements the remaining spell slots (innate casting) at a class level. More...
 
void NWNX_Creature_IncrementRemainingSpellSlots (object oCreature, int nClass, int nSpellLevel)
 Increments the remaining spell slots (innate casting) at a class level. More...
 
int NWNX_Creature_GetMaximumBonusAttacks (object oCreature)
 Gets the maximum number of bonus attacks a creature can have from EffectModifyAttacks(). More...
 
void NWNX_Creature_SetMaximumBonusAttacks (object oCreature, int nMaxBonusAttacks, int bPersist=FALSE)
 Sets the maximum number of bonus attacks a creature can have from EffectModifyAttacks(). More...
 
void NWNX_Creature_DoCleaveAttack (object oCreature)
 Inserts a cleave or great cleave attack into oCreature's current attack round against the nearest enemy within melee reach. More...
 
object NWNX_Creature_GetLockOrientationToObject (object oCreature)
 Gets the current object oCreature's orientation is locked to. More...
 
void NWNX_Creature_SetLockOrientationToObject (object oCreature, object oTarget)
 Locks oCreature's orientation to always face oTarget. More...
 
void NWNX_Creature_BroadcastAttackOfOpportunity (object oCreature, object oSingleCreature=OBJECT_INVALID, int bMovement=FALSE)
 Causes oCreature to broadcast an Attack of Opportunity against themself. More...
 
int NWNX_Creature_GetMaxSellToStorePriceOverride (object oCreature, object oStore)
 Returns the maximum price oStore will buy items from oCreature for. More...
 
void NWNX_Creature_SetMaxSellToStorePriceOverride (object oCreature, object oStore, int nMaxSellToPrice)
 Overrides the maximum price oStore will buy items from oCreature for. More...
 
int NWNX_Creature_GetAbilityIncreaseByLevel (object oCreature, int nLevel)
 Returns the creature's ability increase for nLevel. More...
 
void NWNX_Creature_SetAbilityIncreaseByLevel (object oCreature, int nLevel, int nAbility)
 Sets the creature's ability increase for nLevel. More...
 
float NWNX_Creature_GetMaxAttackRange (object oCreature, object oTarget)
 Returns the creature's maximum attack range to a target. More...
 

Variables

const int NWNX_CREATURE_ABILITY_NONE = 6
 

Function Documentation

◆ NWNX_Creature_AddFeat()

void NWNX_Creature_AddFeat ( object  creature,
int  feat 
)

Gives the creature a feat.

Parameters
creatureThe creature object.
featThe feat id.
Remarks
Consider also using NWNX_Creature_AddFeatByLevel() to properly allocate the feat to a level

Definition at line 1012 of file nwnx_creature.nss.

◆ NWNX_Creature_AddFeatByLevel()

void NWNX_Creature_AddFeatByLevel ( object  creature,
int  feat,
int  level 
)

Gives the creature a feat assigned at a level.

Parameters
creatureThe creature object.
featThe feat id.
levelThe level they gained the feat.
Remarks
Adds the feat to the stat list at the provided level.

Definition at line 1021 of file nwnx_creature.nss.

◆ NWNX_Creature_RemoveFeat()

void NWNX_Creature_RemoveFeat ( object  creature,
int  feat 
)

Removes a feat from a creature.

Parameters
creatureThe creature object.
featThe feat id.

Definition at line 1032 of file nwnx_creature.nss.

◆ NWNX_Creature_RemoveFeatByLevel()

void NWNX_Creature_RemoveFeatByLevel ( object  creature,
int  feat,
int  level 
)

Removes the creature a feat assigned at a level.

Parameters
creatureThe creature object.
featThe feat id.
levelThe level they gained the feat.
Remarks
Removes the feat from the stat list at the provided level. Does not remove the feat from the creature, use NWNX_Creature_RemoveFeat for this.

Definition at line 1041 of file nwnx_creature.nss.

◆ NWNX_Creature_GetKnowsFeat()

int NWNX_Creature_GetKnowsFeat ( object  creature,
int  feat 
)

Determines if the creature knows a feat.

Note
This differs from native GetHasFeat which returns FALSE if the feat has no more uses per day.
Parameters
creatureThe creature object.
featThe feat id.
Returns
TRUE if the creature has the feat, regardless if they have any usages left or not.

Definition at line 1052 of file nwnx_creature.nss.

◆ NWNX_Creature_GetFeatCountByLevel()

int NWNX_Creature_GetFeatCountByLevel ( object  creature,
int  level 
)

Returns the count of feats learned at the provided level.

Parameters
creatureThe creature object.
levelThe level.
Returns
The count of feats.

Definition at line 1063 of file nwnx_creature.nss.

◆ NWNX_Creature_GetFeatByLevel()

int NWNX_Creature_GetFeatByLevel ( object  creature,
int  level,
int  index 
)

Returns the feat learned at the level and index.

Parameters
creatureThe creature object.
levelThe level.
indexThe index. Index bounds: 0 <= index < NWNX_Creature_GetFeatCountByLevel().
Returns
The feat id at the index.

Definition at line 1074 of file nwnx_creature.nss.

◆ NWNX_Creature_GetFeatGrantLevel()

int NWNX_Creature_GetFeatGrantLevel ( object  creature,
int  feat 
)

Returns the creature level where the specified feat was learned.

Parameters
creatureThe creature object.
featThe feat id.
Returns
The character level that the specified feat was granted, otherwise 0 if the creature does not have this feat.

Definition at line 1096 of file nwnx_creature.nss.

◆ NWNX_Creature_GetFeatCount()

int NWNX_Creature_GetFeatCount ( object  creature)

Get the total number of feats known by creature.

Parameters
creatureThe creature object.
Returns
The total feat count for the creature.

Definition at line 1086 of file nwnx_creature.nss.

◆ NWNX_Creature_GetFeatByIndex()

int NWNX_Creature_GetFeatByIndex ( object  creature,
int  index 
)

Returns the creature's feat at a given index.

Parameters
creatureThe creature object.
indexThe index. Index bounds: 0 <= index < NWNX_Creature_GetFeatCount();
Returns
The feat id at the index.

Definition at line 1106 of file nwnx_creature.nss.

◆ NWNX_Creature_GetMeetsFeatRequirements()

int NWNX_Creature_GetMeetsFeatRequirements ( object  creature,
int  feat 
)

Gets if creature meets feat requirements.

Parameters
creatureThe creature object.
featThe feat id.
Returns
TRUE if creature meets all requirements to take given feat

Definition at line 1117 of file nwnx_creature.nss.

◆ NWNX_Creature_GetSpecialAbilityCount()

int NWNX_Creature_GetSpecialAbilityCount ( object  creature)

Gets the count of special abilities of the creature.

Parameters
creatureThe creature object.
Returns
The total special ability count.

Definition at line 1146 of file nwnx_creature.nss.

◆ NWNX_Creature_GetSpecialAbility()

struct NWNX_Creature_SpecialAbility NWNX_Creature_GetSpecialAbility ( object  creature,
int  index 
)

Returns the creature's special ability at a given index.

Parameters
creatureThe creature object.
indexThe index. Index bounds: 0 <= index < NWNX_Creature_GetSpecialAbilityCount().
Returns
An NWNX_Creature_SpecialAbility struct.

Definition at line 1128 of file nwnx_creature.nss.

◆ NWNX_Creature_AddSpecialAbility()

void NWNX_Creature_AddSpecialAbility ( object  creature,
struct NWNX_Creature_SpecialAbility  ability 
)

Adds a special ability to a creature.

Parameters
creatureThe creature object.
abilityAn NWNX_Creature_SpecialAbility struct.

Definition at line 1156 of file nwnx_creature.nss.

◆ NWNX_Creature_RemoveSpecialAbility()

void NWNX_Creature_RemoveSpecialAbility ( object  creature,
int  index 
)

Removes a special ability from a creature.

Parameters
creatureThe creature object.
indexThe index. Index bounds: 0 <= index < NWNX_Creature_GetSpecialAbilityCount().

Definition at line 1168 of file nwnx_creature.nss.

◆ NWNX_Creature_SetSpecialAbility()

void NWNX_Creature_SetSpecialAbility ( object  creature,
int  index,
struct NWNX_Creature_SpecialAbility  ability 
)

Sets a special ability at the index for the creature.

Parameters
creatureThe creature object.
indexThe index. Index bounds: 0 <= index < NWNX_Creature_GetSpecialAbilityCount().
abilityAn NWNX_Creature_SpecialAbility struct.

Definition at line 1178 of file nwnx_creature.nss.

◆ NWNX_Creature_GetClassByLevel()

int NWNX_Creature_GetClassByLevel ( object  creature,
int  level 
)

Get the class taken by the creature at the provided level.

Parameters
creatureThe creature object.
levelThe level.
Returns
The class id.

Definition at line 1191 of file nwnx_creature.nss.

◆ NWNX_Creature_SetBaseAC()

void NWNX_Creature_SetBaseAC ( object  creature,
int  ac 
)

Sets the base AC for the creature.

Parameters
creatureThe creature object.
acThe base AC to set for the creature.

Definition at line 1202 of file nwnx_creature.nss.

◆ NWNX_Creature_GetBaseAC()

int NWNX_Creature_GetBaseAC ( object  creature)

Get the base AC for the creature.

Parameters
creatureThe creature object.
Returns
The base AC.

Definition at line 1212 of file nwnx_creature.nss.

◆ NWNX_Creature_SetRawAbilityScore()

void NWNX_Creature_SetRawAbilityScore ( object  creature,
int  ability,
int  value 
)

Sets the ability score of the creature to the provided value.

Note
Does not apply racial bonuses/penalties.
Parameters
creatureThe creature object.
abilityThe ability constant.
valueThe value to set.

Definition at line 1222 of file nwnx_creature.nss.

◆ NWNX_Creature_GetRawAbilityScore()

int NWNX_Creature_GetRawAbilityScore ( object  creature,
int  ability 
)

Gets the ability score of the creature.

Note
Does not apply racial bonuses/penalties.
Parameters
creatureThe creature object.
abilityThe ability constant.
Returns
The ability score.

Definition at line 1233 of file nwnx_creature.nss.

◆ NWNX_Creature_ModifyRawAbilityScore()

void NWNX_Creature_ModifyRawAbilityScore ( object  creature,
int  ability,
int  modifier 
)

Adjusts the ability score of a creature.

Note
Does not apply racial bonuses/penalties.
Parameters
creatureThe creature object.
abilityThe ability constant.
modifierThe modifier value.

Definition at line 1244 of file nwnx_creature.nss.

◆ NWNX_Creature_GetPrePolymorphAbilityScore()

int NWNX_Creature_GetPrePolymorphAbilityScore ( object  creature,
int  ability 
)

Gets the raw ability score a polymorphed creature had prior to polymorphing.

Note
For Strength, Dexterity and Constitution only.
Parameters
creatureThe creature object.
abilityThe ability constant.
Returns
The raw ability score.

Definition at line 1255 of file nwnx_creature.nss.

◆ NWNX_Creature_GetRemainingSpellSlots()

int NWNX_Creature_GetRemainingSpellSlots ( object  creature,
int  class,
int  level 
)

Gets the remaining spell slots (innate casting) at a class level's index.

Parameters
creatureThe creature object.
classThe class id from classes.2da. (Not class index 0-2)
levelThe spell level.
Returns
The remaining spell slot count.

Definition at line 1266 of file nwnx_creature.nss.

◆ NWNX_Creature_SetRemainingSpellSlots()

void NWNX_Creature_SetRemainingSpellSlots ( object  creature,
int  class,
int  level,
int  slots 
)

Sets the remaining spell slots (innate casting) at a class level.

Parameters
creatureThe creature object.
classThe class id from classes.2da. (Not class index 0-2)
levelThe spell level.
slotsThe remaining spell slots to set.

Definition at line 1278 of file nwnx_creature.nss.

◆ NWNX_Creature_GetMaxSpellSlots()

int NWNX_Creature_GetMaxSpellSlots ( object  creature,
int  class,
int  level 
)

Gets the maximum spell slots (innate casting) at a class level.

Parameters
creatureThe creature object.
classThe class id from classes.2da. (Not class index 0-2)
levelThe spell level.
Returns
The maximum spell slot count.

Definition at line 1314 of file nwnx_creature.nss.

◆ NWNX_Creature_AddKnownSpell()

void NWNX_Creature_AddKnownSpell ( object  creature,
int  class,
int  level,
int  spellId 
)

Add a spell to a creature's spellbook for class.

Parameters
creatureThe creature object.
classThe class id from classes.2da. (Not class index 0-2)
levelThe spell level.
spellIdThe spell to remove.

Definition at line 1302 of file nwnx_creature.nss.

◆ NWNX_Creature_RemoveKnownSpell()

void NWNX_Creature_RemoveKnownSpell ( object  creature,
int  class,
int  level,
int  spellId 
)

Remove a spell from creature's spellbook for class.

Parameters
creatureThe creature object.
classThe class id from classes.2da. (Not class index 0-2)
levelThe spell level.
spellIdThe spell to remove.

Definition at line 1290 of file nwnx_creature.nss.

◆ NWNX_Creature_GetMaxHitPointsByLevel()

int NWNX_Creature_GetMaxHitPointsByLevel ( object  creature,
int  level 
)

Gets the maximum hit points for creature for level.

Parameters
creatureThe creature object.
levelThe level.
Returns
The maximum hit points a creature can have for the class at the provided level.

Definition at line 1327 of file nwnx_creature.nss.

◆ NWNX_Creature_SetMaxHitPointsByLevel()

void NWNX_Creature_SetMaxHitPointsByLevel ( object  creature,
int  level,
int  value 
)

Sets the maximum hit points for creature.

Parameters
creatureThe creature object.
levelThe level.
valueThe amount to set the max hit points.

Definition at line 1338 of file nwnx_creature.nss.

◆ NWNX_Creature_SetMovementRate()

void NWNX_Creature_SetMovementRate ( object  creature,
int  rate 
)

Set creature's movement rate.

Parameters
creatureThe creature object.
rateThe movement rate.

Definition at line 1349 of file nwnx_creature.nss.

◆ NWNX_Creature_GetMovementRateFactor()

float NWNX_Creature_GetMovementRateFactor ( object  creature)

Returns the creature's current movement rate factor.

Remarks
Base movement rate factor is 1.0.
Parameters
creatureThe creature object.
Returns
The current movement rate factor.

Definition at line 1359 of file nwnx_creature.nss.

◆ NWNX_Creature_SetMovementRateFactor()

void NWNX_Creature_SetMovementRateFactor ( object  creature,
float  rate 
)

Sets the creature's current movement rate factor.

Note
Base movement rate factor is 1.0.
Parameters
creatureThe creature object.
rateThe rate to set.

Definition at line 1368 of file nwnx_creature.nss.

◆ NWNX_Creature_GetMovementRateFactorCap()

float NWNX_Creature_GetMovementRateFactorCap ( object  creature)

Returns the creature's maximum movement rate cap.

Remarks
Default movement rate cap is 1.5.
Parameters
creatureThe creature object.
Returns
The maximum movement rate cap.

Definition at line 1378 of file nwnx_creature.nss.

◆ NWNX_Creature_SetMovementRateFactorCap()

void NWNX_Creature_SetMovementRateFactorCap ( object  creature,
float  cap 
)

Sets the creature's maximum movement rate cap.

Note
Default movement rate cap is 1.5.
Parameters
creatureThe creature object.
capThe cap to set.

Definition at line 1387 of file nwnx_creature.nss.

◆ NWNX_Creature_GetMovementType()

int NWNX_Creature_GetMovementType ( object  creature)

Returns the creature's current movement type.

Parameters
creatureThe creature object.
Returns
An NWNX_CREATURE_MOVEMENT_TYPE_* constant.

Definition at line 1574 of file nwnx_creature.nss.

◆ NWNX_Creature_SetWalkRateCap()

void NWNX_Creature_SetWalkRateCap ( object  creature,
float  fWalkRate = 2000.0f 
)

Sets the maximum movement rate a creature can have while walking (not running)

Remarks
This allows a creature with movement speed enhancements to walk at a normal rate.
Parameters
creatureThe creature object.
fWalkRateThe walk rate to apply. Setting the value to -1.0 will remove the cap. Default value is 2000.0, which is the base human walk speed.

Definition at line 1583 of file nwnx_creature.nss.

◆ NWNX_Creature_SetAlignmentGoodEvil()

void NWNX_Creature_SetAlignmentGoodEvil ( object  creature,
int  value 
)

Set creature's raw good/evil alignment value.

Parameters
creatureThe creature object.
valueThe value to set.

Definition at line 1397 of file nwnx_creature.nss.

◆ NWNX_Creature_SetAlignmentLawChaos()

void NWNX_Creature_SetAlignmentLawChaos ( object  creature,
int  value 
)

Set creature's raw law/chaos alignment value.

Parameters
creatureThe creature object.
valueThe value to set.

Definition at line 1407 of file nwnx_creature.nss.

◆ NWNX_Creature_SetSkillRank()

void NWNX_Creature_SetSkillRank ( object  creature,
int  skill,
int  rank 
)

Set the base ranks in a skill for creature.

Parameters
creatureThe creature object.
skillThe skill id.
rankThe value to set as the skill rank.

Definition at line 1417 of file nwnx_creature.nss.

◆ NWNX_Creature_GetSkillRankByLevel()

int NWNX_Creature_GetSkillRankByLevel ( object  creature,
int  skill,
int  level 
)

Get the ranks in a skill for creature assigned at a level.

Parameters
creatureThe creature object.
skillThe skill id.
levelThe level they gained skill ranks.
Returns
The rank in a skill assigned at a level (-1 on error).

Definition at line 1427 of file nwnx_creature.nss.

◆ NWNX_Creature_SetSkillRankByLevel()

void NWNX_Creature_SetSkillRankByLevel ( object  creature,
int  skill,
int  rank,
int  level 
)

Set the ranks in a skill for creature assigned at a level.

Note
It only affect the leveling array, to know what to do on level-down. To effectivly change the skill rank on the current level, NWNX_Creature_SetSkillRank is also needed.
Parameters
creatureThe creature object.
skillThe skill id.
levelThe level they gained skill ranks.
rankThe value to set as the skill rank.

Definition at line 1439 of file nwnx_creature.nss.

◆ NWNX_Creature_SetClassByPosition()

void NWNX_Creature_SetClassByPosition ( object  creature,
int  position,
int  classID,
int  bUpdateLevels = TRUE 
)

Set the class ID in a particular position for a creature.

Parameters
creatureThe creature object.
positionShould be 0, 1, or 2 depending on how many classes the creature has and which is to be modified.
classIDA valid ID number in classes.2da and between 0 and 255.
bUpdateLevelsdetermines whether the method will replace all occurrences of the old class in CNWLevelStats with the new classID.

Definition at line 1451 of file nwnx_creature.nss.

◆ NWNX_Creature_SetLevelByPosition()

void NWNX_Creature_SetLevelByPosition ( object  creature,
int  position,
int  level 
)

Set the level at the given position for a creature.

Note
A creature should already have a class in that position.
Parameters
creatureThe creature object.
positionShould be 0, 1, or 2 depending on how many classes the creature has and which is to be modified.
levelThe level to set.

Definition at line 1462 of file nwnx_creature.nss.

◆ NWNX_Creature_SetBaseAttackBonus()

void NWNX_Creature_SetBaseAttackBonus ( object  creature,
int  bab 
)

Set creature's base attack bonus (BAB).

Note
Modifying the BAB will also affect the creature's attacks per round and its eligibility for feats, prestige classes, etc.
Parameters
creatureThe creature object.
babThe BAB value. Should be between 0 and 254. Setting BAB to 0 will cause the creature to revert to its original BAB based on its classes and levels. A creature can never have an actual BAB of zero.
Remarks
The base game has a function SetBaseAttackBonus, which actually sets the bonus attacks per round for a creature, not the BAB.

Definition at line 1472 of file nwnx_creature.nss.

◆ NWNX_Creature_GetAttacksPerRound()

int NWNX_Creature_GetAttacksPerRound ( object  creature,
int  bBaseAPR = FALSE 
)

Gets the creatures current attacks per round (using equipped weapon).

Parameters
creatureThe creature object.
bBaseAPRIf TRUE, will return the base attacks per round, based on BAB and equipped weapons, regardless of overrides set by calls to SetBaseAttackBonus builtin function.
Returns
The attacks per round.

Definition at line 1481 of file nwnx_creature.nss.

◆ NWNX_Creature_RestoreFeats()

void NWNX_Creature_RestoreFeats ( object  creature)

Restore all creature feat uses.

Parameters
creatureThe creature object.

Definition at line 1491 of file nwnx_creature.nss.

◆ NWNX_Creature_RestoreSpecialAbilities()

void NWNX_Creature_RestoreSpecialAbilities ( object  creature)

Restore all creature special ability uses.

Parameters
creatureThe creature object.

Definition at line 1499 of file nwnx_creature.nss.

◆ NWNX_Creature_RestoreItems()

void NWNX_Creature_RestoreItems ( object  creature)

Restore uses for all items carried by the creature.

Parameters
creatureThe creature object.

Definition at line 1507 of file nwnx_creature.nss.

◆ NWNX_Creature_SetSize()

void NWNX_Creature_SetSize ( object  creature,
int  size 
)

Sets the creature size.

Parameters
creatureThe creature object.
sizeUse CREATURE_SIZE_* constants.

Definition at line 1515 of file nwnx_creature.nss.

◆ NWNX_Creature_GetSkillPointsRemaining()

int NWNX_Creature_GetSkillPointsRemaining ( object  creature)

Gets the creature's remaining unspent skill points.

Parameters
creatureThe creature object.
Returns
The remaining unspent skill points.

Definition at line 1524 of file nwnx_creature.nss.

◆ NWNX_Creature_SetSkillPointsRemaining()

void NWNX_Creature_SetSkillPointsRemaining ( object  creature,
int  skillpoints 
)

Sets the creature's remaining unspent skill points.

Parameters
creatureThe creature object.
skillpointsThe value to set.

Definition at line 1534 of file nwnx_creature.nss.

◆ NWNX_Creature_GetSkillPointsRemainingByLevel()

int NWNX_Creature_GetSkillPointsRemainingByLevel ( object  creature,
int  level 
)

Gets the creature's remaining unspent skill points for level.

Parameters
creatureThe creature object.
levelThe level.
Returns
The remaining unspent skill points for level.

Definition at line 1543 of file nwnx_creature.nss.

◆ NWNX_Creature_SetSkillPointsRemainingByLevel()

void NWNX_Creature_SetSkillPointsRemainingByLevel ( object  creature,
int  level,
int  value 
)

Sets the creature's remaining unspent skill points for level.

Parameters
creatureThe creature object.
levelThe level.
valueThe value to set for level.

Definition at line 1554 of file nwnx_creature.nss.

◆ NWNX_Creature_SetRacialType()

void NWNX_Creature_SetRacialType ( object  creature,
int  racialtype 
)

Sets the creature's racial type.

Parameters
creatureThe creature object.
racialtypeThe racial type to set.

Definition at line 1565 of file nwnx_creature.nss.

◆ NWNX_Creature_SetGold()

void NWNX_Creature_SetGold ( object  creature,
int  gold 
)

Sets the creature's gold without sending a feedback message.

Parameters
creatureThe creature object.
goldThe amount of gold to set for their creature.

Definition at line 1592 of file nwnx_creature.nss.

◆ NWNX_Creature_SetCorpseDecayTime()

void NWNX_Creature_SetCorpseDecayTime ( object  creature,
int  nDecayTime 
)

Sets corpse decay time in milliseconds.

Parameters
creatureThe creature object.
nDecayTimeThe corpse decay time.

Definition at line 1601 of file nwnx_creature.nss.

◆ NWNX_Creature_GetBaseSavingThrow()

int NWNX_Creature_GetBaseSavingThrow ( object  creature,
int  which 
)

Gets the creature's base save.

Parameters
creatureThe creature object.
whichOne of SAVING_THROW_FORT, SAVING_THROW_REFLEX or SAVING_THROW_WILL
Returns
The base save value.
Note
This will include any modifiers set in the toolset.

Definition at line 1611 of file nwnx_creature.nss.

◆ NWNX_Creature_SetBaseSavingThrow()

void NWNX_Creature_SetBaseSavingThrow ( object  creature,
int  which,
int  value 
)

Sets the creature's base save.

Parameters
creatureThe creature object.
whichOne of SAVING_THROW_FORT, SAVING_THROW_REFLEX or SAVING_THROW_WILL
valueThe base save value.

Definition at line 1621 of file nwnx_creature.nss.

◆ NWNX_Creature_LevelUp()

void NWNX_Creature_LevelUp ( object  creature,
int  class,
int  count = 1,
int  package = PACKAGE_INVALID 
)

Add levels of class to the creature, bypassing all validation.

Parameters
creatureThe creature object.
classThe class id.
countThe amount of levels of class to add.
packageThe class package to use for leveling up (PACKAGE_INVALID = starting package)
Note
This will not work on player characters.

Definition at line 1631 of file nwnx_creature.nss.

◆ NWNX_Creature_LevelDown()

void NWNX_Creature_LevelDown ( object  creature,
int  count = 1 
)

Remove last levels from a creature.

Parameters
creatureThe creature object.
countThe amount of levels to decrement.
Note
This will not work on player characters.

Definition at line 1642 of file nwnx_creature.nss.

◆ NWNX_Creature_SetChallengeRating()

void NWNX_Creature_SetChallengeRating ( object  creature,
float  fCR 
)

Sets the creature's challenge rating.

Parameters
creatureThe creature object.
fCRThe challenge rating.

Definition at line 1651 of file nwnx_creature.nss.

◆ NWNX_Creature_GetAttackBonus()

int NWNX_Creature_GetAttackBonus ( object  creature,
int  isMelee = -1,
int  isTouchAttack = FALSE,
int  isOffhand = FALSE,
int  includeBaseAttackBonus = TRUE 
)

Returns the creature's highest attack bonus based on its own stats.

Note
AB vs. Type and +AB on Gauntlets are excluded
Parameters
creatureThe creature object.
isMelee
  • TRUE: Get Melee/Unarmed Attack Bonus
  • FALSE: Get Ranged Attack Bonus
  • -1: Get Attack Bonus depending on the weapon creature has equipped in its right hand Defaults to Melee Attack Bonus if weapon is invalid or no weapon
isTouchAttackIf the attack was a touch attack.
isOffhandIf the attack was with the offhand.
includeBaseAttackBonusShould the result include the base attack bonus.
Returns
The highest attack bonus.

Definition at line 1660 of file nwnx_creature.nss.

◆ NWNX_Creature_GetHighestLevelOfFeat()

int NWNX_Creature_GetHighestLevelOfFeat ( object  creature,
int  feat 
)

Get highest level version of feat possessed by creature.

Remarks
For feats that increment in power, for example, barbarian rage.
Parameters
creatureThe creature object.
featThe feat id.
Returns
The highest level version of the feat.

Definition at line 1688 of file nwnx_creature.nss.

◆ NWNX_Creature_GetFeatRemainingUses()

int NWNX_Creature_GetFeatRemainingUses ( object  creature,
int  feat 
)

Get feat remaining uses.

Parameters
creatureThe creature object.
featThe feat id.
Returns
The amount of remaining uses.

Definition at line 1699 of file nwnx_creature.nss.

◆ NWNX_Creature_GetFeatTotalUses()

int NWNX_Creature_GetFeatTotalUses ( object  creature,
int  feat 
)

Get feat total uses.

Parameters
creatureThe creature object.
featThe feat id.
Returns
The total uses.

Definition at line 1710 of file nwnx_creature.nss.

◆ NWNX_Creature_SetFeatRemainingUses()

void NWNX_Creature_SetFeatRemainingUses ( object  creature,
int  feat,
int  uses 
)

Set feat remaining uses.

Parameters
creatureThe creature object.
featThe feat id.
usesThe amount of remaining uses.

Definition at line 1721 of file nwnx_creature.nss.

◆ NWNX_Creature_GetTotalEffectBonus()

int NWNX_Creature_GetTotalEffectBonus ( object  creature,
int  bonusType = NWNX_CREATURE_BONUS_TYPE_ATTACK,
object  target = OBJECT_INVALID,
int  isElemental = 0,
int  isForceMax = 0,
int  savetype = -1,
int  saveSpecificType = -1,
int  skill = -1,
int  abilityScore = -1,
int  isOffhand = FALSE 
)

Get total effect bonus.

Remarks
This exposes the actual bonus value beyond a player's base scores to attack, damage bonus, saves, skills, ability scores, and touch attack provided by spells, equipment, potions etc.
Parameters
creatureThe creature object.
bonusTypeA Bonus Type
targetA target object. Used to calculate bonuses versus specific races, alignments, etc.
isElementalIf a damage bonus includes elemental damage.
isForceMaxIf the bonus should return the maximum possible.
savetypeA SAVING_THROW_* constant.
saveSpecificTypeA SAVING_THROW_TYPE_* constant.
skillA skill id.
abilityScoreAn ABILITY_* constant.
isOffhandWhether the attack is an offhand attack.
Returns
The bonus value.

Definition at line 1732 of file nwnx_creature.nss.

◆ NWNX_Creature_SetOriginalName()

void NWNX_Creature_SetOriginalName ( object  creature,
string  name,
int  isLastName 
)

Set the original first or last name of creature.

Parameters
creatureThe creature object.
nameThe name to give the creature.
isLastNameTRUE to change their last name, FALSE for first.
Note
For PCs this will persist to the .bic file if saved. Requires a relog to update.

Definition at line 1751 of file nwnx_creature.nss.

◆ NWNX_Creature_GetOriginalName()

string NWNX_Creature_GetOriginalName ( object  creature,
int  isLastName 
)

Get the original first or last name of creature.

Parameters
creatureThe creature object.
isLastNameTRUE to get last name, FALSE for first name.
Returns
The original first or last name of the creature.

Definition at line 1762 of file nwnx_creature.nss.

◆ NWNX_Creature_SetSpellResistance()

void NWNX_Creature_SetSpellResistance ( object  creature,
int  sr 
)

Set creature's spell resistance.

Parameters
creatureThe creature object.
srThe spell resistance.
Warning
This setting will be overwritten by effects and once those effects fade the old setting (typically 0) will be set.

Definition at line 1773 of file nwnx_creature.nss.

◆ NWNX_Creature_SetAnimalCompanionCreatureType()

void NWNX_Creature_SetAnimalCompanionCreatureType ( object  creature,
int  type 
)

Set creature's animal companion creature type.

Parameters
creatureThe master creature object.
typeThe type from ANIMAL_COMPANION_CREATURE_TYPE_*.

Definition at line 1783 of file nwnx_creature.nss.

◆ NWNX_Creature_SetFamiliarCreatureType()

void NWNX_Creature_SetFamiliarCreatureType ( object  creature,
int  type 
)

Set creature's familiar creature type.

Parameters
creatureThe master creature object.
typeThe type from FAMILIAR_CREATURE_TYPE_*.

Definition at line 1793 of file nwnx_creature.nss.

◆ NWNX_Creature_SetAnimalCompanionName()

void NWNX_Creature_SetAnimalCompanionName ( object  creature,
string  name 
)

Set creature's animal companion's name.

Parameters
creatureThe master creature object.
nameThe name to give their animal companion.

Definition at line 1803 of file nwnx_creature.nss.

◆ NWNX_Creature_SetFamiliarName()

void NWNX_Creature_SetFamiliarName ( object  creature,
string  name 
)

Set creature's familiar's name.

Parameters
creatureThe master creature object.
nameThe name to give their familiar.

Definition at line 1813 of file nwnx_creature.nss.

◆ NWNX_Creature_GetDisarmable()

int NWNX_Creature_GetDisarmable ( object  creature)

Get whether the creature can be disarmed.

Parameters
creatureThe creature object.
Returns
TRUE if the creature can be disarmed.

Definition at line 1823 of file nwnx_creature.nss.

◆ NWNX_Creature_SetDisarmable()

void NWNX_Creature_SetDisarmable ( object  creature,
int  disarmable 
)

Set whether a creature can be disarmed.

Parameters
creatureThe creature object.
disarmableSet to TRUE if the creature can be disarmed.

Definition at line 1833 of file nwnx_creature.nss.

◆ NWNX_Creature_SetDomain()

void NWNX_Creature_SetDomain ( object  creature,
int  class,
int  index,
int  domain 
)

Sets one of creature's domains.

Parameters
creatureThe creature object.
classThe class id from classes.2da. (Not class index 0-2)
indexThe first or second domain.
domainThe domain constant to set.

Definition at line 1843 of file nwnx_creature.nss.

◆ NWNX_Creature_SetSpecialization()

void NWNX_Creature_SetSpecialization ( object  creature,
int  class,
int  school 
)

Sets creature's specialist school.

Parameters
creatureThe creature object.
classThe class id from classes.2da. (Not class index 0-2)
schoolThe school constant.

Definition at line 1855 of file nwnx_creature.nss.

◆ NWNX_Creature_SetFaction()

void NWNX_Creature_SetFaction ( object  oCreature,
int  nFactionId 
)

Sets oCreatures faction to be the faction with id nFactionId.

Parameters
oCreatureThe creature.
nFactionIdThe faction id we want the creature to join.

Definition at line 1866 of file nwnx_creature.nss.

◆ NWNX_Creature_GetFaction()

int NWNX_Creature_GetFaction ( object  oCreature)

Gets the faction id from oCreature.

Parameters
oCreaturethe creature we wish to query against
Returns
faction id as an integer, -1 when used against invalid creature or invalid object.

Definition at line 1874 of file nwnx_creature.nss.

◆ NWNX_Creature_GetFlatFooted()

int NWNX_Creature_GetFlatFooted ( object  oCreature)

Get whether a creature is flat-footed.

Parameters
oCreatureThe creature object.
Returns
TRUE if the creature is flat-footed.

Definition at line 1882 of file nwnx_creature.nss.

◆ NWNX_Creature_SerializeQuickbar()

string NWNX_Creature_SerializeQuickbar ( object  oCreature)

Serialize oCreature's quickbar to a base64 string.

Parameters
oCreatureThe creature.
Returns
A base64 string representation of oCreature's quickbar.

Definition at line 1890 of file nwnx_creature.nss.

◆ NWNX_Creature_DeserializeQuickbar()

int NWNX_Creature_DeserializeQuickbar ( object  oCreature,
string  sSerializedQuickbar 
)

Deserialize sSerializedQuickbar for oCreature.

Parameters
oCreatureThe creature.
sSerializedQuickbarA base64 string of a quickbar
Returns
TRUE on success

Definition at line 1900 of file nwnx_creature.nss.

◆ NWNX_Creature_SetCasterLevelModifier()

void NWNX_Creature_SetCasterLevelModifier ( object  oCreature,
int  nClass,
int  nModifier,
int  bPersist = FALSE 
)

Sets a caster level modifier for oCreature.

Parameters
oCreaturethe target creature
nClassthe class that this modifier will apply to
nModifierthe modifier to apply
bPersistwhether the modifier should be persisted to the .bic file if applicable

Definition at line 1911 of file nwnx_creature.nss.

◆ NWNX_Creature_GetCasterLevelModifier()

int NWNX_Creature_GetCasterLevelModifier ( object  oCreature,
int  nClass 
)

Gets the current caster level modifier for oCreature.

Parameters
oCreaturethe target creature
nClassthe creature caster class
Returns
the current caster level modifier for the creature

Definition at line 1923 of file nwnx_creature.nss.

◆ NWNX_Creature_SetCasterLevelOverride()

void NWNX_Creature_SetCasterLevelOverride ( object  oCreature,
int  nClass,
int  nCasterLevel,
int  bPersist = FALSE 
)

Sets a caster level override for oCreature.

Parameters
oCreaturethe target creature
nClassthe class that this modifier will apply to
nCasterLevelthe caster level override to apply
bPersistwhether the override should be persisted to the .bic file if applicable

Definition at line 1934 of file nwnx_creature.nss.

◆ NWNX_Creature_GetCasterLevelOverride()

int NWNX_Creature_GetCasterLevelOverride ( object  oCreature,
int  nClass 
)

Gets the current caster level override for oCreature.

Parameters
oCreaturethe target creature
nClassthe creature caster class
Returns
the current caster level override for the creature or -1 if not set

Definition at line 1946 of file nwnx_creature.nss.

◆ NWNX_Creature_JumpToLimbo()

void NWNX_Creature_JumpToLimbo ( object  oCreature)

Move a creature to limbo.

Parameters
oCreatureThe creature object.

Definition at line 1957 of file nwnx_creature.nss.

◆ NWNX_Creature_SetCriticalMultiplierModifier()

void NWNX_Creature_SetCriticalMultiplierModifier ( object  oCreature,
int  nModifier,
int  nHand = 0,
int  bPersist = FALSE,
int  nBaseItem = -1 
)

Sets the critical hit multiplier modifier for the Creature.

Parameters
oCreatureThe target creature
nModifierThe modifier to apply
nHand0 for all attacks, 1 for Mainhand, 2 for Offhand
bPersistWhether the modifier should persist to .bic file if applicable
nBaseItemApplies the.modifier only when the attack used this baseitem. BASE_ITEM_GLOVES for Unarmed, '-1' for all
Note
Persistence is activated each server reset by the first use of either 'SetCriticalMultiplier*' functions. Recommended to trigger on a dummy target OnModuleLoad to enable persistence.

Definition at line 1964 of file nwnx_creature.nss.

◆ NWNX_Creature_GetCriticalMultiplierModifier()

int NWNX_Creature_GetCriticalMultiplierModifier ( object  oCreature,
int  nHand = 0,
int  nBaseItem = -1 
)

Gets the critical hit multiplier modifier for the Creature.

Parameters
oCreatureThe target creature
nHand0 for all attacks, 1 for Mainhand, 2 for Offhand
nBaseItemThe baseitem modifer to retrieve. BASE_ITEM_GLOVES for Unarmed, '-1' for all
Returns
the current critical hit multiplier modifier for the creature

Definition at line 1977 of file nwnx_creature.nss.

◆ NWNX_Creature_SetCriticalMultiplierOverride()

void NWNX_Creature_SetCriticalMultiplierOverride ( object  oCreature,
int  nOverride,
int  nHand = 0,
int  bPersist = FALSE,
int  nBaseItem = -1 
)

Sets the critical hit multiplier override for the Creature.

Parameters
oCreatureThe target creature
nOverrideThe override value to apply. -1 to clear override.
nHand0 for all attacks, 1 for Mainhand, 2 for Offhand
bPersistWhether the modifier should persist to .bic file if applicable
nBaseItemApplies the.Override only when the attack used this baseitem. BASE_ITEM_GLOVES for Unarmed, '-1' for all
Note
Persistence is activated each server reset by the first use of either 'SetCriticalMultiplier*' functions. Recommended to trigger on a dummy target OnModuleLoad to enable persistence.

Definition at line 1989 of file nwnx_creature.nss.

◆ NWNX_Creature_GetCriticalMultiplierOverride()

int NWNX_Creature_GetCriticalMultiplierOverride ( object  oCreature,
int  nHand = 0,
int  nBaseItem = -1 
)

Gets the critical hit multiplier override for the Creature.

Parameters
oCreatureThe target creature
nHand0 for all attacks, 1 for Mainhand, 2 for Offhand
nBaseItemThe baseitem Override to retrieve. BASE_ITEM_GLOVES for Unarmed, '-1' for all
Returns
the current critical hit multiplier override for the creature. No override == -1

Definition at line 2002 of file nwnx_creature.nss.

◆ NWNX_Creature_SetCriticalRangeModifier()

void NWNX_Creature_SetCriticalRangeModifier ( object  oCreature,
int  nModifier,
int  nHand = 0,
int  bPersist = FALSE,
int  nBaseItem = -1 
)

Sets the critical hit range modifier for the creature.

Parameters
oCreatureThe target creature
nModifierThe modifier to apply. Positive modifiers reduce critical chance. (I.e. From 18-20, a +1 results in crit range of 19-20)
nHand0 for all attacks, 1 for Mainhand, 2 for Offhand
bPersistWhether the modifier should persist to .bic file if applicable
nBaseItemApplies the.modifier only when the attack used this baseitem. BASE_ITEM_GLOVES for Unarmed, '-1' for all
Note
Persistence is activated each server reset by the first use of either 'SetCriticalRange*' functions. Recommended to trigger on a dummy target OnModuleLoad to enable persistence.

Definition at line 2014 of file nwnx_creature.nss.

◆ NWNX_Creature_GetCriticalRangeModifier()

int NWNX_Creature_GetCriticalRangeModifier ( object  oCreature,
int  nHand = 0,
int  nBaseItem = -1 
)

Gets the critical hit range modifier for the creature.

Parameters
oCreatureThe target creature
nHand0 for all attacks, 1 for Mainhand, 2 for Offhand
nBaseItemThe baseitem modifer to retrieve. BASE_ITEM_GLOVES for Unarmed, '-1' for all
Returns
the current critical hit range modifier for the creature

Definition at line 2027 of file nwnx_creature.nss.

◆ NWNX_Creature_SetCriticalRangeOverride()

void NWNX_Creature_SetCriticalRangeOverride ( object  oCreature,
int  nOverride,
int  nHand = 0,
int  bPersist = FALSE,
int  nBaseItem = -1 
)

Sets the critical hit range Override for the creature.

Parameters
oCreatureThe target creature
nOverrideThe new minimum roll to crit. i.e nOverride of 15 results in crit range of 15-20. -1 to clear override.
nHand0 for all attacks, 1 for Mainhand, 2 for Offhand
bPersistWhether the modifier should persist to .bic file if applicable
nBaseItemApplies the.Override only when the attack used this baseitem. BASE_ITEM_GLOVES for Unarmed, '-1' for all
Note
Persistence is activated each server reset by the first use of either 'SetCriticalRange*' functions. Recommended to trigger on a dummy target OnModuleLoad to enable persistence.

Definition at line 2039 of file nwnx_creature.nss.

◆ NWNX_Creature_GetCriticalRangeOverride()

int NWNX_Creature_GetCriticalRangeOverride ( object  oCreature,
int  nHand = 0,
int  nBaseItem = -1 
)

Sets the critical hit range Override for the creature.

Parameters
oCreatureThe target creature
nHand0 for all attacks, 1 for Mainhand, 2 for Offhand
nBaseItemThe baseitem Override to retrieve. BASE_ITEM_GLOVES for Unarmed, '-1' for all
Returns
the current critical hit range override for the creature. No override == -1

Definition at line 2052 of file nwnx_creature.nss.

◆ NWNX_Creature_AddAssociate()

void NWNX_Creature_AddAssociate ( object  oCreature,
object  oAssociate,
int  nAssociateType 
)

Add oAssociate as nAssociateType to oCreature.

Warning
Only basic checks are done so care must be taken when using this function
Parameters
oCreatureThe creature to add oAssociate to
oAssociateThe associate, must be a NPC
nAssociateTypeThe associate type, one of ASSOCIATE_TYPE_*, except _NONE

Definition at line 2064 of file nwnx_creature.nss.

◆ NWNX_Creature_OverrideDamageLevel()

void NWNX_Creature_OverrideDamageLevel ( object  oCreature,
int  nDamageLevel 
)

Override the damage level of oCreature.

Note
Damage levels are the damage state under a creature's name, for example: 'Near Death'
Parameters
oCreatureThe target creature.
nDamageLevelA damage level, see damagelevels.2da. Allowed values: 0-255 or -1 to remove the override.

Definition at line 2075 of file nwnx_creature.nss.

◆ NWNX_Creature_SetEncounter()

void NWNX_Creature_SetEncounter ( object  oCreature,
object  oEncounter 
)

Set the encounter source of oCreature.

Parameters
oCreatureThe target creature.
oEncounterThe source encounter

Definition at line 2084 of file nwnx_creature.nss.

◆ NWNX_Creature_GetEncounter()

object NWNX_Creature_GetEncounter ( object  oCreature)

Get the encounter source of oCreature.

Parameters
oCreatureThe target creature.
Returns
The encounter, OBJECT_INVALID if not part of an encounter or on error

Definition at line 2093 of file nwnx_creature.nss.

◆ NWNX_Creature_GetIsBartering()

int NWNX_Creature_GetIsBartering ( object  oCreature)

Get if oCreature is currently bartering.

Parameters
oCreatureThe target creature.
Returns
TRUE if oCreature is bartering, FALSE if not or on error.

Definition at line 2103 of file nwnx_creature.nss.

◆ NWNX_Creature_SetLastItemCasterLevel()

void NWNX_Creature_SetLastItemCasterLevel ( object  oCreature,
int  nCasterLvl 
)

Sets caster level for the last item used. Use in a spellhook or spell event before to set caster level for any spells cast from the item.

Parameters
oCreaturethe creature who used the item.
nCasterLvlthe desired caster level.

Definition at line 2113 of file nwnx_creature.nss.

◆ NWNX_Creature_GetLastItemCasterLevel()

int NWNX_Creature_GetLastItemCasterLevel ( object  oCreature)

Gets the caster level of the last item used.

Parameters
oCreaturethe creature who used the item.
Returns
returns the creatures last used item's level.

Definition at line 2122 of file nwnx_creature.nss.

◆ NWNX_Creature_GetArmorClassVersus()

int NWNX_Creature_GetArmorClassVersus ( object  oAttacked,
object  oVersus,
int  nTouch = FALSE 
)

Gets the Armor classed of attacked against versus.

Parameters
oAttackedThe one being attacked
oVersusThe one doing the attacking
nTouchTRUE for touch attacks
Returns
-255 on Error, Flat footed AC if oVersus is invalid or the Attacked AC versus oVersus.

Definition at line 2131 of file nwnx_creature.nss.

◆ NWNX_Creature_GetWalkAnimation()

int NWNX_Creature_GetWalkAnimation ( object  oCreature)

Gets the current walk animation of oCreature.

Parameters
oCreatureThe target creature.
Returns
-1 on Error, otherwise the walk animation number

Definition at line 2142 of file nwnx_creature.nss.

◆ NWNX_Creature_SetWalkAnimation()

void NWNX_Creature_SetWalkAnimation ( object  oCreature,
int  nAnimation 
)

Sets the current walk animation of oCreature.

Parameters
oCreatureThe target creature.
nAnimationThe walk animation number.

Definition at line 2151 of file nwnx_creature.nss.

◆ NWNX_Creature_SetAttackRollOverride()

void NWNX_Creature_SetAttackRollOverride ( object  oCreature,
int  nRoll,
int  nModifier 
)

Changes the attack modifier depending on the dice roll. Used to skip autofail on 1 and autosucceed on 20 as well.

Parameters
oCreatureThe attacking creature, use OBJECT_INVALID for all.
nRollThe dice roll to modify.
nModifierThe modifier to the attack, use 0 to turn off autofail for 1/autosucceed for 20 with no attack modifier value.

Definition at line 2159 of file nwnx_creature.nss.

◆ NWNX_Creature_SetParryAllAttacks()

void NWNX_Creature_SetParryAllAttacks ( object  oCreature,
int  bParry 
)

Works like the tweak but can be turned on and off for all creatures or single ones.

Parameters
oCreatureThe parrying creature, use OBJECT_INVALID for all.
bParryTRUE to parry all attacks.
Note
Use this command on_module_load instead of the NWNX_TWEAKS_PARRY_ALL_ATTACKS tweak if using NWNX_Creature_SetAttackRollOverride()

Definition at line 2168 of file nwnx_creature.nss.

◆ NWNX_Creature_GetNoPermanentDeath()

int NWNX_Creature_GetNoPermanentDeath ( object  oCreature)

Gets the NoPermanentDeath flag of oCreature.

Parameters
oCreatureThe target creature.
Returns
TRUE/FALSE or -1 on error.

Definition at line 2176 of file nwnx_creature.nss.

◆ NWNX_Creature_SetNoPermanentDeath()

void NWNX_Creature_SetNoPermanentDeath ( object  oCreature,
int  bNoPermanentDeath 
)

Sets the NoPermanentDeath flag of oCreature.

Parameters
oCreatureThe target creature.
bNoPermanentDeathTRUE/FALSE.

Definition at line 2186 of file nwnx_creature.nss.

◆ NWNX_Creature_ComputeSafeLocation()

vector NWNX_Creature_ComputeSafeLocation ( object  oCreature,
vector  vPosition,
float  fRadius = 20.0f,
int  bWalkStraightLineRequired = TRUE 
)

Compute a safe location for oCreature.

Parameters
oCreatureThe target creature.
vPositionThe starting position.
fRadiusThe search radius around vPosition.
bWalkStraightLineRequiredWhether the creature must be able to walk in a straight line to the position.
Returns
A safe location as vector, will return vPosition if one wasn't found. Returns {0.0, 0.0, 0.0} on error.

Definition at line 2195 of file nwnx_creature.nss.

◆ NWNX_Creature_DoPerceptionUpdateOnCreature()

void NWNX_Creature_DoPerceptionUpdateOnCreature ( object  oCreature,
object  oTargetCreature 
)

Update oCreature's perception of oTargetCreature.

Parameters
oCreatureThe creature.
oTargetCreatureThe target creature.

Definition at line 2215 of file nwnx_creature.nss.

◆ NWNX_Creature_GetPersonalSpace()

float NWNX_Creature_GetPersonalSpace ( object  oCreature)

Get a creatures personal space (meters from center to non-creature objects).

Parameters
oCreatureThe creature.
Returns
The creatures personal space.

Definition at line 2224 of file nwnx_creature.nss.

◆ NWNX_Creature_SetPersonalSpace()

void NWNX_Creature_SetPersonalSpace ( object  oCreature,
float  fPerspace 
)

Set a creatures personal space (meters from center to non-creature objects).

Parameters
oCreatureThe creature.
fPerspaceThe creatures personal space.

Definition at line 2234 of file nwnx_creature.nss.

◆ NWNX_Creature_GetCreaturePersonalSpace()

float NWNX_Creature_GetCreaturePersonalSpace ( object  oCreature)

Get a creatures creature personal space (meters from center to other creatures).

Parameters
oCreatureThe creature.
Returns
The creatures creature personal space.

Definition at line 2243 of file nwnx_creature.nss.

◆ NWNX_Creature_SetCreaturePersonalSpace()

void NWNX_Creature_SetCreaturePersonalSpace ( object  oCreature,
float  fCrePerspace 
)

Set a creatures creature personal space (meters from center to other creatures).

Parameters
oCreatureThe creature.
fCrePerspaceThe creatures creature personal space.

Definition at line 2253 of file nwnx_creature.nss.

◆ NWNX_Creature_GetHeight()

float NWNX_Creature_GetHeight ( object  oCreature)

Get a creatures height.

Parameters
oCreatureThe creature.
Returns
The creatures height.

Definition at line 2262 of file nwnx_creature.nss.

◆ NWNX_Creature_SetHeight()

void NWNX_Creature_SetHeight ( object  oCreature,
float  fHeight 
)

Set a creatures height.

Parameters
oCreatureThe creature.
fHeightThe creatures height.

Definition at line 2272 of file nwnx_creature.nss.

◆ NWNX_Creature_GetHitDistance()

float NWNX_Creature_GetHitDistance ( object  oCreature)

Get a creatures hit distance.

Parameters
oCreatureThe creature.
Returns
The creatures hit distance.

Definition at line 2281 of file nwnx_creature.nss.

◆ NWNX_Creature_SetHitDistance()

void NWNX_Creature_SetHitDistance ( object  oCreature,
float  fHitDist 
)

Set a creatures hit distance.

Parameters
oCreatureThe creature.
fHitDistThe creatures hit distance.

Definition at line 2291 of file nwnx_creature.nss.

◆ NWNX_Creature_GetPreferredAttackDistance()

float NWNX_Creature_GetPreferredAttackDistance ( object  oCreature)

Get a creatures preferred attack distance.

Parameters
oCreatureThe creature.
Returns
The creatures preferred attack distance.

Definition at line 2300 of file nwnx_creature.nss.

◆ NWNX_Creature_SetPreferredAttackDistance()

void NWNX_Creature_SetPreferredAttackDistance ( object  oCreature,
float  fPrefAtckDist 
)

Set a creatures preferred attack distance.

Parameters
oCreatureThe creature.
fPrefAtckDistThe creatures preferred attack distance.

Definition at line 2310 of file nwnx_creature.nss.

◆ NWNX_Creature_GetArmorCheckPenalty()

int NWNX_Creature_GetArmorCheckPenalty ( object  oCreature)

Get the skill penalty from wearing armor.

Parameters
oCreatureThe creature.

Definition at line 2319 of file nwnx_creature.nss.

◆ NWNX_Creature_GetShieldCheckPenalty()

int NWNX_Creature_GetShieldCheckPenalty ( object  oCreature)

Get the skill penalty from wearing a shield.

Parameters
oCreatureThe creature.

Definition at line 2328 of file nwnx_creature.nss.

◆ NWNX_Creature_SetBypassEffectImmunity()

void NWNX_Creature_SetBypassEffectImmunity ( object  oCreature,
int  nImmunityType,
int  nChance = 100,
int  bPersist = FALSE 
)

Sets a chance for normal Effect Immunities to be bypassed.

Parameters
oCreatureThe affected creature
nImmunityType'IMMUNITY_TYPE_*' to bypass. By default affects outgoing effects (oCreature -> another creature). Use a negative (-IMMUNITY_TYPE_*) to affect incoming effects instead (another creature -> oCreature) use 255/-255 to bypass ALL Immunities.
nChanceThe chance (of 100%) to bypass the immunity check. A Positive chance results in NOT IMMUNE. A Negative chance results in IMMUNE.
bPersistWhether the modifier should persist to .bic file (for PCs)
Note
Persistence is enabled after a server reset by the first use of this function. Recommended to trigger on a dummy target OnModuleLoad to enable persistence.
Where an Outgoing and Incoming bypass both attempt opposing outcomes, both are ignored and the immunity status without bypass will apply.

Definition at line 2337 of file nwnx_creature.nss.

◆ NWNX_Creature_GetBypassEffectImmunity()

int NWNX_Creature_GetBypassEffectImmunity ( object  oCreature,
int  nImmunityType 
)

Gets a chance for normal Effect Immunities to be bypassed.

Parameters
oCreatureThe target creature
nImmunityType'IMMUNITY_TYPE_*' to retrieve the current chance for bypass: Positive gets outgoing effects (oCreature -> another creature). Negative (-IMMUNITY_TYPE_*) gets incoming effects (another creature -> oCreature).
Returns
the current critical hit multiplier modifier for the creature

Definition at line 2348 of file nwnx_creature.nss.

◆ NWNX_Creature_SetLastKiller()

void NWNX_Creature_SetLastKiller ( object  oCreature,
object  oKiller 
)

Sets the killer of oCreature to oKiller.

Parameters
oCreatureThe target creature.
oKillerThe killer.

Definition at line 2358 of file nwnx_creature.nss.

◆ NWNX_Creature_DoItemCastSpell()

void NWNX_Creature_DoItemCastSpell ( object  oCreature,
object  oTarget,
location  locTarget,
int  nSpellID,
int  nCasterLevel,
float  fProjectileTime,
int  nProjectilePathType = PROJECTILE_PATH_TYPE_DEFAULT,
int  nProjectileSpellID = -1,
object  oItem = OBJECT_INVALID,
string  sImpactScript = "" 
)

Instantly cast a spell at a target or location.

Note
oCreature must be in the same area as oTarget or locTarget.
Does not care if oCreature can't cast spells or doesn't know the spell. Does not consume spell slots.
Parameters
oCreatureThe caster.
oTargetThe target, use OBJECT_INVALID to cast at a location.
locTargetThe location, only used when oTarget is OBJECT_INVALID.
nSpellIDThe spell ID.
nCasterLevelThe caster level of the spell.
fProjectileTimeThe time in seconds for the projectile to reach the target. 0.0f for no projectile.
nProjectilePathTypeA PROJECTILE_PATH_TYPE_* constant.
nProjectileSpellIDAn optional spell ID which to use the projectile vfx of. -1 to use nSpellID's projectile vfx.
oItemThe spell cast item retrieved by GetSpellCastItem().
sImpactScriptThe spell impact script. Set to "****"" to not run any impact script. If left blank, will execute nSpellID's impact script.

Definition at line 2367 of file nwnx_creature.nss.

◆ NWNX_Creature_RunEquip()

int NWNX_Creature_RunEquip ( object  oCreature,
object  oItem,
int  nInventorySlot 
)

Have oCreature instantly equip oItem to nInventorySlot.

Parameters
oCreatureThe creature.
oItemThe item, must be possessed by oCreature.
nInventorySlotAn INVENTORY_SLOT_* constant.
Returns
TRUE on success, FALSE on failure.

Definition at line 2390 of file nwnx_creature.nss.

◆ NWNX_Creature_RunUnequip()

int NWNX_Creature_RunUnequip ( object  oCreature,
object  oItem 
)

Have oCreature instantly unequip oItem.

Parameters
oCreatureThe creature.
oItemThe item, must be possessed by oCreature.
Returns
TRUE on success, FALSE on failure.

Definition at line 2402 of file nwnx_creature.nss.

◆ NWNX_Creature_OverrideRangedProjectileVFX()

void NWNX_Creature_OverrideRangedProjectileVFX ( object  oCreature,
int  nProjectileVFX,
int  bPersist = FALSE 
)

Override the elemental projectile visual effect of ranged/throwing weapons.

Parameters
oCreatureThe creature.
nProjectileVFXA NWNX_CREATURE_PROJECTILE_VFX_* constant or -1 to remove the override.
bPersistWhether the vfx should persist to the .bic file (for PCs).
Note
Persistence is enabled after a server reset by the first use of this function. Recommended to trigger on a dummy target OnModuleLoad to enable persistence.

Definition at line 2413 of file nwnx_creature.nss.

◆ NWNX_Creature_SetInitiativeModifier()

void NWNX_Creature_SetInitiativeModifier ( object  oCreature,
int  nMod,
int  bPersist = FALSE 
)

Sets a custom Initiative modifier.

Parameters
oCreatureThe affected creature
nModThe amount to adjust their initiative (+/-).
bPersistWhether the modifier should persist to .bic file (for PCs)
Note
Persistence is enabled after a server reset by the first use of this function. Recommended to trigger on a dummy target OnModuleLoad to enable persistence.
Warning
This modifier takes precedence over an NWNX_Race Initiative modifier; they're not additive

Definition at line 2423 of file nwnx_creature.nss.

◆ NWNX_Creature_GetInitiativeModifier()

int NWNX_Creature_GetInitiativeModifier ( object  oCreature)

Gets the custom Initiative modifier.

Parameters
oCreatureThe target creature
Returns
the current custom initiative modifier for the creature

Definition at line 2433 of file nwnx_creature.nss.

◆ NWNX_Creature_GetBodyBag()

object NWNX_Creature_GetBodyBag ( object  oCreature)

Gets the Body Bag of a creature.

Parameters
oCreatureThe target creature
Returns
The creatures assigned Body Bag

Definition at line 2442 of file nwnx_creature.nss.

◆ NWNX_Creature_AddCastSpellActions()

int NWNX_Creature_AddCastSpellActions ( object  oCreature,
object  oTarget,
vector  vTargetLocation,
int  nSpellID,
int  nMultiClass,
int  nMetaMagic = METAMAGIC_NONE,
int  nDomainLevel = 0,
int  nProjectilePathType = PROJECTILE_PATH_TYPE_DEFAULT,
int  bInstant = FALSE,
int  bClearActions = FALSE,
int  bAddToFront = FALSE 
)

Add a cast spell action to oCreature's action queue.

Parameters
oCreatureThe creature casting the spell.
oTargetThe target, to cast at a location use the area as target.
vTargetLocationThe target location.
nSpellIDThe spell ID.
nMultiClassThe character class position to cast the spell as. 0 = First Class, 1 = Second Class, 3 = Third Class. To cast a cheat spell use 255 and to cast a special ability use 254.
nMetaMagicA METAMAGIC_* constant, except METAMAGIC_ANY.
nDomainLevelThe domain level if casting a domain spell.
nProjectilePathTypeA PROJECTILE_PATH_TYPE_* constant.
bInstantTRUE to instantly cast the spell.
bClearActionsTRUE to clear all actions.
bAddToFrontTRUE to add the cast spell action to the front of the action queue.
Returns
TRUE if the action was successfully added to oCreature's action queue.

Definition at line 2451 of file nwnx_creature.nss.

◆ NWNX_Creature_GetIsFlanking()

int NWNX_Creature_GetIsFlanking ( object  oCreature,
object  oTargetCreature 
)

Get whether oCreature is flanking oTargetCreature.

Parameters
oCreatureThe creature object.
oTargetCreatureThe target creature object.
Returns
TRUE if oCreature is flanking oTargetCreature.

Definition at line 2473 of file nwnx_creature.nss.

◆ NWNX_Creature_DecrementRemainingSpellSlots()

void NWNX_Creature_DecrementRemainingSpellSlots ( object  oCreature,
int  nClass,
int  nSpellLevel 
)

Decrements the remaining spell slots (innate casting) at a class level.

Parameters
oCreatureThe creature object.
nClassThe class id from classes.2da. (Not class index 0-2)
nSpellLevelThe spell level.

Definition at line 2484 of file nwnx_creature.nss.

◆ NWNX_Creature_IncrementRemainingSpellSlots()

void NWNX_Creature_IncrementRemainingSpellSlots ( object  oCreature,
int  nClass,
int  nSpellLevel 
)

Increments the remaining spell slots (innate casting) at a class level.

Parameters
oCreatureThe creature object.
nClassThe class id from classes.2da. (Not class index 0-2)
nSpellLevelThe spell level.

Definition at line 2495 of file nwnx_creature.nss.

◆ NWNX_Creature_GetMaximumBonusAttacks()

int NWNX_Creature_GetMaximumBonusAttacks ( object  oCreature)

Gets the maximum number of bonus attacks a creature can have from EffectModifyAttacks().

Parameters
oCreatureThe creature.
Returns
The maximum number of bonus attacks or 0 on error.

Definition at line 2506 of file nwnx_creature.nss.

◆ NWNX_Creature_SetMaximumBonusAttacks()

void NWNX_Creature_SetMaximumBonusAttacks ( object  oCreature,
int  nMaxBonusAttacks,
int  bPersist = FALSE 
)

Sets the maximum number of bonus attacks a creature can have from EffectModifyAttacks().

Note
This function also removes the limit of 5 bonus attacks from EffectModifyAttacks().
Parameters
oCreatureThe creature.
nMaxBonusAttacksThe maximum number of bonus attacks. Values < 0 will set the limit back to the default of 5.
bPersistWhether the modifier should persist to .bic file (for PCs).
Note
Persistence is enabled after a server reset by the first use of this function. Recommended to trigger on a dummy target OnModuleLoad to enable persistence.

Definition at line 2515 of file nwnx_creature.nss.

◆ NWNX_Creature_DoCleaveAttack()

void NWNX_Creature_DoCleaveAttack ( object  oCreature)

Inserts a cleave or great cleave attack into oCreature's current attack round against the nearest enemy within melee reach.

Parameters
oCreatureThe creature object.
Note
oCreature must have the cleave or great cleave feats, must be in combat, and must have available attacks remaining in their combat round to use for cleave attack.

Definition at line 2525 of file nwnx_creature.nss.

◆ NWNX_Creature_GetLockOrientationToObject()

object NWNX_Creature_GetLockOrientationToObject ( object  oCreature)

Gets the current object oCreature's orientation is locked to.

Parameters
oCreatureThe creature object.
Returns
The object oCreature's orientation is locked to, or OBJECT_INVALID if oCreature's orientation is not locked.

Definition at line 2533 of file nwnx_creature.nss.

◆ NWNX_Creature_SetLockOrientationToObject()

void NWNX_Creature_SetLockOrientationToObject ( object  oCreature,
object  oTarget 
)

Locks oCreature's orientation to always face oTarget.

Parameters
oCreatureThe creature object.
oTargetThe target to lock oCreature's orientation to. Use OBJECT_INVALID to remove the orientation lock.

Definition at line 2543 of file nwnx_creature.nss.

◆ NWNX_Creature_BroadcastAttackOfOpportunity()

void NWNX_Creature_BroadcastAttackOfOpportunity ( object  oCreature,
object  oSingleCreature = OBJECT_INVALID,
int  bMovement = FALSE 
)

Causes oCreature to broadcast an Attack of Opportunity against themself.

Parameters
oCreatureThe creature object.
oSingleCreatureA single creature to broadcast the Attack of Opporunity to. Use OBJECT_INVALID to broadcast to all nearby enemies.
bMovementWhether the Attack of Opportunity was caused by movement.

Definition at line 2552 of file nwnx_creature.nss.

◆ NWNX_Creature_GetMaxSellToStorePriceOverride()

int NWNX_Creature_GetMaxSellToStorePriceOverride ( object  oCreature,
object  oStore 
)

Returns the maximum price oStore will buy items from oCreature for.

Parameters
oCreatureThe creature object.
oStoreThe store object.
Returns
The max buy price override. -1 = No maximum buy price, -2 = No override set.

Definition at line 2562 of file nwnx_creature.nss.

◆ NWNX_Creature_SetMaxSellToStorePriceOverride()

void NWNX_Creature_SetMaxSellToStorePriceOverride ( object  oCreature,
object  oStore,
int  nMaxSellToPrice 
)

Overrides the maximum price oStore will buy items from oCreature for.

Parameters
oCreatureThe creature object.
oStoreThe store object.
nMaxSellToPriceThe maximum buy price override. -1 = No maximum buy price, -2 = Remove the override.

Definition at line 2573 of file nwnx_creature.nss.

◆ NWNX_Creature_GetAbilityIncreaseByLevel()

int NWNX_Creature_GetAbilityIncreaseByLevel ( object  oCreature,
int  nLevel 
)

Returns the creature's ability increase for nLevel.

Parameters
oCreatureThe creature object.
nLevelThe level.
Returns
An ABILITY_* constant, NWNX_CREATURE_ABILITY_NONE or -1 on error

Definition at line 2583 of file nwnx_creature.nss.

◆ NWNX_Creature_SetAbilityIncreaseByLevel()

void NWNX_Creature_SetAbilityIncreaseByLevel ( object  oCreature,
int  nLevel,
int  nAbility 
)

Sets the creature's ability increase for nLevel.

Parameters
oCreatureThe creature object.
nLevelThe level.
nAbilityABILITY_* constant or NWNX_CREATURE_ABILITY_NONE

Definition at line 2594 of file nwnx_creature.nss.

◆ NWNX_Creature_GetMaxAttackRange()

float NWNX_Creature_GetMaxAttackRange ( object  oCreature,
object  oTarget 
)

Returns the creature's maximum attack range to a target.

Parameters
oCreatureThe creature object.
oTargetThe target to get the maximum attack range to
Returns
The maximum attack range for oCreature to oTarget

Definition at line 2604 of file nwnx_creature.nss.

Variable Documentation

◆ NWNX_CREATURE_MOVEMENT_RATE_PC

const int NWNX_CREATURE_MOVEMENT_RATE_PC = 0

Definition at line 14 of file nwnx_creature.nss.

◆ NWNX_CREATURE_MOVEMENT_RATE_IMMOBILE

const int NWNX_CREATURE_MOVEMENT_RATE_IMMOBILE = 1

Definition at line 15 of file nwnx_creature.nss.

◆ NWNX_CREATURE_MOVEMENT_RATE_VERY_SLOW

const int NWNX_CREATURE_MOVEMENT_RATE_VERY_SLOW = 2

Definition at line 16 of file nwnx_creature.nss.

◆ NWNX_CREATURE_MOVEMENT_RATE_SLOW

const int NWNX_CREATURE_MOVEMENT_RATE_SLOW = 3

Definition at line 17 of file nwnx_creature.nss.

◆ NWNX_CREATURE_MOVEMENT_RATE_NORMAL

const int NWNX_CREATURE_MOVEMENT_RATE_NORMAL = 4

Definition at line 18 of file nwnx_creature.nss.

◆ NWNX_CREATURE_MOVEMENT_RATE_FAST

const int NWNX_CREATURE_MOVEMENT_RATE_FAST = 5

Definition at line 19 of file nwnx_creature.nss.

◆ NWNX_CREATURE_MOVEMENT_RATE_VERY_FAST

const int NWNX_CREATURE_MOVEMENT_RATE_VERY_FAST = 6

Definition at line 20 of file nwnx_creature.nss.

◆ NWNX_CREATURE_MOVEMENT_RATE_DEFAULT

const int NWNX_CREATURE_MOVEMENT_RATE_DEFAULT = 7

Definition at line 21 of file nwnx_creature.nss.

◆ NWNX_CREATURE_MOVEMENT_RATE_DM_FAST

const int NWNX_CREATURE_MOVEMENT_RATE_DM_FAST = 8

Definition at line 22 of file nwnx_creature.nss.

◆ NWNX_CREATURE_MOVEMENT_TYPE_STATIONARY

const int NWNX_CREATURE_MOVEMENT_TYPE_STATIONARY = 0

Definition at line 30 of file nwnx_creature.nss.

◆ NWNX_CREATURE_MOVEMENT_TYPE_WALK

const int NWNX_CREATURE_MOVEMENT_TYPE_WALK = 1

Definition at line 31 of file nwnx_creature.nss.

◆ NWNX_CREATURE_MOVEMENT_TYPE_RUN

const int NWNX_CREATURE_MOVEMENT_TYPE_RUN = 2

Definition at line 32 of file nwnx_creature.nss.

◆ NWNX_CREATURE_MOVEMENT_TYPE_SIDESTEP

const int NWNX_CREATURE_MOVEMENT_TYPE_SIDESTEP = 3

Definition at line 33 of file nwnx_creature.nss.

◆ NWNX_CREATURE_MOVEMENT_TYPE_WALK_BACKWARDS

const int NWNX_CREATURE_MOVEMENT_TYPE_WALK_BACKWARDS = 4

Definition at line 34 of file nwnx_creature.nss.

◆ NWNX_CREATURE_BONUS_TYPE_ATTACK

const int NWNX_CREATURE_BONUS_TYPE_ATTACK = 1

Definition at line 42 of file nwnx_creature.nss.

◆ NWNX_CREATURE_BONUS_TYPE_DAMAGE

const int NWNX_CREATURE_BONUS_TYPE_DAMAGE = 2

Definition at line 43 of file nwnx_creature.nss.

◆ NWNX_CREATURE_BONUS_TYPE_SAVING_THROW

const int NWNX_CREATURE_BONUS_TYPE_SAVING_THROW = 3

Definition at line 44 of file nwnx_creature.nss.

◆ NWNX_CREATURE_BONUS_TYPE_ABILITY

const int NWNX_CREATURE_BONUS_TYPE_ABILITY = 4

Definition at line 45 of file nwnx_creature.nss.

◆ NWNX_CREATURE_BONUS_TYPE_SKILL

const int NWNX_CREATURE_BONUS_TYPE_SKILL = 5

Definition at line 46 of file nwnx_creature.nss.

◆ NWNX_CREATURE_BONUS_TYPE_TOUCH_ATTACK

const int NWNX_CREATURE_BONUS_TYPE_TOUCH_ATTACK = 6

Definition at line 47 of file nwnx_creature.nss.

◆ NWNX_CREATURE_PROJECTILE_VFX_NONE

const int NWNX_CREATURE_PROJECTILE_VFX_NONE = 0

No VFX.

Definition at line 55 of file nwnx_creature.nss.

◆ NWNX_CREATURE_PROJECTILE_VFX_ACID

const int NWNX_CREATURE_PROJECTILE_VFX_ACID = 1

Definition at line 56 of file nwnx_creature.nss.

◆ NWNX_CREATURE_PROJECTILE_VFX_COLD

const int NWNX_CREATURE_PROJECTILE_VFX_COLD = 2

Definition at line 57 of file nwnx_creature.nss.

◆ NWNX_CREATURE_PROJECTILE_VFX_ELECTRICAL

const int NWNX_CREATURE_PROJECTILE_VFX_ELECTRICAL = 3

Definition at line 58 of file nwnx_creature.nss.

◆ NWNX_CREATURE_PROJECTILE_VFX_FIRE

const int NWNX_CREATURE_PROJECTILE_VFX_FIRE = 4

Definition at line 59 of file nwnx_creature.nss.

◆ NWNX_CREATURE_PROJECTILE_VFX_SONIC

const int NWNX_CREATURE_PROJECTILE_VFX_SONIC = 5

Definition at line 60 of file nwnx_creature.nss.

◆ NWNX_CREATURE_PROJECTILE_VFX_RANDOM

const int NWNX_CREATURE_PROJECTILE_VFX_RANDOM = 6

Random Elemental VFX.

Definition at line 61 of file nwnx_creature.nss.

◆ NWNX_CREATURE_ABILITY_NONE

const int NWNX_CREATURE_ABILITY_NONE = 6

Definition at line 64 of file nwnx_creature.nss.