Skip to content

Commit

Permalink
Update CoreBots.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
wtffidy committed Nov 13, 2024
1 parent f344a4d commit 335741a
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions CoreBots.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1952,7 +1952,7 @@ public void RegisterQuests(params int[] questIDs)
{
if (!Bot.Quests.IsInProgress(quest.ID))
{
Bot.Quests.EnsureAccept(quest.ID);
Bot.Quests.Accept(quest.ID);
await Task.Delay(500); // Wait for half a second to ensure the quest is accepted
}
Expand All @@ -1961,11 +1961,6 @@ public void RegisterQuests(params int[] questIDs)
// Determine reward ID if quest is in the chooseQuests dictionary
int rewardId = -1;
int turnIns = Bot.Flash.CallGameFunction<int>("world.maximumQuestTurnIns", quest.ID);
if (turnIns == 0)
continue;
if (chooseQuests.ContainsKey(quest))
{
Quest? activeQuest = InitializeWithRetries(() => Bot.Quests.Active.FirstOrDefault(q => q.ID == quest.ID));
Expand All @@ -1979,11 +1974,10 @@ public void RegisterQuests(params int[] questIDs)
// Ensure quest is loaded, and is entirely completable.
if (Bot.Quests.IsInProgress(quest.ID))
{
if (Bot.Quests.CanCompleteFullCheck(quest.ID))
Bot.Send.Packet($"%xt%zm%tryQuestComplete%{Bot.Map.RoomID}%{quest.ID}%{rewardId}%false%{(quest.Once || !string.IsNullOrEmpty(quest.Field) ? 1 : Bot.Flash.CallGameFunction<int>("world.maximumQuestTurnIns", quest.ID))}%wvz%");
Bot.Send.Packet($"%xt%zm%tryQuestComplete%{Bot.Map.RoomID}%{quest.ID}%{rewardId}%false%{(quest.Once || !string.IsNullOrEmpty(quest.Field) ? 1 : Bot.Flash.CallGameFunction<int>("world.maximumQuestTurnIns", quest.ID))}%wvz%");
// Bot.Flash.CallGameFunction("world.tryQuestComplete", quest.ID, false, turnIns);
await Task.Delay(500); // Wait for half a second to ensure the quest is completed
Bot.Quests.EnsureAccept(quest.ID); // Reaccept the quest after completion
Bot.Quests.Accept(quest.ID); // Reaccept the quest after completion
await Task.Delay(500); // Wait for half a second to ensure the quest is reaccepted
}
}
Expand Down

0 comments on commit 335741a

Please sign in to comment.