Anvil
Anvil.API.Effect Class Reference

Represents an effect engine structure. More...

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

Public Member Functions

Effect Clone ()
 Creates a new copy of this effect. More...
 
- Public Member Functions inherited from Anvil.API.EngineStructure
void Dispose ()
 

Static Public Member Functions

static Effect AbilityDecrease (Ability ability, int amount)
 Creates an effect that decreases a certain ability score. More...
 
static Effect AbilityIncrease (Ability ability, int amount)
 Creates an effect that increases a certain ability score. More...
 
static Effect ACDecrease (int amount, ACBonus acType=ACBonus.Dodge)
 Creates an effect that decreases the AC of an object.
More...
 
static Effect ACIncrease (int amount, ACBonus acType=ACBonus.Dodge)
 Creates an effect that increases the AC of an object. More...
 
static Effect Appear ()
 Creates a special effect to make an object "fly in". More...
 
static Effect AreaOfEffect (PersistentVfxTableEntry vfxType, ScriptCallbackHandle? onEnterHandle=null, ScriptCallbackHandle? heartbeatHandle=null, ScriptCallbackHandle? onExitHandle=null)
 Creates an area of effect (AOE) effect. More...
 
static Effect AttackDecrease (int amount, AttackBonus penaltyType=AttackBonus.Misc)
 Creates an effect that applies a penalty to an attack roll. More...
 
static Effect AttackIncrease (int amount, AttackBonus bonusType=AttackBonus.Misc)
 Creates an effect that applies a bonus to an attack roll. More...
 
static Effect Beam (VfxType fxType, NwGameObject emitter, BodyNode origin, bool missTarget=false)
 Creates a visual beam effect. More...
 
static Effect Blindness ()
 Creates an effect that blinds a creature. More...
 
static Effect BonusFeat (NwFeat feat)
 Creates an effect that grants a bonus feat, similar to ItemProperty.BonusFeat. More...
 
static Effect Charmed ()
 Creates an effect that increases the personal reputation to the target by 50 points. More...
 
static Effect Concealment (int percentage, MissChanceType missChanceType=MissChanceType.Normal)
 Creates an effect that conceals an object. More...
 
static Effect Confused ()
 Creates a confuse effect. More...
 
static Effect Curse (int strMod=1, int dexMod=1, int conMod=1, int intMod=1, int wisMod=1, int chaMod=1)
 Creates a curse effect. More...
 
static Effect CutsceneDominated ()
 Creates an effect that is guaranteed to dominate a creature, bypassing immunities and cannot be resisted. More...
 
static Effect CutsceneGhost ()
 Creates an effect that allows creatures to pathfind through other creatures without bumping. More...
 
static Effect CutsceneImmobilize ()
 Creates an effect that will prevent the target from moving, but can otherwise act unpenalized. The cutscene version bypasses immunities and cannot be resisted. More...
 
static Effect CutsceneParalyze ()
 Creates an effect that is guaranteed to paralyze a creature, but can not be resisted. More...
 
static Effect Damage (int amount, DamageType damageType=DamageType.Magical)
 Creates an effect that immediately applies damage to a target. More...
 
static Effect DamageDecrease (int penalty, DamageType damageType=DamageType.Magical)
 Creates an effect that applies a penalty to a specified damage type. More...
 
static Effect DamageImmunityDecrease (DamageType damageType, int pctImmunity)
 Creates an effect that decreases immunity to a certain damage type.
If a creature does not have an immunity to the specified type, the creature will instead become more vulnerable to the damage, to a max of 100% (double damage). More...
 
static Effect DamageImmunityIncrease (DamageType damageType, int pctImmunity)
 Creates an effect that increases immunity to a certain damage type, to a max of 100% (complete immunity). More...
 
static Effect DamageIncrease (int bonus, DamageType damageType=DamageType.Magical)
 Creates an effect that applies a bonus to a specified damage type. More...
 
static Effect DamageReduction (int amount, DamagePower damagePower, int totalAbsorb=0, bool rangedOnly=false)
 Creates an effect that resists a constant amount of damage from a physical attack with a certain magical power. More...
 
static Effect DamageResistance (DamageType damageType, int amount, int totalAbsorb=0, bool rangedOnly=false)
 Creates an effect that resists a constant amount of damage from a specific damage type. More...
 
static Effect DamageShield (int damageAmount, DamageBonus randomAmount, DamageType damageType)
 Creates an effect that reflects damage to melee attackers from successful hits. More...
 
static Effect Darkness ()
 Creates an effect that shrouds an area in darkness, applying a miss chance to all those standing within.
Creatures with an Ultravision effect will bypass this miss chance. More...
 
static Effect Dazed ()
 Creates an effect that dazes a creature, preventing all actions but walking movement. More...
 
static Effect Deaf ()
 Creates an effect that deafens a creature, applying a 20% spell failure chance for spells with (V)erbal components. More...
 
static Effect Death (bool spectacularDeath=false, bool feedback=true)
 Creates an effect that kills, or destroys an object. More...
 
static Effect Disappear ()
 Creates an effect that causes the object to "fly away", before destroying itself.
This effect should not be applied to PCs. More...
 
static Effect DisappearAppear (Location location, int animationType=1)
 Creates an effect that causes the object to "fly away", before appearing in another location. More...
 
static Effect Disease (DiseaseType diseaseType)
 Creates an effect that applies a disease to a creature. More...
 
static Effect DispelMagicAll (int casterLevel)
 Creates an effect that attempts to strip all (Sp)ell effects on a target, up to a specified caster level.
(Su)pernatural and (Ex)traordinary effects can never be dispelled. More...
 
static Effect DispelMagicBest (int casterLevel)
 Creates an effect that will attempt to strip the highest level spell effect on a target, up to a specified caster level. More...
 
static Effect Dominated ()
 Creates a dominate effect.
A dominated creature is added to the effect creators party. This means they will become instantly friendly and not attack each other, and they are treated as a normal friend as a henchman would be. More...
 
static Effect EnemyAttackBonus (int bonus)
 Creates an effect that gives a creature with melee/ranged/touched attacks a bonus to hit. More...
 
static Effect Entangle ()
 Creates an effect that prevents all movement, and applies a -2 to all attacks and a -4 to AC. More...
 
static Effect Ethereal ()
 Creates an effect that causes the creature to become invisible and un-perceivable, and taking on an ethereal appearance.
