/// @brief Set creature's raw good/evil alignment value.
/// @param creature The creature object.
/// @param value The value to set.
void NWNX_Creature_SetAlignmentGoodEvil(object creature, int value);
/// @brief Set creature's raw law/chaos alignment value.
/// @param creature The creature object.
/// @param value The value to set.
void NWNX_Creature_SetAlignmentLawChaos(object creature, int value);
/// @brief Set the base ranks in a skill for creature
/// @param creature The creature object.
/// @param skill The skill id.
/// @param rank The value to set as the skill rank.
void NWNX_Creature_SetSkillRank(object creature, int skill, int rank);
/// @brief Get the ranks in a skill for creature assigned at a level.
/// @param creature The creature object.
/// @param skill The skill id.
/// @param level The level they gained skill ranks.
/// @return The rank in a skill assigned at a level (-1 on error).
int NWNX_Creature_GetSkillRankByLevel(object creature, int skill, int level);
/// @brief 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.
/// @param creature The creature object.
/// @param skill The skill id.
/// @param level The level they gained skill ranks.
/// @param rank The value to set as the skill rank.
void NWNX_Creature_SetSkillRankByLevel(object creature, int skill, int rank, int level);
/// @brief Set the class ID in a particular position for a creature.
/// @param creature The creature object.
/// @param position Should be 0, 1, or 2 depending on how many classes the creature
/// has and which is to be modified.
/// @param classID A valid ID number in classes.2da and between 0 and 255.
/// @param bUpdateLevels determines whether the method will replace all occurrences
/// of the old class in CNWLevelStats with the new classID.
void NWNX_Creature_SetClassByPosition(object creature, int position, int classID, int bUpdateLevels = TRUE);
/// @brief Set the level at the given position for a creature.
/// @note A creature should already have a class in that position.
/// @param creature The creature object.
/// @param position Should be 0, 1, or 2 depending on how many classes the creature
/// has and which is to be modified.
/// @param level The level to set.
void NWNX_Creature_SetLevelByPosition(object creature, int position, int level);
/// @brief 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.
/// @param creature The creature object.
/// @param bab The 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.
/// @remark The base game has a function @nwn{SetBaseAttackBonus}, which actually sets
/// the bonus attacks per round for a creature, not the BAB.
void NWNX_Creature_SetBaseAttackBonus(object creature, int bab);
/// @brief Gets the creatures current attacks per round (using equipped weapon).
/// @param creature The creature object.
/// @param bBaseAPR If TRUE, will return the base attacks per round, based on BAB and
/// equipped weapons, regardless of overrides set by calls to @nwn{SetBaseAttackBonus} builtin function.
/// @return The attacks per round.
int NWNX_Creature_GetAttacksPerRound(object creature, int bBaseAPR = FALSE);
/// @brief Restore all creature feat uses.
/// @param creature The creature object.
void NWNX_Creature_RestoreFeats(object creature);
/// @brief Restore all creature special ability uses.
/// @brief Returns the creature's highest attack bonus based on its own stats.
/// @note AB vs. Type and +AB on Gauntlets are excluded
/// @param creature The creature object.
/// @param 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
/// @param isTouchAttack If the attack was a touch attack.
/// @param isOffhand If the attack was with the offhand.
/// @param includeBaseAttackBonus Should the result include the base attack bonus.
/// @return The highest attack bonus.
int NWNX_Creature_GetAttackBonus(object creature, int isMelee = -1, int isTouchAttack = FALSE, int isOffhand = FALSE, int includeBaseAttackBonus = TRUE);
/// @brief Get highest level version of feat possessed by creature.
/// @remark For feats that increment in power, for example, barbarian rage.
/// @param creature The creature object.
/// @param feat The feat id.
/// @return The highest level version of the feat.
int NWNX_Creature_GetHighestLevelOfFeat(object creature, int feat);
/// @brief Get feat remaining uses.
/// @param creature The creature object.
/// @param feat The feat id.
/// @return The amount of remaining uses.
int NWNX_Creature_GetFeatRemainingUses(object creature, int feat);
/// @brief Get feat total uses.
/// @param creature The creature object.
/// @param feat The feat id.
/// @return The total uses.
int NWNX_Creature_GetFeatTotalUses(object creature, int feat);
/// @brief Set feat remaining uses.
/// @param creature The creature object.
/// @param feat The feat id.
/// @param uses The amount of remaining uses.
void NWNX_Creature_SetFeatRemainingUses(object creature, int feat, int uses);
/// @brief Get total effect bonus
/// @remark 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.
/// @param creature The creature object.
/// @param bonusType A @ref bonus_types "Bonus Type"
/// @param target A target object. Used to calculate bonuses versus specific races, alignments, etc.
/// @param isElemental If a damage bonus includes elemental damage.
/// @param isForceMax If the bonus should return the maximum possible.
/// @param savetype A SAVING_THROW_* constant.
/// @param saveSpecificType A SAVING_THROW_TYPE_* constant.
/// @param skill A skill id.
/// @param abilityScore An ABILITY_* constant.
/// @param isOffhand Whether the attack is an offhand attack.
/// @return The bonus value.
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);
/// @brief Set the original first or last name of creature
/// @param creature The creature object.
/// @param name The name to give the creature.
/// @param isLastName TRUE 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.
void NWNX_Creature_SetOriginalName(object creature, string name, int isLastName);
/// @brief Get the original first or last name of creature
/// @param creature The creature object.
/// @param isLastName TRUE to get last name, FALSE for first name.
/// @return The original first or last name of the creature.
string NWNX_Creature_GetOriginalName(object creature, int isLastName);
/// @brief Set creature's spell resistance
/// @param creature The creature object.
/// @param sr The spell resistance.
/// @warning This setting will be overwritten by effects and once those effects fade the old setting (typically 0) will be set.
void NWNX_Creature_SetSpellResistance(object creature, int sr);
/// @brief Set creature's animal companion creature type
/// @param creature The master creature object.
/// @param type The type from ANIMAL_COMPANION_CREATURE_TYPE_*.
void NWNX_Creature_SetAnimalCompanionCreatureType(object creature, int type);
/// @brief Set creature's familiar creature type
/// @param creature The master creature object.
/// @param type The type from FAMILIAR_CREATURE_TYPE_*.
void NWNX_Creature_SetFamiliarCreatureType(object creature, int type);
/// @brief Set creature's animal companion's name
/// @param creature The master creature object.
/// @param name The name to give their animal companion.
/// @brief Deserialize sSerializedQuickbar for oCreature
/// @param oCreature The creature.
/// @param sSerializedQuickbar A base64 string of a quickbar
/// @return TRUE on success
int NWNX_Creature_DeserializeQuickbar(object oCreature, string sSerializedQuickbar);
/// @brief Sets a caster level modifier for oCreature
/// @param oCreature the target creature
/// @param nClass the class that this modifier will apply to
/// @param nModifier the modifier to apply
/// @param bPersist whether the modifier should be persisted to the .bic file if applicable
void NWNX_Creature_SetCasterLevelModifier(object oCreature, int nClass, int nModifier, int bPersist = FALSE);
/// @brief Gets the current caster level modifier for oCreature
/// @param oCreature the target creature
/// @param nClass the creature caster class
/// @return the current caster level modifier for the creature
int NWNX_Creature_GetCasterLevelModifier(object oCreature, int nClass);
/// @brief Sets a caster level override for oCreature
/// @param oCreature the target creature
/// @param nClass the class that this modifier will apply to
/// @param nCasterLevel the caster level override to apply
/// @param bPersist whether the override should be persisted to the .bic file if applicable
void NWNX_Creature_SetCasterLevelOverride(object oCreature, int nClass, int nCasterLevel, int bPersist = FALSE);
/// @brief Gets the current caster level override for oCreature
/// @param oCreature the target creature
/// @param nClass the creature caster class
/// @return the current caster level override for the creature or -1 if not set
int NWNX_Creature_GetCasterLevelOverride(object oCreature, int nClass);
/// @brief Move a creature to limbo.
/// @param oCreature The creature object.
void NWNX_Creature_JumpToLimbo(object oCreature);
/// @brief Sets the critical hit multiplier modifier for the Creature
/// @param oCreature The target creature
/// @param nModifier The modifier to apply
/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand
/// @param bPersist Whether the modifier should persist to .bic file if applicable
/// @param nBaseItem Applies 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.
void NWNX_Creature_SetCriticalMultiplierModifier(object oCreature, int nModifier, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1);
/// @brief Gets the critical hit multiplier modifier for the Creature
/// @param oCreature The target creature
/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand
/// @param nBaseItem The baseitem modifer to retrieve. BASE_ITEM_GLOVES for Unarmed, '-1' for all
/// @return the current critical hit multiplier modifier for the creature
int NWNX_Creature_GetCriticalMultiplierModifier(object oCreature, int nHand = 0, int nBaseItem = -1);
/// @brief Sets the critical hit multiplier override for the Creature.
/// @param oCreature The target creature
/// @param nOverride The override value to apply. -1 to clear override.
/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand
/// @param bPersist Whether the modifier should persist to .bic file if applicable
/// @param nBaseItem Applies 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.
void NWNX_Creature_SetCriticalMultiplierOverride(object oCreature, int nOverride, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1);
/// @brief Gets the critical hit multiplier override for the Creature
/// @param oCreature The target creature
/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand
/// @param nBaseItem The baseitem Override to retrieve. BASE_ITEM_GLOVES for Unarmed, '-1' for all
/// @return the current critical hit multiplier override for the creature. No override == -1
int NWNX_Creature_GetCriticalMultiplierOverride(object oCreature, int nHand = 0, int nBaseItem = -1);
/// @brief Sets the critical hit range modifier for the creature.
/// @param oCreature The target creature
/// @param nModifier The modifier to apply. Positive modifiers reduce critical chance. (I.e. From 18-20, a +1 results in crit range of 19-20)
/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand
/// @param bPersist Whether the modifier should persist to .bic file if applicable
/// @param nBaseItem Applies 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.
void NWNX_Creature_SetCriticalRangeModifier(object oCreature, int nModifier, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1);
/// @brief Gets the critical hit range modifier for the creature.
/// @param oCreature The target creature
/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand
/// @param nBaseItem The baseitem modifer to retrieve. BASE_ITEM_GLOVES for Unarmed, '-1' for all
/// @return the current critical hit range modifier for the creature
int NWNX_Creature_GetCriticalRangeModifier(object oCreature, int nHand = 0, int nBaseItem = -1);
/// @brief Sets the critical hit range Override for the creature.
/// @param oCreature The target creature
/// @param nOverride The new minimum roll to crit. i.e nOverride of 15 results in crit range of 15-20. -1 to clear override.
/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand
/// @param bPersist Whether the modifier should persist to .bic file if applicable
/// @param nBaseItem Applies 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.
void NWNX_Creature_SetCriticalRangeOverride(object oCreature, int nOverride, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1);
/// @brief Sets the critical hit range Override for the creature.
/// @param oCreature The target creature
/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand
/// @param nBaseItem The baseitem Override to retrieve. BASE_ITEM_GLOVES for Unarmed, '-1' for all
/// @return the current critical hit range override for the creature. No override == -1
int NWNX_Creature_GetCriticalRangeOverride(object oCreature, int nHand = 0, int nBaseItem = -1);
/// @brief Add oAssociate as nAssociateType to oCreature
/// @warning Only basic checks are done so care must be taken when using this function
/// @param oCreature The creature to add oAssociate to
/// @param oAssociate The associate, must be a NPC
/// @param nAssociateType The associate type, one of ASSOCIATE_TYPE_*, except _NONE
void NWNX_Creature_AddAssociate(object oCreature, object oAssociate, int nAssociateType);
/// @brief Override the damage level of oCreature.
/// @note Damage levels are the damage state under a creature's name, for example: 'Near Death'
/// @param oCreature The target creature.
/// @param nDamageLevel A damage level, see damagelevels.2da. Allowed values: 0-255 or -1 to remove the override.
void NWNX_Creature_OverrideDamageLevel(object oCreature, int nDamageLevel);
/// @brief Get the skill penalty from wearing armor.
/// @param oCreature The creature.
int NWNX_Creature_GetArmorCheckPenalty(object oCreature);
/// @brief Get the skill penalty from wearing a shield.
/// @param oCreature The creature.
int NWNX_Creature_GetShieldCheckPenalty(object oCreature);
/// @brief Sets a chance for normal Effect Immunities to be bypassed
/// @param oCreature The affected creature
/// @param 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.
/// @param nChance The chance (of 100%) to bypass the immunity check. A Positive chance results in NOT IMMUNE. A Negative chance results in IMMUNE.
/// @param bPersist Whether 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.
/// @note Where an Outgoing and Incoming bypass both attempt opposing outcomes, both are ignored and the immunity status without bypass will apply.
void NWNX_Creature_SetBypassEffectImmunity(object oCreature, int nImmunityType, int nChance = 100, int bPersist = FALSE);
/// @brief Gets a chance for normal Effect Immunities to be bypassed
/// @param oCreature The target creature
/// @param 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).
/// @return the current critical hit multiplier modifier for the creature
int NWNX_Creature_GetBypassEffectImmunity(object oCreature, int nImmunityType);
/// @brief Sets the killer of oCreature to oKiller.
/// @brief Have oCreature instantly equip oItem to nInventorySlot.
/// @param oCreature The creature.
/// @param oItem The item, must be possessed by oCreature.
/// @param nInventorySlot An INVENTORY_SLOT_* constant.
/// @return TRUE on success, FALSE on failure.
int NWNX_Creature_RunEquip(object oCreature, object oItem, int nInventorySlot);
/// @brief Have oCreature instantly unequip oItem.
/// @param oCreature The creature.
/// @param oItem The item, must be possessed by oCreature.
/// @return TRUE on success, FALSE on failure.
int NWNX_Creature_RunUnequip(object oCreature, object oItem);
/// @brief Override the elemental projectile visual effect of ranged/throwing weapons.
/// @param oCreature The creature.
/// @param nProjectileVFX A @ref ranged_projectile_vfx "NWNX_CREATURE_PROJECTILE_VFX_*" constant or -1 to remove the override.
/// @param bPersist Whether 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.
void NWNX_Creature_OverrideRangedProjectileVFX(object oCreature, int nProjectileVFX, int bPersist = FALSE);
/// @brief Sets a custom Initiative modifier
/// @param oCreature The affected creature
/// @param nMod The amount to adjust their initiative (+/-).
/// @param bPersist Whether 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
/// @brief Add a cast spell action to oCreature's action queue.
/// @param oCreature The creature casting the spell.
/// @param oTarget The target, to cast at a location use the area as target.
/// @param vTargetLocation The target location.
/// @param nSpellID The spell ID.
/// @param nMultiClass The 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.
/// @param nMetaMagic A METAMAGIC_* constant, except METAMAGIC_ANY.
/// @param nDomainLevel The domain level if casting a domain spell.
/// @param nProjectilePathType A PROJECTILE_PATH_TYPE_* constant.
/// @param bInstant TRUE to instantly cast the spell.
/// @param bClearActions TRUE to clear all actions.
/// @param bAddToFront TRUE to add the cast spell action to the front of the action queue.
/// @return TRUE if the action was successfully added to oCreature's action queue.
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);
/// @brief Get whether oCreature is flanking oTargetCreature.
/// @param oCreature The creature object.
/// @param oTargetCreature The target creature object.
/// @return TRUE if oCreature is flanking oTargetCreature.
int NWNX_Creature_GetIsFlanking(object oCreature, object oTargetCreature);
/// @brief Decrements the remaining spell slots (innate casting) at a class level.
/// @param oCreature The creature object.
/// @param nClass The class id from classes.2da. (Not class index 0-2)
/// @param nSpellLevel The spell level.
void NWNX_Creature_DecrementRemainingSpellSlots(object oCreature, int nClass, int nSpellLevel);
/// @brief Increments the remaining spell slots (innate casting) at a class level.
/// @param oCreature The creature object.
/// @param nClass The class id from classes.2da. (Not class index 0-2)
/// @param nSpellLevel The spell level.
void NWNX_Creature_IncrementRemainingSpellSlots(object oCreature, int nClass, int nSpellLevel);
/// @brief Gets the maximum number of bonus attacks a creature can have from EffectModifyAttacks().
/// @param oCreature The creature.
/// @return The maximum number of bonus attacks or 0 on error.
int NWNX_Creature_GetMaximumBonusAttacks(object oCreature);
/// @brief 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().
/// @param oCreature The creature.
/// @param nMaxBonusAttacks The maximum number of bonus attacks. Values < 0 will set the limit back to the default of 5.
/// @param bPersist Whether 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.
void NWNX_Creature_SetMaximumBonusAttacks(object oCreature, int nMaxBonusAttacks, int bPersist = FALSE);
/// @brief Inserts a cleave or great cleave attack into oCreature's current attack round against the nearest enemy within melee reach.
/// @param oCreature The 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.
int NWNX_Creature_GetAttackBonus(object creature, int isMelee = -1, int isTouchAttack = FALSE, int isOffhand = FALSE, int includeBaseAttackBonus = TRUE)
int NWNX_Creature_GetHighestLevelOfFeat(object creature, int feat)
{
string sFunc = "GetHighestLevelOfFeat";
NWNX_PushArgumentInt(feat);
NWNX_PushArgumentObject(creature);
NWNX_CallFunction(NWNX_Creature, sFunc);
return NWNX_GetReturnValueInt();
}
int NWNX_Creature_GetFeatRemainingUses(object creature, int feat)
{
string sFunc = "GetFeatRemainingUses";
NWNX_PushArgumentInt(feat);
NWNX_PushArgumentObject(creature);
NWNX_CallFunction(NWNX_Creature, sFunc);
return NWNX_GetReturnValueInt();
}
int NWNX_Creature_GetFeatTotalUses(object creature, int feat)
{
string sFunc = "GetFeatTotalUses";
NWNX_PushArgumentInt(feat);
NWNX_PushArgumentObject(creature);
NWNX_CallFunction(NWNX_Creature, sFunc);
return NWNX_GetReturnValueInt();
}
void NWNX_Creature_SetFeatRemainingUses(object creature, int feat, int uses)
{
string sFunc = "SetFeatRemainingUses";
NWNX_PushArgumentInt(uses);
NWNX_PushArgumentInt(feat);
NWNX_PushArgumentObject(creature);
NWNX_CallFunction(NWNX_Creature, sFunc);
}
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)
{
string sFunc = "GetTotalEffectBonus";
NWNX_PushArgumentInt(isOffhand);
NWNX_PushArgumentInt(abilityScore);
NWNX_PushArgumentInt(skill);
NWNX_PushArgumentInt(saveSpecificType);
NWNX_PushArgumentInt(savetype);
NWNX_PushArgumentInt(isForceMax);
NWNX_PushArgumentInt(isElemental);
NWNX_PushArgumentObject(target);
NWNX_PushArgumentInt(bonusType);
NWNX_PushArgumentObject(creature);
NWNX_CallFunction(NWNX_Creature, sFunc);
return NWNX_GetReturnValueInt();
}
void NWNX_Creature_SetOriginalName(object creature, string name, int isLastName)
{
string sFunc = "SetOriginalName";
NWNX_PushArgumentInt(isLastName);
NWNX_PushArgumentString(name);
NWNX_PushArgumentObject(creature);
NWNX_CallFunction(NWNX_Creature, sFunc);
}
string NWNX_Creature_GetOriginalName(object creature, int isLastName)
{
string sFunc = "GetOriginalName";
NWNX_PushArgumentInt(isLastName);
NWNX_PushArgumentObject(creature);
NWNX_CallFunction(NWNX_Creature, sFunc);
return NWNX_GetReturnValueString();
}
void NWNX_Creature_SetSpellResistance(object creature, int sr)
{
string sFunc = "SetSpellResistance";
NWNX_PushArgumentInt(sr);
NWNX_PushArgumentObject(creature);
NWNX_CallFunction(NWNX_Creature, sFunc);
}
void NWNX_Creature_SetAnimalCompanionCreatureType(object creature, int type)
{
string sFunc = "SetAnimalCompanionCreatureType";
NWNX_PushArgumentInt(type);
NWNX_PushArgumentObject(creature);
NWNX_CallFunction(NWNX_Creature, sFunc);
}
void NWNX_Creature_SetFamiliarCreatureType(object creature, int type)
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)
{
string sFunc = "AddCastSpellActions";
NWNX_PushArgumentInt(bAddToFront);
NWNX_PushArgumentInt(bClearActions);
NWNX_PushArgumentInt(bInstant);
NWNX_PushArgumentInt(nProjectilePathType);
NWNX_PushArgumentInt(nDomainLevel);
NWNX_PushArgumentInt(nMetaMagic);
NWNX_PushArgumentInt(nMultiClass);
NWNX_PushArgumentInt(nSpellID);
NWNX_PushArgumentFloat(vTargetLocation.z);
NWNX_PushArgumentFloat(vTargetLocation.y);
NWNX_PushArgumentFloat(vTargetLocation.x);
NWNX_PushArgumentObject(oTarget);
NWNX_PushArgumentObject(oCreature);
NWNX_CallFunction(NWNX_Creature, sFunc);
return NWNX_GetReturnValueInt();
}
int NWNX_Creature_GetIsFlanking(object oCreature, object oTargetCreature)
{
string sFunc = "GetIsFlanking";
NWNX_PushArgumentObject(oTargetCreature);
NWNX_PushArgumentObject(oCreature);
NWNX_CallFunction(NWNX_Creature, sFunc);
return NWNX_GetReturnValueInt();
}
void NWNX_Creature_DecrementRemainingSpellSlots(object oCreature, int nClass, int nSpellLevel)
{
string sFunc = "DecrementRemainingSpellSlots";
NWNX_PushArgumentInt(nSpellLevel);
NWNX_PushArgumentInt(nClass);
NWNX_PushArgumentObject(oCreature);
NWNX_CallFunction(NWNX_Creature, sFunc);
}
void NWNX_Creature_IncrementRemainingSpellSlots(object oCreature, int nClass, int nSpellLevel)
{
string sFunc = "IncrementRemainingSpellSlots";
NWNX_PushArgumentInt(nSpellLevel);
NWNX_PushArgumentInt(nClass);
NWNX_PushArgumentObject(oCreature);
NWNX_CallFunction(NWNX_Creature, sFunc);
}
int NWNX_Creature_GetMaximumBonusAttacks(object oCreature)
{
string sFunc = "GetMaximumBonusAttacks";
NWNX_PushArgumentObject(oCreature);
NWNX_CallFunction(NWNX_Creature, sFunc);
return NWNX_GetReturnValueInt();
}
void NWNX_Creature_SetMaximumBonusAttacks(object oCreature, int nMaxBonusAttacks, int bPersist = FALSE)