fix: Fixes skill cooldown for some target skills (#2231)

### Summary

Stealing, Detect Hidden, and Begging will now give credit for the time it took the player to use the targeter against the total skill cooldown. So if the player takes longer than 10s to target, then they can use a skill again immediately.

> [!NOTE]
> This does not change the requirement that players can no longer stack target these skills.
This commit is contained in:
Kamron Batman 2025-07-06 22:50:40 -07:00 • committed by GitHub
parent c0948fd0e2
commit 55d653d752
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 74 additions and 63 deletions

View file

@ -114,7 +114,13 @@ namespace Server.SkillHandlers
src.SendLocalizedMessage(500817); // You can see nothing hidden there.
}
src.NextSkillTime = Core.TickCount + 6000; // 6 seconds cooldown
const int TargeterCooldown = 30000; // 30s
const int SkillCooldown = 10000; // 10s
// Calculate how much time has passed since the targeter was opened
int ticksSinceTargeter = (int)(Core.TickCount - (src.NextSkillTime - TargeterCooldown));
int remainingCooldown = Math.Max(0, SkillCooldown - ticksSinceTargeter);
src.NextSkillTime = Core.TickCount + remainingCooldown;
}
}
}