summaryrefslogtreecommitdiff
path: root/npc/functions/nurse.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-06-20 18:21:12 -0300
committerJesusaves <cpntb1@ymail.com>2018-06-20 18:21:12 -0300
commit48c5b0b516e2ec422ba0503d8c18dc0c6e163c6a (patch)
treea8a47cb65c09e8bb90b1b4a4f759878c4eeb674f /npc/functions/nurse.txt
parent28914babfa8c12ea5657038a83a26c59024c85f2 (diff)
downloadserverdata-48c5b0b516e2ec422ba0503d8c18dc0c6e163c6a.tar.gz
serverdata-48c5b0b516e2ec422ba0503d8c18dc0c6e163c6a.tar.bz2
serverdata-48c5b0b516e2ec422ba0503d8c18dc0c6e163c6a.tar.xz
serverdata-48c5b0b516e2ec422ba0503d8c18dc0c6e163c6a.zip
Improve and fix nurse
Diffstat (limited to 'npc/functions/nurse.txt')
-rw-r--r--npc/functions/nurse.txt117
1 files changed, 52 insertions, 65 deletions
diff --git a/npc/functions/nurse.txt b/npc/functions/nurse.txt
index add33b9b7..e7889c0b5 100644
--- a/npc/functions/nurse.txt
+++ b/npc/functions/nurse.txt
@@ -6,83 +6,70 @@
// Name, Base Price, Price Multiplier
// getarg(3) switches functions:
-// 0 - everything (default)
// 1 - Only healing dialog (returns price)
// 2 - Only core healing
+// 3 - everything (default)
function script Nurse {
// Handle redirects
- .@d=getarg(3, 0);
- if(.@d == 0)
- goto L_HealMenu;
- if(.@d == 1)
- goto L_HealMenu;
- if(.@d == 2)
- goto L_Heal_L;
- mes col("Script error, bad Nurse value. Please report.", 1);
- close;
+ .@d=getarg(3, 3);
-L_HealMenu:
- mes "";
- mesn getarg(0);
- .@temp = rand(4);
- if(.@temp == 1) goto L_Heal2;
- if(.@temp == 2) goto L_Heal3;
- if(.@temp == 3) goto L_Heal4;
- goto L_Heal1;
-
-
-L_Heal1:
- mesq l("You don't look too well; let me treat your wounds.");
- mes "";
- goto L_Menu;
+ if (.@d & 1) {//&1
+ mes "";
+ mesn getarg(0);
+ .@temp = rand(1,4);
+ switch (.@temp) {
+ case 1:
+ mesq l("You don't look too well; let me treat your wounds.");
+ break;
+ case 2:
+ mesq l("I will make quick work of your wounds.");
+ break;
+ case 3:
+ mesq l("Need a healing?");
+ break;
+ case 4:
+ mesq l("Sometimes you just need to run from battle.");
+ break;
+ }
+ mes "";
-L_Heal2:
- mesq l("I will make quick work of your wounds.");
- mes "";
- goto L_Menu;
-
-L_Heal3:
- mesq l("Need a healing?");
- mes "";
- goto L_Menu;
-
-L_Heal4:
- mesq l("Sometimes you just need to run from battle.");
- mes "";
- goto L_Menu;
-
-L_Menu:
- .@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);
+ .@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 == 1)
+ if (!.@d & 2)
return .@price;
mesq l("For you, it'll be @@ GP.", .@price);
mes "";
- menu
- rif(Zeny >= .@price, l("Please heal me!")), L_Heal_L,
- l("Another time, maybe."), -;
- closedialog;
- goodbye;
- close;
+ select
+ rif(Zeny >= .@price, l("Please heal me!")),
+ l("Another time, maybe.");
-L_Heal_L:
- mes "";
- set Zeny, Zeny - .@price;
- sc_end(SC_POISON);
- sc_end(SC_SLOWPOISON);
- percentheal 100,100; // We can also use "recovery(<account id>)"
- mesn getarg(0);
- @temp = rand(1,4);
- if(@temp == 1) mesq l("Here you go!");
- if(@temp == 2) mesq l("Painless, wasn't it?");
- if(@temp == 3) mesq l("You should be more careful.");
- if(@temp == 4) mesq l("Much better, right?!");
- close;
+ if (@menu == 2) {
+ closedialog;
+ goodbye;
+ close;
+ }
+
+ }// & 1
+ if (.@d & 2) { // &2
+
+ mes "";
+ set Zeny, Zeny - .@price;
+ sc_end(SC_POISON);
+ sc_end(SC_SLOWPOISON);
+ percentheal 100,100; // We can also use "recovery(<account id>)"
+ mesn getarg(0);
+ @temp = rand(1,4);
+ if(@temp == 1) mesq l("Here you go!");
+ if(@temp == 2) mesq l("Painless, wasn't it?");
+ if(@temp == 3) mesq l("You should be more careful.");
+ if(@temp == 4) mesq l("Much better, right?!");
+ close;
+ }//&2
}