Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Reflection;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using ZzukBot.Engines.CustomClass;
- using ZzukBot.Engines.CustomClass.Objects;
- namespace OrionHunter
- {
- internal static class Constants
- {
- public static readonly Version Release = new Version(0, 1);
- public const string Name = "kevinsugerhunter";
- public const byte Class = PlayerClass.Hunter;
- public static readonly string[] TalentStrings =
- {
- "5500320152521251052500000000000000000000000000"
- };
- }
- public class Core : CustomClass
- {
- private readonly Spellbook spellbook;
- private readonly TalentManager talentManager;
- public Core()
- {
- this.spellbook = new Spellbook(this);
- this.talentManager = new TalentManager(this.Player);
- }
- public override string CustomClassName
- {
- get { return string.Format("{0} {1}", Constants.Name, Constants.Release); }
- }
- public override byte DesignedForClass
- {
- get { return Constants.Class; }
- }
- public override void Fight()
- {
- try
- {
- try
- {
- if (this.IsCastingSpell(Spellbook.MendPet))
- {
- return;
- }
- }
- catch (Exception)
- {
- }
- if (this.IsNotCasting() == false)
- {
- return;
- }
- if (this.HandledMultiTargetCombat() == false)
- {
- return;
- }
- if (this.TakeCareOfOurPet())
- return;
- var damageSpells = this.spellbook.GetDamageSpells();
- foreach (var spell in damageSpells)
- {
- if (spell.IsWanted && this.CanCast(spell))
- {
- this.spellbook.UpdateLastSpell(spell);
- this.Cast(spell);
- break;
- }
- }
- this.CheckForLastResorts();
- }
- catch (Exception)
- {
- }
- }
- public override void PreFight()
- {
- try
- {
- try
- {
- if (this.IsCastingSpell(Spellbook.RevivePet) || this.IsCastingSpell(Spellbook.MendPet) || (this.Player.GotPet() && this.Pet.GotBuff("Feed Pet Effect")))
- {
- return;
- }
- }
- catch (Exception)
- {
- }
- var huntersMark = Spellbook.HuntersMark;
- if (huntersMark.IsWanted && this.CanCast(huntersMark))
- {
- this.Cast(huntersMark);
- }
- this.EnsureTargetIsWithinRange();
- if (this.Player.ToCloseForRanged)
- {
- this.Fight();
- return;
- }
- if (Target.DistanceToPlayer <= 28)
- {
- if (this.Player.GotPet())
- {
- this.Fight();
- }
- else
- {
- var serpentSting = Spellbook.SerpentSting;
- if (!this.CanCast(serpentSting))
- this.Player.RangedAttack();
- else if (serpentSting.IsWanted)
- this.Cast(serpentSting);
- else
- this.Fight();
- }
- }
- }
- catch (Exception)
- {
- }
- }
- public override bool Buff()
- {
- try
- {
- if (this.IsCastingSpell(Spellbook.RevivePet) || this.IsCastingSpell(Spellbook.MendPet) || (this.Player.GotPet() && this.Pet.GotBuff("Feed Pet Effect")))
- {
- return false;
- }
- bool needToRevive = false;
- try
- {
- needToRevive = !this.Pet.IsAlive() && this.Player.GotPet();
- }
- catch (Exception ex)
- {
- needToRevive = this.Player.GotPet();
- }
- if (!needToRevive && this.Player.GotPet() && this.Pet.HealthPercent > 1 && this.Pet.HealthPercent < 50)
- return false;
- if (needToRevive && this.CanCast(Spellbook.RevivePet))
- {
- this.TryCast(Spellbook.RevivePet);
- return false;
- }
- else if (!this.Player.GotPet())
- {
- bool couldCastCallPet = this.TryCast(Spellbook.CallPet);
- if (!couldCastCallPet)
- this.TryCast(Spellbook.RevivePet);
- return false;
- }
- var mendPet = Spellbook.MendPet;
- if (mendPet.IsWanted && this.CanCast(mendPet))
- {
- this.Cast(mendPet);
- return false;
- }
- var buffs = this.spellbook.GetBuffSpells();
- foreach (var spell in buffs)
- {
- if (spell.IsWanted && this.CanCast(spell))
- {
- this.Cast(spell);
- return false;
- }
- }
- }
- catch (Exception ex)
- {
- }
- if (this.Player.GotPet() && this.Pet.DistanceToPlayer > 10)
- this.Pet.FollowPlayer();
- return true;
- }
- public override void Rest()
- {
- try
- {
- if (this.IsNotCasting() == false)
- {
- return;
- }
- var mendPet = Spellbook.MendPet;
- if (mendPet.IsWanted && this.CanCast(mendPet))
- {
- this.Cast(mendPet);
- }
- this.Player.Drink();
- this.Player.Eat();
- }
- catch (Exception)
- {
- }
- }
- private bool HandledMultiTargetCombat()
- {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement