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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
|
// TMW2 scripts.
// Author:
// Jesusalva
// Description:
// Lilica is TMW-BR Scary Scary Easter Bunny and will help your trading stuff.
// Data layout:
// SQuest_Easter
// (year of eggshell hat, strange coin limit, limited shop purchases)
// Strage Coin Limit: 500, or last year + 100, the smaller of both
001-4,139,151,0 script Lilica#easter NPC_EASTER,{
mesn;
mesq lg("Ah, traveller! I am Lilica the Scary Bunny! I exchange many @@ and @@ for neat rewards!","Ah, traveller! I am Lilica the Scary Bunny! I exchange many @@ and @@ for neat rewards!", getitemlink(SilverEasteregg), getitemlink(GoldenEasteregg));
next;
mesn;
mesq l("Golden Eggs are used for the grand collector prize. Ah, I love Easter! I loooooooove it!");
mesc l("Note: Golden and Silver Eggs are deleted after the next event end.");
menu
l("Scary..........."), -,
l("Trade Silver Eggs"), L_Silver,
l("Trade Golden Eggs"), L_Golden,
rif(getq(SQuest_Easter) == gettime(7), l("Limited Shop")), L_Limited,
rif(getq(SQuest_Easter) != gettime(7), l("I want an Eggshell Hat!")), L_Quest,
l("View LeaderBoard"), L_Leader;
close;
L_Silver:
openshop "#eastershop1";
closedialog;
close;
L_Golden:
mes l("You can still purchase %d %s.", getq2(SQuest_Easter),
getitemlink(StrangeCoin));
next;
openshop "#eastershop2";
closedialog;
close;
L_Leader:
mesc l("Leaderboard is refresh daily at 1 AM!");
mes("1."+$@easter_name$[0]+" ("+$@easter_value[0]+")");
mes("2."+$@easter_name$[1]+" ("+$@easter_value[1]+")");
mes("3."+$@easter_name$[2]+" ("+$@easter_value[2]+")");
mes("4."+$@easter_name$[3]+" ("+$@easter_value[3]+")");
mes("5."+$@easter_name$[4]+" ("+$@easter_value[4]+")");
mes("6."+$@easter_name$[5]+" ("+$@easter_value[5]+")");
mes("7."+$@easter_name$[6]+" ("+$@easter_value[6]+")");
mes("8."+$@easter_name$[7]+" ("+$@easter_value[7]+")");
mes("9."+$@easter_name$[8]+" ("+$@easter_value[8]+")");
mes("10."+$@easter_name$[9]+" ("+$@easter_value[9]+")");
close;
L_Quest:
setarray .@Seasonal, EggshellHat, VioletEggshellHat, YellowEggshellHat, RedEggshellHat, GreenEggshellHat, CyanEggshellHat, OrangeEggshellHat, BlueEggshellHat;
.@Hat=.@Seasonal[gettime(7)%8]; // Magically choose the hat from the array
mesn;
mesq l("Good choice! This year we're having a @@!", getitemlink(.@Hat));
next;
mesn;
mesq l("As usual, you can get only one hat yearly, for the symbolic amount of 40 @@ and 10 @@!", getitemlink(GoldenEasteregg), getitemlink(SilverEasteregg));
next;
menu
l("Maybe later."), -,
rif(countitem(GoldenEasteregg) >= 40 && countitem(SilverEasteregg) >= 10, l("Deal.")), L_QuestDone;
close;
L_QuestDone:
inventoryplace .@Hat, 1;
delitem GoldenEasteregg, 40;
delitem SilverEasteregg, 10;
if (rand2(10000) < 100) goto L_Unlucky;
setq SQuest_Easter, gettime(7), min(500, getq2(SQuest_Easter)+100), 0;
npctalk3 l("Strange Coins stock on shops was restored!");
getnameditem(.@Hat, strcharinfo(0));
mesn;
mesq l("Here you go! Happy easter! Bhop bhop!");
close;
L_Unlucky:
getitem GoldenGift, 1;
mesn;
mes l("\"Oh... Sorry, @@.", strcharinfo(0));
mes l("But in accordance to an old %s, you were unlucky.", b(l("Community Decision")));
mes l("This means ##BAll items were lost##b, and you need to collect EVERYTHING, again, to get the hat.");
mes l("But, hm hm hm! I have a %s for you! It won't have what you wanted, but maybe you're lucky, after all?", getitemlink(GoldenGift));
mes l("Better luck next time!\"");
close;
// Leaderboard functions, and initialization
OnClock0100:
OnClock1300:
if ($EVENT$ == "Easter")
.@nb = query_sql("SELECT c.name, i.amount FROM `inventory` AS i, `char` AS c WHERE i.nameid=834 AND i.char_id=c.char_id ORDER BY i.amount DESC LIMIT 10", $@easter_name$, $@easter_value);
end;
OnInit:
.sex = G_OTHER;
.distance = 5;
if ($EVENT$ == "Easter")
sEaster();
end;
// Special shop functions
function EEX_check {
.@tier = getarg(0); // Minimum reward level
.@clas = getarg(1); // EEX code
.@preq = getarg(2, 0); // Pre-requisite purchase
if (!.@clas || .@clas == .@preq) return false; // Fail-safe
.@s = getq3(SQuest_Easter);
.@lv = (TOP3AVERAGELVL() / 25) + $GAME_STORYLINE;
if (.@preq)
return (!(.@s & .@clas) && .@lv >= .@tier && (.@s & .@preq));
else
return (!(.@s & .@clas) && .@lv >= .@tier);
}
function EEX_trade {
.@clas = getarg(2); // Easter EXchange code (EEX)
.@item = getarg(1); // Item ID
.@pric = getarg(0); // Price in Golden Eggs
if (!.@item || !.@clas) return; // Fail-safe
if (countitem(GoldenEasteregg) < .@pric) {
mesc l("You only have %d/%d %s, so the transaction was cancelled.", countitem(GoldenEasteregg), .@pric, getitemlink(GoldenEasteregg)), 1;
close; // TERMINATE the script
}
inventoryplace .@item, 1; // may TERMINATE the script
delitem GoldenEasteregg, .@pric;
setq3 SQuest_Easter, getq3(SQuest_Easter) | .@clas;
getitem .@item, 1;
return;
}
L_Limited:
mes l("You can only make each purchase only. Some purchases unlock other purchases.");
mesc l("The limited shop will not be available once event ends."), 1;
mesc l("Trade here will lower your ranking on Easter event. Be careful."), 1;
mes l("Current golden eggs: %s", fnum(countitem(GoldenEasteregg)));
menuint
l("Nothing, thanks."), -1,
rif(EEX_check(1, EEX_bronze),
l("Bronze Gift (%d eggs)", 50)), EEX_bronze,
rif(EEX_check(3, EEX_silver, EEX_bronze),
l("Silver Gift (%d eggs)", 100)), EEX_silver,
rif(EEX_check(5, EEX_golden, EEX_silver),
l("Golden Gift (%d eggs)", 150)), EEX_golden,
rif(EEX_check(7, EEX_prism, EEX_golden),
l("Prism Gift (%d eggs)", 250)), EEX_prism,
rif(EEX_check(9, EEX_supreme, EEX_prism),
l("Supreme Gift (%d eggs)", 500)), EEX_supreme,
rif(EEX_check(2, EEX_gapple),
l("Golden Apple (%d eggs)", 35)), EEX_gapple,
rif(EEX_check(4, EEX_napple, EEX_gapple),
l("Manapple (%d eggs)", 75)), EEX_napple,
rif(EEX_check(6, EEX_elixir, EEX_napple),
l("Elixir of Life (%d eggs)", 150)), EEX_elixir,
rif(EEX_check(8, EEX_dapple, EEX_elixir),
l("Divine Apple (%d eggs)", 300)), EEX_dapple,
rif(EEX_check(10, EEX_mapple, EEX_dapple),
l("Magic Apple (%d eggs)", 300)), EEX_mapple,
rif(EEX_check(0, EEX_merc1),
l("★ Mercenary (%d eggs)", 20)), EEX_merc1,
rif(EEX_check(3, EEX_merc2, EEX_merc1),
l("★★ Mercenary (%d eggs)", 40)), EEX_merc2,
rif(EEX_check(6, EEX_merc3, EEX_merc2),
l("★★★ Mercenary (%d eggs)", 60)), EEX_merc3,
rif(EEX_check(9, EEX_merc4, EEX_merc3),
l("★★★★ Mercenary (%d eggs)", 80)), EEX_merc4,
rif(EEX_check(11, EEX_merc5, EEX_merc4),
l("★★★★★ Mercenary (%d eggs)", 100)), EEX_merc5,
l("I have to go."), -1;
mes "";
switch (@menuret) {
case EEX_bronze: EEX_trade( 50, BronzeGift, EEX_bronze); break;
case EEX_silver: EEX_trade( 100, SilverGift, EEX_silver); break;
case EEX_golden: EEX_trade( 150, GoldenGift, EEX_golden); break;
case EEX_prism: EEX_trade( 250, PrismGift, EEX_prism); break;
case EEX_supreme: EEX_trade( 500, SupremeGift, EEX_supreme); break;
case EEX_gapple: EEX_trade( 35, GoldenApple, EEX_gapple); break;
case EEX_napple: EEX_trade( 75, Manapple, EEX_napple); break;
case EEX_elixir: EEX_trade( 150, ElixirOfLife, EEX_elixir); break;
case EEX_dapple: EEX_trade( 300, DivineApple, EEX_dapple); break;
case EEX_mapple: EEX_trade( 300, MagicApple, EEX_mapple); break;
case EEX_merc1: EEX_trade( 20, MercBoxAA, EEX_merc1); break;
case EEX_merc2: EEX_trade( 40, MercBoxBB, EEX_merc2); break;
case EEX_merc3: EEX_trade( 60, MercBoxCC, EEX_merc3); break;
case EEX_merc4: EEX_trade( 80, MercBoxDD, EEX_merc4); break;
case EEX_merc5: EEX_trade( 100, MercBoxEE, EEX_merc5); break;
default: closeclientdialog; close;
}
mesc l("Enjoy your purchase!"), 3;
next;
goto L_Limited;
}
function script EasterCoinCheck {
for (.@i=0;.@i < getarraysize(@bought_nameid); .@i++) {
if (debug || $@GM_OVERRIDE)
debugmes("%dx %s", @bought_quantity[.@i], getitemname(@bought_nameid[.@i]));
if (@bought_nameid[.@i] == StrangeCoin) {
.@q2=getq2(SQuest_Easter)-@bought_quantity[.@i];
if (.@q2 < 0) {
dispbottom l("Attempted to buy %d/%d %s, operation cancelled.",
@bought_quantity[.@i], getq2(SQuest_Easter),
getitemlink(StrangeCoin));
if (TUTORIAL)
dispbottom l("This quota is reset yearly, by completing %s's quest.", b("Lilica"));
end;
}
setq2 SQuest_Easter, .@q2;
}
}
return;
}
// Silver Easter Egg exchange.
001-4,139,151,0 trader #eastershop1 NPC_HIDDEN,{
end;
OnInit:
tradertype(NST_CUSTOM);
sellitem ChocolateMouboo,100;
sellitem StrangeCoin,50;
sellitem GoldenEasteregg,25;
sellitem EasterEgg,5;
end;
OnCountFunds:
setcurrency(countitem(SilverEasteregg));
end;
OnPayFunds:
if( countitem(SilverEasteregg) < @price )
end;
// Strange Coins are different
EasterCoinCheck();
// Complete purchase
delitem SilverEasteregg, @price;
purchaseok();
end;
}
// Golden Easter Egg exchange.
001-4,139,151,0 trader #eastershop2 NPC_HIDDEN,{
end;
OnInit:
tradertype(NST_CUSTOM);
setarray .@Seasonal, EggshellHat, VioletEggshellHat, YellowEggshellHat, RedEggshellHat, GreenEggshellHat, CyanEggshellHat, OrangeEggshellHat, BlueEggshellHat;
.Hat=.@Seasonal[(gettime(7)+1)%8]; // Magically choose the hat from the array
.PrevHat=.@Seasonal[(gettime(7)-1)%8]; // Magically choose the hat from the array
// Seasonal item
sellitem .Hat,200;
sellitem .PrevHat,500;
// Determine the current game shift
// Range: 0 ~ 12 (Roughly)
.@lv = (TOP3AVERAGELVL() / 25) + $GAME_STORYLINE;
.@ol = max(1, 12-.@lv); // The opposite from the above function
// Rare and not-so-rare Items
if (.@lv >= 4)
sellitem MercBoxE,125*.@ol;
if (.@lv >= 3)
sellitem MercBoxD,80*.@ol;
if (.@lv >= 2)
sellitem MercBoxC,40*.@ol;
if (.@lv >= 1)
sellitem Boots,37*.@ol;
// These are better limited to a max amount of purchases
sellitem BronzeGift,100;
sellitem BunnyEars,50;
sellitem StrangeCoin,10;
sellitem SilverEasteregg,1;
end;
OnCountFunds:
setcurrency(countitem(GoldenEasteregg));
end;
OnPayFunds:
if( countitem(GoldenEasteregg) < @price )
end;
// Strange Coins are different
EasterCoinCheck();
// Complete purchase
delitem GoldenEasteregg, @price;
purchaseok();
end;
}
|