-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoroutines.Combat.cs
More file actions
60 lines (54 loc) · 1.39 KB
/
Coroutines.Combat.cs
File metadata and controls
60 lines (54 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Bots.Grind;
using Buddy.Coroutines;
using Styx;
using Styx.Common;
using Styx.CommonBot;
using Styx.CommonBot.Coroutines;
using Styx.CommonBot.Frames;
using Styx.CommonBot.POI;
using Styx.CommonBot.Profiles;
using Styx.Helpers;
using Styx.Pathing;
using Styx.TreeSharp;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using Action = System.Action;
namespace HighVoltz.AutoAngler
{
partial class Coroutines
{
private static Composite _combatBehavior;
static Composite CombatBehavior
{
get { return _combatBehavior ?? (_combatBehavior = LevelBot.CreateCombatBehavior()); }
}
public static async Task<bool> HandleCombat()
{
if (!Me.IsFlying && Me.IsActuallyInCombat)
{
var mainHand = Me.Inventory.Equipped.MainHand;
if ((mainHand == null || mainHand.Entry != AutoAnglerSettings.Instance.MainHand)
&& Utility.EquipWeapons())
{
return true;
}
if (await CombatBehavior.ExecuteCoroutine())
return true;
}
if (BotPoi.Current.Type == PoiType.Kill)
{
var unit = BotPoi.Current.AsObject as WoWUnit;
if (unit == null)
BotPoi.Clear("Target not found");
else if (unit.IsDead)
BotPoi.Clear("Target is dead");
}
return false;
}
}
}