Anvil
Anvil.API.NwCreature Class Reference

A monster, NPC, player character or DM avatar More...

+ Inheritance diagram for Anvil.API.NwCreature:
+ Collaboration diagram for Anvil.API.NwCreature:

Public Member Functions

unsafe void AcquireItem (NwItem item, bool displayFeedback=true)
 
async Task ActionAttackTarget (NwGameObject target, bool passive=false)
 Instructs this creature to start attacking the target using whichever weapon they currently have equipped. More...
 
async Task ActionCastFakeSpellAt (NwSpell spell, Location location, ProjectilePathType pathType=ProjectilePathType.Default)
 Begins the casting animation and spell fx for the specified spell, without any spell effects. More...
 
async Task ActionCastFakeSpellAt (NwSpell spell, NwGameObject target, ProjectilePathType pathType=ProjectilePathType.Default)
 Begins the casting animation and spell fx for the specified spell, without any spell effects. More...
 
async Task ActionCounterspell (NwGameObject counterSpellTarget)
 Intructs this creature to enter counterspell combat mode against the specified creature. More...
 
async Task ActionEquipItem (NwItem item, InventorySlot slot)
 Instructs this creature to equip the specified item into the given inventory slot.
Note: If the creature already has an item equipped in the slot specified, it will be unequipped automatically by the call to EquipItem, and dropped if the creature lacks inventory space.
In order for EquipItem to succeed the creature must be able to equip the item normally. This means that:
1) The item is in the creature's inventory.
2) The item must already be identified (if magical).
3) The creature has the level required to equip the item (if magical and ILR is on).
4) The creature possesses the required feats to equip the item (such as weapon proficiencies). More...
 
async Task ActionEquipMostDamagingMelee (NwGameObject? verses=null, bool offhand=false)
 Instructs this creature to equip its most damaging melee weapon. If no valid melee weapon is found, it will equip the most damaging ranged weapon. More...
 
async Task ActionEquipMostDamagingRanged (NwGameObject? verses=null)
 Instructs this creature to equip its most damaging ranged weapon. If no valid ranged weapon is found, it will equip the most damaging melee weapon. More...
 
async Task ActionEquipMostEffectiveArmor ()
 Instructs this creature to equip the best armor in its inventory. More...
 
async Task ActionForceFollowObject (NwGameObject target, float distance)
 Forces this creature to follow the specified target until NwObject.ClearActionQueue is called. More...
 
async Task ActionForceMoveTo (Location target, bool run=false, TimeSpan? timeOut=null)
 Instructs this creature to walk/run to the specified target location. More...
 
async Task ActionForceMoveTo (NwObject target, bool run=false, float range=1.0f, TimeSpan? timeOut=null)
 Instructs this creature to walk/run to the specified target object. More...
 
async Task ActionInteractObject (NwPlaceable placeable)
 Instructs this creature to use the specified placeable. More...
 
Task ActionLockObject (NwDoor door)
 Instructs this creature to approach and lock the specified door. More...
 
Task ActionLockObject (NwPlaceable placeable)
 Instructs this creature to approach and lock the specified placeable. More...
 
async Task ActionMoveAwayFrom (Location location, bool run, float range=40.0f)
 Instructs this creature to move to a certain distance away from the specified location. More...
 
async Task ActionMoveAwayFrom (NwObject target, bool run, float range=40.0f)
 Instructs this creature to move a certain distance away from the specified target. More...
 
async Task ActionMoveTo (Location target, bool run=false)
 Instructs this creature to walk/run to the specified target location. More...
 
async Task ActionMoveTo (NwObject target, bool run=false, float range=1.0f)
 Instructs this creature to walk/run to the specified target object. More...
 
async Task ActionPickUpItem (NwItem item)
 Instructs this creature to walk over and pick up the specified item on the ground. More...
 
async Task ActionPutDownItem (NwItem item)
 Instructs this creature to begin placing down an item at its feet. More...
 
async Task ActionRandomWalk ()
 The creature will generate a random location near its current location and pathfind to it. This repeats and never ends, which means it is necessary to call NwObject.ClearActionQueue in order to allow a creature to perform any other action once BeginRandomWalking has been called. More...
 
async Task ActionRest (bool enemyLineOfSightCheck=false)
 Instructs this creature to rest. More...
 
async Task ActionSit (NwPlaceable sitPlaceable, bool alignToPlaceable=true)
 Instructs the creature to sit in the specified placeable. More...
 
async Task ActionUnequipItem (NwItem item)
 Instructs this creature to unequip the specified item from whatever slot it is currently in. More...
 
Task ActionUnlockObject (NwDoor door)
 Instructs this creature to approach and unlock the specified door. More...
 
Task ActionUnlockObject (NwPlaceable placeable)
 Instructs this creature to approach and unlock the specified placeable. More...
 
async Task ActionUseFeat (NwFeat feat, Location target, Subfeat subFeat=Subfeat.None)
 Instructs this creature to use the specified feat at the target location. More...
 
async Task ActionUseFeat (NwFeat feat, NwGameObject target, Subfeat subFeat=Subfeat.None)
 Instructs this creature to use the specified feat on the target object. More...
 
async Task ActionUseItem (NwItem item, ItemProperty itemProperty, Location location, bool decrementCharges=true, int subPropertyIndex=0)
 Instructs this creature to use the specified item property of an item in their inventory. More...
 
async Task ActionUseItem (NwItem item, ItemProperty itemProperty, NwGameObject gameObject, bool decrementCharges=true, int subPropertyIndex=0)
 Instructs this creature to use the specified item property of an item in their inventory. More...
 
async Task ActionUseSkill (NwSkill skill, NwGameObject target, SubSkill subSkill=SubSkill.None, NwItem? itemUsed=null)
 Instructs this creature to attempt to use a skill on another object. More...
 
async Task ActionUseTalent (Talent talent, Location target)
 Uses the specified talent. More...
 
async Task ActionUseTalent (Talent talent, NwGameObject target)
 Uses the specified talent. More...
 
void AddFeat (NwFeat feat)
 Gives this creature the specified feat.
Consider using the AddFeat(NwFeat, int) overload to properly allocate the feat to a level. More...
 
void AddFeat (NwFeat feat, int level)
 Gives this creature the specified feat at a level.
Consider using the AddFeat(NwFeat, int) overload to properly allocate the feat to a level. More...
 
void AddSpecialAbility (SpecialAbility ability)
 Adds the specified ability to this creature. More...
 
void AdjustPartyAlignment (Alignment alignment, int shift)
 Adjusts the alignment of this creature and associated party members by the specified value.
Use the LawChaosValue and GoodEvilValue setters to only affect this creature. More...
 
void BroadcastSkillRoll (int diceRoll, NwSkill skill, int modifier, int difficultyClass, bool take20, SkillResult result)
 Causes this creature to broadcast feedback for an arbitrary skill roll (pre-calculated)
This causes a message to be posted in the combat log, and floaty skill text to appear above the character. More...
 
int CalculateAbilityModifierFromScore (byte abilityScore)
 Gets the ability modifier from the given ability score. More...
 
ResistSpellResult CheckResistSpell (NwGameObject target)
 Performs a spell resistance check between this creature, and the specified target object. More...
 
void ClearDamageLevelOverride ()
 Clears any override that is set for the creature's damage level.
More...
 
void ClearInitiativeModifier ()
 Clears the modifier that is set for the creature's initiative.
More...
 
override NwCreature Clone (Location location, string? newTag=null, bool copyLocalState=true)
 Creates a copy of this game object. More...
 
void DecrementRemainingFeatUses (NwFeat feat, int amount=1)
 Decrements the remaining number of uses of a particular feat for this creature by the specified amount.
You must have at least one feat use remaining to be able to decrement it.
Passive feats, and feats that can be used unlimited times per day, cannot be decremented or suppressed. More...
 
bool DeserializeQuickbar (byte[] serialized)
 
async Task DoDoorAction (NwDoor door, DoorAction doorAction)
 Instructs this creature to perform the specified action on a door. More...
 
async Task DoPlaceableAction (NwPlaceable placeable, PlaceableAction placeableAction)
 Instructs this creature to perform the specified action on a placeable. More...
 
bool DoSkillCheck (NwSkill skill, int difficultyClass)
 Returns true if 1d20 + skill rank is greater than, or equal to difficultyClass. More...
 
NwItemFindItemWithTag (string itemTag)
 Get the item possessed by this creature with the tag itemTag. More...
 
void ForceRest ()
 Instantly gives this creature the benefits of a rest (restored hitpoints, spells, feats, etc...). More...
 
int GetAbilityModifier (Ability ability)
 Gets this creature's ability modifier for the specified ability. More...
 
int GetAbilityScore (Ability ability, bool baseOnly=false)
 Gets the specified ability score from this creature. More...
 
bool GetActionMode (ActionMode actionMode)
 Gets if this creature is using the specified action mode. More...
 
int GetArmorClassVersus (NwCreature creature)
 Return the Armor Class this creature has against another creature More...
 
NwCreatureGetAssociate (AssociateType associateType)
 Gets the first associate of this creature with the matching associate type.
See Henchmen for getting a list of all henchmen associated with this creature. See Associates for getting a list of all creatures associated with this creature. More...
 
int GetAttackBonus (bool isMelee=false, bool isTouchAttack=false, bool isOffHand=false, bool includeBaseAttackBonus=true)
 Gets the creature's highest attack bonus based on its own stats.
AB vs. Type and +AB on Gauntlets are excluded. More...
 
int GetBaseSavingThrow (SavingThrow savingThrow)
 Gets this creature's base save value for the specified saving throw. More...
 
IEnumerable< NwDomainGetClassDomains (NwClass? nwClass=default)
 Returns this creature's domains in the specified class. Unless custom content is used, only clerics have domains. More...
 
CreatureClassInfoGetClassInfo (NwClass? nwClass)
 Gets the CreatureClassInfo associated with the specified class type. More...
 
int GetCreatureBodyPart (CreaturePart creaturePart)
 Gets the model number for the specified body part on the creature. More...
 
DamageLevelEntryGetDamageLevelOverride ()
 Gets the override that is set for the creature's damage level.
More...
 
int GetFeatGainLevel (NwFeat feat)
 Gets the level a feat was gained. More...
 
byte GetFeatRemainingUses (NwFeat feat)
 Gets the remaining uses available for the specified feat. More...
 
byte GetFeatTotalUses (NwFeat feat)
 Gets the max/total amount of times the specified feat can be used. More...
 
int? GetInitiativeModifier ()
 Gets the modifier that is set for the creature's initiative.
More...
 
NwItemGetItemInSlot (InventorySlot slot)
 Gets the item that is equipped in the specified inventory slot. More...
 
CreatureLevelInfo GetLevelStats (int level)
 Gets the level stat info for the specified level (feat, class, skills, etc.). More...
 
byte GetPrePolymorphAbilityScore (Ability ability)
 Gets the raw ability score a polymorphed creature had prior to polymorphing. More...
 
PlayerQuickBarButton GetQuickBarButton (byte index)
 
PlayerQuickBarButton[] GetQuickBarButtons ()
 
byte GetRawAbilityScore (Ability ability)
 Gets the base (raw) ability score for the specified ability, without racial modfiers. More...
 
int GetSavingThrow (SavingThrow savingThrow)
 Gets the specified saving throw modifier for this creature. More...
 
int GetSkillRank (NwSkill skill, bool ranksOnly=false)
 Gets the number of ranks this creature has in the specified skill. More...
 
EquipmentSlots GetSlotFromItem (NwItem item)
 Gets the slot that the specified item is in. More...
 
SpellSchool GetSpecialization (NwClass? nwClass=default)
 Returns this creature's spell school specialization in the specified class.
Unless custom content is used, only Wizards have spell schools. More...
 
int GetSpellUsesLeft (NwClass nwClass, NwSpell spell, MetaMagic metaMagic=MetaMagic.None, int domain=0)
 Gets the number of remaining uses for a specific spell for this creature. More...
 
bool GetTileExplored (NwArea area, int x, int y)
 Gets whether the given area tile is visible on the map for this creature.
Tile exploration also controls object visibility in areas and the fog of war for interior and underground areas. More...
 
void GiveGold (int amount, bool showFeedback=true)
 Gives gold to this creature. More...
 
async Task GiveItem (NwItem item)
 Moves the specified item/item stack to this creature's inventory. More...
 
async Task GiveItem (NwItem item, int amount)
 Moves a specified amount of items from an item stack to this creature's inventory. More...
 
bool HasFeatEffect (NwFeat feat)
 Gets whether this creature is under the effects of the specified feat. More...
 
bool HasFeatPrepared (NwFeat feat)
 Returns true if this creature knows the specified NwFeat, and can use it.
Use KnowsFeat to simply check if a creature knows NwFeat, but may or may not have uses remaining. More...
 
bool HasSkill (NwSkill skill)
 Returns true if this creature has the skill specified, and is useable. More...
 
bool HasSpellEffect (NwSpell spell)
 Gets whether this creature is under the effects of the specified spell. More...
 
bool HasSpellUse (NwSpell spell)
 Gets if this creature has the specified spell available to cast. More...
 
bool HasTalent (Talent talent)
 Determines whether this creature has the specified talent. More...
 
void IncrementRemainingFeatUses (NwFeat feat, int amount=1)
 Increment the remaining uses per day for this (creature) by the specified amount.
