Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix npc talk loop #703

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions AutoDuty/Managers/ActionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void InvokeAction(PathAction action)
Svc.Log.Error(ex.ToString());
}
}

public void Follow(PathAction action) => FollowHelper.SetFollow(GetObjectByName(action.Arguments[0]));

public void SetBMSettings(PathAction action) => Plugin.SetBMSettings(bool.TryParse(action.Arguments[0], out bool defaultsettings) && defaultsettings);
Expand Down Expand Up @@ -101,7 +101,7 @@ public unsafe void ConditionAction(PathAction action)
};
var operatorValue = string.Empty;
var operationResult = false;

switch (conditionArray[0])
{
case "GetDistanceToPlayer":
Expand Down Expand Up @@ -406,7 +406,7 @@ private unsafe bool InteractableCheck(IGameObject? gameObject)
if (gameObject == null || !gameObject.IsTargetable || !gameObject.IsValid() || !IsValid)
return true;

if (EzThrottler.Throttle("Interactable", 250))
if (EzThrottler.Throttle("Interactable", 1000))
{
if (!TryGetObjectByDataId(gameObject?.DataId ?? 0, out gameObject)) return true;

Expand Down Expand Up @@ -474,7 +474,7 @@ public unsafe void Interactable(PathAction action)
dataIds.Add(TryGetObjectIdRegex(action.Arguments[0], out objectDataId) ? (uint.TryParse(objectDataId, out var dataId) ? dataId : 0) : 0);

if (dataIds.All(x => x.Equals("0"))) return;

IGameObject? gameObject = null;
Plugin.Action = $"Interactable";
_taskManager.Enqueue(() => Player.Character->InCombat || (gameObject = Svc.Objects.Where(x => x.DataId.EqualsAny(dataIds) && x.IsTargetable).OrderBy(GetDistanceToPlayer).FirstOrDefault()) != null, "Interactable-GetGameObjectUnlessInCombat");
Expand Down Expand Up @@ -550,7 +550,7 @@ public void Boss(PathAction action)
_taskManager.Enqueue(() => BossCheck(), int.MaxValue, "Boss-BossCheck");
_taskManager.Enqueue(() => { Plugin.StopForCombat = true; }, "Boss-SetStopForCombatTrue");
_taskManager.Enqueue(() => { Plugin.BossObject = null; }, "Boss-ClearBossObject");

if (Plugin.Configuration.LootTreasure)
{
_taskManager.DelayNext("Boss-TreasureDelay", 1000);
Expand Down
Loading