summaryrefslogtreecommitdiff
path: root/npc/functions/nurse.txt
blob: 4edc1b85a3173234d12572e3b688191ca6047ef3 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// TMW-2 Script
// Author:
//    Jesusalva
//  Description:
//    Nurse for all hurt players

// Name, Base Price, Price Multiplier
// getarg(3) switches functions:
//   1 - Only healing dialog (returns price)
//   2 - Only core healing
//   3 - everything (default)
function	script	Nurse	{
    AerosFall(l("medical services are suspended", getmap() != "001-15"));
    // Handle redirects
    .@d=getarg(3, 3);

    // Botter Syndrome
    if (CAPTCHA_NPC$ == getmap()) {
        sc_end SC_BOTTER_SYNDROME;
        CAPTCHA_NPC$ = "";
        mesn getarg(0);
        mesq l("Oh dear, another one with Botter Syndrome? Here, have this injection. Done. You're now all patched up.");
        mes "";
        mesn strcharinfo(0);
        mesc l("Ouch!");
        next;
    }

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

        // Random message
        .@temp = rand2(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 "";

    // Skip menu flag
    if (!(.@d & 2))
        return .@price;

    mesq l("For you, it'll be @@ GP.", .@price);
    mes "";
    select
        rif(Zeny >= .@price, l("Please heal me!")),
        l("Another time, maybe.");

    if (@menu == 2) {
        closedialog;
        goodbye;
        close;
    }

    }// & 1

    // Allowed Nurse to do the healing
    if (.@d & 2) { // &2

        // Heal persona
        mes "";
        set Zeny, Zeny - .@price;
        // Heal status ailments, subset from the Elixir of Life
		//sc_end SC_STONE; // Unable to unpetrify
		//sc_end SC_FREEZE; // Not warm enough
		//sc_end SC_STUN; // Not effective enough
		sc_end SC_POISON;
		sc_end SC_DPOISON;
		sc_end SC_CURSE;
		sc_end SC_SILENCE;
		sc_end SC_CONFUSION;
		sc_end SC_BLIND;
		sc_end SC_BLOODING; // FIXME: Failing?
		//sc_end SC_FEAR; // Cannot heal fear
		sc_end SC_COLD;
		sc_end SC_BURNING;
		sc_end SC_SLEEP;
		//sc_end SC_DEEP_SLEEP; // Cannot wake you from a heavy slumber
		sc_end SC_DEC_AGI;
		sc_end SC_FROSTMISTY;
		sc_end SC_VENOMBLEED;
		sc_end SC_QUAGMIRE;
		sc_end SC_MOVESLOW_POTION;
		sc_end SC_FROSTMISTY;
		//sc_end SC_BOTTER_SYNDROME; // Only when set by CAPTCHA$
		sc_end SC_HALT_REGENERATION;
        // We can also use "recovery()" but that revives players :o
        percentheal 100,100;
        // Grant temporary immunity to same map effects
		@coolio=max(gettimetick(2), @coolio)+45;
		@sickio=max(gettimetick(2), @sickio)+45;
		@purifio=max(gettimetick(2), @purifio)+45;
		@bleedio=max(gettimetick(2), @bleedio)+45;
		@frostio=max(gettimetick(2), @frostio)+45;
		@leechio=max(gettimetick(2), @leechio)+45;
		@windyio=max(gettimetick(2), @windyio)+45;
        // Report completion
        mesn getarg(0);
        @temp = rand2(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
    return;
}