using System;
using System.Diagnostics;
using System.Globalization;
using LavishScriptAPI;
using MRBot.IsxEq2.Helpers;
using MRBot.IsxEq2.InventoryConsignment;
namespace MRBot.IsxEq2.UI
{
///
/// This DataType includes all of the data available to ISXEQ2 that is related to the "loot" window.
///
public class LootWindow : LavishScriptObject
{
#region Constructor
///
/// Constructor
///
/// LS Object
public LootWindow(LavishScriptObject copy) : base(copy) { }
#endregion
#region Members
///
/// Returns TRUE if Lotto Loot
///
public bool IsLotto
{
get
{
Trace.WriteLine(String.Format("LootWindow:IsLotto"));
return this.GetBoolFromLSO("IsLotto");
}
}
///
/// Returns the item at the index provided. (From 1 to NumItems)
///
/// index
/// Item
public Item Item(int index)
{
Trace.WriteLine(String.Format("LootWindow:Item({0})", index.ToString(CultureInfo.InvariantCulture)));
return new Item(this.GetMember("Item", index.ToString(CultureInfo.InvariantCulture)));
}
///
/// Returns the item that matches the substring name
///
/// name
/// call success
public Item Item(string name)
{
Trace.WriteLine(String.Format("LootWindow:Item({0})", name));
return new Item(this.GetMember("Item", name));
}
///
/// The number of items in the loot window
///
public int NumItems
{
get
{
Trace.WriteLine(String.Format("LootWindow:NumItems"));
return this.GetIntFromLSO("NumItems");
}
}
///
/// Returns the LootWindow as an EQ2Window
///
public EQ2Window ToEQ2UIPage
{
get
{
Trace.WriteLine(String.Format("LootWindow:ToEQ2UIPage"));
return new EQ2Window(this.GetMember("ToEQ2UIPage"));
}
}
///
/// Returns "Free For All" "Lottery" "Need Before Greed" or "Unknown"
///
public string Type
{
get
{
Trace.WriteLine(String.Format("LootWindow:Type"));
return this.GetStringFromLSO("Type");
}
}
#endregion
#region Methods
///
/// Declines the Lotto
///
/// call success
public bool DeclineLotto()
{
Trace.WriteLine(String.Format("LootWindow:DeclineLotto()"));
return this.ExecuteMethod("DeclineLotto");
}
///
/// Decline Need Before Greed
///
/// call success
public bool DeclineNBG()
{
Trace.WriteLine(String.Format("LootWindow:DeclineLotto()"));
return this.ExecuteMethod("DeclineNBG");
}
///
/// Loots all items in loot window
///
/// call success
public bool LootAll()
{
Trace.WriteLine(String.Format("LootWindow:LootAll()"));
return this.ExecuteMethod("LootAll");
}
///
/// Loots the single item in the loot window. This method does
/// not work for Lotto loot window, only for FreeForAll, LeaderOnly, or Solo.
///
///
public bool LootItem()
{
Trace.WriteLine(String.Format("LootWindow:LootItem()"));
return this.ExecuteMethod("LootItem");
}
///
/// Attempts to loot the item with ID provided
///
/// ID
/// Loot No Trade Items
/// call success
public bool LootItem(int id, bool lootNoTrade = false)
{
Trace.WriteLine(String.Format("LootWindow:LootItem({0}, {1})", id.ToString(CultureInfo.InvariantCulture),
lootNoTrade.ToString(CultureInfo.InvariantCulture)));
return lootNoTrade
? this.ExecuteMethod("LootItem", id.ToString(CultureInfo.InvariantCulture))
: this.ExecuteMethod("LootItem", id.ToString(CultureInfo.InvariantCulture),
0.ToString(CultureInfo.InvariantCulture));
}
///
/// Click Request All Button. Defaults to LootAll if no RequestAll button.
///
/// call success
public bool RequestAll()
{
Trace.WriteLine(String.Format("LootWindow:RequestAll()"));
return this.ExecuteMethod("RequestAll");
}
///
/// Selects the greed button
///
/// call success
public bool SelectGreed()
{
Trace.WriteLine(String.Format("LootWindow:SelectGreed()"));
return this.ExecuteMethod("SelectGreed");
}
///
/// Selects the need button
///
/// call success
public bool SelectNeed()
{
Trace.WriteLine(String.Format("LootWindow:SelectNeed()"));
return this.ExecuteMethod("SelectNeed");
}
#endregion
}
}