Untitled diff

Criado O diff nunca expira
1 remoção
326 linhas
21 adições
344 linhas
using System.IO;
using System.IO;
using System.Linq;
using System.Linq;
using System.Threading.Tasks;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Controls;
using System.Windows.Markup;
using System.Windows.Markup;
using log4net;
using log4net;
using System;
using System;
using Loki.Bot;
using Loki.Bot;
using Loki.Bot.Logic.Bots.BasicGrindBot;
using Loki.Bot.Logic.Bots.BasicGrindBot;
using Loki.Bot.Pathfinding;
using Loki.Bot.Pathfinding;
using Loki.Bot.v3;
using Loki.Bot.v3;
using Loki.Game;
using Loki.Game;
using Loki.Game.Objects;
using Loki.Game.Objects;
using Loki.Utilities;
using Loki.Utilities;
namespace DominusFight
namespace DominusFight
{
{
internal class DominusFight : IPlugin
internal class DominusFight : IPlugin
{
{
private static readonly ILog Log = Logger.GetLoggerInstanceForType();
private static readonly ILog Log = Logger.GetLoggerInstanceForType();
private bool _enabled;
private bool _enabled;
private bool _skip;
private bool _skip;
/// <summary> The name of the plugin. </summary>
/// <summary> The name of the plugin. </summary>
public string Name
public string Name
{
{
get { return "DominusFight"; }
get { return "DominusFight"; }
}
}
/// <summary> The description of the plugin. </summary>
/// <summary> The description of the plugin. </summary>
public string Description
public string Description
{
{
get { return "A plugin that handles the logic required for fighting Dominus."; }
get { return "A plugin that handles the logic required for fighting Dominus."; }
}
}
/// <summary>The author of the plugin.</summary>
/// <summary>The author of the plugin.</summary>
public string Author
public string Author
{
{
get { return "Bossland GmbH"; }
get { return "Bossland GmbH"; }
}
}
/// <summary>The version of the plugin.</summary>
/// <summary>The version of the plugin.</summary>
public Version Version
public Version Version
{
{
get { return new Version(0, 0, 1, 1); }
get { return new Version(0, 0, 1, 1); }
}
}
/// <summary>Initializes this plugin.</summary>
/// <summary>Initializes this plugin.</summary>
public void Initialize()
public void Initialize()
{
{
Log.DebugFormat("[DominusFight] Initialize");
Log.DebugFormat("[DominusFight] Initialize");
}
}
/// <summary> The plugin start callback. Do any initialization here. </summary>
/// <summary> The plugin start callback. Do any initialization here. </summary>
public void Start()
public void Start()
{
{
Log.DebugFormat("[DominusFight] Start");
Log.DebugFormat("[DominusFight] Start");
GameEventManager.AreaChanged += GameEventManagerOnAreaChanged;
GameEventManager.AreaChanged += GameEventManagerOnAreaChanged;
Reset();
Reset();
// Check to see if the current grind zone is for Dominus.
// Check to see if the current grind zone is for Dominus.
if (BasicGrindBotSettings.Instance.GrindZoneName != "The Upper Sceptre of God")
if (BasicGrindBotSettings.Instance.GrindZoneName != "The Upper Sceptre of God")
{
{
Log.InfoFormat("[DominusFight] The area to grind is not Dominus. Skipping execution until a restart or area change.");
Log.InfoFormat("[DominusFight] The area to grind is not Dominus. Skipping execution until a restart or area change.");
_skip = true;
_skip = true;
return;
return;
}
}
// We want to change the behavior after exploration, so we can start the boss fight, and stay in it
// We want to change the behavior after exploration, so we can start the boss fight, and stay in it
// though different phases.
// though different phases.
if (!TaskManager.AddAfter(new HandleDominusArea(), "ExploreTask"))
if (!TaskManager.AddAfter(new HandleDominusArea(), "ExploreTask"))
{
{
Log.ErrorFormat("[DominusFight] AddAfter failed.");
Log.ErrorFormat("[DominusFight] AddAfter failed.");
BotManager.Stop();
BotManager.Stop();
}
}
}
}
/// <summary> The plugin tick callback. Do any update logic here. </summary>
/// <summary> The plugin tick callback. Do any update logic here. </summary>
public void Tick()
public void Tick()
{
{
if (_skip)
if (_skip)
return;
return;
if (!LokiPoe.IsInGame || LokiPoe.Me.IsInTown || LokiPoe.Me.IsDead)
if (!LokiPoe.IsInGame || LokiPoe.Me.IsInTown || LokiPoe.Me.IsDead)
return;
return;
}
}
/// <summary> The plugin stop callback. Do any pre-dispose cleanup here. </summary>
/// <summary> The plugin stop callback. Do any pre-dispose cleanup here. </summary>
public void Stop()
public void Stop()
{
{
Log.DebugFormat("[DominusFight] Stop");
Log.DebugFormat("[DominusFight] Stop");
GameEventManager.AreaChanged -= GameEventManagerOnAreaChanged;
GameEventManager.AreaChanged -= GameEventManagerOnAreaChanged;
}
}
#region Implementation of IConfigurable
#region Implementation of IConfigurable
public JsonSettings Settings
public JsonSettings Settings