The effect is cancelled when the creature performs a hostile action. More...
 
static Effect ForceWalk ()
 Creates an effect that forces creatures to always walk. More...
 
static Effect Frightened ()
 Creates a frightened effect for use in making creatures shaken or flee. More...
 
static Effect Haste ()
 Creates a haste effect.
Haste effects add +4 dodge AC, +1 action/round and 50% movement speed increase. More...
 
static Effect Heal (int damageToHeal)
 Creates a heal effect that will heal the object it is applied to by the specified damage amount. More...
 
static Effect HitPointChangeWhenDying (float hpChangePerRound)
 Creates a special effect for healing/damaging dying players. More...
 
static Effect Icon (EffectIconTableEntry icon)
 Creates an icon effect. Icons appear in the top right and in the character sheet and examine panels. More...
 
static Effect Immunity (ImmunityType immunityType)
 Creates an immunity effect. This provides immunity to a specific effect type. More...
 
static Effect Invisibility (InvisibilityType invisibilityType)
 Creates an invisiblity effect. Behaviour is defined from the specified invisibility type. More...
 
static Effect Knockdown ()
 Creates a knockdown effect. This effect knocks creatures off their feet, they will sit until the effect is removed. More...
 
static Effect LinkEffects (Effect baseEffect, IEnumerable< Effect > effects)
 
static Effect LinkEffects (Effect baseEffect, params Effect[] effects)
 Creates a new linked effect from the specified effects.
If you remove/dispel one of the effects from a target which is linked to others, the other linked effects will be removed/dispelled too. More...
 
static Effect MissChance (int missPct, MissChanceType missChanceType=MissChanceType.Normal)
 Creates a new effect used to hinder the attacks of the creature it is applied to. More...
 
static Effect ModifyAttacks (int numAttacks)
 Creates an effect that modifies the amount of attacks a creature can perform. More...
 
static Effect MovementSpeedDecrease (int pctChange)
 Creates an effect that reduces the movement speed of a creature. More...
 
static Effect MovementSpeedIncrease (int pctChange)
 Creates an effect that increases the movement speed of a creature. More...
 
static Effect NegativeLevel (int numLevels)
 Creates an effect that will "decrease" the level of the target. More...
 
static implicit operator Effect? (IntPtr intPtr)
 
static Effect Pacified ()
 Creates an effect that pacifies a creature, making them unable to do attacks. More...
 
static Effect Paralyze ()
 Creates a paralyze effect. More...
 
static Effect Petrify ()
 Creates an effect that will petrify a creature. It is similar to Paralyze, but also applies the VfxType.DurPetrify visual effect. More...
 
static Effect Poison (PoisonType poisonType)
 Creates a poison effect that sets the poisoned status effect, with varying penalties based on the type chosen. More...
 
static Effect Polymorph (PolymorphTableEntry polymorphType, bool locked=false)
 Creates a polymorph effect that changes the target into a different kind of creature. More...
 
static Effect Regenerate (int amountPerInterval, TimeSpan interval)
 Creates a regeneration effect that will cause the target to heal the specified amount at each interval. More...
 
static Effect Resurrection ()
 Creates an effect that raises a creature who is dead to 1 hit point. More...
 
static Effect RunAction (ScriptCallbackHandle? onAppliedHandle=null, ScriptCallbackHandle? onRemovedHandle=null, ScriptCallbackHandle? onIntervalHandle=null, TimeSpan interval=default, string data="")
 Creates a custom scripted effect. More...
 
static Effect Sanctuary (int difficultyClass)
 Creates a sanctuary effect. Sanctuary effects work similar to invisibility effects, but also cause creatures to be unable to hear the target creature, if they fail the DC. More...
 
static Effect SavingThrowDecrease (SavingThrow savingThrow, int amount, SavingThrowType savingThrowType=SavingThrowType.All)
 Creates an effect to decrease one saving throw type. More...
 
static Effect SavingThrowIncrease (SavingThrow savingThrow, int amount, SavingThrowType savingThrowType=SavingThrowType.All)
 Creates an effect to increase one saving throw type. More...
 
static Effect SeeInvisible ()
 Creates an effect that allows a creature to see through magical invisibility. More...
 
static Effect Silence ()
 Creates an effect that silences a creature. Silent creatures may not cast spell with verbal components. More...
 
static Effect SkillDecrease (NwSkill skill, int amount)
 Creates an effect that decreases a specific skill score. More...
 
static Effect SkillDecreaseAll (int amount)
 Creates an effect that decreases all skill scores. More...
 
static Effect SkillIncrease (NwSkill skill, int amount)
 Creates an effect that increases a specific skill score. More...
 
static Effect SkillIncreaseAll (int amount)
 Creates an effect that increases all skill scores. More...
 
static Effect Sleep ()
 Creates a sleep effect. Sleeping creatures may not act, and are subject to coup de grace (4 or less HD) More...
 
static Effect Slow ()
 Creates a slow effect. Slowed creatures have no benefits from any haste applied to them, or if they have no haste, have 1 attack per round, -2 AC, -2 attack, -2 Reflex Saving Throw, and -50% movement speed. More...
 
static Effect SpellFailure (int failPct, SpellSchool spellSchool=SpellSchool.General)
 Creates an effect that inhibits spells. More...
 
static Effect SpellImmunity (Spell spell=API.Spell.AllSpells)
 Creates an effect that provides immunity to a specific spell More...
 
static Effect SpellLevelAbsorption (int maxSpellLevel, int totalSpellsAbsorbed=0, SpellSchool spellSchool=SpellSchool.General)
 Creates an effect that absorbs a certain amount of spells. More...
 
static Effect SpellResistanceDecrease (int amount)
 Creates an effect that decreases the spell resistance of a creature. More...
 
static Effect SpellResistanceIncrease (int amount)
 Creates an effect that increases the spell resistance of a creature. More...
 
static Effect Stunned ()
 Creates a stun effect. This is a mind-effecting effect, and so immunity to mind effects prevents this from working.
Stunned creatures are flat-footed (no AC dex bonus), and cannot move. More...
 
static Effect SummonCreature (string creatureResRef, VfxType vfxType, TimeSpan delay=default, int appearType=0)
 Creates an effect to summon a creature.
