A monster, NPC, player character or DM avatar. More...
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. | |||||
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. | |||||
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. | |||||
async Task | ActionCloseDoor (NwDoor door, bool run=false) | ||||
Instructs this creature to move and close the specified door. | |||||
async Task | ActionCounterspell (NwGameObject counterSpellTarget) | ||||
Intructs this creature to enter counterspell combat mode against the specified creature. | |||||
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). | |||||
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. | |||||
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. | |||||
async Task | ActionEquipMostEffectiveArmor () | ||||
Instructs this creature to equip the best armor in its inventory. | |||||
async Task | ActionForceFollowObject (NwGameObject target, float distance) | ||||
Forces this creature to follow the specified target until NwObject.ClearActionQueue is called. | |||||
async Task | ActionForceMoveTo (Location target, bool run=false, TimeSpan? timeOut=null) | ||||
Instructs this creature to walk/run to the specified target location. | |||||
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. | |||||
async Task | ActionInteractObject (NwPlaceable placeable) | ||||
Instructs this creature to use the specified placeable. | |||||
Task | ActionLockObject (NwDoor door) | ||||
Instructs this creature to approach and lock the specified door. | |||||
Task | ActionLockObject (NwPlaceable placeable) | ||||
Instructs this creature to approach and lock the specified placeable. | |||||
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. | |||||
async Task | ActionMoveAwayFrom (NwObject target, bool run, float range=40.0f) | ||||
Instructs this creature to move a certain distance away from the specified target. | |||||
async Task | ActionMoveTo (Location target, bool run=false) | ||||
Instructs this creature to walk/run to the specified target location. | |||||
async Task | ActionMoveTo (NwObject target, bool run=false, float range=1.0f) | ||||
Instructs this creature to walk/run to the specified target object. | |||||
async Task | ActionOpenDoor (NwDoor door, bool run=false) | ||||
Instructs this creature to move and open the specified door. | |||||
async Task | ActionPickUpItem (NwItem item) | ||||
Instructs this creature to walk over and pick up the specified item on the ground. | |||||
async Task | ActionPutDownItem (NwItem item) | ||||
Instructs this creature to begin placing down an item at its feet. | |||||
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. | |||||
async Task | ActionRest (bool enemyLineOfSightCheck=false) | ||||
Instructs this creature to rest. | |||||
async Task | ActionSit (NwPlaceable sitPlaceable, bool alignToPlaceable=true) | ||||
Instructs the creature to sit in the specified placeable. | |||||
async Task | ActionUnequipItem (NwItem item) | ||||
Instructs this creature to unequip the specified item from whatever slot it is currently in. | |||||
Task | ActionUnlockObject (NwDoor door) | ||||
Instructs this creature to approach and unlock the specified door. | |||||
Task | ActionUnlockObject (NwPlaceable placeable) | ||||
Instructs this creature to approach and unlock the specified placeable. | |||||
async Task | ActionUseFeat (NwFeat feat, Location target, Subfeat subFeat=Subfeat.None) | ||||
Instructs this creature to use the specified feat at the target location. | |||||
async Task | ActionUseFeat (NwFeat feat, NwGameObject target, Subfeat subFeat=Subfeat.None) | ||||
Instructs this creature to use the specified feat on the target object. | |||||
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. | |||||
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. | |||||
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. | |||||
async Task | ActionUseTalent (Talent talent, Location target) | ||||
Uses the specified talent. | |||||
async Task | ActionUseTalent (Talent talent, NwGameObject target) | ||||
Uses the specified talent. | |||||
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. | |||||
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. | |||||
void | AddSpecialAbility (SpecialAbility ability) | ||||
Adds the specified ability to this creature. | |||||
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. | |||||
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. | |||||
int | CalculateAbilityModifierFromScore (byte abilityScore) | ||||
Gets the ability modifier from the given ability score. | |||||
ResistSpellResult | CheckResistSpell (NwGameObject target) | ||||
void | ClearDamageLevelOverride () | ||||
Clears any override that is set for the creature's damage level. | |||||
void | ClearInitiativeModifier () | ||||
Clears the modifier that is set for the creature's initiative. | |||||
override NwCreature | Clone (Location location, string? newTag=null, bool copyLocalState=true) | ||||
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. | |||||
bool | DeserializeQuickbar (byte[] serialized) | ||||
async Task | DoDoorAction (NwDoor door, DoorAction doorAction) | ||||
Instructs this creature to perform the specified action on a door. | |||||
async Task | DoPlaceableAction (NwPlaceable placeable, PlaceableAction placeableAction) | ||||
Instructs this creature to perform the specified action on a placeable. | |||||
bool | DoSkillCheck (NwSkill skill, int difficultyClass) | ||||
Returns true if 1d20 + skill rank is greater than, or equal to difficultyClass. | |||||
NwItem? | FindItemWithTag (string itemTag) | ||||
Get the item possessed by this creature with the tag itemTag. | |||||
void | ForceLevelUp (NwClass classType, byte hitDie, Ability? abilityGain=default, bool epic=false, ushort skillPointsRemaining=0, NwDomain? domain1=default, NwDomain? domain2=default, SpellSchool school=SpellSchool.Unknown, bool addStatsToList=true) | ||||
Forces a PC to level up without the level up GUI. | |||||
void | ForceRest () | ||||
Instantly gives this creature the benefits of a rest (restored hitpoints, spells, feats, etc...). | |||||
int | GetAbilityModifier (Ability ability) | ||||
Gets this creature's ability modifier for the specified ability. | |||||
int | GetAbilityScore (Ability ability, bool baseOnly=false) | ||||
Gets the specified ability score from this creature. | |||||
bool | GetActionMode (ActionMode actionMode) | ||||
Gets if this creature is using the specified action mode. | |||||
int | GetArmorClassVersus (NwCreature creature) | ||||
Return the Armor Class this creature has against another creature. | |||||
NwCreature? | GetAssociate (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. | |||||
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. | |||||
int | GetBaseSavingThrow (SavingThrow savingThrow) | ||||
Gets this creature's base save value for the specified saving throw. | |||||
IEnumerable< NwDomain > | GetClassDomains (NwClass? nwClass=default) | ||||
Returns this creature's domains in the specified class. Unless custom content is used, only clerics have domains. | |||||
CreatureClassInfo? | GetClassInfo (NwClass? nwClass) | ||||
Gets the CreatureClassInfo associated with the specified class type. | |||||
int | GetCreatureBodyPart (CreaturePart creaturePart) | ||||
Gets the model number for the specified body part on the creature. | |||||
DamageLevelEntry? | GetDamageLevelOverride () | ||||
Gets the override that is set for the creature's damage level. | |||||
int | GetFeatGainLevel (NwFeat feat) | ||||
Gets the level a feat was gained. | |||||
byte | GetFeatRemainingUses (NwFeat feat) | ||||
Gets the remaining uses available for the specified feat. | |||||
byte | GetFeatTotalUses (NwFeat feat) | ||||
Gets the max/total amount of times the specified feat can be used. | |||||
int? | GetInitiativeModifier () | ||||
Gets the modifier that is set for the creature's initiative. | |||||
NwItem? | GetItemInSlot (InventorySlot slot) | ||||
Gets the item that is equipped in the specified inventory slot. | |||||
CreatureLevelInfo | GetLevelStats (int level) | ||||
Gets the level stat info for the specified level (feat, class, skills, etc.). | |||||
byte | GetPrePolymorphAbilityScore (Ability ability) | ||||
Gets the raw ability score a polymorphed creature had prior to polymorphing. | |||||
PlayerQuickBarButton | GetQuickBarButton (byte index) | ||||
PlayerQuickBarButton[] | GetQuickBarButtons () | ||||
byte | GetRawAbilityScore (Ability ability) | ||||
Gets the base (raw) ability score for the specified ability, without racial modfiers. | |||||
int | GetSavingThrow (SavingThrow savingThrow) | ||||
Gets the specified saving throw modifier for this creature. | |||||
int | GetSkillRank (NwSkill skill, bool ranksOnly=false) | ||||
Gets the number of ranks this creature has in the specified skill. | |||||
EquipmentSlots | GetSlotFromItem (NwItem item) | ||||
Gets the slot that the specified item is in. | |||||
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. | |||||
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. | |||||
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. | |||||
void | GiveGold (int amount, bool showFeedback=true) | ||||
Gives gold to this creature. | |||||
async Task | GiveItem (NwItem item) | ||||
Moves the specified item/item stack to this creature's inventory. | |||||
async Task | GiveItem (NwItem item, int amount) | ||||
Moves a specified amount of items from an item stack to this creature's inventory. | |||||
bool | HasFeatEffect (NwFeat feat) | ||||
Gets whether this creature is under the effects of the specified feat. | |||||
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. | |||||
bool | HasSkill (NwSkill skill) | ||||
Returns true if this creature has the skill specified, and is useable. | |||||
bool | HasSpellEffect (NwSpell spell) | ||||
Gets whether this creature is under the effects of the specified spell. | |||||
bool | HasSpellUse (NwSpell spell) | ||||
Gets if this creature has the specified spell available to cast. | |||||
bool | HasTalent (Talent talent) | ||||
Determines whether this creature has the specified talent. | |||||
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. | |||||
bool | IsCreatureHeard (NwCreature creature) | ||||
Gets whether this creature can hear the specified creature. | |||||
bool | IsCreatureSeen (NwCreature creature) | ||||
Gets whether this creature can see the specified creature. | |||||
bool | IsEnemy (NwCreature target) | ||||
Gets a value indicating whether this creature considers the target as a friend. | |||||
bool | IsFlanking (NwCreature target) | ||||
Gets if this creature is flanking the specified target. | |||||
bool | IsFriend (NwCreature target) | ||||
Gets a value indicating whether this creature considers the target as a enemy. | |||||
bool | IsImmuneTo (ImmunityType immunityType, NwGameObject? verses=null) | ||||
Gets whether this creature has a specific immunity. | |||||
bool | IsNeutral (NwCreature target) | ||||
Gets a value indicating whether this creature considers the target as neutral. | |||||
bool | IsReactionTypeFriendly (NwCreature creature) | ||||
Gets whether this creature has a friendly reaction towards another given creature. | |||||
bool | IsReactionTypeHostile (NwCreature creature) | ||||
Gets whether this creature has a hostile reaction towards another given creature. | |||||
bool | IsReactionTypeNeutral (NwCreature creature) | ||||
Gets whether this creature has a neutral reaction towards another given creature. | |||||
async Task< bool > | IsWeaponEffective (NwGameObject target, bool offHand=false) | ||||
Check whether this creature can damage the specified object using their current weapon/s. | |||||
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. | |||||
bool | KnowsFeat (NwFeat feat) | ||||
Gets if this creature knows the specified feat. | |||||
void | LevelUp (NwClass nwClass, int count) | ||||
Adds levels of the specified class to a creature, bypassing all validation. | |||||
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. | |||||
bool | MeetsFeatRequirements (NwFeat feat) | ||||
Gets if this creature meets the requirements to take the specified feat. | |||||
void | PlayVoiceChat (VoiceChatType voiceChatType) | ||||
Instructs this creature to speak/play the specified voice chat. | |||||
void | RemoveFeat (NwFeat feat, bool removeFeatFromLevelList=false) | ||||
Removes the specified feat from this creature. | |||||
void | RemoveSpecialAbilityAt (int index) | ||||
Removes the specified ability at the given index. | |||||
int | Reputation (NwCreature creature) | ||||
Gets how one creature feels toward this creature. | |||||
void | RestoreAllSpells () | ||||
Restore all NwCreature spells per day for all levels. | |||||
void | RestoreBaseAttackBonus () | ||||
Restores the number of base attacks back to it's original state on this (creature). | |||||
void | RestoreSpells (byte level) | ||||
Restore all NwCreature spells per day for given level. | |||||
bool | RunEquip (NwItem item, EquipmentSlots equipmentSlot) | ||||
Instruct this creature to instantly equip the specified item. | |||||
bool | RunEquip (NwItem item, InventorySlot inventorySlot) | ||||
Instruct this creature to instantly equip the specified item. | |||||
bool | RunUnequip (NwItem item) | ||||
Instruct this creature to instantly unequip the specified item. | |||||
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). | |||||
void | SetAssociateListenPatterns () | ||||
Initialises this creature to listen for the standard AssociateCommand messages. These are the messages sent by the standard party UI. | |||||
void | SetBaseSavingThrow (SavingThrow savingThrow, sbyte newValue) | ||||
Sets this creatures's base save value for the specified saving throw. | |||||
void | SetCreatureBodyPart (CreaturePart creaturePart, int modelNumber) | ||||
Sets the model number to use for the specified body part on the creature. | |||||
void | SetDamageLevelOverride (DamageLevelEntry damageLevel) | ||||
Sets the override value to use for this creature's damage level. | |||||
void | SetEffectIconFlashing (EffectIconTableEntry effectIcon, bool flashing) | ||||
Sets whether the specified effect icon should be flashing in the creature's GUI icon bar. | |||||
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. | |||||
void | SetInitiativeModifier (int modifier) | ||||
Sets the modifier that is set for the creature's initiative. | |||||
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. | |||||
void | SetSpecialAbilityAt (int index, SpecialAbility ability) | ||||
Updates the specified ability at the given index. | |||||
void | SetsRawAbilityScore (Ability ability, byte value) | ||||
Sets the base (raw) ability score for the specified ability, without racial modifiers. | |||||
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. | |||||
async Task | SpeakOneLinerConversation (string dialogResRef="", NwGameObject? tokenTarget=null) | ||||
Instructs this creature to immediately speak the first non-branching conversation line in their dialog. | |||||
bool | SpellAbsorptionLimitedCheck (NwGameObject target, NwSpell? spell=null, SpellSchool? spellSchool=null, int? spellLevel=null, bool removeLevels=true, bool feedback=true) | ||||
Performs a spell absorption check for limited spell absorption effects (e.g. Spell Mantle). | |||||
bool | SpellAbsorptionUnlimitedCheck (NwGameObject target, NwSpell? spell=null, SpellSchool? spellSchool=null, int? spellLevel=null, bool feedback=true) | ||||
Performs a spell absorption check for unlimited spell absorption effects (e.g. Globe of invulnerability). | |||||
bool | SpellImmunityCheck (NwGameObject target, NwSpell? spell=null, bool feedback=true) | ||||
Performs a spell immunity check. | |||||
bool | SpellResistanceCheck (NwGameObject target, NwSpell? spell=null, int? casterLevel=null, int? spellResistance=null, bool feedback=true) | ||||
Performs a spell resistance check. | |||||
void | SummonAnimalCompanion () | ||||
Instructs this creature to summon their animal companion. Does nothing if this creature has no animal companion available. | |||||
void | SummonAnimalCompanion (string resRef) | ||||
Forces this creature to summon a familiar event if it does not meet the base game requirements. | |||||
void | SummonFamiliar () | ||||
Instructs this creature to summon their familiar (wizard/sorcerer). Does nothing if this creature has no familiar available. | |||||
void | SummonFamiliar (string resRef) | ||||
Forces this creature to summon a familiar event if it does not meet the base game requirements. | |||||
void | TakeGold (int amount, bool showFeedback=true) | ||||
Takes gold away from this creature. | |||||
Talent | TalentBest (TalentCategory category, int maxCr) | ||||
Gets the best talent from a group of talents. | |||||
Talent | TalentRandom (TalentCategory category) | ||||
Gets a random talent from a group of talents possessed by this creature. | |||||
TouchAttackResult | TouchAttackMelee (NwGameObject target, bool displayFeedback=true) | ||||
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. | |||||
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. | |||||
void | UnpossessFamiliar () | ||||
Instructs this creature to unpossess their familiar. This function can be run on the player creature, or the possessed familiar. | |||||
void | Unsummon () | ||||
Forces this creature to unsummon itself. Does nothing if this creature is not a summon. | |||||
void | UnsummonAnimalCompanion () | ||||
Forces this creature to unsummon their animal companion. Does nothing if this creature has no animal companion summoned. | |||||
void | UnsummonFamiliar () | ||||
Forces this creature to unsummon their familiar. Does nothing if this creature has no familiar summoned. | |||||
![]() | |||||
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. | |||||
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. | |||||
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. | |||||
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. | |||||
void | ApplyEffect (EffectDuration durationType, Effect effect, TimeSpan duration=default) | ||||
Applies the specified effect to this game object. | |||||
void | ClearObjectAnimationOverride (string anim) | ||||
Clears the specified animation override, restoring the original. | |||||
NwGameObject | Clone (Location location, string? newTag=null, bool copyLocalState=true) | ||||
Creates a copy of this game object. | |||||
virtual void | Destroy () | ||||
Destroys this object (irrevocably). | |||||
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. | |||||
float | DistanceSquared (NwGameObject target) | ||||
Returns the squared distance to the target. | |||||
async Task | EndConversation () | ||||
Immediately ends this GameObject's current conversation. | |||||
void | FaceToObject (NwGameObject target) | ||||
Rotates this object to face towards target. | |||||
virtual void | FaceToPoint (Vector3 point) | ||||
Rotates this object to face a position. | |||||
int | GetColor (ColorChannel colorChannel) | ||||
Gets the color for the specified color channel. | |||||
string | GetLocalizedName (PlayerLanguage language, Gender gender=Gender.Male) | ||||
Gets the localized string for this object in the specified language. | |||||
IEnumerable< NwCreature > | GetNearestCreatures () | ||||
Returns the creatures closest to this object. | |||||
IEnumerable< NwCreature > | GetNearestCreatures (CreatureTypeFilter filter1) | ||||
Returns the creatures closest to this object, matching the specified criteria. | |||||
IEnumerable< NwCreature > | GetNearestCreatures (CreatureTypeFilter filter1, CreatureTypeFilter filter2) | ||||
Returns the creatures closest to this object, matching all of the specified criteria. | |||||
IEnumerable< NwCreature > | GetNearestCreatures (CreatureTypeFilter filter1, CreatureTypeFilter filter2, CreatureTypeFilter filter3) | ||||
Returns the creatures closest to this object, matching all of the specified criteria. | |||||
IEnumerable< T > | GetNearestObjectsByType< T > () | ||||
Gets the nearest object that is of the specified type. | |||||
VisualTransform | GetVisualTransform (ObjectVisualTransformDataScope scope) | ||||
Gets the visual transform of this object for the specified scope. | |||||
bool | HasLineOfSight (NwGameObject target) | ||||
Gets whether this object has a direct line of sight to the specified object (not blocked by any geometry). | |||||
override? Guid | PeekUUID () | ||||
async Task | PlayAnimation (Animation animation, float animSpeed, bool queueAsAction=false, TimeSpan duration=default) | ||||
Plays the specified animation. | |||||
async Task | PlaySound (string soundName) | ||||
Plays the specified sound as mono audio from the location of this object. | |||||
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. | |||||
void | RemoveEffect (Effect effect) | ||||
Removes the specified effect from this game object. | |||||
void | ReplaceObjectAnimation (string anim, string newAnim) | ||||
Replaces the specified animation with an override. Use ClearObjectAnimationOverride to clear the override. | |||||
void | ReplaceObjectTexture (string texture, string newTexture) | ||||
Replaces the specified texture with a new texture on this object only. | |||||
void | ResetMaterialShaderUniforms () | ||||
Resets all material shader parameter overrides on this object. | |||||
void | ResetMaterialShaderUniforms (string material) | ||||
Resets all material shader parameter overrides for the specified material on this object.
| |||||
void | ResetMaterialShaderUniforms (string material, string param) | ||||
Resets the specified material shader parameter override for the specified material.
| |||||
SavingThrowResult | RollSavingThrow (SavingThrow savingThrow, int dc, SavingThrowType saveType, NwGameObject? saveVs=null) | ||||
Performs a saving throw against the given dc. | |||||
byte?[] | Serialize () | ||||
void | SetColor (ColorChannel colorChannel, int newColor) | ||||
Sets the color for the specified color channel. | |||||
void | SetFacing (float facing) | ||||
Rotates this object to face the specified facing angle. | |||||
void | SetIsDestroyable (bool destroyable, bool raiseable=true, bool selectableWhenDead=false) | ||||
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. | |||||
void | SetLocalizedName (string name, PlayerLanguage language, Gender gender=Gender.Male) | ||||
Sets the localized string for this object in the specified language. | |||||
void | SetMaterialShaderUniform (string material, string param, float value) | ||||
Sets a material shader uniform override. | |||||
void | SetMaterialShaderUniform (string material, string param, int value) | ||||
Sets a material shader uniform override. | |||||
void | SetMaterialShaderUniform (string material, string param, Vector4 value) | ||||
Sets a material shader uniform override. | |||||
void | SetTextBubbleOverride (ObjectUiTextBubbleOverride mode, string text) | ||||
Sets a text override for the hover/tab-highlight text of this object. | |||||
Static Public Member Functions | |
static ? NwCreature | Create (string template, Location location, bool useAppearAnim=false, string newTag="") |
Creates a creature at the specified location. | |
static ? NwCreature | Deserialize (byte[] serialized) |
static implicit | operator CNWSCreature? (NwCreature? creature) |
![]() | |
static IEnumerable< T > | FindObjectsOfType< T > () |
Locates all objects of the specified type. | |
static IEnumerable< NwObject > | FindObjectsWithTag (params string[] tags) |
Locates all objects of that have the specified tag. | |
static IEnumerable< T > | FindObjectsWithTag< T > (params string[] tags) |
Locates all objects of the specified type that have the specified tag. | |
Protected Member Functions | |
override void | AddToArea (CNWSArea area, float x, float y, float z) |
![]() | |
void | AddToArea (CNWSArea area, float x, float y, float z) |
T | CloneInternal< T > (Location location, string? newTag, bool copyLocalState) |
Properties | |
int | AC [get] |
Gets this creature's armour class. | |
int | Age [get, set] |
Gets or sets this creature's age, in years. | |
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. | |
bool | AlwaysWalk [get, set] |
Gets or sets whether this creature is forced to walk. Is not persistent, and must be applied again at login. | |
string | AnimalCompanionName [get, set] |
Gets or sets this creature's animal companion name. | |
AnimalCompanionCreatureType | AnimalCompanionType [get, set] |
Gets or sets this creature's animal companion creature type. | |
AppearanceTableEntry | Appearance [get, set] |
Gets or sets the appearance of this creature. | |
int | ArcaneSpellFailure [get] |
Gets the arcane spell failure factor for this creature. | |
sbyte | ArmorCheckPenalty [get] |
IEnumerable< NwCreature > | Associates [get] |
Gets all creatures associated with this creature. | |
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. | |
NwGameObject? | AttackTarget [get] |
Gets this creature's current attack target. | |
NwGameObject? | AttemptedAttackTarget [get] |
Gets the last target this creature tried to attack. | |
NwGameObject? | AttemptedSpellTarget [get] |
Gets the target this creature attempted to cast a spell at. | |
sbyte | BaseAC [get, set] |
Gets or sets the base AC for this creature. | |
byte | BaseArmorArcaneSpellFailure [get, set] |
Gets or sets the current base armor arcane spell failure factor for this creature (global ASF is automatically recalculated). | |
int | BaseAttackBonus [get, set] |
Gets or sets the Base Attack Bonus for this creature. | |
int | BaseAttackCount [get, set] |
Sets the number of base attacks for this creature. The range of values accepted are from 1 to 6. | |
byte | BaseShieldArcaneSpellFailure [get, set] |
Gets or sets the current base shield arcane spell failure factor for this creature (global ASF is automatically recalculated). | |
NwPlaceable? | BodyBag [get] |
Gets the body bag assigned to this creature as a result of its death. | |
BodyBagTableEntry | BodyBagTemplate [get, set] |
Gets or sets the body bag template to use when this creature dies. | |
float | ChallengeRating [get, set] |
Gets or sets the calculated challenge rating for this creature. | |
IReadOnlyList< CreatureClassInfo > | Classes [get] |
Gets this creature's classes, and associated class info. | |
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. | |
bool | Commandable [get, set] |
Gets or sets a value indicating whether this creature's action queue can be modified. | |
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. | |
TimeSpan | CorpseDecayTime [get, set] |
Gets or sets the corpse decay time for this creature. | |
Action | CurrentAction [get] |
Gets the current action that this creature is executing. | |
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. | |
bool | DefensiveCastingModeActive [get] |
Gets a value indicating whether this creature is currently in Defensive Casting Mode. | |
string | Deity [get, set] |
Gets or sets the name of this creature's deity. | |
bool | DetectModeActive [get] |
Gets a value indicating whether this creature is currently in Detect Mode. | |
string? | DialogResRef [get, set] |
Gets or sets the dialog ResRef for this creature. | |
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). | |
NwEncounter? | Encounter [get] |
Gets the encounter that spawned this creature. | |
bool | ExploresMinimap [get, set] |
Gets or sets a value indicating whether this creature will auto-explore the minimap as it walks around. | |
NwFaction | Faction [get, set] |
Gets or sets the faction of this object. | |
string | FamiliarName [get, set] |
Gets or sets this creature's familiar name. | |
FamiliarCreatureType | FamiliarType [get, set] |
Gets or sets the type of familiar that this creature can summon. | |
int | FeatCount [get] |
Gets the number of feats known by this creature. | |
IReadOnlyList< NwFeat > | Feats [get] |
Gets the feats known by this character. | |
bool | FlatFooted [get] |
Gets a value indicating whether this creature is flat footed. | |
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. | |
Gender | Gender [get, set] |
Gets or sets the gender of this creature. | |
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. | |
Alignment | GoodEvilAlignment [get] |
Gets this creature's Good/Evil Alignment. | |
int | GoodEvilValue [get, set] |
Gets or sets this creature's Evil (0) - Good (100) alignment value. | |
IEnumerable< NwCreature > | Henchmen [get] |
Gets all henchmen associated with this creature. | |
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. | |
byte | InitiativeRoll [get, set] |
Gets or sets this creature's initiative roll. | |
Inventory | Inventory [get] |
Gets the inventory of this creature. | |
bool | IsBartering [get] |
Gets a value indicating whether this creature is currently bartering. | |
bool | IsDead [get] |
Gets a value indicating whether this creature is a dead NPC, dead PC, or dying PC. | |
bool | IsDMAvatar [get] |
Gets a value indicating whether this creature is a DM avatar character. This returns false for NPC creatures possessed by DMs. | |
bool | IsDMPossessed [get] |
Gets a value indicating whether this creature is currently possessed by a DM avatar. | |
bool | IsEncounterCreature [get] |
Gets a value indicating whether this creature was spawned from an encounter. | |
bool | IsInCombat [get] |
Gets a value indicating whether this creature is in combat. | |
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. | |
bool | IsPlayableRace [get] |
Gets a value indicating whether this creature is a playable racial type. | |
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. | |
bool | IsPossessedFamiliar [get] |
Gets a value indicating whether this creature is a familiar currently possessed by a master. | |
bool | IsRangedWeaponEquipped [get] |
Gets if this creature is currently holding a ranged weapon. | |
bool | IsResting [get] |
Gets a value indicating whether this creature is currently resting. | |
override bool | IsValid [get] |
LastAttackMode | LastAttackMode [get] |
Gets the attack mode used during this creature's last attack. | |
AssociateCommand | LastCommandFromMaster [get] |
Gets the last command issued to this creature. | |
SpecialAttack | LastSpecialAttackType [get] |
Gets the special attack type used in the last physical attack against this creature. | |
NwTrappable? | LastTrapDetected [get] |
Gets the last trap detected by this creature. | |
Alignment | LawChaosAlignment [get] |
Gets this creature's Law/Chaos Alignment. | |
int | LawChaosValue [get, set] |
Gets or sets this creature's Chaos (0) - Lawful (100) alignment value. | |
int | Level [get] |
Gets the Hit Dice/Level of this creature. | |
IReadOnlyList< CreatureLevelInfo > | LevelInfo [get] |
Gets an enumerable containing information about this creature's levels (feats, skills, class taken, etc). | |
NwPlayer? | 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. | |
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. | |
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 [get, set] |
Gets or sets the movement rate of this creature. | |
float | MovementRateFactor [get, set] |
Gets or sets the creature's current movement rate factor. Base movement rate factor is 1.0. | |
MovementType | MovementType [get] |
Gets the creature's current movement type. | |
string | OriginalFirstName [get, set] |
Gets or sets the original first name of this creature. | |
string | OriginalLastName [get, set] |
Gets or sets the original last name of this creature. | |
string | OriginalName [get] |
Gets the original name of this creature. | |
Phenotype | Phenotype [get, set] |
Gets or sets this creature's currently set Phenotype (body type). | |
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. | |
NwRace | Race [get, set] |
Gets this creature's race. | |
ushort | RemainingSkillPoints [get, set] |
Gets or sets the remaining skill points this creature has to spend. | |
sbyte | ShieldCheckPenalty [get] |
NwPlaceable? | SittingObject [get] |
Gets the placeable object (if any) that this creature is currently sitting in. | |
CreatureSize | Size [get, set] |
Gets or sets the size of this creature. | |
ushort | SoundSet [get, set] |
Gets or sets the sound set index for this creature. | |
IReadOnlyList< SpecialAbility > | SpecialAbilities [get] |
Gets the special abilities available to this creature. | |
IEnumerable< CreatureSpellAbility > | SpellAbilities [get] |
Gets a list of spell abilities usable by this creature. | |
sbyte | SpellResistance [get, set] |
Gets or sets the spell resistance of this creature. Returns 0 if this creature has no spell resistance. | |
PackageType | StartingPackage [get] |
Gets this creature's default level up package. | |
bool | StealthModeActive [get] |
Gets a value indicating whether this creature is currently in stealth mode. | |
string | SubRace [get, set] |
Gets or sets the name of this creature's sub-race. | |
CreatureTailType | TailType [get, set] |
Gets or sets the tail type of this creature. | |
decimal | TotalWeight [get] |
Gets the total weight of this creature, in pounds. | |
int | TurnResistanceHitDice [get] |
Gets the number of hit dice worth of Turn Resistance this creature has. | |
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. | |
CreatureWingType | WingType [get, set] |
Gets or sets the wing type of this creature. | |
int | Xp [get, set] |
Gets or sets the total experience points for this creature, taking/granting levels based on progression. | |
![]() | |
IEnumerable< Effect > | ActiveEffects [get] |
Gets all effects (permanent and temporary) that are active on this game object. | |
AnimationState | AnimationState [get] |
Gets the current animation state of this object. | |
NwArea? | Area [get] |
Gets the area this object is currently in. | |
int | CasterLevel [get] |
Gets the caster level of this object. | |
Color | HighlightColor [get, set] |
Gets or sets the highlight color of this object. | |
int | HP [get, set] |
Gets or sets the current HP for this object. | |
bool | IsDestroyable [get, set] |
Gets or sets if this object is destroyable. | |
bool | IsInConversation [get] |
Gets a value indicating whether this object is in a conversation. | |
bool | IsListening [get, set] |
Gets or sets if this object should be listening for chat patterns, via the listen pattern system. | |
bool | IsRaiseable [get, set] |
Gets or sets if this object is raiseable. | |
bool | IsSelectableWhenDead [get, set] |
Gets or sets if this object is selectable when dead. | |
virtual ? Location | Location [get, set] |
Gets or sets the location of this object. | |
int | MaxHP [get, set] |
Gets or sets the maximum HP for this object. Returns 0 if this object has no defined HP. | |
MouseCursor | MouseCursor [get, set] |
Gets or sets the mouse cursor for this object. | |
bool | PlotFlag [get, set] |
Gets or sets a value indicating whether the plot flag is enabled. | |
PortraitTableEntry? | PortraitId [get, set] |
Gets or sets the PortraitId of this (game object). | |
string | PortraitResRef [get, set] |
Gets or sets the Portrait ResRef for this object. | |
virtual Vector3 | Position [get, set] |
Gets or sets the local area position of this GameObject. | |
virtual float | Rotation [get, set] |
Gets or sets the world rotation for this object. | |
NwGameObject? | TransitionTarget [get, set] |
Gets or sets the transition target for this object. | |
ObjectUiDiscovery | UiDiscoveryFlags [get, set] |
Gets or sets flags for controlling Ui discovery of this object. | |
bool | Useable [get, set] |
Gets or sets a value indicating whether this object should be useable (clickable). | |
VisibilityMode | VisibilityOverride [get, set] |
Gets or sets the global visiblity override for this object. | |
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. | |
VisualTransform | VisualTransform [get] |
Gets the base visual transform for this object. Use GetVisualTransform to get the visual transform for other scopes for this object. | |
Events | |
Action< ModuleEvents.OnActivateItem > | OnActivateItem [add, remove] |
Action< OnAssociateAdd > | OnAssociateAdd [add, remove] |
Action< OnAssociateRemove > | OnAssociateRemove [add, remove] |
Action< CreatureEvents.OnBlocked > | OnBlocked [add, remove] |
Action< OnCheckEffectImmunity > | OnCheckEffectImmunity [add, remove] |
Action< OnCombatDRBroken > | OnCombatDRBroken [add, remove] |
Action< OnCombatModeToggle > | OnCombatModeToggle [add, remove] |
Action< CreatureEvents.OnCombatRoundEnd > | OnCombatRoundEnd [add, remove] |
Action< OnCombatRoundStart > | OnCombatRoundStart [add, remove] |
Action< CreatureEvents.OnConversation > | OnConversation [add, remove] |
Action< OnCreatureAcquireItem > | OnCreatureAcquireItem [add, remove] |
Action< OnCreatureAttack > | OnCreatureAttack [add, remove] |
Action< OnCreatureCheckProficiencies > | OnCreatureCheckProficiencies [add, remove] |
Action< OnCreatureDamage > | OnCreatureDamage [add, remove] |
Action< CreatureEvents.OnDamaged > | OnDamaged [add, remove] |
Action< CreatureEvents.OnDeath > | OnDeath [add, remove] |
Action< OnDetectModeUpdate > | OnDetectModeUpdate [add, remove] |
Action< CreatureEvents.OnDisturbed > | OnDisturbed [add, remove] |
Action< OnDoListenDetection > | OnDoListenDetection [add, remove] |
Action< OnDoSpotDetection > | OnDoSpotDetection [add, remove] |
Action< OnFamiliarPossess > | OnFamiliarPossess [add, remove] |
Action< OnFamiliarUnpossess > | OnFamiliarUnpossess [add, remove] |
Action< OnHealKitUse > | OnHealKitUse [add, remove] |
Action< CreatureEvents.OnHeartbeat > | OnHeartbeat [add, remove] |
Action< OnInventoryGoldAdd > | OnInventoryGoldAdd [add, remove] |
Action< OnInventoryGoldRemove > | OnInventoryGoldRemove [add, remove] |
Action< OnItemEquip > | OnItemEquip [add, remove] |
Action< OnItemInventoryClose > | OnItemInventoryClose [add, remove] |
Action< OnItemInventoryOpen > | OnItemInventoryOpen [add, remove] |
Action< OnItemPayToIdentify > | OnItemPayToIdentify [add, remove] |
Action< OnItemScrollLearn > | OnItemScrollLearn [add, remove] |
Action< OnItemUnequip > | OnItemUnequip [add, remove] |
Action< OnItemUse > | OnItemUse [add, remove] |
Action< OnItemValidateEquip > | OnItemValidateEquip [add, remove] |
Action< OnItemValidateUse > | OnItemValidateUse [add, remove] |
Action< OnLevelDown > | OnLevelDown [add, remove] |
Action< OnLevelUp > | OnLevelUp [add, remove] |
Action< OnLevelUpAutomatic > | OnLevelUpAutomatic [add, remove] |
Action< OnObjectUse > | OnObjectUse [add, remove] |
Action< CreatureEvents.OnPerception > | OnPerception [add, remove] |
Action< CreatureEvents.OnPhysicalAttacked > | OnPhysicalAttacked [add, remove] |
Action< OnPolymorphApply > | OnPolymorphApply [add, remove] |
Action< OnPolymorphRemove > | OnPolymorphRemove [add, remove] |
Action< CreatureEvents.OnRested > | OnRested [add, remove] |
Action< CreatureEvents.OnSpawn > | OnSpawn [add, remove] |
Action< OnSpellAction > | OnSpellAction [add, remove] |
Action< CreatureEvents.OnSpellCastAt > | OnSpellCastAt [add, remove] |
Action< OnSpellSlotClear > | OnSpellSlotClear [add, remove] |
Action< OnSpellSlotMemorize > | OnSpellSlotMemorize [add, remove] |
Action< OnStealthModeUpdate > | OnStealthModeUpdate [add, remove] |
Action< OnStoreRequestBuy > | OnStoreRequestBuy [add, remove] |
Action< OnStoreRequestSell > | OnStoreRequestSell [add, remove] |
Action< OnTrapDisarm > | OnTrapDisarm [add, remove] |
Action< OnTrapExamine > | OnTrapExamine [add, remove] |
Action< OnTrapFlag > | OnTrapFlag [add, remove] |
Action< OnTrapRecover > | OnTrapRecover [add, remove] |
Action< OnTrapSet > | OnTrapSet [add, remove] |
Action< OnUseFeat > | OnUseFeat [add, remove] |
Action< CreatureEvents.OnUserDefined > | OnUserDefined [add, remove] |
Action< OnUseSkill > | OnUseSkill [add, remove] |
![]() | |
Action< ModuleEvents.OnAcquireItem > | OnAcquireItem [add, remove] |
Action< OnChatMessageSend > | OnChatMessageSend [add, remove] |
Action< OnDisarmWeapon > | OnDisarmWeapon [add, remove] |
Action< OnDispelMagicApply > | OnDispelMagicApply [add, remove] |
Action< OnEffectApply > | OnEffectApply [add, remove] |
Action< OnEffectRemove > | OnEffectRemove [add, remove] |
Action< OnHeal > | OnHeal [add, remove] |
Action< OnSpellBroadcast > | OnSpellBroadcast [add, remove] |
Action< OnSpellCast > | OnSpellCast [add, remove] |
Action< OnSpellInterrupt > | OnSpellInterrupt [add, remove] |
Action< ModuleEvents.OnUnacquireItem > | OnUnacquireItem [add, remove] |
A monster, NPC, player character or DM avatar.
|
inline |
Instructs this creature to start attacking the target using whichever weapon they currently have equipped.
target | The target object to attack. |
passive | If TRUE, the attacker will not move to attack the target. If we have a melee weapon equipped, we will just stand still. |
|
inline |
Begins the casting animation and spell fx for the specified spell, without any spell effects.
spell | The spell to cast. |
location | The target location for the fake spell to be cast at. |
pathType | An optional path type for this spell to use. |
|
inline |
Begins the casting animation and spell fx for the specified spell, without any spell effects.
spell | The spell to cast. |
target | The target object for the fake spell to be cast at. |
pathType | An optional path type for this spell to use. |
|
inline |
Instructs this creature to move and close the specified door.
door | The door to close. |
run | If true, the creature will run rather than walk. |
|
inline |
Intructs this creature to enter counterspell combat mode against the specified creature.
counterSpellTarget | The target object to enter counterspell mode against. |
|
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.
verses | If set, finds the most effective melee weapon for attacking this object. |
offhand | Determines if an off-hand weapon is equipped. |
|
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.
verses | If set, finds the most effective ranged weapon for attacking this object. |
|
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.
|
inline |
Forces this creature to follow the specified target until NwObject.ClearActionQueue is called.
target | The target to follow. |
distance | The distance to follow the creature at. |
|
inline |
Instructs this creature to walk/run to the specified target location.
target | The location to move towards. |
run | If true, the creature will run rather than walk. |
timeOut | The amount of time to search for a path before jumping to the location (Default: 30 seconds). |
|
inline |
Instructs this creature to walk/run to the specified target object.
target | The target object to move towards. |
run | If true, the creature will run rather than walk. |
range | The desired distance between the creature and the target object. |
timeOut | The amount of time to search for a path before jumping to the object. (Default: 30 seconds). |
|
inline |
Instructs this creature to use the specified placeable.
placeable | The placeable object to interact with. |
|
inline |
Instructs this creature to approach and lock the specified door.
door | The door to lock. |
|
inline |
Instructs this creature to approach and lock the specified placeable.
placeable | The placeable to lock. |
|
inline |
Instructs this creature to move to a certain distance away from the specified location.
location | The target location this creature should move away from. If the location is not in the same area as this creature, nothing will happen. |
run | If set true, the creature will run rather than walk. |
range | How much distance this creature should put between themselves and the location. |
|
inline |
Instructs this creature to move a certain distance away from the specified target.
target | The target object this creature should move away from. If the target object is not in the same area as this creature, nothing will happen. |
run | If set to true, the creature will run rather than walk. |
range | How much distance this creature should put between themselves and the object. |
|
inline |
Instructs this creature to walk/run to the specified target location.
target | The location to move towards. |
run | If true, the creature will run rather than walk. |
|
inline |
Instructs this creature to walk/run to the specified target object.
target | The target object to move towards. |
run | If true, the creature will run rather than walk. |
range | The desired distance between the creature and the target object. |
|
inline |
Instructs this creature to move and open the specified door.
door | The door to open. |
run | If true, the creature will run rather than walk. |
|
inline |
Instructs this creature to walk over and pick up the specified item on the ground.
item | The item to pick up. |
|
inline |
Instructs this creature to begin placing down an item at its feet.
item | The item to drop. |
|
inline |
Instructs this creature to rest.
enemyLineOfSightCheck | If true, allows this creature to rest if enemies are nearby as long as they are not visible to this creature. |
|
inline |
Instructs the creature to sit in the specified placeable.
sitPlaceable | The placeable to sit in. Must be marked useable, empty, and support sitting (e.g. chairs). |
alignToPlaceable | If true, auto-aligns the creature to the placeable's rotation. Otherwise, this creature will face East (0). |
|
inline |
Instructs this creature to approach and unlock the specified door.
door | The door to unlock. |
|
inline |
Instructs this creature to approach and unlock the specified placeable.
placeable | The placeable to unlock. |
|
inline |
Instructs this creature to use the specified feat at the target location.
This action cannot be used on PCs.
feat | The feat to use. |
target | The target location for the feat. |
subFeat | For some specific feats, the subtype to use. E.g. Wild shape |
|
inline |
Instructs this creature to use the specified feat on the target object.
This action cannot be used on PCs.
feat | The feat to use. |
subFeat | For some specific feats, the subtype to use. E.g. Wild shape |
target | The target object for the feat. |
|
inline |
Instructs this creature to use the specified item property of an item in their inventory.
item | The item to use. |
itemProperty | The item property on the item to use. |
location | The target location for the item property action. |
decrementCharges | If true, decrements item charges as configured for the item property action. |
subPropertyIndex | Specifies the index to use if this item has sub-properties (such as sub-radial spells). |
|
inline |
Instructs this creature to use the specified item property of an item in their inventory.
item | The item to use. |
itemProperty | The item property on the item to use. |
gameObject | The target object for the item property action. |
decrementCharges | If true, decrements item charges as configured for the item property action. |
subPropertyIndex | Specifies the index to use if this item has sub-properties (such as sub-radial spells). |
|
inline |
Instructs this creature to attempt to use a skill on another object.
skill | The skill to use. |
target | The target to use the skill on. |
subSkill | A specific subskill to use. |
itemUsed | An item to use in conjunction with this skill. |
Uses the specified talent.
talent | The talent to use. |
target | The target location for the talent. |
|
inline |
Uses the specified talent.
talent | The talent to use. |
target | The target object for the talent. |
|
inline |
Gives this creature the specified feat.
Consider using the AddFeat(NwFeat, int) overload to properly allocate the feat to a level.
feat | The feat to give. |
|
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.
feat | The feat to give. |
level | The level the feat was gained. |
|
inline |
Adds the specified ability to this creature.
ability | The ability to add. |
|
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.
alignment | The alignment to shift towards. |
shift | The amount of alignment shift. |
|
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.
diceRoll | The d20 dice value result. |
skill | The skill that was rolled. |
modifier | The modifier added to the dice roll. |
difficultyClass | The difficulty class/dc of the skill check. |
take20 | If the roll was an automatic take 20 roll. |
result | The result of the skill check. |
|
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.
abilityScore | The ability score to calculate the ability modifier from. |
|
inlinestatic |
Creates a creature at the specified location.
template | The creature resref template from the toolset palette. |
location | The location where this creature will spawn. |
useAppearAnim | If true, plays EffectAppear when created. |
newTag | The new tag to assign this creature. Leave uninitialized/as null to use the template's tag. |
|
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.
feat | The n/day feat to decrement uses. |
amount | The amount of uses to decrement. |
|
inline |
Instructs this creature to perform the specified action on a door.
door | The door to interact with. |
doorAction | The action to perform on the door. |
|
inline |
Instructs this creature to perform the specified action on a placeable.
placeable | The placeable to interact with. |
placeableAction | The action to perform on the placeable. |
|
inline |
Returns true if 1d20 + skill rank is greater than, or equal to difficultyClass.
skill | The type of skill check. |
difficultyClass | The DC of this skill check. |
|
inline |
Forces a PC to level up without the level up GUI.
classType | The class to level up. |
hitDie | The hit points gained during this level up. |
abilityGain | The abilty to increase : 6 = no increase. |
epic | Is this an epic level. |
skillPointsRemaining | Number of skill points to give |
domain1 | Sets a cleric domain for the class (255 = no domain) |
domain2 | Sets the second cleric domain for the class (255 = no domain) |
school | Sets the wizard school for the class (255 = no school) |
addStatsToList | Adds the new stats to the character sheet |
|
inline |
Gets this creature's ability modifier for the specified ability.
ability | The ability to resolve. |
|
inline |
Gets the specified ability score from this creature.
ability | The type of ability. |
baseOnly | If true, will return the creature's base ability score without bonuses or penalties. |
|
inline |
Gets if this creature is using the specified action mode.
actionMode | The action mode to query. |
|
inline |
Return the Armor Class this creature has against another creature.
creature | The creature against which the Armor Class will be checked. |
|
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.
associateType | The type of associate to locate. |
|
inline |
Gets the creature's highest attack bonus based on its own stats.
AB vs. Type and +AB on Gauntlets are excluded.
isMelee | TRUE: Get Melee/Unarmed Attack Bonus, FALSE: Get Ranged Attack Bonus |
isTouchAttack | If the attack was a touch attack. |
isOffHand | If the attack was a touch attack. |
includeBaseAttackBonus | If the attack was with the offhand. |
|
inline |
Gets this creature's base save value for the specified saving throw.
savingThrow | The type of saving throw. |
ArgumentOutOfRangeException | Thrown if savingThrow is not Fortitude, Reflex, or Will. |
Returns this creature's domains in the specified class. Unless custom content is used, only clerics have domains.
nwClass | The class with domains. Defaults to ClassType.Cleric if not specified. |
|
inline |
Gets the CreatureClassInfo associated with the specified class type.
nwClass | The class type to query. |
|
inline |
Gets the level a feat was gained.
feat | The feat to query. |
|
inline |
Gets the remaining uses available for the specified feat.
feat | The feat to query. |
|
inline |
Gets the max/total amount of times the specified feat can be used.
feat | The feat to query. |
|
inline |
Gets the item that is equipped in the specified inventory slot.
slot | The inventory slot to check. |
|
inline |
Gets the level stat info for the specified level (feat, class, skills, etc.).
level | The level to lookup. |
|
inline |
Gets the raw ability score a polymorphed creature had prior to polymorphing.
ability | The ability score to query. Works for strength, dexterity and constitution only. |
ArgumentOutOfRangeException |
|
inline |
Gets the base (raw) ability score for the specified ability, without racial modfiers.
ability | The ability score type to query. |
ArgumentOutOfRangeException | Thrown if an invalid ability is specified. |
|
inline |
Gets the specified saving throw modifier for this creature.
savingThrow | The type of saving throw. |
ArgumentOutOfRangeException | Thrown if savingThrow is not Fortitude, Reflex, or Will. |
|
inline |
Gets the number of ranks this creature has in the specified skill.
skill | The skill to check. |
ranksOnly | If true, returns the base amount of skill ranks without any ability modifiers. |
|
inline |
Gets the slot that the specified item is in.
item | The item to query. |
|
inline |
Returns this creature's spell school specialization in the specified class.
Unless custom content is used, only Wizards have spell schools.
nwClass | The class to query for specialized spell schools. Defaults to ClassType.Wizard if not specified. |
|
inline |
Gets the number of remaining uses for a specific spell for this creature.
nwClass | The spell caster class. |
spell | The spell to check for remaining uses. |
metaMagic | The metamagic for the spell. |
domain | The domain level, if it is a domain level spell. |
|
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.
area | The area containing the tile. |
x | The location of the tile on the x axis. |
y | The location of the tile on the y axis. |
|
inline |
Gives gold to this creature.
amount | The amount of gold to give. |
showFeedback | If true, shows "Acquired xgp" feedback to the creature. |
|
inline |
Moves the specified item/item stack to this creature's inventory.
item | The item to add. |
|
inline |
Moves a specified amount of items from an item stack to this creature's inventory.
item | The item to add. |
amount | The number of items from the item stack to take. |
|
inline |
Gets whether this creature is under the effects of the specified feat.
feat | The feat to check. |
|
inline |
Returns true if this creature has the skill specified, and is useable.
skill | The skill to check. |
|
inline |
Gets whether this creature is under the effects of the specified spell.
spell | The spell to check. |
|
inline |
Gets if this creature has the specified spell available to cast.
spell | The spell to check. |
|
inline |
Determines whether this creature has the specified talent.
talent | The talent to check. |
|
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.
feat | The n/day feat to add uses. |
amount | The amount of uses to add. |
|
inline |
Gets whether this creature can hear the specified creature.
creature | The creature that may be heard. |
|
inline |
Gets whether this creature can see the specified creature.
creature | The creature to test visibility. |
|
inline |
Gets a value indicating whether this creature considers the target as a friend.
target | The target creature. |
|
inline |
Gets if this creature is flanking the specified target.
target | The target creature to check for flanking status. |
|
inline |
Gets a value indicating whether this creature considers the target as a enemy.
target | The target creature. |
|
inline |
Gets whether this creature has a specific immunity.
immunityType | The immunity type to check. |
verses | If specified, the race and alignment of verses will be considered when determining immunities. |
|
inline |
Gets a value indicating whether this creature considers the target as neutral.
target | The target creature. |
|
inline |
Gets whether this creature has a friendly reaction towards another given creature.
creature | The target creature to test. |
|
inline |
Gets whether this creature has a hostile reaction towards another given creature.
creature | The target creature to test. |
|
inline |
Gets whether this creature has a neutral reaction towards another given creature.
creature | The target creature to test. |
|
inline |
Check whether this creature can damage the specified object using their current weapon/s.
target | The object to test this creature's weapon against. |
offHand | If true, checks the creature's off-hand weapon. |
|
inline |
Teleports this creature to the nearest valid location by the target.
This action produces no visual effect.
gameObject | The target object to jump to. |
walkStraightLineToPoint | Unknown. |
Does not affect dead or dying creatures.
|
inline |
Gets if this creature knows the specified feat.
feat | The feat to check. |
|
inline |
Adds levels of the specified class to a creature, bypassing all validation.
nwClass | The class to add. |
count | The number of levels to add. |
NotSupportedException | Thrown if this creature is a player character. |
|
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.
nwClass | Constant matching the class to level the creature in. |
package | Constant matching the package used to select skills and feats for the henchman. |
spellsReady | Determines if all memorable spell slots will be filled without requiring rest. |
|
inline |
Gets if this creature meets the requirements to take the specified feat.
feat | The feat to query. |
|
inline |
Instructs this creature to speak/play the specified voice chat.
voiceChatType | The VoiceChatType for this creature to speak. |
|
inline |
Removes the specified feat from this creature.
feat | The feat to remove. |
removeFeatFromLevelList |
|
inline |
Removes the specified ability at the given index.
index | The ability index to remove. |
|
inline |
Gets how one creature feels toward this creature.
creature | The creature whose feelings we wish to know. |
|
inline |
Instruct this creature to instantly equip the specified item.
item | The item to equip. |
equipmentSlot | The equipment slot to equip the item to. |
ArgumentNullException | Item is null. |
|
inline |
Instruct this creature to instantly equip the specified item.
item | The item to equip. |
inventorySlot | The inventory slot to equip the item to. |
ArgumentNullException | Item is null. |
|
inline |
Instruct this creature to instantly unequip the specified item.
item | The item to unequip. |
ArgumentNullException | Item is null. |
|
inline |
Instructs this creature to enable/disable the specified action mode (parry, power attack, expertise, etc).
actionMode | The action mode to toggle. |
status | The new state of the action mode. |
|
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.
|
inline |
Sets this creatures's base save value for the specified saving throw.
savingThrow | The type of saving throw. |
newValue | The new base saving throw. |
ArgumentOutOfRangeException | Thrown if savingThrow is not Fortitude, Reflex, or Will. |
|
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.
effectIcon | The icon to start/stop flashing. |
flashing | The new flashing state. |
|
inline |
Sets the remaining uses available for the specified feat.
Cannot exceed the creature's total/max uses of the feat.
feat | The feat to change. |
remainingUses | The new number of uses remaining. |
|
inline |
Sets the skill ranks for the specified skill on this creature.
skill | The skill to modify. |
rank | The new number of skill ranks. |
|
inline |
Updates the specified ability at the given index.
index | The ability index to update. |
ability | The new state for the ability. |
|
inline |
Sets the base (raw) ability score for the specified ability, without racial modifiers.
ability | The ability score type to query. |
value | The new ability score to set. |
ArgumentOutOfRangeException | Thrown if an invalid ability is specified. |
|
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.
area | The area containing the tile. |
x | The location of the tile on the x axis. |
y | The location of the tile on the y axis. |
newState | The new exploration state for this tile (true = explored, false = unexplored). |
|
inline |
Instructs this creature to immediately speak the first non-branching conversation line in their dialog.
dialogResRef | The dialog resource reference to use. |
tokenTarget | The object to use if there are object-specific tokens in the string. |
|
inline |
Performs a spell absorption check for limited spell absorption effects (e.g. Spell Mantle).
target | The target creature of the spell. |
spell | The spell to use for the check. If null, will auto-detect based on the current running spell script. |
spellSchool | The spell school to check for. If null, uses the default spell school from the spell parameter. |
spellLevel | The spell level. If null, uses the spell level from the spell parameter using the creature's caster class. |
removeLevels | If true, will remove the spell levels from the effect that would stop it, and remove the effect if 0 or fewer levels remain. If false, the effect is untouched. |
feedback | If true, will show feedback for the spell absorption check. |
|
inline |
Performs a spell absorption check for unlimited spell absorption effects (e.g. Globe of invulnerability).
target | The target creature of the spell. |
spell | The spell to use for the check. If null, will auto-detect based on the current running spell script. |
spellSchool | The spell school to check for. If null, uses the default spell school from the spell parameter. |
spellLevel | The spell level. If null, uses the spell level from the spell parameter using the creature's caster class. |
feedback | If true, will show feedback for the spell absorption check. |
|
inline |
Performs a spell immunity check.
target | The target creature of the spell. |
spell | The spell to use for the check. If null, will auto-detect based on the current running spell script. |
feedback | If true, will show feedback for the spell immunity check. |
|
inline |
Performs a spell resistance check.
target | The target creature of the spell. |
spell | The spell to use for the check. If null, will auto-detect based on the current running spell script. |
casterLevel | The caster level for the spell. If null, will use the caster's level. |
spellResistance | The spell resistance to penetrate. If null, will use the spell resistance of the target. |
feedback | If true, will show feedback for the spell resistance roll. |
|
inline |
Forces this creature to summon a familiar event if it does not meet the base game requirements.
resRef | The blueprint resource reference of the creature. |
|
inline |
Forces this creature to summon a familiar event if it does not meet the base game requirements.
resRef | The blueprint resource reference of the creature. |
|
inline |
Takes gold away from this creature.
amount | The amount of gold to take. |
showFeedback | If true, shows "Lost xgp" feedback to the creature. |
|
inline |
Gets the best talent from a group of talents.
category | The category of talents to pick from. |
maxCr | The maximum Challenge Rating of the talent. |
|
inline |
Gets a random talent from a group of talents possessed by this creature.
category | The category of talents to pick from. |
|
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.
target | The target of this touch attack. |
displayFeedback | If true, displays combat feedback in the chat window. |
|
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.
target | The target of this touch attack. |
displayFeedback | If true, displays combat feedback in the chat window. |
|
getset |
Sets the number of base attacks for this creature.
The range of values accepted are from 1 to 6.
|
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.