Anvil
|
Base class for all entities in areas. More...
Public Member Functions | |||||
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. | |||||
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 | 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. | |||||
Protected Member Functions | |
void | AddToArea (CNWSArea area, float x, float y, float z) |
T | CloneInternal< T > (Location location, string? newTag, bool copyLocalState) |
Properties | |
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.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] |
Additional Inherited Members | |
![]() | |
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. | |
Base class for all entities in areas.
|
inline |
Casts a spell at an location.
spell | The spell to cast. |
target | The target for the spell. |
metaMagic | Metamagic that should be applied to the spell. |
cheat | If true, this object doesn't have to be able to cast the spell. |
projectilePathType | The type of projectile path to use for this spell. |
instant | If true, the spell is cast immediately. |
spellClass | If specified, the spell will be cast using that class specifically. Null will use spell abilities instead. |
spontaneousCast | If true, the creature will attempt to cast the given spell spontaneously. Requires class parameter is set to a valid class with spontaneous cast spells. |
domainLevel | Specifies the spell level if the spell is to be cast as a domain spell. |
|
inline |
Casts a spell at an object.
spell | The spell to cast. |
target | The target for the spell. |
metaMagic | Metamagic that should be applied to the spell. If class is specified, cannot be MetaMagic.Any. |
cheat | If true, this object doesn't have to be able to cast the spell. Ignored if class is specified. |
domainLevel | Specifies the spell level if the spell is to be cast as a domain spell. |
projectilePathType | The type of projectile path to use for this spell. |
instant | If true, the spell is cast immediately. |
spellClass | If specified, the spell will be cast using that class specifically. Null will use spell abilities instead. |
spontaneousCast | If true, the creature will attempt to cast the given spell spontaneously. Requires class parameter is set to a valid class with spontaneous cast spells. |
|
inline |
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.
location | The location to attempt to jump to. |
|
inline |
Instructs this object to do nothing for the specified duration, before continuing with the next item in the action queue.
duration | The time to wait. |
|
inline |
Applies the specified effect to this game object.
durationType | The duration type to apply with this effect. |
effect | The effect to apply. |
duration | If duration type is EffectDuration.Temporary, the duration of this effect. |
|
inline |
Clears the specified animation override, restoring the original.
anim | The name of the original animation to clear. |
|
abstract |
Creates a copy of this game object.
location | The location to create the cloned object. |
newTag | A new tag to assign the cloned object. |
copyLocalState | If true, will clone all local variables, effects, action queue and transition info (triggers, doors) for the object. |
|
inlineprotected |
T | : | NwGameObject |
|
inlinevirtual |
Destroys this object (irrevocably).
Reimplemented in Anvil.API.NwEncounter.
|
inline |
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.
target | The other object to calculate distance from. |
|
inline |
Returns the squared distance to the target.
target | The other object to calculate distance from. |
|
inline |
Rotates this object to face towards target.
target | The target object to face. |
|
inlinevirtual |
Rotates this object to face a position.
point | The position to face towards. |
Reimplemented in Anvil.API.NwStationary.
|
inline |
Gets the color for the specified color channel.
colorChannel | The color channel that you want to get the color value of. |
|
inline |
Returns the creatures closest to this object, matching the specified criteria.
filter1 | A filter created using CreatureTypeFilter. |
|
inline |
Returns the creatures closest to this object, matching all of the specified criteria.
filter1 | A filter created using CreatureTypeFilter. |
filter2 | A 2nd filter created using CreatureTypeFilter. |
|
inline |
Returns the creatures closest to this object, matching all of the specified criteria.
filter1 | A filter created using CreatureTypeFilter. |
filter2 | A 2nd filter created using CreatureTypeFilter. |
filter3 | A 3rd filter created using CreatureTypeFilter. |
|
inline |
Gets the nearest object that is of the specified type.
T | The type of object to search. |
T | : | NwGameObject |
|
inline |
Gets the visual transform of this object for the specified scope.
scope | The transform scope to get. |
|
inline |
Gets whether this object has a direct line of sight to the specified object (not blocked by any geometry).
target | The target object to perform the line of sight check against. |
|
inline |
Plays the specified animation.
animation | Constant value representing the animation to play. |
animSpeed | Speed to play the animation. |
queueAsAction | If true, enqueues animation playback in the object's action queue. |
duration | Duration to keep animating. Not used in fire and forget animations. |
|
inline |
Plays the specified sound as mono audio from the location of this object.
soundName | The name of the sound to play. |
|
inline |
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.
strRef | String reference number of the sound to play. |
runAsAction | Determines if this is an action that can be stacked on the action queue. |
The strRef values for sounds can be found in the file dialog.tlk in the NWN install directory.
|
inline |
Removes the specified effect from this game object.
effect | The existing effect instance. |
|
inline |
Replaces the specified animation with an override.
Use ClearObjectAnimationOverride to clear the override.
anim | The animation to replace. |
newAnim | The replacement animation. |
|
inline |
Replaces the specified texture with a new texture on this object only.
texture | The texture to be replaced. |
newTexture | The replacement texture. |
|
inline |
Performs a saving throw against the given dc.
savingThrow | The type of saving throw to make (Fortitude/Reflex/Will). |
dc | Difficulty class. |
saveType | The sub-type of this save (Mind effect, etc). |
saveVs | The creature this object is making the save against. |
ArgumentOutOfRangeException | Thrown if savingThrow is not Fortitude, Reflex, or Will. |
|
inline |
Sets the color for the specified color channel.
colorChannel | The color channel to modify. |
newColor | The color channel's new color index. |
|
inline |
Rotates this object to face the specified facing angle.
facing | The angle to face. |
|
inline |
Sets a listen pattern for this object, assigning a pattern number that is accessible from the related object's OnConversation event.
pattern | The pattern to match the message against. This is not regex, but a custom pattern format. See the remarks for more info. |
patternNumber | The pattern number to assign, on a successful match. |
Pattern Format:
** will match zero or more characters
*w one or more whitespace
*n one or more numeric
*p one or more punctuation
*a one or more alphabetic
| is or
( and ) can be used for block.
Setting a creature to listen for "**" will match any string
Telling him to listen for "**funk**" will match any string that contains the word "funk".
"**(bash|open|unlock)**(chest|door)**" will match strings like "open the door please" or "he just bashed that chest!"
|
inline |
Sets a material shader uniform override.
material | The material on the object to modify. |
param | The parameter to override. |
value | The new parameter value. |
|
inline |
Sets a material shader uniform override.
material | The material on the object to modify. |
param | The parameter to override. |
value | The new parameter value. |
|
inline |
Sets a material shader uniform override.
material | The material on the object to modify. |
param | The parameter to override. |
value | The new parameter value. |
|
inline |
Sets a text override for the hover/tab-highlight text of this object.
mode | How the text should be applied. |
text | The text override. |
|
get |
Gets the caster level of this object.
A creature will return the caster level of their currently cast spell or ability, or the item's caster level if an item was used.
A placeable will return an automatic caster level: floor(10, (spell innate level * 2) - 1)
An Area of Effect object will return the caster level that was used to create the Area of Effect.
Otherwise, returns 0
|
getset |
Gets or sets the PortraitId of this (game object).
When this property is set to null, the ID will be set to NWScript.PORTRAIT_INVALID (65535).
When this property is invalid, the portrait from PortraitResRef will be used instead.
|
getset |
Gets or sets the Portrait ResRef for this object.
Setting this property will automatically set PortraitId to invalid, ensuring this property is used instead.