using Jungler.Bot.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace Bolge
{
public class Fisher : Core
{
protected Dictionary<string, string> actions;
private string tekSkill;
private string CastingSkill;
private double CastingSkillId;
private bool MoveF;
public Fisher()
{
base.\u002Ector();
this.actions = new Dictionary<string, string>()
{
{
"Отчаянное сопротивление",
"Ослабить леску"
},
{
"Рывок на глубину",
"Подкрутить катушку"
},
{
"Прыжок над водой",
"Подсечь"
}
};
}
public static string GetPluginAuthor()
{
return "Andreich";
}
public static string GetPluginVersion()
{
return "1.0.0.0";
}
public static string GetPluginDescription()
{
return "Fishing machine";
}
protected void Wait()
{
while (((Creature) this.get_me()).get_target() == null || ((Creature) this.get_me()).get_target().get_target() != null && ((Creature) this.get_me()).get_target().get_target() != this.get_me() || this.getBuff(((Creature) this.get_me()).get_target(), "Рыбак и море") == null)
Thread.Sleep(1000);
}
protected void Cel()
{
while (true)
{
if (((Creature) this.get_me()).get_target() != null)
this.TurnDirectly((SpawnObject) ((Creature) this.get_me()).get_target());
Thread.Sleep(1000);
}
}
protected void StepForw()
{
if (this.MoveF)
{
try
{
this.MoveForward(true);
Thread.Sleep(70);
}
finally
{
this.MoveForward(false);
}
}
else
{
try
{
this.MoveBackward(true);
Thread.Sleep(70);
}
finally
{
this.MoveBackward(false);
}
}
this.MoveF = !this.MoveF;
}
protected void Stopper()
{
while (true)
{
this.Wait();
if (this.getBuff(((Creature) this.get_me()).get_target(), "Натяжение лески") != null && this.isCasting())
{
try
{
this.MoveForward(true);
Thread.Sleep(100);
}
finally
{
this.MoveForward(false);
}
this.Log("Cancellllllllll", false);
Thread.Sleep(1500);
}
Thread.Sleep(100);
}
}
private void skillCasting(Creature obj, SpawnObject obj2, Skill skill, double x, double y, double z)
{
if (obj != this.get_me())
return;
this.CastingSkill = skill.get_name();
this.CastingSkillId = (double) skill.get_id();
}
public void PluginRun()
{
// ISSUE: method pointer
this.add_onSkillCasting(new CoreInternal.SkillCasting((object) this, __methodptr(skillCasting)));
this.tekSkill = "";
this.CastingSkill = "";
this.CastingSkillId = 0.0;
this.MoveF = true;
while (true)
{
if (((Creature) this.get_me()).get_isCasting() && ((Creature) this.get_me()).get_target() != null && this.CastingSkill == "Рыбачить на блесну")
{
this.Log("Клюнуло!!!", false);
this.CancelSkill();
}
if (((Creature) this.get_me()).get_target() != null && ((Creature) this.get_me()).get_target().isAlive())
{
if (this.angle(((Creature) this.get_me()).get_target(), (Creature) this.get_me()) > 50 && this.angle(((Creature) this.get_me()).get_target(), (Creature) this.get_me()) < 310)
this.TurnDirectly((SpawnObject) ((Creature) this.get_me()).get_target());
if (((Creature) this.get_me()).get_target() != null && ((Creature) this.get_me()).get_target().isAlive() && (this.buffTime(((Creature) this.get_me()).get_target(), "Отчаянное сопротивление") < 1000L && this.buffTime(((Creature) this.get_me()).get_target(), "Отчаянное сопротивление") > 0L || this.buffTime(((Creature) this.get_me()).get_target(), "Рывок влево") < 1000L && this.buffTime(((Creature) this.get_me()).get_target(), "Рывок влево") > 0L || this.buffTime(((Creature) this.get_me()).get_target(), "Рывок вправо") < 1000L && this.buffTime(((Creature) this.get_me()).get_target(), "Рывок вправо") > 0L))
{
if (((Creature) this.get_me()).get_isCasting())
{
this.Log("Cancel " + this.CastingSkill, false);
this.CancelSkill();
}
}
else if (((Creature) this.get_me()).get_target() != null && ((Creature) this.get_me()).get_target().isAlive() && Enumerable.Count<Buff>(Enumerable.Where<Buff>((IEnumerable<Buff>) ((Creature) this.get_me()).get_target().getBuffs(), (Func<Buff, bool>) (x => x.get_name().Contains("Отчаянное сопротивление")))) > 0)
{
if (((Creature) this.get_me()).get_isCasting() && this.CastingSkill != "Ослабить леску")
{
this.CancelSkill();
this.Log("Cancel " + this.CastingSkill, false);
}
if (((Creature) this.get_me()).get_isCasting() && this.CastingSkill == "Ослабить леску")
{
Thread.Sleep(100);
}
else
{
this.UseSkill("Ослабить леску");
this.Log("Ослабили леску", false);
}
}
else if (((Creature) this.get_me()).get_target() != null && ((Creature) this.get_me()).get_target().isAlive() && Enumerable.Count<Buff>(Enumerable.Where<Buff>((IEnumerable<Buff>) ((Creature) this.get_me()).get_target().getBuffs(), (Func<Buff, bool>) (x => x.get_name().Contains("Рывок на глубину")))) > 0)
{
if (((Creature) this.get_me()).get_isCasting() && this.CastingSkill != "Подкрутить катушку")
{
this.CancelSkill();
this.Log("Cancel " + this.CastingSkill, false);
}
if (((Creature) this.get_me()).get_isCasting() && this.CastingSkill == "Подкрутить катушку")
{
Thread.Sleep(100);
}
else
{
this.UseSkill("Подкрутить катушку");
this.Log("Подкрутить катушку", false);
}
}
else if (((Creature) this.get_me()).get_target() != null && ((Creature) this.get_me()).get_target().isAlive() && Enumerable.Count<Buff>(Enumerable.Where<Buff>((IEnumerable<Buff>) ((Creature) this.get_me()).get_target().getBuffs(), (Func<Buff, bool>) (x => x.get_name().Contains("Прыжок над водой")))) > 0)
{
if (((Creature) this.get_me()).get_isCasting() && this.CastingSkill != "Подсечь")
{
this.CancelSkill();
this.Log("Cancel " + this.CastingSkill, false);
}
if (((Creature) this.get_me()).get_isCasting() && this.CastingSkill == "Подсечь")
{
Thread.Sleep(100);
}
else
{
this.UseSkill("Подсечь");
this.Log("Подсекаем", false);
}
}
else if (((Creature) this.get_me()).get_target() != null && ((Creature) this.get_me()).get_target().isAlive() && Enumerable.Count<Buff>(Enumerable.Where<Buff>((IEnumerable<Buff>) ((Creature) this.get_me()).get_target().getBuffs(), (Func<Buff, bool>) (x => x.get_name().Contains("Рывок влево")))) > 0)
{
if (((Creature) this.get_me()).get_isCasting() && this.CastingSkill != "Отвести удилище влево" || this.buffTime(((Creature) this.get_me()).get_target(), "Рывок влево") < 1000L && this.buffTime(((Creature) this.get_me()).get_target(), "Рывок влево") > 0L && this.CastingSkillId == 21194.0)
{
this.Log("Cancel " + this.CastingSkill, false);
this.CancelSkill();
}
if (this.CastingSkillId == 21194.0)
{
Thread.Sleep(50);
}
else
{
this.UseSkill("Отвести удилище влево");
this.Log("Отводим влево", false);
}
}
else if (((Creature) this.get_me()).get_target() != null && ((Creature) this.get_me()).get_target().isAlive() && Enumerable.Count<Buff>(Enumerable.Where<Buff>((IEnumerable<Buff>) ((Creature) this.get_me()).get_target().getBuffs(), (Func<Buff, bool>) (x => x.get_name().Contains("Рывок вправо")))) > 0)
{
if (((Creature) this.get_me()).get_isCasting() && this.CastingSkill != "Отвести удилище вправо")
{
this.CancelSkill();
this.Log("Cancel " + this.CastingSkill, false);
}
if (((Creature) this.get_me()).get_isCasting() && this.CastingSkill == "Отвести удилище вправо")
{
Thread.Sleep(50);
}
else
{
this.UseSkill("Отвести удилище вправо");
this.Log("Отводим вправо", false);
}
}
else
this.tekSkill = "";
}
Thread.Sleep(100);
}
}
}
}