From 8dbffa63a1c2639031b41de9fcca825e8355e78f Mon Sep 17 00:00:00 2001 From: xangelo Date: Fri, 7 Jul 2023 13:12:42 -0400 Subject: [PATCH] fix: give users free healing if they have less than 20g --- src/events/healer/server.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/events/healer/server.ts b/src/events/healer/server.ts index 4347954..e3f3634 100644 --- a/src/events/healer/server.ts +++ b/src/events/healer/server.ts @@ -110,15 +110,15 @@ export const healer: SocketEvent = { text.push(`

You're already at full health?

`); } else { - if(api.player.level <= 3) { - text.push(`

Since you still seem to be new around here, this one's on the house!

`); + if(api.player.gold <= (healCost * 2)) { + text.push(`

You don't seem to have too much money... I guess I can do it for free this time...

`); text.push(`

`); } else { text.push(`

`); } - } + } api.socket.emit('city:service:healer', { text: text.join("\n") @@ -145,7 +145,7 @@ export const heal: SocketEvent = { text.push(`

${service.name}

`); - const cost = api.player.level <= 3 ? 0 : healCost; + const cost = api.player.gold <= (healCost * 2) ? 0 : healCost; if(api.player.gold < cost) { text.push(`

${getText('insufficient_money', service, city)}

`) -- 2.25.1