THIS IS OBJECT CONTEXT SENSITIVE! Use NwObject.WaitForObjectContext to correctly assign the right owner of the master. More...
 
static Effect Swarm (bool loop, string creatureTemplate1, string creatureTemplate2="", string creatureTemplate3="", string creatureTemplate4="")
 Creates a swarm effect. This is exactly the same as SummonCreature, except, after one dies, another takes its place. More...
 
static Effect TemporaryHitpoints (int hitPoints)
 Creates an effect that will give temporary hitpoints to a target. More...
 
static Effect TimeStop ()
 Creates a time stop effect.
Time stop applies a special module-wide pause which only the object it is applied to (and DM's) can move and cast spells without penalties or hindrance.
This is not recommended for multiplayer games as it will cause everyone in the module to pause.
You can query the current timestop state with NwServer.IsTimestopPaused. More...
 
static Effect TimeStopImmunity ()
 Creates a time stop immunity effect.
Immunity allows objects to continue taking actions during an active time stop effect. More...
 
static Effect TrueSeeing ()
 Creates a true seeing effect. Creatures with true sight can see through stealth, invisibility, sanctuary and darkness. More...
 
static Effect Turned ()
 Creates a turned effect. Turning bypass all fear immunity effects, but should only be used in the turn undead script. More...
 
static Effect TurnResistanceDecrease (int hitDiceDecrease)
 Creates an effect that decreases a creature's turn resistance, making them more susceptible to turning. More...
 
static Effect TurnResistanceIncrease (int hitDiceIncrease)
 Creates an effect that increases a creature's turn resistance, making them more resistant to turning. More...
 
static Effect Ultravision ()
 Creates an Ultravision effect. Ultravision lets the target see through Darkness and Invisibility effects with InvisibilityType.Darkness. More...
 
static Effect VisualEffect (VfxType visualEffectId, bool missEffect=false, float fScale=1.0f, System.Numerics.Vector3 vTranslate=default, System.Numerics.Vector3 vRotate=default)
 Creates an effect that plays a visual effect when applied. More...
 
static Effect VisualEffect (VisualEffectTableEntry visualEffect, bool missEffect=false, float fScale=1.0f, System.Numerics.Vector3 vTranslate=default, System.Numerics.Vector3 vRotate=default)
 Creates an effect that plays a visual effect when applied. More...
 
- Static Public Member Functions inherited from Anvil.API.EffectBase
static implicit operator CGameEffect (EffectBase effect)
 
- Static Public Member Functions inherited from Anvil.API.EngineStructure
static implicit operator IntPtr (EngineStructure engineStructure)
 

Properties

float DurationRemaining [get]
 Gets the remaining duration of this effect in seconds. Returns 0 if the duration type is not EffectDuration.Temporary. More...
 
EffectDuration DurationType [get, set]
 Gets or sets the duration type (Temporary, Instant, Permanent) of this effect. More...
 
EffectType EffectType [get]
 Gets the type of this effect. More...
 
bool IgnoreImmunity [get, set]
 Gets or sets if this effect should ignore immunities. More...
 
string LinkId [get]
 Gets the link id of this effect, if it is a linked effect. There is no guarantees about this identifier other than it is unique and the same for all effects linked to it. More...
 
override int StructureId [get]
 
EffectSubType SubType [get, set]
 Gets or sets the subtype of this effect. More...
 
string? Tag [get, set]
 Gets or sets the tag for this effect. More...
 
float TotalDuration [get]
 Gets the total duration of this effect in seconds. Returns 0 if the duration type is not EffectDuration.Temporary. More...
 
- Properties inherited from Anvil.API.EffectBase
int CasterLevel [get, set]
 Gets or sets the caster level for this effect/item property. More...
 
NwObjectCreator [get, set]
 Gets or sets the creator of this effect/item property. More...
 
bool Expose [get, set]
 
EffectParams< float > FloatParams [get]
 Gets the float parameters of this effect/item property. More...
 
EffectParams< int > IntParams [get]
 Gets the integer parameters of this effect/item property. More...
 
EffectParams< NwObjectObjectParams [get]
 Gets the object parameters of this effect/item property. More...
 
bool ShowIcon [get, set]
 Gets or sets if this effect should show an icon in the top right and in the character sheet and examine panels. More...
 
NwSpell Spell [get, set]
 Gets or sets the associated spell for this effect/item property. More...
 
EffectParams< string > StringParams [get]
 Gets the string parameters of this effect/item property. More...
 
EffectParams< Vector3 > VectorParams [get]
 Gets the vector parameters of this effect/item property. More...
 
- Properties inherited from Anvil.API.EngineStructure
bool IsValid [get]
 Gets if this object is valid. More...
 
abstract int StructureId [get]
 

Additional Inherited Members

- Protected Member Functions inherited from Anvil.API.EffectBase
unsafe EffectBase (CGameEffect effect, bool memoryOwn)
 
- Protected Member Functions inherited from Anvil.API.EngineStructure
 EngineStructure (IntPtr handle, bool memoryOwn)
 
- Protected Attributes inherited from Anvil.API.EffectBase
readonly CGameEffect Effect
 

Detailed Description

Represents an effect engine structure.

Examples

/*
* Examples for creating and applying effects to objects and locations.
*/
using System;
using System.Linq;
using Anvil.API;
namespace NWN.Anvil.Samples
{
[ServiceBinding(typeof(EffectExamples))]
public class EffectExamples
{
// Some effects can be declared as fields. This allows you to reuse effects, rather than creating them every time.
private readonly Effect blindnessEffect = Effect.Blindness();
private readonly Effect bloodVfx = Effect.VisualEffect(VfxType.ComBloodCrtRed);
public EffectExamples()
{
// Make our blindness effect a supernatural effect.
blindnessEffect.SubType = EffectSubType.Supernatural;
// Register methods to listen for the player/client enter event.
NwModule.Instance.OnClientEnter += RatSummonExample;
// When entering a specific area, remove all blindness effects:
NwArea? area = NwObject.FindObjectsWithTag<NwArea>("clear_blind").FirstOrDefault();
if (area != null)
{
area.OnEnter += RemoveBlindnessExample;
}
// Register methods to listen for the creature damage event.
NwModule.Instance.OnCreatureDamage += BloodVfxExample;
NwModule.Instance.OnCreatureDamage += BlindnessExample;
}
private async void RatSummonExample(ModuleEvents.OnClientEnter eventData)
{
// Create the summon effect.
// Some effects require a "caster" for the effect, and must be made within the caster's context.
await eventData.Player.ControlledCreature!.WaitForObjectContext();
Effect summon = Effect.SummonCreature("nw_rat001", VfxType.ImpUnsummon);
// Spawn the summon at the module's starting location
Location spawnLocation = NwModule.Instance.StartingLocation;
spawnLocation.ApplyEffect(EffectDuration.Temporary, summon, TimeSpan.FromMinutes(5));
}
private void BloodVfxExample(OnCreatureDamage eventData)
{
// If the target is a creature, and the attack does more than 50 slashing damage...
if (eventData.Target is NwCreature && eventData.DamageData.GetDamageByType(DamageType.Slashing) > 50)
{
// ...Apply our blood effect to the creature
eventData.Target.ApplyEffect(EffectDuration.Instant, bloodVfx);
}
}
private void BlindnessExample(OnCreatureDamage eventData)
{
// If the target is a creature, and the attack does more than 100 bludgeoning damage...
if (eventData.Target is NwCreature && eventData.DamageData.GetDamageByType(DamageType.Bludgeoning) > 100)
{
// ...Apply our blindness effect for 5 seconds.
eventData.Target.ApplyEffect(EffectDuration.Temporary, blindnessEffect, TimeSpan.FromSeconds(5));
}
}
private void RemoveBlindnessExample(AreaEvents.OnEnter eventData)
{
// If the object entering is not a creature, early return.
if (eventData.EnteringObject is not NwCreature creature)
{
return;
}
// Loop through all active effects on the creature, and remove any with the blindness type.
foreach (Effect effect in creature.ActiveEffects)
{
if (effect.EffectType == EffectType.Blindness)
{
creature.RemoveEffect(effect);
}
}
}
}
}

Member Function Documentation

◆ AbilityDecrease()

static Effect Anvil.API.Effect.AbilityDecrease ( Ability  ability,
int  amount 
)
inlinestatic

Creates an effect that decreases a certain ability score.

Parameters
abilityThe ability to decrease.
amountThe amount to increase the ability by.

◆ AbilityIncrease()

static Effect Anvil.API.Effect.AbilityIncrease ( Ability  ability,
int  amount 
)
inlinestatic

Creates an effect that increases a certain ability score.

Parameters
abilityThe ability to increase.
amountThe amount to increase the ability by.

◆ ACDecrease()

static Effect Anvil.API.Effect.ACDecrease ( int  amount,
ACBonus  acType = ACBonus.Dodge 
)
inlinestatic

Creates an effect that decreases the AC of an object.

Parameters
amountThe AC penalty.
acTypeThe type of AC to decrease (Dodge).

◆ ACIncrease()

static Effect Anvil.API.Effect.ACIncrease ( int  amount,
ACBonus  acType = ACBonus.Dodge 
)
inlinestatic

Creates an effect that increases the AC of an object.

Parameters
amountThe AC bonus.
acTypeThe AC type of the AC bonus.

◆ Appear()

static Effect Anvil.API.Effect.Appear ( )
inlinestatic

Creates a special effect to make an object "fly in".

◆ AreaOfEffect()

static Effect Anvil.API.Effect.AreaOfEffect ( PersistentVfxTableEntry  vfxType,
ScriptCallbackHandle onEnterHandle = null,
ScriptCallbackHandle heartbeatHandle = null,
ScriptCallbackHandle onExitHandle = null 
)
inlinestatic

Creates an area of effect (AOE) effect.

Parameters
vfxTypeThe persistent area visual effect to use for this effect.
onEnterHandleThe callback to invoke when something enters this area of effect.
heartbeatHandleThe callback to invoke when something is inside the area of effect during a heartbeat (~6 seconds)
onExitHandleThe callback to invoke when something leaves this area of effect.

◆ AttackDecrease()

static Effect Anvil.API.Effect.AttackDecrease ( int  amount,
AttackBonus  penaltyType = AttackBonus.Misc 
)
inlinestatic

Creates an effect that applies a penalty to an attack roll.

Parameters
amountThe penalty to apply.
penaltyTypeThe weapon slot this penalty should be applied to.

◆ AttackIncrease()

static Effect Anvil.API.Effect.AttackIncrease ( int  amount,
AttackBonus  bonusType = AttackBonus.Misc 
)
inlinestatic

Creates an effect that applies a bonus to an attack roll.

Parameters
amountThe bonus to apply.
bonusTypeThe weapon slot this bonus should be applied to.

◆ Beam()

static Effect Anvil.API.Effect.Beam ( VfxType  fxType,
NwGameObject  emitter,
BodyNode  origin,
bool  missTarget = false 
)
inlinestatic

Creates a visual beam effect.

Parameters
fxTypeThe beam effect to render.
emitterThe origin object of this beam .
originThe origin body part of this beam.
missTargetIf true, the beam will hit a random position near or past the applied target to indicate a miss.

◆ Blindness()

static Effect Anvil.API.Effect.Blindness ( )
inlinestatic

Creates an effect that blinds a creature.

◆ BonusFeat()

static Effect Anvil.API.Effect.BonusFeat ( NwFeat  feat)
inlinestatic

Creates an effect that grants a bonus feat, similar to ItemProperty.BonusFeat.

Parameters
featThe feat to grant.

◆ Charmed()

static Effect Anvil.API.Effect.Charmed ( )
inlinestatic

Creates an effect that increases the personal reputation to the target by 50 points.

◆ Clone()

Effect Anvil.API.Effect.Clone ( )
inline

Creates a new copy of this effect.

◆ Concealment()

static Effect Anvil.API.Effect.Concealment ( int  percentage,
MissChanceType  missChanceType = MissChanceType.Normal 
)
inlinestatic

Creates an effect that conceals an object.

Parameters
percentageA positive number representing the percentage chance for other attackers to miss (1-100).
missChanceTypeThe type of attack to apply this concealment against.

◆ Confused()

static Effect Anvil.API.Effect.Confused ( )
inlinestatic

Creates a confuse effect.

◆ Curse()

static Effect Anvil.API.Effect.Curse ( int  strMod = 1,
int  dexMod = 1,
int  conMod = 1,
int  intMod = 1,
int  wisMod = 1,
int  chaMod = 1 
)
inlinestatic

Creates a curse effect.

Parameters
strModThe penalty to Strength.
dexModThe penalty to Dexterity.
conModThe penalty to Constitution.
intModThe penalty to Intelligence.
wisModThe penalty to Wisdom.
chaModThe penalty to Charisma.

◆ CutsceneDominated()

static Effect Anvil.API.Effect.CutsceneDominated ( )
inlinestatic

Creates an effect that is guaranteed to dominate a creature, bypassing immunities and cannot be resisted.

◆ CutsceneGhost()

static Effect Anvil.API.Effect.CutsceneGhost ( )
inlinestatic

Creates an effect that allows creatures to pathfind through other creatures without bumping.

◆ CutsceneImmobilize()

static Effect Anvil.API.Effect.CutsceneImmobilize ( )
inlinestatic

Creates an effect that will prevent the target from moving, but can otherwise act unpenalized. The cutscene version bypasses immunities and cannot be resisted.

◆ CutsceneParalyze()

static Effect Anvil.API.Effect.CutsceneParalyze ( )
inlinestatic

Creates an effect that is guaranteed to paralyze a creature, but can not be resisted.

◆ Damage()

static Effect Anvil.API.Effect.Damage ( int  amount,
DamageType  damageType = DamageType.Magical 
)
inlinestatic

Creates an effect that immediately applies damage to a target.

Parameters
amountThe amount of damage to apply.
damageTypeThe damage type to apply.

◆ DamageDecrease()

static Effect Anvil.API.Effect.DamageDecrease ( int  penalty,
DamageType  damageType = DamageType.Magical 
)
inlinestatic

Creates an effect that applies a penalty to a specified damage type.

Parameters
penaltyThe damage penalty to apply.
damageTypeThe damage type to apply the penalty to.

◆ DamageImmunityDecrease()

static Effect Anvil.API.Effect.DamageImmunityDecrease ( DamageType  damageType,
int  pctImmunity 
)
inlinestatic

Creates an effect that decreases immunity to a certain damage type.
If a creature does not have an immunity to the specified type, the creature will instead become more vulnerable to the damage, to a max of 100% (double damage).

Parameters
damageTypeThe type of damage to decrease immunity against.
pctImmunityA positive number representing the percentage decrease (1-100).

◆ DamageImmunityIncrease()

static Effect Anvil.API.Effect.DamageImmunityIncrease ( DamageType  damageType,
int  pctImmunity 
)
inlinestatic

Creates an effect that increases immunity to a certain damage type, to a max of 100% (complete immunity).

Parameters
damageTypeThe type of damage to increase immunity against.
pctImmunityA positive number representing the percentage increase (1-100).

◆ DamageIncrease()

static Effect Anvil.API.Effect.DamageIncrease ( int  bonus,
DamageType  damageType = DamageType.Magical 
)
inlinestatic

Creates an effect that applies a bonus to a specified damage type.

Parameters
bonusThe damage bonus to apply.
damageTypeThe damage type to apply the bonus to.

◆ DamageReduction()

static Effect Anvil.API.Effect.DamageReduction ( int  amount,
DamagePower  damagePower,
int  totalAbsorb = 0,
bool  rangedOnly = false 
)
inlinestatic

Creates an effect that resists a constant amount of damage from a physical attack with a certain magical power.

Parameters
amountThe damage to remove from each attack.
damagePowerThe max enchantment/power bonus of the weapon this effect will resist.
totalAbsorbThe total amount of damage to absorb, before the effect is removed (0 = infinite).
rangedOnlySet to true to have this damage reduction effect only apply to ranged attacks.

◆ DamageResistance()

static Effect Anvil.API.Effect.DamageResistance ( DamageType  damageType,
int  amount,
int  totalAbsorb = 0,
bool  rangedOnly = false 
)
inlinestatic

Creates an effect that resists a constant amount of damage from a specific damage type.

Parameters
damageTypeThe type of damage to resist.
amountThe damage to remove from each attack.
totalAbsorbThe total amount of damage to absorb, before the effect is removed (0 = infinite).
rangedOnlySet to true to have this damage resistance effect only apply to ranged attacks.

◆ DamageShield()

static Effect Anvil.API.Effect.DamageShield ( int  damageAmount,
DamageBonus  randomAmount,
DamageType  damageType 
)
inlinestatic

Creates an effect that reflects damage to melee attackers from successful hits.

Parameters
damageAmountThe flat amount of damage to reflect back to the attacker.
randomAmountA special damage amount to additionally reflect back to the attacker.
damageTypeThe type of the damage reflected to the attacker.

◆ Darkness()

static Effect Anvil.API.Effect.Darkness ( )
inlinestatic

Creates an effect that shrouds an area in darkness, applying a miss chance to all those standing within.
Creatures with an Ultravision effect will bypass this miss chance.

◆ Dazed()

static Effect Anvil.API.Effect.Dazed ( )
inlinestatic

Creates an effect that dazes a creature, preventing all actions but walking movement.

◆ Deaf()

static Effect Anvil.API.Effect.Deaf ( )
inlinestatic

Creates an effect that deafens a creature, applying a 20% spell failure chance for spells with (V)erbal components.

◆ Death()

static Effect Anvil.API.Effect.Death ( bool  spectacularDeath = false,
bool  feedback = true 
)
inlinestatic

Creates an effect that kills, or destroys an object.

Parameters
spectacularDeathIf true, the object in which this is applied will die in an extraordinary fashion (gibs).
feedbackIf false, excludes the "XXX: Dead" feedback message.

◆ Disappear()

static Effect Anvil.API.Effect.Disappear ( )
inlinestatic

Creates an effect that causes the object to "fly away", before destroying itself.
This effect should not be applied to PCs.

◆ DisappearAppear()

static Effect Anvil.API.Effect.DisappearAppear ( Location  location,
int  animationType = 1 
)
inlinestatic

Creates an effect that causes the object to "fly away", before appearing in another location.

Parameters
locationThe new location to re-appear at.
animationTypeThe appear/disappear animation nto use.

◆ Disease()

static Effect Anvil.API.Effect.Disease ( DiseaseType  diseaseType)
inlinestatic

Creates an effect that applies a disease to a creature.

Parameters
diseaseTypeThe type of disease to apply.

◆ DispelMagicAll()

static Effect Anvil.API.Effect.DispelMagicAll ( int  casterLevel)
inlinestatic

Creates an effect that attempts to strip all (Sp)ell effects on a target, up to a specified caster level.
(Su)pernatural and (Ex)traordinary effects can never be dispelled.

Parameters
casterLevelThe max (inclusive) caster level of spell to dispel.

◆ DispelMagicBest()

static Effect Anvil.API.Effect.DispelMagicBest ( int  casterLevel)
inlinestatic

Creates an effect that will attempt to strip the highest level spell effect on a target, up to a specified caster level.

Parameters
casterLevelThe max (inclusive) caster level of spell to dispel.

◆ Dominated()

static Effect Anvil.API.Effect.Dominated ( )
inlinestatic

Creates a dominate effect.
A dominated creature is added to the effect creators party. This means they will become instantly friendly and not attack each other, and they are treated as a normal friend as a henchman would be.

◆ EnemyAttackBonus()

static Effect Anvil.API.Effect.EnemyAttackBonus ( int  bonus)
inlinestatic

Creates an effect that gives a creature with melee/ranged/touched attacks a bonus to hit.

Parameters
bonusThe additional attack bonus.

◆ Entangle()

static Effect Anvil.API.Effect.Entangle ( )
inlinestatic

Creates an effect that prevents all movement, and applies a -2 to all attacks and a -4 to AC.

◆ Ethereal()

static Effect Anvil.API.Effect.Ethereal ( )
inlinestatic

Creates an effect that causes the creature to become invisible and un-perceivable, and taking on an ethereal appearance.
The effect is cancelled when the creature performs a hostile action.

◆ ForceWalk()

static Effect Anvil.API.Effect.ForceWalk ( )
inlinestatic

Creates an effect that forces creatures to always walk.

◆ Frightened()

static Effect Anvil.API.Effect.Frightened ( )
inlinestatic

Creates a frightened effect for use in making creatures shaken or flee.

◆ Haste()

static Effect Anvil.API.Effect.Haste ( )
inlinestatic

Creates a haste effect.
Haste effects add +4 dodge AC, +1 action/round and 50% movement speed increase.

◆ Heal()

static Effect Anvil.API.Effect.Heal ( int  damageToHeal)
inlinestatic

Creates a heal effect that will heal the object it is applied to by the specified damage amount.

Parameters
damageToHealThe amount of damage to heal.

◆ HitPointChangeWhenDying()

static Effect Anvil.API.Effect.HitPointChangeWhenDying ( float  hpChangePerRound)
inlinestatic

Creates a special effect for healing/damaging dying players.

Parameters
hpChangePerRoundThe HP change each round.

◆ Icon()

static Effect Anvil.API.Effect.Icon ( EffectIconTableEntry  icon)
inlinestatic

Creates an icon effect. Icons appear in the top right and in the character sheet and examine panels.

Parameters
iconThe icon to display.

◆ Immunity()

static Effect Anvil.API.Effect.Immunity ( ImmunityType  immunityType)
inlinestatic

Creates an immunity effect. This provides immunity to a specific effect type.

Parameters
immunityTypeThe type of immunity.

◆ Invisibility()

static Effect Anvil.API.Effect.Invisibility ( InvisibilityType  invisibilityType)
inlinestatic

Creates an invisiblity effect. Behaviour is defined from the specified invisibility type.

Parameters
invisibilityTypeThe type of invisibility to apply.

◆ Knockdown()

static Effect Anvil.API.Effect.Knockdown ( )
inlinestatic

Creates a knockdown effect. This effect knocks creatures off their feet, they will sit until the effect is removed.

◆ LinkEffects()

static Effect Anvil.API.Effect.LinkEffects ( Effect  baseEffect,
params Effect[]  effects 
)
inlinestatic

Creates a new linked effect from the specified effects.
If you remove/dispel one of the effects from a target which is linked to others, the other linked effects will be removed/dispelled too.

Parameters
baseEffectThe base effect.
effectsThe effects to link.
Returns
The new composite effect linking both effects.

◆ MissChance()

static Effect Anvil.API.Effect.MissChance ( int  missPct,
MissChanceType  missChanceType = MissChanceType.Normal 
)
inlinestatic

Creates a new effect used to hinder the attacks of the creature it is applied to.

Parameters
missPctA positive number representing the percentage chance to miss.
missChanceTypeThe type of attack that will have the hindered attack.

◆ ModifyAttacks()

static Effect Anvil.API.Effect.ModifyAttacks ( int  numAttacks)
inlinestatic

Creates an effect that modifies the amount of attacks a creature can perform.

Parameters
numAttacksThe number of attacks to add to the target (max 5).

◆ MovementSpeedDecrease()

static Effect Anvil.API.Effect.MovementSpeedDecrease ( int  pctChange)
inlinestatic

Creates an effect that reduces the movement speed of a creature.

Parameters
pctChangeA positive number representing the percentage speed to decrease (0-99)

◆ MovementSpeedIncrease()

static Effect Anvil.API.Effect.MovementSpeedIncrease ( int  pctChange)
inlinestatic

Creates an effect that increases the movement speed of a creature.

Parameters
pctChangeA positive number representing the percentage speed to increase (0-99)

◆ NegativeLevel()

static Effect Anvil.API.Effect.NegativeLevel ( int  numLevels)
inlinestatic

Creates an effect that will "decrease" the level of the target.

Parameters
numLevelsThe number of negative levels to apply.

◆ Pacified()

static Effect Anvil.API.Effect.Pacified ( )
inlinestatic

Creates an effect that pacifies a creature, making them unable to do attacks.

◆ Paralyze()

static Effect Anvil.API.Effect.Paralyze ( )
inlinestatic

Creates a paralyze effect.

Paralysis is not a mind effect - it stops all movement (and also in-game pauses the creature in their current action), and so they are prone, have no dexterity or strength (act as if had the lowest, 3) and all sneak attacks work against them.
By default creatures level 4 and below in 10 meters can be "coup de grace" ie instantly killed on a successful hit.

◆ Petrify()

static Effect Anvil.API.Effect.Petrify ( )
inlinestatic

Creates an effect that will petrify a creature. It is similar to Paralyze, but also applies the VfxType.DurPetrify visual effect.

◆ Poison()

static Effect Anvil.API.Effect.Poison ( PoisonType  poisonType)
inlinestatic

Creates a poison effect that sets the poisoned status effect, with varying penalties based on the type chosen.

Parameters
poisonTypeThe type of poison to apply.

◆ Polymorph()

static Effect Anvil.API.Effect.Polymorph ( PolymorphTableEntry  polymorphType,
bool  locked = false 
)
inlinestatic

Creates a polymorph effect that changes the target into a different kind of creature.

Parameters
polymorphTypeThe polymorph to apply.
lockedIf true, players cannot dismiss the polymorph effect.

◆ Regenerate()

static Effect Anvil.API.Effect.Regenerate ( int  amountPerInterval,
TimeSpan  interval 
)
inlinestatic

Creates a regeneration effect that will cause the target to heal the specified amount at each interval.

Parameters
amountPerIntervalThe amount to heal.
intervalThe interval at which the healing is applied.

◆ Resurrection()

static Effect Anvil.API.Effect.Resurrection ( )
inlinestatic

Creates an effect that raises a creature who is dead to 1 hit point.

◆ RunAction()

static Effect Anvil.API.Effect.RunAction ( ScriptCallbackHandle onAppliedHandle = null,
ScriptCallbackHandle onRemovedHandle = null,
ScriptCallbackHandle onIntervalHandle = null,
TimeSpan  interval = default,
string  data = "" 
)
inlinestatic

Creates a custom scripted effect.

Parameters
onAppliedHandleThe callback to invoke when this effect is applied.
onRemovedHandleThe callback to invoke when this effect is removed (via script, death, resting, or dispelling).
onIntervalHandleThe callback to invoke per interval.
intervalThe interval in which to call onIntervalHandle.
dataOptional string of data saved with the effect, retrievable with Effect.StringParams[0].

◆ Sanctuary()

static Effect Anvil.API.Effect.Sanctuary ( int  difficultyClass)
inlinestatic

Creates a sanctuary effect. Sanctuary effects work similar to invisibility effects, but also cause creatures to be unable to hear the target creature, if they fail the DC.

Parameters
difficultyClassThe difficulty class for other creatures to beat the effect, allowing them to see and hear the creature.

◆ SavingThrowDecrease()

static Effect Anvil.API.Effect.SavingThrowDecrease ( SavingThrow  savingThrow,
int  amount,
SavingThrowType  savingThrowType = SavingThrowType.All 
)
inlinestatic

Creates an effect to decrease one saving throw type.

Parameters
savingThrowThe saving throw to decrease.
amountThe amount to decrease the saving throw.
savingThrowTypeThe saving throw sub-type to decrease.

◆ SavingThrowIncrease()

static Effect Anvil.API.Effect.SavingThrowIncrease ( SavingThrow  savingThrow,
int  amount,
SavingThrowType  savingThrowType = SavingThrowType.All 
)
inlinestatic

Creates an effect to increase one saving throw type.

Parameters
savingThrowThe saving throw to increase.
amountThe amount to increase the saving throw.
savingThrowTypeThe saving throw sub-type to increase.

◆ SeeInvisible()

static Effect Anvil.API.Effect.SeeInvisible ( )
inlinestatic

Creates an effect that allows a creature to see through magical invisibility.

◆ Silence()

static Effect Anvil.API.Effect.Silence ( )
inlinestatic

Creates an effect that silences a creature. Silent creatures may not cast spell with verbal components.

◆ SkillDecrease()

static Effect Anvil.API.Effect.SkillDecrease ( NwSkill  skill,
int  amount 
)
inlinestatic

Creates an effect that decreases a specific skill score.

Parameters
skillThe skill to decrease.
amountThe amount to decrease the skill by.

◆ SkillDecreaseAll()

static Effect Anvil.API.Effect.SkillDecreaseAll ( int  amount)
inlinestatic

Creates an effect that decreases all skill scores.

Parameters
amountThe amount to decrease all skills by.

◆ SkillIncrease()

static Effect Anvil.API.Effect.SkillIncrease ( NwSkill  skill,
int  amount 
)
inlinestatic

Creates an effect that increases a specific skill score.

Parameters
skillThe skill to increase.
amountThe amount to increase the skill by.

◆ SkillIncreaseAll()

static Effect Anvil.API.Effect.SkillIncreaseAll ( int  amount)
inlinestatic

Creates an effect that increases all skill scores.

Parameters
amountThe amount to increase all skills by.

◆ Sleep()

static Effect Anvil.API.Effect.Sleep ( )
inlinestatic

Creates a sleep effect. Sleeping creatures may not act, and are subject to coup de grace (4 or less HD)

◆ Slow()

static Effect Anvil.API.Effect.Slow ( )
inlinestatic

Creates a slow effect. Slowed creatures have no benefits from any haste applied to them, or if they have no haste, have 1 attack per round, -2 AC, -2 attack, -2 Reflex Saving Throw, and -50% movement speed.

◆ SpellFailure()

static Effect Anvil.API.Effect.SpellFailure ( int  failPct,
SpellSchool  spellSchool = SpellSchool.General 
)
inlinestatic

Creates an effect that inhibits spells.

Parameters
failPctA positive number representing the percent chance of spell failing (1-100)
spellSchoolThe spell school that is affected.

◆ SpellImmunity()

static Effect Anvil.API.Effect.SpellImmunity ( Spell  spell = API.Spell.AllSpells)
inlinestatic

Creates an effect that provides immunity to a specific spell

Parameters
spellThe spell to provide immunity for.

◆ SpellLevelAbsorption()

static Effect Anvil.API.Effect.SpellLevelAbsorption ( int  maxSpellLevel,
int  totalSpellsAbsorbed = 0,
SpellSchool  spellSchool = SpellSchool.General 
)
inlinestatic

Creates an effect that absorbs a certain amount of spells.

Parameters
maxSpellLevelThe max level spell that can be absorbed.
totalSpellsAbsorbedThe total number of spells that can be absorbed.
spellSchoolThe spell school to absorb specifically.

◆ SpellResistanceDecrease()

static Effect Anvil.API.Effect.SpellResistanceDecrease ( int  amount)
inlinestatic

Creates an effect that decreases the spell resistance of a creature.

Parameters
amountThe amount to decrease.

◆ SpellResistanceIncrease()

static Effect Anvil.API.Effect.SpellResistanceIncrease ( int  amount)
inlinestatic

Creates an effect that increases the spell resistance of a creature.

Parameters
amountThe amount to increase.

◆ Stunned()

static Effect Anvil.API.Effect.Stunned ( )
inlinestatic

Creates a stun effect. This is a mind-effecting effect, and so immunity to mind effects prevents this from working.
Stunned creatures are flat-footed (no AC dex bonus), and cannot move.

◆ SummonCreature()

static Effect Anvil.API.Effect.SummonCreature ( string  creatureResRef,
VfxType  vfxType,
TimeSpan  delay = default,
int  appearType = 0 
)
inlinestatic

Creates an effect to summon a creature.
THIS IS OBJECT CONTEXT SENSITIVE! Use NwObject.WaitForObjectContext to correctly assign the right owner of the master.

Parameters
creatureResRefThe template/ResRef of the creature to summon.
vfxTypeA visual effect to display upon summoning.
delayA delay between the visual effect, and the creature actually being added to the area.
appearTypeThe appear animation to use.

◆ Swarm()

static Effect Anvil.API.Effect.Swarm ( bool  loop,
string  creatureTemplate1,
string  creatureTemplate2 = "",
string  creatureTemplate3 = "",
string  creatureTemplate4 = "" 
)
inlinestatic

Creates a swarm effect. This is exactly the same as SummonCreature, except, after one dies, another takes its place.

Parameters
loopIf true, while the effect is active and the last creature dies, it will loop back to the first template.
creatureTemplate1The blueprint of the first creature to spawn.
creatureTemplate2The blueprint of the second creature to spawn.
creatureTemplate3The blueprint of the third creature to spawn.
creatureTemplate4The blueprint of the fourth creature to spawn.

◆ TemporaryHitpoints()

static Effect Anvil.API.Effect.TemporaryHitpoints ( int  hitPoints)
inlinestatic

Creates an effect that will give temporary hitpoints to a target.

Parameters
hitPointsThe amount of temporary hit points to add.

◆ TimeStop()

static Effect Anvil.API.Effect.TimeStop ( )
inlinestatic

Creates a time stop effect.
Time stop applies a special module-wide pause which only the object it is applied to (and DM's) can move and cast spells without penalties or hindrance.
This is not recommended for multiplayer games as it will cause everyone in the module to pause.
You can query the current timestop state with NwServer.IsTimestopPaused.

◆ TimeStopImmunity()

static Effect Anvil.API.Effect.TimeStopImmunity ( )
inlinestatic

Creates a time stop immunity effect.
Immunity allows objects to continue taking actions during an active time stop effect.

◆ TrueSeeing()

static Effect Anvil.API.Effect.TrueSeeing ( )
inlinestatic

Creates a true seeing effect. Creatures with true sight can see through stealth, invisibility, sanctuary and darkness.

◆ Turned()

static Effect Anvil.API.Effect.Turned ( )
inlinestatic

Creates a turned effect. Turning bypass all fear immunity effects, but should only be used in the turn undead script.

◆ TurnResistanceDecrease()

static Effect Anvil.API.Effect.TurnResistanceDecrease ( int  hitDiceDecrease)
inlinestatic

Creates an effect that decreases a creature's turn resistance, making them more susceptible to turning.

Parameters
hitDiceDecreaseA positive number representing the number of hit dice to decrease.

◆ TurnResistanceIncrease()

static Effect Anvil.API.Effect.TurnResistanceIncrease ( int  hitDiceIncrease)
inlinestatic

Creates an effect that increases a creature's turn resistance, making them more resistant to turning.

Parameters
hitDiceIncreaseA positive number representing the number of hit dice to increase.

◆ Ultravision()

static Effect Anvil.API.Effect.Ultravision ( )
inlinestatic

Creates an Ultravision effect. Ultravision lets the target see through Darkness and Invisibility effects with InvisibilityType.Darkness.

◆ VisualEffect() [1/2]

static Effect Anvil.API.Effect.VisualEffect ( VfxType  visualEffectId,
bool  missEffect = false,
float  fScale = 1.0f,
System.Numerics.Vector3  vTranslate = default,
System.Numerics.Vector3  vRotate = default 
)
inlinestatic

Creates an effect that plays a visual effect when applied.

Parameters
visualEffectIdThe visual effect to apply.
missEffectIf true, a random vector near or past the target will be generated, as the location for the effect.
fScaleA scaling factor to apply to the visual effect.
vTranslateA translation vector transform to apply to the visual effect.
vRotateA rotation vector transform to apply to the visual effect.

◆ VisualEffect() [2/2]

static Effect Anvil.API.Effect.VisualEffect ( VisualEffectTableEntry  visualEffect,
bool  missEffect = false,
float  fScale = 1.0f,
System.Numerics.Vector3  vTranslate = default,
System.Numerics.Vector3  vRotate = default 
)
inlinestatic

Creates an effect that plays a visual effect when applied.

Parameters
visualEffectThe visual effect to apply.
missEffectIf true, a random vector near or past the target will be generated, as the location for the effect.
fScaleA scaling factor to apply to the visual effect.
vTranslateA translation vector transform to apply to the visual effect.
vRotateA rotation vector transform to apply to the visual effect.

Property Documentation

◆ DurationRemaining

float Anvil.API.Effect.DurationRemaining
get

Gets the remaining duration of this effect in seconds. Returns 0 if the duration type is not EffectDuration.Temporary.

◆ DurationType

EffectDuration Anvil.API.Effect.DurationType
getset

Gets or sets the duration type (Temporary, Instant, Permanent) of this effect.

◆ EffectType

EffectType Anvil.API.Effect.EffectType
get

Gets the type of this effect.

◆ IgnoreImmunity

bool Anvil.API.Effect.IgnoreImmunity
getset

Gets or sets if this effect should ignore immunities.

◆ LinkId

string Anvil.API.Effect.LinkId
get

Gets the link id of this effect, if it is a linked effect. There is no guarantees about this identifier other than it is unique and the same for all effects linked to it.

◆ SubType

EffectSubType Anvil.API.Effect.SubType
getset

Gets or sets the subtype of this effect.

◆ Tag

string? Anvil.API.Effect.Tag
getset

Gets or sets the tag for this effect.

◆ TotalDuration

float Anvil.API.Effect.TotalDuration
get

Gets the total duration of this effect in seconds. Returns 0 if the duration type is not EffectDuration.Temporary.


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