Total number of feats uses per-day cannot exceed the creature's standard maximum. More...
 
bool IsCreatureHeard (NwCreature creature)
 Gets whether this creature can hear the specified creature. More...
 
bool IsCreatureSeen (NwCreature creature)
 Gets whether this creature can see the specified creature. More...
 
bool IsEnemy (NwCreature target)
 Gets a value indicating whether this creature considers the target as a friend. More...
 
bool IsFlanking (NwCreature target)
 Gets if this creature is flanking the specified target. More...
 
bool IsFriend (NwCreature target)
 Gets a value indicating whether this creature considers the target as a enemy. More...
 
bool IsImmuneTo (ImmunityType immunityType, NwGameObject? verses=null)
 Gets whether this creature has a specific immunity. More...
 
bool IsNeutral (NwCreature target)
 Gets a value indicating whether this creature considers the target as neutral. More...
 
bool IsReactionTypeFriendly (NwCreature creature)
 Gets whether this creature has a friendly reaction towards another given creature. More...
 
bool IsReactionTypeHostile (NwCreature creature)
 Gets whether this creature has a hostile reaction towards another given creature. More...
 
bool IsReactionTypeNeutral (NwCreature creature)
 Gets whether this creature has a neutral reaction towards another given creature. More...
 
async Task< bool > IsWeaponEffective (NwGameObject target, bool offHand=false)
 Check whether this creature can damage the specified object using their current weapon/s. More...
 
async Task JumpToObject (NwGameObject gameObject, bool walkStraightLineToPoint=true)
 Teleports this creature to the nearest valid location by the target.
This action produces no visual effect. More...
 
bool KnowsFeat (NwFeat feat)
 Gets if this creature knows the specified feat. More...
 
void LevelUp (NwClass nwClass, int count)
 Adds levels of the specified class to a creature, bypassing all validation. More...
 
int LevelUpHenchman (NwClass nwClass, PackageType package, bool spellsReady=false)
 Levels up this creature using the default settings.
You can assign a new class to level up
If an invalid class combination is chosen the default class is leveled up.
Package determines which package to level up with.
If package is omitted it will use the starting package assigned to that class or just the class package.
More...
 
bool MeetsFeatRequirements (NwFeat feat)
 Gets if this creature meets the requirements to take the specified feat. More...
 
void PlayVoiceChat (VoiceChatType voiceChatType)
 Instructs this creature to speak/play the specified voice chat. More...
 
void RemoveFeat (NwFeat feat, bool removeFeatFromLevelList=false)
 Removes the specified feat from this creature. More...
 
void RemoveSpecialAbilityAt (int index)
 Removes the specified ability at the given index. More...
 
int Reputation (NwCreature creature)
 Gets how one creature feels toward this creature. More...
 
void RestoreAllSpells ()
 Restore all NwCreature spells per day for all levels. More...
 
void RestoreBaseAttackBonus ()
 Restores the number of base attacks back to it's original state on this (creature). More...
 
void RestoreSpells (byte level)
 Restore all NwCreature spells per day for given level. More...
 
bool RunEquip (NwItem item, EquipmentSlots equipmentSlot)
 Instruct this creature to instantly equip the specified item. More...
 
bool RunEquip (NwItem item, InventorySlot inventorySlot)
 Instruct this creature to instantly equip the specified item. More...
 
bool RunUnequip (NwItem item)
 Instruct this creature to instantly unequip the specified item. More...
 
override? byte[] Serialize ()
 
byte?[] SerializeQuickbar ()
 
void SetActionMode (ActionMode actionMode, bool status)
 Instructs this creature to enable/disable the specified action mode (parry, power attack, expertise, etc). More...
 
void SetAssociateListenPatterns ()
 Initialises this creature to listen for the standard AssociateCommand messages.
These are the messages sent by the standard party UI. More...
 
void SetBaseSavingThrow (SavingThrow savingThrow, sbyte newValue)
 Sets this creatures's base save value for the specified saving throw. More...
 
void SetCreatureBodyPart (CreaturePart creaturePart, int modelNumber)
 Sets the model number to use for the specified body part on the creature. More...
 
void SetDamageLevelOverride (DamageLevelEntry damageLevel)
 Sets the override value to use for this creature's damage level.
More...
 
void SetEffectIconFlashing (EffectIconTableEntry effectIcon, bool flashing)
 Sets whether the specified effect icon should be flashing in the creature's GUI icon bar. More...
 
void SetFeatRemainingUses (NwFeat feat, byte remainingUses)
 Sets the remaining uses available for the specified feat.
Cannot exceed the creature's total/max uses of the feat. More...
 
void SetInitiativeModifier (int modifier)
 Sets the modifier that is set for the creature's initiative.
More...
 
void SetQuickBarButton (byte index, PlayerQuickBarButton data)
 
void SetQuickBarButtons (PlayerQuickBarButton[] buttons)
 
void SetSkillRank (NwSkill skill, sbyte rank)
 Sets the skill ranks for the specified skill on this creature. More...
 
void SetSpecialAbilityAt (int index, SpecialAbility ability)
 Updates the specified ability at the given index. More...
 
void SetsRawAbilityScore (Ability ability, byte value)
 Sets the base (raw) ability score for the specified ability, without racial modifiers. More...
 
bool SetTileExplored (NwArea area, int x, int y, bool newState)
 Gets whether the given area tile is visible on the map for this creature.
Tile exploration also controls object visibility in areas and the fog of war for interior and underground areas. More...
 
async Task SpeakOneLinerConversation (string dialogResRef="", NwGameObject? tokenTarget=null)
 Instructs this creature to immediately speak the first non-branching conversation line in their dialog. More...
 
void SummonAnimalCompanion ()
 Instructs this creature to summon their animal companion.
Does nothing if this creature has no animal companion available. More...
 
void SummonFamiliar ()
 Instructs this creature to summon their familiar (wizard/sorcerer).
Does nothing if this creature has no familiar available. More...
 
void TakeGold (int amount, bool showFeedback=true)
 Takes gold away from this creature. More...
 
Talent TalentBest (TalentCategory category, int maxCr)
 Gets the best talent from a group of talents. More...
 
Talent TalentRandom (TalentCategory category)
 Gets a random talent from a group of talents possessed by this creature. More...
 
async Task< TouchAttackResult > TouchAttackMelee (NwGameObject target)
 Attempts to perform a melee touch attack on target. This is not a creature action, and assumes that this creature is already within range of the target. More...
 
async Task< TouchAttackResult > TouchAttackRanged (NwGameObject target, bool displayFeedback)
 Attempts to perform a ranged touch attack on the target. This is not a creature action, and simply does a roll to see if the target was hit. More...
 
void UnpossessFamiliar ()
 Instructs this creature to unpossess their familiar.
This function can be run on the player creature, or the possessed familiar. More...
 
- Public Member Functions inherited from Anvil.API.NwGameObject
async Task ActionCastSpellAt (NwSpell spell, Location target, MetaMagic metaMagic=MetaMagic.Any, bool cheat=false, ProjectilePathType projectilePathType=ProjectilePathType.Default, bool instant=false, NwClass? spellClass=null, bool spontaneousCast=false, int domainLevel=0)
 Casts a spell at an location. More...
 
async Task ActionCastSpellAt (NwSpell spell, NwGameObject target, MetaMagic metaMagic=MetaMagic.Any, bool cheat=false, int domainLevel=0, ProjectilePathType projectilePathType=ProjectilePathType.Default, bool instant=false, NwClass? spellClass=null, bool spontaneousCast=false)
 Casts a spell at an object. More...
 
async Task ActionJumpToLocation (Location location)
 Jumps this object to the specified location.
Unlike the Location setter, this method will compute a safe location when teleporting, and may not equal the location specified. More...
 
async Task ActionWait (TimeSpan duration)
 Instructs this object to do nothing for the specified duration, before continuing with the next item in the action queue. More...
 
void ApplyEffect (EffectDuration durationType, Effect effect, TimeSpan duration=default)
 Applies the specified effect to this game object. More...
 
void ClearObjectAnimationOverride (string anim)
 Clears the specified animation override, restoring the original. More...
 
virtual void Destroy ()
 Destroys this object (irrevocably). More...
 
float Distance (NwGameObject target)
 Returns the distance to the target.
If you only need to compare the distance, you can compare the squared distance using DistanceSquared to avoid a costly sqrt operation. More...
 
float DistanceSquared (NwGameObject target)
 Returns the squared distance to the target. More...
 
async void EndConversation ()
 Immediately ends this GameObject's current conversation. More...
 
Task FaceToObject (NwGameObject target)
 Rotates this object to face towards target. More...
 
virtual async Task FaceToPoint (Vector3 point)
 Rotates this object to face a position. More...
 
int GetColor (ColorChannel colorChannel)
 Gets the color for the specified color channel. More...
 
IEnumerable< NwCreatureGetNearestCreatures ()
 Returns the creatures closest to this object. More...
 
IEnumerable< NwCreatureGetNearestCreatures (CreatureTypeFilter filter1)
 Returns the creatures closest to this object, matching the specified criteria. More...
 
IEnumerable< NwCreatureGetNearestCreatures (CreatureTypeFilter filter1, CreatureTypeFilter filter2)
 Returns the creatures closest to this object, matching all of the specified criteria. More...
 
IEnumerable< NwCreatureGetNearestCreatures (CreatureTypeFilter filter1, CreatureTypeFilter filter2, CreatureTypeFilter filter3)
 Returns the creatures closest to this object, matching all of the specified criteria. More...
 
IEnumerable< T > GetNearestObjectsByType< T > ()
 Gets the nearest object that is of the specified type. More...
 
VisualTransform GetVisualTransform (ObjectVisualTransformDataScope scope)
 Gets the visual transform of this object for the specified scope. More...
 
bool HasLineOfSight (NwGameObject target)
 Gets whether this object has a direct line of sight to the specified object (not blocked by any geometry).
More...
 
override? Guid PeekUUID ()
 Attempts to get the UUID of this object, if assigned. More...
 
async Task PlayAnimation (Animation animation, float animSpeed, bool queueAsAction=false, TimeSpan duration=default)
 Plays the specified animation. More...
 
async Task PlaySound (string soundName)
 Plays the specified sound as mono audio from the location of this object. More...
 
async Task PlaySoundByStrRef (StrRef strRef, bool runAsAction=true)
 Plays a sound associated with a string reference (strRef).
The sound comes out as a mono sound sourcing from the location of the object running the command.
If runAsAction is False, then the sound is played instantly. More...
 
void RemoveEffect (Effect effect)
 Removes the specified effect from this game object. More...
 
void ReplaceObjectAnimation (string anim, string newAnim)
 Replaces the specified animation with an override.
Use ClearObjectAnimationOverride to clear the override. More...
 
void ReplaceObjectTexture (string texture, string newTexture)
 Replaces the specified texture with a new texture on this object only. More...
 
void ResetMaterialShaderUniforms ()
 Resets all material shader parameter overrides on this object. More...
 
void ResetMaterialShaderUniforms (string material)
 Resets all material shader parameter overrides for the specified material on this object.

Parameters
materialThe material on the object to be reset.
More...
 
void ResetMaterialShaderUniforms (string material, string param)
 Resets the specified material shader parameter override for the specified material.

Parameters
materialThe material on the object to be reset.
paramThe parameter override to reset.
More...
 
SavingThrowResult RollSavingThrow (SavingThrow savingThrow, int dc, SavingThrowType saveType, NwGameObject? saveVs=null)
 Performs a saving throw against the given dc. More...
 
void SetColor (ColorChannel colorChannel, int newColor)
 Sets the color for the specified color channel. More...
 
async Task SetFacing (float facing)
 Rotates this object to face the specified facing angle. More...
 
async Task SetIsDestroyable (bool destroyable, bool raiseable=true, bool selectableWhenDead=false)
 Sets whether this object is destroyable. More...
 
void SetListenPattern (string pattern, int patternNumber)
 Sets a listen pattern for this object, assigning a pattern number that is accessible from the related object's OnConversation event. More...
 
void SetMaterialShaderUniform (string material, string param, float value)
 Sets a material shader uniform override. More...
 
void SetMaterialShaderUniform (string material, string param, int value)
 Sets a material shader uniform override. More...
 
void SetMaterialShaderUniform (string material, string param, Vector4 value)
 Sets a material shader uniform override. More...
 
void SetTextBubbleOverride (ObjectUiTextBubbleOverride mode, string text)
 Sets a text override for the hover/tab-highlight text of this object. More...
 
- Public Member Functions inherited from Anvil.API.NwObject
async Task AddActionToQueue (System.Action action)
 Inserts the function call aCommand into the Action Queue, ensuring the calling object will perform actions in a particular order. More...
 
async Task ClearActionQueue (bool clearCombatState=false)
 Clear all the object's actions. More...
 
void ClearEventSubscriptions ()
 Clears any event subscriptions associated with this object. More...
 
bool Equals (NwObject? other)
 
override bool Equals (object? obj)
 
void ForceRefreshUUID ()
 
string GetEventScript (EventScriptType eventType)
 Gets the script assigned to run for the specified object event. More...
 
override int GetHashCode ()
 
GetObjectVariable< T > (string name)
 Gets the specified object variable for this object. More...
 
bool IsEventLocked (EventScriptType eventType)
 Gets a value indicating whether the event script can be modified for the specified event. More...
 
