using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using LavishScriptAPI;
using MRBot.IsxEq2.AbilityEffect;
using MRBot.IsxEq2.Helpers;
using MRBot.IsxEq2.InventoryConsignment;
using MRBot.IsxEq2.UI;
namespace MRBot.IsxEq2.CharacterActor
{
///
/// This Data Type includes all of the data available to ISXEQ2 that can be gathered from the character Information structure.
///
public class Character : LavishScriptObject
{
#region Constructor
///
/// Constructor
///
/// LS Object
public Character(LavishScriptObject copy) : base(copy)
{
}
#endregion
#region Members
///
/// Returns an ability based on the index from 1 to NumAbilities
///
/// index
public Ability Ability(int id) => new Ability(GetMember("Ability", id.ToString(CultureInfo.InvariantCulture)));
///
/// Returns an ability based on ID
///
/// ID
public Ability Ability(uint id) => new Ability(GetMember("Ability", id.ToString(CultureInfo.InvariantCulture)));
///
/// Retrieves an ability based on name.
///
/// name
public Ability Ability(string name) => new Ability(GetMember("Ability", name));
///
/// Agility
///
public int Agility
{
get
{
Trace.WriteLine(String.Format("Character:Agility"));
return this.GetIntFromLSO("Agility");
}
}
///
/// Achievement Point Experience
///
public float APExp
{
get
{
Trace.WriteLine(String.Format("Character:APExp"));
return this.GetFloatFromLSO("APExp");
}
}
///
/// Arcane Affliction Counter
///
public int Arcane
{
get
{
Trace.WriteLine(String.Format("Character:Arcane"));
return this.GetIntFromLSO("Arcane");
}
}
///
/// Arcane Resist
///
public int ArcaneResist
{
get
{
Trace.WriteLine(String.Format("Character:ArcaneResist"));
return this.GetIntFromLSO("ArcaneResist");
}
}
///
/// Arcane Resist Percentage
///
public float ArcaneResistPct
{
get
{
Trace.WriteLine(String.Format("Character:ArcaneResistPct"));
return this.GetFloatFromLSO("ArcaneResistPct");
}
}
///
/// Cache of Archetype
///
private string _archetype;
///
/// Archetype (fighter, priest, scout, mage)
///
public string Archetype
{
get
{
Trace.WriteLine(String.Format("Character:Archetype"));
return _archetype ?? (_archetype = this.GetStringFromLSO("Archetype"));
}
}
///
/// Returns TRUE if at the Character Select Screen. Only works
/// after logging all the way in once.
///
public bool AtCharSelect
{
get
{
Trace.WriteLine(String.Format("Character:AtCharSelect"));
return this.GetBoolFromLSO("AtCharSelect");
}
}
///
/// Returns TRUE if auto attack is on.
///
public bool AutoAttackOn
{
get
{
Trace.WriteLine(String.Format("Character:AutoAttackOn"));
return this.GetBoolFromLSO("AutoAttackOn");
}
}
///
/// Actual bank slots free and bank container slots free
///
public int BankSlotsFree
{
get
{
Trace.WriteLine(String.Format("Character:BankSlotsFree"));
return this.GetIntFromLSO("BankSlotsFree");
}
}
///
/// Cache of BaseAgility
///
private int? _baseAgility;
///
/// Base Agility
///
public int BaseAgility
{
get
{
Trace.WriteLine(String.Format("Character:BaseAgility"));
if (!_baseAgility.HasValue)
_baseAgility = this.GetIntFromLSO("BaseAgility");
return _baseAgility.Value;
}
}
///
/// Cache of BaseIntelligence
///
private int? _baseIntelligence;
///
/// Base Intelligence
///
public int BaseIntelligence
{
get
{
Trace.WriteLine(String.Format("Character:BaseIntelligence"));
if (!_baseIntelligence.HasValue)
_baseIntelligence = this.GetIntFromLSO("BaseIntelligence");
return _baseIntelligence.Value;
}
}
///
/// Cache of BaseStamina
///
private int? _baseStamina;
///
/// Base Stamina
///
public int BaseStamina
{
get
{
Trace.WriteLine(String.Format("Character:BaseStamina"));
if (!_baseStamina.HasValue)
_baseStamina = this.GetIntFromLSO("BaseStamina");
return _baseStamina.Value;
}
}
///
/// Cache of BaseStrength
///
private int? _baseStrength;
///
/// Base Strength
///
public int BaseStrength
{
get
{
Trace.WriteLine(String.Format("Character:BaseStrength"));
if (!_baseStrength.HasValue)
_baseStrength = this.GetIntFromLSO("BaseStrength");
return _baseStrength.Value;
}
}
///
/// Cache of BaseWisdom
///
private int? _baseWisdom;
///
/// Base Wisdom
///
public int BaseWisdom
{
get
{
Trace.WriteLine(String.Format("Character:BaseWisdom"));
if (!_baseWisdom.HasValue)
_baseWisdom = this.GetIntFromLSO("BaseWisdom");
return _baseWisdom.Value;
}
}
/// TODO: Find out what Me.Breath is.
///
/// Breath
///
public float Breath
{
get
{
Trace.WriteLine(String.Format("Character:Breath"));
return this.GetFloatFromLSO("Breath");
}
}
///
/// Returns TRUE if casting a spell.
///
public bool CastingSpell
{
get
{
Trace.WriteLine(String.Format("Character:CastingSpell"));
return this.GetBoolFromLSO("CastingSpell");
}
}
///
/// Checks between the character and the given point.
///
/// X
/// Y
/// Z
public bool CheckCollision(float toX, float toY, float toZ)
{
Trace.WriteLine(String.Format("Character:CheckCollision({0}, {1}, {2})", toX.ToString(CultureInfo.InvariantCulture),
toY.ToString(CultureInfo.InvariantCulture), toZ.ToString(CultureInfo.InvariantCulture)));
return this.GetBoolFromLSO("CheckCollision", toX.ToString(CultureInfo.InvariantCulture),
toY.ToString(CultureInfo.InvariantCulture), toZ.ToString(CultureInfo.InvariantCulture));
}
///
/// Cache of Class
///
private string _class;
///
/// Class (warrior, brawler, crusader, sorcerer, enchanter, summoner, druid,
/// cleric, shaman, shaper, bard, predator, rogue, animalist)
///
public string Class
{
get
{
Trace.WriteLine(String.Format("Character:Class"));
return _class ?? (_class = this.GetStringFromLSO("Class"));
}
}
///
/// Returns TRUE if Combat Experience is enabled.
///
public bool CombatExpEnabled
{
get
{
Trace.WriteLine(String.Format("Character:CombatExpEnabled"));
return this.GetBoolFromLSO("CombatExpEnabled");
}
}
///
/// Copper
///
public int Copper
{
get
{
Trace.WriteLine(String.Format("Character:Copper"));
return this.GetIntFromLSO("Copper");
}
}
///
/// The number of effects. (Beneficial, Detrimental, All)
///
/// effect type
public int CountEffects(EffectType type = EffectType.All)
{
Trace.WriteLine(String.Format("Character:CountEffects({0})", type));
switch (type)
{
case EffectType.Beneficial:
case EffectType.Detrimental:
return this.GetIntFromLSO("CountEffects", type.ToString());
default:
return this.GetIntFromLSO("CountEffects");
}
}
///
/// The number of maintained effects.
///
public int CountMaintained
{
get
{
Trace.WriteLine(String.Format("Character:CountMaintained"));
return this.GetIntFromLSO("CountMaintained");
}
}
///
/// Cursed Counter
///
public bool Cursed
{
get
{
Trace.WriteLine(String.Format("Character:Cursed"));
return GetMember("Cursed");
}
}
///
/// This member will return an 'actor' object of whatever is currently underneath your mouse cursor.
///
public Actor CursorActor
{
get
{
Trace.WriteLine(String.Format("Character:CursorActor"));
return new Actor(this.GetMember("CursorActor"));
}
}
///
/// Retrieves the item at the specified index of the CustomInventoryArray
///
/// index
public Item CustomInventory(int index)
{
Trace.WriteLine(String.Format("Character:CustomInventory({0})", index.ToString(CultureInfo.InvariantCulture)));
return new Item(this.GetMember("CustomInventory", index.ToString(CultureInfo.InvariantCulture)));
}
///
/// Retrieves the item based on the search arguments from the CustomInventoryArray
///
/// search arguments
public Item CustomInventory(params string[] args)
{
Trace.WriteLine(String.Format("Character:CustomInventory({0})", String.Join(", ", args)));
return new Item(this.GetMember("CustomInventory", args));
}
///
/// Returns the size of the CustomInventoryArray
///
public int CustomInventoryArraySize
{
get
{
Trace.WriteLine(String.Format("Character:CustomInventoryArraySize"));
return this.GetIntFromLSO("CustomInventoryArraySize");
}
}
///
/// Dissipation
///
public int Dissipation
{
get
{
Trace.WriteLine(String.Format("Character:Dissipation"));
return this.GetIntFromLSO("Dissipation");
}
}
///
/// Dissonance
///
public int Dissonance
{
get
{
Trace.WriteLine(String.Format("Character:Dissonance"));
return this.GetIntFromLSO("Dissonance");
}
}
///
/// Dissonance Remaining
///
public int DissonanceRemaining
{
get
{
Trace.WriteLine(String.Format("Character:DissonanceRemaining"));
return this.GetIntFromLSO("DissonanceRemaining");
}
}
///
/// Retrieves the effect of the given type at the specified index. (Beneficial, Detrimental, All)
///
/// effect type
/// index
public Effect Effect(int index, EffectType type = EffectType.All)
{
Trace.WriteLine(String.Format("Character:CountEffects({0}, {1})", type, index.ToString(CultureInfo.InvariantCulture)));
switch (type)
{
case EffectType.Beneficial:
case EffectType.Detrimental:
return new Effect(this.GetMember("Effect", type.ToString(), index.ToString(CultureInfo.InvariantCulture)));
default:
return new Effect(this.GetMember("Effect", index.ToString(CultureInfo.InvariantCulture)));
}
}
///
/// Retrieves the effect of the given type at the specified index. (Beneficial, Detrimental, All(
///
/// type
/// name
public Effect Effect(string name, EffectType type = EffectType.All)
{
Trace.WriteLine(String.Format("Character:CountEffects({0}, {1})", type, name));
switch (type)
{
case EffectType.Beneficial:
case EffectType.Detrimental:
return new Effect(this.GetMember("Effect", type.ToString(), name));
default:
return new Effect(this.GetMember("Effect", name));
}
}
///
/// Effective Level (Mentored or Chrono)
///
public int EffectiveLevel
{
get
{
Trace.WriteLine(String.Format("Character:EffectiveLevel"));
return this.GetIntFromLSO("EffectiveLevel");
}
}
///
/// Elemental Affliction Counter
///
public int Elemental
{
get
{
Trace.WriteLine(String.Format("Character:Elemental"));
return GetMember("Elemental");
}
}
///
/// Elemental Resist
///
public int ElementalResist
{
get
{
Trace.WriteLine(String.Format("Character:ElementalResist"));
return GetMember("ElementalResist");
}
}
///
/// Elemental Resist Percent
///
public int ElementalResistPct
{
get
{
Trace.WriteLine(String.Format("Character:ElementalResistPct"));
return GetMember("ElementalResistPct");
}
}
///
/// Retrieves an equipped item that matches the search criteria
///
/// search criteria
public Item Equipment(params string[] args)
{
Trace.WriteLine(String.Format("Character:Equipment({0})", String.Join(", ", args)));
return new Item(this.GetMember("Equipment", args));
}
///
/// Experience
///
public int Exp
{
get
{
Trace.WriteLine(String.Format("Character:Exp"));
return this.GetIntFromLSO("Exp");
}
}
/// TODO: Find out why Me.ExpDebt returns NULL
///
/// Experience Debt
///
public float ExpDebt
{
get
{
Trace.WriteLine(String.Format("Character:ExpDebt"));
return this.GetFloatFromLSO("ExpDebt");
}
}
///
/// Experience Points
///
public float ExpPoints
{
get
{
Trace.WriteLine(String.Format("Character:ExpPoints"));
return this.GetFloatFromLSO("ExpPoints");
}
}
///
/// Experience Points Needed to Reach the Next Level
///
public float ExpPointsToLevel
{
get
{
Trace.WriteLine(String.Format("Character:ExpPointsToLevel"));
return this.GetFloatFromLSO("ExpPointsToLevel");
}
}
///
/// Cache of Gender
///
private string _gender;
///
/// Gender
///
public string Gender
{
get
{
Trace.WriteLine(String.Format("Character:Gender"));
return _gender ?? (_gender = this.GetStringFromLSO("Gender"));
}
}
///
/// Returns an IEnumerable of all abilities.
///
public List QueryAbilities()
{
Trace.WriteLine(String.Format("Character:QueryAbilities()"));
return this.GetListFromMethod("QueryAbilities", "ability");
}
///
/// Returns an IEnumerable of all equipped items.
///
///
public IEnumerable- GetEquipment()
{
Trace.WriteLine(String.Format("Character:GetEquipment()"));
return Util.GetListFromMember
- (this, "GetEquipment", "item");
}
// TODO: Research Me.GetGameData
///
/// Returns the EQ2UIElement at the specified path.
///
/// path
public EQ2Widget GetGameData(string path)
{
Trace.WriteLine(String.Format("Character:GetGameData({0})", path));
return new EQ2Widget(this.GetMember("GetGameData", path));
}
///
/// Returns an IEnumerable of all items (including bank) NOT EQUIPPED.
///
public IEnumerable
- QueryInventory()
{
Trace.WriteLine(String.Format("Character:QueryInventory()"));
return Util.GetListFromMember
- (this, "QueryInventory?", "item");
}
///
/// Returns an IEnumerable of all items (excluding bank) NOT EQUIPPED
///
public IEnumerable
- GetInventoryAtHand()
{
Trace.WriteLine(String.Format("Character:GetInventory()"));
return Util.GetListFromMember
- (this, "GetInventory", "item");
}
///
/// Gold
///
public int Gold
{
get
{
Trace.WriteLine(String.Format("Character:Gold"));
return this.GetIntFromLSO("Gold");
}
}
///
/// Returns the group member at the specified index between 1 and 5.
/// The player is at index 0. Me.Group(0) is the same as Me.ToActor
///
/// index
public GroupMember Group(int index)
{
Trace.WriteLine(String.Format("Character:Group({0})", index.ToString(CultureInfo.InvariantCulture)));
return new GroupMember(this.GetMember("Group", index.ToString(CultureInfo.InvariantCulture)));
}
///
/// Returns the group member matching the name provided.
///
/// name
public GroupMember Group(string name)
{
Trace.WriteLine(String.Format("Character:Group({0})", name));
return new GroupMember(this.GetMember("Group", name));
}
///
/// Returns the number of members in the group from 1 to 6.
///
public int GroupCount
{
get
{
Trace.WriteLine(String.Format("Character:GroupCount"));
return this.GetIntFromLSO("GroupCount");
}
}
///
/// Returns TRUE if the character is Grouped
///
public bool Grouped
{
get
{
Trace.WriteLine(String.Format("Character:Grouped"));
return this.GetBoolFromLSO("Grouped");
}
}
///
/// Returns TRUE if guild privacy is on
///
public bool GuildPrivacyOn
{
get
{
Trace.WriteLine(String.Format("Character:GuildPrivacyOn"));
return GetMember("GuildPrivacyOn");
}
}
///
/// Heading. Returns heading as degrees (think compass), to a precision of 2 decimal places.
///
public float Heading
{
get
{
Trace.WriteLine(String.Format("Character:Heading"));
return this.GetFloatFromLSO("Heading");
}
}
///
/// Returns the heading you would need to face to reach the target point. Better known as bearing.
///
/// X
/// Y
/// Z
public float HeadingTo(float toX, float toY, float toZ)
{
Trace.WriteLine(String.Format("Character:HeadingTo({0}, {1}, {2})", toX.ToString(CultureInfo.InvariantCulture),
toY.ToString(CultureInfo.InvariantCulture), toZ.ToString(CultureInfo.InvariantCulture)));
return this.GetFloatFromLSO("HeadingTo", toX.ToString(CultureInfo.InvariantCulture),
toY.ToString(CultureInfo.InvariantCulture), toZ.ToString(CultureInfo.InvariantCulture));
}
///
/// Returns health as a percentage.
///
public int Health
{
get
{
Trace.WriteLine(String.Format("Character:Health"));
return GetMember("Health");
}
}
///
/// Health Regeneration
///
public int HealthRegen
{
get
{
Trace.WriteLine(String.Format("Character:HealthRegen"));
return this.GetIntFromLSO("HealthRegen");
}
}
///
/// ID
///
public int ID
{
get
{
Trace.WriteLine(String.Format("Character:ID"));
return this.GetIntFromLSO("ID");
}
}
///
/// Returns TRUE if user is "ignoring all" as toggled with the 'eq2ignore all' command.
///
public bool IgnoringAll
{
get
{
Trace.WriteLine(String.Format("Character:IgnoringAll"));
return this.GetBoolFromLSO("IgnoringAll");
}
}
///
/// Returns TRUE if the camera is in First Person
///
public bool InFirstPersonView
{
get
{
Trace.WriteLine(String.Format("Character:In1stPersonView"));
return this.GetBoolFromLSO("In1stPersonView");
}
}
///
/// Returns TRUE if the camera is in Third Person
///
public bool InThirdPersonView
{
get
{
Trace.WriteLine(String.Format("Character:In3rdPersonView"));
return this.GetBoolFromLSO("In3rdPersonView");
}
}
///
/// Returns TRUE if the character is in combat
///
public bool InCombat
{
get
{
Trace.WriteLine(String.Format("Character:InCombat"));
return this.GetBoolFromLSO("InCombat");
}
}
///
/// Returns TRUE if the character is in the game world. Only
/// works if you have logged in completely once.
///
public bool InGameWorld
{
get
{
Trace.WriteLine(String.Format("Character:InGameWorld"));
return this.GetBoolFromLSO("InGameWorld");
}
}
///
/// Returns TRUE if Initializing Effects on the character.
///
public bool InitializingEffects
{
get
{
Trace.WriteLine(String.Format("Character:InitializingEffects"));
return this.GetBoolFromLSO("InitializingEffects");
}
}
///
/// Returns TRUE if the character is in a raid.
///
public bool InRaid
{
get
{
Trace.WriteLine(String.Format("Character:InRaid"));
return this.GetBoolFromLSO("InRaid");
}
}
///
/// Intelligence
///
public int Intelligence
{
get
{
Trace.WriteLine(String.Format("Character:InRaid"));
return this.GetIntFromLSO("Intelligence");
}
}
///
/// Retrieves the inventory item based on the search criteria
///
/// criteria
public Item Inventory(params string[] args)
{
Trace.WriteLine(String.Format("Character:Inventory({0})", String.Join(", ", args)));
return new Item(this.GetMember("Inventory", args));
}
///
/// Actual inventory slots free and inventory container slots free
///
public int InventorySlotsFree
{
get
{
Trace.WriteLine(String.Format("Character:InventorySlotsFree"));
return this.GetIntFromLSO("InventorySlotsFree");
}
}
///
/// Returns TRUE if the character is in the water
///
public bool InWater
{
get
{
Trace.WriteLine(String.Format("Character:InWater"));
return this.GetBoolFromLSO("InWater");
}
}
///
/// Returns TRUE if the character is afflicted by arcane, noxious, etc.
///
public bool IsAfflicted
{
get
{
Trace.WriteLine(String.Format("Character:IsAfflicted"));
return this.GetBoolFromLSO("IsAfflicted");
}
}
///
/// Returns TRUE if the character is flagged AFK
///
public bool IsAFK
{
get
{
Trace.WriteLine(String.Format("Character:IsAfflicted"));
return this.GetBoolFromLSO("IsAFK");
}
}
///
/// Returns TRUE if the character is flagged anonymous
///
public bool IsAnonymous
{
get
{
Trace.WriteLine(String.Format("Character:IsAnonymous"));
return this.GetBoolFromLSO("IsAnonymous");
}
}
///
/// Returns TRUE if the character is camping
///
public bool IsCamping
{
get
{
Trace.WriteLine(String.Format("Character:IsCamping"));
return this.GetBoolFromLSO("IsCamping");
}
}
///
/// Returns TRUE if the character is declining duel invites
///
public bool IsDecliningDuelInvites
{
get
{
Trace.WriteLine(String.Format("Character:IsDecliningDuelInvites"));
return this.GetBoolFromLSO("IsDecliningDuelInvites");
}
}
///
/// Returns TRUE if the character is declining group invites
///
public bool IsDecliningGroupInvites
{
get
{
Trace.WriteLine(String.Format("Character:IsDecliningGroupInvites"));
return this.GetBoolFromLSO("IsDecliningGroupInvites");
}
}
///
/// Returns TRUE if the character is declining guild invites
///
public bool IsDecliningGuildInvites
{
get
{
Trace.WriteLine(String.Format("Character:IsDecliningGuildInvites"));
return this.GetBoolFromLSO("IsDecliningGuildInvites");
}
}
///
/// Returns TRUE if the character is declining raid invites
///
public bool IsDecliningRaidInvites
{
get
{
Trace.WriteLine(String.Format("Character:IsDecliningRaidInvites"));
return this.GetBoolFromLSO("IsDecliningRaidInvites");
}
}
///
/// Returns TRUE if the character is declining trade invites
///
public bool IsDecliningTradeInvites
{
get
{
Trace.WriteLine(String.Format("Character:IsDecliningTradeInvites"));
return this.GetBoolFromLSO("IsDecliningTradeInvites");
}
}
///
/// Returns TRUE if the character is on a hate list
///
public bool IsHated
{
get
{
Trace.WriteLine(String.Format("Character:IsHated"));
return this.GetBoolFromLSO("IsHated");
}
}
///
/// Returns TRUE if the character is engaged in PvP combat
///
public bool IsInPVP
{
get
{
Trace.WriteLine(String.Format("Character:IsInPvP"));
return this.GetBoolFromLSO("IsInPVP");
}
}
///
/// Returns TRUE if the character is looking for group
///
public bool IsLFG
{
get
{
Trace.WriteLine(String.Format("Character:IsLFG"));
return this.GetBoolFromLSO("IsLFG");
}
}
///
/// Returns TRUE if the character is looking for work
///
public bool IsLFW
{
get
{
Trace.WriteLine(String.Format("Character:IsLFW"));
return this.GetBoolFromLSO("IsLFW");
}
}
///
/// Returns TRUE if the character is moving
///
public bool IsMoving
{
get
{
Trace.WriteLine(String.Format("Character:IsMoving"));
return this.GetBoolFromLSO("IsMoving");
}
}
///
/// Returns TRUE if the character is roleplaying
///
public bool IsRolePlaying
{
get
{
Trace.WriteLine(String.Format("Character:IsRoleplaying"));
return this.GetBoolFromLSO("IsRolePlaying");
}
}
///
/// Returns TRUE if the character is sitting
///
public bool IsSitting
{
get
{
Trace.WriteLine(String.Format("Character:IsSitting"));
return this.GetBoolFromLSO("IsSitting");
}
}
///
/// Cache of Level
///
private int? _level;
///
/// Level
///
public int Level
{
get
{
Trace.WriteLine(String.Format("Character:Level"));
if (!_level.HasValue)
_level = this.GetIntFromLSO("Level");
return _level.Value;
}
}
///
/// Returns the maintained effect at the index
///
/// index
public Maintained Maintained(int index)
{
Trace.WriteLine(String.Format("Character:Maintained({0})", index.ToString(CultureInfo.InvariantCulture)));
return new Maintained(this.GetMember("Maintained", index.ToString(CultureInfo.InvariantCulture)));
}
///
/// Returns the maintained effect by name
///
///
///
public Maintained Maintained(string name)
{
Trace.WriteLine(String.Format("Character:Maintained({0})", name));
return new Maintained(this.GetMember("Maintained", name));
}
///
/// Maximum Achievement Points
///
public int MaxAPs
{
get
{
Trace.WriteLine(String.Format("Character:MaxAPs"));
return this.GetIntFromLSO("MaxAPs");
}
}
///
/// Cache of MaxConc
///
private int? _maxConc;
///
/// Max Concentration
///
public int MaxConc
{
get
{
Trace.WriteLine(String.Format("Character:MaxConc"));
if (!_maxConc.HasValue)
_maxConc = this.GetIntFromLSO("MaxConc");
return _maxConc.Value;
}
}
///
/// Cache of MaxDissonance
///
private int? _maxDissonance;
///
/// Max Dissonance
///
public int MaxDissonance
{
get
{
Trace.WriteLine(String.Format("Character:MaxDissonance"));
if (!_maxDissonance.HasValue)
_maxDissonance = this.GetIntFromLSO("MaxDissonance");
return _maxDissonance.Value;
}
}
///
/// Max Health
///
public int MaxHealth
{
get
{
Trace.WriteLine(String.Format("Character:MaxHealth"));
return this.GetIntFromLSO("MaxHealth");
}
}
///
/// Max Power
///
public int MaxPower
{
get
{
Trace.WriteLine(String.Format("Character:MaxPower"));
return this.GetIntFromLSO("MaxPower");
}
}
///
/// Cache of MentoringXPAdj
///
private float? _mentoringXPAdj;
///
/// Mentoring XP Adjustment
///
public float MentoringXPAdj
{
get
{
Trace.WriteLine(String.Format("Character:MentoringXPAdj"));
if (!_mentoringXPAdj.HasValue)
_mentoringXPAdj = this.GetFloatFromLSO("MentoringXPAdj");
return _mentoringXPAdj.Value;
}
}
///
/// Returns the object the character is capable of selling at the specified index. (1 to NumItemsICanSell)
///
/// index
public Merchandise Merchandise(int index)
{
Trace.WriteLine(String.Format("Character:Merchandise({0})", index.ToString(CultureInfo.InvariantCulture)));
return new Merchandise(this.GetMember("Merchandise", index.ToString(CultureInfo.InvariantCulture)));
}
///
/// Returns the object the character is capable of selling based on name.
///
/// name
public Merchandise Merchandise(string name)
{
Trace.WriteLine(String.Format("Character:Merchandise({0})", name));
return new Merchandise(this.GetMember("Merchandise", name));
}
///
/// Cache of Name
///
private string _name;
///
/// Name
///
public string Name
{
get
{
Trace.WriteLine(String.Format("Character:Name"));
return _name ?? (_name = this.GetStringFromLSO("Name"));
}
}
///
/// Returns an integer which is the ID of the first available container in the inventory that has an open slot
///
public int NextFreeInvContainer
{
get
{
Trace.WriteLine(String.Format("Character:NextFreeInvContainer"));
return this.GetIntFromLSO("NextFreeInvContainer");
}
}
///
/// Noxious Affliction Counter
///
public int Noxious
{
get
{
Trace.WriteLine(String.Format("Character:Noxious"));
return this.GetIntFromLSO("Noxious");
}
}
///
/// Noxious Resist
///
public int NoxiousResist
{
get
{
Trace.WriteLine(String.Format("Character:NoxiousResist"));
return this.GetIntFromLSO("NoxiousResist");
}
}
///
/// Noxious Resist Percent
///
public float NoxiousResistPct
{
get
{
Trace.WriteLine(String.Format("Character:NoxiousResistPct"));
return this.GetFloatFromLSO("NoxiousResistPct");
}
}
///
/// Returns the number of abilities your character currently has in his/her knowledge book.
///
public int NumAbilities
{
get
{
Trace.WriteLine(String.Format("Character:NumAbilities"));
return this.GetIntFromLSO("NumAbilities");
}
}
///
/// The number of effects. (Beneficial, Detrimental, All)
///
/// type
public int NumEffects(EffectType type = EffectType.All)
{
Trace.WriteLine(String.Format("Character:NumEffects({0})", type));
switch (type)
{
case EffectType.Beneficial:
case EffectType.Detrimental:
return this.GetIntFromLSO("NumEffects", type.ToString());
default:
return this.GetIntFromLSO("NumEffects");
}
}
///
/// Returns the number of items that the character is capable of selling
/// (ie, the number of items in the inventory minus the number of NO VALUE and NO TRADE items.)
///
public int NumItemsICanSell
{
get
{
Trace.WriteLine(String.Format("Character:NumItemsICanSell"));
return this.GetIntFromLSO("NumItemsICanSell");
}
}
///
/// Returns the number of recipes your character currently has in his/her recipe book.
///
public int NumRecipes
{
get
{
Trace.WriteLine(String.Format("Character:NumRecipes"));
return this.GetIntFromLSO("NumRecipes");
}
}
///
/// Returns the number of vending containers
///
public int NumVendingContainers
{
get
{
Trace.WriteLine(String.Format("Character:NumVendingContainers"));
return this.GetIntFromLSO("NumVendingContainers");
}
}
///
/// Returns the number of vending containers
///
public int NumVendors
{
get
{
Trace.WriteLine(String.Format("Character:NumVendors"));
return this.GetIntFromLSO("NumVendors");
}
}
///
/// Returns the character's pet, if any.
///
public Actor Pet
{
get
{
Trace.WriteLine(String.Format("Character:Pet"));
return new Actor(this.GetMember("Pet"));
}
}
///
/// Platinum
///
public int Platinum
{
get
{
Trace.WriteLine(String.Format("Character:Platinum"));
return this.GetIntFromLSO("Platinum");
}
}
///
/// Power
///
public int Power
{
get
{
Trace.WriteLine(String.Format("Character:Power"));
return this.GetIntFromLSO("Power");
}
}
///
/// Power Regen
///
public int PowerRegen
{
get
{
Trace.WriteLine(String.Format("Character:PowerRegen"));
return this.GetIntFromLSO("PowerRegen");
}
}
///
/// Cache of Race
///
private string _race;
///
/// Race
///
public string Race
{
get
{
Trace.WriteLine(String.Format("Character:Race"));
return _race ?? (_race = this.GetStringFromLSO("Race"));
}
}
///
/// Number of people in the raid. If you are not in a raid, this returns 0.
///
public int Raid()
{
Trace.WriteLine(String.Format("Character:Raid()"));
return this.GetIntFromLSO("Raid");
}
///
/// Returns the raid member by Actor ID or Raid Member number
///
/// ID or member number
public GroupMember Raid(int number)
{
Trace.WriteLine(String.Format("Character:Raid({0})", number.ToString(CultureInfo.InvariantCulture)));
return number < 25 ? new GroupMember(this.GetMember("Raid", number.ToString(CultureInfo.InvariantCulture)))
: new GroupMember(this.GetMember("Raid", "id", number.ToString(CultureInfo.InvariantCulture)));
}
///
/// Returns the raid member by group and member numbers
///
/// group number
/// member number
public GroupMember Raid(int group, int member)
{
Trace.WriteLine(String.Format("Character:Raid({0}, {1})", group.ToString(CultureInfo.InvariantCulture),
member.ToString(CultureInfo.InvariantCulture)));
return new GroupMember(this.GetMember("Raid", group.ToString(CultureInfo.InvariantCulture),
member.ToString(CultureInfo.InvariantCulture)));
}
///
/// Number of people in the raid. If you are not in a raid, this returns 0.
///
public int RaidCount
{
get
{
Trace.WriteLine(String.Format("Character:RaidCount"));
return this.GetIntFromLSO("RaidCount");
}
}
///
/// Returns the character's raid group number
///
public int RaidGroupNum
{
get
{
Trace.WriteLine(String.Format("Character:RaidGroupNum"));
return this.GetIntFromLSO("RaidGroupNum");
}
}
///
/// Returns TRUE if the ranged auto attack is on
///
public bool RangedAutoAttackOn
{
get
{
Trace.WriteLine(String.Format("Character:RangedAutoAttackOn"));
return this.GetBoolFromLSO("RangedAutoAttackOn");
}
}
///
/// Returns the recipe at the specified index
///
/// index
public Recipe.Recipe Recipe(int index)
{
Trace.WriteLine(String.Format("Character:Recipe({0})", index.ToString(CultureInfo.InvariantCulture)));
return new Recipe.Recipe(this.GetMember("Recipe", index.ToString(CultureInfo.InvariantCulture)));
}
///
/// Returns the recipe with the ID provided
///
/// ID
public Recipe.Recipe Recipe(uint id)
{
Trace.WriteLine(String.Format("Character:Recipe({0})", id.ToString(CultureInfo.InvariantCulture)));
return new Recipe.Recipe(this.GetMember("Recipe", "id", id.ToString(CultureInfo.InvariantCulture)));
}
///
/// Returns the recipe with the name provided
///
///
public Recipe.Recipe Recipe(string name)
{
Trace.WriteLine(String.Format("Character:Recipe({0})", name));
return new Recipe.Recipe(this.GetMember("Recipe", name));
}
///
/// Returns the number of shared bank slots free
///
public int SharedBankSlotsFree
{
get
{
Trace.WriteLine(String.Format("Character:SharedBankSlotsFree)"));
return this.GetIntFromLSO("SharedBankSlotsFree");
}
}
///
/// Silver
///
public int Silver
{
get
{
Trace.WriteLine(String.Format("Character:Silver)"));
return this.GetIntFromLSO("Silver");
}
}
///
/// Stamina
///
public int Stamina
{
get
{
Trace.WriteLine(String.Format("Character:Stamina)"));
return this.GetIntFromLSO("Stamina");
}
}
///
/// Strength
///
public int Strength
{
get
{
Trace.WriteLine(String.Format("Character:Strength)"));
return this.GetIntFromLSO("Strength");
}
}
///
/// Cache of SubClass
///
private string _subClass;
///
/// Sub Class. What we normally think of as Class. (Guardian, Mystic, etc...)
///
public string SubClass
{
get
{
Trace.WriteLine(String.Format("Character:SubClass)"));
return _subClass ?? (_subClass = this.GetStringFromLSO("SubClass"));
}
}
///
/// Returns TRUE if you have Line of Sight to your current target.
///
public bool TargetLOS
{
get
{
Trace.WriteLine(String.Format("Character:TargetLOS"));
return this.GetBoolFromLSO("TargetLOS");
}
}
///
/// Returns the time until camp out. Starts at 20, and updates every 5 seconds.
///
public float TimeToCampOut
{
get
{
Trace.WriteLine(String.Format("Character:TimeToCampout"));
return this.GetFloatFromLSO("TimeToCampOut");
}
}
///
/// Returns as Actor
///
public Actor ToActor
{
get
{
Trace.WriteLine(String.Format("Character:ToActor"));
return new Actor(this.GetMember("ToActor"));
}
}
///
/// Target, if any.
///
public Actor Target
{
get
{
Trace.WriteLine(String.Format("Actor:Target"));
return new Actor(this.GetMember("Target"));
}
}
///
/// Location (or position in Point3f)
///
public Point3f Loc
{
get
{
Trace.WriteLine(String.Format("Actor:Loc"));
return new Point3f(this.GetMember("Loc"));
}
}
///
/// Total Earned APs
///
public int TotalEarnedAPs
{
get
{
Trace.WriteLine(String.Format("Character:TotalEarnedAPs"));
return this.GetIntFromLSO("TotalEarnedAPs");
}
}
///
/// Total slot capacity of all the characters vending containers combined.
///
public int TotalVendingCapacity
{
get
{
Trace.WriteLine(String.Format("Character:TotalVendingCapacity"));
return this.GetIntFromLSO("TotalVendingCapacity");
}
}
///
/// Trauma Affliction Counter
///
public int Trauma
{
get
{
Trace.WriteLine(String.Format("Character:Trauma"));
return this.GetIntFromLSO("Trauma");
}
}
///
/// Cache of TSArchetype
///
private string _tSArchetype;
///
/// Trade Skill Archetype (artisan, etc.)
///
public string TSArchetype
{
get
{
Trace.WriteLine(String.Format("Character:TSArcheype"));
return _tSArchetype ?? (_tSArchetype = this.GetStringFromLSO("TSArchetype"));
}
}
///
/// Cache of TSClass
///
private string _tSClass;
///
/// Trade Skill Class (outfitter, etc.)
///
public string TSClass
{
get
{
Trace.WriteLine(String.Format("Character:TSClass"));
return _tSClass ?? (_tSClass = this.GetStringFromLSO("TSClass"));
}
}
///
/// Trade Skill Experience
///
public float TSExp
{
get
{
Trace.WriteLine(String.Format("Character:TSExp"));
return this.GetFloatFromLSO("TSExp");
}
}
///
/// Trade Skill Experience Debt
///
public float TSExpDebt
{
get
{
Trace.WriteLine(String.Format("Character:TSExpDebt"));
return this.GetFloatFromLSO("TSExpDebt");
}
}
///
/// Trade Skill Experience Points
///
public float TSExpPoints
{
get
{
Trace.WriteLine(String.Format("Character:TSExpPoints"));
return this.GetFloatFromLSO("TSExpPoints");
}
}
///
/// Trade Skill Experience Points Needed to Reach the Next Level
///
public float TSExpPointsToLevel
{
get
{
Trace.WriteLine(String.Format("Character:TSExpPointsToLevel"));
return this.GetFloatFromLSO("TSExpPointsToLevel");
}
}
///
/// Trade Skill Level
///
public int TSLevel
{
get
{
Trace.WriteLine(String.Format("Character:TSLevel"));
return this.GetIntFromLSO("TSLevel");
}
}
///
/// Trade Skill SubClass (armorer, etc.)
///
public string TSSubClass
{
get
{
Trace.WriteLine(String.Format("Character:TSSubClass"));
return this.GetStringFromLSO("TSSubClass");
}
}
///
/// Trade Skill Vitality
///
public float TSVitality
{
get
{
Trace.WriteLine(String.Format("Character:TSVitality"));
return this.GetFloatFromLSO("TSVitality");
}
}
///
/// Amount of Concentration Used
///
public int UsedConc
{
get
{
Trace.WriteLine(String.Format("Character:UsedConc"));
return this.GetIntFromLSO("UsedConc");
}
}
///
/// Retrieves the vending container at the index (1 to 6)
///
/// index
public VendingContainer Vending(int index)
{
Trace.WriteLine(String.Format("Character:Vending({0})", index.ToString(CultureInfo.InvariantCulture)));
return new VendingContainer(this.GetMember("Vending", index.ToString(CultureInfo.InvariantCulture)));
}
///
/// Retrieves the vending container by exact name
///
/// name
public VendingContainer Vending(string name)
{
Trace.WriteLine(String.Format("Character:Vending({0})", name));
return new VendingContainer(this.GetMember("Vending", name));
}
///
/// Number of vending container slots currently free for use
///
public int VendingCapacityFree
{
get
{
Trace.WriteLine(String.Format("Character:VendingCapacityFree"));
return this.GetIntFromLSO("VendingCapacityFree");
}
}
///
/// Number of vending container slots currently being used
///
public int VendingCapacityUsed
{
get
{
Trace.WriteLine(String.Format("Character:VendingCapacityUsed"));
return this.GetIntFromLSO("VendingCapacityUsed");
}
}
///
/// Experience Vitality
///
public float Vitality
{
get
{
Trace.WriteLine(String.Format("Character:Vitality"));
return this.GetFloatFromLSO("Vitality");
}
}
///
/// Water Depth
///
public float WaterDepth
{
get
{
Trace.WriteLine(String.Format("Character:WaterDepth"));
return this.GetFloatFromLSO("WaterDepth");
}
}
///
/// Wisdom
///
public int Wisdom
{
get
{
Trace.WriteLine(String.Format("Character:Wisdom"));
return this.GetIntFromLSO("Wisdom");
}
}
///
/// X-coordinate
///
public float X
{
get
{
Trace.WriteLine(String.Format("Character:X"));
return GetMember("X");
}
}
///
/// Y-coordinate
///
public float Y
{
get
{
Trace.WriteLine(String.Format("Character:Y"));
return this.GetFloatFromLSO("Y");
}
}
///
/// Z-coordinate
///
public float Z
{
get
{
Trace.WriteLine(String.Format("Character:Z"));
return this.GetFloatFromLSO("Z");
}
}
#endregion
#region Methods
///
/// Deposits the specified quantity of coin into the player's bank. May be used
/// to transfer money from the shared bank as well.
///
/// type of coin
/// amount of coin
/// use shared bank as source
/// call success
public bool BankDeposit(CoinType type, int amount, bool useSharedBank = false)
{
Trace.WriteLine(String.Format("Character:BankDeposit({0}, {1}, {2})", type,
amount.ToString(CultureInfo.InvariantCulture), useSharedBank));
return !useSharedBank ? this.ExecuteMethod("BankDeposit", type.ToString()[0].ToString(CultureInfo.InvariantCulture),
amount.ToString(CultureInfo.InvariantCulture)) : this.ExecuteMethod("BankDeposit",
type.ToString()[0].ToString(CultureInfo.InvariantCulture), amount.ToString(CultureInfo.InvariantCulture), "FromShared");
}
///
/// Withdraws the selected quantity of coin from the player's bank.
///
/// type of coin
/// amount of coin
/// call success
public bool BankWithdraw(CoinType type, int amount)
{
Trace.WriteLine(String.Format("Character:BankWithdraw({0}, {1})", type,
amount.ToString(CultureInfo.InvariantCulture)));
return this.ExecuteMethod("BankWithdraw", type.ToString()[0].ToString(CultureInfo.InvariantCulture),
amount.ToString(CultureInfo.InvariantCulture));
}
///
/// Creates a custom inventory array of the specified type.
///
/// inventory type
/// call success
public bool CreateCustomInventoryArray(InvType type = InvType.All)
{
Trace.WriteLine(String.Format("Character:CreateCustomInventoryArray({0})", type.ToString()));
return ExecuteMethod("CreateCustomInventoryArray", type.ToString().ToLower());
}
///
/// Deposits the specified amount of copper and status into house escrow
///
/// copper
/// status
/// call success
public void DepositIntoHouseEscrow(int coin, int status)
{
Trace.WriteLine(String.Format("Character:DepositIntoHouseEscrow({0}, {1})", coin.ToString(CultureInfo.InvariantCulture),
status.ToString(CultureInfo.InvariantCulture)));
ExecuteMethod("DepositIntoHouseEscrow", coin.ToString(CultureInfo.InvariantCulture),
status.ToString(CultureInfo.InvariantCulture));
}
///
/// Rotates the character to face the supplied heading (0 to 360)
///
///
/// call success
public bool Face(float heading)
{
Trace.WriteLine(String.Format("Character:Face({0})", heading.ToString(CultureInfo.InvariantCulture)));
return this.ExecuteMethod("Face", heading.ToString(CultureInfo.InvariantCulture));
}
///
/// Deposits the specified amount of silver in the designated guild bank
///
/// bank number (1-4)
/// amount to deposit in silver
/// call success
public bool GuildBankDeposit(int bank, int amount)
{
Trace.WriteLine(String.Format("Character:GuildBankDeposit({0}, {1})", bank.ToString(CultureInfo.InvariantCulture),
amount.ToString(CultureInfo.InvariantCulture)));
return this.ExecuteMethod("GuildBankDeposit", bank.ToString(CultureInfo.InvariantCulture),
amount.ToString(CultureInfo.InvariantCulture));
}
///
/// Withdraws the specified amount of silver from the designated guild bank
///
/// bank number (1-4)
/// amount to withdraw in silver
/// call success
public bool GuildBankWithdraw(int bank, int amount)
{
Trace.WriteLine(String.Format("Character:GuildBankWithdraw({0}, {1})", bank.ToString(CultureInfo.InvariantCulture),
amount.ToString(CultureInfo.InvariantCulture)));
return this.ExecuteMethod("GuildBankWithdraw", bank.ToString(CultureInfo.InvariantCulture),
amount.ToString(CultureInfo.InvariantCulture));
}
///
/// Initializes character effects
///
/// call success
public bool InitializeEffects()
{
Trace.WriteLine(String.Format("Character:InitializeEffects()"));
return this.ExecuteMethod("InitializeEffects");
}
///
/// Attempts to reset the time for the zone. This may require to have opened
/// the zone reuse window at least once in your current session before working
/// properly (use /togglezonereuse)
///
/// zone name
/// call success
public bool ResetZoneTimer(string name)
{
Trace.WriteLine(String.Format("Character:ResetZoneTimer({0})", name));
return this.ExecuteMethod("ResetZoneTimer", name);
}
///
/// Deposits the amount of the coin type provided into the bank. Optional third parameter will
/// move the coin from the regular bank to the shared bank if true.
///
/// coin type
/// coin amount
/// use bank as source
///
public bool SharedBankDeposit(CoinType type, int amount, bool useBank = false)
{
Trace.WriteLine(String.Format("Character:BankDeposit({0}, {1}, {2})", type,
amount.ToString(CultureInfo.InvariantCulture), useBank));
return !useBank ? this.ExecuteMethod("BankDeposit", type.ToString()[0].ToString(CultureInfo.InvariantCulture),
amount.ToString(CultureInfo.InvariantCulture)) : this.ExecuteMethod("BankDeposit",
type.ToString()[0].ToString(CultureInfo.InvariantCulture), amount.ToString(CultureInfo.InvariantCulture), "FromBank");
}
///
/// Withdraws the specified coin type and amount from the shared bank.
///
/// coin type
/// coin amount
/// call success
public bool SharedBankWithdraw(CoinType type, int amount)
{
Trace.WriteLine(String.Format("Character:SharedBankWithdraw({0}, {1})", type,
amount.ToString(CultureInfo.InvariantCulture)));
return this.ExecuteMethod("SharedBankWithdraw", type.ToString()[0].ToString(CultureInfo.InvariantCulture),
amount.ToString(CultureInfo.InvariantCulture));
}
///
/// Removes all coin from all vendors at once.
///
/// call success
public bool TakeAllVendingCoin()
{
Trace.WriteLine(String.Format("Character:TakeAllVendingCoin()"));
return this.ExecuteMethod("TakeAllVendingCoin");
}
#endregion
#region Enums
///
/// Effect Types
///
public enum EffectType
{
///
/// Beneficial
///
Beneficial,
///
/// Detrimental
///
Detrimental,
///
/// All
///
All
}
///
/// Coin Types
///
public enum CoinType
{
///
/// Coin Type Copper
///
Copper,
///
/// Coin Type Silver
///
Silver,
///
/// Coin Type Gold
///
Gold,
///
/// Coin Type Platinum
///
Platinum
}
///
/// Inventory Types
///
public enum InvType
{
///
/// Not in bank or shared bank
///
NonBankOnly,
///
/// Only in bank or shared bank
///
BankOnly,
///
/// All items
///
All
}
#endregion
}
}