Skip to content

Commit c59bafb

Browse files
committed
add slash commands for aion aioff and aionnf
1 parent c142845 commit c59bafb

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

BossMod/AI/AIBehaviour.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void Execute(Actor player, Actor master)
3636
return;
3737

3838
// keep master in focus
39-
FocusMaster(master);
39+
//FocusMaster(master);
4040

4141
_afkMode = !master.InCombat && (_autorot.WorldState.CurrentTime - _masterLastMoved).TotalSeconds > 10;
4242
bool forbidActions = _forbidActions || _ctrl.IsMounted || _afkMode || _autorot.ClassActions == null || _autorot.ClassActions.AutoAction >= CommonActions.AutoActionFirstCustom;

BossMod/AI/AIManager.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ namespace BossMod.AI
99
{
1010
class AIManager : IDisposable
1111
{
12-
private Autorotation _autorot;
12+
public Autorotation _autorot;
1313
private AIController _controller;
1414
private AIConfig _config;
1515
private int _masterSlot = PartyState.PlayerSlot; // non-zero means corresponding player is master
1616
private AIBehaviour? _beh;
1717
private UISimpleWindow _ui;
18+
public bool _nft = false;
1819

1920
public AIManager(Autorotation autorot)
2021
{
@@ -71,7 +72,7 @@ private void DrawOverlay()
7172
}
7273
}
7374

74-
private void SwitchToIdle()
75+
public void SwitchToIdle()
7576
{
7677
_beh?.Dispose();
7778
_beh = null;
@@ -80,7 +81,7 @@ private void SwitchToIdle()
8081
_controller.Clear();
8182
}
8283

83-
private void SwitchToFollow(int masterSlot)
84+
public void SwitchToFollow(int masterSlot)
8485
{
8586
SwitchToIdle();
8687
_masterSlot = masterSlot;

BossMod/Framework/Plugin.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,23 @@ private void OnCommand(string cmd, string args)
161161
case "r":
162162
_wndReplay.SetVisible(!_wndReplay.IsOpen);
163163
break;
164+
case "aion":
165+
//turn ai on
166+
var leader = Service.PartyList[(int)Service.PartyList.PartyLeaderIndex];
167+
int leaderSlot = leader != null ? _ai._autorot.WorldState.Party.ContentIDs.IndexOf((ulong)leader.ContentId) : -1;
168+
_ai.SwitchToFollow(leaderSlot >= 0 ? leaderSlot : PartyState.PlayerSlot);
169+
break;
170+
case "aionnf":
171+
//turn ai on no follow
172+
var leader2 = Service.PartyList[(int)Service.PartyList.PartyLeaderIndex];
173+
int leaderSlot2 = leader2 != null ? _ai._autorot.WorldState.Party.ContentIDs.IndexOf((ulong)leader2.ContentId) : -1;
174+
_ai.SwitchToFollow(leaderSlot2 >= 0 ? leaderSlot2 : PartyState.PlayerSlot);
175+
_ai.SwitchToFollow(PartyState.PlayerSlot);
176+
break;
177+
case "aioff":
178+
//turn ai off
179+
_ai.SwitchToIdle();
180+
break;
164181
}
165182
}
166183

0 commit comments

Comments
 (0)