Json SerializeToJson (bool saveObjectState)
 Serializes this game object to a json representation More...
 
void SetEventScript (EventScriptType eventType, string? script)
 Sets the script to be run on the specified object event. More...
 
async Task SpeakString (string message, TalkVolume talkVolume=TalkVolume.Talk, bool queueAsAction=false)
 Instructs this object to speak. More...
 
override string ToString ()
 The ID of this object as a string. Can be used in StringExtensions.ParseObject while the object is alive.
This cannot be used across server restarts. See UUID for a persistent unique identifier. More...
 
bool TryGetUUID (out Guid uid)
 Attempts to get the UUID for this object, assigning a new ID if it does not already exist.
More...
 
async Task WaitForObjectContext ()
 Notifies then awaits for this object to become the current active object for the purpose of implicitly assigned values (e.g. effect creators).
If the current active object is already this object, then the code runs immediately. Otherwise, it will be run with all other closures.
This is the async equivalent of AssignCommand in NWScript. More...
 

Static Public Member Functions

static ? NwCreature Create (string template, Location location, bool useAppearAnim=false, string newTag="")
 Creates a creature at the specified location. More...
 
static ? NwCreature Deserialize (byte[] serialized)
 
static implicit operator CNWSCreature? (NwCreature? creature)
 
- Static Public Member Functions inherited from Anvil.API.NwObject
static IEnumerable< T > FindObjectsOfType< T > ()
 Locates all objects of the specified type. More...
 
static IEnumerable< NwObjectFindObjectsWithTag (params string[] tags)
 Locates all objects of that have the specified tag. More...
 
static IEnumerable< T > FindObjectsWithTag< T > (params string[] tags)
 Locates all objects of the specified type that have the specified tag. More...
 
static implicit operator uint (NwObject? gameObject)
 
static bool operator!= (NwObject? left, NwObject? right)
 
static bool operator== (NwObject? left, NwObject? right)
 

Protected Member Functions

override void AddToArea (CNWSArea area, float x, float y, float z)
 
- Protected Member Functions inherited from Anvil.API.NwGameObject
CloneInternal< T > (Location location, string? newTag, bool copyLocalState)
 
- Protected Member Functions inherited from Anvil.API.NwObject
 NwObject (ICGameObject gameObject)
 
void AssertObjectValid ()
 

Properties

int AC [get]
 Gets this creature's armour class. More...
 
int Age [get, set]
 Gets or sets this creature's age, in years. More...
 
AiLevel AiLevel [get, set]
 Gets or sets the current AI level that this creature is running at.
Anvil.API.AiLevel.Default is recommended for most creatures. Too many creatures at Anvil.API.AiLevel.Normal or higher can cause performance degradation. More...
 
bool AlwaysWalk [get, set]
 Gets or sets whether this creature is forced to walk.
Is not persistent, and must be applied again at login. More...
 
string AnimalCompanionName [get]
 Gets this creature's animal companion name. More...
 
AnimalCompanionCreatureType AnimalCompanionType [get]
 Gets this creature's animal companion creature type. More...
 
AppearanceTableEntry Appearance [get, set]
 Gets or sets the appearance of this creature. More...
 
int ArcaneSpellFailure [get]
 Gets the arcane spell failure factor for this creature. More...
 
sbyte ArmorCheckPenalty [get]
 
IEnumerable< NwCreatureAssociates [get]
 Gets all creatures associated with this creature. More...
 
AssociateType AssociateType [get]
 Gets the associate type of this creature, otherwise returns Anvil.API.AssociateType.None if this creature is not an associate of anyone. More...
 
NwGameObjectAttackTarget [get]
 Gets this creature's current attack target. More...
 
NwGameObjectAttemptedAttackTarget [get]
 Gets the last target this creature tried to attack. More...
 
NwGameObjectAttemptedSpellTarget [get]
 Gets the target this creature attempted to cast a spell at. More...
 
sbyte BaseAC [get, set]
 Gets or sets the base AC for this creature. More...
 
byte BaseArmorArcaneSpellFailure [get, set]
 Gets or sets the current base armor arcane spell failure factor for this creature (global ASF is automatically recalculated). More...
 
byte BaseAttackBonus [get, set]
 Gets or sets the Base Attack Bonus for this creature. More...
 
int BaseAttackCount [get, set]
 Sets the number of base attacks for this creature.
The range of values accepted are from 1 to 6.
More...
 
byte BaseShieldArcaneSpellFailure [get, set]
 Gets or sets the current base shield arcane spell failure factor for this creature (global ASF is automatically recalculated). More...
 
NwPlaceableBodyBag [get]
 Gets the body bag assigned to this creature as a result of its death. More...
 
BodyBagTableEntry BodyBagTemplate [get, set]
 Gets or sets the body bag template to use when this creature dies. More...
 
float ChallengeRating [get, set]
 Gets or sets the calculated challenge rating for this creature. More...
 
IReadOnlyList< CreatureClassInfoClasses [get]
 Gets this creature's classes, and associated class info. More...
 
CombatMode CombatMode [get]
 Gets the creature's current Combat Mode.
Can be used in the Events.OnCombatModeToggle event to determine which combat mode is being toggled off. More...
 
bool Commandable [get, set]
 Gets or sets a value indicating whether this creature's action queue can be modified. More...
 
NwPlayer?? ControllingPlayer [get, set]
 Gets or sets the player currently controlling this creature.
If this creature is a possessed familiar or is DM possessed, this will return the player or DM controlling this creature.
If this creature is a player creature (the creature a played logged in with), but the player is possessing another creature, this returns null.
If no player is controlling this creature, this returns null.
The setter makes this this creature controllable by the specified player, if player party control is enabled. More...
 
TimeSpan CorpseDecayTime [get, set]
 Gets or sets the corpse decay time for this creature. More...
 
Action CurrentAction [get]
 Gets the current action that this creature is executing. More...
 
DamageLevelEntry DamageLevel [get]
 Gets the creature's current damage level (Uninjured, Injured, Near Death, etc).
If an override is set with SetDamageLevelOverride, this property will return the override value. More...
 
bool DefensiveCastingModeActive [get]
 Gets a value indicating whether this creature is currently in Defensive Casting Mode. More...
 
string Deity [get, set]
 Gets or sets the name of this creature's deity. More...
 
bool DetectModeActive [get]
 Gets a value indicating whether this creature is currently in Detect Mode. More...
 
string? DialogResRef [get, set]
 Gets or sets the dialog ResRef for this creature. More...
 
bool Disarmable [get]
 Gets a value indicating whether this creature can be disarmed (checks disarm flag on creature, and if the creature actually has a weapon equipped in their right hand that is droppable). More...
 
NwEncounterEncounter [get]
 Gets the encounter that spawned this creature. More...
 
bool ExploresMinimap [get, set]
 Gets or sets a value indicating whether this creature will auto-explore the minimap as it walks around. More...
 
NwFaction Faction [get, set]
 Gets or sets the faction of this object. More...
 
string FamiliarName [get]
 Gets this creature's familiar name. More...
 
FamiliarCreatureType FamiliarType [get]
 Gets the type of familiar that this creature can summon. More...
 
int FeatCount [get]
 Gets the number of feats known by this creature. More...
 
IReadOnlyList< NwFeatFeats [get]
 Gets the feats known by this character. More...
 
bool FlatFooted [get]
 Gets a value indicating whether this creature is flat footed. More...
 
FootstepType FootstepType [get, set]
 Gets or sets the sounds to use when this creature makes a step. By default, this is based on the creature's appearance. More...
 
Gender Gender [get, set]
 Gets or sets the gender of this creature. More...
 
uint Gold [get, set]
 Gets or sets the amount of gold carried by this creature.
This property does not display feedback to the creature. See GiveGold and TakeGold for options that provide feedback. More...
 
Alignment GoodEvilAlignment [get]
 Gets this creature's Good/Evil Alignment. More...
 
int? GoodEvilValue [get, set]
 Gets or sets this creature's Evil (0) - Good (100) alignment value. More...
 
IEnumerable< NwCreatureHenchmen [get]
 Gets all henchmen associated with this creature. More...
 
bool Immortal [get, set]
 Gets or sets a value indicating whether this creature is immortal.
An immortal creature still takes damage, but cannot be killed. More...
 
Inventory Inventory [get]
 Gets the inventory of this creature. More...
 
bool IsBartering [get]
 Gets a value indicating whether this creature is currently bartering. More...
 
bool IsDead [get]
 Gets a value indicating whether this creature is a dead NPC, dead PC, or dying PC. More...
 
bool IsDMAvatar [get]
 Gets a value indicating whether this creature is a DM avatar character.
This returns false for NPC creatures possessed by DMs. More...
 
bool IsDMPossessed [get]
 Gets a value indicating whether this creature is currently possessed by a DM avatar. More...
 
bool IsEncounterCreature [get]
 Gets a value indicating whether this creature was spawned from an encounter. More...
 
bool IsInCombat [get]
 Gets a value indicating whether this creature is in combat. More...
 
bool IsLoginPlayerCharacter [get]
 Gets if this creature is a player character/DM avatar.
If this creature is a NPC or familiar, regardless of possession, this will return false. More...
 
bool IsPlayableRace [get]
 Gets a value indicating whether this creature is a playable racial type. More...
 
bool IsPlayerControlled [get]
 Gets if this creature is currently being controlled by a player/DM.
If this creature is a possessed familiar or is DM possessed, this will return true.
If this creature is a player creature (the creature a played logged in with), but the player is possessing another creature, this returns false.
If no player is controlling this creature, this returns false. More...
 
bool IsPossessedFamiliar [get]
 Gets a value indicating whether this creature is a familiar currently possessed by a master. More...
 
bool? IsRangedWeaponEquipped [get]
 Gets if this creature is currently holding a ranged weapon. More...
 
bool IsResting [get]
 Gets a value indicating whether this creature is currently resting. More...
 
LastAttackMode LastAttackMode [get]
 Gets the attack mode used during this creature's last attack. More...
 
AssociateCommand LastCommandFromMaster [get]
 Gets the last command issued to this creature. More...
 
SpecialAttack LastSpecialAttackType [get]
 Gets the special attack type used in the last physical attack against this creature. More...
 
NwTrappableLastTrapDetected [get]
 Gets the last trap detected by this creature. More...
 
Alignment LawChaosAlignment [get]
 Gets this creature's Law/Chaos Alignment. More...
 
int? LawChaosValue [get, set]
 Gets or sets this creature's Chaos (0) - Lawful (100) alignment value. More...
 
int Level [get]
 Gets the Hit Dice/Level of this creature. More...
 
IReadOnlyList< CreatureLevelInfoLevelInfo [get]
 Gets an enumerable containing information about this creature's levels (feats, skills, class taken, etc). More...
 
NwPlayerLoginPlayer [get]
 Gets the player that logged in with this creature.
If this creature is a NPC or familiar, regardless of possession, this will return null. More...
 
bool Lootable [get, set]
 Gets or sets a value indicating whether this creature will leave a lootable corpse on death.
This flag must be set while the creature is alive. Players are not supported. More...
 
NwCreatureMaster [get]
 Gets the possessor of this creature. This can be the master of a familiar, or the DM for a DM controlled creature. More...
 
MovementRate MovementRate [get, set]
 Gets or sets the movement rate of this creature. More...
 
float MovementRateFactor [get, set]
 Gets or sets the creature's current movement rate factor.
Base movement rate factor is 1.0. More...
 
MovementType MovementType [get]
 Gets the creature's current movement type. More...
 
Action< ModuleEvents.OnActivateItemOnActivateItem
 
Action< OnAssociateAddOnAssociateAdd
 
Action< OnAssociateRemoveOnAssociateRemove
 
Action< CreatureEvents.OnBlockedOnBlocked
 
Action< OnCheckEffectImmunityOnCheckEffectImmunity
 
Action< OnCombatDRBrokenOnCombatDRBroken
 
Action< OnCombatModeToggleOnCombatModeToggle
 
Action< CreatureEvents.OnCombatRoundEndOnCombatRoundEnd
 
Action< OnCombatRoundStartOnCombatRoundStart
 
Action< CreatureEvents.OnConversationOnConversation
 
Action< OnCreatureAttackOnCreatureAttack
 
Action< OnCreatureCheckProficienciesOnCreatureCheckProficiencies
 
Action< OnCreatureDamageOnCreatureDamage
 
Action< CreatureEvents.OnDamagedOnDamaged
 
Action< CreatureEvents.OnDeathOnDeath
 
Action< OnDetectModeUpdateOnDetectModeUpdate
 
Action< CreatureEvents.OnDisturbedOnDisturbed
 
Action< OnDoListenDetectionOnDoListenDetection
 
Action< OnDoSpotDetectionOnDoSpotDetection
 
Action< OnFamiliarPossessOnFamiliarPossess
 
Action< OnFamiliarUnpossessOnFamiliarUnpossess
 
Action< OnHealKitUseOnHealKitUse
 
Action< CreatureEvents.OnHeartbeatOnHeartbeat
 
Action< OnInventoryGoldAddOnInventoryGoldAdd
 
Action< OnInventoryGoldRemoveOnInventoryGoldRemove
 
Action< OnItemEquipOnItemEquip
 
Action< OnItemInventoryCloseOnItemInventoryClose
 
Action< OnItemInventoryOpenOnItemInventoryOpen
 
