BlueGit

timfa questward

Files

questward / shared / combat / combatLogout.js

combatLogout.js

combatLogout.js 549 B Download Raw
1/** Combat-logout stay-in-world + PvP cowardice rules. */
2
3/** How long after combat activity a combat-logged-out character may remain. */
4export const COMBAT_LOGOUT_MS = 5 * 60_000;
5
6/** Coins that must drop on offline PvP death to skip the cowardice skull. */
7export function combatLogoutCoinThreshold (combatLevel)
8{
9 return Math.max(0, (combatLevel | 0) * 50);
10}
11
12/** Wall-clock hour bucket used for the once-per-hour cowardice forgiveness. */
13export function cowardiceHourKey (now = Date.now())
14{
15 return Math.floor(Number(now) / 3_600_000);
16}