using System; using System.Diagnostics; using System.Globalization; using LavishScriptAPI; using MRBot.IsxEq2.AbilityEffect; using MRBot.IsxEq2.Helpers; namespace MRBot.IsxEq2.InventoryConsignment { /// /// This DataType includes all of the data available to ISXEQ2 that is related to inventory and equipped items. /// public class Item : LavishScriptObject { #region Constructor /// /// Constructor /// /// LS Object public Item(LavishScriptObject copy) : base(copy) { } #endregion #region Members /// /// Returns the RewardWindow as an EQ2Window /// public ItemInfo ToItemInfo { get { Trace.WriteLine(String.Format("Item:ToItemInfo")); return new ItemInfo(this.GetMember("ToItemInfo")); } } /// /// Returns TRUE if the collectible has already been collected. /// public bool AlreadyCollected { get { Trace.WriteLine(String.Format("Item:AlreadyCollected")); return this.GetBoolFromLSO("AlreadyCollected"); } } /// /// Cache of AppearanceOnly /// private bool? _appearanceOnly; /// /// Returns TRUE if the item is an Appearance Only item /// public bool AppearanceOnly { get { Trace.WriteLine(String.Format("Item:AppearanceOnly")); if (!_appearanceOnly.HasValue) _appearanceOnly = this.GetBoolFromLSO("AppearanceOnly"); return _appearanceOnly.Value; } } /// /// Cache of Artifact /// private bool? _artifact; /// /// Returns TRUE if the item is an artifact /// public bool Artifact { get { Trace.WriteLine(String.Format("Item:Artifact")); if (!_artifact.HasValue) _artifact = this.GetBoolFromLSO("Artifact"); return _artifact.Value; } } /// /// Cache of Attuneable /// private bool? _attuneable; /// /// Returns TRUE if the item is attuneable /// public bool Attuneable { get { Trace.WriteLine(String.Format("Item:Attuneable")); if (!_attuneable.HasValue) _attuneable = this.GetBoolFromLSO("Attuneable"); return _attuneable.Value; } } /// /// Returns TRUE if the item is attuned /// public bool Attuned { get { Trace.WriteLine(String.Format("Item:Attuned")); return this.GetBoolFromLSO("Attuned"); } } /// /// Returns TRUE if Auto Consume is on /// public bool AutoConsumeOn { get { Trace.WriteLine(String.Format("Item:AutoConsumeOn")); return this.GetBoolFromLSO("AutoConsumeOn"); } } /// /// Cache of BaseMaxDamage /// private int? _baseMaxDamage; /// /// Base Maximum Weapon Damage /// public int BaseMaxDamage { get { Trace.WriteLine(String.Format("Item:BaseMaxDamage")); if (!_baseMaxDamage.HasValue) _baseMaxDamage = this.GetIntFromLSO("BaseMaxDamage"); return _baseMaxDamage.Value; } } /// /// Cache of BaseMinDamage /// private int? _baseMinDamage; /// /// Base Minimum Weapon Damage /// public int BaseMinDamage { get { Trace.WriteLine(String.Format("Item:BaseMinDamage")); if (!_baseMinDamage.HasValue) _baseMinDamage = this.GetIntFromLSO("BaseMinDamage"); return _baseMinDamage.Value; } } /// /// Cache of CanBeRedeemed /// private bool? _canBeRedeemed; /// /// Returns TRUE if the item can be redeemed /// public bool CanBeRedeemed { get { Trace.WriteLine(String.Format("Item:CanBeRedeemed")); if (!_canBeRedeemed.HasValue) _canBeRedeemed = this.GetBoolFromLSO("CanBeRedeemed"); return _canBeRedeemed.Value; } } /// /// Item casting time /// public float CastingTime { get { Trace.WriteLine(String.Format("Item:CastingTime")); return this.GetFloatFromLSO("CastingTime"); } } /// /// Item Charges (-1 indicates unlimited) /// public int Charges { get { Trace.WriteLine(String.Format("Item:Charges")); return this.GetIntFromLSO("Charges"); } } /// /// Returns a 'class' datatype -- # is the class number within the array /// Abilities that are usable by ALL will have one class in the array, which will have the name "commoner". /// Remember, 'commoner' is a class of which everyone is a member /// /// class index /// class at index public Class Class(int index) { Trace.WriteLine(String.Format("Item:Class({0})", index.ToString(CultureInfo.InvariantCulture))); return new Class(GetMember("Class", index.ToString(CultureInfo.InvariantCulture))); } /// /// Cache of Condition /// private int? _condition; /// /// Item condition (%) /// public int Condition { get { Trace.WriteLine(String.Format("Item:Condition")); if (!_condition.HasValue) _condition = this.GetIntFromLSO("Condition"); return _condition.Value; } } /// /// Cache of ContainerID /// private int? _containerID; /// /// The Container ID of the container /// public int ContainerID { get { Trace.WriteLine(String.Format("Item:ContainerID")); if (!_containerID.HasValue) _containerID = this.GetIntFromLSO("ContainerID"); return _containerID.Value; } } /// /// Cache of Crafter /// private string _crafter; /// /// The name of the crafter (if crafted item) /// public string Crafter { get { Trace.WriteLine(String.Format("Item:Crafter")); return _crafter ?? (_crafter = this.GetStringFromLSO("Crafter")); } } /// /// Cache of DamageRating /// private float? _damageRating; /// /// Weapon Damage Rating /// public float DamageRating { get { Trace.WriteLine(String.Format("Item:DamageRating")); if (!_damageRating.HasValue) _damageRating = this.GetFloatFromLSO("DamageRating"); return _damageRating.Value; } } /// /// Cache of DamageType /// private string _damageType; /// /// Weapon Damage Type /// public string DamageType { get { Trace.WriteLine(String.Format("Item:DamageType")); return _damageType ?? (_damageType = this.GetStringFromLSO("DamageType")); } } /// /// Cache of DamageTypeVerb /// private string _damageTypeVerb; /// /// Weapon Damage Type Verb (Slashing, etc...) /// public string DamageTypeVerb { get { Trace.WriteLine(String.Format("Item:DamageTypeVerb")); return _damageTypeVerb ?? (_damageTypeVerb = this.GetStringFromLSO("DamageTypeVerb")); } } /// /// Cache of Delay /// private float? _delay; /// /// Weapon Delay /// public float Delay { get { Trace.WriteLine(String.Format("Item:Delay")); if (!_delay.HasValue) _delay = this.GetFloatFromLSO("Delay"); return _delay.Value; } } /// /// Cache of description /// private string _description; /// /// The description of the item. Not all items have a description. /// public string Description { get { Trace.WriteLine(String.Format("Item:Description")); return _description ?? (_description = this.GetStringFromLSO("Description")); } } /// /// Food or Drink Duration /// public float Duration { get { Trace.WriteLine(String.Format("Item:Duration")); return this.GetFloatFromLSO("Duration"); } } /// /// Name of Effect at index /// /// effect index /// effect name public string EffectName(int index) { Trace.WriteLine(String.Format("Item:EffectName({0})", index.ToString(CultureInfo.InvariantCulture))); return this.GetStringFromLSO("EffectName", index.ToString(CultureInfo.InvariantCulture)); } /// /// Description of the effect at index /// /// effect index /// effect description public string EffectDescription(int index) { Trace.WriteLine(String.Format("Item:EffectDescription({0})", index.ToString(CultureInfo.InvariantCulture))); return this.GetStringFromLSO("EffectDescription", index.ToString(CultureInfo.InvariantCulture)); } /// /// Returns the name of the equipslot at the index /// /// equipslot index /// equipslot name public string EquipSlot(int index) { Trace.WriteLine(String.Format("Item:EquipSlot({0})", index.ToString(CultureInfo.InvariantCulture))); return this.GetStringFromLSO("EquipSlot", index.ToString(CultureInfo.InvariantCulture)); } /// /// Cache of Evil /// private bool? _evil; /// /// Returns TRUE if item only usable by Evil characters /// public bool Evil { get { Trace.WriteLine(String.Format("Item:Evil")); if (!_evil.HasValue) _evil = this.GetBoolFromLSO("Evil"); return _evil.Value; } } /// /// Cache of ExamineText /// private string _examineText; /// /// This is the text that appears in the examine window while 'examining' an item. /// public string ExamineText { get { Trace.WriteLine(String.Format("Item:ExamineText")); return _examineText ?? (_examineText = this.GetStringFromLSO("ExamineText")); } } /// /// Cache of Good /// private bool? _good; /// /// Returns TRUE if item only usable by Good characters /// public bool Good { get { Trace.WriteLine(String.Format("Item:Good")); if (!_good.HasValue) _good = this.GetBoolFromLSO("Good"); return _good.Value; } } /// /// Cache of Heirloom /// private bool? _heirloom; /// /// Returns TRUE if the item is Heirloom /// public bool Heirloom { get { Trace.WriteLine(String.Format("Item:Heirloom")); if (!_heirloom.HasValue) _heirloom = this.GetBoolFromLSO("Heirloom"); return _heirloom.Value; } } /// /// Cache of ID /// private int? _iD; /// /// The ID of the item /// public int ID { get { Trace.WriteLine(String.Format("Item:ID")); if (!_iD.HasValue) _iD = this.GetIntFromLSO("ID"); return _iD.Value; } } /// /// Returns TRUE if the item is in the bank /// public bool InBank { get { Trace.WriteLine(String.Format("Item:InBank")); return this.GetBoolFromLSO("InBank"); } } /// /// Returns TRUE if the item is in a container /// public bool InContainer { get { Trace.WriteLine(String.Format("Item:InContainer")); return this.GetBoolFromLSO("InContainer"); } } /// /// ID of parent container /// public int InContainerID { get { Trace.WriteLine(String.Format("Item:InContainerID")); return this.GetIntFromLSO("InContainerID"); } } /// /// Cache of Index /// private int? _index; /// /// A number that represents a unique item number for an item. /// e.g. eq2execute "inventory equip 'ItemIndex' 'SlotNumber'" /// public int Index { get { Trace.WriteLine(String.Format("Item:Index")); if (!_index.HasValue) _index = this.GetIntFromLSO("Index"); return _index.Value; } } /// /// Identifies if the item is in a bag or actual inventory slot /// public bool InInventory { get { Trace.WriteLine(String.Format("Item:InInventory")); return this.GetBoolFromLSO("InInventory"); } } /// /// Identifies if the item is in one of your 6 actual inventory slots /// public bool InInventorySlot { get { Trace.WriteLine(String.Format("Item:InInventorySlot")); return this.GetBoolFromLSO("InInventorySlot"); } } /// /// Returns TRUE if the item is in a nosale container /// public bool InNoSaleContainer { get { Trace.WriteLine(String.Format("Item:InNoSaleContainer")); return this.GetBoolFromLSO("InNoSaleContainer"); } } /// /// Returns TRUE if the item is in the shared bank /// public bool InSharedBank { get { Trace.WriteLine(String.Format("Item:InSharedBank")); return this.GetBoolFromLSO("InSharedBank"); } } /// /// Cache of IsAutoConsumeable /// private bool? _isAutoConsumeable; /// /// Returns TRUE if the item is auto consumeable /// public bool IsAutoConsumeable { get { Trace.WriteLine(String.Format("Item:IsAutoConsumeable")); if (!_isAutoConsumeable.HasValue) _isAutoConsumeable = this.GetBoolFromLSO("IsAutoConsumeOn"); return _isAutoConsumeable.Value; } } /// /// Identifies if the item is a container placed in one of your 12 actual bank slots /// public bool IsBankContainer { get { Trace.WriteLine(String.Format("Item:IsBankContainer")); return this.GetBoolFromLSO("IsBankContainer"); } } /// /// Cache of IsCollectible /// private bool? _isCollectible; /// /// Returns TRUE if the item is a collectible /// public bool IsCollectible { get { Trace.WriteLine(String.Format("Item:IsCollectible")); if (!_isCollectible.HasValue) _isCollectible = this.GetBoolFromLSO("IsCollectible"); return _isCollectible.Value; } } /// /// Cache of IsContainer /// private bool? _isContainer; /// /// Returns TRUE if the item is a container /// public bool IsContainer { get { Trace.WriteLine(String.Format("Item:IsContainer")); if(!_isContainer.HasValue) _isContainer = this.GetBoolFromLSO("IsContainer"); return _isContainer.Value; } } /// /// Returns TRUE if the item is equipped /// public bool IsEquipped { get { Trace.WriteLine(String.Format("Item:IsEquipped")); return this.GetBoolFromLSO("IsEquipped"); } } /// /// Cache of IsItemFoodOrDrink /// private bool? _isFoodOrDrink; /// /// Returns TRUE if the item is a food or drink /// public bool IsFoodOrDrink { get { Trace.WriteLine(String.Format("Item:IsFoodOrDrink")); if (!_isFoodOrDrink.HasValue) _isFoodOrDrink = this.GetBoolFromLSO("IsFoodOrDrink"); return _isFoodOrDrink.Value; } } /// /// Returns true if all of this item's datatype members are available /// (i.e., if information has been cached from the server.) /// public bool IsInitialized { get { Trace.WriteLine(String.Format("Item:IsInitialized")); return this.GetBoolFromLSO("IsInitialized"); } } /// /// Returns true if all of this item's datatype members are available /// (i.e., if information has been cached from the server.) /// public bool IsItemInfoAvailable { get { Trace.WriteLine(String.Format("Item:IsItemInfoAvailable")); return this.GetBoolFromLSO("IsItemInfoAvailable"); } } /// /// Identifies if the item is a container placed in one of your 6 actual inventory slots /// public bool IsInventoryContainer { get { Trace.WriteLine(String.Format("Item:IsInventoryContainer")); return this.GetBoolFromLSO("IsInventoryContainer"); } } /// /// Cache of IsQuestItemUsable /// private bool? _isQuestItemUsable; /// /// Returns TRUE if the item is a usable quest item /// public bool IsQuestItemUsable { get { Trace.WriteLine(String.Format("Item:IsQuestItemUsable")); if (!_isQuestItemUsable.HasValue) _isQuestItemUsable = this.GetBoolFromLSO("IsQuestItemUsable"); return _isQuestItemUsable.Value; } } /// /// Returns true if the IsActivatable == TRUE and the item is ready for use /// public bool IsReady { get { Trace.WriteLine(String.Format("Item:IsReady")); return this.GetBoolFromLSO("IsReady"); } } /// /// Cache of IsScribeable /// private bool? _isScribeable; /// /// Returns TRUE if the item is scribeable /// public bool IsScribeable { get { Trace.WriteLine(String.Format("Item:IsScribeable")); if (!_isScribeable.HasValue) _isScribeable = this.GetBoolFromLSO("IsScribeable"); return _isScribeable.Value; } } /// /// Identifies if the item is a container placed in one of your 8 actual shared bank slots /// public bool IsSharedBankContainer { get { Trace.WriteLine(String.Format("Item:IsSharedBankContainer")); return this.GetBoolFromLSO("IsSharedBankContainer"); } } /// /// Returns TRUE if the slot is open /// /// slot number /// TRUE if the slot is open public bool IsSlotOpen(int slot) { Trace.WriteLine(String.Format("Item:IsOpenSlot({0})", slot.ToString(CultureInfo.InvariantCulture))); return this.GetBoolFromLSO("IsSlotOpen", slot.ToString(CultureInfo.InvariantCulture)); } /// /// Returns the item in the slot /// /// slot number /// item in the slot public Item ItemInSlot(int slot) { Trace.WriteLine(String.Format("Item:ItemInSlot({0})", slot.ToString(CultureInfo.InvariantCulture))); return new Item(this.GetMember("ItemInSlot", slot.ToString(CultureInfo.InvariantCulture))); } /// /// Cache of Level /// private int? _level; /// /// Food/Drink Level /// public int Level { get { Trace.WriteLine(String.Format("Item:Level")); if (!_level.HasValue) _level = this.GetIntFromLSO("Level"); return _level.Value; } } /// /// Cache of LinkID /// private int? _linkID; /// /// The item LinkID /// public int LinkID { get { Trace.WriteLine(String.Format("Item:LinkID")); if (!_linkID.HasValue) _linkID = this.GetIntFromLSO("LinkID"); return _linkID.Value; } } /// /// Cache of Lore /// private bool? _lore; /// /// Returns TRUE if the item is lore /// public bool Lore { get { Trace.WriteLine(String.Format("Item:Lore")); if (!_lore.HasValue) _lore = this.GetBoolFromLSO("Lore"); return _lore.Value; } } /// /// Cache of LoreOnEquip /// private bool? _loreOnEquip; /// /// Returns TRUE if the item becomes Lore if equipped /// public bool LoreOnEquip { get { Trace.WriteLine(String.Format("Item:LoreOnEquip")); if (!_loreOnEquip.HasValue) _loreOnEquip = this.GetBoolFromLSO("LoreOnEquip"); return _loreOnEquip.Value; } } /// /// Cache of MasteryMinDamage /// private int? _masteryMinDamage; /// /// Minimum Mastery Weapon Damage /// public int MasteryMinDamage { get { Trace.WriteLine(String.Format("Item:MasteryMinDamage")); if (!_masteryMinDamage.HasValue) _masteryMinDamage = this.GetIntFromLSO("MasteryMinDamage"); return _masteryMinDamage.Value; } } /// /// Cache of MasteryMaxDamage /// private int? _masteryMaxDamage; /// /// Maximum Mastery Weapon Damage /// public int MasteryMaxDamage { get { Trace.WriteLine(String.Format("Item:MasteryMaxDamage")); if (!_masteryMaxDamage.HasValue) _masteryMaxDamage = this.GetIntFromLSO("MasteryMaxDamage"); return _masteryMaxDamage.Value; } } /// /// Cache of MaxCharges /// private int? _maxCharges; /// /// Max Charges (-1 indicates unlimited) /// public int MaxCharges { get { Trace.WriteLine(String.Format("Item:MaxCharges")); if (!_maxCharges.HasValue) _maxCharges = this.GetIntFromLSO("MaxCharges"); return _maxCharges.Value; } } /// /// Cache of MaxMitigation /// private int? _maxMitigation; /// /// Max Mitigation /// public int MaxMitigation { get { Trace.WriteLine(String.Format("Item:MaxMitigation")); if (!_maxMitigation.HasValue) _maxMitigation = this.GetIntFromLSO("MaxMitigation"); return _maxMitigation.Value; } } /// /// Cache of MaxProtection /// private int? _maxProtection; /// /// MaxProtection /// public int MaxProtection { get { Trace.WriteLine(String.Format("Item:MaxProtection")); if (!_maxProtection.HasValue) _maxProtection = this.GetIntFromLSO("MaxProtection"); return _maxProtection.Value; } } /// /// Cache of MaxRange /// private int? _maxRange; /// /// Max Weapon Range /// public int MaxRange { get { Trace.WriteLine(String.Format("Item:MaxRange")); if (!_maxRange.HasValue) _maxRange = this.GetIntFromLSO("MaxRange"); return _maxRange.Value; } } /// /// Cache of MinRange /// private int? _minRange; /// /// Min Weapon Range /// public int MinRange { get { Trace.WriteLine(String.Format("Item:MinRange")); if (!_minRange.HasValue) _minRange = this.GetIntFromLSO("MinRange"); return _minRange.Value; } } /// /// Cache of Mitigation /// private int? _mitigation; /// /// Mitigation /// public int Mitigation { get { Trace.WriteLine(String.Format("Item:Mitigation")); if (!_mitigation.HasValue) _mitigation = this.GetIntFromLSO("Mitigation"); return _mitigation.Value; } } /// /// Retrieves the modifier at index between 1 and NumModifiers /// /// index /// item modifier public ItemModifier Modifier(int index) { Trace.WriteLine(String.Format("Item:Modifier({0})", index.ToString(CultureInfo.InvariantCulture))); return new ItemModifier(this.GetMember("Modifier", index.ToString(CultureInfo.InvariantCulture))); } /// /// Weapon Min Damage /// public int MyMinDamage { get { Trace.WriteLine(String.Format("Item:MyMinDamage")); return this.GetIntFromLSO("MyMinDamage"); } } /// /// Weapon Max Damage /// public int MyMaxDamage { get { Trace.WriteLine(String.Format("Item:MyMaxDamage")); return this.GetIntFromLSO("MyMaxDamage"); } } /// /// Cache of Name /// private string _name; /// /// The name of the item /// public string Name { get { Trace.WriteLine(String.Format("Item:Name")); return _name ?? (_name = this.GetStringFromLSO("Name")); } } /// /// The next open slot in the container /// public int NextSlotOpen { get { Trace.WriteLine(String.Format("Item:NextSlotOpen")); return this.GetIntFromLSO("NextSlotOpen"); } } /// /// Cache of NoDestroy /// private bool? _noDestroy; /// /// Returns TRUE if the item is no destroy /// public bool NoDestroy { get { Trace.WriteLine(String.Format("Item:NoDestroy")); if (!_noDestroy.HasValue) _noDestroy = this.GetBoolFromLSO("NoDestroy"); return _noDestroy.Value; } } /// /// Cache of NoTrade /// private bool? _noTrade; /// /// Returns TRUE if the item is no trade /// public bool NoTrade { get { Trace.WriteLine(String.Format("Item:Notrade")); if (!_noTrade.HasValue) _noTrade = this.GetBoolFromLSO("NoTrade"); return _noTrade.Value; } } /// /// Cache of NoValue /// private bool? _noValue; /// /// Returns TRUE if the item is no value /// public bool NoValue { get { Trace.WriteLine(String.Format("Item:NoValue")); if (!_noValue.HasValue) _noValue = this.GetBoolFromLSO("NoValue"); return _noValue.Value; } } /// /// Cache of NoZone /// private bool? _noZone; /// /// Returns TRUE if the item is no zone /// public bool NoZone { get { Trace.WriteLine(String.Format("Item:NoZone")); if (!_noZone.HasValue) _noZone = this.GetBoolFromLSO("NoZone"); return _noZone.Value; } } /// /// Cache of NumClasses /// private int? _numClasses; /// /// Returns the number of classes that can use the item /// public int NumClasses { get { Trace.WriteLine(String.Format("Item:NumClasses")); if (!_numClasses.HasValue) _numClasses = this.GetIntFromLSO("NumClasses"); return _numClasses.Value; } } /// /// The number of effects on the item /// public int NumEffects { get { Trace.WriteLine(String.Format("Item:NumEffects")); return this.GetIntFromLSO("NumEffects"); } } /// /// Cache of NumEquipSlots /// private int? _numEquipSlots; /// /// Returns the number of slots in which this item can be equipped /// public int NumEquipSlots { get { Trace.WriteLine(String.Format("Item:NumEquipSlots")); if (!_numEquipSlots.HasValue) _numEquipSlots = this.GetIntFromLSO("NumEquipSlots"); return _numEquipSlots.Value; } } /// /// Cache of NumModifiers /// private int? _numModifiers; /// /// The number of item modifiers /// public int NumModifiers { get { Trace.WriteLine(String.Format("Item:NumModifiers")); if (!_numModifiers.HasValue) _numModifiers = this.GetIntFromLSO("NumModifiers"); return _numModifiers.Value; } } /// /// Cache for NumSlots /// private int? _numSlots; /// /// The number of slots in the container /// public int NumSlots { get { Trace.WriteLine(String.Format("Item:NumSlots")); if (!_numSlots.HasValue) _numSlots = this.GetIntFromLSO("NumSlots"); return _numSlots.Value; } } /// /// Identifies the number of free slots in a container /// public int NumSlotsFree { get { Trace.WriteLine(String.Format("Item:NumSlotsFree")); return this.GetIntFromLSO("NumSlotsFree"); } } /// /// Cache of OffersQuest /// private bool? _offersQuest; /// /// Returns TRUE if the item offers a quest /// public bool OffersQuest { get { Trace.WriteLine(String.Format("Item:OffersQuest")); if (!_offersQuest.HasValue) _offersQuest = this.GetBoolFromLSO("OffersQuest"); return _offersQuest.Value; } } /// /// Cache of Ornate /// private bool? _ornate; /// /// Returns TRUE if the item is Ornate /// public bool Ornate { get { Trace.WriteLine(String.Format("Item:Ornate")); if (!_ornate.HasValue) _ornate = this.GetBoolFromLSO("Ornate"); return _ornate.Value; } } /// /// Cache of Protection /// private int? _protection; /// /// Protection /// public int Protection { get { Trace.WriteLine(String.Format("Item:Protection")); if (!_protection.HasValue) _protection = this.GetIntFromLSO("Protection"); return _protection.Value; } } /// /// Item Quantity /// public int Quantity { get { Trace.WriteLine(String.Format("Item:Quantity")); return this.GetIntFromLSO("Quantity"); } } /// /// Return MaxRange /// public int Range { get { Trace.WriteLine(String.Format("Item:Range")); return this.MaxRange; } } /// /// Item Recast Time /// public float RecastTime { get { Trace.WriteLine(String.Format("Item:RecastTime")); return this.GetFloatFromLSO("RecastTime"); } } /// /// Item Recovery Time /// public float RecoveryTime { get { Trace.WriteLine(String.Format("Item:RecoveryTime")); return this.GetFloatFromLSO("RecoveryTime"); } } /// /// Cache of RentStatusReduction /// private int? _rentStatusReduction; /// /// Rent Status Reduction /// public int RentStatusReduction { get { Trace.WriteLine(String.Format("Item:RentStatusReduction")); if (!_rentStatusReduction.HasValue) _rentStatusReduction = this.GetIntFromLSO("RentStatusReduction"); return _rentStatusReduction.Value; } } /// /// Cache of RequiredByQuest /// private bool? _requiredByQuest; /// /// Returns TRUE if the item is required by a quest /// public bool RequiredByQuest { get { Trace.WriteLine(String.Format("Item:RequiredByQuest")); if (!_requiredByQuest.HasValue) _requiredByQuest = this.GetBoolFromLSO("RequiredByQuest"); return _requiredByQuest.Value; } } /// /// Cache of Satiation /// private string _satiation; /// /// Food or Drink satiation level /// public string Satiation { get { Trace.WriteLine(String.Format("Item:Satiation")); return _satiation ?? (_satiation = this.GetStringFromLSO("Satiation")); } } /// /// Cache of SerialNumber /// private long? _serialNumber; /// /// Item Serial Number /// public long SerialNumber { get { Trace.WriteLine(String.Format("Item:SerialNumber")); if (!_serialNumber.HasValue) _serialNumber = this.GetInt64FromLSO("SerialNumber"); return _serialNumber.Value; } } /// /// Returns the current slot position for the item within its container, or within your inventory. /// So, if the item is in a bag that has 20 slots, it will return a number between 0 and 19. /// If the item (or container) is sitting in one of your six "real" inventory slots, it will return 0 to 5. /// public int Slot { get { Trace.WriteLine(String.Format("Item:Slot")); return this.GetIntFromLSO("Slot"); } } /// /// Cache of SubType /// private string _subType; /// /// Weapon Sub Type /// public string SubType { get { Trace.WriteLine(String.Format("Item:SubType")); return _subType ?? (_subType = this.GetStringFromLSO("SubType")); } } /// /// Cache of Temporary /// private bool? _temporary; /// /// Returns TRUE if the item is Temporary /// public bool Temporary { get { Trace.WriteLine(String.Format("Item:Temporary")); if (!_temporary.HasValue) _temporary = this.GetBoolFromLSO("Temporary"); return _temporary.Value; } } /// /// Cache of tier /// private string _tier; /// /// The tier of the item (FABLED, LEGENDARY, TREASURED, MASTERCRAFTED, HANDCRAFTED, or UNCOMMON) /// public string Tier { get { Trace.WriteLine(String.Format("Item:Tier")); return _tier ?? (_tier = this.GetStringFromLSO("Tier")); } } /// /// Returns the time in seconds until the item is ready for use /// public float TimeUntilReady { get { Trace.WriteLine(String.Format("Item:TimeUntilReady")); return this.GetFloatFromLSO("TimeUntilReady"); } } /// /// This will recreate the actual link used with in game chat channels (used typically with eq2echo or eq2execute). /// /// link public string ToLink { get { Trace.WriteLine(String.Format("Item:ToLink")); return this.GetStringFromLSO("ToLink"); } } /// /// Cache of Type /// private string _type; /// /// Item type (Weapon, Armor, Shield, Container, Spell Scroll, Recipe Book, House Item, Food, Drink, or Activateable) /// public string Type { get { Trace.WriteLine(String.Format("Item:Type")); return _type ?? (_type = this.GetStringFromLSO("Type")); } } /// /// Cache of WieldStyle /// private string _wieldStyle; /// /// Wield Style (Returns: Dual Wield, Two-Handed, or One-Handed.) /// public string WieldStyle { get { Trace.WriteLine(String.Format("Item:WieldStyle")); return _wieldStyle ?? (_wieldStyle = this.GetStringFromLSO("WieldStyle")); } } #endregion #region Methods /// /// Activates the item /// /// call success public bool Activate() { Trace.WriteLine(String.Format("Item:Activate()")); return this.ExecuteMethod("Activate"); } /// /// Moves the entire item/stack to the first available vendor /// /// call success public bool AddToConsignment() { Trace.WriteLine(String.Format("Item:AddToConsignment()")); return this.ExecuteMethod("AddToConsignment"); } /// /// Moves the quantity of the stack to the first available vendor /// /// quantity /// call success public bool AddToConsignment(int quantity) { Trace.WriteLine(String.Format("Item:AddToConsignment({0}", quantity.ToString(CultureInfo.InvariantCulture))); return this.ExecuteMethod("AddToConsignment", quantity.ToString(CultureInfo.InvariantCulture)); } /// /// Moves the quantity of the stack to the vendor/vending container (1 to 6) /// /// quantity /// index /// call success public bool AddToConsignment(int quantity, int vendorindex) { Trace.WriteLine(String.Format("Item:AddToConsignment({0}, {1})", quantity.ToString(CultureInfo.InvariantCulture), vendorindex.ToString(CultureInfo.InvariantCulture))); return this.ExecuteMethod("AddToConsignment", quantity.ToString(CultureInfo.InvariantCulture), vendorindex.ToString(CultureInfo.InvariantCulture)); } /// /// Moves the quantity of the stack to the vendor/vending container (1 to 6) to the stack with /// the stack serial number consignment /// /// quantity /// index /// serial number of target stack /// call success public bool AddToConsignment(int quantity, int vendorindex, long stackwithserialnumber) { Trace.WriteLine(String.Format("Item:AddToConsignment({0}, {1}, {2})", quantity.ToString(CultureInfo.InvariantCulture), vendorindex.ToString(CultureInfo.InvariantCulture), stackwithserialnumber.ToString(CultureInfo.InvariantCulture))); return ExecuteMethod("AddToConsignment", quantity.ToString(CultureInfo.InvariantCulture), vendorindex.ToString(CultureInfo.InvariantCulture), stackwithserialnumber.ToString(CultureInfo.InvariantCulture)); } /// /// Adds the item to a depot /// /// depot ID /// call success public bool AddToDepot(int depotID) { Trace.WriteLine(String.Format("Item:AddToDepot({0})", depotID.ToString(CultureInfo.InvariantCulture))); return this.ExecuteMethod("AddToDepot", depotID.ToString(CultureInfo.InvariantCulture)); } /// /// Adds the quantity of the item to the depot /// /// depot ID /// quantity /// call success public bool AddToDepot(int depotID, int quantity) { Trace.WriteLine(String.Format("Item:AddToDepot({0}, {1})", depotID.ToString(CultureInfo.InvariantCulture), quantity.ToString(CultureInfo.InvariantCulture))); return this.ExecuteMethod("AddToDepot", depotID.ToString(CultureInfo.InvariantCulture), quantity.ToString(CultureInfo.InvariantCulture)); } /// /// Used to apply an item to another item /// /// target item id /// call success public bool ApplyToItem(int itemID) { Trace.WriteLine(String.Format("Item:AppltToItem({0})", itemID.ToString(CultureInfo.InvariantCulture))); return this.ExecuteMethod("ApplyToItem", itemID.ToString(CultureInfo.InvariantCulture)); } /// /// Consumes the item (Food/Drink) /// /// call success public bool Consume() { Trace.WriteLine(String.Format("Item:Consume")); return this.ExecuteMethod("Consume"); } /// /// Destroys Item /// /// call success public bool Destroy() { Trace.WriteLine(String.Format("Item:Destroy")); return this.ExecuteMethod("Destroy"); } /// /// Destroys the quantity of an item if it is in a stack /// /// call success public bool Destroy(int quantity) { Trace.WriteLine(String.Format("Item:Destroy({0})", quantity.ToString(CultureInfo.InvariantCulture))); return this.ExecuteMethod("Destroy", quantity.ToString(CultureInfo.InvariantCulture)); } /// /// Destroys Item with Confirm On /// /// call success public bool DestroyWithConf() { Trace.WriteLine(String.Format("Item:DestroyWithConf")); return this.ExecuteMethod("DestroyWithConf"); } /// /// Applies temporary enchantments after use /// /// target item ID /// call success public bool EnchantItem(int itemID) { Trace.WriteLine(String.Format("Item:EnchantItem({0})", itemID.ToString(CultureInfo.InvariantCulture))); return ExecuteMethod("EnchantITem", itemID.ToString(CultureInfo.InvariantCulture)); } /// /// Auto Equips the item /// /// call success public bool Equip() { Trace.WriteLine(String.Format("Item:Equip()")); return this.ExecuteMethod("Equip"); } /// /// Examines the item /// /// call success public bool Examine() { Trace.WriteLine(String.Format("Item:Examine()")); return this.ExecuteMethod("Examine"); } /// /// Asks the server for information about the given item. Usually takes less than a second for the information to be cached to the client. /// (Note: Most of the item datatype members require this. The only exceptions are: Name, ID, IsEquipped, LinkID, /// ToLink, Index, InContainer, InContainerID, NumSlots, Slot, Quantity, IsContainer, ContainerID, InSharedBank, InBank, NumSlotsFree, /// IsSlotOpen, ItemInSlot, NextSlotOpen, InInventory, InInventorySlot, IsInventoryContainer, IsBankContainer, IsSharedBankContainer, /// InNoSaleContainer, IsAutoConsumeable, CanBeRedeemed, IsFoodOrDrink, CanScribeNow, IsScribeable, IsActivatable, IsReady, TimeUntilReady.) /// /// Function call success public bool Initialize() { Trace.WriteLine(String.Format("Item:Initialize()")); return this.ExecuteMethod("Initialize"); } /// /// Adds the item (which must be a vending container and must be in your inventory) to /// your consignment system. It will place the vending container into the first /// free slot that is available. /// /// call success public bool InstallAsVendingContainer() { Trace.WriteLine(String.Format("Item:InstallAsVendingContainer()")); return this.ExecuteMethod("InstallAsVendingContainer"); } /// /// Moves an item to a particular slot in a bag /// /// slot /// bag id /// call success public bool Move(int bagslot, int bagID) { Trace.WriteLine(String.Format("Item:Move({0}, {1})", bagslot.ToString(CultureInfo.InvariantCulture), bagID.ToString(CultureInfo.InvariantCulture))); return ExecuteMethod("Move", bagslot.ToString(CultureInfo.InvariantCulture), bagID.ToString(CultureInfo.InvariantCulture)); } /// /// Moves a quantity of a stackable item to a particular slot in a container /// /// slot /// bag id /// quantity /// call success public bool Move(int bagslot, int bagID, int quantity) { Trace.WriteLine(String.Format("Item:Move({0}, {1}, {2}", bagslot.ToString(CultureInfo.InvariantCulture), bagID.ToString(CultureInfo.InvariantCulture), quantity.ToString(CultureInfo.InvariantCulture))); return this.ExecuteMethod("Move", bagslot.ToString(CultureInfo.InvariantCulture), bagID.ToString(CultureInfo.InvariantCulture), quantity.ToString(CultureInfo.InvariantCulture)); } /// /// Moves the item(s) to the next free inventory slot of the selected type. /// (Use quantity = 0 for non-stackable items.) /// /// inventory type /// quantity /// call success public bool Move(NextFreeType invtype, int quantity) { Trace.WriteLine(String.Format("Item:Move({0}, {1})", invtype.ToString(), quantity.ToString(CultureInfo.InvariantCulture))); return ExecuteMethod("Move", invtype.ToString(), quantity.ToString(CultureInfo.InvariantCulture)); } /// /// Opens a container /// /// call success public bool Open() { Trace.WriteLine(String.Format("Item:Open()")); return this.ExecuteMethod("Open"); } /// /// Sacrifices the item /// /// with confirmation /// call success public bool Sacrifice(bool withconfirm) { Trace.WriteLine(String.Format("Item:Sacrifice({0})", withconfirm.ToString(CultureInfo.InvariantCulture))); return withconfirm ? this.ExecuteMethod("Sacrifice", "With Confirmation") : this.ExecuteMethod("Sacrifice"); } /// /// Scribes the item /// /// call success public bool Scribe() { Trace.WriteLine(String.Format("Item:Scribe()")); return this.ExecuteMethod("Scribe"); } /// /// Attaches the item as a gift. Must be in a mail transaction. /// /// call success public bool SendAsGift() { Trace.WriteLine(String.Format("Item:SendAsGift()")); return this.ExecuteMethod("SendAsGift"); } /// /// Attaches the quantity of a stackable item as a gift. Must be in a mail transaction. /// /// quantity /// call success public bool SendAsGift(int quantity) { Trace.WriteLine(String.Format("Item:SendAsGift({0})", quantity.ToString(CultureInfo.InvariantCulture))); return this.ExecuteMethod("SendAsGift", quantity.ToString(CultureInfo.InvariantCulture)); } /// /// Toggles auto consume on and off. Check with AutoConsumeOn /// /// call success public bool ToggleAutoConsume() { Trace.WriteLine(String.Format("Item:ToggleAutoConsume()")); return this.ExecuteMethod("ToggleAutoConsume"); } /// /// Transmutes the item /// /// with confirmation /// call success public bool Transmute(bool withconfirm) { Trace.WriteLine(String.Format("Item:Transmute({0})", withconfirm.ToString(CultureInfo.InvariantCulture))); return withconfirm ? this.ExecuteMethod("Transmute", "askmefirst") : this.ExecuteMethod("Transmute"); } /// /// UnEquips the item /// /// call success public bool UnEquip() { Trace.WriteLine(String.Format("Item:UnEquip")); return this.ExecuteMethod("UnEquip"); } /// /// Uses the item /// /// call success public bool Use() { Trace.WriteLine(String.Format("Item:Use()")); return this.ExecuteMethod("Use"); } #endregion #region Enums /// /// Inventory Types for the Move() Method /// public enum NextFreeType { /// /// Non Bank Inventory /// NextFreeNonBank, /// /// Bank Inventory /// NextFreeInBank } #endregion } }