Action< OnItemPayToIdentifyOnItemPayToIdentify
 
Action< OnItemScrollLearnOnItemScrollLearn
 
Action< OnItemUnequipOnItemUnequip
 
Action< OnItemUseOnItemUse
 
Action< OnItemValidateEquipOnItemValidateEquip
 
Action< OnItemValidateUseOnItemValidateUse
 
Action< OnLevelDownOnLevelDown
 
Action< OnLevelUpOnLevelUp
 
Action< OnLevelUpAutomaticOnLevelUpAutomatic
 
Action< OnObjectUseOnObjectUse
 
Action< CreatureEvents.OnPerceptionOnPerception
 
Action< CreatureEvents.OnPhysicalAttackedOnPhysicalAttacked
 
Action< CreatureEvents.OnRestedOnRested
 
Action< CreatureEvents.OnSpawnOnSpawn
 
Action< OnSpellActionOnSpellAction
 
Action< CreatureEvents.OnSpellCastAtOnSpellCastAt
 
Action< OnSpellSlotClearOnSpellSlotClear
 
Action< OnSpellSlotMemorizeOnSpellSlotMemorize
 
Action< OnStealthModeUpdateOnStealthModeUpdate
 
Action< OnStoreRequestBuyOnStoreRequestBuy
 
Action< OnStoreRequestSellOnStoreRequestSell
 
Action< OnUseFeatOnUseFeat
 
Action< CreatureEvents.OnUserDefinedOnUserDefined
 
Action< OnUseSkillOnUseSkill
 
string OriginalFirstName [get, set]
 Gets or sets the original first name of this creature. More...
 
string OriginalLastName [get, set]
 Gets or sets the original last name of this creature. More...
 
string OriginalName [get]
 Gets the original name of this creature. More...
 
Phenotype Phenotype [get, set]
 Gets or sets this creature's currently set Phenotype (body type). More...
 
override Vector3 Position [set]
 Gets or sets the creature's position.
NOTE: For player creatures, you likely want to immobilize the player first before moving them.
An issue exists where drive mode (W/A/S/D) can cause a client/server desync, making the creature appear at their old position. More...
 
NwRace Race [get, set]
 Gets this creature's race. More...
 
ushort RemainingSkillPoints [get, set]
 Gets or sets the remaining skill points this creature has to spend. More...
 
sbyte ShieldCheckPenalty [get]
 
NwPlaceableSittingObject [get]
 Gets the placeable object (if any) that this creature is currently sitting in. More...
 
CreatureSize Size [get, set]
 Gets or sets the size of this creature. More...
 
ushort SoundSet [get, set]
 Gets or sets the sound set index for this creature. More...
 
IReadOnlyList< SpecialAbilitySpecialAbilities [get]
 Gets the special abilities available to this creature. More...
 
IEnumerable< CreatureSpellAbilitySpellAbilities [get]
 Gets a list of spell abilities usable by this creature. More...
 
sbyte SpellResistance [get, set]
 Gets or sets the spell resistance of this creature.
Returns 0 if this creature has no spell resistance. More...
 
PackageType StartingPackage [get]
 Gets this creature's default level up package. More...
 
bool StealthModeActive [get]
 Gets a value indicating whether this creature is currently in stealth mode. More...
 
string SubRace [get, set]
 Gets or sets the name of this creature's sub-race. More...
 
CreatureTailType TailType [get, set]
 Gets or sets the tail type of this creature. More...
 
decimal TotalWeight [get]
 Gets the total weight of this creature, in pounds. More...
 
int TurnResistanceHitDice [get]
 Gets the number of hit dice worth of Turn Resistance this creature has. More...
 
float? WalkRateCap [get, set]
 Gets or sets the walk rate cap for this creature (persistent).
Set to null to clear existing walk rate caps. Returns null if no walk rate cap is set. More...
 
CreatureWingType WingType [get, set]
 Gets or sets the wing type of this creature. More...
 
int? Xp [get, set]
 Gets or sets the total experience points for this creature, taking/granting levels based on progression. More...
 
- Properties inherited from Anvil.API.NwGameObject
IEnumerable< Effect >? ActiveEffects [get]
 Gets all effects (permanent and temporary) that are active on this game object. More...
 
AnimationState AnimationState [get]
 Gets the current animation state of this object. More...
 
NwAreaArea [get]
 Gets the area this object is currently in. More...
 
int CasterLevel [get]
 Gets the caster level of this object. More...
 
Color HighlightColor [get, set]
 Gets or sets the highlight color of this object. More...
 
int HP [get, set]
 Gets or sets the current HP for this object. More...
 
bool IsInConversation [get]
 Gets a value indicating whether this object is in a conversation. More...
 
bool IsListening [get, set]
 Gets or sets if this object should be listening for chat patterns, via the listen pattern system. More...
 
virtual ? Location Location [get, set]
 Gets or sets the location of this object. More...
 
int MaxHP [get, set]
 Gets or sets the maximum HP for this object. Returns 0 if this object has no defined HP. More...
 
MouseCursor MouseCursor [get, set]
 Gets or sets the mouse cursor for this object. More...
 
Action< ModuleEvents.OnAcquireItemOnAcquireItem
 
Action< OnChatMessageSendOnChatMessageSend
 
Action< OnDisarmWeaponOnDisarmWeapon
 
Action< OnDispelMagicApplyOnDispelMagicApply
 
Action< OnEffectApplyOnEffectApply
 
Action< OnEffectRemoveOnEffectRemove
 
Action< OnHealOnHeal
 
Action< OnSpellBroadcastOnSpellBroadcast
 
Action< OnSpellCastOnSpellCast
 
Action< OnSpellInterruptOnSpellInterrupt
 
Action< ModuleEvents.OnUnacquireItemOnUnacquireItem
 
bool PlotFlag [get, set]
 Gets or sets a value indicating whether the plot flag is enabled. More...
 
PortraitTableEntry???? PortraitId [get, set]
 Gets or sets the PortraitId of this (game object). More...
 
string PortraitResRef [get, set]
 Gets or sets the Portrait ResRef for this object. More...
 
virtual Vector3 Position [get, set]
 Gets or sets the local area position of this GameObject. More...
 
virtual float Rotation [get, set]
 Gets or sets the world rotation for this object. More...
 
NwGameObjectTransitionTarget [get, set]
 Gets or sets the transition target for this object. More...
 
ObjectUiDiscovery UiDiscoveryFlags [get, set]
 Gets or sets flags for controlling Ui discovery of this object. More...
 
bool Useable [get, set]
 Gets or sets a value indicating whether this object should be useable (clickable). More...
 
VisibilityMode VisibilityOverride [get, set]
 Gets or sets the global visiblity override for this object. More...
 
float VisibleDistance [get, set]
 Gets or sets the distance that this object will become visible to clients (default 45.0).
This is still subject to other limitations, such as perception ranges for creatures. More...
 
VisualTransform VisualTransform [get]
 Gets the base visual transform for this object.
Use GetVisualTransform to get the visual transform for other scopes for this object. More...
 
- Properties inherited from Anvil.API.NwObject
string Description [get, set]
 Gets or sets the description for this object. More...
 
static EventService EventService = null! [get]
 
bool HasUUID [get]
 Gets a value indicating whether this object has an assigned UUID. More...
 
bool IsValid [get]
 Gets a value indicating whether this is a valid object. More...
 
IEnumerable< ObjectVariableLocalVariables [get]
 Gets all local variables assigned on this object. More...
 
string Name [get, set]
 Gets or sets the name of this object. More...
 
static Lazy< ObjectVisibilityService > ObjectVisibilityService = null! [get]
 
string OriginalDescription [get]
 Gets the original description for this object as defined in the toolset. More...
 
static ResourceManager ResourceManager = null! [get]
 
string ResRef [get]
 Gets the resource reference used to create this object. More...
 
string Tag [get, set]
 Gets or sets the tag for this object. More...
 
Guid UUID [get]
 Gets the globally unique identifier for this object. More...
 
static VirtualMachine VirtualMachine = null! [get]
 

Additional Inherited Members

- Public Attributes inherited from Anvil.API.NwObject
readonly uint ObjectId
 The ID of this object instance. Not persistent, changes after every spawn of the object.
See UUID for a persistent unique ID for objects. More...
 

Detailed Description

A monster, NPC, player character or DM avatar

Member Function Documentation

◆ ActionAttackTarget()

async Task Anvil.API.NwCreature.ActionAttackTarget ( NwGameObject  target,
bool  passive = false 
)
inline

Instructs this creature to start attacking the target using whichever weapon they currently have equipped.

Parameters
targetThe target object to attack.
passiveIf TRUE, the attacker will not move to attack the target. If we have a melee weapon equipped, we will just stand still.

◆ ActionCastFakeSpellAt() [1/2]

async Task Anvil.API.NwCreature.ActionCastFakeSpellAt ( NwSpell  spell,
Location  location,
ProjectilePathType  pathType = ProjectilePathType.Default 
)
inline

Begins the casting animation and spell fx for the specified spell, without any spell effects.

Parameters
spellThe spell to cast.
locationThe target location for the fake spell to be cast at.
pathTypeAn optional path type for this spell to use.

◆ ActionCastFakeSpellAt() [2/2]

async Task Anvil.API.NwCreature.ActionCastFakeSpellAt ( NwSpell  spell,
NwGameObject  target,
ProjectilePathType  pathType = ProjectilePathType.Default 
)
inline

Begins the casting animation and spell fx for the specified spell, without any spell effects.

Parameters
spellThe spell to cast.
targetThe target object for the fake spell to be cast at.
pathTypeAn optional path type for this spell to use.

◆ ActionCounterspell()

async Task Anvil.API.NwCreature.ActionCounterspell ( NwGameObject  counterSpellTarget)
inline

Intructs this creature to enter counterspell combat mode against the specified creature.

Parameters
counterSpellTargetThe target object to enter counterspell mode against.

◆ ActionEquipItem()

async Task Anvil.API.NwCreature.ActionEquipItem ( NwItem  item,
InventorySlot  slot 
)
inline

Instructs this creature to equip the specified item into the given inventory slot.
Note: If the creature already has an item equipped in the slot specified, it will be unequipped automatically by the call to EquipItem, and dropped if the creature lacks inventory space.
In order for EquipItem to succeed the creature must be able to equip the item normally. This means that:
1) The item is in the creature's inventory.
2) The item must already be identified (if magical).
3) The creature has the level required to equip the item (if magical and ILR is on).
4) The creature possesses the required feats to equip the item (such as weapon proficiencies).

◆ ActionEquipMostDamagingMelee()

async Task Anvil.API.NwCreature.ActionEquipMostDamagingMelee ( NwGameObject verses = null,
bool  offhand = false 
)
inline

Instructs this creature to equip its most damaging melee weapon. If no valid melee weapon is found, it will equip the most damaging ranged weapon.

Parameters
versesIf set, finds the most effective melee weapon for attacking this object.
offhandDetermines if an off-hand weapon is equipped.

◆ ActionEquipMostDamagingRanged()

async Task Anvil.API.NwCreature.ActionEquipMostDamagingRanged ( NwGameObject verses = null)
inline

Instructs this creature to equip its most damaging ranged weapon. If no valid ranged weapon is found, it will equip the most damaging melee weapon.

Parameters
versesIf set, finds the most effective ranged weapon for attacking this object.

◆ ActionEquipMostEffectiveArmor()

async Task Anvil.API.NwCreature.ActionEquipMostEffectiveArmor ( )
inline

Instructs this creature to equip the best armor in its inventory.

This function will do nothing if this creature is in combat (IsInCombat).
It will also not equip clothing items with a base AC of 0, even if the item has AC bonuses applied to it.

◆ ActionForceFollowObject()

async Task Anvil.API.NwCreature.ActionForceFollowObject ( NwGameObject  target,
float  distance 
)
inline

Forces this creature to follow the specified target until NwObject.ClearActionQueue is called.

Parameters
targetThe target to follow.
distanceThe distance to follow the creature at.

◆ ActionForceMoveTo() [1/2]

async Task Anvil.API.NwCreature.ActionForceMoveTo ( Location  target,
bool  run = false,
TimeSpan?  timeOut = null 
)
inline

Instructs this creature to walk/run to the specified target location.

Parameters
targetThe location to move towards.
runIf true, the creature will run rather than walk.
timeOutThe amount of time to search for a path before jumping to the location (Default: 30 seconds).

◆ ActionForceMoveTo() [2/2]

async Task Anvil.API.NwCreature.ActionForceMoveTo ( NwObject  target,
bool  run = false,
float  range = 1.0f,
TimeSpan?  timeOut = null 
)
inline

Instructs this creature to walk/run to the specified target object.

Parameters
targetThe target object to move towards.
runIf true, the creature will run rather than walk.
rangeThe desired distance between the creature and the target object.
timeOutThe amount of time to search for a path before jumping to the object. (Default: 30 seconds).

◆ ActionInteractObject()

async Task Anvil.API.NwCreature.ActionInteractObject ( NwPlaceable  placeable)
inline

Instructs this creature to use the specified placeable.

Parameters
placeableThe placeable object to interact with.

◆ ActionLockObject() [1/2]

Task Anvil.API.NwCreature.ActionLockObject ( NwDoor  door)
inline

Instructs this creature to approach and lock the specified door.

Parameters
doorThe door to lock.

