· 6 years ago · Jul 25, 2019, 12:30 AM
1/*
2 --------------------
3 db/import/mob_db.txt
4 --------------------
5 3001,ROBR_Supply_box,Supply box,Supply box,1,1,1,0,0,0,0,0,120,120,0,0,0,0,0,0,0,0,1,0,20,0x4680020,200,0,0,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
6 --------------------
7 db/import/mob_avail.txt
8 --------------------
9 3001,1845
10*/
11
12
13
14
15function script robrrank_getstat {
16 .@type$ = getarg(0);
17
18 .@manager$ = "ROBR#ROBRManager";
19
20 .@rating = ROBR_RATING;
21
22 for(.@i=0;.@i<getarraysize(getVariable(".rp_next",.@manager$));++.@i){
23 if( .@rating >= getVariable(".rp_next["+.@i+"]",.@manager$) ){
24 .@title$ = getVariable(".title$["+.@i+"]",.@manager$);
25 .@rank_id = getVariable(".rank_id["+.@i+"]",.@manager$);
26 .@rp_next = getVariable(".rp_next["+(.@i+1)+"]",.@manager$);
27 .@index = .@i;
28 if(.@i<getarraysize(getVariable(".rp_next",.@manager$))-1) .@rp_next = getVariable(".rp_next["+(.@i+1)+"]",.@manager$);
29 }
30 }
31
32 if(.@type$=="nextexp"){
33 if(.@rating < .@rp_next){
34 .@nextexp = .@rp_next - .@rating;
35 }else{
36 .@nextexp = 0;
37 }
38 return .@nextexp;
39 }else if(.@type$=="title"){
40 return .@title$;
41 }else if(.@type$=="rank_id"){
42 return .@rank_id;
43 }else if(.@type$=="rp_next"){
44 return .@rp_next;
45 }else if(.@type$=="titleindex"){
46 return .@index;
47 }
48 debugmes "robrrank_getstat: none valid parameter requested!";
49 return;
50}
51
52function script robrrank_getexp {
53
54 ROBR_RATING = rating_get(0);
55
56 rating_adjust( getarg(0), getarg(1), getarg(2));
57
58 .@level_old = robrrank_getstat("titleindex");
59
60 query_sql( "SELECT `rating` FROM `robr_rating` WHERE `account_id` = "+ getcharid(3), .@rank_rating );
61
62 query_sql( "INSERT INTO `robr_rating` SET `account_id`='"+ getcharid(3) +"', `char_id`='"+ getcharid(0) +"',`char_name`='"+ escape_sql( strcharinfo(0) ) +"', `rating` = '"+ rating_get(0) +"' ON DUPLICATE KEY UPDATE `char_id`='"+ getcharid(0) +"',`char_name`='"+ escape_sql( strcharinfo(0) ) +"', `rating` = '"+ rating_get(0) +"' " );
63
64 ROBR_RATING = rating_get(0);
65
66 message strcharinfo(0), "Your current rating :"+ rating_get(0);
67
68 .@level_new = robrrank_getstat("titleindex");
69
70 if(.@level_old != .@level_new)
71 {
72 showscript "PVP Rank changed to "+robrrank_getstat("title")+"!";
73 dispbottom "PVP Rank changed to "+robrrank_getstat("title")+"!";
74 specialeffect2 158;
75 }
76 return;
77}
78
79function script hg_rank_change_br {
80 .@rating = getarg(0);
81 // Please manually set the view IDs
82 /*---- set .@r, <view id>; ----*/
83 if ( .@rating < 1600 ) set .@r, 319; // Rookie
84 else if ( .@rating >= 1600 && .@rating < 1800 ) set .@r, 457; // Regular
85 else if ( .@rating >= 1800 && .@rating < 2000 ) set .@r, 454; // Pro
86 else if ( .@rating >= 2000 && .@rating < 2200 ) set .@r, 453; // Veteran
87 else if ( .@rating >= 2200 ) set .@r, 452; // Elite
88 return .@r;
89}
90
91prontera,150,168,1 script ROBR Ladder Board 837,{
92 mes "Hi!";
93 mes "How may I help you?";
94 mes "--------------------------";
95 mes "^ff0000Information^000000:";
96 mes "Only ROBR Character (Gunslinger) can see the current status";
97 mes "--------------------------";
98 next;
99 switch(select(
100 "~ ROBR Ladder - Top 10",
101 (Class==24)?"~ My Status":"",
102 "~ Nevermind")) {
103 case 1:
104 mes .n$;
105 mes "Top 10 Ladder Players :";
106
107 if ( ! ( .@nb = query_sql("SELECT `char_name`, `rating`, FIND_IN_SET(`rating`, (SELECT GROUP_CONCAT(`rating` ORDER BY `rating` DESC) FROM `robr_rating`)) FROM `robr_rating` ORDER BY `rating` DESC LIMIT 10", .@char_name$, .@rating, .@rank) ) ) {
108 mes "There is currently no player ranked.";
109 mes "Come back later.";
110 close;
111 }
112
113 for ( .@i = 0; .@i < .@nb; ++.@i )
114 mes "["+ .@rank[.@i] +"] "+ .@char_name$[.@i] +" ~ "+ .@rating[.@i] +" ROBR Points";
115 close;
116
117 case 2:
118 mes .n$;
119 mes "^c4c4c4Title:^000000 " + StrColor( robrrank_getstat("title") ,"BLACK");
120 mes "^c4c4c4ROBR Points:^000000 "+ StrColor( ROBR_RATING ,"BLACK");
121 close;
122
123 default:
124 close;
125 }
126 end;
127
128OnInit:
129 // NPC Name
130 .n$ = "[ "+ StrColor(strnpcinfo(1) ,"RED") +" ]";
131 waitingroom "ROBR LADDER BOARD",0;
132 end;
133}
134
135
136prontera,163,110,0 script ROBR#ROBRManager 100,{
137 function F_Checkplayers;
138 callsub OnTalk;
139 end;
140
141OnInit:
142 // Server name
143 .servername$ = "HonorRO";
144
145 // Cutin Image
146 .cutin_img$ = "kafra_07";
147
148 // min level to join
149 .min_level = 99;
150
151 // Supply Box drop count
152 .supply_box = 150;
153
154 // Winner reward.
155 .item_id = 42088; // ID
156 .item_amt = 10; // Amt
157
158 // Winner points
159 .win_points = 1;
160
161 // Loser points
162 .lose_points = 3;
163
164 // Registration time (in mins)
165 .regtime = 5;
166
167 // Min players to start
168 .min2start = 2;
169
170 // Max players can join
171 .maxcapacity = 50;
172
173 // RoBR map
174 .map$ = "league";
175
176 // Rank Exp Points
177 // Points needed to change rank..
178 setarray .rp_next,
179 -1, // always set to -1 (Rookie)
180 1600, // Regular
181 1800, // Pro
182 2000, // Veteran
183 2200; // Elite
184
185 // Rank id from lowest to highest
186 setarray .rank_id,
187 1,
188 2,
189 3,
190 4,
191 5;
192 // Rank Titles
193 setarray .title$,
194 "Rookie",
195 "Regular",
196 "Pro",
197 "Veteran",
198 "Elite";
199
200 // use "@robrstart" to initiate the event using a GM account.
201 bindatcmd "robrstart", strnpcinfo(0)+"::OnAtCmd", 0, 60;
202
203 setarray .@mapflag,
204 mf_nosave,
205 mf_nogo,
206 mf_nomemo,
207 mf_nowarp,
208 mf_nowarpto,
209 mf_pvp_noparty,
210 mf_pvp_noguild,
211 mf_nocommand,
212 mf_notrade;
213
214 for(.@i = 0; .@i < getarraysize(.@mapflag); .@i++ )
215 setmapflag "league", .@mapflag[.@i];
216
217 hideonnpc strnpcinfo(0);
218 query_sql ("CREATE TABLE IF NOT EXISTS `robr_rating` ( `account_id` int(11) unsigned NOT NULL, `char_id` int(11) unsigned NOT NULL, `char_name` varchar(30) NOT NULL default 'Unknown', `rating` int(11) default '0', PRIMARY KEY ( `account_id` ),KEY (`rating`)) ENGINE=InnoDB;");
219 end;
220
221// Set a time when will event starts.
222OnMinute00: // Triggers every hour
223OnAtCmd:
224 .@start_ = getvariableofnpc(.start ,"robr#main");
225 if (.@start_ == true ) end;
226 hideoffnpc strnpcinfo(0);
227 .size = 0;
228 deletearray .aid;
229 while ( .@r < .regtime ) {
230 announce .servername$ +" Battle Royale is now open for registration!", bc_all | bc_blue;
231 sleep 1250;
232 announce "Go to "+ strnpcinfo(1) +" NPC now to register!", bc_all | bc_blue;
233 sleep 1250;
234 announce "Registration will open for "+ (.regtime-.@r) +" min(s)!", bc_all | bc_blue;
235 sleep 60000;
236 .@r++;
237 }
238 announce .servername$ +" Battle Royale registration is now closed!", bc_all | bc_blue;
239 F_Checkplayers;
240 if ( .size < .min2start ) {
241 announce .servername$ +" Battle Royale has stopped!", bc_all | bc_blue;
242 sleep 2250;
243 announce "-- Not enough participants.", bc_all | bc_blue;
244 } else {
245 announce .servername$ +" Battle Royale has started!", bc_all | bc_blue;
246 enablenpc "robr#main";
247 copyarray getvariableofnpc( .aid_, "robr#main" ), .aid, .size;
248 donpcevent "robr#main::OnStart";
249 enablenpc "#zone_1";
250 donpcevent "#zone_1::OnStart";
251 enablenpc "robr#hg_change";
252 donpcevent "robr#hg_change::OnStart";
253 }
254 hideonnpc strnpcinfo(0);
255 end;
256
257
258OnTalk:
259 disable_items;
260 disable_command;
261 getinventorylist;
262 if ( Class != 24 || BaseLevel != .min_level ) {
263 mes "[Manager]";
264 mes "Only Level "+ .min_level +" Gunslinger class can join this event!";
265 close;
266 }
267 if ( .size == .maxcapacity ) {
268 mes "[Manager]";
269 mes "The map is currently full. Please wait for the next game to start.";
270 close;
271 }
272 if ( getpetinfo(PETINFO_ID) ) {
273 mes "[Manager]";
274 mes "Pets are not allowed.";
275 close;
276 }
277 if ( @inventorylist_count ) {
278 mes "[Manager]";
279 mes "Make sure your inventory is empty.";
280 close;
281 }
282 mes "[Manager]";
283 mes "Hello, "+ strcharinfo(0) +"!";
284 mes "How may I help you?";
285 next;
286 switch(select("Join","Nothing")) {
287 case 1:
288 while ( .aid[.@i] != getcharid(3) && .@i < .size ) ++.@i;
289 if ( .@i < .size ) {
290 mes "You already joined the queue.";
291 mes " ";
292 mes "Automatically removing from previous queue.";
293 mes " ";
294 mes "Please try joining again";
295 close2;
296 deletearray .aid[.@i], 1;
297 --.@i;
298 --.size;
299 end;
300 }
301 mes "[Manager]";
302 mes "Joining..";
303 mes "stand by on the lobby map..";
304 mes "warping";
305 close2;
306 .aid[ .size++ ] = getcharid(3);
307 percentheal 100, 100;
308 ROBRPLAY = true;
309 sc_end SC_ALL;
310 warp .map$,0,0;
311 sleep2 2500;
312 announce strcharinfo(0) + " has joined the "+.servername$+" Battle Royale! --- "+ .size +"/"+ .maxcapacity, bc_all | bc_blue;
313 F_Checkplayers;
314 end;
315
316 case 2:
317 break;
318 }
319 end;
320
321 function F_Checkplayers {
322 for ( .@i = 0; .@i < .size; ++.@i ) {
323 if ( !isloggedin( .aid[.@i] ) ) {
324 deletearray .aid[.@i], 1;
325 --.@i;
326 --.size;
327 }
328 else {
329 attachrid .aid[.@i];
330 if ( strcharinfo(3) != .map$ ) {
331 deletearray .aid[.@i], 1;
332 --.@i;
333 --.size;
334 }
335 }
336 }
337 detachrid;
338 return;
339 }
340}
341
342league,0,0,0 script robr#hg_change -1,{
343OnStart:
344 addrid(1);
345 .@r = hg_rank_change_br(rating_get(0));
346 setlook LOOK_HEAD_TOP, .@r;
347 end;
348
349OnEnd:
350 disablenpc strnpcinfo(0);
351 end;
352
353}
354league,0,0,0 script robr#main -1,{
355OnInit:
356 disablenpc strnpcinfo(0);
357 end;
358
359OnStart:
360 .start = true;
361 .size = getarraysize(.aid_);
362 initnpctimer;
363 end;
364
365OnTimer61000:
366 mapannounce strnpcinfo(4), "Players Left -- "+ .size, bc_area|bc_blue;
367 setnpctimer 0;
368 end;
369
370OnPCLoginEvent:
371 if ( ROBRPLAY ) {
372 ROBRPLAY = false;
373 getinventorylist;
374 for ( .@i = 0; .@i < @inventorylist_count; .@i++) {
375 .@itemid[.@i] = @inventorylist_id[.@i];
376 .@itemamt[.@i] = @inventorylist_amount[.@i];
377 delitem .@itemid[.@i], .@itemamt[.@i];
378 }
379 }
380 end;
381
382OnPCDieEvent:
383OnPCLogoutEvent:
384 if ( strcharinfo(3) == strnpcinfo(4) ) {
385 for ( .@j = 0; .@j < .size; .@j++ ) {
386 if ( getcharid(3) == .aid_[.@j] ) {
387 ROBRPLAY = false;
388 setlook LOOK_HEAD_TOP, 0;
389 robrrank_getexp ( rating_get(0), 50, 2 ); // 1 = win ; 2 = lost
390 mapannounce strnpcinfo(4), strcharinfo(0) +" has died on Battle Royale!", bc_area|bc_blue;
391 getinventorylist;
392 getmapxy .@map$, .@x, .@y, BL_PC;
393 deletearray .aid_[.@j], 1;
394 --.@j;
395 --.size;
396 for ( .@i = 0; .@i < @inventorylist_count; .@i++) {
397 .@itemid[.@i] = @inventorylist_id[.@i];
398 .@itemamt[.@i] = @inventorylist_amount[.@i];
399 makeitem .@itemid[.@i], .@itemamt[.@i], .@map$, .@x, .@y;
400 delitem .@itemid[.@i], .@itemamt[.@i];
401 }
402 warp "SavePoint", 0, 0;
403 if ( .size == 1 )
404 callsub OnReward;
405 sleep2 1250;
406 }
407 }
408 }
409 end;
410
411OnReward:
412 .@id = getvariableofnpc(.item_id ,"ROBR#ROBRManager");
413 .@am = getvariableofnpc(.item_amt ,"ROBR#ROBRManager");
414 .@cutin$ = getvariableofnpc(.cutin_img$ ,"ROBR#ROBRManager");
415 donpcevent "#zone_1::OnEnd";
416 donpcevent "#zone_2::OnEnd";
417 donpcevent "#zone_3::OnEnd";
418 donpcevent "#zone_4::OnEnd";
419 donpcevent "#zone_5::OnEnd";
420 donpcevent "robr#hg_change::OnEnd";
421 stopnpctimer;
422 .start = false;
423 pvpoff "league";
424
425 killmonsterall strnpcinfo(4);
426 attachrid .aid_;
427 cutin .@cutin$ , 4;
428 announce strcharinfo(0) + " is our Battle Royale Champion!", bc_all | bc_blue;
429 getinventorylist;
430 for ( .@i = 0; .@i < @inventorylist_count; .@i++) {
431 .@itemid[.@i] = @inventorylist_id[.@i];
432 .@itemamt[.@i] = @inventorylist_amount[.@i];
433 delitem .@itemid[.@i], .@itemamt[.@i];
434 }
435 getitem .@id, .@am;
436 ROBRPLAY = false;
437 setlook LOOK_HEAD_TOP, 0;
438 robrrank_getexp ( rating_get(0), 50, 1 ); // 1 = win ; 2 = lost
439 dispbottom "[System] You will be warped out in a few seconds.", 0xFF0000;
440 sleep 15000;
441 mapwarp strnpcinfo(4), "prontera", 156, 191;
442 disablenpc strnpcinfo(0);
443 end;
444}
445
446league,0,0,0 script ROBR#Mobspawn -1,{
447OnInit:
448 disablenpc strnpcinfo(0);
449 end;
450
451OnStart:
452 .@amt = getvariableofnpc(.supply_box ,"ROBR#ROBRManager");
453 monster strnpcinfo(4), 0, 0, "Supply Box", 3001, .@amt, strnpcinfo(0)+"::OnOpenSupply";
454 end;
455
456OnOpenSupply:
457 setarray .@weapon_id,
458 13112, // P_Revolver1
459 13113, // P_Revolver2
460 13163, // Long_Barrel
461 13165, // Jungle_Carbine
462 13158, // Butcher
463 13156, // Gate_Keeper
464 13167, // Gate_KeeperDD
465 13160, // Destroyer
466 13160, // Destroyer
467 13160; // Destroyer
468 setarray .@armor_id,
469 5829, // Ordinary_Armor
470 2303, // Leather_Jacket
471 2339, // G_Strings
472 2370; // Used_Mage_Coat
473 setarray .@garm_id,
474 2501, // Hood
475 2507, // Cape_Of_Ancient_Lord
476 2526, // Dragon_Scale_Coat
477 2547; // Cheap_Running_Shirts
478 setarray .@boots_id,
479 2401, // Sandals
480 2405, // Boots
481 2430, // Iron_Boots02
482 2439; // Refresh_Shoes
483 setarray .@helm_id,
484 5410, // Bread_Bag2
485 5400, // Fox_Hat
486 5461, // Adv_Whisper_Mask
487 2264, // Munak_Turban
488 5428, // Bread_Bag1
489 5485; // Tiger_Face
490 setarray .@ammo_id,
491 13202, // Shell_Of_Blood
492 13202, // Shell_Of_Blood
493 13200, // Bullet
494 13200, // Bullet
495 13200, // Bullet
496 13201, //Silver_Bullet
497 13201, //Silver_Bullet
498 13206, // Blind_Sphere
499 13203, // Flare_Sphere
500 13207, // Freezing_Sphere
501 13204, // Lighting_Sphere
502 13205; // Poison_Sphere
503 setarray .@pots_id,
504 662, // Inspector_Certificate
505 12029, // Gloomy_Box
506 12236, // Choco_Tart
507 11705, // Special_White_Potion
508 11705, // Special_White_Potion
509 11705, // Special_White_Potion
510 11705, // Special_White_Potion
511 11705; // Special_White_Potion
512 setarray .@acce_id,
513 2605, // (Brooch)
514 2693, // (Brooch_C)
515 2616, // (Critical_Ring)
516 2737, // (Foot_Ring)
517 2604, // (Glove)
518 2692, // (Glove_C)
519 2675; // (Lord_Ring)
520 .@s = rand(1,6);
521 switch(.@s) {
522 case 1:
523 .@r = rand(getarraysize(.@weapon_id)-1);
524 if ( !countitem(.@weapon_id[.@r]) ) getitem .@weapon_id[.@r], 1;
525 break;
526 case 2:
527 .@r = rand(getarraysize(.@armor_id)-1);
528 if ( !countitem(.@armor_id[.@r]) ) getitem .@armor_id[.@r], 1;
529 .@r = rand(getarraysize(.@weapon_id)-1);
530 if ( !countitem(.@weapon_id[.@r]) && rand(100) > 30 ) getitem .@weapon_id[.@r], 1;
531 break;
532 case 3:
533 .@r = rand(getarraysize(.@garm_id)-1);
534 if ( !countitem(.@garm_id[.@r]) ) getitem .@garm_id[.@r], 1;
535 .@r = rand(getarraysize(.@weapon_id)-1);
536 if ( !countitem(.@weapon_id[.@r]) && rand(100) > 30 ) getitem .@weapon_id[.@r], 1;
537 break;
538 case 4:
539 .@r = rand(getarraysize(.@boots_id)-1);
540 if ( !countitem(.@boots_id[.@r]) ) getitem .@boots_id[.@r], 1;
541 .@r = rand(getarraysize(.@weapon_id)-1);
542 if ( !countitem(.@weapon_id[.@r]) && rand(100) > 30 ) getitem .@weapon_id[.@r], 1;
543 break;
544 case 5:
545 .@r = rand(getarraysize(.@helm_id)-1);
546 if ( !countitem(.@helm_id[.@r]) ) getitem .@helm_id[.@r], 1;
547 .@r = rand(getarraysize(.@weapon_id)-1);
548 if ( !countitem(.@weapon_id[.@r]) && rand(100) > 30 ) getitem .@weapon_id[.@r], 1;
549 break;
550 case 6:
551 .@r = rand(getarraysize(.@acce_id)-1);
552 if ( !countitem(.@acce_id[.@r]) ) getitem .@acce_id[.@r], 1;
553 .@r = rand(getarraysize(.@weapon_id)-1);
554 if ( !countitem(.@weapon_id[.@r]) && rand(100) > 30 ) getitem .@weapon_id[.@r], 1;
555 break;
556 }
557 if ( rand(100) > 20 ) {
558 .@r = rand(getarraysize(.@ammo_id)-1);
559 if ( .@ammo_id[.@r] == 13200 ) .@amt = rand(5,10); else .@amt = rand(3,5);
560 getitem .@ammo_id[.@r], .@amt;
561 }
562 if ( rand(100) > 50 ) {
563 .@r = rand(getarraysize(.@pots_id)-1);
564 if ( .@pots_id[.@r] == 11705 ) .@amt = rand(2,5); else .@amt = 1;
565 getitem .@pots_id[.@r], .@amt;
566 }
567 end;
568
569}
570
571league,0,0,0 script #zone_1 111,100,100,{
572end;
573
574OnInit:
575 disablenpc strnpcinfo(0);
576 end;
577
578OnEnd:
579 stopnpctimer;
580 disablenpc strnpcinfo(0);
581 end;
582
583OnStart:
584 .restricted = false;
585 mapannounce strnpcinfo(4), "Rule is simple!", bc_area|bc_blue;
586 sleep 5000;
587 mapannounce strnpcinfo(4), "Last man remaining on this battlefield wins!", bc_area|bc_blue;
588 sleep 5000;
589 mapannounce strnpcinfo(4), "Warning! There are landmines on the area, please be careful", bc_area|bc_blue;
590 sleep 5000;
591 mapwarp strnpcinfo(4), strnpcinfo(4), 0, 0;
592 pvpon "league";
593 .location = rand(5);
594 switch(.location) {
595 case 0: .@x = 145; .@y = 145; break;
596 case 1: .@x = 172; .@y = 165; break;
597 case 2: .@x = 118; .@y = 168; break;
598 case 3: .@x = 145; .@y = 190; break;
599 case 4: .@x = 123; .@y = 134; break;
600 case 5: .@x = 173; .@y = 137; break;
601 }
602 movenpc strnpcinfo(0), .@x, .@y;
603 getmapxy .@nmap$, .npcx, .npcy, BL_NPC, strnpcinfo(3);
604 donpcevent strnpcinfo(0)+"::OnViewPoint";
605 enablenpc "ROBR#Mobspawn";
606 donpcevent "ROBR#Mobspawn::OnStart";
607 .timer = 0;
608 initnpctimer;
609 end;
610
611OnTouch:
612 if ( .restricted )
613 {
614 specialeffect2 EF_HEAL;
615 dispbottom "You are in the safe zone", 0xb1e188;
616 }
617 end;
618
619OnTimer1000:
620 .timer++;
621 if ( .timer == 1 )
622 mapannounce strnpcinfo(4), "Area will be restricted in 5 mins.", bc_area|bc_blue;
623 if ( .timer == 120 )
624 mapannounce strnpcinfo(4), "Area will be restricted in 3 mins.", bc_area|bc_blue;
625 if ( .timer == 180 )
626 mapannounce strnpcinfo(4), "Area will be restricted in 2 mins.", bc_area|bc_blue;
627 if ( .timer == 240 )
628 mapannounce strnpcinfo(4), "Area will be restricted in 1 mins.", bc_area|bc_blue;
629 if ( .timer == 240+30 )
630 mapannounce strnpcinfo(4), "Area will be restricted in 30 secs.", bc_area|bc_blue;
631 if ( .timer == 240+50 )
632 mapannounce strnpcinfo(4), "Area will be restricted in 20 secs.", bc_area|bc_blue;
633 if ( .timer == 240+70 )
634 mapannounce strnpcinfo(4), "Area will be restricted in 10 secs.", bc_area|bc_blue;
635 if ( .timer == 240+75 )
636 mapannounce strnpcinfo(4), "Area will be restricted in 5 secs.", bc_area|bc_blue;
637 if ( .timer == 240+76 )
638 mapannounce strnpcinfo(4), "Area will be restricted in 4 secs.", bc_area|bc_blue;
639 if ( .timer == 240+77 )
640 mapannounce strnpcinfo(4), "Area will be restricted in 3 secs.", bc_area|bc_blue;
641 if ( .timer == 240+78 )
642 mapannounce strnpcinfo(4), "Area will be restricted in 2 secs.", bc_area|bc_blue;
643 if ( .timer == 240+79 )
644 mapannounce strnpcinfo(4), "Area will be restricted in 1 secs.", bc_area|bc_blue;
645 if ( .timer == 240+80 ) {
646 .restricted = true;
647 donpcevent strnpcinfo(0)+"::OnRemoveViewPoint";
648 donpcevent strnpcinfo(0)+"::OnViewPoint";
649 enablenpc "#zone_2";
650 donpcevent "#zone_2::OnStart";
651 }
652 if ( .restricted ) donpcevent strnpcinfo(0)+"::OnDangerZone";
653 setnpctimer 0;
654 end;
655
656OnRemoveViewPoint:
657 addrid(1);
658 viewpoint 2, .npcx, .npcy+100, 1, 0x1d9df1;
659 viewpoint 2, .npcx, .npcy-100, 2, 0x1d9df1;
660 viewpoint 2, .npcx+100, .npcy, 3, 0x1d9df1;
661 viewpoint 2, .npcx-100, .npcy, 4, 0x1d9df1;
662 viewpoint 2, .npcx+100, .npcy+100, 5, 0x1d9df1;
663 viewpoint 2, .npcx+100, .npcy-100, 6, 0x1d9df1;
664 viewpoint 2, .npcx-100, .npcy-100, 7, 0x1d9df1;
665 viewpoint 2, .npcx-100, .npcy+100, 8, 0x1d9df1;
666 viewpoint 2, .npcx, .npcy+100, 9, 0xFFFFFF;
667 viewpoint 2, .npcx, .npcy-100, 10, 0xFFFFFF;
668 viewpoint 2, .npcx+100, .npcy, 11, 0xFFFFFF;
669 viewpoint 2, .npcx-100, .npcy, 12, 0xFFFFFF;
670 viewpoint 2, .npcx+100, .npcy+100, 13, 0xFFFFFF;
671 viewpoint 2, .npcx+100, .npcy-100, 14, 0xFFFFFF;
672 viewpoint 2, .npcx-100, .npcy-100, 15, 0xFFFFFF;
673 viewpoint 2, .npcx-100, .npcy+100, 16, 0xFFFFFF;
674 end;
675
676OnViewPoint:
677 addrid(1);
678 if ( .restricted )
679 {
680 viewpoint 1, .npcx, .npcy+100, 1, 0x1d9df1;
681 viewpoint 1, .npcx, .npcy-100, 2, 0x1d9df1;
682 viewpoint 1, .npcx+100, .npcy, 3, 0x1d9df1;
683 viewpoint 1, .npcx-100, .npcy, 4, 0x1d9df1;
684 viewpoint 1, .npcx+100, .npcy+100, 5, 0x1d9df1;
685 viewpoint 1, .npcx+100, .npcy-100, 6, 0x1d9df1;
686 viewpoint 1, .npcx-100, .npcy-100, 7, 0x1d9df1;
687 viewpoint 1, .npcx-100, .npcy+100, 8, 0x1d9df1;
688 } else {
689 viewpoint 1, .npcx, .npcy+100, 9, 0xFFFFFF;
690 viewpoint 1, .npcx, .npcy-100, 10, 0xFFFFFF;
691 viewpoint 1, .npcx+100, .npcy, 11, 0xFFFFFF;
692 viewpoint 1, .npcx-100, .npcy, 12, 0xFFFFFF;
693 viewpoint 1, .npcx+100, .npcy+100, 13, 0xFFFFFF;
694 viewpoint 1, .npcx+100, .npcy-100, 14, 0xFFFFFF;
695 viewpoint 1, .npcx-100, .npcy-100, 15, 0xFFFFFF;
696 viewpoint 1, .npcx-100, .npcy+100, 16, 0xFFFFFF;
697 }
698 end;
699
700OnDangerZone:
701 addrid(1);
702 getmapxy .@pmap$, .@px, .@py, BL_PC;
703 if(distance(.@px, .@py, .npcx, .npcy) > 100 ) {
704 dispbottom "You are in the danger zone!", 0xf13a1d;
705 heal -100, 0;
706 specialeffect2 EF_RED_HIT;
707 specialeffect2 EF_HIT;
708 }
709 end;
710}
711
712league,0,0,0 script #zone_2 111,80,80,{
713end;
714OnInit:
715 disablenpc strnpcinfo(0);
716 end;
717
718OnEnd:
719 stopnpctimer;
720 disablenpc strnpcinfo(0);
721 end;
722
723OnStart:
724 .restricted = false;
725 .location = rand(5);
726 switch(.location) {
727 case 0: .@x = 145; .@y = 145; break;
728 case 1: .@x = 172; .@y = 165; break;
729 case 2: .@x = 118; .@y = 168; break;
730 case 3: .@x = 145; .@y = 190; break;
731 case 4: .@x = 123; .@y = 134; break;
732 case 5: .@x = 173; .@y = 137; break;
733 }
734 movenpc strnpcinfo(0), .@x, .@y;
735 getmapxy .@nmap$, .npcx, .npcy, BL_NPC, strnpcinfo(3);
736 donpcevent strnpcinfo(0)+"::OnViewPoint";
737 .timer = 0;
738 initnpctimer;
739 end;
740
741OnTouch:
742 if ( .restricted )
743 {
744 specialeffect2 EF_HEAL;
745 dispbottom "You are in the safe zone", 0xb1e188;
746 }
747 end;
748
749OnTimer1000:
750 .timer++;
751 if ( .timer == 1 )
752 mapannounce strnpcinfo(4), "Area has been restricted.", bc_area|bc_blue;
753 if ( .timer == 10 )
754 mapannounce strnpcinfo(4), "Area will be restricted in 4 mins.", bc_area|bc_blue;
755 if ( .timer == 60 )
756 mapannounce strnpcinfo(4), "Area will be restricted in 3 mins.", bc_area|bc_blue;
757 if ( .timer == 120 )
758 mapannounce strnpcinfo(4), "Area will be restricted in 2 mins.", bc_area|bc_blue;
759 if ( .timer == 180 )
760 mapannounce strnpcinfo(4), "Area will be restricted in 1 mins.", bc_area|bc_blue;
761 if ( .timer == 180+30 )
762 mapannounce strnpcinfo(4), "Area will be restricted in 30 secs.", bc_area|bc_blue;
763 if ( .timer == 180+50 )
764 mapannounce strnpcinfo(4), "Area will be restricted in 20 secs.", bc_area|bc_blue;
765 if ( .timer == 180+70 )
766 mapannounce strnpcinfo(4), "Area will be restricted in 10 secs.", bc_area|bc_blue;
767 if ( .timer == 180+75 )
768 mapannounce strnpcinfo(4), "Area will be restricted in 5 secs.", bc_area|bc_blue;
769 if ( .timer == 180+76 )
770 mapannounce strnpcinfo(4), "Area will be restricted in 4 secs.", bc_area|bc_blue;
771 if ( .timer == 180+77 )
772 mapannounce strnpcinfo(4), "Area will be restricted in 3 secs.", bc_area|bc_blue;
773 if ( .timer == 180+78 )
774 mapannounce strnpcinfo(4), "Area will be restricted in 2 secs.", bc_area|bc_blue;
775 if ( .timer == 180+79 )
776 mapannounce strnpcinfo(4), "Area will be restricted in 1 secs.", bc_area|bc_blue;
777 if ( .timer == 180+80 ) {
778 .restricted = true;
779 donpcevent "#zone_1::OnRemoveViewPoint";
780 stopnpctimer "#zone_1";
781 donpcevent strnpcinfo(0)+"::OnRemoveViewPoint";
782 donpcevent strnpcinfo(0)+"::OnViewPoint";
783 enablenpc "#zone_3";
784 donpcevent "#zone_3::OnStart";
785 }
786 if ( .restricted ) donpcevent strnpcinfo(0)+"::OnDangerZone";
787 setnpctimer 0;
788 end;
789
790OnRemoveViewPoint:
791 addrid(1);
792 viewpoint 2, .npcx, .npcy+80, 1, 0x1d9df1;
793 viewpoint 2, .npcx, .npcy-80, 2, 0x1d9df1;
794 viewpoint 2, .npcx+80, .npcy, 3, 0x1d9df1;
795 viewpoint 2, .npcx-80, .npcy, 4, 0x1d9df1;
796 viewpoint 2, .npcx+80, .npcy+80, 5, 0x1d9df1;
797 viewpoint 2, .npcx+80, .npcy-80, 6, 0x1d9df1;
798 viewpoint 2, .npcx-80, .npcy-80, 7, 0x1d9df1;
799 viewpoint 2, .npcx-80, .npcy+80, 8, 0x1d9df1;
800 viewpoint 2, .npcx, .npcy+80, 9, 0xFFFFFF;
801 viewpoint 2, .npcx, .npcy-80, 10, 0xFFFFFF;
802 viewpoint 2, .npcx+80, .npcy, 11, 0xFFFFFF;
803 viewpoint 2, .npcx-80, .npcy, 12, 0xFFFFFF;
804 viewpoint 2, .npcx+80, .npcy+80, 13, 0xFFFFFF;
805 viewpoint 2, .npcx+80, .npcy-80, 14, 0xFFFFFF;
806 viewpoint 2, .npcx-80, .npcy-80, 15, 0xFFFFFF;
807 viewpoint 2, .npcx-80, .npcy+80, 16, 0xFFFFFF;
808 end;
809
810OnViewPoint:
811 addrid(1);
812 if ( .restricted )
813 {
814 viewpoint 1, .npcx, .npcy+80, 1, 0x1d9df1;
815 viewpoint 1, .npcx, .npcy-80, 2, 0x1d9df1;
816 viewpoint 1, .npcx+80, .npcy, 3, 0x1d9df1;
817 viewpoint 1, .npcx-80, .npcy, 4, 0x1d9df1;
818 viewpoint 1, .npcx+80, .npcy+80, 5, 0x1d9df1;
819 viewpoint 1, .npcx+80, .npcy-80, 6, 0x1d9df1;
820 viewpoint 1, .npcx-80, .npcy-80, 7, 0x1d9df1;
821 viewpoint 1, .npcx-80, .npcy+80, 8, 0x1d9df1;
822 } else {
823 viewpoint 1, .npcx, .npcy+80, 9, 0xFFFFFF;
824 viewpoint 1, .npcx, .npcy-80, 10, 0xFFFFFF;
825 viewpoint 1, .npcx+80, .npcy, 11, 0xFFFFFF;
826 viewpoint 1, .npcx-80, .npcy, 12, 0xFFFFFF;
827 viewpoint 1, .npcx+80, .npcy+80, 13, 0xFFFFFF;
828 viewpoint 1, .npcx+80, .npcy-80, 14, 0xFFFFFF;
829 viewpoint 1, .npcx-80, .npcy-80, 15, 0xFFFFFF;
830 viewpoint 1, .npcx-80, .npcy+80, 16, 0xFFFFFF;
831 }
832 end;
833
834OnDangerZone:
835 addrid(1);
836 getmapxy .@pmap$, .@px, .@py, BL_PC;
837 if(distance(.@px, .@py, .npcx, .npcy) > 80 ) {
838 dispbottom "You are in the danger zone!", 0xf13a1d;
839 heal -120, 0;
840 specialeffect2 EF_RED_HIT;
841 specialeffect2 EF_HIT;
842 }
843 end;
844}
845
846league,0,0,0 script #zone_3 111,60,60,{
847end;
848OnInit:
849 disablenpc strnpcinfo(0);
850 end;
851
852OnEnd:
853 stopnpctimer;
854 disablenpc strnpcinfo(0);
855 end;
856
857OnStart:
858 .restricted = false;
859 .location = rand(5);
860 switch(.location) {
861 case 0: .@x = 145; .@y = 145; break;
862 case 1: .@x = 172; .@y = 165; break;
863 case 2: .@x = 118; .@y = 168; break;
864 case 3: .@x = 145; .@y = 190; break;
865 case 4: .@x = 123; .@y = 134; break;
866 case 5: .@x = 173; .@y = 137; break;
867 }
868 movenpc strnpcinfo(0), .@x, .@y;
869 getmapxy .@nmap$, .npcx, .npcy, BL_NPC, strnpcinfo(3);
870 donpcevent strnpcinfo(0)+"::OnViewPoint";
871 .timer = 0;
872 initnpctimer;
873 end;
874
875OnTouch:
876 if ( .restricted )
877 {
878 specialeffect2 EF_HEAL;
879 dispbottom "You are in the safe zone", 0xb1e188;
880 }
881 end;
882
883OnTimer1000:
884 .timer++;
885 if ( .timer == 1 )
886 mapannounce strnpcinfo(4), "Area has been restricted.", bc_area|bc_blue;
887 if ( .timer == 10 )
888 mapannounce strnpcinfo(4), "Area will be restricted in 3 mins.", bc_area|bc_blue;
889 if ( .timer == 60 )
890 mapannounce strnpcinfo(4), "Area will be restricted in 2 mins.", bc_area|bc_blue;
891 if ( .timer == 120 )
892 mapannounce strnpcinfo(4), "Area will be restricted in 1 mins.", bc_area|bc_blue;
893 if ( .timer == 120+30 )
894 mapannounce strnpcinfo(4), "Area will be restricted in 30 secs.", bc_area|bc_blue;
895 if ( .timer == 120+50 )
896 mapannounce strnpcinfo(4), "Area will be restricted in 20 secs.", bc_area|bc_blue;
897 if ( .timer == 120+70 )
898 mapannounce strnpcinfo(4), "Area will be restricted in 10 secs.", bc_area|bc_blue;
899 if ( .timer == 120+75 )
900 mapannounce strnpcinfo(4), "Area will be restricted in 5 secs.", bc_area|bc_blue;
901 if ( .timer == 120+76 )
902 mapannounce strnpcinfo(4), "Area will be restricted in 4 secs.", bc_area|bc_blue;
903 if ( .timer == 120+77 )
904 mapannounce strnpcinfo(4), "Area will be restricted in 3 secs.", bc_area|bc_blue;
905 if ( .timer == 120+78 )
906 mapannounce strnpcinfo(4), "Area will be restricted in 2 secs.", bc_area|bc_blue;
907 if ( .timer == 120+79 )
908 mapannounce strnpcinfo(4), "Area will be restricted in 1 secs.", bc_area|bc_blue;
909 if ( .timer == 120+80 ) {
910 .restricted = true;
911 donpcevent "#zone_2::OnRemoveViewPoint";
912 stopnpctimer "#zone_2";
913 donpcevent strnpcinfo(0)+"::OnRemoveViewPoint";
914 donpcevent strnpcinfo(0)+"::OnViewPoint";
915 enablenpc "#zone_4";
916 donpcevent "#zone_4::OnStart";
917 }
918 if ( .restricted ) donpcevent strnpcinfo(0)+"::OnDangerZone";
919 setnpctimer 0;
920 end;
921
922OnRemoveViewPoint:
923 addrid(1);
924 viewpoint 2, .npcx, .npcy+60, 1, 0x1d9df1;
925 viewpoint 2, .npcx, .npcy-60, 2, 0x1d9df1;
926 viewpoint 2, .npcx+60, .npcy, 3, 0x1d9df1;
927 viewpoint 2, .npcx-60, .npcy, 4, 0x1d9df1;
928 viewpoint 2, .npcx+60, .npcy+60, 5, 0x1d9df1;
929 viewpoint 2, .npcx+60, .npcy-60, 6, 0x1d9df1;
930 viewpoint 2, .npcx-60, .npcy-60, 7, 0x1d9df1;
931 viewpoint 2, .npcx-60, .npcy+60, 8, 0x1d9df1;
932 viewpoint 2, .npcx, .npcy+60, 9, 0xFFFFFF;
933 viewpoint 2, .npcx, .npcy-60, 10, 0xFFFFFF;
934 viewpoint 2, .npcx+60, .npcy, 11, 0xFFFFFF;
935 viewpoint 2, .npcx-60, .npcy, 12, 0xFFFFFF;
936 viewpoint 2, .npcx+60, .npcy+60, 13, 0xFFFFFF;
937 viewpoint 2, .npcx+60, .npcy-60, 14, 0xFFFFFF;
938 viewpoint 2, .npcx-60, .npcy-60, 15, 0xFFFFFF;
939 viewpoint 2, .npcx-60, .npcy+60, 16, 0xFFFFFF;
940 end;
941
942OnViewPoint:
943 addrid(1);
944 if ( .restricted )
945 {
946 viewpoint 1, .npcx, .npcy+60, 1, 0x1d9df1;
947 viewpoint 1, .npcx, .npcy-60, 2, 0x1d9df1;
948 viewpoint 1, .npcx+60, .npcy, 3, 0x1d9df1;
949 viewpoint 1, .npcx-60, .npcy, 4, 0x1d9df1;
950 viewpoint 1, .npcx+60, .npcy+60, 5, 0x1d9df1;
951 viewpoint 1, .npcx+60, .npcy-60, 6, 0x1d9df1;
952 viewpoint 1, .npcx-60, .npcy-60, 7, 0x1d9df1;
953 viewpoint 1, .npcx-60, .npcy+60, 8, 0x1d9df1;
954 } else {
955 viewpoint 1, .npcx, .npcy+60, 9, 0xFFFFFF;
956 viewpoint 1, .npcx, .npcy-60, 10, 0xFFFFFF;
957 viewpoint 1, .npcx+60, .npcy, 11, 0xFFFFFF;
958 viewpoint 1, .npcx-60, .npcy, 12, 0xFFFFFF;
959 viewpoint 1, .npcx+60, .npcy+60, 13, 0xFFFFFF;
960 viewpoint 1, .npcx+60, .npcy-60, 14, 0xFFFFFF;
961 viewpoint 1, .npcx-60, .npcy-60, 15, 0xFFFFFF;
962 viewpoint 1, .npcx-60, .npcy+60, 16, 0xFFFFFF;
963 }
964 end;
965
966OnDangerZone:
967 addrid(1);
968 getmapxy .@pmap$, .@px, .@py, BL_PC;
969 if(distance(.@px, .@py, .npcx, .npcy) > 60 ) {
970 dispbottom "You are in the danger zone!", 0xf13a1d;
971 heal -150, 0;
972 specialeffect2 EF_RED_HIT;
973 specialeffect2 EF_HIT;
974 }
975 end;
976
977}
978
979league,0,0,0 script #zone_4 111,40,40,{
980end;
981OnInit:
982 disablenpc strnpcinfo(0);
983 end;
984
985OnEnd:
986 stopnpctimer;
987 disablenpc strnpcinfo(0);
988 end;
989
990OnStart:
991 .restricted = false;
992 .location = rand(5);
993 switch(.location) {
994 case 0: .@x = 145; .@y = 145; break;
995 case 1: .@x = 172; .@y = 165; break;
996 case 2: .@x = 118; .@y = 168; break;
997 case 3: .@x = 145; .@y = 190; break;
998 case 4: .@x = 123; .@y = 134; break;
999 case 5: .@x = 173; .@y = 137; break;
1000 }
1001 movenpc strnpcinfo(0), .@x, .@y;
1002 getmapxy .@nmap$, .npcx, .npcy, BL_NPC, strnpcinfo(3);
1003 donpcevent strnpcinfo(0)+"::OnViewPoint";
1004 .timer = 0;
1005 initnpctimer;
1006 end;
1007
1008OnTouch:
1009 if ( .restricted )
1010 {
1011 specialeffect2 EF_HEAL;
1012 dispbottom "You are in the safe zone", 0xb1e188;
1013 }
1014 end;
1015
1016OnTimer1000:
1017 .timer++;
1018 if ( .timer == 1 )
1019 mapannounce strnpcinfo(4), "Area has been restricted.", bc_area|bc_blue;
1020 if ( .timer == 10 )
1021 mapannounce strnpcinfo(4), "Area will be restricted in 2 mins.", bc_area|bc_blue;
1022 if ( .timer == 60 )
1023 mapannounce strnpcinfo(4), "Area will be restricted in 1 mins.", bc_area|bc_blue;
1024 if ( .timer == 60+30 )
1025 mapannounce strnpcinfo(4), "Area will be restricted in 30 secs.", bc_area|bc_blue;
1026 if ( .timer == 60+50 )
1027 mapannounce strnpcinfo(4), "Area will be restricted in 20 secs.", bc_area|bc_blue;
1028 if ( .timer == 60+70 )
1029 mapannounce strnpcinfo(4), "Area will be restricted in 10 secs.", bc_area|bc_blue;
1030 if ( .timer == 60+75 )
1031 mapannounce strnpcinfo(4), "Area will be restricted in 5 secs.", bc_area|bc_blue;
1032 if ( .timer == 60+76 )
1033 mapannounce strnpcinfo(4), "Area will be restricted in 4 secs.", bc_area|bc_blue;
1034 if ( .timer == 60+77 )
1035 mapannounce strnpcinfo(4), "Area will be restricted in 3 secs.", bc_area|bc_blue;
1036 if ( .timer == 60+78 )
1037 mapannounce strnpcinfo(4), "Area will be restricted in 2 secs.", bc_area|bc_blue;
1038 if ( .timer == 60+79 )
1039 mapannounce strnpcinfo(4), "Area will be restricted in 1 secs.", bc_area|bc_blue;
1040 if ( .timer == 60+80 ) {
1041 .restricted = true;
1042 donpcevent "#zone_3::OnRemoveViewPoint";
1043 stopnpctimer "#zone_3";
1044 donpcevent strnpcinfo(0)+"::OnRemoveViewPoint";
1045 donpcevent strnpcinfo(0)+"::OnViewPoint";
1046 enablenpc "#zone_5";
1047 donpcevent "#zone_5::OnStart";
1048 }
1049 if ( .restricted ) donpcevent strnpcinfo(0)+"::OnDangerZone";
1050 setnpctimer 0;
1051 end;
1052
1053OnRemoveViewPoint:
1054 addrid(1);
1055 viewpoint 2, .npcx, .npcy+40, 1, 0x1d9df1;
1056 viewpoint 2, .npcx, .npcy-40, 2, 0x1d9df1;
1057 viewpoint 2, .npcx+40, .npcy, 3, 0x1d9df1;
1058 viewpoint 2, .npcx-40, .npcy, 4, 0x1d9df1;
1059 viewpoint 2, .npcx+40, .npcy+40, 5, 0x1d9df1;
1060 viewpoint 2, .npcx+40, .npcy-40, 6, 0x1d9df1;
1061 viewpoint 2, .npcx-40, .npcy-40, 7, 0x1d9df1;
1062 viewpoint 2, .npcx-40, .npcy+40, 8, 0x1d9df1;
1063 viewpoint 2, .npcx, .npcy+40, 9, 0xFFFFFF;
1064 viewpoint 2, .npcx, .npcy-40, 10, 0xFFFFFF;
1065 viewpoint 2, .npcx+40, .npcy, 11, 0xFFFFFF;
1066 viewpoint 2, .npcx-40, .npcy, 12, 0xFFFFFF;
1067 viewpoint 2, .npcx+40, .npcy+40, 13, 0xFFFFFF;
1068 viewpoint 2, .npcx+40, .npcy-40, 14, 0xFFFFFF;
1069 viewpoint 2, .npcx-40, .npcy-40, 15, 0xFFFFFF;
1070 viewpoint 2, .npcx-40, .npcy+40, 16, 0xFFFFFF;
1071 end;
1072
1073OnViewPoint:
1074 addrid(1);
1075 if ( .restricted )
1076 {
1077 viewpoint 1, .npcx, .npcy+40, 1, 0x1d9df1;
1078 viewpoint 1, .npcx, .npcy-40, 2, 0x1d9df1;
1079 viewpoint 1, .npcx+40, .npcy, 3, 0x1d9df1;
1080 viewpoint 1, .npcx-40, .npcy, 4, 0x1d9df1;
1081 viewpoint 1, .npcx+40, .npcy+40, 5, 0x1d9df1;
1082 viewpoint 1, .npcx+40, .npcy-40, 6, 0x1d9df1;
1083 viewpoint 1, .npcx-40, .npcy-40, 7, 0x1d9df1;
1084 viewpoint 1, .npcx-40, .npcy+40, 8, 0x1d9df1;
1085 } else {
1086 viewpoint 1, .npcx, .npcy+40, 9, 0xFFFFFF;
1087 viewpoint 1, .npcx, .npcy-40, 10, 0xFFFFFF;
1088 viewpoint 1, .npcx+40, .npcy, 11, 0xFFFFFF;
1089 viewpoint 1, .npcx-40, .npcy, 12, 0xFFFFFF;
1090 viewpoint 1, .npcx+40, .npcy+40, 13, 0xFFFFFF;
1091 viewpoint 1, .npcx+40, .npcy-40, 14, 0xFFFFFF;
1092 viewpoint 1, .npcx-40, .npcy-40, 15, 0xFFFFFF;
1093 viewpoint 1, .npcx-40, .npcy+40, 16, 0xFFFFFF;
1094 }
1095 end;
1096
1097OnDangerZone:
1098 addrid(1);
1099 getmapxy .@pmap$, .@px, .@py, BL_PC;
1100 if(distance(.@px, .@py, .npcx, .npcy) > 40 ) {
1101 dispbottom "You are in the danger zone!", 0xf13a1d;
1102 heal -200, 0;
1103 specialeffect2 EF_RED_HIT;
1104 specialeffect2 EF_HIT;
1105 }
1106 end;
1107}
1108
1109league,0,0,0 script #zone_5 111,20,20,{
1110end;
1111OnInit:
1112 disablenpc strnpcinfo(0);
1113 end;
1114
1115OnEnd:
1116 stopnpctimer;
1117 disablenpc strnpcinfo(0);
1118 end;
1119
1120OnStart:
1121 .restricted = false;
1122 .location = rand(5);
1123 switch(.location) {
1124 case 0: .@x = 145; .@y = 145; break;
1125 case 1: .@x = 172; .@y = 165; break;
1126 case 2: .@x = 118; .@y = 168; break;
1127 case 3: .@x = 145; .@y = 190; break;
1128 case 4: .@x = 123; .@y = 134; break;
1129 case 5: .@x = 173; .@y = 137; break;
1130 }
1131 movenpc strnpcinfo(0), .@x, .@y;
1132 getmapxy .@nmap$, .npcx, .npcy, BL_NPC, strnpcinfo(3);
1133 donpcevent strnpcinfo(0)+"::OnViewPoint";
1134 .timer = 0;
1135 initnpctimer;
1136 end;
1137
1138OnTouch:
1139 if ( .restricted )
1140 {
1141 specialeffect2 EF_HEAL;
1142 dispbottom "You are in the safe zone", 0xb1e188;
1143 }
1144 end;
1145
1146OnTimer1000:
1147 .timer++;
1148 if ( .timer == 1 )
1149 mapannounce strnpcinfo(4), "Area has been restricted.", bc_area|bc_blue;
1150 if ( .timer == 10 )
1151 mapannounce strnpcinfo(4), "Area will be restricted in 2 mins.", bc_area|bc_blue;
1152 if ( .timer == 60 )
1153 mapannounce strnpcinfo(4), "Area will be restricted in 1 mins.", bc_area|bc_blue;
1154 if ( .timer == 60+30 )
1155 mapannounce strnpcinfo(4), "Area will be restricted in 30 secs.", bc_area|bc_blue;
1156 if ( .timer == 60+50 )
1157 mapannounce strnpcinfo(4), "Area will be restricted in 20 secs.", bc_area|bc_blue;
1158 if ( .timer == 60+70 )
1159 mapannounce strnpcinfo(4), "Area will be restricted in 10 secs.", bc_area|bc_blue;
1160 if ( .timer == 60+75 )
1161 mapannounce strnpcinfo(4), "Area will be restricted in 5 secs.", bc_area|bc_blue;
1162 if ( .timer == 60+76 )
1163 mapannounce strnpcinfo(4), "Area will be restricted in 4 secs.", bc_area|bc_blue;
1164 if ( .timer == 60+77 )
1165 mapannounce strnpcinfo(4), "Area will be restricted in 3 secs.", bc_area|bc_blue;
1166 if ( .timer == 60+78 )
1167 mapannounce strnpcinfo(4), "Area will be restricted in 2 secs.", bc_area|bc_blue;
1168 if ( .timer == 60+79 )
1169 mapannounce strnpcinfo(4), "Area will be restricted in 1 secs.", bc_area|bc_blue;
1170 if ( .timer == 60+80 ) {
1171 .restricted = true;
1172 donpcevent "#zone_4::OnRemoveViewPoint";
1173 stopnpctimer "#zone_4";
1174 donpcevent strnpcinfo(0)+"::OnRemoveViewPoint";
1175 donpcevent strnpcinfo(0)+"::OnViewPoint";
1176 }
1177 if ( .restricted ) donpcevent strnpcinfo(0)+"::OnDangerZone";
1178 setnpctimer 0;
1179 end;
1180
1181OnRemoveViewPoint:
1182 addrid(1);
1183 viewpoint 2, .npcx, .npcy+20, 1, 0x1d9df1;
1184 viewpoint 2, .npcx, .npcy-20, 2, 0x1d9df1;
1185 viewpoint 2, .npcx+20, .npcy, 3, 0x1d9df1;
1186 viewpoint 2, .npcx-20, .npcy, 4, 0x1d9df1;
1187 viewpoint 2, .npcx+20, .npcy+20, 5, 0x1d9df1;
1188 viewpoint 2, .npcx+20, .npcy-20, 6, 0x1d9df1;
1189 viewpoint 2, .npcx-20, .npcy-20, 7, 0x1d9df1;
1190 viewpoint 2, .npcx-20, .npcy+20, 8, 0x1d9df1;
1191 viewpoint 2, .npcx, .npcy+20, 9, 0xFFFFFF;
1192 viewpoint 2, .npcx, .npcy-20, 10, 0xFFFFFF;
1193 viewpoint 2, .npcx+20, .npcy, 11, 0xFFFFFF;
1194 viewpoint 2, .npcx-20, .npcy, 12, 0xFFFFFF;
1195 viewpoint 2, .npcx+20, .npcy+20, 13, 0xFFFFFF;
1196 viewpoint 2, .npcx+20, .npcy-20, 14, 0xFFFFFF;
1197 viewpoint 2, .npcx-20, .npcy-20, 15, 0xFFFFFF;
1198 viewpoint 2, .npcx-20, .npcy+20, 16, 0xFFFFFF;
1199 end;
1200
1201OnViewPoint:
1202 addrid(1);
1203 if ( .restricted )
1204 {
1205 viewpoint 1, .npcx, .npcy+20, 1, 0x1d9df1;
1206 viewpoint 1, .npcx, .npcy-20, 2, 0x1d9df1;
1207 viewpoint 1, .npcx+20, .npcy, 3, 0x1d9df1;
1208 viewpoint 1, .npcx-20, .npcy, 4, 0x1d9df1;
1209 viewpoint 1, .npcx+20, .npcy+20, 5, 0x1d9df1;
1210 viewpoint 1, .npcx+20, .npcy-20, 6, 0x1d9df1;
1211 viewpoint 1, .npcx-20, .npcy-20, 7, 0x1d9df1;
1212 viewpoint 1, .npcx-20, .npcy+20, 8, 0x1d9df1;
1213 } else {
1214 viewpoint 1, .npcx, .npcy+20, 9, 0xFFFFFF;
1215 viewpoint 1, .npcx, .npcy-20, 10, 0xFFFFFF;
1216 viewpoint 1, .npcx+20, .npcy, 11, 0xFFFFFF;
1217 viewpoint 1, .npcx-20, .npcy, 12, 0xFFFFFF;
1218 viewpoint 1, .npcx+20, .npcy+20, 13, 0xFFFFFF;
1219 viewpoint 1, .npcx+20, .npcy-20, 14, 0xFFFFFF;
1220 viewpoint 1, .npcx-20, .npcy-20, 15, 0xFFFFFF;
1221 viewpoint 1, .npcx-20, .npcy+20, 16, 0xFFFFFF;
1222 }
1223 end;
1224
1225OnDangerZone:
1226 addrid(1);
1227 getmapxy .@pmap$, .@px, .@py, BL_PC;
1228 if(distance(.@px, .@py, .npcx, .npcy) > 20 ) {
1229 dispbottom "You are in the danger zone!", 0xf13a1d;
1230 heal -250, 0;
1231 specialeffect2 EF_RED_HIT;
1232 specialeffect2 EF_HIT;
1233 }
1234 end;
1235
1236}
1237
1238function script fWalkable {
1239 .@map$ = getarg(0);
1240 freeloop(1);
1241 do {
1242 .@rXr = rand(getarg(1));
1243 .@rYr = rand(getarg(2,getarg(1)));
1244 }
1245 while (checkcell(.@map$,.@rXr,.@rYr,cell_chkwall)
1246 || checkcell(.@map$,.@rXr,.@rYr,cell_chkcliff)
1247 || checkcell(.@map$,.@rXr,.@rYr,cell_chknopass)
1248 || checkcell(.@map$,.@rXr,.@rYr,cell_chknoreach));
1249
1250 return (.@rXr<<12)+.@rYr;
1251}
1252
1253- script Kaboom 111,{
1254end;
1255OnTouch:
1256 .@start_ = getvariableofnpc(.start ,"robr#main");
1257 if ( .@start_ == false ) end;
1258 atcommand "@nuke " + strcharinfo(0);
1259 mapannounce strnpcinfo(4), strcharinfo(0) +" was easily taken off by a landmine! Be careful!", bc_area|bc_blue;
1260 disablenpc strnpcinfo(0);
1261 movenpc strnpcinfo(0), 0, 0;
1262 end;
1263
1264S_MoveNPC:
1265 explode(.@tmp_ary$,strnpcinfo(2),"|");
1266 .@walkable_xy = fWalkable(strnpcinfo(4), atoi(.@tmp_ary$[0]), atoi(.@tmp_ary$[1]));
1267 .@y = .@walkable_xy & 4095;
1268 .@x = .@walkable_xy >> 12;
1269 movenpc strnpcinfo(0), .@x, .@y;
1270 enablenpc strnpcinfo(0);
1271 sleep 60000;
1272 callsub S_MoveNPC;
1273
1274OnInit:
1275 disablenpc strnpcinfo(0);
1276 if( strnpcinfo(2) != "" )
1277 callsub S_MoveNPC;
1278}
1279
1280// landmines
1281league,0,0,0 duplicate(Kaboom) 1#300|300 111,2,2
1282league,0,0,0 duplicate(Kaboom) 2#300|300 111,2,2
1283league,0,0,0 duplicate(Kaboom) 3#300|300 111,2,2
1284league,0,0,0 duplicate(Kaboom) 4#300|300 111,2,2
1285league,0,0,0 duplicate(Kaboom) 5#300|300 111,2,2