Show / Hide Table of Contents

Class DaggerfallUnityItem

Parent class for any individual item in Daggerfall Unity.

Inheritance
Object
DaggerfallUnityItem
Implements
IMacroContextProvider
Namespace: DaggerfallWorkshop.Game.Items
Assembly: Assembly-CSharp.dll
Syntax
public class DaggerfallUnityItem : IMacroContextProvider

Constructors

| Improve this Doc View Source

DaggerfallUnityItem()

Default constructor. Generates new UID.

Declaration
public DaggerfallUnityItem()
| Improve this Doc View Source

DaggerfallUnityItem(ItemRecord)

Construct from legacy ItemRecord data. Generates new UID.

Declaration
public DaggerfallUnityItem(ItemRecord record)
Parameters
Type Name Description
ItemRecord record
| Improve this Doc View Source

DaggerfallUnityItem(DaggerfallUnityItem)

Construct from another item. Generates new UID.

Declaration
public DaggerfallUnityItem(DaggerfallUnityItem item)
Parameters
Type Name Description
DaggerfallUnityItem item
| Improve this Doc View Source

DaggerfallUnityItem(ItemGroups, Int32)

Construct from item group and index. Generates new UID.

Declaration
public DaggerfallUnityItem(ItemGroups itemGroup, int groupIndex)
Parameters
Type Name Description
ItemGroups itemGroup
Int32 groupIndex
| Improve this Doc View Source

DaggerfallUnityItem(ItemData_v1)

Construct item from serialized data. Used serialized UID.

Declaration
public DaggerfallUnityItem(ItemData_v1 itemData)
Parameters
Type Name Description
ItemData_v1 itemData

Item data to restore.

Fields

| Improve this Doc View Source

currentCondition

Declaration
public int currentCondition
Field Value
Type Description
Int32
| Improve this Doc View Source

customMagic

Declaration
public CustomEnchantment[] customMagic
Field Value
Type Description
CustomEnchantment[]
| Improve this Doc View Source

drawOrder

Declaration
public int drawOrder
Field Value
Type Description
Int32
| Improve this Doc View Source

dyeColor

Declaration
public DyeColors dyeColor
Field Value
Type Description
DyeColors
| Improve this Doc View Source

enchantmentPoints

Declaration
public int enchantmentPoints
Field Value
Type Description
Int32
| Improve this Doc View Source

flags

Declaration
public ushort flags
Field Value
Type Description
UInt16
| Improve this Doc View Source

legacyMagic

Declaration
public DaggerfallEnchantment[] legacyMagic
Field Value
Type Description
DaggerfallEnchantment[]
| Improve this Doc View Source

maxCondition

Declaration
public int maxCondition
Field Value
Type Description
Int32
| Improve this Doc View Source

message

Declaration
public int message
Field Value
Type Description
Int32
| Improve this Doc View Source

nativeMaterialValue

Declaration
public int nativeMaterialValue
Field Value
Type Description
Int32
| Improve this Doc View Source

poisonType

Declaration
public Poisons poisonType
Field Value
Type Description
Poisons
| Improve this Doc View Source

shortName

Declaration
public string shortName
Field Value
Type Description
String
| Improve this Doc View Source

stackCount

Declaration
public int stackCount
Field Value
Type Description
Int32
| Improve this Doc View Source

timeEffectsLastRerolled

Declaration
public uint timeEffectsLastRerolled
Field Value
Type Description
UInt32
| Improve this Doc View Source

timeHealthLeechLastUsed

Declaration
public uint timeHealthLeechLastUsed
Field Value
Type Description
UInt32
| Improve this Doc View Source

typeDependentData

Declaration
public byte typeDependentData
Field Value
Type Description
Byte
| Improve this Doc View Source

unknown

Declaration
public ushort unknown
Field Value
Type Description
UInt16
| Improve this Doc View Source

unknown2

Declaration
public byte unknown2
Field Value
Type Description
Byte
| Improve this Doc View Source

value

Declaration
public int value
Field Value
Type Description
Int32
| Improve this Doc View Source

weightInKg

Declaration
public float weightInKg
Field Value
Type Description
Single

Properties

| Improve this Doc View Source

ConditionPercentage

Gets current item condition as a percentage of max.

