using System;
using System.Diagnostics;
using System.Globalization;
using InnerSpaceAPI;
using LavishScriptAPI;
using MRBot.IsxEq2.AbilityEffect;
using MRBot.IsxEq2.Helpers;
namespace MRBot.IsxEq2.CharacterActor
{
///
/// This DataType includes all of the data available to ISXEQ2 that is related to entities within the world.
///
public class Actor : LavishScriptObject
{
#region Constructor
///
/// Constructor
///
/// LS Object
public Actor(LavishScriptObject copy) : base(copy) { }
#endregion
#region Members
///
/// Returns an ability based on the index from 1 to NumAbilities
///
/// index
public Ability Ability(int index)
{
Trace.WriteLine(String.Format("Character:Ability({0})", index.ToString(CultureInfo.InvariantCulture)));
var ability = GetMember("Ability", index.ToString(CultureInfo.InvariantCulture));
InnerSpace.Echo($"Ability ID {ability.GetMember("ID")}");
return new Ability(GetMember("Ability", index.ToString()));
}
///
/// Returns TRUE if the actor can turn. NOTE: If you're 'mezzed' you are
/// both rooted and you cannot turn. Use similar logic to determine other
/// situations such as being 'stunned' etc.
///
public bool CanTurn
{
get
{
Trace.WriteLine(String.Format("Actor:CanTurn"));
return this.GetBoolFromLSO("CanTurn");
}
}
///
/// Checks collision between you and this actor
///
public bool CheckCollision()
{
Trace.WriteLine(String.Format("Actor:CheckCollision"));
return this.GetBoolFromLSO("CheckCollision");
}
///
/// Checks between the actor and the given point.
///
/// X
/// Y
/// Z
public bool CheckCollision(float toX, float toY, float toZ)
{
Trace.WriteLine(String.Format("Actor: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
///
public string Class
{
get
{
return _class ?? (_class = this.GetStringFromLSO("Class"));
}
}
///
/// Cache of CollisionRadius
///
private float? _collisionRadius;
///
/// Collision Radius
///
public float CollisionRadius
{
get
{
if(!_collisionRadius.HasValue)
_collisionRadius = this.GetFloatFromLSO("CollisionRadius");
return _collisionRadius.Value;
}
}
///
/// Collision Scale
///
private float? _collisionScale;
///
///
///
public float CollisionScale
{
get
{
if(!_collisionScale.HasValue)
_collisionScale = this.GetFloatFromLSO("CollisionScale");
return _collisionScale.Value;
}
}
///
/// Con Color
///
/// as RGB
/// Con Color
public string ConColor(bool asRGB)
{
return asRGB ? this.GetStringFromLSO("ConColor", "raw") : this.GetStringFromLSO("ConColor");
}
private int? _difficulty;
///
/// Returns the encounter difficulty as a range of -3 to 3.
/// -3 == three down arrows, 0 == no arrows, 3 == three up arrows
///
public int Difficulty
{
get
{
if(!_difficulty.HasValue)
_difficulty = this.GetIntFromLSO("Difficulty");
return _difficulty.Value;
}
}
///
/// 3D Distance to this actor
///
public float Distance
{
get
{
return this.GetFloatFromLSO("Distance");
}
}
///
/// Distance to this actor
///
public float Distance2D
{
get
{
return this.GetFloatFromLSO("Distance2D");
}
}
///
/// Retrieves the Effect at the index (1 to NumEffects). Must InitializeEffects()
/// if effects may have changed.
///
/// index
/// Effect
public Effect Effect(int index)
{
Trace.WriteLine(String.Format("Actor:Effect({0})", index.ToString(CultureInfo.InvariantCulture)));
return new Effect(this.GetMember("Effect", index.ToString(CultureInfo.InvariantCulture)));
}
///
/// Retireves the Effect by name.
///
/// name
/// Effect
public Effect Effect(string name)
{
Trace.WriteLine(String.Format("Actor:Effect({0})", name));
return new Effect(this.GetMember("Effect", name));
}
///
/// Cache of EffectiveLevel
///
private int? _effectiveLevel;
///
/// Mentored Level
///
public int EffectiveLevel
{
get
{
Trace.WriteLine(String.Format("Actor:EffectiveLevel"));
if(!_effectiveLevel.HasValue)
_effectiveLevel = this.GetIntFromLSO("EffectiveLevel");
return _effectiveLevel.Value;
}
}
///
/// Cache of EncounterSize
///
private int? _encounterSize;
///
/// Returns the size of the encounter. This number will not change throughout the fight.
///
public int EncounterSize
{
get
{
Trace.WriteLine(String.Format("Actor:EncounterSize"));
if(!_encounterSize.HasValue)
_encounterSize = this.GetIntFromLSO("EncounterSize");
return _encounterSize.Value;
}
}
///
/// Cache of Faction
///
private int? _faction;
///
/// Less than -4 is KOS, -3 is threatening, -2 is dubious, -1 is apprehensive, etc.
///
public int Faction
{
get
{
Trace.WriteLine(String.Format("Actor:Faction"));
if(!_faction.HasValue)
_faction = this.GetIntFromLSO("Faction");
return _faction.Value;
}
}
///
/// Cache of Faction Standing
///
private string _factionStanding;
///
/// Possible Faction Standings are: Ally, Warmly, Kindly, Amiable, Indifferent, Apprehensive, Dubious, Threatening, and KOS.
///
public string FactionStanding
{
get
{
Trace.WriteLine(String.Format("Actor:FactionStanding"));
return _factionStanding ?? (_factionStanding = this.GetStringFromLSO("FactionStanding"));
}
}
///
/// Cache of FlyingUsingMount
///
private bool? _flyingUseMount;
///
/// Returns TRUE if currently flying in the air using a flying mount (the mount is visible)
///
public bool FlyingUsingMount
{
get
{
Trace.WriteLine(String.Format("Actor:FlyingUsingMount"));
if (!_flyingUseMount.HasValue)
_flyingUseMount = this.GetBoolFromLSO("FlyingUsingMount");
return _flyingUseMount.Value;
}
}
///
/// Cache of Gender
///
private string _gender;
///
/// Gender
///
public string Gender
{
get
{
Trace.WriteLine(String.Format("Actor:Gender"));
return _gender ?? (_gender = this.GetStringFromLSO("Gender"));
}
}
///
/// Cache of Guild
///
private string _guild;
///
/// Guild
///
public string Guild
{
get
{
Trace.WriteLine(String.Format("Actor:Guild"));
return _guild ?? (_guild = this.GetStringFromLSO("Guild"));
}
}
///
/// Heading. Returns heading as degrees (think compass), to a precision of 2 decimal places.
///
public float Heading
{
get
{
Trace.WriteLine(String.Format("Actor:Heading"));
return this.GetFloatFromLSO("Heading");
}
}
///
/// Better known as bearing.
///
public float HeadingTo
{
get
{
Trace.WriteLine(String.Format("Actor:Heading"));
return this.GetFloatFromLSO("HeadingTo");
}
}
///
/// Returns health as a percentage.
///
public int Health
{
get
{
Trace.WriteLine(String.Format("Actor:Health"));
return this.GetIntFromLSO("Health");
}
}
///
/// Cache on HighlightOnMouseHover
///
private bool? _highlightOnMouseHover;
///
/// Interactable
///
public bool HighlightOnMouseHover
{
get
{
Trace.WriteLine(String.Format("Actor:HighlightOnMouseHover"));
if(!_highlightOnMouseHover.HasValue)
_highlightOnMouseHover = this.GetBoolFromLSO("HighlightOnMouseHover");
return _highlightOnMouseHover.Value;
}
}
///
/// Cache of ID
///
private int? _iD;
///
/// ID
///
public int ID
{
get
{
Trace.WriteLine(String.Format("Actor:ID"));
if(!_iD.HasValue)
_iD = this.GetIntFromLSO("ID");
return _iD.Value;
}
}
///
/// Returns TRUE if the actor is in combat. Mutually exclusive with
/// IsCrouching and IsSitting
///
public bool InCombatMode
{
get
{
Trace.WriteLine(String.Format("Actor:InCombatMode"));
return this.GetBoolFromLSO("InCombatMode");
}
}
///
/// Cache of InMyGroup
///
private bool? _inMyGroup;
///
/// Return TRUE if the actor is in the players group
///
public bool InMyGroup
{
get
{
Trace.WriteLine(String.Format("Actor:InMyGroup"));
if (!_inMyGroup.HasValue)
_inMyGroup = this.GetBoolFromLSO("InMyGroup");
return _inMyGroup.Value;
}
}
///
/// Cache of Interactable
///
private bool? _interactable;
///
/// Interactable
///
public bool Interactable
{
get
{
Trace.WriteLine(String.Format("Actor:Interactable"));
if(!_interactable.HasValue)
_interactable = this.GetBoolFromLSO("Interactable");
return _interactable.Value;
}
}
///
/// Cache of ISAFK
///
private bool? _isAFK;
///
/// Returns TRUE if the actor is AFK
///
public bool IsAFK
{
get
{
Trace.WriteLine(String.Format("Actor:IsAFK"));
if(!_isAFK.HasValue)
_isAFK = this.GetBoolFromLSO("IsAFK");
return _isAFK.Value;
}
}
///
/// Returns TRUE if the actor is a aggro
///
public bool IsAggro
{
get
{
Trace.WriteLine(String.Format("Actor:IsAFK"));
return this.GetBoolFromLSO("IsAggro");
}
}
///
/// Cache of IsAPet
///
private bool? _isAPet;
///
/// Returns TRUE if the actor is a pet
///
public bool IsAPet
{
get
{
Trace.WriteLine(String.Format("Actor:IsAPet"));
if(!_isAPet.HasValue)
_isAPet = this.GetBoolFromLSO("IsAPet");
return _isAPet.Value;
}
}
///
/// Returns TRUE if the actor is backing up. Mutually exclusive with IsStrafingLeft,
/// IsStrafingRight, and IsIdle.
///
public bool IsBackingUp
{
get
{
Trace.WriteLine(String.Format("Actor:IsAPet"));
return this.GetBoolFromLSO("IsBackingUp");
}
}
///
/// Cache of IsBanker
///
private bool? _isBanker;
///
/// Returns TRUE if the actor is a banker
///
public bool IsBanker
{
get
{
Trace.WriteLine(String.Format("Actor:IsBanker"));
if(!_isBanker.HasValue)
_isBanker = this.GetBoolFromLSO("IsBanker");
return _isBanker.Value;
}
}
///
/// Cache of IsCamping
///
private bool? _isCamping;
///
/// Returns TRUE if the actor is camping
///
public bool IsCamping
{
get
{
Trace.WriteLine(String.Format("Actor:IsCamping"));
if(!_isCamping.HasValue)
_isCamping = this.GetBoolFromLSO("IsCamping");
return _isCamping.Value;
}
}
///
/// Cache of IsChest
///
private bool? _isChest;
///
/// Returns TRUE if the actor is a chest
///
public bool IsChest
{
get
{
Trace.WriteLine(String.Format("Actor:IsChest"));
if(!_isChest.HasValue)
_isChest = this.GetBoolFromLSO("IsChest");
return _isChest.Value;
}
}
///
/// Cache of IsClimbing
///
private bool? _isClimbing;
///
/// Returns TRUE if the actor is climbing
///
public bool IsClimbing
{
get
{
Trace.WriteLine(String.Format("Actor:IsClimbing"));
if(!_isClimbing.HasValue)
_isClimbing = this.GetBoolFromLSO("IsClimbing");
return _isClimbing.Value;
}
}
///
/// Returns TRUE if the actor is crouching. Mutually exclusive with
/// InCombatMode and IsSitting
///
public bool IsCrouching
{
get
{
Trace.WriteLine(String.Format("Actor:IsCrouching"));
return this.GetBoolFromLSO("IsCrouching");
}
}
///
/// Returns TRUE if the actor is dead
///
public bool IsDead
{
get
{
Trace.WriteLine(String.Format("Actor:IsDead"));
return this.GetBoolFromLSO("IsDead");
}
}
///
/// Returns TRUE if the encounter is broken.
///
public bool IsEncounterBroken
{
get
{
Trace.WriteLine(String.Format("Actor:IsEncounterBroken"));
return this.GetBoolFromLSO("IsEncounterBroken");
}
}
///
/// Cache of IsEpic
///
private bool? _isEpic;
///
/// Returns TRUE if the actor is Epic.
///
public bool IsEpic
{
get
{
Trace.WriteLine(String.Format("Actor:IsEpic"));
if(!_isEpic.HasValue)
_isEpic = this.GetBoolFromLSO("IsEpic");
return _isEpic.Value;
}
}
///
/// Returns TRUE if the actor is falling or jumping.
///
public bool IsFalling
{
get
{
Trace.WriteLine(String.Format("Actor:IsFalling"));
return this.GetBoolFromLSO("IsFalling");
}
}
///
/// Returns TRUE if the actor is feign death.
///
public bool IsFD
{
get
{
Trace.WriteLine(String.Format("Actor:IsFD"));
return this.GetBoolFromLSO("IsFD");
}
}
///
/// Cache of IsHeroic
///
private bool? _isHeroic;
///
/// Returns TRUE if the actor is Heroic.
///
public bool IsHeroic
{
get
{
Trace.WriteLine(String.Format("Actor:IsHeroic"));
if(!_isHeroic.HasValue)
_isHeroic = this.GetBoolFromLSO("IsHeroic");
return _isHeroic.Value;
}
}
///
/// Returns TRUE if the actor is idle. Mutually exclusive with
/// IsBackingUp, IsStrafingLeft, and IsStrafingRight.
///
public bool IsIdle
{
get
{
Trace.WriteLine(String.Format("Actor:IsIdle"));
return this.GetBoolFromLSO("IsIdle");
}
}
///
/// Returns TRUE if the actor with the give ID is in the same encounter.
///
///
public bool IsInSameEncounter(int id)
{
Trace.WriteLine(String.Format("Actor:IsInSameEncounter({0})", id.ToString(CultureInfo.InvariantCulture)));
return this.GetBoolFromLSO("IsInSameEncounter", id.ToString(CultureInfo.InvariantCulture));
}
///
/// Return TRUE if the actor is invis. (alias for IsStealthed)
///
public bool IsInvis
{
get
{
Trace.WriteLine(String.Format("Actor:IsInvis"));
return this.GetBoolFromLSO("IsInvis");
}
}
///
/// Returns TRUE if the actor is jumping.
///
public bool IsJumping
{
get
{
Trace.WriteLine(String.Format("Actor:IsJumping"));
return this.GetBoolFromLSO("IsJumping");
}
}
///
/// Cache of IsLFG
///
private bool? _isLFG;
///
/// Returns TRUE if the actor is Looking for Group.
///
public bool IsLFG
{
get
{
Trace.WriteLine(String.Format("Actor:IsLFG"));
if (!_isLFG.HasValue)
_isLFG = this.GetBoolFromLSO("IsLFG");
return _isLFG.Value;
}
}
///
/// Cache of IsLFW
///
private bool? _isLFW;
///
/// Returns TRUE is the actor is Looking for Work.
///
public bool IsLFW
{
get
{
Trace.WriteLine(String.Format("Actor:IsLFW"));
if(!_isLFW.HasValue)
_isLFW = this.GetBoolFromLSO("IsLFW");
return _isLFW.Value;
}
}
///
/// Returns TRUE if the actor is linkdead.
///
public bool IsLinkdead
{
get
{
Trace.WriteLine(String.Format("Actor:IsLinkdead"));
return this.GetBoolFromLSO("IsLinkdead");
}
}
///
/// Returns TRUE if the actor is engaged in a locked encounter.
///
public bool IsLocked
{
get
{
Trace.WriteLine(String.Format("Actor:IsLocked"));
return this.GetBoolFromLSO("IsLocked");
}
}
///
/// Cache of IsMerchant
///
private bool? _isMerchant;
///
/// Returns TRUE if the actor is a merchant. (includes Mender)
///
public bool IsMerchant
{
get
{
Trace.WriteLine(String.Format("Actor:IsMerchant"));
if(!_isMerchant.HasValue)
_isMerchant = this.GetBoolFromLSO("IsMerchant");
return _isMerchant.Value;
}
}
///
/// Cache of IsMyPet
///
private bool? _isMyPet;
///
/// Returns TRUE if the actor is my pet.
///
public bool IsMyPet
{
get
{
Trace.WriteLine(String.Format("Actor:IsMyPet"));
if(!_isMyPet.HasValue)
_isMyPet = this.GetBoolFromLSO("IsMyPet");
return _isMyPet.Value;
}
}
///
/// Cache of IsNamed
///
private bool? _isNamed;
///
/// Returns TRUE if the actor is a Named.
///
public bool IsNamed
{
get
{
Trace.WriteLine(String.Format("Actor:IsNamed"));
if(!_isNamed.HasValue)
_isNamed = this.GetBoolFromLSO("IsNamed");
return _isNamed.Value;
}
}
///
/// Returns TRUE if the actor is rooted. NOTE: If you're 'mezzed' you are
/// both rooted and you cannot turn. Use similar logic to determine other
/// situations such as being 'stunned' etc.
///
public bool IsRooted
{
get
{
Trace.WriteLine(String.Format("Actor:IsRooted"));
return this.GetBoolFromLSO("IsRooted");
}
}
///
/// Returns TRUE if the actor is running. Mutually exclusive with
/// IsWalking and IsSprinting.
///
public bool IsRunning
{
get
{
Trace.WriteLine(String.Format("Actor:IsRunning"));
return GetMember("IsRunning");
}
}
///
/// Returns TRUE if the actor is sitting. Mutually exclusive with
/// InCombatMode and IsCrouching.
///
public bool IsSitting
{
get
{
Trace.WriteLine(String.Format("Actor:IsSitting"));
return GetMember("IsSitting");
}
}
///
/// Cache of IsSolo
///
private bool? _isSolo;
///
/// Returns TRUE if the actor is solo. (NOT an encounter)
///
public bool IsSolo
{
get
{
Trace.WriteLine(String.Format("Actor:IsSolo"));
if(!_isSolo.HasValue)
_isSolo = this.GetBoolFromLSO("IsSolo");
return _isSolo.Value;
}
}
///
/// Returns TRUE if the actor is sprinting. Mutually exclusive
/// with IsRunning and IsWalking.
///
public bool IsSprinting
{
get
{
Trace.WriteLine(String.Format("Actor:IsSprinting"));
return this.GetBoolFromLSO("IsSprinting");
}
}
///
/// Returns TRUE if the actor is stealthed. (alias for IsInvis)
///
public bool IsStealthed
{
get
{
Trace.WriteLine(String.Format("Actor:IsStealthed"));
return this.GetBoolFromLSO("IsStealthed");
}
}
///
/// Returns TRUE if the actor is strafing left. Mutually exclusive
/// with IsBackingUp, IsStrafingRight, and IsIdle.
///
public bool IsStrafingLeft
{
get
{
Trace.WriteLine(String.Format("Actor:IsStrafingLeft"));
return this.GetBoolFromLSO("IsStrafingLeft");
}
}
///
/// Returns TRUE if the actor is strafing right. Mutually exclusive
/// with IsBackingUp, IsStrafingLeft, and IsIdle.
///
public bool IsStrafingRight
{
get
{
Trace.WriteLine(String.Format("Actor:IsStrafingRight"));
return GetMember("IsStrafingRight");
}
}
///
/// Returns TRUE if the actor is swimming.
///
public bool IsSwimming
{
get
{
Trace.WriteLine(String.Format("Actor:IsSwimming"));
return GetMember("IsSwimming");
}
}
///
/// Returns TRUE if the actor is walking. Mutually exclusive
/// with IsRunning and IsSprinting.
///
public bool IsWalking
{
get
{
Trace.WriteLine(String.Format("Actor:IsWalking"));
return this.GetBoolFromLSO("IsWalking");
}
}
///
/// Cache of LastName
///
private string _lastName;
///
/// Last Name
///
public string LastName
{
get
{
Trace.WriteLine(String.Format("Actor:IsLastName"));
return _lastName ?? (_lastName = this.GetStringFromLSO("LastName"));
}
}
///
/// Cache of Level
///
private int? _level;
///
/// Level
///
public int Level
{
get
{
Trace.WriteLine(String.Format("Actor:Level"));
if(!_level.HasValue)
_level = this.GetIntFromLSO("Level");
return _level.Value;
}
}
///
/// Location (or position in Point3f)
///
public Point3f Loc
{
get
{
Trace.WriteLine(String.Format("Actor:Loc"));
return new Point3f(this.GetMember("Loc"));
}
}
///
/// Cache of Name
///
private string _name;
///
/// Name
///
public string Name
{
get
{
Trace.WriteLine(String.Format("Actor:Name"));
return _name ?? (_name = this.GetStringFromLSO("Name"));
}
}
///
/// The number of effects on the actor. Use with Effects(int).
///
public int NumEffects
{
get
{
Trace.WriteLine(String.Format("Actor:NumEffects"));
return this.GetIntFromLSO("NumEffects");
}
}
///
/// Returns TRUE if the actor is on a carpet. Mutually exclusive
/// with OnHorse and OnGriffin.
///
public bool OnCarpet
{
get
{
Trace.WriteLine(String.Format("Actor:OnCarpet"));
return this.GetBoolFromLSO("OnCarpet");
}
}
///
/// Cache of OnFlyingMount
///
private bool? _onFlyingMount;
///
/// Returns TRUE if currently on a flying mount, whether on the ground or in the air
///
public bool OnFlyingMount
{
get
{
Trace.WriteLine(String.Format("Actor:OnFlyingMount"));
if (!_onFlyingMount.HasValue)
_onFlyingMount = this.GetBoolFromLSO("OnFlyingMount");
return _onFlyingMount.Value;
}
}
///
/// Returns TRUE if the actor is flying on a griffin. (Old World, intra zone travel like horses and sokokar)
///
public bool OnGriffin
{
get
{
Trace.WriteLine(String.Format("Actor:OnGriffin"));
return this.GetBoolFromLSO("OnGriffin");
}
}
///
/// Returns TRUE if the actor is flying on a griffon. (Old World, intra zone travel, e.g. Thundering Steppes)
///
public bool OnGriffon
{
get
{
Trace.WriteLine(String.Format("Actor:OnGriffon"));
return this.GetBoolFromLSO("OnGriffon");
}
}
///
/// Returns TRUE if the actor is on a horse. (Old World, intra zone travel. e.g. in G Fay)
///
public bool OnHorse
{
get
{
Trace.WriteLine(String.Format("Actor:OnHorse"));
return this.GetBoolFromLSO("OnHorse");
}
}
///
/// Actor's pet, if any.
///
public Actor Pet
{
get
{
Trace.WriteLine(String.Format("Actor:Pet"));
return new Actor(this.GetMember("Pet"));
}
}
///
/// Returns power as a percentage.
///
public int Power
{
get
{
Trace.WriteLine(String.Format("Actor:Power"));
return this.GetIntFromLSO("Power");
}
}
///
/// Cache of Race
///
private string _race;
///
/// Race
///
public string Race
{
get
{
Trace.WriteLine(String.Format("Actor:Race"));
return _race ?? (_race = this.GetStringFromLSO("Race"));
}
}
///
/// Cache of Speed
///
private float? _speed;
///
/// Returns the run speed percent enhancement on the actor.
///
public float Speed
{
get
{
Trace.WriteLine(String.Format("Actor:Speed"));
if(!_speed.HasValue)
_speed = this.GetFloatFromLSO("Speed");
return _speed.Value;
}
}
///
/// Cache of SuffixTitle
///
private string _suffixTitle;
///
/// Returns the suffix title of the actor if it exists, or NULL if it does not.
///
public string SuffixTitle
{
get
{
Trace.WriteLine(String.Format("Actor:SuffixTitle"));
return _suffixTitle ?? (_suffixTitle = this.GetStringFromLSO("SuffixTitle"));
}
}
///
/// Cache of SwimmingSpeedMod
///
private float? _swimmingSpeedMod;
///
/// Swimming Speed Modifier
///
public float SwimmingSpeedMod
{
get
{
Trace.WriteLine(String.Format("Actor:SwimmingSpeedMod"));
if(!_swimmingSpeedMod.HasValue)
_swimmingSpeedMod = this.GetFloatFromLSO("SwimmingSpeedMod");
return _swimmingSpeedMod.Value;
}
}
///
/// Target, if any.
///
public Actor Target
{
get
{
Trace.WriteLine(String.Format("Actor:Target"));
return new Actor(this.GetMember("Target"));
}
}
///
/// Cache of TargetRingRadius
///
private float? _targetRingRadius;
///
/// Target Ring Radius
///
public float TargetRingRadius
{
get
{
Trace.WriteLine(String.Format("Actor:TargetRingRadius"));
if(!_targetRingRadius.HasValue)
_targetRingRadius = this.GetFloatFromLSO("TargetRingRadius");
return _targetRingRadius.Value;
}
}
///
/// Actor's threat to me.
///
public int ThreatToMe
{
get
{
Trace.WriteLine(String.Format("Actor:ThreatToMe"));
return this.GetIntFromLSO("ThreatToMe");
}
}
///
/// Threat to next person down on the hate list.
///
public int ThreatToNext
{
get
{
Trace.WriteLine(String.Format("Actor:ThreatToNext"));
return this.GetIntFromLSO("ThreatToNext");
}
}
///
/// Threat to actor's pet.
///
public int ThreatToPet
{
get
{
Trace.WriteLine(String.Format("Actor:ThreatToPet"));
return this.GetIntFromLSO("ThreatToPet");
}
}
///
/// Useful for iterating the character.Group array.
///
public Actor ToActor
{
get
{
Trace.WriteLine(String.Format("Actor:ToActor"));
return new Actor(this.GetMember("ToActor"));
}
}
///
/// Cache of Type
///
private string _type;
///
/// Actor type.
///
public string Type
{
get
{
Trace.WriteLine(String.Format("Actor:Type"));
return _type ?? (_type = this.GetStringFromLSO("Type"));
}
}
///
/// Velocity
///
public Point3f Velocity
{
get
{
Trace.WriteLine(String.Format("Actor:Velocity"));
return new Point3f(this.GetMember("Velocity"));
}
}
///
/// Returns the name of the actor that the actor is following.
///
public string WhoFollowing
{
get
{
Trace.WriteLine(String.Format("Actor:WhoFollowing"));
return this.GetStringFromLSO("WhoFollowing");
}
}
///
/// Returns the ID of the actor the actor is following.
///
public int WhoFollowingID
{
get
{
Trace.WriteLine(String.Format("Actor:WhoFollowingID"));
return this.GetIntFromLSO("WhoFollowingID");
}
}
///
/// Position X-coordinate
///
public float X
{
get
{
Trace.WriteLine(String.Format("Actor:X"));
return this.GetFloatFromLSO("X");
}
}
///
/// Position Y-coordinate
///
public float Y
{
get
{
Trace.WriteLine(String.Format("Actor:Y"));
return this.GetFloatFromLSO("Y");
}
}
///
/// Position Z-coordinate
///
public float Z
{
get
{
Trace.WriteLine(String.Format("Actor:Z"));
return this.GetFloatFromLSO("Z");
}
}
#endregion
#region Methods
///
/// Faces the actor.
///
/// call success
public bool DoFace()
{
Trace.WriteLine(String.Format("Actor:DoFace()"));
return this.ExecuteMethod("DoFace");
}
///
/// Targets the actor.
///
/// call success
public bool DoTarget()
{
Trace.WriteLine(String.Format("Actor:DoTarget()"));
return this.ExecuteMethod("DoTarget");
}
///
/// Excellent for activating doors.
///
/// call success
public bool DoubleClick()
{
Trace.WriteLine(String.Format("Actor:DoubleClick()"));
return this.ExecuteMethod("DoubleClick");
}
///
/// Used to retrieve effects data for this actor.
///
///
public bool InitializeEffects()
{
Trace.WriteLine(String.Format("Actor:InitializeEffects()"));
return this.ExecuteMethod("InitializeEffects");
}
///
/// This method will create a location in your locations database
/// (which will save to your isxeq2locations.xml file) creating a label for you.
/// Please understand that this only works well for stationary actors.
///
/// add or delete
/// notes
/// call success
public bool Location(CommandType action, string notes = null)
{
switch (action)
{
case CommandType.Add:
return notes == null ? this.ExecuteMethod("Location", action.ToString()) : this.ExecuteMethod("Location", action.ToString(), notes);
case CommandType.Delete:
return ExecuteMethod("Location", action.ToString());
default:
return false;
}
}
///
/// Creates a waypoint to the actor.
///
/// call success
public bool WaypointTo()
{
return ExecuteMethod("WaypointTo");
}
#endregion
#region Enums
///
/// Command Type
///
public enum CommandType
{
///
/// Command Type Add
///
Add,
///
/// Command Type Delete
///
Delete
}
#endregion
}
}