· 6 years ago · Aug 01, 2019, 10:28 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,83,3 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", 60, 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 switch(Class) {
263 case JOB_RUNE_KNIGHT_T:
264 case JOB_WARLOCK_T:
265 case JOB_RANGER_T:
266 case JOB_ARCH_BISHOP_T:
267 case JOB_MECHANIC_T:
268 case JOB_GUILLOTINE_CROSS_T:
269 case JOB_ROYAL_GUARD_T:
270 case JOB_SORCERER_T:
271 case JOB_MINSTREL_T:
272 case JOB_WANDERER_T:
273 case JOB_SURA_T:
274 case JOB_GENETIC_T:
275 case JOB_SHADOW_CHASER_T:
276 case JOB_KAGEROU:
277 case JOB_OBORO:
278 case JOB_REBELLION:
279 .@can_join = true;
280 break;
281 default:
282 .@can_join = false;
283 break;
284 }
285 if ( !.@can_join ) {
286 mes "[Manager]";
287 mes "Only 3rd trans jobs can join this event!";
288 close;
289 }
290 if ( BaseLevel < .min_level ) {
291 mes "[Manager]";
292 mes "Only Level "+ .min_level +" can join this event!";
293 close;
294 }
295 if ( .size == .maxcapacity ) {
296 mes "[Manager]";
297 mes "The map is currently full. Please wait for the next game to start.";
298 close;
299 }
300 if ( getpetinfo(PETINFO_ID) ) {
301 mes "[Manager]";
302 mes "Pets are not allowed.";
303 close;
304 }
305 if ( @inventorylist_count ) {
306 mes "[Manager]";
307 mes "Make sure your inventory is empty.";
308 close;
309 }
310 mes "[Manager]";
311 mes "Hello, "+ strcharinfo(0) +"!";
312 mes "How may I help you?";
313 next;
314 switch(select("Join","Nothing")) {
315 case 1:
316 while ( .aid[.@i] != getcharid(3) && .@i < .size ) ++.@i;
317 if ( .@i < .size ) {
318 mes "You already joined the queue.";
319 mes " ";
320 mes "Automatically removing from previous queue.";
321 mes " ";
322 mes "Please try joining again";
323 close2;
324 deletearray .aid[.@i], 1;
325 --.@i;
326 --.size;
327 end;
328 }
329 mes "[Manager]";
330 mes "Joining..";
331 mes "stand by on the lobby map..";
332 mes "warping";
333 close2;
334 .aid[ .size++ ] = getcharid(3);
335 percentheal 100, 100;
336 ROBRPLAY = true;
337 sc_end SC_ALL;
338 warp .map$,0,0;
339 sleep2 2500;
340 announce strcharinfo(0) + " has joined the "+.servername$+" Battle Royale! --- "+ .size +"/"+ .maxcapacity, bc_all | bc_blue;
341 F_Checkplayers;
342 end;
343
344 case 2:
345 break;
346 }
347 end;
348
349 function F_Checkplayers {
350 for ( .@i = 0; .@i < .size; ++.@i ) {
351 if ( !isloggedin( .aid[.@i] ) ) {
352 deletearray .aid[.@i], 1;
353 --.@i;
354 --.size;
355 }
356 else {
357 attachrid .aid[.@i];
358 if ( strcharinfo(3) != .map$ ) {
359 deletearray .aid[.@i], 1;
360 --.@i;
361 --.size;
362 }
363 }
364 }
365 detachrid;
366 return;
367 }
368}
369
370league,0,0,0 script robr#hg_change -1,{
371OnStart:
372 addrid(1);
373 .@r = hg_rank_change_br(rating_get(0));
374 setlook LOOK_HEAD_TOP, .@r;
375 end;
376
377OnEnd:
378 disablenpc strnpcinfo(0);
379 end;
380
381}
382league,0,0,0 script robr#main -1,{
383OnInit:
384 disablenpc strnpcinfo(0);
385 end;
386
387OnStart:
388 .start = true;
389 .size = getarraysize(.aid_);
390 initnpctimer;
391 end;
392
393OnTimer61000:
394 mapannounce strnpcinfo(4), "Players Left -- "+ .size, bc_area|bc_blue;
395 setnpctimer 0;
396 end;
397
398OnPCLoginEvent:
399 if ( ROBRPLAY ) {
400 ROBRPLAY = false;
401 getinventorylist;
402 for ( .@i = 0; .@i < @inventorylist_count; .@i++) {
403 .@itemid[.@i] = @inventorylist_id[.@i];
404 .@itemamt[.@i] = @inventorylist_amount[.@i];
405 delitem .@itemid[.@i], .@itemamt[.@i];
406 }
407 }
408 end;
409
410OnPCDieEvent:
411OnPCLogoutEvent:
412 if ( strcharinfo(3) == strnpcinfo(4) ) {
413 for ( .@j = 0; .@j < .size; .@j++ ) {
414 if ( getcharid(3) == .aid_[.@j] ) {
415 ROBRPLAY = false;
416 setlook LOOK_HEAD_TOP, 0;
417 robrrank_getexp ( rating_get(0), 50, 2 ); // 1 = win ; 2 = lost
418 mapannounce strnpcinfo(4), strcharinfo(0) +" has died on Battle Royale!", bc_area|bc_blue;
419 getinventorylist;
420 getmapxy .@map$, .@x, .@y, BL_PC;
421 deletearray .aid_[.@j], 1;
422 --.@j;
423 --.size;
424 for ( .@i = 0; .@i < @inventorylist_count; .@i++) {
425 .@itemid[.@i] = @inventorylist_id[.@i];
426 .@itemamt[.@i] = @inventorylist_amount[.@i];
427 makeitem .@itemid[.@i], .@itemamt[.@i], .@map$, .@x, .@y;
428 delitem .@itemid[.@i], .@itemamt[.@i];
429 }
430 warp "SavePoint", 0, 0;
431 if ( .size == 1 )
432 callsub OnReward;
433 sleep2 1250;
434 }
435 }
436 }
437 end;
438
439OnReward:
440 .@id = getvariableofnpc(.item_id ,"ROBR#ROBRManager");
441 .@am = getvariableofnpc(.item_amt ,"ROBR#ROBRManager");
442 .@cutin$ = getvariableofnpc(.cutin_img$ ,"ROBR#ROBRManager");
443 donpcevent "#zone_1::OnEnd";
444 donpcevent "#zone_2::OnEnd";
445 donpcevent "#zone_3::OnEnd";
446 donpcevent "#zone_4::OnEnd";
447 donpcevent "#zone_5::OnEnd";
448 donpcevent "robr#hg_change::OnEnd";
449 stopnpctimer;
450 .start = false;
451 pvpoff "league";
452
453 killmonsterall strnpcinfo(4);
454 attachrid .aid_;
455 cutin .@cutin$ , 4;
456 announce strcharinfo(0) + " is our Battle Royale Champion!", bc_all | bc_blue;
457 getinventorylist;
458 for ( .@i = 0; .@i < @inventorylist_count; .@i++) {
459 .@itemid[.@i] = @inventorylist_id[.@i];
460 .@itemamt[.@i] = @inventorylist_amount[.@i];
461 delitem .@itemid[.@i], .@itemamt[.@i];
462 }
463 getitem .@id, .@am;
464 ROBRPLAY = false;
465 setlook LOOK_HEAD_TOP, 0;
466 robrrank_getexp ( rating_get(0), 50, 1 ); // 1 = win ; 2 = lost
467 dispbottom "[System] You will be warped out in a few seconds.", 0xFF0000;
468 sleep 15000;
469 mapwarp strnpcinfo(4), "prontera", 156, 191;
470 disablenpc strnpcinfo(0);
471 end;
472}
473
474league,0,0,0 script ROBR#Mobspawn -1,{
475OnInit:
476 disablenpc strnpcinfo(0);
477 end;
478
479OnStart:
480 .@amt = getvariableofnpc(.supply_box ,"ROBR#ROBRManager");
481 monster strnpcinfo(4), 0, 0, "Supply Box", 3001, .@amt, strnpcinfo(0)+"::OnOpenSupply";
482 end;
483
484OnOpenSupply:
485 switch(BaseClass) {
486 case JOB_ROYAL_GUARD_T:
487 .@weapon_id = F_Rand(1156, 1160, 1406, 2101); // add more items here for PA
488 break;
489 case JOB_RUNE_KNIGHT_T:
490 .@weapon_id = F_Rand(1156, 1160, 1406, 2105); // add more items here for LK
491 break;
492 case JOB_ARCH_BISHOP_T:
493 .@weapon_id = F_Rand(1551, 1506, 2101); // add more items here for HP
494 break;
495 case JOB_SURA_T:
496 .@weapon_id = F_Rand(1506, 1806); // add more items here for CH
497 break;
498 case JOB_WARLOCK_T:
499 .@weapon_id = F_Rand(1603, 1601, 2101); // add more items here for HW
500 break;
501 case JOB_SORCERER_T:
502 .@weapon_id = F_Rand(1603, 1601, 2101); // add more items here for PR
503 break;
504 case JOB_MECHANIC_T:
505 .@weapon_id = F_Rand(1303, 1353); // add more items here for WS
506 break;
507 case JOB_MINSTREL_T:
508 .@weapon_id = F_Rand(1703, 1702, 1913); // add more items here for SN
509 .@ammo_id = 12104;
510 break;
511 case JOB_WANDERER_T:
512 .@weapon_id = F_Rand(1703, 1702, 1969); // add more items here for SN
513 .@ammo_id = 12104;
514 break;
515 case JOB_RANGER_T:
516 .@weapon_id = F_Rand(1703, 1702); // add more items here for SN
517 .@ammo_id = 12104;
518 break;
519 case JOB_GUILLOTINE_CROSS_T:
520 .@weapon_id = F_Rand(1201, 1202, 2101); // add more items here for AC
521 break;
522 case JOB_SHADOW_CHASER_T:
523 .@weapon_id = F_Rand(1201, 1202); // add more items here for ST
524 break;
525 case JOB_GENETIC_T:
526 .@weapon_id = F_Rand(1201, 1202)); // add more items here for CR
527 break;
528 case JOB_REBELLION:
529 .@weapon_id = F_Rand(13112, 13113, 13163, 13165, 13158, 13156, 13167, 13160, 13160);
530 .@ammo_id = F_Rand(13202,13202, 13200, 13200, 13200, 13201, 13201, 13206, 13203, 13207, 13204, 13205);
531 break;
532 case JOB_KAGEROU:
533 case JOB_OBORO:
534 .@weapon_id = F_Rand(1206, 1207, 13300);
535 .@ammo_id = F_Rand(13256, 13294, 13259, 13258, 13257, 13255);
536 break;
537 case JOB_STAR_EMPEROR:
538 case JOB_SOUL_REAPER:
539 .@weapon_id = F_Rand(1551, 1506);
540 break;
541 }
542 setarray .@armor_id,
543 5829, // Ordinary_Armor
544 2303, // Leather_Jacket
545 2339, // G_Strings
546 2370; // Used_Mage_Coat
547 setarray .@garm_id,
548 2501, // Hood
549 2507, // Cape_Of_Ancient_Lord
550 2526, // Dragon_Scale_Coat
551 2547; // Cheap_Running_Shirts
552 setarray .@boots_id,
553 2401, // Sandals
554 2405, // Boots
555 2430, // Iron_Boots02
556 2439; // Refresh_Shoes
557 setarray .@helm_id,
558 5410, // Bread_Bag2
559 5400, // Fox_Hat
560 5461, // Adv_Whisper_Mask
561 2264, // Munak_Turban
562 5428, // Bread_Bag1
563 5485; // Tiger_Face
564 setarray .@pots_id,
565 662, // Inspector_Certificate
566 12029, // Gloomy_Box
567 12236, // Choco_Tart
568 11705, // Special_White_Potion
569 11705, // Special_White_Potion
570 11705, // Special_White_Potion
571 11705, // Special_White_Potion
572 11705; // Special_White_Potion
573 setarray .@acce_id,
574 2605, // (Brooch)
575 2693, // (Brooch_C)
576 2616, // (Critical_Ring)
577 2737, // (Foot_Ring)
578 2604, // (Glove)
579 2692, // (Glove_C)
580 2675; // (Lord_Ring)
581 .@s = rand(1,6);
582 switch(.@s) {
583 case 1:
584 getitem .@weapon_id, 1;
585 break;
586 case 2:
587 .@r = rand(getarraysize(.@armor_id)-1);
588 if ( !countitem(.@armor_id[.@r]) ) getitem .@armor_id[.@r], 1;
589 if (rand(100) > 30 ) getitem .@weapon_id, 1;
590 break;
591 case 3:
592 .@r = rand(getarraysize(.@garm_id)-1);
593 if ( !countitem(.@garm_id[.@r]) ) getitem .@garm_id[.@r], 1;
594 if (rand(100) > 30 ) getitem .@weapon_id, 1;
595 break;
596 case 4:
597 .@r = rand(getarraysize(.@boots_id)-1);
598 if ( !countitem(.@boots_id[.@r]) ) getitem .@boots_id[.@r], 1;
599 if (rand(100) > 30 ) getitem .@weapon_id, 1;
600 break;
601 case 5:
602 .@r = rand(getarraysize(.@helm_id)-1);
603 if ( !countitem(.@helm_id[.@r]) ) getitem .@helm_id[.@r], 1;
604 if (rand(100) > 30 ) getitem .@weapon_id, 1;
605 break;
606 case 6:
607 .@r = rand(getarraysize(.@acce_id)-1);
608 if ( !countitem(.@acce_id[.@r]) ) getitem .@acce_id[.@r], 1;
609 if (rand(100) > 30 ) getitem .@weapon_id, 1;
610 break;
611 }
612 if ( rand(100) > 20 && .@ammo_id ) {
613 .@amt = rand(5,10); else .@amt = rand(3,5);
614 getitem .@ammo_id, .@amt;
615 }
616 if ( rand(100) > 50 ) {
617 .@r = rand(getarraysize(.@pots_id)-1);
618 if ( .@pots_id[.@r] == 11705 ) .@amt = rand(2,5); else .@amt = 1;
619 getitem .@pots_id[.@r], .@amt;
620 }
621 end;
622
623}
624
625league,0,0,0 script #zone_1 111,100,100,{
626end;
627
628OnInit:
629 disablenpc strnpcinfo(0);
630 end;
631
632OnEnd:
633 stopnpctimer;
634 disablenpc strnpcinfo(0);
635 end;
636
637OnStart:
638 .restricted = false;
639 mapannounce strnpcinfo(4), "Rule is simple!", bc_area|bc_blue;
640 sleep 5000;
641 mapannounce strnpcinfo(4), "Last man remaining on this battlefield wins!", bc_area|bc_blue;
642 sleep 5000;
643 mapannounce strnpcinfo(4), "Warning! There are landmines on the area, please be careful", bc_area|bc_blue;
644 sleep 5000;
645 mapwarp strnpcinfo(4), strnpcinfo(4), 0, 0;
646 pvpon "league";
647 .location = rand(5);
648 switch(.location) {
649 case 0: .@x = 145; .@y = 145; break;
650 case 1: .@x = 172; .@y = 165; break;
651 case 2: .@x = 118; .@y = 168; break;
652 case 3: .@x = 145; .@y = 190; break;
653 case 4: .@x = 123; .@y = 134; break;
654 case 5: .@x = 173; .@y = 137; break;
655 }
656 movenpc strnpcinfo(0), .@x, .@y;
657 getmapxy .@nmap$, .npcx, .npcy, BL_NPC, strnpcinfo(3);
658 donpcevent strnpcinfo(0)+"::OnViewPoint";
659 enablenpc "ROBR#Mobspawn";
660 donpcevent "ROBR#Mobspawn::OnStart";
661 .timer = 0;
662 initnpctimer;
663 end;
664
665OnTouch:
666 if ( .restricted )
667 {
668 specialeffect2 EF_HEAL;
669 dispbottom "You are in the safe zone", 0xb1e188;
670 }
671 end;
672
673OnTimer1000:
674 .timer++;
675 if ( .timer == 1 )
676 mapannounce strnpcinfo(4), "Area will be restricted in 5 mins.", bc_area|bc_blue;
677 if ( .timer == 120 )
678 mapannounce strnpcinfo(4), "Area will be restricted in 3 mins.", bc_area|bc_blue;
679 if ( .timer == 180 )
680 mapannounce strnpcinfo(4), "Area will be restricted in 2 mins.", bc_area|bc_blue;
681 if ( .timer == 240 )
682 mapannounce strnpcinfo(4), "Area will be restricted in 1 mins.", bc_area|bc_blue;
683 if ( .timer == 240+30 )
684 mapannounce strnpcinfo(4), "Area will be restricted in 30 secs.", bc_area|bc_blue;
685 if ( .timer == 240+50 )
686 mapannounce strnpcinfo(4), "Area will be restricted in 20 secs.", bc_area|bc_blue;
687 if ( .timer == 240+70 )
688 mapannounce strnpcinfo(4), "Area will be restricted in 10 secs.", bc_area|bc_blue;
689 if ( .timer == 240+75 )
690 mapannounce strnpcinfo(4), "Area will be restricted in 5 secs.", bc_area|bc_blue;
691 if ( .timer == 240+76 )
692 mapannounce strnpcinfo(4), "Area will be restricted in 4 secs.", bc_area|bc_blue;
693 if ( .timer == 240+77 )
694 mapannounce strnpcinfo(4), "Area will be restricted in 3 secs.", bc_area|bc_blue;
695 if ( .timer == 240+78 )
696 mapannounce strnpcinfo(4), "Area will be restricted in 2 secs.", bc_area|bc_blue;
697 if ( .timer == 240+79 )
698 mapannounce strnpcinfo(4), "Area will be restricted in 1 secs.", bc_area|bc_blue;
699 if ( .timer == 240+80 ) {
700 .restricted = true;
701 donpcevent strnpcinfo(0)+"::OnRemoveViewPoint";
702 donpcevent strnpcinfo(0)+"::OnViewPoint";
703 enablenpc "#zone_2";
704 donpcevent "#zone_2::OnStart";
705 }
706 if ( .restricted ) donpcevent strnpcinfo(0)+"::OnDangerZone";
707 setnpctimer 0;
708 end;
709
710OnRemoveViewPoint:
711 addrid(1);
712 viewpoint 2, .npcx, .npcy+100, 1, 0x1d9df1;
713 viewpoint 2, .npcx, .npcy-100, 2, 0x1d9df1;
714 viewpoint 2, .npcx+100, .npcy, 3, 0x1d9df1;
715 viewpoint 2, .npcx-100, .npcy, 4, 0x1d9df1;
716 viewpoint 2, .npcx+100, .npcy+100, 5, 0x1d9df1;
717 viewpoint 2, .npcx+100, .npcy-100, 6, 0x1d9df1;
718 viewpoint 2, .npcx-100, .npcy-100, 7, 0x1d9df1;
719 viewpoint 2, .npcx-100, .npcy+100, 8, 0x1d9df1;
720 viewpoint 2, .npcx, .npcy+100, 9, 0xFFFFFF;
721 viewpoint 2, .npcx, .npcy-100, 10, 0xFFFFFF;
722 viewpoint 2, .npcx+100, .npcy, 11, 0xFFFFFF;
723 viewpoint 2, .npcx-100, .npcy, 12, 0xFFFFFF;
724 viewpoint 2, .npcx+100, .npcy+100, 13, 0xFFFFFF;
725 viewpoint 2, .npcx+100, .npcy-100, 14, 0xFFFFFF;
726 viewpoint 2, .npcx-100, .npcy-100, 15, 0xFFFFFF;
727 viewpoint 2, .npcx-100, .npcy+100, 16, 0xFFFFFF;
728 end;
729
730OnViewPoint:
731 addrid(1);
732 if ( .restricted )
733 {
734 viewpoint 1, .npcx, .npcy+100, 1, 0x1d9df1;
735 viewpoint 1, .npcx, .npcy-100, 2, 0x1d9df1;
736 viewpoint 1, .npcx+100, .npcy, 3, 0x1d9df1;
737 viewpoint 1, .npcx-100, .npcy, 4, 0x1d9df1;
738 viewpoint 1, .npcx+100, .npcy+100, 5, 0x1d9df1;
739 viewpoint 1, .npcx+100, .npcy-100, 6, 0x1d9df1;
740 viewpoint 1, .npcx-100, .npcy-100, 7, 0x1d9df1;
741 viewpoint 1, .npcx-100, .npcy+100, 8, 0x1d9df1;
742 } else {
743 viewpoint 1, .npcx, .npcy+100, 9, 0xFFFFFF;
744 viewpoint 1, .npcx, .npcy-100, 10, 0xFFFFFF;
745 viewpoint 1, .npcx+100, .npcy, 11, 0xFFFFFF;
746 viewpoint 1, .npcx-100, .npcy, 12, 0xFFFFFF;
747 viewpoint 1, .npcx+100, .npcy+100, 13, 0xFFFFFF;
748 viewpoint 1, .npcx+100, .npcy-100, 14, 0xFFFFFF;
749 viewpoint 1, .npcx-100, .npcy-100, 15, 0xFFFFFF;
750 viewpoint 1, .npcx-100, .npcy+100, 16, 0xFFFFFF;
751 }
752 end;
753
754OnDangerZone:
755 addrid(1);
756 getmapxy .@pmap$, .@px, .@py, BL_PC;
757 if(distance(.@px, .@py, .npcx, .npcy) > 100 ) {
758 dispbottom "You are in the danger zone!", 0xf13a1d;
759 heal -100, 0;
760 specialeffect2 EF_RED_HIT;
761 specialeffect2 EF_HIT;
762 }
763 end;
764}
765
766league,0,0,0 script #zone_2 111,80,80,{
767end;
768OnInit:
769 disablenpc strnpcinfo(0);
770 end;
771
772OnEnd:
773 stopnpctimer;
774 disablenpc strnpcinfo(0);
775 end;
776
777OnStart:
778 .restricted = false;
779 .location = rand(5);
780 switch(.location) {
781 case 0: .@x = 145; .@y = 145; break;
782 case 1: .@x = 172; .@y = 165; break;
783 case 2: .@x = 118; .@y = 168; break;
784 case 3: .@x = 145; .@y = 190; break;
785 case 4: .@x = 123; .@y = 134; break;
786 case 5: .@x = 173; .@y = 137; break;
787 }
788 movenpc strnpcinfo(0), .@x, .@y;
789 getmapxy .@nmap$, .npcx, .npcy, BL_NPC, strnpcinfo(3);
790 donpcevent strnpcinfo(0)+"::OnViewPoint";
791 .timer = 0;
792 initnpctimer;
793 end;
794
795OnTouch:
796 if ( .restricted )
797 {
798 specialeffect2 EF_HEAL;
799 dispbottom "You are in the safe zone", 0xb1e188;
800 }
801 end;
802
803OnTimer1000:
804 .timer++;
805 if ( .timer == 1 )
806 mapannounce strnpcinfo(4), "Area has been restricted.", bc_area|bc_blue;
807 if ( .timer == 10 )
808 mapannounce strnpcinfo(4), "Area will be restricted in 4 mins.", bc_area|bc_blue;
809 if ( .timer == 60 )
810 mapannounce strnpcinfo(4), "Area will be restricted in 3 mins.", bc_area|bc_blue;
811 if ( .timer == 120 )
812 mapannounce strnpcinfo(4), "Area will be restricted in 2 mins.", bc_area|bc_blue;
813 if ( .timer == 180 )
814 mapannounce strnpcinfo(4), "Area will be restricted in 1 mins.", bc_area|bc_blue;
815 if ( .timer == 180+30 )
816 mapannounce strnpcinfo(4), "Area will be restricted in 30 secs.", bc_area|bc_blue;
817 if ( .timer == 180+50 )
818 mapannounce strnpcinfo(4), "Area will be restricted in 20 secs.", bc_area|bc_blue;
819 if ( .timer == 180+70 )
820 mapannounce strnpcinfo(4), "Area will be restricted in 10 secs.", bc_area|bc_blue;
821 if ( .timer == 180+75 )
822 mapannounce strnpcinfo(4), "Area will be restricted in 5 secs.", bc_area|bc_blue;
823 if ( .timer == 180+76 )
824 mapannounce strnpcinfo(4), "Area will be restricted in 4 secs.", bc_area|bc_blue;
825 if ( .timer == 180+77 )
826 mapannounce strnpcinfo(4), "Area will be restricted in 3 secs.", bc_area|bc_blue;
827 if ( .timer == 180+78 )
828 mapannounce strnpcinfo(4), "Area will be restricted in 2 secs.", bc_area|bc_blue;
829 if ( .timer == 180+79 )
830 mapannounce strnpcinfo(4), "Area will be restricted in 1 secs.", bc_area|bc_blue;
831 if ( .timer == 180+80 ) {
832 .restricted = true;
833 donpcevent "#zone_1::OnRemoveViewPoint";
834 stopnpctimer "#zone_1";
835 donpcevent strnpcinfo(0)+"::OnRemoveViewPoint";
836 donpcevent strnpcinfo(0)+"::OnViewPoint";
837 enablenpc "#zone_3";
838 donpcevent "#zone_3::OnStart";
839 }
840 if ( .restricted ) donpcevent strnpcinfo(0)+"::OnDangerZone";
841 setnpctimer 0;
842 end;
843
844OnRemoveViewPoint:
845 addrid(1);
846 viewpoint 2, .npcx, .npcy+80, 1, 0x1d9df1;
847 viewpoint 2, .npcx, .npcy-80, 2, 0x1d9df1;
848 viewpoint 2, .npcx+80, .npcy, 3, 0x1d9df1;
849 viewpoint 2, .npcx-80, .npcy, 4, 0x1d9df1;
850 viewpoint 2, .npcx+80, .npcy+80, 5, 0x1d9df1;
851 viewpoint 2, .npcx+80, .npcy-80, 6, 0x1d9df1;
852 viewpoint 2, .npcx-80, .npcy-80, 7, 0x1d9df1;
853 viewpoint 2, .npcx-80, .npcy+80, 8, 0x1d9df1;
854 viewpoint 2, .npcx, .npcy+80, 9, 0xFFFFFF;
855 viewpoint 2, .npcx, .npcy-80, 10, 0xFFFFFF;
856 viewpoint 2, .npcx+80, .npcy, 11, 0xFFFFFF;
857 viewpoint 2, .npcx-80, .npcy, 12, 0xFFFFFF;
858 viewpoint 2, .npcx+80, .npcy+80, 13, 0xFFFFFF;
859 viewpoint 2, .npcx+80, .npcy-80, 14, 0xFFFFFF;
860 viewpoint 2, .npcx-80, .npcy-80, 15, 0xFFFFFF;
861 viewpoint 2, .npcx-80, .npcy+80, 16, 0xFFFFFF;
862 end;
863
864OnViewPoint:
865 addrid(1);
866 if ( .restricted )
867 {
868 viewpoint 1, .npcx, .npcy+80, 1, 0x1d9df1;
869 viewpoint 1, .npcx, .npcy-80, 2, 0x1d9df1;
870 viewpoint 1, .npcx+80, .npcy, 3, 0x1d9df1;
871 viewpoint 1, .npcx-80, .npcy, 4, 0x1d9df1;
872 viewpoint 1, .npcx+80, .npcy+80, 5, 0x1d9df1;
873 viewpoint 1, .npcx+80, .npcy-80, 6, 0x1d9df1;
874 viewpoint 1, .npcx-80, .npcy-80, 7, 0x1d9df1;
875 viewpoint 1, .npcx-80, .npcy+80, 8, 0x1d9df1;
876 } else {
877 viewpoint 1, .npcx, .npcy+80, 9, 0xFFFFFF;
878 viewpoint 1, .npcx, .npcy-80, 10, 0xFFFFFF;
879 viewpoint 1, .npcx+80, .npcy, 11, 0xFFFFFF;
880 viewpoint 1, .npcx-80, .npcy, 12, 0xFFFFFF;
881 viewpoint 1, .npcx+80, .npcy+80, 13, 0xFFFFFF;
882 viewpoint 1, .npcx+80, .npcy-80, 14, 0xFFFFFF;
883 viewpoint 1, .npcx-80, .npcy-80, 15, 0xFFFFFF;
884 viewpoint 1, .npcx-80, .npcy+80, 16, 0xFFFFFF;
885 }
886 end;
887
888OnDangerZone:
889 addrid(1);
890 getmapxy .@pmap$, .@px, .@py, BL_PC;
891 if(distance(.@px, .@py, .npcx, .npcy) > 80 ) {
892 dispbottom "You are in the danger zone!", 0xf13a1d;
893 heal -120, 0;
894 specialeffect2 EF_RED_HIT;
895 specialeffect2 EF_HIT;
896 }
897 end;
898}
899
900league,0,0,0 script #zone_3 111,60,60,{
901end;
902OnInit:
903 disablenpc strnpcinfo(0);
904 end;
905
906OnEnd:
907 stopnpctimer;
908 disablenpc strnpcinfo(0);
909 end;
910
911OnStart:
912 .restricted = false;
913 .location = rand(5);
914 switch(.location) {
915 case 0: .@x = 145; .@y = 145; break;
916 case 1: .@x = 172; .@y = 165; break;
917 case 2: .@x = 118; .@y = 168; break;
918 case 3: .@x = 145; .@y = 190; break;
919 case 4: .@x = 123; .@y = 134; break;
920 case 5: .@x = 173; .@y = 137; break;
921 }
922 movenpc strnpcinfo(0), .@x, .@y;
923 getmapxy .@nmap$, .npcx, .npcy, BL_NPC, strnpcinfo(3);
924 donpcevent strnpcinfo(0)+"::OnViewPoint";
925 .timer = 0;
926 initnpctimer;
927 end;
928
929OnTouch:
930 if ( .restricted )
931 {
932 specialeffect2 EF_HEAL;
933 dispbottom "You are in the safe zone", 0xb1e188;
934 }
935 end;
936
937OnTimer1000:
938 .timer++;
939 if ( .timer == 1 )
940 mapannounce strnpcinfo(4), "Area has been restricted.", bc_area|bc_blue;
941 if ( .timer == 10 )
942 mapannounce strnpcinfo(4), "Area will be restricted in 3 mins.", bc_area|bc_blue;
943 if ( .timer == 60 )
944 mapannounce strnpcinfo(4), "Area will be restricted in 2 mins.", bc_area|bc_blue;
945 if ( .timer == 120 )
946 mapannounce strnpcinfo(4), "Area will be restricted in 1 mins.", bc_area|bc_blue;
947 if ( .timer == 120+30 )
948 mapannounce strnpcinfo(4), "Area will be restricted in 30 secs.", bc_area|bc_blue;
949 if ( .timer == 120+50 )
950 mapannounce strnpcinfo(4), "Area will be restricted in 20 secs.", bc_area|bc_blue;
951 if ( .timer == 120+70 )
952 mapannounce strnpcinfo(4), "Area will be restricted in 10 secs.", bc_area|bc_blue;
953 if ( .timer == 120+75 )
954 mapannounce strnpcinfo(4), "Area will be restricted in 5 secs.", bc_area|bc_blue;
955 if ( .timer == 120+76 )
956 mapannounce strnpcinfo(4), "Area will be restricted in 4 secs.", bc_area|bc_blue;
957 if ( .timer == 120+77 )
958 mapannounce strnpcinfo(4), "Area will be restricted in 3 secs.", bc_area|bc_blue;
959 if ( .timer == 120+78 )
960 mapannounce strnpcinfo(4), "Area will be restricted in 2 secs.", bc_area|bc_blue;
961 if ( .timer == 120+79 )
962 mapannounce strnpcinfo(4), "Area will be restricted in 1 secs.", bc_area|bc_blue;
963 if ( .timer == 120+80 ) {
964 .restricted = true;
965 donpcevent "#zone_2::OnRemoveViewPoint";
966 stopnpctimer "#zone_2";
967 donpcevent strnpcinfo(0)+"::OnRemoveViewPoint";
968 donpcevent strnpcinfo(0)+"::OnViewPoint";
969 enablenpc "#zone_4";
970 donpcevent "#zone_4::OnStart";
971 }
972 if ( .restricted ) donpcevent strnpcinfo(0)+"::OnDangerZone";
973 setnpctimer 0;
974 end;
975
976OnRemoveViewPoint:
977 addrid(1);
978 viewpoint 2, .npcx, .npcy+60, 1, 0x1d9df1;
979 viewpoint 2, .npcx, .npcy-60, 2, 0x1d9df1;
980 viewpoint 2, .npcx+60, .npcy, 3, 0x1d9df1;
981 viewpoint 2, .npcx-60, .npcy, 4, 0x1d9df1;
982 viewpoint 2, .npcx+60, .npcy+60, 5, 0x1d9df1;
983 viewpoint 2, .npcx+60, .npcy-60, 6, 0x1d9df1;
984 viewpoint 2, .npcx-60, .npcy-60, 7, 0x1d9df1;
985 viewpoint 2, .npcx-60, .npcy+60, 8, 0x1d9df1;
986 viewpoint 2, .npcx, .npcy+60, 9, 0xFFFFFF;
987 viewpoint 2, .npcx, .npcy-60, 10, 0xFFFFFF;
988 viewpoint 2, .npcx+60, .npcy, 11, 0xFFFFFF;
989 viewpoint 2, .npcx-60, .npcy, 12, 0xFFFFFF;
990 viewpoint 2, .npcx+60, .npcy+60, 13, 0xFFFFFF;
991 viewpoint 2, .npcx+60, .npcy-60, 14, 0xFFFFFF;
992 viewpoint 2, .npcx-60, .npcy-60, 15, 0xFFFFFF;
993 viewpoint 2, .npcx-60, .npcy+60, 16, 0xFFFFFF;
994 end;
995
996OnViewPoint:
997 addrid(1);
998 if ( .restricted )
999 {
1000 viewpoint 1, .npcx, .npcy+60, 1, 0x1d9df1;
1001 viewpoint 1, .npcx, .npcy-60, 2, 0x1d9df1;
1002 viewpoint 1, .npcx+60, .npcy, 3, 0x1d9df1;
1003 viewpoint 1, .npcx-60, .npcy, 4, 0x1d9df1;
1004 viewpoint 1, .npcx+60, .npcy+60, 5, 0x1d9df1;
1005 viewpoint 1, .npcx+60, .npcy-60, 6, 0x1d9df1;
1006 viewpoint 1, .npcx-60, .npcy-60, 7, 0x1d9df1;
1007 viewpoint 1, .npcx-60, .npcy+60, 8, 0x1d9df1;
1008 } else {
1009 viewpoint 1, .npcx, .npcy+60, 9, 0xFFFFFF;
1010 viewpoint 1, .npcx, .npcy-60, 10, 0xFFFFFF;
1011 viewpoint 1, .npcx+60, .npcy, 11, 0xFFFFFF;
1012 viewpoint 1, .npcx-60, .npcy, 12, 0xFFFFFF;
1013 viewpoint 1, .npcx+60, .npcy+60, 13, 0xFFFFFF;
1014 viewpoint 1, .npcx+60, .npcy-60, 14, 0xFFFFFF;
1015 viewpoint 1, .npcx-60, .npcy-60, 15, 0xFFFFFF;
1016 viewpoint 1, .npcx-60, .npcy+60, 16, 0xFFFFFF;
1017 }
1018 end;
1019
1020OnDangerZone:
1021 addrid(1);
1022 getmapxy .@pmap$, .@px, .@py, BL_PC;
1023 if(distance(.@px, .@py, .npcx, .npcy) > 60 ) {
1024 dispbottom "You are in the danger zone!", 0xf13a1d;
1025 heal -150, 0;
1026 specialeffect2 EF_RED_HIT;
1027 specialeffect2 EF_HIT;
1028 }
1029 end;
1030
1031}
1032
1033league,0,0,0 script #zone_4 111,40,40,{
1034end;
1035OnInit:
1036 disablenpc strnpcinfo(0);
1037 end;
1038
1039OnEnd:
1040 stopnpctimer;
1041 disablenpc strnpcinfo(0);
1042 end;
1043
1044OnStart:
1045 .restricted = false;
1046 .location = rand(5);
1047 switch(.location) {
1048 case 0: .@x = 145; .@y = 145; break;
1049 case 1: .@x = 172; .@y = 165; break;
1050 case 2: .@x = 118; .@y = 168; break;
1051 case 3: .@x = 145; .@y = 190; break;
1052 case 4: .@x = 123; .@y = 134; break;
1053 case 5: .@x = 173; .@y = 137; break;
1054 }
1055 movenpc strnpcinfo(0), .@x, .@y;
1056 getmapxy .@nmap$, .npcx, .npcy, BL_NPC, strnpcinfo(3);
1057 donpcevent strnpcinfo(0)+"::OnViewPoint";
1058 .timer = 0;
1059 initnpctimer;
1060 end;
1061
1062OnTouch:
1063 if ( .restricted )
1064 {
1065 specialeffect2 EF_HEAL;
1066 dispbottom "You are in the safe zone", 0xb1e188;
1067 }
1068 end;
1069
1070OnTimer1000:
1071 .timer++;
1072 if ( .timer == 1 )
1073 mapannounce strnpcinfo(4), "Area has been restricted.", bc_area|bc_blue;
1074 if ( .timer == 10 )
1075 mapannounce strnpcinfo(4), "Area will be restricted in 2 mins.", bc_area|bc_blue;
1076 if ( .timer == 60 )
1077 mapannounce strnpcinfo(4), "Area will be restricted in 1 mins.", bc_area|bc_blue;
1078 if ( .timer == 60+30 )
1079 mapannounce strnpcinfo(4), "Area will be restricted in 30 secs.", bc_area|bc_blue;
1080 if ( .timer == 60+50 )
1081 mapannounce strnpcinfo(4), "Area will be restricted in 20 secs.", bc_area|bc_blue;
1082 if ( .timer == 60+70 )
1083 mapannounce strnpcinfo(4), "Area will be restricted in 10 secs.", bc_area|bc_blue;
1084 if ( .timer == 60+75 )
1085 mapannounce strnpcinfo(4), "Area will be restricted in 5 secs.", bc_area|bc_blue;
1086 if ( .timer == 60+76 )
1087 mapannounce strnpcinfo(4), "Area will be restricted in 4 secs.", bc_area|bc_blue;
1088 if ( .timer == 60+77 )
1089 mapannounce strnpcinfo(4), "Area will be restricted in 3 secs.", bc_area|bc_blue;
1090 if ( .timer == 60+78 )
1091 mapannounce strnpcinfo(4), "Area will be restricted in 2 secs.", bc_area|bc_blue;
1092 if ( .timer == 60+79 )
1093 mapannounce strnpcinfo(4), "Area will be restricted in 1 secs.", bc_area|bc_blue;
1094 if ( .timer == 60+80 ) {
1095 .restricted = true;
1096 donpcevent "#zone_3::OnRemoveViewPoint";
1097 stopnpctimer "#zone_3";
1098 donpcevent strnpcinfo(0)+"::OnRemoveViewPoint";
1099 donpcevent strnpcinfo(0)+"::OnViewPoint";
1100 enablenpc "#zone_5";
1101 donpcevent "#zone_5::OnStart";
1102 }
1103 if ( .restricted ) donpcevent strnpcinfo(0)+"::OnDangerZone";
1104 setnpctimer 0;
1105 end;
1106
1107OnRemoveViewPoint:
1108 addrid(1);
1109 viewpoint 2, .npcx, .npcy+40, 1, 0x1d9df1;
1110 viewpoint 2, .npcx, .npcy-40, 2, 0x1d9df1;
1111 viewpoint 2, .npcx+40, .npcy, 3, 0x1d9df1;
1112 viewpoint 2, .npcx-40, .npcy, 4, 0x1d9df1;
1113 viewpoint 2, .npcx+40, .npcy+40, 5, 0x1d9df1;
1114 viewpoint 2, .npcx+40, .npcy-40, 6, 0x1d9df1;
1115 viewpoint 2, .npcx-40, .npcy-40, 7, 0x1d9df1;
1116 viewpoint 2, .npcx-40, .npcy+40, 8, 0x1d9df1;
1117 viewpoint 2, .npcx, .npcy+40, 9, 0xFFFFFF;
1118 viewpoint 2, .npcx, .npcy-40, 10, 0xFFFFFF;
1119 viewpoint 2, .npcx+40, .npcy, 11, 0xFFFFFF;
1120 viewpoint 2, .npcx-40, .npcy, 12, 0xFFFFFF;
1121 viewpoint 2, .npcx+40, .npcy+40, 13, 0xFFFFFF;
1122 viewpoint 2, .npcx+40, .npcy-40, 14, 0xFFFFFF;
1123 viewpoint 2, .npcx-40, .npcy-40, 15, 0xFFFFFF;
1124 viewpoint 2, .npcx-40, .npcy+40, 16, 0xFFFFFF;
1125 end;
1126
1127OnViewPoint:
1128 addrid(1);
1129 if ( .restricted )
1130 {
1131 viewpoint 1, .npcx, .npcy+40, 1, 0x1d9df1;
1132 viewpoint 1, .npcx, .npcy-40, 2, 0x1d9df1;
1133 viewpoint 1, .npcx+40, .npcy, 3, 0x1d9df1;
1134 viewpoint 1, .npcx-40, .npcy, 4, 0x1d9df1;
1135 viewpoint 1, .npcx+40, .npcy+40, 5, 0x1d9df1;
1136 viewpoint 1, .npcx+40, .npcy-40, 6, 0x1d9df1;
1137 viewpoint 1, .npcx-40, .npcy-40, 7, 0x1d9df1;
1138 viewpoint 1, .npcx-40, .npcy+40, 8, 0x1d9df1;
1139 } else {
1140 viewpoint 1, .npcx, .npcy+40, 9, 0xFFFFFF;
1141 viewpoint 1, .npcx, .npcy-40, 10, 0xFFFFFF;
1142 viewpoint 1, .npcx+40, .npcy, 11, 0xFFFFFF;
1143 viewpoint 1, .npcx-40, .npcy, 12, 0xFFFFFF;
1144 viewpoint 1, .npcx+40, .npcy+40, 13, 0xFFFFFF;
1145 viewpoint 1, .npcx+40, .npcy-40, 14, 0xFFFFFF;
1146 viewpoint 1, .npcx-40, .npcy-40, 15, 0xFFFFFF;
1147 viewpoint 1, .npcx-40, .npcy+40, 16, 0xFFFFFF;
1148 }
1149 end;
1150
1151OnDangerZone:
1152 addrid(1);
1153 getmapxy .@pmap$, .@px, .@py, BL_PC;
1154 if(distance(.@px, .@py, .npcx, .npcy) > 40 ) {
1155 dispbottom "You are in the danger zone!", 0xf13a1d;
1156 heal -200, 0;
1157 specialeffect2 EF_RED_HIT;
1158 specialeffect2 EF_HIT;
1159 }
1160 end;
1161}
1162
1163league,0,0,0 script #zone_5 111,20,20,{
1164end;
1165OnInit:
1166 disablenpc strnpcinfo(0);
1167 end;
1168
1169OnEnd:
1170 stopnpctimer;
1171 disablenpc strnpcinfo(0);
1172 end;
1173
1174OnStart:
1175 .restricted = false;
1176 .location = rand(5);
1177 switch(.location) {
1178 case 0: .@x = 145; .@y = 145; break;
1179 case 1: .@x = 172; .@y = 165; break;
1180 case 2: .@x = 118; .@y = 168; break;
1181 case 3: .@x = 145; .@y = 190; break;
1182 case 4: .@x = 123; .@y = 134; break;
1183 case 5: .@x = 173; .@y = 137; break;
1184 }
1185 movenpc strnpcinfo(0), .@x, .@y;
1186 getmapxy .@nmap$, .npcx, .npcy, BL_NPC, strnpcinfo(3);
1187 donpcevent strnpcinfo(0)+"::OnViewPoint";
1188 .timer = 0;
1189 initnpctimer;
1190 end;
1191
1192OnTouch:
1193 if ( .restricted )
1194 {
1195 specialeffect2 EF_HEAL;
1196 dispbottom "You are in the safe zone", 0xb1e188;
1197 }
1198 end;
1199
1200OnTimer1000:
1201 .timer++;
1202 if ( .timer == 1 )
1203 mapannounce strnpcinfo(4), "Area has been restricted.", bc_area|bc_blue;
1204 if ( .timer == 10 )
1205 mapannounce strnpcinfo(4), "Area will be restricted in 2 mins.", bc_area|bc_blue;
1206 if ( .timer == 60 )
1207 mapannounce strnpcinfo(4), "Area will be restricted in 1 mins.", bc_area|bc_blue;
1208 if ( .timer == 60+30 )
1209 mapannounce strnpcinfo(4), "Area will be restricted in 30 secs.", bc_area|bc_blue;
1210 if ( .timer == 60+50 )
1211 mapannounce strnpcinfo(4), "Area will be restricted in 20 secs.", bc_area|bc_blue;
1212 if ( .timer == 60+70 )
1213 mapannounce strnpcinfo(4), "Area will be restricted in 10 secs.", bc_area|bc_blue;
1214 if ( .timer == 60+75 )
1215 mapannounce strnpcinfo(4), "Area will be restricted in 5 secs.", bc_area|bc_blue;
1216 if ( .timer == 60+76 )
1217 mapannounce strnpcinfo(4), "Area will be restricted in 4 secs.", bc_area|bc_blue;
1218 if ( .timer == 60+77 )
1219 mapannounce strnpcinfo(4), "Area will be restricted in 3 secs.", bc_area|bc_blue;
1220 if ( .timer == 60+78 )
1221 mapannounce strnpcinfo(4), "Area will be restricted in 2 secs.", bc_area|bc_blue;
1222 if ( .timer == 60+79 )
1223 mapannounce strnpcinfo(4), "Area will be restricted in 1 secs.", bc_area|bc_blue;
1224 if ( .timer == 60+80 ) {
1225 .restricted = true;
1226 donpcevent "#zone_4::OnRemoveViewPoint";
1227 stopnpctimer "#zone_4";
1228 donpcevent strnpcinfo(0)+"::OnRemoveViewPoint";
1229 donpcevent strnpcinfo(0)+"::OnViewPoint";
1230 }
1231 if ( .restricted ) donpcevent strnpcinfo(0)+"::OnDangerZone";
1232 setnpctimer 0;
1233 end;
1234
1235OnRemoveViewPoint:
1236 addrid(1);
1237 viewpoint 2, .npcx, .npcy+20, 1, 0x1d9df1;
1238 viewpoint 2, .npcx, .npcy-20, 2, 0x1d9df1;
1239 viewpoint 2, .npcx+20, .npcy, 3, 0x1d9df1;
1240 viewpoint 2, .npcx-20, .npcy, 4, 0x1d9df1;
1241 viewpoint 2, .npcx+20, .npcy+20, 5, 0x1d9df1;
1242 viewpoint 2, .npcx+20, .npcy-20, 6, 0x1d9df1;
1243 viewpoint 2, .npcx-20, .npcy-20, 7, 0x1d9df1;
1244 viewpoint 2, .npcx-20, .npcy+20, 8, 0x1d9df1;
1245 viewpoint 2, .npcx, .npcy+20, 9, 0xFFFFFF;
1246 viewpoint 2, .npcx, .npcy-20, 10, 0xFFFFFF;
1247 viewpoint 2, .npcx+20, .npcy, 11, 0xFFFFFF;
1248 viewpoint 2, .npcx-20, .npcy, 12, 0xFFFFFF;
1249 viewpoint 2, .npcx+20, .npcy+20, 13, 0xFFFFFF;
1250 viewpoint 2, .npcx+20, .npcy-20, 14, 0xFFFFFF;
1251 viewpoint 2, .npcx-20, .npcy-20, 15, 0xFFFFFF;
1252 viewpoint 2, .npcx-20, .npcy+20, 16, 0xFFFFFF;
1253 end;
1254
1255OnViewPoint:
1256 addrid(1);
1257 if ( .restricted )
1258 {
1259 viewpoint 1, .npcx, .npcy+20, 1, 0x1d9df1;
1260 viewpoint 1, .npcx, .npcy-20, 2, 0x1d9df1;
1261 viewpoint 1, .npcx+20, .npcy, 3, 0x1d9df1;
1262 viewpoint 1, .npcx-20, .npcy, 4, 0x1d9df1;
1263 viewpoint 1, .npcx+20, .npcy+20, 5, 0x1d9df1;
1264 viewpoint 1, .npcx+20, .npcy-20, 6, 0x1d9df1;
1265 viewpoint 1, .npcx-20, .npcy-20, 7, 0x1d9df1;
1266 viewpoint 1, .npcx-20, .npcy+20, 8, 0x1d9df1;
1267 } else {
1268 viewpoint 1, .npcx, .npcy+20, 9, 0xFFFFFF;
1269 viewpoint 1, .npcx, .npcy-20, 10, 0xFFFFFF;
1270 viewpoint 1, .npcx+20, .npcy, 11, 0xFFFFFF;
1271 viewpoint 1, .npcx-20, .npcy, 12, 0xFFFFFF;
1272 viewpoint 1, .npcx+20, .npcy+20, 13, 0xFFFFFF;
1273 viewpoint 1, .npcx+20, .npcy-20, 14, 0xFFFFFF;
1274 viewpoint 1, .npcx-20, .npcy-20, 15, 0xFFFFFF;
1275 viewpoint 1, .npcx-20, .npcy+20, 16, 0xFFFFFF;
1276 }
1277 end;
1278
1279OnDangerZone:
1280 addrid(1);
1281 getmapxy .@pmap$, .@px, .@py, BL_PC;
1282 if(distance(.@px, .@py, .npcx, .npcy) > 20 ) {
1283 dispbottom "You are in the danger zone!", 0xf13a1d;
1284 heal -250, 0;
1285 specialeffect2 EF_RED_HIT;
1286 specialeffect2 EF_HIT;
1287 }
1288 end;
1289
1290}
1291
1292function script fWalkable {
1293 .@map$ = getarg(0);
1294 freeloop(1);
1295 do {
1296 .@rXr = rand(getarg(1));
1297 .@rYr = rand(getarg(2,getarg(1)));
1298 }
1299 while (checkcell(.@map$,.@rXr,.@rYr,cell_chkwall)
1300 || checkcell(.@map$,.@rXr,.@rYr,cell_chkcliff)
1301 || checkcell(.@map$,.@rXr,.@rYr,cell_chknopass)
1302 || checkcell(.@map$,.@rXr,.@rYr,cell_chknoreach));
1303
1304 return (.@rXr<<12)+.@rYr;
1305}
1306
1307- script Kaboom 111,{
1308end;
1309OnTouch:
1310 .@start_ = getvariableofnpc(.start ,"robr#main");
1311 if ( .@start_ == false ) end;
1312 atcommand "@nuke " + strcharinfo(0);
1313 mapannounce strnpcinfo(4), strcharinfo(0) +" was easily taken off by a landmine! Be careful!", bc_area|bc_blue;
1314 disablenpc strnpcinfo(0);
1315 movenpc strnpcinfo(0), 0, 0;
1316 end;
1317
1318S_MoveNPC:
1319 explode(.@tmp_ary$,strnpcinfo(2),"|");
1320 .@walkable_xy = fWalkable(strnpcinfo(4), atoi(.@tmp_ary$[0]), atoi(.@tmp_ary$[1]));
1321 .@y = .@walkable_xy & 4095;
1322 .@x = .@walkable_xy >> 12;
1323 movenpc strnpcinfo(0), .@x, .@y;
1324 enablenpc strnpcinfo(0);
1325 sleep 60000;
1326 callsub S_MoveNPC;
1327
1328OnInit:
1329 disablenpc strnpcinfo(0);
1330 if( strnpcinfo(2) != "" )
1331 callsub S_MoveNPC;
1332}
1333
1334// landmines
1335league,0,0,0 duplicate(Kaboom) 1#300|300 111,2,2
1336league,0,0,0 duplicate(Kaboom) 2#300|300 111,2,2
1337league,0,0,0 duplicate(Kaboom) 3#300|300 111,2,2
1338league,0,0,0 duplicate(Kaboom) 4#300|300 111,2,2
1339league,0,0,0 duplicate(Kaboom) 5#300|300 111,2,2