◆ ActionLockObject() [2/2]

Task Anvil.API.NwCreature.ActionLockObject ( NwPlaceable  placeable)
inline

Instructs this creature to approach and lock the specified placeable.

Parameters
placeableThe placeable to lock.

◆ ActionMoveAwayFrom() [1/2]

async Task Anvil.API.NwCreature.ActionMoveAwayFrom ( Location  location,
bool  run,
float  range = 40.0f 
)
inline

Instructs this creature to move to a certain distance away from the specified location.

Parameters
locationThe target location this creature should move away from. If the location is not in the same area as this creature, nothing will happen.
runIf set true, the creature will run rather than walk.
rangeHow much distance this creature should put between themselves and the location.

◆ ActionMoveAwayFrom() [2/2]

async Task Anvil.API.NwCreature.ActionMoveAwayFrom ( NwObject  target,
bool  run,
float  range = 40.0f 
)
inline

Instructs this creature to move a certain distance away from the specified target.

Parameters
targetThe target object this creature should move away from. If the target object is not in the same area as this creature, nothing will happen.
runIf set to true, the creature will run rather than walk.
rangeHow much distance this creature should put between themselves and the object.

◆ ActionMoveTo() [1/2]

async Task Anvil.API.NwCreature.ActionMoveTo ( Location  target,
bool  run = false 
)
inline

Instructs this creature to walk/run to the specified target location.

Parameters
targetThe location to move towards.
runIf true, the creature will run rather than walk.

◆ ActionMoveTo() [2/2]

async Task Anvil.API.NwCreature.ActionMoveTo ( NwObject  target,
bool  run = false,
float  range = 1.0f 
)
inline

Instructs this creature to walk/run to the specified target object.

Parameters
targetThe target object to move towards.
runIf true, the creature will run rather than walk.
rangeThe desired distance between the creature and the target object.

◆ ActionPickUpItem()

async Task Anvil.API.NwCreature.ActionPickUpItem ( NwItem  item)
inline

Instructs this creature to walk over and pick up the specified item on the ground.

Parameters
itemThe item to pick up.

◆ ActionPutDownItem()

async Task Anvil.API.NwCreature.ActionPutDownItem ( NwItem  item)
inline

Instructs this creature to begin placing down an item at its feet.

Parameters
itemThe item to drop.

◆ ActionRandomWalk()

async Task Anvil.API.NwCreature.ActionRandomWalk ( )
inline

The creature will generate a random location near its current location and pathfind to it. This repeats and never ends, which means it is necessary to call NwObject.ClearActionQueue in order to allow a creature to perform any other action once BeginRandomWalking has been called.

◆ ActionRest()

async Task Anvil.API.NwCreature.ActionRest ( bool  enemyLineOfSightCheck = false)
inline

Instructs this creature to rest.

Parameters
enemyLineOfSightCheckIf true, allows this creature to rest if enemies are nearby as long as they are not visible to this creature.

◆ ActionSit()

async Task Anvil.API.NwCreature.ActionSit ( NwPlaceable  sitPlaceable,
bool  alignToPlaceable = true 
)
inline

Instructs the creature to sit in the specified placeable.

Parameters
sitPlaceableThe placeable to sit in. Must be marked useable, empty, and support sitting (e.g. chairs).
alignToPlaceableIf true, auto-aligns the creature to the placeable's rotation. Otherwise, this creature will face East (0).

◆ ActionUnequipItem()

async Task Anvil.API.NwCreature.ActionUnequipItem ( NwItem  item)
inline

Instructs this creature to unequip the specified item from whatever slot it is currently in.

◆ ActionUnlockObject() [1/2]

Task Anvil.API.NwCreature.ActionUnlockObject ( NwDoor  door)
inline

Instructs this creature to approach and unlock the specified door.

Parameters
doorThe door to unlock.

◆ ActionUnlockObject() [2/2]

Task Anvil.API.NwCreature.ActionUnlockObject ( NwPlaceable  placeable)
inline

Instructs this creature to approach and unlock the specified placeable.

Parameters
placeableThe placeable to unlock.

◆ ActionUseFeat() [1/2]

async Task Anvil.API.NwCreature.ActionUseFeat ( NwFeat  feat,
Location  target,
Subfeat  subFeat = Subfeat.None 
)
inline

Instructs this creature to use the specified feat at the target location.

This action cannot be used on PCs.

Parameters
featThe feat to use.
targetThe target location for the feat.
subFeatFor some specific feats, the subtype to use. E.g. Wild shape

◆ ActionUseFeat() [2/2]

async Task Anvil.API.NwCreature.ActionUseFeat ( NwFeat  feat,
NwGameObject  target,
Subfeat  subFeat = Subfeat.None 
)
inline

Instructs this creature to use the specified feat on the target object.

This action cannot be used on PCs.

Parameters
featThe feat to use.
subFeatFor some specific feats, the subtype to use. E.g. Wild shape
targetThe target object for the feat.

◆ ActionUseItem() [1/2]

async Task Anvil.API.NwCreature.ActionUseItem ( NwItem  item,
ItemProperty  itemProperty,
Location  location,
bool  decrementCharges = true,
int  subPropertyIndex = 0 
)
inline

Instructs this creature to use the specified item property of an item in their inventory.

Parameters
itemThe item to use.
itemPropertyThe item property on the item to use.
locationThe target location for the item property action.
decrementChargesIf true, decrements item charges as configured for the item property action.
subPropertyIndexSpecifies the index to use if this item has sub-properties (such as sub-radial spells).

◆ ActionUseItem() [2/2]

async Task Anvil.API.NwCreature.ActionUseItem ( NwItem  item,
ItemProperty  itemProperty,
NwGameObject  gameObject,
bool  decrementCharges = true,
int  subPropertyIndex = 0 
)
inline

Instructs this creature to use the specified item property of an item in their inventory.

Parameters
itemThe item to use.
itemPropertyThe item property on the item to use.
gameObjectThe target object for the item property action.
decrementChargesIf true, decrements item charges as configured for the item property action.
subPropertyIndexSpecifies the index to use if this item has sub-properties (such as sub-radial spells).

◆ ActionUseSkill()

async Task Anvil.API.NwCreature.ActionUseSkill ( NwSkill  skill,
NwGameObject  target,
SubSkill  subSkill = SubSkill.None,
NwItem itemUsed = null 
)
inline

Instructs this creature to attempt to use a skill on another object.

Parameters
skillThe skill to use.
targetThe target to use the skill on.
subSkillA specific subskill to use.
itemUsedAn item to use in conjunction with this skill.

◆ ActionUseTalent() [1/2]

async Task Anvil.API.NwCreature.ActionUseTalent ( Talent  talent,
Location  target 
)
inline

Uses the specified talent.

Parameters
talentThe talent to use.
targetThe target location for the talent.

◆ ActionUseTalent() [2/2]

async Task Anvil.API.NwCreature.ActionUseTalent ( Talent  talent,
NwGameObject  target 
)
inline

Uses the specified talent.

Parameters
talentThe talent to use.
targetThe target object for the talent.

◆ AddFeat() [1/2]

void Anvil.API.NwCreature.AddFeat ( NwFeat  feat)
inline

Gives this creature the specified feat.
Consider using the AddFeat(NwFeat, int) overload to properly allocate the feat to a level.

Parameters
featThe feat to give.

◆ AddFeat() [2/2]

void Anvil.API.NwCreature.AddFeat ( NwFeat  feat,
int  level 
)
inline

Gives this creature the specified feat at a level.
Consider using the AddFeat(NwFeat, int) overload to properly allocate the feat to a level.

Parameters
featThe feat to give.
levelThe level the feat was gained.

◆ AddSpecialAbility()

void Anvil.API.NwCreature.AddSpecialAbility ( SpecialAbility  ability)
inline

Adds the specified ability to this creature.

Parameters
abilityThe ability to add.

◆ AdjustPartyAlignment()

void Anvil.API.NwCreature.AdjustPartyAlignment ( Alignment  alignment,
int  shift 
)
inline

Adjusts the alignment of this creature and associated party members by the specified value.
Use the LawChaosValue and GoodEvilValue setters to only affect this creature.

Parameters
alignmentThe alignment to shift towards.
shiftThe amount of alignment shift.

◆ BroadcastSkillRoll()

void Anvil.API.NwCreature.BroadcastSkillRoll ( int  diceRoll,
NwSkill  skill,
int  modifier,
int  difficultyClass,
bool  take20,
SkillResult  result 
)
inline

Causes this creature to broadcast feedback for an arbitrary skill roll (pre-calculated)
This causes a message to be posted in the combat log, and floaty skill text to appear above the character.

Parameters
diceRollThe d20 dice value result.
skillThe skill that was rolled.
modifierThe modifier added to the dice roll.
difficultyClassThe difficulty class/dc of the skill check.
take20If the roll was an automatic take 20 roll.
resultThe result of the skill check.

◆ CalculateAbilityModifierFromScore()

int Anvil.API.NwCreature.CalculateAbilityModifierFromScore ( byte  abilityScore)
inline

Gets the ability modifier from the given ability score.

By default, this will return '(ability score - 10) / 2', however this can be different based on definitions in the ruleset.2da.

Parameters
abilityScoreThe ability score to calculate the ability modifier from.
Returns
The ability modifier for the specified ability score.

◆ CheckResistSpell()

ResistSpellResult Anvil.API.NwCreature.CheckResistSpell ( NwGameObject  target)
inline

Performs a spell resistance check between this creature, and the specified target object.

Parameters
targetThe target of the spell.
Returns
A result indicating if the spell was resisted by the target.

◆ ClearDamageLevelOverride()

void Anvil.API.NwCreature.ClearDamageLevelOverride ( )
inline

Clears any override that is set for the creature's damage level.

◆ ClearInitiativeModifier()

void Anvil.API.NwCreature.ClearInitiativeModifier ( )
inline

Clears the modifier that is set for the creature's initiative.

◆ Clone()

override NwCreature Anvil.API.NwCreature.Clone ( Location  location,
string?  newTag = null,
bool  copyLocalState = true 
)
inlinevirtual

Creates a copy of this game object.

Parameters
locationThe location to create the cloned object.
newTagA new tag to assign the cloned object.
copyLocalStateIf true, will clone all local variables, effects, action queue and transition info (triggers, doors) for the object.
Returns
The newly cloned copy of the item.

Implements Anvil.API.NwGameObject.

◆ Create()

static ? NwCreature Anvil.API.NwCreature.Create ( string  template,
Location  location,
bool  useAppearAnim = false,
string  newTag = "" 
)
inlinestatic

Creates a creature at the specified location.

Parameters
templateThe creature resref template from the toolset palette.
locationThe location where this creature will spawn.
useAppearAnimIf true, plays EffectAppear when created.
newTagThe new tag to assign this creature. Leave uninitialized/as null to use the template's tag.

◆ DecrementRemainingFeatUses()

void Anvil.API.NwCreature.DecrementRemainingFeatUses ( NwFeat  feat,
int  amount = 1 
)
inline

Decrements the remaining number of uses of a particular feat for this creature by the specified amount.
You must have at least one feat use remaining to be able to decrement it.
Passive feats, and feats that can be used unlimited times per day, cannot be decremented or suppressed.

Parameters
featThe n/day feat to decrement uses.
amountThe amount of uses to decrement.

◆ DoDoorAction()

async Task Anvil.API.NwCreature.DoDoorAction ( NwDoor  door,
DoorAction  doorAction 
)
inline

Instructs this creature to perform the specified action on a door.

Parameters
doorThe door to interact with.
doorActionThe action to perform on the door.

◆ DoPlaceableAction()

async Task Anvil.API.NwCreature.DoPlaceableAction ( NwPlaceable  placeable,
PlaceableAction  placeableAction 
)
inline

Instructs this creature to perform the specified action on a placeable.

Parameters
placeableThe placeable to interact with.
placeableActionThe action to perform on the placeable.

◆ DoSkillCheck()

bool Anvil.API.NwCreature.DoSkillCheck ( NwSkill  skill,
int  difficultyClass 
)
inline

Returns true if 1d20 + skill rank is greater than, or equal to difficultyClass.

Parameters
skillThe type of skill check.
difficultyClassThe DC of this skill check.

◆ FindItemWithTag()

NwItem? Anvil.API.NwCreature.FindItemWithTag ( string  itemTag)
inline

Get the item possessed by this creature with the tag itemTag.

◆ ForceRest()

void Anvil.API.NwCreature.ForceRest ( )
inline

Instantly gives this creature the benefits of a rest (restored hitpoints, spells, feats, etc...).

◆ GetAbilityModifier()

int Anvil.API.NwCreature.GetAbilityModifier ( Ability  ability)
inline

Gets this creature's ability modifier for the specified ability.

Parameters
abilityThe ability to resolve.
Returns
An int representing the creature's ability modifier.

◆ GetAbilityScore()

int Anvil.API.NwCreature.GetAbilityScore ( Ability  ability,
bool  baseOnly = false 
)
inline

Gets the specified ability score from this creature.

Parameters
abilityThe type of ability.
baseOnlyIf true, will return the creature's base ability score without bonuses or penalties.

◆ GetActionMode()

bool Anvil.API.NwCreature.GetActionMode ( ActionMode  actionMode)
inline

Gets if this creature is using the specified action mode.

