using System;
using System.Windows;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Buddy.BehaviorTree;
using Buddy.Swtor;
using Buddy.Common.Plugins;
using Buddy.Swtor.Objects;
using Action = System.Action;
namespace Buddywing.Plugins
{
public class TheLuck : IPlugin
{
public string Author { get { return "Jon310 - Edited by CryoGenesis"; } }
public Version Version { get { return new Version(0, 2); } }
public string Name { get { return "The Luck"; } }
public string Description { get { return "Gambles on the Smuggler's & Kingpin's Luck Machines and Contraband Slot Machine"; } }
public Window DisplayWindow { get { return null; } }
public void OnPulse()
{
var Luck = ObjectManager.GetObjects<TorObject>().OrderBy(t => t.Distance).FirstOrDefault(t => t.Name == "Smuggler's Luck");
var Bounty = ObjectManager.GetObjects<TorObject>().OrderBy(t => t.Distance).FirstOrDefault(t => t.Name == "Kingpin's Bounty");
var Contraband = ObjectManager.GetObjects<TorObject>().OrderBy(t => t.Distance).FirstOrDefault(t => t.Name == "Contraband Slot Machine");
// Don't run in combat.
if (BuddyTor.Me.InCombat)
return;
if (Luck != null && Luck.Distance < 5) Luck.Interact();
if (Bounty != null && Bounty.Distance < 5) Bounty.Interact();
if (Contraband != null && Contraband.Distance < 5) Contraband.Interact();
}
/// <summary> Executes the initialize action. This is called at initial bot startup. (When the bot itself is started, not when Start() is called) </summary>
public void OnInitialize()
{
}
/// <summary> Executes the shutdown action. This is called when the bot is shutting down. (Not when Stop() is called) </summary>
public void OnShutdown()
{
}
/// <summary> Executes the enabled action. This is called when the user has enabled this specific plugin via the GUI. </summary>
public void OnEnabled()
{
}
/// <summary> Executes the disabled action. This is called whent he user has disabled this specific plugin via the GUI. </summary>
public void OnDisabled()
{
}
public bool Equals(IPlugin other)
{
return other.Name == Name;
}
}
}