private async Task <bool> LookForTarget(string source, CancellationToken cancellationToken) { if (playerReader.HasTarget && !playerReader.Bits.TargetIsDead && !blacklist.IsTargetBlacklisted()) { return(true); } else { if (!cancellationToken.IsCancellationRequested) { npcNameTargeting.ChangeNpcType(NpcNameToFind); await input.TapNearestTarget(source); } if (!classConfig.KeyboardOnly) { if (!playerReader.HasTarget && !cancellationToken.IsCancellationRequested) { npcNameTargeting.ChangeNpcType(NpcNameToFind); if (npcNameTargeting.NpcCount > 0 && !cancellationToken.IsCancellationRequested) { await npcNameTargeting.TargetingAndClickNpc(true, cancellationToken); if (!cancellationToken.IsCancellationRequested) { await wait.Update(1); } } } } } return(!cancellationToken.IsCancellationRequested && playerReader.HasTarget && !blacklist.IsTargetBlacklisted()); }
public override async Task OnEnter() { await base.OnEnter(); if (bagReader.BagsFull) { logger.LogWarning("Inventory is full"); SendActionEvent(new ActionEventArgs(GoapKey.shouldskin, false)); } npcNameTargeting.ChangeNpcType(NpcNames.Corpse); }