forked from DrewKestell/BloogBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArmsWarriorBot.cs
72 lines (62 loc) · 2.79 KB
/
ArmsWarriorBot.cs
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
61
62
63
64
65
66
67
68
69
70
71
72
using BloogBot;
using BloogBot.AI;
using BloogBot.Game;
using BloogBot.Game.Enums;
using BloogBot.Game.Objects;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
namespace ArmsWarriorBot
{
[Export(typeof(IBot))]
class ArmsWarriorBot : Bot, IBot
{
public string Name => "Arms Warrior";
public string FileName => "ArmsWarriorBot.dll";
// omit any targets that bring the player too close to another threat while moving to that target
bool AdditionalTargetingCriteria(WoWUnit u) =>
!ObjectManager.Units.Any(o =>
o.Level > ObjectManager.Player.Level - 3 &&
(o.UnitReaction == UnitReaction.Hated || o.UnitReaction == UnitReaction.Hostile) &&
o.Guid != ObjectManager.Player.Guid &&
o.Guid != u.Guid &&
false &&
Navigation.CalculatePath(ObjectManager.MapId, ObjectManager.Player.Position, u.Position, false).Any(p => p.DistanceTo(o.Position) < 30)
);
IBotState CreateRestState(Stack<IBotState> botStates, IDependencyContainer container) =>
new RestState(botStates, container);
IBotState CreateMoveToTargetState(Stack<IBotState> botStates, IDependencyContainer container, WoWUnit target) =>
new MoveToTargetState(botStates, container, target);
IBotState CreatePowerlevelCombatState(Stack<IBotState> botStates, IDependencyContainer container, WoWUnit target, WoWPlayer powerlevelTarget) =>
new PowerlevelCombatState(botStates, container, target, powerlevelTarget);
public IDependencyContainer GetDependencyContainer(BotSettings botSettings, Probe probe, IEnumerable<Hotspot> hotspots) =>
new DependencyContainer(
AdditionalTargetingCriteria,
CreateRestState,
CreateMoveToTargetState,
CreatePowerlevelCombatState,
botSettings,
probe,
hotspots);
public void Test(IDependencyContainer container)
{
//var target = ObjectManager.Units.FirstOrDefault(u => u.Guid == ObjectManager.Player.TargetGuid);
//if (target != null)
//{
// Console.WriteLine(target.CanBeLooted);
//}
ThreadSynchronizer.RunOnMainThread(() =>
{
var results = Functions.LuaCallWithResult($"{{0}}, {{1}}, {{2}}, {{3}} = GetGossipOptions()");
if (results.Length > 0)
{
Console.WriteLine(results[0]);
Console.WriteLine(results[1]);
Console.WriteLine(results[2]);
Console.WriteLine(results[3]);
}
});
}
}
}