Parameters
actionModeThe action mode to query.
Returns
True if the specified action mode is currently active, otherwise false.

◆ GetArmorClassVersus()

int Anvil.API.NwCreature.GetArmorClassVersus ( NwCreature  creature)
inline

Return the Armor Class this creature has against another creature

Parameters
creatureThe creature against which the Armor Class will be checked.

◆ GetAssociate()

NwCreature? Anvil.API.NwCreature.GetAssociate ( AssociateType  associateType)
inline

Gets the first associate of this creature with the matching associate type.
See Henchmen for getting a list of all henchmen associated with this creature. See Associates for getting a list of all creatures associated with this creature.

Parameters
associateTypeThe type of associate to locate.
Returns
The associated creature, otherwise null if this creature does not have an associate of the specified type.

◆ GetAttackBonus()

int Anvil.API.NwCreature.GetAttackBonus ( bool  isMelee = false,
bool  isTouchAttack = false,
bool  isOffHand = false,
bool  includeBaseAttackBonus = true 
)
inline

Gets the creature's highest attack bonus based on its own stats.
AB vs. Type and +AB on Gauntlets are excluded.

Parameters
isMeleeTRUE: Get Melee/Unarmed Attack Bonus, FALSE: Get Ranged Attack Bonus
isTouchAttackIf the attack was a touch attack.
isOffHandIf the attack was a touch attack.
includeBaseAttackBonusIf the attack was with the offhand.
Returns
The highest attack bonus.

◆ GetBaseSavingThrow()

int Anvil.API.NwCreature.GetBaseSavingThrow ( SavingThrow  savingThrow)
inline

Gets this creature's base save value for the specified saving throw.

Parameters
savingThrowThe type of saving throw.
Returns
The creature's base saving throw value.
Exceptions
ArgumentOutOfRangeExceptionThrown if savingThrow is not Fortitude, Reflex, or Will.

◆ GetClassDomains()

IEnumerable<NwDomain> Anvil.API.NwCreature.GetClassDomains ( NwClass nwClass = default)
inline

Returns this creature's domains in the specified class. Unless custom content is used, only clerics have domains.

Parameters
nwClassThe class with domains. Defaults to ClassType.Cleric if not specified.
Returns
An enumeration of this creature's domains.

◆ GetClassInfo()

CreatureClassInfo? Anvil.API.NwCreature.GetClassInfo ( NwClass nwClass)
inline

Gets the CreatureClassInfo associated with the specified class type.

Parameters
nwClassThe class type to query.
Returns
The CreatureClassInfo for the specified class, otherwise null if this creature does not have any levels in the class.

◆ GetCreatureBodyPart()

int Anvil.API.NwCreature.GetCreatureBodyPart ( CreaturePart  creaturePart)
inline

Gets the model number for the specified body part on the creature.

◆ GetDamageLevelOverride()

DamageLevelEntry? Anvil.API.NwCreature.GetDamageLevelOverride ( )
inline

Gets the override that is set for the creature's damage level.

◆ GetFeatGainLevel()

int Anvil.API.NwCreature.GetFeatGainLevel ( NwFeat  feat)
inline

Gets the level a feat was gained.

Parameters
featThe feat to query.
Returns
The character level a feat was gained, otherwise 0 if the character does not have the feat.

◆ GetFeatRemainingUses()

byte Anvil.API.NwCreature.GetFeatRemainingUses ( NwFeat  feat)
inline

Gets the remaining uses available for the specified feat.

Parameters
featThe feat to query.
Returns
The amount of remaining uses.

◆ GetFeatTotalUses()

byte Anvil.API.NwCreature.GetFeatTotalUses ( NwFeat  feat)
inline

Gets the max/total amount of times the specified feat can be used.

Parameters
featThe feat to query.
Returns
The amount of remaining uses.

◆ GetInitiativeModifier()

int? Anvil.API.NwCreature.GetInitiativeModifier ( )
inline

Gets the modifier that is set for the creature's initiative.

◆ GetItemInSlot()

NwItem? Anvil.API.NwCreature.GetItemInSlot ( InventorySlot  slot)
inline

Gets the item that is equipped in the specified inventory slot.

Parameters
slotThe inventory slot to check.
Returns
The item in the inventory slot, otherwise null if it is unpopulated.

◆ GetLevelStats()

CreatureLevelInfo Anvil.API.NwCreature.GetLevelStats ( int  level)
inline

Gets the level stat info for the specified level (feat, class, skills, etc.).

Parameters
levelThe level to lookup.
Returns
A LevelInfo object containing level info.

◆ GetPrePolymorphAbilityScore()

byte Anvil.API.NwCreature.GetPrePolymorphAbilityScore ( Ability  ability)
inline

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

Parameters
abilityThe ability score to query. Works for strength, dexterity and constitution only.
Returns
Exceptions
ArgumentOutOfRangeException

◆ GetRawAbilityScore()

byte Anvil.API.NwCreature.GetRawAbilityScore ( Ability  ability)
inline

Gets the base (raw) ability score for the specified ability, without racial modfiers.

Parameters
abilityThe ability score type to query.
Returns
An integer representing the creature's ability score without modifiers.
Exceptions
ArgumentOutOfRangeExceptionThrown if an invalid ability is specified.

◆ GetSavingThrow()

int Anvil.API.NwCreature.GetSavingThrow ( SavingThrow  savingThrow)
inline

Gets the specified saving throw modifier for this creature.

Parameters
savingThrowThe type of saving throw.
Returns
The creature's base saving throw value.
Exceptions
ArgumentOutOfRangeExceptionThrown if savingThrow is not Fortitude, Reflex, or Will.

◆ GetSkillRank()

int Anvil.API.NwCreature.GetSkillRank ( NwSkill  skill,
bool  ranksOnly = false 
)
inline

Gets the number of ranks this creature has in the specified skill.

Parameters
skillThe skill to check.
ranksOnlyIf true, returns the base amount of skill ranks without any ability modifiers.
Returns
-1 if the creature does not have this skill, 0 if untrained, otherwise the number of skill ranks.

◆ GetSlotFromItem()

EquipmentSlots Anvil.API.NwCreature.GetSlotFromItem ( NwItem  item)
inline

Gets the slot that the specified item is in.

Parameters
itemThe item to query.
Returns

◆ GetSpecialization()

SpellSchool Anvil.API.NwCreature.GetSpecialization ( NwClass nwClass = default)
inline

Returns this creature's spell school specialization in the specified class.
Unless custom content is used, only Wizards have spell schools.

Parameters
nwClassThe class to query for specialized spell schools. Defaults to ClassType.Wizard if not specified.
Returns
The creature's selected spell specialization.

◆ GetSpellUsesLeft()

int Anvil.API.NwCreature.GetSpellUsesLeft ( NwClass  nwClass,
NwSpell  spell,
MetaMagic  metaMagic = MetaMagic.None,
int  domain = 0 
)
inline

Gets the number of remaining uses for a specific spell for this creature.

Parameters
nwClassThe spell caster class.
spellThe spell to check for remaining uses.
metaMagicThe metamagic for the spell.
domainThe domain level, if it is a domain level spell.
Returns
The number of spell uses remaining.

◆ GetTileExplored()

bool Anvil.API.NwCreature.GetTileExplored ( NwArea  area,
int  x,
int  y 
)
inline

Gets whether the given area tile is visible on the map for this creature.
Tile exploration also controls object visibility in areas and the fog of war for interior and underground areas.

Parameters
areaThe area containing the tile.
xThe location of the tile on the x axis.
yThe location of the tile on the y axis.
Returns
True if this creature has explored this tile, otherwise false.

◆ GiveGold()

void Anvil.API.NwCreature.GiveGold ( int  amount,
bool  showFeedback = true 
)
inline

Gives gold to this creature.

Parameters
amountThe amount of gold to give.
showFeedbackIf true, shows "Acquired xgp" feedback to the creature.

◆ GiveItem() [1/2]

async Task Anvil.API.NwCreature.GiveItem ( NwItem  item)
inline

Moves the specified item/item stack to this creature's inventory.

Parameters
itemThe item to add.

◆ GiveItem() [2/2]

async Task Anvil.API.NwCreature.GiveItem ( NwItem  item,
int  amount 
)
inline

Moves a specified amount of items from an item stack to this creature's inventory.

Parameters
itemThe item to add.
amountThe number of items from the item stack to take.

◆ HasFeatEffect()

bool Anvil.API.NwCreature.HasFeatEffect ( NwFeat  feat)
inline

Gets whether this creature is under the effects of the specified feat.

Parameters
featThe feat to check.

◆ HasFeatPrepared()

bool Anvil.API.NwCreature.HasFeatPrepared ( NwFeat  feat)
inline

Returns true if this creature knows the specified NwFeat, and can use it.
Use KnowsFeat to simply check if a creature knows NwFeat, but may or may not have uses remaining.

◆ HasSkill()

bool Anvil.API.NwCreature.HasSkill ( NwSkill  skill)
inline

Returns true if this creature has the skill specified, and is useable.

Parameters
skillThe skill to check.
Returns
True if the creature has this skill.

◆ HasSpellEffect()

bool Anvil.API.NwCreature.HasSpellEffect ( NwSpell  spell)
inline

Gets whether this creature is under the effects of the specified spell.

Parameters
spellThe spell to check.

◆ HasSpellUse()

bool Anvil.API.NwCreature.HasSpellUse ( NwSpell  spell)
inline

Gets if this creature has the specified spell available to cast.

Parameters
spellThe spell to check.
Returns
True if this creature can immediately cast the spell.

◆ HasTalent()

bool Anvil.API.NwCreature.HasTalent ( Talent  talent)
inline

Determines whether this creature has the specified talent.

Parameters
talentThe talent to check.
Returns
True if this creature has talent, otherwise false.

◆ IncrementRemainingFeatUses()

void Anvil.API.NwCreature.IncrementRemainingFeatUses ( NwFeat  feat,
int  amount = 1 
)
inline

Increment the remaining uses per day for this (creature) by the specified amount.
Total number of feats uses per-day cannot exceed the creature's standard maximum.

Parameters
featThe n/day feat to add uses.
amountThe amount of uses to add.

◆ IsCreatureHeard()

bool Anvil.API.NwCreature.IsCreatureHeard ( NwCreature  creature)
inline

Gets whether this creature can hear the specified creature.

Parameters
creatureThe creature that may be heard.
Returns
True if the creature has been heard, otherwise false.

◆ IsCreatureSeen()

bool Anvil.API.NwCreature.IsCreatureSeen ( NwCreature  creature)
inline

Gets whether this creature can see the specified creature.

Parameters
creatureThe creature to test visibility.
Returns
True if the creature is visible by this creature, otherwise false.

◆ IsEnemy()

bool Anvil.API.NwCreature.IsEnemy ( NwCreature  target)
inline

Gets a value indicating whether this creature considers the target as a friend.

Parameters
targetThe target creature.
Returns
true if target is an enemy, otherwise false.

◆ IsFlanking()

bool Anvil.API.NwCreature.IsFlanking ( NwCreature  target)
inline

Gets if this creature is flanking the specified target.

Parameters
targetThe target creature to check for flanking status.
Returns
True if the creature is flanking the target, otherwise false.

◆ IsFriend()

bool Anvil.API.NwCreature.IsFriend ( NwCreature  target)
inline

Gets a value indicating whether this creature considers the target as a enemy.

Parameters
targetThe target creature.
Returns
true if target is a friend, otherwise false.

◆ IsImmuneTo()

bool Anvil.API.NwCreature.IsImmuneTo ( ImmunityType  immunityType,
NwGameObject verses = null 
)
inline

Gets whether this creature has a specific immunity.

Parameters
immunityTypeThe immunity type to check.
versesIf specified, the race and alignment of verses will be considered when determining immunities.
Returns
True if the creature has the specified immunity, otherwise false.

◆ IsNeutral()

bool Anvil.API.NwCreature.IsNeutral ( NwCreature  target)
inline

Gets a value indicating whether this creature considers the target as neutral.

Parameters
targetThe target creature.
Returns
true if this creature considers the target as neutral, otherwise false.

◆ IsReactionTypeFriendly()

bool Anvil.API.NwCreature.IsReactionTypeFriendly ( NwCreature  creature)
inline

Gets whether this creature has a friendly reaction towards another given creature.

Parameters
creatureThe target creature to test.

◆ IsReactionTypeHostile()

bool Anvil.API.NwCreature.IsReactionTypeHostile ( NwCreature  creature)
inline

Gets whether this creature has a hostile reaction towards another given creature.

Parameters
creatureThe target creature to test.

◆ IsReactionTypeNeutral()

bool Anvil.API.NwCreature.IsReactionTypeNeutral ( NwCreature  creature)
inline

Gets whether this creature has a neutral reaction towards another given creature.

Parameters
creatureThe target creature to test.

◆ IsWeaponEffective()

async Task<bool> Anvil.API.NwCreature.IsWeaponEffective ( NwGameObject  target,
bool  offHand = false 
)
inline

Check whether this creature can damage the specified object using their current weapon/s.

Parameters
targetThe object to test this creature's weapon against.
offHandIf true, checks the creature's off-hand weapon.

◆ JumpToObject()

async Task Anvil.API.NwCreature.JumpToObject ( NwGameObject  gameObject,
bool  walkStraightLineToPoint = true 
)
inline

Teleports this creature to the nearest valid location by the target.
This action produces no visual effect.

Parameters
gameObjectThe target object to jump to.
walkStraightLineToPointUnknown.

Does not affect dead or dying creatures.

◆ KnowsFeat()

bool Anvil.API.NwCreature.KnowsFeat ( NwFeat  feat)
inline

Gets if this creature knows the specified feat.

Parameters
featThe feat to check.
Returns
True if the creature knows the feat, otherwise false.

◆ LevelUp()

void Anvil.API.NwCreature.LevelUp ( NwClass  nwClass,
int  count 
)
inline

Adds levels of the specified class to a creature, bypassing all validation.

Parameters
nwClassThe class to add.
countThe number of levels to add.
Exceptions
NotSupportedExceptionThrown if this creature is a player character.

◆ LevelUpHenchman()

int Anvil.API.NwCreature.LevelUpHenchman ( NwClass  nwClass,
PackageType  package,
bool  spellsReady = false 
)
inline

Levels up this creature using the default settings.
You can assign a new class to level up
If an invalid class combination is chosen the default class is leveled up.
Package determines which package to level up with.
If package is omitted it will use the starting package assigned to that class or just the class package.

Parameters
nwClassConstant matching the class to level the creature in.
packageConstant matching the package used to select skills and feats for the henchman.
spellsReadyDetermines if all memorable spell slots will be filled without requiring rest.
Returns
Returns the new level if successful, or 0 if the function fails.

◆ MeetsFeatRequirements()

bool Anvil.API.NwCreature.MeetsFeatRequirements ( NwFeat  feat)
inline

Gets if this creature meets the requirements to take the specified feat.

Parameters
featThe feat to query.

◆ PlayVoiceChat()

void Anvil.API.NwCreature.PlayVoiceChat ( VoiceChatType  voiceChatType)
inline

Instructs this creature to speak/play the specified voice chat.

Parameters
voiceChatTypeThe VoiceChatType for this creature to speak.

◆ RemoveFeat()

void Anvil.API.NwCreature.RemoveFeat ( NwFeat  feat,
bool  removeFeatFromLevelList = false 
)
inline

Removes the specified feat from this creature.

Parameters
featThe feat to remove.
removeFeatFromLevelList

◆ RemoveSpecialAbilityAt()

void Anvil.API.NwCreature.RemoveSpecialAbilityAt ( int  index)
inline

Removes the specified ability at the given index.

Parameters
indexThe ability index to remove.

◆ Reputation()

int Anvil.API.NwCreature.Reputation ( NwCreature  creature)
inline

Gets how one creature feels toward this creature.

Parameters
creatureThe creature whose feelings we wish to know.

◆ RestoreAllSpells()

void Anvil.API.NwCreature.RestoreAllSpells ( )
inline

Restore all NwCreature spells per day for all levels.

◆ RestoreBaseAttackBonus()

void Anvil.API.NwCreature.RestoreBaseAttackBonus ( )
inline

Restores the number of base attacks back to it's original state on this (creature).

◆ RestoreSpells()

void Anvil.API.NwCreature.RestoreSpells ( byte  level)
inline

Restore all NwCreature spells per day for given level.

◆ RunEquip() [1/2]

bool Anvil.API.NwCreature.RunEquip ( NwItem  item,
EquipmentSlots  equipmentSlot 
)
inline

Instruct this creature to instantly equip the specified item.

Parameters
itemThe item to equip.
equipmentSlotThe equipment slot to equip the item to.
Returns
True if the item was successfully equipped, otherwise false.
Exceptions
ArgumentNullExceptionItem is null.

◆ RunEquip() [2/2]

bool Anvil.API.NwCreature.RunEquip ( NwItem  item,
InventorySlot  inventorySlot 
)
inline

Instruct this creature to instantly equip the specified item.

Parameters
itemThe item to equip.
inventorySlotThe inventory slot to equip the item to.
Returns
True if the item was successfully equipped, otherwise false.
Exceptions
ArgumentNullExceptionItem is null.

◆ RunUnequip()

bool Anvil.API.NwCreature.RunUnequip ( NwItem  item)
inline

Instruct this creature to instantly unequip the specified item.

Parameters
itemThe item to unequip.
Returns
True if the item was successfully unequipped, otherwise false.
Exceptions
ArgumentNullExceptionItem is null.

◆ SetActionMode()

void Anvil.API.NwCreature.SetActionMode ( ActionMode  actionMode,
bool  status 
)
inline

Instructs this creature to enable/disable the specified action mode (parry, power attack, expertise, etc).

Parameters
actionModeThe action mode to toggle.
statusThe new state of the action mode.

◆ SetAssociateListenPatterns()

void Anvil.API.NwCreature.SetAssociateListenPatterns ( )
inline

Initialises this creature to listen for the standard AssociateCommand messages.
These are the messages sent by the standard party UI.

This method is automatically invoked when calling NwPlayer.AddHenchmen, and does not need to be called again.

◆ SetBaseSavingThrow()

void Anvil.API.NwCreature.SetBaseSavingThrow ( SavingThrow  savingThrow,
sbyte  newValue 
)
inline

Sets this creatures's base save value for the specified saving throw.

Parameters
savingThrowThe type of saving throw.
newValueThe new base saving throw.
Exceptions
ArgumentOutOfRangeExceptionThrown if savingThrow is not Fortitude, Reflex, or Will.

◆ SetCreatureBodyPart()

void Anvil.API.NwCreature.SetCreatureBodyPart ( CreaturePart  creaturePart,
int  modelNumber 
)
inline

Sets the model number to use for the specified body part on the creature.

◆ SetDamageLevelOverride()

void Anvil.API.NwCreature.SetDamageLevelOverride ( DamageLevelEntry  damageLevel)
inline

Sets the override value to use for this creature's damage level.

◆ SetEffectIconFlashing()

void Anvil.API.NwCreature.SetEffectIconFlashing ( EffectIconTableEntry  effectIcon,
bool  flashing 
)
inline

Sets whether the specified effect icon should be flashing in the creature's GUI icon bar.

If the creature does not have the icon specified active in their GUI, nothing happens.
This function will not add icons to the icon bar.

Parameters
effectIconThe icon to start/stop flashing.
flashingThe new flashing state.

◆ SetFeatRemainingUses()

void Anvil.API.NwCreature.SetFeatRemainingUses ( NwFeat  feat,
byte  remainingUses 
)
inline

Sets the remaining uses available for the specified feat.
Cannot exceed the creature's total/max uses of the feat.

Parameters
featThe feat to change.
remainingUsesThe new number of uses remaining.

◆ SetInitiativeModifier()

void Anvil.API.NwCreature.SetInitiativeModifier ( int  modifier)
inline

Sets the modifier that is set for the creature's initiative.

◆ SetSkillRank()

void Anvil.API.NwCreature.SetSkillRank ( NwSkill  skill,
sbyte  rank 
)
inline

Sets the skill ranks for the specified skill on this creature.

Parameters
skillThe skill to modify.
rankThe new number of skill ranks.

◆ SetSpecialAbilityAt()

void Anvil.API.NwCreature.SetSpecialAbilityAt ( int  index,
SpecialAbility  ability 
)
inline

Updates the specified ability at the given index.

Parameters
indexThe ability index to update.
abilityThe new state for the ability.

◆ SetsRawAbilityScore()

void Anvil.API.NwCreature.SetsRawAbilityScore ( Ability  ability,
byte  value 
)
inline

Sets the base (raw) ability score for the specified ability, without racial modifiers.

Parameters
abilityThe ability score type to query.
valueThe new ability score to set.
Exceptions
ArgumentOutOfRangeExceptionThrown if an invalid ability is specified.

◆ SetTileExplored()

bool Anvil.API.NwCreature.SetTileExplored ( NwArea  area,
int  x,
int  y,
bool  newState 
)
inline

Gets whether the given area tile is visible on the map for this creature.
Tile exploration also controls object visibility in areas and the fog of war for interior and underground areas.

Parameters
areaThe area containing the tile.
xThe location of the tile on the x axis.
yThe location of the tile on the y axis.
newStateThe new exploration state for this tile (true = explored, false = unexplored).
Returns
The exploration state before newState. True if this creature has explored this tile, otherwise false.

◆ SpeakOneLinerConversation()

async Task Anvil.API.NwCreature.SpeakOneLinerConversation ( string  dialogResRef = "",
NwGameObject tokenTarget = null 
)
inline

Instructs this creature to immediately speak the first non-branching conversation line in their dialog.

Parameters
dialogResRefThe dialog resource reference to use.
tokenTargetThe object to use if there are object-specific tokens in the string.

◆ SummonAnimalCompanion()

void Anvil.API.NwCreature.SummonAnimalCompanion ( )
inline

Instructs this creature to summon their animal companion.
Does nothing if this creature has no animal companion available.

◆ SummonFamiliar()

void Anvil.API.NwCreature.SummonFamiliar ( )
inline

Instructs this creature to summon their familiar (wizard/sorcerer).
Does nothing if this creature has no familiar available.

◆ TakeGold()

void Anvil.API.NwCreature.TakeGold ( int  amount,
bool  showFeedback = true 
)
inline

Takes gold away from this creature.

Parameters
amountThe amount of gold to take.
showFeedbackIf true, shows "Lost xgp" feedback to the creature.

◆ TalentBest()

Talent Anvil.API.NwCreature.TalentBest ( TalentCategory  category,
int  maxCr 
)
inline

Gets the best talent from a group of talents.

Parameters
categoryThe category of talents to pick from.
maxCrThe maximum Challenge Rating of the talent.

◆ TalentRandom()

Talent Anvil.API.NwCreature.TalentRandom ( TalentCategory  category)
inline

Gets a random talent from a group of talents possessed by this creature.

Parameters
categoryThe category of talents to pick from.

◆ TouchAttackMelee()

async Task<TouchAttackResult> Anvil.API.NwCreature.TouchAttackMelee ( NwGameObject  target)
inline

Attempts to perform a melee touch attack on target. This is not a creature action, and assumes that this creature is already within range of the target.

Parameters
targetThe target of this touch attack.

◆ TouchAttackRanged()

async Task<TouchAttackResult> Anvil.API.NwCreature.TouchAttackRanged ( NwGameObject  target,
bool  displayFeedback 
)
inline

Attempts to perform a ranged touch attack on the target. This is not a creature action, and simply does a roll to see if the target was hit.

Parameters
targetThe target of this touch attack.
displayFeedbackIf true, displays combat feedback in the chat window.

◆ UnpossessFamiliar()

void Anvil.API.NwCreature.UnpossessFamiliar ( )
inline

Instructs this creature to unpossess their familiar.
This function can be run on the player creature, or the possessed familiar.

Property Documentation

◆ AC

int Anvil.API.NwCreature.AC
get

Gets this creature's armour class.

◆ Age

int Anvil.API.NwCreature.Age
getset

Gets or sets this creature's age, in years.

◆ AiLevel

AiLevel Anvil.API.NwCreature.AiLevel
getset

Gets or sets the current AI level that this creature is running at.
Anvil.API.AiLevel.Default is recommended for most creatures. Too many creatures at Anvil.API.AiLevel.Normal or higher can cause performance degradation.

◆ AlwaysWalk

bool Anvil.API.NwCreature.AlwaysWalk
getset

Gets or sets whether this creature is forced to walk.
Is not persistent, and must be applied again at login.

◆ AnimalCompanionName

string Anvil.API.NwCreature.AnimalCompanionName
get

Gets this creature's animal companion name.

◆ AnimalCompanionType

AnimalCompanionCreatureType Anvil.API.NwCreature.AnimalCompanionType
get

Gets this creature's animal companion creature type.

◆ Appearance

AppearanceTableEntry Anvil.API.NwCreature.Appearance
getset

Gets or sets the appearance of this creature.

◆ ArcaneSpellFailure

int Anvil.API.NwCreature.ArcaneSpellFailure
get

Gets the arcane spell failure factor for this creature.

◆ Associates

IEnumerable<NwCreature> Anvil.API.NwCreature.Associates
get

Gets all creatures associated with this creature.

◆ AssociateType

AssociateType Anvil.API.NwCreature.AssociateType
get

Gets the associate type of this creature, otherwise returns Anvil.API.AssociateType.None if this creature is not an associate of anyone.

◆ AttackTarget

NwGameObject? Anvil.API.NwCreature.AttackTarget
get

Gets this creature's current attack target.

◆ AttemptedAttackTarget

NwGameObject? Anvil.API.NwCreature.AttemptedAttackTarget
get

Gets the last target this creature tried to attack.

◆ AttemptedSpellTarget

NwGameObject? Anvil.API.NwCreature.AttemptedSpellTarget
get

Gets the target this creature attempted to cast a spell at.

◆ BaseAC

sbyte Anvil.API.NwCreature.BaseAC
getset

Gets or sets the base AC for this creature.

◆ BaseArmorArcaneSpellFailure

byte Anvil.API.NwCreature.BaseArmorArcaneSpellFailure
getset

Gets or sets the current base armor arcane spell failure factor for this creature (global ASF is automatically recalculated).

◆ BaseAttackBonus

byte Anvil.API.NwCreature.BaseAttackBonus
getset

Gets or sets the Base Attack Bonus for this creature.

◆ BaseAttackCount

int Anvil.API.NwCreature.BaseAttackCount
getset

Sets the number of base attacks for this creature.
The range of values accepted are from 1 to 6.

