using System;
using System.Linq;
using System.Windows.Media;
using ff14bot.AClasses;
using ff14bot.BotBases;
using ff14bot.Helpers;
using ff14bot.Managers;
namespace ChainIt
{
public class ChainIt : BotPlugin
{
public override string Author { get { return "Heinzskies"; } }
public override Version Version { get { return new Version(0, 0, 1); } }
public override string Name { get { return "ChainIt"; } }
public override string Description { get { return "Allow you to do chain quest without going back."; } }
public override bool WantButton
{
get { return false; }
}
public new bool Equals(BotPlugin other)
{
throw new NotImplementedException();
}
bool _lastFateChainActive = false;
FateIdleAction _userAction = FateIdleAction.Nothing;
public override void OnPulse()
{
uint[] chain1 = { 791, 792 };
handleFateschain(chain1);
uint[] chain2 = { 809, 810 };
handleFateschain(chain2);
/* uint[] chain3 = { 811, 812 };
handleFateschain(chain3); */
}
public void handleFateschain(uint[] fatesChain)
{
foreach (var fateChain in from fateChain in fatesChain let fateSearch = FateManager.ActiveFates.Count(fate => fate.Id == fateChain) where fateSearch != 0 select fateChain)
{
ActiveChain();
if (fatesChain.Last() == fateChain)
{
_lastFateChainActive = true;
}
FatebotSettings.Instance.ThisFateOnly = FateManager.GetFateById(fateChain).Name;
}
if (FateManager.ActiveFates.Count(fate => fate.Id == fatesChain.Last()) == 0 && _lastFateChainActive)
{
_lastFateChainActive = false;
FatebotSettings.Instance.ThisFateOnly = "";
FatebotSettings.Instance.IdleAction = _userAction;
}
}
private void ActiveChain()
{
if (FatebotSettings.Instance.IdleAction != FateIdleAction.Nothing)
{
_userAction = FatebotSettings.Instance.IdleAction;
}
FatebotSettings.Instance.IdleAction = FateIdleAction.Nothing;
}
public override void OnInitialize()
{
}
public override void OnShutdown()
{
throw new NotImplementedException();
}
public override void OnEnabled()
{
Logging.Write(Colors.SkyBlue, "[ChainIt] v" + Version + " Enabled");
}
public override void OnDisabled()
{
}
}
}