Declaration
public int ConditionPercentage { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

CurrentVariant

Gets current variant of this item.

Declaration
public virtual int CurrentVariant { get; set; }
Property Value
Type Description
Int32
| Improve this Doc View Source

CustomEnchantments

Gets custom enchantments on this item. Can be null or empty. Custom enchantments on items are stored and generated using an effectKey/customParam pair.

Declaration
public CustomEnchantment[] CustomEnchantments { get; }
Property Value
Type Description
CustomEnchantment[]
| Improve this Doc View Source

EquipSlot

Gets temp equip slot.

Declaration
public EquipSlots EquipSlot { get; set; }
Property Value
Type Description
EquipSlots
| Improve this Doc View Source

GroupIndex

Gets or sets item group index. Setting will reset item data from new template.

Declaration
public virtual int GroupIndex { get; set; }
Property Value
Type Description
Int32
| Improve this Doc View Source

HasCustomEnchantments

True is item has any custom enchantments.

Declaration
public bool HasCustomEnchantments { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

HasLegacyEnchantments

True if item has any legacy enchantments.

Declaration
public bool HasLegacyEnchantments { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

InventoryTextureArchive

Gets inventory texture archive.

Declaration
public virtual int InventoryTextureArchive { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

InventoryTextureRecord

Gets inventory texture record.

Declaration
public virtual int InventoryTextureRecord { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

IsArtifact

Checks if this item is an artifact.

Declaration
public bool IsArtifact { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsClothing

Checks if this item is clothing.

Declaration
public bool IsClothing { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsEnchanted

Checks if this item has magical properties.

Declaration
public virtual bool IsEnchanted { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsEquipped

Checks if this item is equipped.

Declaration
public bool IsEquipped { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsIdentified

Checks if this item is identified.

Declaration
public bool IsIdentified { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsIngredient

Checks if this is an ingredient.

Declaration
public bool IsIngredient { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsLightSource

Checks if this item is light source.

Declaration
public bool IsLightSource { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsParchment

Checks if this item is a parchment.

Declaration
public bool IsParchment { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPotion

Checks if this item is a potion.

Declaration
public bool IsPotion { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPotionRecipe

Checks if this item is a potion recipe.

Declaration
public bool IsPotionRecipe { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsQuestItem

Check if this is a quest item.

Declaration
public bool IsQuestItem { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsShield

Checks if this item is of any shield type.

Declaration
public bool IsShield { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsSummoned

Get flag checking if this is a summoned item. Summoned items have a specific future game time they expire. Non-summoned items have 0 in this field.

Declaration
public bool IsSummoned { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

ItemGroup

Gets or sets item group. Setting will reset item data from new template.

Declaration
public ItemGroups ItemGroup { get; set; }
Property Value
Type Description
ItemGroups
| Improve this Doc View Source

ItemName

Resolve this item's name.

Declaration
public virtual string ItemName { get; }
Property Value
Type Description
String
| Improve this Doc View Source

ItemTemplate

Get this item's template data.

Declaration
public ItemTemplate ItemTemplate { get; }
Property Value
Type Description
ItemTemplate
| Improve this Doc View Source

LegacyEnchantments

Gets legacy enchantments on this item. Can be null or empty. Legacy enchantments on items are stored and generated using the classic type/param enchantment format.

Declaration
public DaggerfallEnchantment[] LegacyEnchantments { get; }
Property Value
Type Description
DaggerfallEnchantment[]
| Improve this Doc View Source

LongName

Resolve this item's full name (mainly for tooltips).

Declaration
public virtual string LongName { get; }
Property Value
Type Description
String
| Improve this Doc View Source

NativeMaterialValue

Gets native material value.

Declaration
public virtual int NativeMaterialValue { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

PlayerTextureArchive

Gets or sets player texture archive. Used during item creation to set correct body morphology.

Declaration
public int PlayerTextureArchive { get; set; }
Property Value
Type Description
Int32
| Improve this Doc View Source

PotionRecipeKey

Gets/sets the key of the potion recipe allocated to this item. Has a side effect (ugh, sorry) of populating the item value from the recipe price. (due to value not being encapsulated) Also populates texture record for potions.

Declaration
public int PotionRecipeKey { get; set; }
Property Value
Type Description
Int32
| Improve this Doc View Source

QuestItemSymbol

Gets symbol of quest item inside quest.

Declaration
public Symbol QuestItemSymbol { get; }
Property Value
Type Description
Symbol
| Improve this Doc View Source

QuestUID

Gets quest UID of quest owning this item.

Declaration
public ulong QuestUID { get; }
Property Value
Type Description
UInt64
| Improve this Doc View Source

RepairData

Gets the repair data for this item.

Declaration
public ItemRepairData RepairData { get; }
Property Value
Type Description
ItemRepairData
| Improve this Doc View Source

TemplateIndex

Get this item's template index.

Declaration
public int TemplateIndex { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

TimeForItemToDisappear

Gets/sets the time for this item to disappear.

Declaration
public uint TimeForItemToDisappear { get; set; }
Property Value
Type Description
UInt32
| Improve this Doc View Source

TotalVariants

Gets total variants of this item.

Declaration
public int TotalVariants { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

TrappedSoulType

Gets/sets the soul trapped in a soul trap.

Declaration
public MobileTypes TrappedSoulType { get; set; }
Property Value
Type Description
MobileTypes
| Improve this Doc View Source

UID

Gets generated unique identifier.

Declaration
public ulong UID { get; }
Property Value
Type Description
UInt64
| Improve this Doc View Source

WorldTextureArchive

Gets or sets world texture archive. This is the generic texture shown when item is used in world by itself, typically for quests.

Declaration
public int WorldTextureArchive { get; set; }
Property Value
Type Description
Int32
| Improve this Doc View Source

WorldTextureRecord

Gets or sets world texture record. This is the generic texture shown when item is used in world by itself, typically for quests.

Declaration
public int WorldTextureRecord { get; set; }
Property Value
Type Description
Int32

Methods

| Improve this Doc View Source

Clone()

Creates a new copy of this item.

Declaration
public DaggerfallUnityItem Clone()
Returns
Type Description
DaggerfallUnityItem

Cloned item.

| Improve this Doc View Source

CompareItems(DaggerfallUnityItem, DaggerfallUnityItem)

Compares two items for equal UID. One or both items can be null.

Declaration
public static bool CompareItems(DaggerfallUnityItem item1, DaggerfallUnityItem item2)
Parameters
Type Name Description
DaggerfallUnityItem item1

First item.

DaggerfallUnityItem item2

Second item.

Returns
Type Description
Boolean

True if items have same UID.

| Improve this Doc View Source

ContainsEnchantment(EnchantmentTypes, Int16)

Check if item contains a specific legacy enchantment.

Declaration
public bool ContainsEnchantment(EnchantmentTypes type, short param)
Parameters
Type Name Description
EnchantmentTypes type

Legacy type.

Int16 param

Legacy param.

Returns
Type Description
Boolean

True if item contains enchantment.

| Improve this Doc View Source

ContainsEnchantment(String, String)

Check if item contains a specific custom enchantment.

Declaration
public bool ContainsEnchantment(string key, string param)
Parameters
Type Name Description
String key

Effect key.

String param

Effect param.

Returns
Type Description
Boolean

True if item contains enchantment.

| Improve this Doc View Source

EffectiveUnitWeightInKg()

Declaration
public float EffectiveUnitWeightInKg()
Returns
Type Description
Single
| Improve this Doc View Source

GetBaseDamageMax()

Declaration
public virtual int GetBaseDamageMax()
Returns
Type Description
Int32
| Improve this Doc View Source

GetBaseDamageMin()

Declaration
public virtual int GetBaseDamageMin()
Returns
Type Description
Int32
| Improve this Doc View Source

GetBodyPartForEquipSlot(EquipSlots)

Get the body part that matches to an equip slot. Used in armor calculations.

Declaration
public static BodyParts GetBodyPartForEquipSlot(EquipSlots equipSlot)
Parameters
Type Name Description
EquipSlots equipSlot
Returns
Type Description
BodyParts
| Improve this Doc View Source

GetCombinedEnchantmentSettings()

Combines all legacy and custom enchantments into a single array. Using EnchantmentSettings to store relavent combined enchantment information. Not all properties of EnchantmentSettings are set here, just what is needed to identify enchantment.

Declaration
public EnchantmentSettings[] GetCombinedEnchantmentSettings()
Returns
Type Description
EnchantmentSettings[]

Array of enchantment settings, can be null or empty.

| Improve this Doc View Source

GetEnchantmentPower()

Gets the enchantment points of this item.

Declaration
public virtual int GetEnchantmentPower()
Returns
Type Description
Int32
| Improve this Doc View Source

GetEquipSlot()

Declaration
public virtual EquipSlots GetEquipSlot()
Returns
Type Description
EquipSlots
| Improve this Doc View Source

GetEquipSlotForBodyPart(BodyParts)

Get the equip slot that matches to a body part. Used in armor calculations.

Declaration
public static EquipSlots GetEquipSlotForBodyPart(BodyParts bodyPart)
Parameters
Type Name Description
BodyParts bodyPart
Returns
Type Description
EquipSlots
| Improve this Doc View Source

GetEquipSound()

Declaration
public virtual SoundClips GetEquipSound()
Returns
Type Description
SoundClips
| Improve this Doc View Source

GetItemHands()

Declaration
public virtual ItemHands GetItemHands()
Returns
Type Description
ItemHands
| Improve this Doc View Source

GetMacroDataSource()

Declaration
public MacroDataSource GetMacroDataSource()
Returns
Type Description
MacroDataSource
| Improve this Doc View Source

GetMaterialArmorValue()

Declaration
public virtual int GetMaterialArmorValue()
Returns
Type Description
Int32
| Improve this Doc View Source

GetPaintingFileIdx()

Declaration
public int GetPaintingFileIdx()
Returns
Type Description
Int32
| Improve this Doc View Source

GetPaintingFilename()

Declaration
public string GetPaintingFilename()
Returns
Type Description
String
| Improve this Doc View Source

GetSaveData()

Gets item data for serialization.

Declaration
public virtual ItemData_v1 GetSaveData()
Returns
Type Description
ItemData_v1

ItemData_v1.

| Improve this Doc View Source

GetShieldArmorValue()

Declaration
public virtual int GetShieldArmorValue()
Returns
Type Description
Int32
| Improve this Doc View Source

GetShieldProtectedBodyParts()

Get body parts protected by a shield.

Declaration
public virtual BodyParts[] GetShieldProtectedBodyParts()
Returns
Type Description
BodyParts[]
| Improve this Doc View Source

GetSwingSound()

Declaration
public virtual SoundClips GetSwingSound()
Returns
Type Description
SoundClips
| Improve this Doc View Source

GetWeaponMaterialModifier()

Declaration
public int GetWeaponMaterialModifier()
Returns
Type Description
Int32
| Improve this Doc View Source

GetWeaponSkillID()

Declaration
public DFCareer.Skills GetWeaponSkillID()
Returns
Type Description
DFCareer.Skills
| Improve this Doc View Source

GetWeaponSkillIDAsShort()

Declaration
public virtual short GetWeaponSkillIDAsShort()
Returns
Type Description
Int16
| Improve this Doc View Source

GetWeaponSkillUsed()

Declaration
public virtual int GetWeaponSkillUsed()
Returns
Type Description
Int32
| Improve this Doc View Source

GetWeaponType()

Declaration
public virtual WeaponTypes GetWeaponType()
Returns
Type Description
WeaponTypes
| Improve this Doc View Source

IdentifyItem()

Identifies the item.

Declaration
public void IdentifyItem()
| Improve this Doc View Source

InitPaintingInfo(Int32)

Declaration
public TextFile.Token[] InitPaintingInfo(int paintingTextId = 250)
Parameters
Type Name Description
Int32 paintingTextId
Returns
Type Description
TextFile.Token[]
| Improve this Doc View Source

IsAStack()

Determines if item is a stack.

Declaration
public bool IsAStack()
Returns
Type Description
Boolean

true if item is a stack, false otherwise.

| Improve this Doc View Source

IsOfTemplate(ItemGroups, Int32)

Checks if item is of both group and template index.

Declaration
public bool IsOfTemplate(ItemGroups itemGroup, int templateIndex)
Parameters
Type Name Description
ItemGroups itemGroup

Item group to check.

Int32 templateIndex

Template index to check.

Returns
Type Description
Boolean

True if item matches both group and template index.

| Improve this Doc View Source

IsOfTemplate(Int32)

Checks if item is of template index.

Declaration
public bool IsOfTemplate(int templateIndex)
Parameters
Type Name Description
Int32 templateIndex

Template index to check.

Returns
Type Description
Boolean

True if item matches template index.

| Improve this Doc View Source

IsStackable()

Determines if item is stackable. Only ingredients, potions, gold pieces, oil and arrows are stackable, but equipped items, enchanted ingredients and quest items are never stackable.

Declaration
public virtual bool IsStackable()
Returns
Type Description
Boolean

True if item stackable.

| Improve this Doc View Source

ItemBreaks(DaggerfallEntity)

Declaration
protected void ItemBreaks(DaggerfallEntity owner)
Parameters
Type Name Description
DaggerfallEntity owner
| Improve this Doc View Source

LinkQuestItem(UInt64, Symbol)

Link this DaggerfallUnityItem to a quest Item resource.

Declaration
public void LinkQuestItem(ulong questUID, Symbol questItemSymbol)
Parameters
Type Name Description
UInt64 questUID

UID of quest owning Item resource.

Symbol questItemSymbol

Symbol to locate Item resource in quest.

| Improve this Doc View Source

LowerCondition(Int32, DaggerfallEntity, ItemCollection)

Declaration
public void LowerCondition(int amount, DaggerfallEntity unequipFromOwner = null, ItemCollection removeFromCollectionWhenBreaks = null)
Parameters
Type Name Description
Int32 amount
DaggerfallEntity unequipFromOwner
ItemCollection removeFromCollectionWhenBreaks
| Improve this Doc View Source

MakePermanent()

Remove status as quest item so it becomes permanent and will not be removed at end of quest.

Declaration
public void MakePermanent()
| Improve this Doc View Source

NextVariant()

Cycles through variants.

Declaration
public void NextVariant()
| Improve this Doc View Source

RaiseOnWeaponStrikeEvent(DaggerfallEntityBehaviour, Int32)

Declaration
public void RaiseOnWeaponStrikeEvent(DaggerfallEntityBehaviour receiver, int damage)
Parameters
Type Name Description
DaggerfallEntityBehaviour receiver
Int32 damage
| Improve this Doc View Source

RenameItem(String)

Rename item.

Declaration
public void RenameItem(string name)
Parameters
Type Name Description
String name

New name of item. Cannot be null or empty.

| Improve this Doc View Source

SetArtifact(ItemGroups, Int32)

Sets item by merging item template and artifact template data. Result is a normal DaggerfallUnityItem with properties of both base template and magic item template.

Declaration
public void SetArtifact(ItemGroups itemGroup, int groupIndex)
Parameters
Type Name Description
ItemGroups itemGroup
Int32 groupIndex

Artifact group index.

| Improve this Doc View Source

SetEnchantments(EnchantmentSettings[], DaggerfallEntity)

Set enchantments on this item. Any existing enchantments will be overwritten.

Declaration
public void SetEnchantments(EnchantmentSettings[] enchantments, DaggerfallEntity owner = null)
Parameters
Type Name Description
EnchantmentSettings[] enchantments

Array of enchantment settings. Maximum of 10 enchantments are applied.

DaggerfallEntity owner

Owner of this item for unequip test.

| Improve this Doc View Source

SetItem(ItemGroups, Int32)

Sets item from group and index. Resets item data from new template. Retains existing UID.

Declaration
public void SetItem(ItemGroups itemGroup, int groupIndex)
Parameters
Type Name Description
ItemGroups itemGroup

Item group.

Int32 groupIndex

Item group index.

| Improve this Doc View Source

UnequipItem(DaggerfallEntity)

Declaration
public void UnequipItem(DaggerfallEntity owner)
Parameters
Type Name Description
DaggerfallEntity owner
| Improve this Doc View Source

UseItem(ItemCollection)

Allow use of item to be implemented by item object and overridden

Declaration
public virtual bool UseItem(ItemCollection collection)
Parameters
Type Name Description
ItemCollection collection
Returns
Type Description
Boolean

true, if item use was handled, false otherwise.

Events

| Improve this Doc View Source

OnWeaponStrike

Declaration
public event DaggerfallUnityItem.OnWeaponStrikeEventHandler OnWeaponStrike
Event Type
Type Description
DaggerfallUnityItem.OnWeaponStrikeEventHandler

Implements

IMacroContextProvider
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX