summaryrefslogtreecommitdiff
path: root/npc/020-1/trainer.txt
blob: e1b2a778e64846660fcb50a1162779f452b95ad5 (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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    Mercenary Trainer

020-1,39,89,0	script	Mercenary Trainer	NPC_REDY_MALE_SWORD,{
    mesn;
    mesq l("Hello, I am a sword to hire, a Mercenary Trainer and Chief.");
    next;
    mesn;
    mesq l("Do you want to hire a mercenary? Or perhaps get a card so you can invoke them later? I can even make them stronger if you wish.");
    next;
    goto L_Main;

L_Main:
    select
        l("Hire a mercenary"),
        l("Buy a mercenary card"),
        l("Evolve mercenaries"),
        l("Bye.");
    mes "";
    switch (@menu) {
        // Hire Card
        case 1:
            menuint
                l("[%d GP] [Lv 1~25] Hire for one hour", 2500), 1,
                l("[%d GP] [Lv 26~40] Hire for one hour", 7500), 2,
                l("[%d GP] [Lv 41~60] Hire for one hour", 15000), 3,
                l("[%d GP] [Lv 61~79] Hire for one hour", 30000), 4,
                l("[%d GP] [Lv 80~100] Hire for one hour", 50000), 5,
                l("I've changed my mind"), 0;
            switch (@menuret) {
                case 1:
                    .@gp=max(2000, POL_AdjustPrice(2500));
                    if (Zeny < .@gp) {
                        mesc l("You cannot pay."), 1;
                        next;
                    } else {
                        .@mid=merc_randid(0, 0, 0, 0, 1000);
                        mercenary_create(.@mid, 3600000);
                        POL_PlayerMoney(.@gp);
                    }
                    break;
                case 2:
                    .@gp=max(7000, POL_AdjustPrice(7500));
                    if (Zeny < .@gp) {
                        mesc l("You cannot pay."), 1;
                        next;
                    } else {
                        .@mid=merc_randid(0, 0, 0, 1000, 0);
                        mercenary_create(.@mid, 3600000);
                        POL_PlayerMoney(.@gp);
                    }
                    break;
                case 3:
                    .@gp=max(14000, POL_AdjustPrice(15000));
                    if (Zeny < .@gp) {
                        mesc l("You cannot pay."), 1;
                        next;
                    } else {
                        mercenary_create merc_randid(0, 0, 1000, 0, 0), 3600000;
                        POL_PlayerMoney(.@gp);
                    }
                    break;
                case 4:
                    .@gp=max(27000, POL_AdjustPrice(30000));
                    if (Zeny < .@gp) {
                        mesc l("You cannot pay."), 1;
                        next;
                    } else {
                        mercenary_create merc_randid(0, 1000, 0, 0, 0), 3600000;
                        POL_PlayerMoney(.@gp);
                    }
                    break;
                case 5:
                    .@gp=max(45000, POL_AdjustPrice(50000));
                    if (Zeny < .@gp) {
                        mesc l("You cannot pay."), 1;
                        next;
                    } else {
                        mercenary_create merc_randid(1000, 0, 0, 0, 0), 3600000;
                        POL_PlayerMoney(.@gp);
                    }
                    break;
                default:
                    break;
            }
            break;
        // Buy Card
        case 2:
            npcshopattach(.name$);
            openshop;
            closedialog;
            close;
            break;
        // Evolve Card
        case 3:
            mesc l("ERROR: Unimplemented Function"), 1;
            break;
        // Leave
        default:
            closeclientdialog;
            goodbye;
            close;
            break;
    }
    goto L_Main;

OnInit:
	tradertype(NST_MARKET);
    sellitem MercBoxEE, 25000, 1;
    sellitem MercBoxDD, 15000, 2;
    sellitem MercBoxCC, 7500, 3;
    sellitem MercBoxBB, 3750, 4;
    sellitem MercBoxAA, 1250, 5;

    .distance=5;
    .sex=G_MALE;
	end;

OnClock0001:
OnClock1201:
    restoreshopitem MercBoxEE, 25000, 1;
    restoreshopitem MercBoxDD, 15000, 2;
    restoreshopitem MercBoxCC, 7500, 3;
    restoreshopitem MercBoxBB, 3750, 4;
    restoreshopitem MercBoxAA, 1250, 5;
    end;

// Pay your taxes!
OnBuyItem:
    debugmes("Purchase confirmed");
    PurchaseTaxes("Nival");
    end;

OnSellItem:
    debugmes("Sale confirmed");
    PurchaseTaxes("Nival");
    end;

}