forked from Entrax643/ExBuddy
/
NoAetheryteUseTransportReturnStrategy.cs
87 lines (64 loc) · 2.28 KB
/
NoAetheryteUseTransportReturnStrategy.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
namespace ExBuddy
{
using Buddy.Coroutines;
using Clio.Utilities;
using ExBuddy.Helpers;
using ExBuddy.Interfaces;
using ff14bot;
using ff14bot.Behavior;
using ff14bot.Managers;
using ff14bot.RemoteWindows;
using System.Threading.Tasks;
public class NoAetheryteUseTransportReturnStrategy : IReturnStrategy
{
public NoAetheryteUseTransportReturnStrategy()
{
DialogOption = -1;
InteractDistance = 4.0f;
}
public int DialogOption { get; set; }
public float InteractDistance { get; set; }
public uint NpcId { get; set; }
public Vector3 NpcLocation { get; set; }
#region IAetheryteId Members
public uint AetheryteId { get; set; }
#endregion IAetheryteId Members
#region IZoneId Members
public ushort ZoneId { get; set; }
#endregion IZoneId Members
public override string ToString()
{
return string.Format(
"NoAetheryteUseTransport: Death Location: {0}, AetheryteId: {1}, NpcLocation: {2}",
InitialLocation,
AetheryteId,
NpcLocation);
}
#region IReturnStrategy Members
public Vector3 InitialLocation { get; set; }
public async Task<bool> ReturnToLocation()
{
if (BotManager.Current.EnglishName != "Fate Bot")
{
return await InitialLocation.MoveTo();
}
await Coroutine.Sleep(1000);
return true;
}
public async Task<bool> ReturnToZone()
{
await this.TeleportTo();
await NpcLocation.MoveTo(true, radius: InteractDistance);
GameObjectManager.GetObjectByNPCId(NpcId).Target();
Core.Player.CurrentTarget.Interact();
// Temporarily assume selectyesno until we see if we need it for anything but hinterlands
await Coroutine.Wait(5000, () => SelectYesno.IsOpen);
SelectYesno.ClickYes();
await Coroutine.Wait(5000, () => CommonBehaviors.IsLoading);
await CommonTasks.HandleLoading();
await Coroutine.Sleep(2000);
return true;
}
#endregion IReturnStrategy Members
}
}