summaryrefslogtreecommitdiff
path: root/npc/001-1/ishi.txt
blob: 95d2a4ad1c16848c87d5045138992239fe00a79e (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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
// Author: 
// Crazyfefe
// Caution if you revove items from @Items$ that add void in the array, not sure how to fix that but i don't thing that matter.
// note : the rare item system suck. not sure how to fix it.

001-1,88,116,0	script	ishi	NPC_PLAYER,{

    if (getq(MPQUEST) == 0)
    {
        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
        l("[Ishi the Rewards Master]"),
        l("\"Hey, it seems like you didn't register as a quest participant yet! You can sign up with Aidan.\"");
        close;
    }


    if (Mobpt < BaseLevel ** 2)
    {
        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
        l("[Ishi the Rewards Master]"),
        l("\"Welcome! I see you have " + Mobpt + " Monster Points. But isn't enought for get items\"");
        close;
    }

    setarray @Items$, "Bread", "Croconut","Plushroom","RedApple","Beer","Candy","Orange","ChocolateBar","BugLeg","CoinBag","PinkieAntenna","Coal","SnakeSkin","CottonCloth","GrassSeeds","HardSpike","CobaltHerb","GambogeHerb","MauveHerb","IronOre","MaggotSlime","RawLog","ScorpionStinger","SilkCocoon","TreasureKey","FluffyFur","EmptyBottle","RustyKnife","TolchiArrow","Arrow","IronArrow","BlueCottonDye";
    .Item1$ = "BrimedHat";
    .Item2$ = "IronIngot";
    .Item3$ = "BronzeGift"; // should be a event.

    speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
        l("[Ishi the Rewards Master]"),
        l("\"Welcome! I see you have " + Mobpt + " Monster Points. Would you like to exchange some of those for items?\"");
    next;

    do
    {
        select
            rif(Mobpt >= BaseLevel ** 2,l("1")),
            rif(Mobpt >= (BaseLevel ** 2)*2,l("2")),
            rif(Mobpt >= (BaseLevel ** 2)*3,l("3")),
            rif(Mobpt >= (BaseLevel ** 2)*4,l("4")),
            rif(Mobpt >= (BaseLevel ** 2)*5,l("5")),
            rif(Mobpt >= (BaseLevel ** 2)*6,l("6")),
            rif(Mobpt >= (BaseLevel ** 2)*7,l("7")),
            rif(Mobpt >= (BaseLevel ** 2)*8,l("8")),
            rif(Mobpt >= (BaseLevel ** 2)*9,l("9")),
            rif(Mobpt >= (BaseLevel ** 2)*10,l("10")),
            rif(Mobpt >= (BaseLevel ** 2)*11,l("Gimme as many as I deserve!")),
            l("Sorry, I have to go now.");

        switch (@menu)
        {
            case 1 :
                @var = 1;
                goto L_Items;
                break;
            case 2 :
                @var = 2;
                goto L_Items;
                break;
            case 3 :
                @var = 3;
                goto L_Items;
                break;
            case 4 :
                @var = 4;
                goto L_Items;
                break;
            case 5 :
                @var = 5;
                goto L_Items;
                break;
            case 6 :
                @var = 6;
                goto L_Items;
                break;
            case 7 :
                @var = 7;
                goto L_Items;
                break;
            case 8 :
                @var = 8;
                goto L_Items;
                break;
            case 9 : 
                @var = 9;
                goto L_Items;
                break;
            case 10 :
                @var = 10;
                goto L_Items;
                break;
            case 11 :
                goto L_Give_all;
                break;
            default :
                goto L_Close;
                break;
        }
    } while (@menu != 12);

    closedialog;
    goodbye;
    close;

L_Close:
    @var =0;
    @reward ="";
    close;

L_LuckyReward1:
    mesq l("Wow !");
    next;
    mesq l("I don't believe.");
    next;
    mesq l("you get lucky and got a @@", getitemlink(.Item1$));
    next;
    mesq l("Come back later for more items i' m so suprised");

    set Mobpt, Mobpt - BaseLevel ** 2;
    getitem .Item1$,1;
    close;

L_LuckyReward2:
    mesq l("Wow !");
    next;
    mesq l("I don't believe.");
    next;
    mesq l("you get lucky and got a @@", getitemlink(.Item2$));
    next;
    mesq l("Come back later for more items i' m so suprised");
    set Mobpt, Mobpt - BaseLevel ** 2;
    getitem .Item2$,1;
    close;

L_LuckyReward3:
    mesq l("Wow !");
    next;
    mesq l("I don't believe.");
    next;
    mesq l("you get lucky and got a @@", getitemlink(.Item3$));
    next;
    mesq l("Come back later for more items i' m so suprised");
    set Mobpt, Mobpt - BaseLevel ** 2;
    getitem .Item3$,1;
    close;

L_Items:
    for (.@i = 0; .@i < @var; .@i ++)
    {
        getinventorylist;
        .@weight = checkweight(@Items$,1);
        if (.@weight == 0)
            goto L_NoPlaceWeight;
        if (@inventorylist_count == 100)
            goto L_NoPlace;
        .@lucky = rand(10000); // 0 - 99999
        if (.@lucky >= 0 && .@lucky <= 5000)
            goto L_LuckyReward1;
        if (.@lucky >= 1 && .@lucky <= 4)
            goto L_LuckyReward2;
        if (.@lucky >= 5 && .@lucky <= 10)
            goto L_LuckyReward3;
        set .@reward$, @Items$[rand(getarraysize(@Items$))];
        mesq l("You received one @@ !", getitemlink(.@reward$));
        set Mobpt, Mobpt - BaseLevel ** 2;
        getitem .@reward$,1;
    }
    close;

L_Continue:
    mesq l("You still have @@ Monster Points ! Do you want more items ?", Mobpt);
    do
        {
        select
            l("Yes"),
            l("No");

        switch (@menu)
        {
            case 1:
                goto L_Give_all;
                break;
            case 2:
                goto L_Close;
                break;
        }
        } while (@menu != 2);

L_NoPlace :
    mesq l("You seem to run out of place, you should go to the storage.");
    close;

L_NoPlaceWeight :
    mesq l("You can't carry more items, you should go to the storage.");
    close;

L_Give_all:
    @var = Mobpt / BaseLevel ** 2;
    if (@var > 50) // limite for avoid lag server
        @var = 50;
    for (.@i = 0; .@i < @var; .@i ++)
    {
        getinventorylist;
        .@weight = checkweight(@Items$,1);
        if (.@weight == 0)
            goto L_NoPlaceWeight;
        if (@inventorylist_count == 100)
            goto L_NoPlace;
        .@lucky = rand(10000); // 0 - 99999
        if (.@lucky == 0)
            goto L_LuckyReward1;
        if (.@lucky >= 1 && .@lucky <= 4)
            goto L_LuckyReward2;
        if (.@lucky >= 5 && .@lucky <= 10)
            goto L_LuckyReward3;
        set .@reward$, @Items$[rand(getarraysize(@Items$))];
        mesq l("You received one @@ !", getitemlink(.@reward$));
        set Mobpt, Mobpt - BaseLevel ** 2;
        getitem .@reward$,1;
    }
    if (Mobpt / BaseLevel ** 2 > 0)
        goto L_Continue;
    close;

OnInit:
    .sex = G_MALE;
    .distance = 3;
    end;
}