Add a minimum delay to redeeming item rewards

This commit is contained in:
Liza 2025-01-03 11:18:45 +01:00
parent dbc31f429f
commit e73d04ce2d
Signed by: liza
GPG Key ID: 2C41B84815CF6445

View File

@ -49,6 +49,7 @@ internal static class RedeemRewardItems
GameFunctions gameFunctions,
ICondition condition) : TaskExecutor<Task>
{
private static readonly TimeSpan MinimumCastTime = TimeSpan.FromSeconds(4);
private DateTime _continueAt;
protected override bool Start()
@ -56,7 +57,13 @@ internal static class RedeemRewardItems
if (condition[ConditionFlag.Mounted])
return false;
_continueAt = DateTime.Now.Add(Task.ItemReward.CastTime).AddSeconds(1);
TimeSpan castTime = Task.ItemReward.CastTime;
if (castTime < MinimumCastTime)
castTime = MinimumCastTime;
_continueAt = DateTime.Now
.Add(castTime)
.AddSeconds(1);
return gameFunctions.UseItem(Task.ItemReward.ItemId);
}