using System; using System.Diagnostics; using System.Globalization; using LavishScriptAPI; using MRBot.IsxEq2.Helpers; namespace MRBot.IsxEq2.Utility { /// /// Represents all of the data available about ISXEQ2 itself /// public class ISXEQ2 : LavishScriptObject { #region Constructor /// /// Constructor /// /// LS Object public ISXEQ2(LavishScriptObject copy) : base(copy) { } /// /// Constructor /// public ISXEQ2() : base(LavishScript.Objects.GetObject("ISXEQ2")) { } #endregion #region Members /// /// Indicates whether or not Affliction Events are on or off /// public bool AfflictionEventsOn { get { Trace.WriteLine(String.Format("ISXEQ2:AfflictionEventsOn")); return this.GetBoolFromLSO("AfflictionEventsOn"); } } /// /// Returns the total amount of EQ2Locations in the current zone or all zones /// /// show all zones public int EQ2LocsCount(bool allZones = false) { Trace.WriteLine(String.Format("ISXEQ2:EQ2LocsCount")); return !allZones ? this.GetIntFromLSO("EQ2LocsCount") : this.GetIntFromLSO("EQ2LocsCount", "AllZones"); } /// /// Indicates whether or not Actor Effects are initializing /// public bool InitializingActorEffects { get { Trace.WriteLine(String.Format("ISXEQ2:InitializingActorEffects")); return this.GetBoolFromLSO("InitializingActorEffects"); } } /// /// Cached value of IsReady /// private bool? _isReady; /// /// Returns TRUE when the authentication and patching routines are complete and ISXEQ2 is truly ready. /// public bool IsReady { get { Trace.WriteLine(String.Format("ISXEQ2:IsReady")); if(!_isReady.HasValue) _isReady = this.GetBoolFromLSO("IsReady"); return _isReady.Value; } } /// /// Returns a boolean indicating whether or not a key board key is a valid eq2press key /// /// /// boolean indicating whether or not the key is valid public bool IsValidEQ2PressKey(string keyName) { Trace.WriteLine(String.Format("ISXEQ2:IsValidEQ2PressKey({0})", keyName)); return this.GetBoolFromLSO("IsValidEQ2PressKey", keyName); } /// /// Cached value of Version /// private string _version; /// /// The ISXEQ2 version /// public string Version { get { Trace.WriteLine(String.Format("ISXEQ2:Version")); return _version ?? (_version = this.GetStringFromLSO("Version")); } } #endregion #region Methods /// /// Used to add an EQ2Location /// /// EQ2Location label public bool AddLoc(string label) { Trace.WriteLine(String.Format("ISXEQ2:AddLoc({0})", label)); return this.ExecuteMethod("AddLoc", label); } /// /// Used to add an EQ2Location /// /// EQ2location label /// EQ2Location notes public bool AddLoc(string label, string notes) { Trace.WriteLine(String.Format("ISXEQ2:AddLoc({0}, {1})", label, notes)); return this.ExecuteMethod("AddLoc", label, notes); } /// /// Clears the abilities cache which means it will be rebuilt automatically when abilities are next used /// public bool ClearAbilitiesCache() { Trace.WriteLine(String.Format("ISXEQ:ClearAbilitiesCache()")); return this.ExecuteMethod("ClearAbilitiesCache"); } /// /// Disables Actor Events /// public bool DisableActorEvents() { Trace.WriteLine(String.Format("ISXEQ2:DisableActorEvents()")); return this.ExecuteMethod("DisableActorEvents"); } /// /// Disables Affliction Events /// public bool DisableAfflictionEvents() { Trace.WriteLine(String.Format("DisableAfflictionEvents()")); return this.ExecuteMethod("DisableAfflictionEvents"); } /// /// Enables Actor Events /// public bool EnableActorEvents() { Trace.WriteLine(String.Format("ISXEQ2:EnableActorEvents()")); return this.ExecuteMethod("EnableActorEvents"); } /// /// Enables Affliction Events /// public bool EnableAfflictionEvents() { Trace.WriteLine(String.Format("ISXEQ2:EnableAfflictionEvents()")); return this.ExecuteMethod("EnableAfflictionEvents"); } /// /// Used to enable or disable Enduring Breath /// /// Enable or Disable public bool EnduringBreath(BenefitToggle benefits) { Trace.WriteLine(String.Format("ISXEQ2:EnduringBreath({0})", benefits.ToString())); return this.ExecuteMethod("EnduringBreath", benefits.ToString()); } /// /// Used to Enable or Disable No Fog /// /// Enable or Disable public bool NoFog(BenefitToggle benefits) { Trace.WriteLine(String.Format("ISXEQ2:NoFog({0})", benefits.ToString())); return this.ExecuteMethod("NoFog", benefits.ToString()); } /// /// Creates an ISXEQ2 popup window (LGUI window). Title and Status are optional. /// /// Title and/or Status public bool Popup(params string[] args) { Trace.WriteLine("ISXEQ2:Popup({0})", String.Join(" ", args)); return this.ExecuteMethod("Popup", args); } /// /// This should be called in your script before doing any calls to the vendingcontainer datatype /// that would be occurring after any user manipulation of the system within the game. /// public bool ResetInternalVendingSystem() { Trace.WriteLine(String.Format("ISXEQ2:ResetInternalVendingSystem()")); return this.ExecuteMethod("ResetInternalVendingSystem"); } /// /// Sets the range for Actor events /// /// range public bool SetActorEventsRange(float range) { Trace.WriteLine(String.Format("ISXEQ2:SetActorEventsRange({0})", range.ToString(CultureInfo.InvariantCulture))); return this.ExecuteMethod("SetActorEventsRange", range.ToString(CultureInfo.InvariantCulture)); } /// /// Sets the time interval used to check for Actor events /// /// time in ms public bool SetActorEventsTimeInterval(float time) { Trace.WriteLine(String.Format("ISXEQ2:SetActorEventsTimeInterval({0})", time.ToString(CultureInfo.InvariantCulture))); return this.ExecuteMethod("SetActorEventsTimeInterval", time.ToString(CultureInfo.InvariantCulture)); } /// /// Sets the time period used to check for Affliction events /// /// time in ms public bool SetAfflictionEventsTimeInterval(int time) { Trace.WriteLine(String.Format("ISXEQ2:SetAfflictionEventsTimeInterval({0})", time.ToString(CultureInfo.InvariantCulture))); return ExecuteMethod("SetAfflictionEventsTimeInterval", time.ToString(CultureInfo.InvariantCulture)); } #endregion #region Enums /// /// Enum used as argument to toggle certain client based effects on or off /// public enum BenefitToggle { /// /// Enable /// Enable, /// /// Disable /// Disable } #endregion } }