summaryrefslogtreecommitdiff
path: root/npc/functions/nurse.txt
blob: 4f95d68b4c22c2591c324087b38ea52867794419 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// TMW-2 Script
// Author:
//    Jesusalva
//  Description:
//    Nurse for all hurt players

// Name, Base Price, Price Multiplier
// getarg(3) switches functions:
//   0 - everything (default)
//   1 - Only healing dialog (returns price)
//   2 - Only core healing
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;

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;

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);

    // Skip menu flag
    if(.@d == 1)
        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."), L_Close;


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;

}