Anvil
Anvil.API.ItemProperty Class Reference

Represents an item property effect engine structure. More...

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

Static Public Member Functions

static ItemProperty AbilityBonus (IPAbility ability, int bonus)
 
static ItemProperty ACBonus (int bonus)
 
static ItemProperty ACBonusVsAlign (IPAlignmentGroup alignmentGroup, int bonus)
 
static ItemProperty ACBonusVsDmgType (IPDamageType damageType, int bonus)
 
static ItemProperty ACBonusVsRace (IPRacialType racialType, int bonus)
 
static ItemProperty ACBonusVsRace (NwRace race, int bonus)
 
static ItemProperty ACBonusVsSAlign (IPAlignment alignment, int bonus)
 
static ItemProperty Additional (IPAdditional additional)
 
static ItemProperty ArcaneSpellFailure (IPArcaneSpellFailure spellFailure)
 
static ItemProperty AttackBonus (int bonus)
 
static ItemProperty AttackBonusVsAlign (IPAlignmentGroup alignmentGroup, int bonus)
 
static ItemProperty AttackBonusVsRace (IPRacialType racialType, int bonus)
 
static ItemProperty AttackBonusVsRace (NwRace race, int bonus)
 
static ItemProperty AttackBonusVsSAlign (IPAlignment alignment, int bonus)
 
static ItemProperty AttackPenalty (int penalty)
 
static ItemProperty BonusFeat (IPFeat feat)
 
static ItemProperty BonusLevelSpell (IPClass classType, IPSpellLevel spellLevel)
 
static ItemProperty BonusSavingThrow (IPSaveBaseType saveType, int bonus)
 
static ItemProperty BonusSavingThrowVsX (IPSaveVs saveType, int bonus)
 
static ItemProperty BonusSpellResistance (IPSpellResistanceBonus resistBonus)
 
static ItemProperty CastSpell (IPCastSpell spell, IPCastSpellNumUses uses)
 
static ItemProperty ContainerReducedWeight (IPContainerWeightReduction weightReduction)
 
static ItemProperty Custom (int type, int subType=-1, int costTableValue=-1, int param1Value=-1)
 
static ItemProperty Custom (ItemPropertyTableEntry property, ItemPropertySubTypeTableEntry? subType=null, ItemPropertyCostTableEntry? costTableValue=null, ItemPropertyParamTableEntry? paramTableValue=null)
 
static ItemProperty DamageBonus (IPDamageType damageType, IPDamageBonus damageBonus)
 
static ItemProperty DamageBonusVsAlign (IPAlignmentGroup alignmentGroup, IPDamageType damageType, IPDamageBonus damageBonus)
 
static ItemProperty DamageBonusVsRace (IPRacialType racialType, IPDamageType damageType, IPDamageBonus damageBonus)
 
static ItemProperty DamageBonusVsRace (NwRace race, IPDamageType damageType, IPDamageBonus damageBonus)
 
static ItemProperty DamageBonusVsSAlign (IPAlignment alignment, IPDamageType damageType, IPDamageBonus damageBonus)
 
static ItemProperty DamageImmunity (IPDamageType damageType, IPDamageImmunityType immunityType)
 
static ItemProperty DamagePenalty (int penalty)
 
static ItemProperty DamageReduction (IPDamageReduction damageReduction, IPDamageSoak damageSoak)
 
static ItemProperty DamageResistance (IPDamageType damageType, IPDamageResist damageResist)
 
static ItemProperty DamageVulnerability (IPDamageType damageType, IPDamageVulnerabilityType damageVulnerability)
 
static ItemProperty Darkvision ()
 
static ItemProperty DecreaseAbility (IPAbility ability, int penalty)
 
static ItemProperty DecreaseAC (IPACModifierType modifierType, int penalty)
 
static ItemProperty DecreaseSkill (NwSkill skill, int penalty)
 
static ItemProperty EnhancementBonus (int bonus)
 
static ItemProperty EnhancementBonusVsAlign (IPAlignmentGroup alignmentGroup, int bonus)
 
static ItemProperty EnhancementBonusVsRace (IPRacialType racialType, int bonus)
 
static ItemProperty EnhancementBonusVsRace (NwRace race, int bonus)
 
