Class DaggerfallUnityItem
Parent class for any individual item in Daggerfall Unity.
Inheritance
DaggerfallUnityItem
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
|
Improve this Doc
View Source
DaggerfallUnityItem(DaggerfallUnityItem)
Construct from another item.
Generates new UID.
Declaration
public DaggerfallUnityItem(DaggerfallUnityItem item)
Parameters
|
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
|
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
|
Improve this Doc
View Source
customMagic
Declaration
public CustomEnchantment[] customMagic
Field Value
|
Improve this Doc
View Source
drawOrder
Declaration
Field Value
|
Improve this Doc
View Source
dyeColor
Declaration
public DyeColors dyeColor
Field Value
|
Improve this Doc
View Source
enchantmentPoints
Declaration
public int enchantmentPoints
Field Value
|
Improve this Doc
View Source
flags
Declaration
Field Value
|
Improve this Doc
View Source
legacyMagic
Declaration
public DaggerfallEnchantment[] legacyMagic
Field Value
|
Improve this Doc
View Source
maxCondition
Declaration
Field Value
|
Improve this Doc
View Source
message
Declaration
Field Value
|
Improve this Doc
View Source
nativeMaterialValue
Declaration
public int nativeMaterialValue
Field Value
|
Improve this Doc
View Source
poisonType
Declaration
public Poisons poisonType
Field Value
|
Improve this Doc
View Source
shortName
Declaration
Field Value
|
Improve this Doc
View Source
stackCount
Declaration
Field Value
|
Improve this Doc
View Source
timeEffectsLastRerolled
Declaration
public uint timeEffectsLastRerolled
Field Value
|
Improve this Doc
View Source
timeHealthLeechLastUsed
Declaration
public uint timeHealthLeechLastUsed
Field Value
|
Improve this Doc
View Source
typeDependentData
Declaration
public byte typeDependentData
Field Value
|
Improve this Doc
View Source
unknown
Declaration
Field Value
|
Improve this Doc
View Source
unknown2
Declaration
Field Value
|
Improve this Doc
View Source
value
Declaration
Field Value
|
Improve this Doc
View Source
weightInKg
Declaration
Field Value
Properties
|
Improve this Doc
View Source
ConditionPercentage
Gets current item condition as a percentage of max.
Declaration
public int ConditionPercentage { get; }
Property Value
|
Improve this Doc
View Source
CurrentVariant
Gets current variant of this item.
Declaration
public virtual int CurrentVariant { get; set; }
Property Value
|
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
|
Improve this Doc
View Source
EquipSlot
Declaration
public EquipSlots EquipSlot { get; set; }
Property Value
|
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
|
Improve this Doc
View Source
HasCustomEnchantments
True is item has any custom enchantments.
Declaration
public bool HasCustomEnchantments { get; }
Property Value
|
Improve this Doc
View Source
HasLegacyEnchantments
True if item has any legacy enchantments.
Declaration
public bool HasLegacyEnchantments { get; }
Property Value
|
Improve this Doc
View Source
InventoryTextureArchive
Gets inventory texture archive.
Declaration
public virtual int InventoryTextureArchive { get; }
Property Value
|
Improve this Doc
View Source
InventoryTextureRecord
Gets inventory texture record.
Declaration
public virtual int InventoryTextureRecord { get; }
Property Value
|
Improve this Doc
View Source
IsArtifact
Checks if this item is an artifact.
Declaration
public bool IsArtifact { get; }
Property Value
|
Improve this Doc
View Source
IsClothing
Checks if this item is clothing.
Declaration
public bool IsClothing { get; }
Property Value
|
Improve this Doc
View Source
IsEnchanted
Checks if this item has magical properties.
Declaration
public virtual bool IsEnchanted { get; }
Property Value
|
Improve this Doc
View Source
IsEquipped
Checks if this item is equipped.
Declaration
public bool IsEquipped { get; }
Property Value
|
Improve this Doc
View Source
IsIdentified
Checks if this item is identified.
Declaration
public bool IsIdentified { get; }
Property Value
|
Improve this Doc
View Source
IsIngredient
Checks if this is an ingredient.
Declaration
public bool IsIngredient { get; }
Property Value
|
Improve this Doc
View Source
IsLightSource
Checks if this item is light source.
Declaration
public bool IsLightSource { get; }
Property Value
|
Improve this Doc
View Source
IsParchment
Checks if this item is a parchment.
Declaration
public bool IsParchment { get; }
Property Value
|
Improve this Doc
View Source
IsPotion
Checks if this item is a potion.
Declaration
public bool IsPotion { get; }
Property Value
|
Improve this Doc
View Source
IsPotionRecipe
Checks if this item is a potion recipe.
Declaration
public bool IsPotionRecipe { get; }
Property Value
|
Improve this Doc
View Source
IsQuestItem
Check if this is a quest item.
Declaration
public bool IsQuestItem { get; }
Property Value
|
Improve this Doc
View Source
IsShield
Checks if this item is of any shield type.
Declaration
public bool IsShield { get; }
Property Value
|
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
|
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
|
Improve this Doc
View Source
ItemName
Resolve this item's name.
Declaration
public virtual string ItemName { get; }
Property Value
|
Improve this Doc
View Source
ItemTemplate
Get this item's template data.
Declaration
public ItemTemplate ItemTemplate { get; }
Property Value
|
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
|
Improve this Doc
View Source
LongName
Resolve this item's full name (mainly for tooltips).
Declaration
public virtual string LongName { get; }
Property Value
|
Improve this Doc
View Source
NativeMaterialValue
Gets native material value.
Declaration
public virtual int NativeMaterialValue { get; }
Property Value
|
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
|
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
|
Improve this Doc
View Source
QuestItemSymbol
Gets symbol of quest item inside quest.
Declaration
public Symbol QuestItemSymbol { get; }
Property Value
|
Improve this Doc
View Source
QuestUID
Gets quest UID of quest owning this item.
Declaration
public ulong QuestUID { get; }
Property Value
|
Improve this Doc
View Source
RepairData
Gets the repair data for this item.
Declaration
public ItemRepairData RepairData { get; }
Property Value
|
Improve this Doc
View Source
TemplateIndex
Get this item's template index.
Declaration
public int TemplateIndex { get; }
Property Value
|
Improve this Doc
View Source
TimeForItemToDisappear
Gets/sets the time for this item to disappear.
Declaration
public uint TimeForItemToDisappear { get; set; }
Property Value
|
Improve this Doc
View Source
TotalVariants
Gets total variants of this item.
Declaration
public int TotalVariants { get; }
Property Value
|
Improve this Doc
View Source
TrappedSoulType
Gets/sets the soul trapped in a soul trap.
Declaration
public MobileTypes TrappedSoulType { get; set; }
Property Value
|
Improve this Doc
View Source
UID
Gets generated unique identifier.
Declaration
public ulong UID { get; }
Property Value
|
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
|
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
Methods
|
Improve this Doc
View Source
Clone()
Creates a new copy of this item.
Declaration
public DaggerfallUnityItem Clone()
Returns
|
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
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
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
|
Improve this Doc
View Source
GetBaseDamageMax()
Declaration
public virtual int GetBaseDamageMax()
Returns
|
Improve this Doc
View Source
GetBaseDamageMin()
Declaration
public virtual int GetBaseDamageMin()
Returns
|
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
Returns
|
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
|
Improve this Doc
View Source
GetEnchantmentPower()
Gets the enchantment points of this item.
Declaration
public virtual int GetEnchantmentPower()
Returns
|
Improve this Doc
View Source
GetEquipSlot()
Declaration
public virtual EquipSlots GetEquipSlot()
Returns
|
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
Returns
|
Improve this Doc
View Source
GetEquipSound()
Declaration
public virtual SoundClips GetEquipSound()
Returns
|
Improve this Doc
View Source
GetItemHands()
Declaration
public virtual ItemHands GetItemHands()
Returns
|
Improve this Doc
View Source
GetMacroDataSource()
Declaration
public MacroDataSource GetMacroDataSource()
Returns
|
Improve this Doc
View Source
GetMaterialArmorValue()
Declaration
public virtual int GetMaterialArmorValue()
Returns
|
Improve this Doc
View Source
GetPaintingFileIdx()
Declaration
public int GetPaintingFileIdx()
Returns
|
Improve this Doc
View Source
GetPaintingFilename()
Declaration
public string GetPaintingFilename()
Returns
|
Improve this Doc
View Source
GetSaveData()
Gets item data for serialization.
Declaration
public virtual ItemData_v1 GetSaveData()
Returns
|
Improve this Doc
View Source
GetShieldArmorValue()
Declaration
public virtual int GetShieldArmorValue()
Returns
|
Improve this Doc
View Source
GetShieldProtectedBodyParts()
Get body parts protected by a shield.
Declaration
public virtual BodyParts[] GetShieldProtectedBodyParts()
Returns
|
Improve this Doc
View Source
GetSwingSound()
Declaration
public virtual SoundClips GetSwingSound()
Returns
|
Improve this Doc
View Source
GetWeaponMaterialModifier()
Declaration
public int GetWeaponMaterialModifier()
Returns
|
Improve this Doc
View Source
GetWeaponSkillID()
Declaration
public DFCareer.Skills GetWeaponSkillID()
Returns
|
Improve this Doc
View Source
GetWeaponSkillIDAsShort()
Declaration
public virtual short GetWeaponSkillIDAsShort()
Returns
|
Improve this Doc
View Source
GetWeaponSkillUsed()
Declaration
public virtual int GetWeaponSkillUsed()
Returns
|
Improve this Doc
View Source
GetWeaponType()
Declaration
public virtual WeaponTypes GetWeaponType()
Returns
|
Improve this Doc
View Source
IdentifyItem()
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
|
Improve this Doc
View Source
IsAStack()
Determines if item is a stack.
Declaration
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
|
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
|
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()
Declaration
public void NextVariant()
|
Improve this Doc
View Source
RaiseOnWeaponStrikeEvent(DaggerfallEntityBehaviour, Int32)
Declaration
public void RaiseOnWeaponStrikeEvent(DaggerfallEntityBehaviour receiver, int damage)
Parameters
|
Improve this Doc
View Source
RenameItem(String)
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
|
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
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
Implements