From 31bb4f529f319a69779d343d3d973ebb526be7e5 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 15 Mar 2019 16:12:50 -0300 Subject: Sanitize a bit Nurse code --- npc/functions/nurse.txt | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'npc/functions/nurse.txt') diff --git a/npc/functions/nurse.txt b/npc/functions/nurse.txt index d63f5fe68..0e6b0b4b4 100644 --- a/npc/functions/nurse.txt +++ b/npc/functions/nurse.txt @@ -13,6 +13,15 @@ function script Nurse { // Handle redirects .@d=getarg(3, 3); + // Calculate price + .@price=(MaxHp-Hp)/getarg(1,5); + .@price=.@price+getarg(2, 10); + if (BaseLevel <= 15) .@price=(.@price/10); + else if (BaseLevel <= 20) .@price=(.@price/5); + else .@price=(.@price/2); + + + // 1 - Only Healing Dialog and return .@price if (.@d & 1) {//&1 mes ""; mesn getarg(0); @@ -35,13 +44,6 @@ function script Nurse { } mes ""; - // Calculate price - .@price=(MaxHp-Hp)/getarg(1,5); - .@price=.@price+getarg(2, 10); - if (BaseLevel <= 15) .@price=(.@price/10); - else if (BaseLevel <= 20) .@price=(.@price/5); - else .@price=(.@price/2); - // Skip menu flag if (!(.@d & 2)) return .@price; @@ -59,16 +61,9 @@ function script Nurse { } }// & 1 - if (.@d & 2) { // &2 - if (!(.@d & 1)) { - // (Re)Calculate price - .@price=(MaxHp-Hp)/getarg(1,5); - .@price=.@price+getarg(2, 10); - if (BaseLevel <= 15) .@price=(.@price/10); - else if (BaseLevel <= 20) .@price=(.@price/5); - else .@price=(.@price/2); - } + // Allowed Nurse to do the healing + if (.@d & 2) { // &2 // Heal persona mes ""; -- cgit v1.2.3-60-g2f50