static ItemProperty EnhancementBonusVsSAlign (IPAlignment alignment, int bonus)
 
static ItemProperty EnhancementPenalty (int penalty)
 
static ItemProperty ExtraMeleeDamageType (IPDamageType damageType)
 
static ItemProperty ExtraRangeDamageType (IPDamageType damageType)
 
static ItemProperty FreeAction ()
 
static ItemProperty Haste ()
 
static ItemProperty HealersKit (int level)
 
static ItemProperty HolyAvenger ()
 
static ItemProperty ImmunityMisc (IPMiscImmunity immunityType)
 
static ItemProperty ImmunityToSpellLevel (IPSpellLevel spellLevel)
 
static ItemProperty ImprovedEvasion ()
 
static ItemProperty Keen ()
 
static ItemProperty Light (IPLightBrightness brightness, IPLightColor color)
 
static ItemProperty LimitUseByAlign (IPAlignmentGroup alignmentGroup)
 
static ItemProperty LimitUseByClass (IPClass classType)
 
static ItemProperty LimitUseByClass (NwClass classType)
 
static ItemProperty LimitUseByRace (IPRacialType racialType)
 
static ItemProperty LimitUseByRace (NwRace race)
 
static ItemProperty LimitUseBySAlign (IPAlignment alignment)
 
static ItemProperty MassiveCritical (IPDamageBonus damageBonus)
 
static ItemProperty Material (int materialType)
 
static ItemProperty MaxRangeStrengthMod (int modifier)
 
static ItemProperty MonsterDamage (IPMonsterDamage monsterDamage)
 
static ItemProperty NoDamage ()
 
static ItemProperty OnHitCastSpell (IPCastSpell spell, IPSpellLevel spellLevel)
 
static ItemProperty OnHitEffect (IPOnHitSaveDC saveDC, HitEffect effect)
 
static ItemProperty OnMonsterHitProperties (MonsterHitEffect effect)
 
static implicit operator ItemProperty? (IntPtr intPtr)
 
static ItemProperty Quality (IPQuality quality)
 
static ItemProperty ReducedSavingThrow (IPSaveBaseType saveType, int penalty)
 
static ItemProperty ReducedSavingThrowVsX (IPSaveVs saveType, int penalty)
 
static ItemProperty Regeneration (int regenAmount)
 
static ItemProperty SkillBonus (NwSkill skill, int bonus)
 
static ItemProperty SpecialWalk ()
 
static ItemProperty SpellImmunitySchool (IPSpellSchool spellSchool)
 
static ItemProperty SpellImmunitySpecific (IPSpellImmunity spell)
 
static ItemProperty ThievesTools (int modifier)
 
static ItemProperty Trap (IPTrapStrength trapStrength, IPTrapType trapType)
 
static ItemProperty TrueSeeing ()
 
static ItemProperty TurnResistance (int modifier)
 
static ItemProperty UnlimitedAmmo (IPUnlimitedAmmoType ammoType=IPUnlimitedAmmoType.Basic)
 
static ItemProperty VampiricRegeneration (int regenAmount)
 
static ItemProperty VisualEffect (ItemVisual itemVisual)
 
static ItemProperty WeightIncrease (IPWeightIncrease weightIncrease)
 
static ItemProperty WeightReduction (IPReducedWeight weightReduction)
 
- 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

TwoDimArray< ItemPropertyCostTableEntry >? CostTable [get]
 Gets the cost table used by this item property. More...
 
ItemPropertyCostTableEntry????? CostTableValue [get, set]
 Gets or sets the cost table entry that is set for this item property.
More...
 
EffectDuration DurationType [get, set]
 Gets or sets whether this item property is a permanent or temporary effect. More...
 
TwoDimArray< ItemPropertyParamTableEntry >? Param1Table [get]
 Gets the #1 param table used by this item property. More...
 
ItemPropertyParamTableEntry????? Param1TableValue [get, set]
 Gets or sets the #1 param table entry that is set for this item property.
More...
 
ItemPropertyTableEntry Property [get]
 Gets the base item property used to create this item property. More...
 
TimeSpan RemainingDuration [get]
 Gets the remaining duration until the item property expires (if this item property is temporary). Otherwise, returns TimeSpan.Zero. More...
 
override int StructureId [get]
 
ItemPropertySubTypeTableEntry????? SubType [get, set]
 Gets or sets the sub type that is set on this item property. More...
 
TwoDimArray< ItemPropertySubTypeTableEntry >? SubTypeTable [get]
 Gets the sub type table used by this item property. More...
 
string? Tag [get, set]
 Gets or sets the tag for this item property. More...
 
TimeSpan TotalDuration [get]
 Gets the total duration of the item property effect (if this item property is temporary). Otherwise, returns TimeSpan.Zero. More...
 
bool Usable [get, set]
 
int UsesPerDay [get, set]
 
bool Valid [get]
 Gets a value indicating whether this item property is valid. 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

- Public Member Functions inherited from Anvil.API.EngineStructure
void Dispose ()
 
- 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 item property effect engine structure.

Examples

/*
* Examples for creating, applying and removing item properties.
*/
using Anvil.API;
namespace NWN.Anvil.Samples
{
[ServiceBinding(typeof(ItemPropertyExamples))]
public class ItemPropertyExamples
{
// Most item properties can be declared as fields. This allows you to reuse effects, rather than creating them every time.
private readonly ItemProperty hasteProperty = ItemProperty.Haste();
public ItemPropertyExamples()
{
NwModule.Instance.OnItemEquip += TemporaryHasteExample;
NwModule.Instance.OnClientEnter += RemoveItemPropertyExample;
}
private void TemporaryHasteExample(OnItemEquip eventData)
{
// Check if the tag matches the item that was equipped.
if (eventData.Item.Tag == "temp_haste")
{
// Apply the haste item property.
eventData.Item.AddItemProperty(hasteProperty, EffectDuration.Temporary, NwTimeSpan.FromRounds(5));
}
}
private void RemoveItemPropertyExample(ModuleEvents.OnClientEnter eventData)
{
// Find an item in the player's inventory with the tag "sword_special"
NwItem? item = eventData.Player.ControlledCreature!.FindItemWithTag("sword_special");
// If they don't have the item, early return.
if (item == null)
{
return;
}
// Loop over the item's properties. Remove any that have a matching tag.
foreach (ItemProperty property in item.ItemProperties)
{
if (property.Tag == "special_temp")
{
item.RemoveItemProperty(property);
}
}
}
}
}

Property Documentation

◆ CostTable

TwoDimArray<ItemPropertyCostTableEntry>? Anvil.API.ItemProperty.CostTable
get

Gets the cost table used by this item property.

◆ CostTableValue

ItemPropertyCostTableEntry????? Anvil.API.ItemProperty.CostTableValue
getset

Gets or sets the cost table entry that is set for this item property.

◆ DurationType

EffectDuration Anvil.API.ItemProperty.DurationType
getset

Gets or sets whether this item property is a permanent or temporary effect.

◆ Param1Table

TwoDimArray<ItemPropertyParamTableEntry>? Anvil.API.ItemProperty.Param1Table
get

Gets the #1 param table used by this item property.

◆ Param1TableValue

ItemPropertyParamTableEntry????? Anvil.API.ItemProperty.Param1TableValue
getset

Gets or sets the #1 param table entry that is set for this item property.

◆ Property

ItemPropertyTableEntry Anvil.API.ItemProperty.Property
get

Gets the base item property used to create this item property.

◆ RemainingDuration

TimeSpan Anvil.API.ItemProperty.RemainingDuration
get

Gets the remaining duration until the item property expires (if this item property is temporary). Otherwise, returns TimeSpan.Zero.

◆ SubType

ItemPropertySubTypeTableEntry????? Anvil.API.ItemProperty.SubType
getset

Gets or sets the sub type that is set on this item property.

◆ SubTypeTable

TwoDimArray<ItemPropertySubTypeTableEntry>? Anvil.API.ItemProperty.SubTypeTable
get

Gets the sub type table used by this item property.

◆ Tag

string? Anvil.API.ItemProperty.Tag
getset

Gets or sets the tag for this item property.

◆ TotalDuration

TimeSpan Anvil.API.ItemProperty.TotalDuration
get

Gets the total duration of the item property effect (if this item property is temporary). Otherwise, returns TimeSpan.Zero.

◆ Valid

bool Anvil.API.ItemProperty.Valid
get

Gets a value indicating whether this item property is valid.


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