summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-03-15 16:12:50 -0300
committerJesusaves <cpntb1@ymail.com>2019-03-15 16:12:50 -0300
commit31bb4f529f319a69779d343d3d973ebb526be7e5 (patch)
treefea513b6ee315cb61e355011ac16a47cf26aca0a /npc
parent425976d831c57d71aa0bb05fcff33f716407fc85 (diff)
downloadserverdata-31bb4f529f319a69779d343d3d973ebb526be7e5.tar.gz
serverdata-31bb4f529f319a69779d343d3d973ebb526be7e5.tar.bz2
serverdata-31bb4f529f319a69779d343d3d973ebb526be7e5.tar.xz
serverdata-31bb4f529f319a69779d343d3d973ebb526be7e5.zip
Sanitize a bit Nurse code
Diffstat (limited to 'npc')
-rw-r--r--npc/functions/nurse.txt27
1 files changed, 11 insertions, 16 deletions
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 "";