Note
Each successive attack per round suffers a -5 penalty.
If the character has levels in Monk and fights with Unarmed Strike, each successive attack per round suffers a -3 penalty.
These additional attacks are not shown on the player's character sheet.

◆ BaseShieldArcaneSpellFailure

byte Anvil.API.NwCreature.BaseShieldArcaneSpellFailure
getset

Gets or sets the current base shield arcane spell failure factor for this creature (global ASF is automatically recalculated).

◆ BodyBag

NwPlaceable? Anvil.API.NwCreature.BodyBag
get

Gets the body bag assigned to this creature as a result of its death.

◆ BodyBagTemplate

BodyBagTableEntry Anvil.API.NwCreature.BodyBagTemplate
getset

Gets or sets the body bag template to use when this creature dies.

◆ ChallengeRating

float Anvil.API.NwCreature.ChallengeRating
getset

Gets or sets the calculated challenge rating for this creature.

◆ Classes

IReadOnlyList<CreatureClassInfo> Anvil.API.NwCreature.Classes
get

Gets this creature's classes, and associated class info.

◆ CombatMode

CombatMode Anvil.API.NwCreature.CombatMode
get

Gets the creature's current Combat Mode.
Can be used in the Events.OnCombatModeToggle event to determine which combat mode is being toggled off.

◆ Commandable

bool Anvil.API.NwCreature.Commandable
getset

Gets or sets a value indicating whether this creature's action queue can be modified.

◆ ControllingPlayer

NwPlayer?? Anvil.API.NwCreature.ControllingPlayer
getset

Gets or sets the player currently controlling this creature.
If this creature is a possessed familiar or is DM possessed, this will return the player or DM controlling this creature.
If this creature is a player creature (the creature a played logged in with), but the player is possessing another creature, this returns null.
If no player is controlling this creature, this returns null.
The setter makes this this creature controllable by the specified player, if player party control is enabled.

◆ CorpseDecayTime

TimeSpan Anvil.API.NwCreature.CorpseDecayTime
getset

Gets or sets the corpse decay time for this creature.

◆ CurrentAction

Action Anvil.API.NwCreature.CurrentAction
get

Gets the current action that this creature is executing.

◆ DamageLevel

DamageLevelEntry Anvil.API.NwCreature.DamageLevel
get

Gets the creature's current damage level (Uninjured, Injured, Near Death, etc).
If an override is set with SetDamageLevelOverride, this property will return the override value.

◆ DefensiveCastingModeActive

bool Anvil.API.NwCreature.DefensiveCastingModeActive
get

Gets a value indicating whether this creature is currently in Defensive Casting Mode.

◆ Deity

string Anvil.API.NwCreature.Deity
getset

Gets or sets the name of this creature's deity.

◆ DetectModeActive

bool Anvil.API.NwCreature.DetectModeActive
get

Gets a value indicating whether this creature is currently in Detect Mode.

◆ DialogResRef

string? Anvil.API.NwCreature.DialogResRef
getset

Gets or sets the dialog ResRef for this creature.

◆ Disarmable

bool Anvil.API.NwCreature.Disarmable
get

Gets a value indicating whether this creature can be disarmed (checks disarm flag on creature, and if the creature actually has a weapon equipped in their right hand that is droppable).

◆ Encounter

NwEncounter? Anvil.API.NwCreature.Encounter
get

Gets the encounter that spawned this creature.

◆ ExploresMinimap

bool Anvil.API.NwCreature.ExploresMinimap
getset

Gets or sets a value indicating whether this creature will auto-explore the minimap as it walks around.

◆ Faction

NwFaction Anvil.API.NwCreature.Faction
getset

Gets or sets the faction of this object.

◆ FamiliarName

string Anvil.API.NwCreature.FamiliarName
get

Gets this creature's familiar name.

◆ FamiliarType

FamiliarCreatureType Anvil.API.NwCreature.FamiliarType
get

Gets the type of familiar that this creature can summon.

◆ FeatCount

int Anvil.API.NwCreature.FeatCount
get

Gets the number of feats known by this creature.

◆ Feats

IReadOnlyList<NwFeat> Anvil.API.NwCreature.Feats
get

Gets the feats known by this character.

◆ FlatFooted

bool Anvil.API.NwCreature.FlatFooted
get

Gets a value indicating whether this creature is flat footed.

◆ FootstepType

FootstepType Anvil.API.NwCreature.FootstepType
getset

Gets or sets the sounds to use when this creature makes a step. By default, this is based on the creature's appearance.

◆ Gender

Gender Anvil.API.NwCreature.Gender
getset

Gets or sets the gender of this creature.

◆ Gold

uint Anvil.API.NwCreature.Gold
getset

Gets or sets the amount of gold carried by this creature.
This property does not display feedback to the creature. See GiveGold and TakeGold for options that provide feedback.

◆ GoodEvilAlignment

Alignment Anvil.API.NwCreature.GoodEvilAlignment
get

Gets this creature's Good/Evil Alignment.

◆ GoodEvilValue

int? Anvil.API.NwCreature.GoodEvilValue
getset

Gets or sets this creature's Evil (0) - Good (100) alignment value.

◆ Henchmen

IEnumerable<NwCreature> Anvil.API.NwCreature.Henchmen
get

Gets all henchmen associated with this creature.

◆ Immortal

bool Anvil.API.NwCreature.Immortal
getset

Gets or sets a value indicating whether this creature is immortal.
An immortal creature still takes damage, but cannot be killed.

◆ Inventory

Inventory Anvil.API.NwCreature.Inventory
get

Gets the inventory of this creature.

◆ IsBartering

bool Anvil.API.NwCreature.IsBartering
get

Gets a value indicating whether this creature is currently bartering.

◆ IsDead

bool Anvil.API.NwCreature.IsDead
get

Gets a value indicating whether this creature is a dead NPC, dead PC, or dying PC.

◆ IsDMAvatar

bool Anvil.API.NwCreature.IsDMAvatar
get

Gets a value indicating whether this creature is a DM avatar character.
This returns false for NPC creatures possessed by DMs.

◆ IsDMPossessed

bool Anvil.API.NwCreature.IsDMPossessed
get

Gets a value indicating whether this creature is currently possessed by a DM avatar.

◆ IsEncounterCreature

bool Anvil.API.NwCreature.IsEncounterCreature
get

Gets a value indicating whether this creature was spawned from an encounter.

◆ IsInCombat

bool Anvil.API.NwCreature.IsInCombat
get

Gets a value indicating whether this creature is in combat.

◆ IsLoginPlayerCharacter

bool Anvil.API.NwCreature.IsLoginPlayerCharacter
get

Gets if this creature is a player character/DM avatar.
If this creature is a NPC or familiar, regardless of possession, this will return false.

◆ IsPlayableRace

bool Anvil.API.NwCreature.IsPlayableRace
get

Gets a value indicating whether this creature is a playable racial type.

◆ IsPlayerControlled

bool Anvil.API.NwCreature.IsPlayerControlled
get

Gets if this creature is currently being controlled by a player/DM.
If this creature is a possessed familiar or is DM possessed, this will return true.
If this creature is a player creature (the creature a played logged in with), but the player is possessing another creature, this returns false.
If no player is controlling this creature, this returns false.

◆ IsPossessedFamiliar

bool Anvil.API.NwCreature.IsPossessedFamiliar
get

Gets a value indicating whether this creature is a familiar currently possessed by a master.

◆ IsRangedWeaponEquipped

bool? Anvil.API.NwCreature.IsRangedWeaponEquipped
get

Gets if this creature is currently holding a ranged weapon.

◆ IsResting

bool Anvil.API.NwCreature.IsResting
get

Gets a value indicating whether this creature is currently resting.

◆ LastAttackMode

LastAttackMode Anvil.API.NwCreature.LastAttackMode
get

Gets the attack mode used during this creature's last attack.

◆ LastCommandFromMaster

AssociateCommand Anvil.API.NwCreature.LastCommandFromMaster
get

Gets the last command issued to this creature.

◆ LastSpecialAttackType

SpecialAttack Anvil.API.NwCreature.LastSpecialAttackType
get

Gets the special attack type used in the last physical attack against this creature.

◆ LastTrapDetected

NwTrappable? Anvil.API.NwCreature.LastTrapDetected
get

Gets the last trap detected by this creature.

◆ LawChaosAlignment

Alignment Anvil.API.NwCreature.LawChaosAlignment
get

Gets this creature's Law/Chaos Alignment.

◆ LawChaosValue

int? Anvil.API.NwCreature.LawChaosValue
getset

Gets or sets this creature's Chaos (0) - Lawful (100) alignment value.

◆ Level

int Anvil.API.NwCreature.Level
get

Gets the Hit Dice/Level of this creature.

◆ LevelInfo

IReadOnlyList<CreatureLevelInfo> Anvil.API.NwCreature.LevelInfo
get

Gets an enumerable containing information about this creature's levels (feats, skills, class taken, etc).

◆ LoginPlayer

NwPlayer? Anvil.API.NwCreature.LoginPlayer
get

Gets the player that logged in with this creature.
If this creature is a NPC or familiar, regardless of possession, this will return null.

◆ Lootable

bool Anvil.API.NwCreature.Lootable
getset

Gets or sets a value indicating whether this creature will leave a lootable corpse on death.
This flag must be set while the creature is alive. Players are not supported.

◆ Master

NwCreature? Anvil.API.NwCreature.Master
get

Gets the possessor of this creature. This can be the master of a familiar, or the DM for a DM controlled creature.

◆ MovementRate

MovementRate Anvil.API.NwCreature.MovementRate
getset

Gets or sets the movement rate of this creature.

◆ MovementRateFactor

float Anvil.API.NwCreature.MovementRateFactor
getset

Gets or sets the creature's current movement rate factor.
Base movement rate factor is 1.0.

◆ MovementType

MovementType Anvil.API.NwCreature.MovementType
get

Gets the creature's current movement type.

◆ OriginalFirstName

string Anvil.API.NwCreature.OriginalFirstName
getset

Gets or sets the original first name of this creature.

◆ OriginalLastName

string Anvil.API.NwCreature.OriginalLastName
getset

Gets or sets the original last name of this creature.

◆ OriginalName

string Anvil.API.NwCreature.OriginalName
get

Gets the original name of this creature.

◆ Phenotype

Phenotype Anvil.API.NwCreature.Phenotype
getset

Gets or sets this creature's currently set Phenotype (body type).

◆ Position

override Vector3 Anvil.API.NwCreature.Position
set

Gets or sets the creature's position.
NOTE: For player creatures, you likely want to immobilize the player first before moving them.
An issue exists where drive mode (W/A/S/D) can cause a client/server desync, making the creature appear at their old position.

◆ Race

NwRace Anvil.API.NwCreature.Race
getset

Gets this creature's race.

◆ RemainingSkillPoints

ushort Anvil.API.NwCreature.RemainingSkillPoints
getset

Gets or sets the remaining skill points this creature has to spend.

Setting this to a greater value will cause player creatures to fail ELC, unless the corresponding level CreatureLevelInfo.SkillPointsRemaining values are also updated.

◆ SittingObject

NwPlaceable? Anvil.API.NwCreature.SittingObject
get

Gets the placeable object (if any) that this creature is currently sitting in.

◆ Size

CreatureSize Anvil.API.NwCreature.Size
getset

Gets or sets the size of this creature.

◆ SoundSet

ushort Anvil.API.NwCreature.SoundSet
getset

Gets or sets the sound set index for this creature.

◆ SpecialAbilities

IReadOnlyList<SpecialAbility> Anvil.API.NwCreature.SpecialAbilities
get

Gets the special abilities available to this creature.

◆ SpellAbilities

IEnumerable<CreatureSpellAbility> Anvil.API.NwCreature.SpellAbilities
get

Gets a list of spell abilities usable by this creature.

◆ SpellResistance

sbyte Anvil.API.NwCreature.SpellResistance
getset

Gets or sets the spell resistance of this creature.
Returns 0 if this creature has no spell resistance.

◆ StartingPackage

PackageType Anvil.API.NwCreature.StartingPackage
get

Gets this creature's default level up package.

◆ StealthModeActive

bool Anvil.API.NwCreature.StealthModeActive
get

Gets a value indicating whether this creature is currently in stealth mode.

◆ SubRace

string Anvil.API.NwCreature.SubRace
getset

Gets or sets the name of this creature's sub-race.

◆ TailType

CreatureTailType Anvil.API.NwCreature.TailType
getset

Gets or sets the tail type of this creature.

◆ TotalWeight

decimal Anvil.API.NwCreature.TotalWeight
get

Gets the total weight of this creature, in pounds.

◆ TurnResistanceHitDice

int Anvil.API.NwCreature.TurnResistanceHitDice
get

Gets the number of hit dice worth of Turn Resistance this creature has.

◆ WalkRateCap

float? Anvil.API.NwCreature.WalkRateCap
getset

Gets or sets the walk rate cap for this creature (persistent).
Set to null to clear existing walk rate caps. Returns null if no walk rate cap is set.

◆ WingType

CreatureWingType Anvil.API.NwCreature.WingType
getset

Gets or sets the wing type of this creature.

◆ Xp

int? Anvil.API.NwCreature.Xp
getset

Gets or sets the total experience points for this creature, taking/granting levels based on progression.


The documentation for this class was generated from the following files: