OSDN Git Service

First version
[st-ro/stro.git] / npc / re / instances / HorrorToyFactory.txt
1 //===== rAthena Script =======================================
2 //= Horror Toy Factory
3 //===== Description: =========================================
4 //= [Official Conversion]
5 //= Horror Toy Factory Instance
6 //===== Changelogs: ==========================================
7 //= 1.0 First version. Uses official script structure and text
8 //=     from iRO. [Capuche]
9 //============================================================
10
11 xmas,237,303,3  script  Catherine Jet Johnson   4_F_SKULL06GIRL,{
12         if (getstatus(SC_MONSTER_TRANSFORM,1) > 0) {
13                 mes "[Catherine Jet Johnson]";
14                 mes "Aaa.. Are you going to go into there?";
15                 next;
16                 mes "[Catherine Jet Johnson]";
17                 mes "You'd better release your transformation if you'd like to enter. It could be dangerous in some ways.";
18                 close;
19         }
20
21         if (BaseLevel < 140) {
22                 mes "[Catherine Jet Johnson]";
23                 mes "Ah, wait! Please wait. This is not a good place for a promising young "+ ( Sex ? "man" : "woman" ) +" like you!";
24                 next;
25                 mes "[Catherine Jet Johnson]";
26                 mes "If you must, come back later after you become far stronger. Hmmm.. I would say.. Lv.140?";
27                 close;
28         }
29
30         mes "^ff0000Be cautious taming or other ways than hunting monsters are not considered as normal killing counts.^000000";
31         next;
32         mes "[Catherine Jet Johnson]";
33         switch( isbegin_quest(12330) ) {
34         case 0:
35                 mes "Do.. Don't be afraid of me. Now I look ugly, but I wasn't like this before.";
36                 next;
37                 mes "^0000ffThe skull-faced girl in front of you is speaking in a tearful voice. Void holes where there should be eyes are staring at you.^000000";
38                 next;
39                 select("What's wrong with your face?");
40                 mes "[Catherine Jet Johnson]";
41                 mes "This is a long story.. Would you mind if I talk to you? If you waste your time on someone like me?";
42                 next;
43                 if (select( "Quit.", "Please keep talking." ) == 1) {
44                         mes "[Catherine Jet Johnson]";
45                         mes "Okay, take care of yourself. And don't ever come near that odd entrance.";
46                         close;
47                 }
48                 mes "[Catherine Jet Johnson]";
49                 mes "Mmm.. Where should I start.. The story of this town first?...";
50                 next;
51                 mes "^0000ffWith a sigh, the girl begins to speak in a subdued tone like a bard who tells an old story.^000000";
52                 next;
53                 mes "[Catherine Jet Johnson]";
54                 mes "There was a toy factory in this town. All of the people in this town work there and I was one of the employees.";
55                 next;
56                 mes "[Catherine Jet Johnson]";
57                 mes "We all were happy in the beginning. We used to gather around together and have a friendly chat having gingerbread and hot tea after work.";
58                 next;
59                 select("I couldn't even imagine, seeing this mood...");
60                 mes "[Catherine Jet Johnson]";
61                 mes "Yes, because we couldn't earn a livng by packaging toys forever. The situations got tough after the villagers left in ones and twos.";
62                 next;
63                 mes "[Catherine Jet Johnson]";
64                 mes "I was the one who worked as an assistant beside the doll craftsman who made dolls to the end.";
65                 next;
66                 mes "^0000ffI could feel her slender jawbone is trembling due to the subtle change of her emotion.^000000";
67                 next;
68                 select("Ask her to continue.");
69                 mes "[Catherine Jet Johnson]";
70                 mes "On the day when the factory is decided to be closed, the doll maker dressed the last doll he made and shed tears.";
71                 next;
72                 mes "[Catherine Jet Johnson]";
73                 mes "Perhaps he thought he wouldn't make a doll anymore.";
74                 next;
75                 mes "[Catherine Jet Johnson]";
76                 mes "He named the last doll ^0000ffCeline Kimi^000000 and stopped all the lines in the factory.";
77                 next;
78                 select("Did he give a doll a name?");
79                 mes "[Catherine Jet Johnson]";
80                 mes "Sometimes there can be the work as if it were their child to doll makers. Kimi was the one for him.";
81                 next;
82                 mes "[Catherine Jet Johnson]";
83                 mes "I guess his earnestness breathed life to Kimi.";
84                 next;
85                 select("Do you mean the doll is alive?");
86                 mes "[Catherine Jet Johnson]";
87                 mes "Yes, ^0000ffShe^000000 became a living creature. I don't know the reason, but she is striding in the toy factory with heavy sorrow and rage.";
88                 next;
89                 mes "[Catherine Jet Johnson]";
90                 mes "When I first saw her, she was standing beside the doll maker who died and collapsed. She stood there with an unknowable expression.";
91                 next;
92                 mes "[Catherine Jet Johnson]";
93                 mes "That's the end. I was outside when I woke up again after I had been blacked out. My face has become like this.";
94                 next;
95                 select("Did Kimi do that?");
96                 mes "[Catherine Jet Johnson]";
97                 mes "I don't know.. She would do it, or it could be a different problem. I have no memory with this.";
98                 next;
99                 select("Do you blame her?");
100                 mes "[Catherine Jet Johnson]";
101                 mes "Ah, no. I don't blame her! I just want to know what happened to the doll craftsman on that day.";
102                 next;
103                 mes "[Catherine Jet Johnson]";
104                 mes "I don't think the scene I saw was everything. However, getting into the factory again is.. Re-entering there is...";
105                 next;
106                 mes "[Catherine Jet Johnson]";
107                 mes "Yes, I am scared and reluctant to do it. If there's someone who can help me..";
108                 next;
109                 if (select( "I am not very helpful to you.", "Maybe I can help you with it." ) == 1) {
110                         mes "[Catherine Jet Johnson]";
111                         mes "Thank you for.. for listening to me. Hope you will enjoy your trip..";
112                         close;
113                 }
114                 mes "[Catherine Jet Johnson]";
115                 mes "Heh? You would do me a favor?";
116                 next;
117                 select("Let's get into the factory with me.");
118                 mes "[Catherine Jet Johnson]";
119                 mes "We.. Well, I cannot help you at all except for providing you with directions. Besides, there can be a big danger to you.";
120                 next;
121                 select("You can reunite with Kimi, can't you?");
122                 mes "[Catherine Jet Johnson]";
123                 mes "Kimi, you mean Kimi..";
124                 next;
125                 mes "^0000ffShe is thinking about something intently with gaping eyes.^000000";
126                 next;
127                 mes "[Catherine Jet Johnson]";
128                 mes "I.. I've decided. It won't be a great help to you, but I can simply let you know the directions.";
129                 next;
130                 mes "[Catherine Jet Johnson]";
131                 mes "Wait, please wait until I am prepared. I can guide you when I am ready.";
132                 setquest 12330;// Skull-faced Girl
133                 close;
134         case 1:
135                 mes "Done. Let me try to open the closed door.";
136                 completequest 12330;
137                 break;
138         case 2:
139                 mes "Kimi's soul is still staying in this ground. When I can let her rest in peace...";
140                 break;
141         }
142         next;
143         if (getcharid(1) < 1) {
144                 mes "^0000ffYou need to organize a party having more than a member to get into Horror Toy Factory.^000000";
145                 close;
146         }
147         switch( checkquest(12331,PLAYTIME) ) {
148         case -1:
149                 if (getpartyleader(getcharid(1),2) != getcharid(0)) {
150                         mes "[Catherine Jet Johnson]";
151                         mes "Eh.. Give me a second. I am talking to the person in charge. Please wait for a while.";
152                         close;
153                 }
154                 if (select( "Unlock Horror Toy Factory", "Cancel" ) == 1) {
155                         mes "Door will be.. opened soon.. Would you wait for a moment?";
156                         if (instance_create("Horror Toy Factory") >= 0)
157                                 'xm_d_map$ = instance_mapname("1@xm_d");
158                 }
159                 close;
160         case 0:
161         case 1:
162                 mes "[Catherine Jet Johnson]";
163                 mes "The smell of preservative from the factory has not been going away. You cannot stand longer there under this state.";
164                 next;
165                 mes "[Catherine Jet Johnson]";
166                 mes "I will keep you from entering before the scent of preservative is completely gone away.";
167                 close;
168         case 2:
169                 mes "^0000ffThe smell of preservative has gone away. You can talk to Catherine Jet Johnson.^000000";
170                 erasequest 12331;
171                 close;
172         }
173 }
174
175 xmas,233,305,4  script  Factory Dimension Telep PORTAL,{
176         if (getstatus(SC_MONSTER_TRANSFORM,1) > 0) {
177                 mes "[Factory Dimension Teleporter]";
178                 mes "There are some work study programs as monster workers during the Horror Toy Factory tour. Therefore, ^ff0000You are limited to enter when you are in transformation.^000000";
179                 close;
180         }
181         if (BaseLevel < 140) {
182                 mes "[Factory Dimension Teleporter]";
183                 mes "You are not eligible for dimensional shifting. You should be at least Lv.140.";
184                 close;
185         }
186         if (getcharid(1) < 1) {
187                 mes "[Factory Dimension Teleporter]";
188                 mes "You don't have any fellows? Please organize a party and come again if you go alone.";
189                 close;
190         }
191         switch( checkquest(12331,PLAYTIME) ) {
192         case -1:
193                 switch( instance_enter("Horror Toy Factory") ) {
194                 case 3:
195                         mes "An unknown error has occurred.";
196                         close;
197                 case 2:
198                         mes "The gateway for dimensional shifting has not been activated.";
199                         close;
200                 case 1:// dummy
201                         mes "[Factory Dimension Teleporter]";
202                         mes "You don't have any fellows? Please organize a party and come again if you go alone.";
203                         close;
204                 case 0:
205                         mapannounce "xmas", getpartyname( getcharid(1) ) +" party's party member "+ strcharinfo(0) +" enters Horror Toy Factory.", bc_map, "0x00ff99";
206                         setquest 12331;// Trail of Toy Factory
207                         end;
208                 }
209         case 0:
210         case 1:
211                 mes "You already have a trail of dimensional shifting. Your access has been denied.";
212                 close;
213         case 2:
214                 mes "^0000ffThe trail of dimensional shifting disappeared. You are allowed to use Factory Dimension Teleporter.^000000";
215                 erasequest 12331;
216                 close;
217         }
218 }
219
220 1@xm_d,112,20,6 script  Catherine Jet Johnson#0 4_F_SKULL06GIRL,{
221         if (getstatus(SC_MONSTER_TRANSFORM,1) > 0) {
222                 mes "[Catherine Jet Johnson]";
223                 mes "You cannot come to here if you are under the effect of a monstre transformation.";
224                 next;
225                 mes "[Catherine Jet Johnson]";
226                 mes "Please wait until the transformation is finished. You cannot move to another area before you become normal.";
227                 close;
228         }
229         if (getpartyleader(getcharid(1),2) != getcharid(0)) {
230                 mes "[Catherine Jet Johnson]";
231                 mes "Eh.. Give me a second. I am talking to the person in charge. Please wait.";
232                 close;
233         }
234         mes "[Catherine Jet Johnson]";
235         mes "Everyone is in their mortal corruptible state right?";
236         npctalk "Catherine Jet Johnson: Everyone is in their mortal corruptible state right?";
237         next;
238         switch( select( "Quit the story", "Listen to her story.", "I know your situation. Let's start quickly!" ) ) {
239         case 1:
240                 mes "[Catherine Jet Johnson]";
241                 mes "Oh, dear. Let me know when you are ready.";
242                 close;
243         case 2:
244                 donpcevent instance_npcname("Catherine Jet Johnson#01") + "::OnStart";
245                 close;
246         case 3:
247                 donpcevent instance_npcname("Catherine Jet Johnson#01") + "::OnStart2";
248                 close;
249         }
250 }
251
252 1@xm_d,112,20,1 script  Catherine Jet Johnson#01        4_F_SKULL06GIRL,{
253         end;
254 OnStart:
255         enablenpc instance_npcname("#bgm01");
256         enablenpc instance_npcname("Catherine Jet Johnson#01");
257         disablenpc instance_npcname("Catherine Jet Johnson#0");
258         sleep 3000;
259         npctalk "Catherine Jet Johnson: This area was Factory No.1. It used to be the place where the toys and dolls were stored before given as presents.";
260         sleep 5000;
261         npctalk "Catherine Jet Johnson: Ah, I remember several things. If someone wasn't in the employee's uniform, the guards used to come and scold them....";
262         sleep 5000;
263         npctalk "Catherine Jet Johnson: By the way...";
264         donpcevent instance_npcname("#fac1ct") + "::OnStart";
265         sleep 3000;
266         mapannounce 'xm_d_map$, "Factory announcement: Wake up, toy factory working time has come...", bc_map, "0x00ff44";
267         sleep 6000;
268         npctalk "Catherine Jet Johnson: Wh.. What happened? Toys and dolls are wandering instead of human workers. As if they are employees...";
269         sleep 5000;
270         npctalk "Catherine Jet Johnson: I think other spirits have inhabited the empty factory for too long.";
271         sleep 3000;
272         mapannounce 'xm_d_map$, "Factory announcement: Waste and other debries should be kept clear from work areas. This is to keep you safe at all times.", bc_map, "0x00ff44";
273         sleep 3000;
274         npctalk "Catherine Jet Johnson: It's just like when humans worked here.";
275         sleep 3000;
276         mapannounce 'xm_d_map$, "Factory announcement: Let's make presents for every child's dream today.", bc_map, "0x00ff44";
277         sleep 3000;
278         npctalk "Catherine Jet Johnson: But, it's not the time to be happy. Once we find the last factory area, we will need to halt all production lines.";
279         sleep 1000;
280         mapannounce 'xm_d_map$, "Factory announcement: Please start product line No.1. Don't forget to wear a safety helmet! This means you Bob!", bc_map, "0x00ff44";
281         sleep 3000;
282         npctalk "Catherine Jet Johnson: Ah, maybe we should restore those toys and gift boxes to their original condition.";
283         sleep 5000;
284         npctalk "Catherine Jet Johnson: Eh? I... I mean... To return them as they were.. Yes... We need to fight them? I don't how exactly.";
285         sleep 2000;
286         mapannounce 'xm_d_map$, "Factory announcement: All employees must wear a proper uniform and identification. Please check with security if you do not have yours.", bc_map, "0x00ff44";
287         sleep 3000;
288         npctalk "Catherine Jet Johnson: Good heavens, I home the guards are still human. There were boxes of uniforms near here in the past..";
289         enablenpc instance_npcname("Employees' Uniform Box#1");
290         enablenpc instance_npcname("Employees' Uniform Box#2");
291         enablenpc instance_npcname("Employees' Uniform Box#3");
292         sleep 5000;
293         npctalk "Catherine Jet Johnson: Ah, they are behind me. You'd better change into the uniform. Fortunately, I still have my employee card.";
294         sleep 5000;
295         npctalk "Catherine Jet Johnson: I will find my way around here. Let's meet near the second production line. Cheer up its a toy factory. It can't be all that bad!!";
296         sleep 6000;
297         disablenpc instance_npcname("Catherine Jet Johnson#01");
298         disablenpc instance_npcname("#bgm01");
299         end;
300
301 OnStart2:
302         enablenpc instance_npcname("#bgm01");
303         enablenpc instance_npcname("Catherine Jet Johnson#01");
304         disablenpc instance_npcname("Catherine Jet Johnson#0");
305         sleep 3000;
306         npctalk "Catherine Jet Johnson: Ah.. We have explored here before? Okay, let's meet at the same spot again.";
307         sleep 6000;
308         disablenpc instance_npcname("Catherine Jet Johnson#01");
309         enablenpc instance_npcname("Employees' Uniform Box#1");
310         enablenpc instance_npcname("Employees' Uniform Box#2");
311         enablenpc instance_npcname("Employees' Uniform Box#3");
312         mapannounce 'xm_d_map$, "Factory announcement: Wake up, toy factory working time has come...", bc_map, "0x00ff44";
313         sleep 6000;
314         mapannounce 'xm_d_map$, "Factory announcement: Waste and other debries should be kept clear from work areas. This is to keep you safe at all times.", bc_map, "0x00ff44";
315         sleep 6000;
316         mapannounce 'xm_d_map$, "Factory announcement: Let's make presents for every child's dream today.", bc_map, "0x00ff44";
317         donpcevent instance_npcname("#fac1ct") + "::OnStart";
318         disablenpc instance_npcname("#bgm01");
319         end;
320
321 OnInstanceInit:
322         disablenpc instance_npcname( strnpcinfo(0) );
323         // disable some warps
324         disablenpc instance_npcname("#fac3wp");
325         disablenpc instance_npcname("#fac3wp2");
326         disablenpc instance_npcname("#fac4wp");
327         disablenpc instance_npcname("#fac4wp2");
328         disablenpc instance_npcname("#fac5wp");
329         disablenpc instance_npcname("#fac6wp");
330         end;
331 }
332
333 1@xm_d,112,20,0 script  #bgm01  -1,9,9,{
334         end;
335 OnTouch:
336         playBGM "99";
337         end;
338 OnInstanceInit:
339         disablenpc instance_npcname( strnpcinfo(0) );
340         end;
341 }
342
343 1@xm_d,13,105,6 script  Employees' Uniform Box#1        4_NONMYSTCASE,{
344         progressbar "ffff00",1;
345         playBGM "52";
346         .@mob_id_transform = getstatus(SC_MONSTER_TRANSFORM,1);
347         if (.@mob_id_transform == 1246 || .@mob_id_transform < 1) {
348                 mes "^0000ffYou put on a factory uniform. There still seem to be a few uniforms left in the box.^000000";
349                 transform 1246,180000;// COOKIE_XMAS
350                 close;
351         }
352         mes "^ff0000In transformation";
353         mes "You cannot use uniform box when already transformed.^000000";
354         close;
355 OnInstanceInit:
356         disablenpc instance_npcname( strnpcinfo(0) );
357         end;
358 }
359 1@xm_d,116,16,6 duplicate(Employees' Uniform Box#1)     Employees' Uniform Box#2        4_NONMYSTCASE
360 1@xm_d,10,20,6  duplicate(Employees' Uniform Box#1)     Employees' Uniform Box#3        4_NONMYSTCASE
361
362 1@xm_d,1,5,3    script  #fac1ct CLEAR_NPC,{
363         end;
364 OnStart:
365         .@event$ = instance_npcname("#fac1ct") + "::OnMyMobDead";
366         killmonster 'xm_d_map$, .@event$;
367         areamonster 'xm_d_map$,16,24,114,112, "Vicious Cookie",2989,31, .@event$;       // XM_COOKIE
368         areamonster 'xm_d_map$,16,24,114,112, "Evil Dwelling Box",2991,36, .@event$;// XM_MYSTCASE
369         end;
370
371 OnMyMobDead:
372         if (mobcount( 'xm_d_map$, instance_npcname("#fac1ct") + "::OnMyMobDead" ) < 30)
373                 initnpctimer;
374         end;
375
376 OnTimer1000:
377         killmonster 'xm_d_map$, instance_npcname("#fac1ct") + "::OnMyMobDead";
378         enablenpc instance_npcname("#fac1bs");
379         mapannounce 'xm_d_map$, "Coordinator's announcement: Huh? Where's everyone! How dare workers to be absent from the line!", bc_map, "0xff8800";
380         for ( .@i = 61; .@i <= 89; .@i++ )
381                 disablenpc instance_npcname( "alert#"+ .@i );
382         stopnpctimer;
383         end;
384
385 OnInstanceInit:
386         hideonnpc instance_npcname( strnpcinfo(0) );
387         end;
388 }
389
390 1@xm_d,71,129,3 script  #fac1bs 4_M_COOKIE,{
391         if (getpartyleader(getcharid(1),2) == getcharid(0)) {
392                 .@mob_id_transform = getstatus(SC_MONSTER_TRANSFORM,1);
393                 mes "[Coordinator]";
394                 if (.@mob_id_transform == 1246) {
395                         mes "I can't find the other workers. We don't have time for dawdling. Children are waiting for presents.";
396                         next;
397                         mes "[Coordinator]";
398                         mes "Hurry up! Carry ^ff0000the gift box over there^000000 and move to the east.";
399                         enablenpc instance_npcname("#pck1");
400                         npctalk "Coordinator: Hurry up! Carry the gift box over there and move to the east.";
401                 }
402                 else if (.@mob_id_transform == 1249)
403                         mes "Why are you hanging around! Carry ^ff0000the gift box over here^000000 and move to the east.";
404                 else {
405                         mes "What!? Humans!!!";
406                         donpcevent instance_npcname("#fac1bs") + "::OnAlert";
407                 }
408                 close;
409         }
410         end;
411
412 OnAlert:
413         .@npc_name$ = instance_npcname("#fac1bs");
414         .@event$ = .@npc_name$ + "::OnMyMobDead";
415         killmonster 'xm_d_map$, .@event$;
416         npctalk "Coordinator: Guard! Where is guard! Humans are invading!!";
417         sleep 3000;
418         disablenpc .@npc_name$;
419         for ( .@i = 0; .@i <= 10; .@i++ ) {
420                 areamonster 'xm_d_map$,61,118,71,128, "Guard",2990,1, .@event$;// XM_CRUISER
421                 sleep 300;
422         }
423         initnpctimer;
424         end;
425 OnMyMobDead:
426         end;
427
428 OnTimer60000:
429         .@npc_name$ = instance_npcname("#fac1bs");
430         killmonster 'xm_d_map$, .@npc_name$ + "::OnMyMobDead";
431         enablenpc .@npc_name$;
432         npctalk "Coordinator: This kind of things happens a lot these days...";
433         stopnpctimer;
434         end;
435
436 OnInstanceInit:
437         disablenpc instance_npcname( strnpcinfo(0) );
438         end;
439 }
440
441 1@xm_d,65,127,6 script  #pck1   4_NONMYSTCASE,{
442         progressbar "ffff00",1;
443         .@mob_id_transform = getstatus(SC_MONSTER_TRANSFORM,1);
444         if (.@mob_id_transform == 1246) {
445                 mes "^0000ffYou are carrying the packaged present.^000000";
446                 transform 1249,180000;// MYSTCASE
447         }
448         else if (.@mob_id_transform == 1249)
449                 mes "^009900The box is in your hands. You cannot carry more than one boxe.^000000";
450         else
451                 mes "^ff0000You are not in uniform. The Coordinator won't let you pick it up.^000000";
452         close;
453
454 OnInstanceInit:
455         disablenpc instance_npcname( strnpcinfo(0) );
456         end;
457 }
458
459 1@xm_d,76,129,0 script  #fac1wp WARPNPC,2,2,{
460 OnTouch:
461         if (getstatus(SC_MONSTER_TRANSFORM,1) == 1249) {
462                 warp 'xm_d_map$,88,129;
463                 playBGM "54";
464         }
465         end;
466 }
467
468 1@xm_d,179,129,0        script  #fac2wp WARPNPC,2,2,{
469 OnTouch:
470         if (getstatus(SC_MONSTER_TRANSFORM,1) == 1249) {
471                 warp 'xm_d_map$,183,100;
472                 playBGM "54";
473         }
474         end;
475 }
476
477 1@xm_d,1,5,3    script  #alert1 CLEAR_NPC,{
478         end;
479 OnStart:
480         .@r = rand(1,10);
481         if (.@r == 1)
482                 mapannounce 'xm_d_map$, "Factory announcement: Outsiders are spotted on the product line. Guard, please move out immediately.",bc_map,"0x00ffff";
483         else if (.@r == 2)
484                 mapannounce 'xm_d_map$, "Factory announcement: Invaders have been identified. Distinction Code AX0829. Type: Human. Chase them away.", bc_map, "0x00ffff";
485         else if (.@r == 3)
486                 mapannounce 'xm_d_map$, "Guard's announcement: Please immediately leave here, outsiders.", bc_map, "0xffff00";
487         else if (.@r == 4)
488                 mapannounce 'xm_d_map$, "Factory announcement: Outsiders, hold up your hands and surrender. Otherwise, I will shoot you.", bc_map, "0x00ffff";
489         else if (.@r == 5)
490                 mapannounce 'xm_d_map$, "Factory announcement: Dispatch the guard. Suppress the invaders.", bc_map, "0x00ffff";
491         else if (.@r == 6)
492                 mapannounce 'xm_d_map$, "CAUTION: The plant manger is coming to inspect. Wipe out the outsiders.", bc_map, "0xff4444";
493         else if (.@r == 7)
494                 mapannounce 'xm_d_map$, "Factory announcement: Not good news. Outside creatures are detected. Guard, please mobilize.", bc_map, "0x00ff88";
495         else if (.@r == 8)
496                 mapannounce 'xm_d_map$, "Factory announcement: Outsiders or invaders are obstacles to operate the factory. You can kill them if it is necessary.", bc_map, "0xff9999";
497         else if (.@r == 9)
498                 mapannounce 'xm_d_map$, "Factory announcement: Okay that's it, party's over! Get out of my house!", bc_map, "0x00ffff";
499         else
500                 mapannounce 'xm_d_map$, "Guard's announcement: Invaders are spotted! They seem human! I will blip them off!", bc_map, "0xffff00";
501         end;
502
503 OnInstanceInit:
504         disablenpc instance_npcname( strnpcinfo(0) );
505         end;
506 }
507
508 1@xm_d,10,24,0  script  alert#61        -1,10,10,{
509 OnTouch_:
510         if (getstatus(SC_MONSTER_TRANSFORM,1) != 1246) {
511                 switch( atoi(strnpcinfo(2)) ) {
512                         case 63: case 66:
513                         case 69: case 72:
514                         case 79: case 82:
515                         case 85: case 88:
516                                 .@count = 4;
517                                 break;
518                         case 61: case 64:
519                         case 67: case 70:
520                         case 73: case 75:
521                         case 77: case 80:
522                         case 83: case 86:
523                         case 89:
524                                 .@count = 6;
525                                 break;
526                         default:
527                                 .@count = 5;
528                                 break;
529                 }
530                 getmapxy .@map$, .@x, .@y, 0;
531                 .@npc_name$ = instance_npcname( strnpcinfo(0) );
532                 .@event$ = .@npc_name$ + "::OnMyMobDead";
533                 playBGM "125";
534                 specialeffect EF_VENOMDUST;
535                 donpcevent instance_npcname("#alert1") + "::Onstart";
536                 disablenpc .@npc_name$;
537                 killmonster 'xm_d_map$, .@event$;
538                 areamonster 'xm_d_map$,(.@x-10),(.@y-10),(.@x+10),(.@y+10), "Toy Factory Guard",2990,.@count, .@event$;// XM_CRUISER
539                 initnpctimer;
540         }
541         end;
542
543 OnTimer45000:
544         enablenpc instance_npcname( strnpcinfo(0) );
545         killmonster 'xm_d_map$, instance_npcname( strnpcinfo(0) ) +"::OnMyMobDead";
546         stopnpctimer;
547         end;
548
549 OnMyMobDead:
550         end;
551 }
552 1@xm_d,30,24,0  duplicate(alert#61)     alert#62        -1,10,10
553 1@xm_d,50,24,0  duplicate(alert#61)     alert#63        -1,10,10
554 1@xm_d,70,24,0  duplicate(alert#61)     alert#64        -1,10,10
555 1@xm_d,90,24,0  duplicate(alert#61)     alert#65        -1,10,10
556 1@xm_d,10,44,0  duplicate(alert#61)     alert#66        -1,10,10
557 1@xm_d,30,44,0  duplicate(alert#61)     alert#67        -1,10,10
558 1@xm_d,50,44,0  duplicate(alert#61)     alert#68        -1,10,10
559 1@xm_d,70,44,0  duplicate(alert#61)     alert#69        -1,10,10
560 1@xm_d,90,44,0  duplicate(alert#61)     alert#70        -1,10,10
561 1@xm_d,110,44,0 duplicate(alert#61)     alert#71        -1,10,10
562 1@xm_d,10,64,0  duplicate(alert#61)     alert#72        -1,10,10
563 1@xm_d,30,64,0  duplicate(alert#61)     alert#73        -1,10,10
564 1@xm_d,50,64,0  duplicate(alert#61)     alert#74        -1,10,10
565 1@xm_d,70,64,0  duplicate(alert#61)     alert#75        -1,10,10
566 1@xm_d,90,64,0  duplicate(alert#61)     alert#76        -1,10,10
567 1@xm_d,110,64,0 duplicate(alert#61)     alert#77        -1,10,10
568 1@xm_d,10,84,0  duplicate(alert#61)     alert#78        -1,10,10
569 1@xm_d,30,84,0  duplicate(alert#61)     alert#79        -1,10,10
570 1@xm_d,50,84,0  duplicate(alert#61)     alert#80        -1,10,10
571 1@xm_d,70,84,0  duplicate(alert#61)     alert#81        -1,10,10
572 1@xm_d,90,84,0  duplicate(alert#61)     alert#82        -1,10,10
573 1@xm_d,110,84,0 duplicate(alert#61)     alert#83        -1,10,10
574 1@xm_d,10,104,0 duplicate(alert#61)     alert#84        -1,10,10
575 1@xm_d,30,104,0 duplicate(alert#61)     alert#85        -1,10,10
576 1@xm_d,50,104,0 duplicate(alert#61)     alert#86        -1,10,10
577 1@xm_d,70,104,0 duplicate(alert#61)     alert#87        -1,10,10
578 1@xm_d,90,104,0 duplicate(alert#61)     alert#88        -1,10,10
579 1@xm_d,110,104,0        duplicate(alert#61)     alert#89        -1,10,10
580 1@xm_d,155,20,0 duplicate(alert#61)     alert#90        -1,10,10
581 1@xm_d,180,50,0 duplicate(alert#61)     alert#91        -1,10,10
582 1@xm_d,205,80,0 duplicate(alert#61)     alert#92        -1,10,10
583 1@xm_d,230,110,0        duplicate(alert#61)     alert#93        -1,10,10
584 1@xm_d,180,20,0 duplicate(alert#61)     alert#94        -1,10,10
585 1@xm_d,180,50,0 duplicate(alert#61)     alert#95        -1,10,10
586 1@xm_d,180,80,0 duplicate(alert#61)     alert#96        -1,10,10
587 1@xm_d,205,20,0 duplicate(alert#61)     alert#97        -1,10,10
588 1@xm_d,205,50,0 duplicate(alert#61)     alert#98        -1,10,10
589 1@xm_d,205,80,0 duplicate(alert#61)     alert#99        -1,10,10
590 1@xm_d,205,110,0        duplicate(alert#61)     alert#100       -1,10,10
591 1@xm_d,230,20,0 duplicate(alert#61)     alert#101       -1,10,10
592 1@xm_d,230,50,0 duplicate(alert#61)     alert#102       -1,10,10
593 1@xm_d,230,80,0 duplicate(alert#61)     alert#103       -1,10,10
594 1@xm_d,230,110,0        duplicate(alert#61)     alert#104       -1,10,10
595
596
597 1@xm_d,185,100,6        script  Catherine Jet Johnson#2 4_F_SKULL06GIRL,{
598         if (getpartyleader(getcharid(1),2) == getcharid(0)) {
599                 mes "[Catherine Jet Johnson]";
600                 mes "Lucky you got here safely.";
601                 next;
602                 switch( select( "Quit the story", "Listen to her tatics.", "I know what to do. Proceed quickly!" ) ) {
603                 case 1:
604                         mes "[Catherine Jet Johnson]";
605                         mes "Oh, dear. Let me know when you are ready.";
606                         close;
607                 case 2:
608                         donpcevent instance_npcname("Catherine Jet Johnson#21") + "::OnStart";
609                         close;
610                 case 3:
611                         donpcevent instance_npcname("Catherine Jet Johnson#21") + "::OnStart2";
612                         close;
613                 }
614         }
615         mes "[Catherine Jet Johnson]";
616         mes "Hold on~ I am talking to your manager, so please wait.";
617         close;
618 }
619
620 1@xm_d,185,100,6        script  Catherine Jet Johnson#21        4_F_SKULL06GIRL,{
621         end;
622 OnStart:
623         callsub S_Skip,0;
624 OnStart2:
625         callsub S_Skip,1;
626 S_Skip:
627         enablenpc instance_npcname("#bgm06");
628         enablenpc instance_npcname("Catherine Jet Johnson#21");
629         disablenpc instance_npcname("Catherine Jet Johnson#2");
630         sleep 3000;
631         if (getarg(0) == 1)
632                 npctalk "Catherine Jet Johnson: If you find all clues, search other places. I will look for the spot where I met the doll maker last time I was here.";
633         else {
634                 npctalk "Catherine Jet Johnson: This place was Factory No.2.";
635                 sleep 5000;
636                 npctalk "Catherine Jet Johnson: It used to be filled with people, but now it isn't.";
637                 sleep 5000;
638                 npctalk "Catherine Jet Johnson: Ah, I realized something while coming here. Some...Children...";
639                 sleep 5000;
640                 npctalk "Catherine Jet Johnson: How can I say.. There were lots of souls looking very scary, but awfully sad.";
641                 sleep 5000;
642                 npctalk "Catherine Jet Johnson: How pitiful they are, but please make them rest if they attack you. Fortunately, they won't come at me.";
643                 sleep 5000;
644                 npctalk "Catherine Jet Johnson: If you see a worker toy on duty while searching here, would you ask it about the doll maker?";
645                 sleep 5000;
646                 npctalk "Catherine Jet Johnson: He might be sent to Heaven if they recall the memory of doll maker. That the only hope.";
647                 sleep 5000;
648                 npctalk "Catherine Jet Johnson: If you find all clues, search other places. I will look for the spot where I met the doll maker last time I was here.";
649                 sleep 5000;
650                 npctalk "Catherine Jet Johnson: Sorry that I can't be a big help to you. See you in a minute.";
651         }
652         sleep 6000;
653         disablenpc instance_npcname("Catherine Jet Johnson#21");
654         enablenpc instance_npcname("Employees' Uniform Box#4");
655         donpcevent instance_npcname("#fac2ct") + "::OnStart";
656
657         for ( .@i = 1; .@i <= 10; .@i++ )
658                 enablenpc instance_npcname( "Worker#"+ .@i );
659         disablenpc instance_npcname("#bgm06");
660         end;
661
662 OnInstanceInit:
663         disablenpc instance_npcname( strnpcinfo(0) );
664         end;
665 }
666
667 1@xm_d,185,100,0        script  #bgm06  -1,9,9,{
668 OnTouch:
669         playBGM "99";
670         end;
671 OnInstanceInit:
672         disablenpc instance_npcname( strnpcinfo(0) );
673         end;
674 }
675
676 1@xm_d,185,94,6 script  Employees' Uniform Box#4        4_NONMYSTCASE,{
677         progressbar "ffff00",1;
678         playBGM "128";
679         .@mob_id_transform = getstatus(SC_MONSTER_TRANSFORM,1);
680         if (.@mob_id_transform == 1246 || .@mob_id_transform == 1249 || .@mob_id_transform < 1) {
681                 mes "^0000ff>You changed into uniform.^000000";
682                 transform 1246,300000;// COOKIE_XMAS
683                 close;
684         }
685         mes "^ff0000You transformed into a different form.";
686         mes "You can't seem to put on the uniform over your fangs.^000000";
687         close;
688
689 OnInstanceInit:
690         disablenpc instance_npcname( strnpcinfo(0) );
691         end;
692 }
693
694 1@xm_d,1,5,3    script  #fac2ct CLEAR_NPC,{
695         end;
696 OnEnd:
697         killmonster 'xm_d_map$, instance_npcname("#fac2ct") + "::OnMyMobDead";
698         end;
699
700 OnStart:
701         .@event$ = instance_npcname("#fac2ct") + "::OnMyMobDead";
702         killmonster 'xm_d_map$, .@event$;
703         areamonster 'xm_d_map$,140,18,240,120, "Malicious Baby Ghost",2993,19, .@event$;        // XM_HYLOZOIST
704         areamonster 'xm_d_map$,140,18,240,120, "Evil Dwelling Box",2991,16, .@event$;           // XM_MYSTCASE
705         areamonster 'xm_d_map$,140,18,240,120, "Abandoned Teddy bear",2995,22, .@event$;        // XM_TEDDY_BEAR
706         areamonster 'xm_d_map$,140,18,240,120, "Creepy Demon",2992,16, .@event$;                        // XM_LUDE
707         end;
708 OnMyMobDead:
709         end;
710
711 OnInstanceInit:
712         hideonnpc instance_npcname( strnpcinfo(0) );
713         end;
714 }
715
716 1@xm_d,1,2,3    script  #fac2wpc        CLEAR_NPC,{
717         end;
718 OnStart:
719         .@fac_open = 'worker[1] + 'worker[2] + 'worker[3] + 'worker[4] + 'worker[5] + 'worker[6] + 'worker[7] + 'worker[8] + 'worker[9] + 'worker[10];
720         if (.@fac_open == 10) {
721                 enablenpc instance_npcname("#fac3wp");
722                 enablenpc instance_npcname("#fac3wp2");
723                 donpcevent instance_npcname("#fac2ct") + "::OnEnd";
724                 mapannounce 'xm_d_map$, "Factory announcement: Everyone has gone home. The line is shut down and the employee's lounge is open.", bc_map, "0x00ff44";
725                 for ( .@i = 90; .@i <= 104; .@i++ )
726                         disablenpc instance_npcname( "alert#"+ .@i );
727         }
728         else
729                 mapannounce 'xm_d_map$, "Factory announcement: Now there are " + (10 - .@fac_open) + " people on the packaging line. Take care of yourself.", bc_map, "0x00ff44";
730         end;
731
732 OnInstanceInit:
733         disablenpc instance_npcname( strnpcinfo(0) );
734         end;
735 }
736
737 1@xm_d,155,98,3 script  Worker#1        4_M_COOKIE,{
738         if (getstatus(SC_MONSTER_TRANSFORM,1) == 1246) {
739                 .@num = atoi(strnpcinfo(2));
740                 mes "[Worker]";
741                 mes "Huh? What happened?";
742                 next;
743                 if (select( "No, nothing special", "Do you know about the doll maker?" ) == 1) {
744                         mes "[Worker]";
745                         if (.@num == 8)
746                                 mes "I'm working now! I'm very busy!";
747                         else
748                                 mes "I'm very busy with working, so could you stop chatting?";
749                         close;
750                 }
751                 close2;
752                 pcblockmove getcharid(3),1;// todo : not able to talk to npc
753                 pcblockskill getcharid(3),1;
754                 switch(.@num) {
755                 case 1:
756                         npctalk "Worker: Ah! Grandpa? He's a real good man. He oiled us everyday and cleaned the dust very often.";
757                         sleep2 3000;
758                         npctalk "Worker: I wish he wouldn't pass away. Ah... Ahah... I feel better.";
759                         break;
760                 case 2:
761                         npctalk "Worker: Did Kimi kill the craftman grandpa? Who said that? That's not true. Kimi was going to save him!";
762                         sleep2 3000;
763                         npctalk "Worker: Ah... B.. By the way, why my body becomes...";
764                         break;
765                 case 3:
766                         npctalk "Worker: He had chronic cardiac disease, but it suddenly started to fit on the day he died. Kimi found him and gave him first aid, but..";
767                         sleep2 3000;
768                         npctalk "Worker: Ah.. Did you do something to me? I feel strange...";
769                         break;
770                 case 4:
771                         npctalk "Worker: Kimi didn't move at all for sometime and sat down like ordinary dolls.";
772                         sleep2 3000;
773                         npctalk "Worker: She was about to fly her soul forever... Like me now... Oh, my... What happened to me?";
774                         break;
775                 case 5:
776                         npctalk "Worker: Oh, Kimi.. My dear.. She thought the doll maker passed away because she startled him.";
777                         sleep2 3000;
778                         npctalk "Worker: Grandpa was just very pleased that Kimi was moving..";
779                         break;
780                 case 6:
781                         npctalk "Worker: He could see a living doll for a while. That's what Kimi first did.";
782                         sleep2 3000;
783                         npctalk "Worker: And what she first saw was his death. What a misery.";
784                         break;
785                 case 7:
786                         npctalk "Worker: Kimi was able to hear the Grandpa's voice and feel before she was indwelled.";
787                         sleep2 3000;
788                         npctalk "Worker: Perhaps Grandpa's affection made her move and become alive. Ahah.. I'm sleepy..";
789                         break;
790                 case 8:
791                         npctalk "Worker: Grandpa good man! Kimi pity! Kimi loves Grandpa! Granpa died. I'm sad!";
792                         sleep2 3000;
793                         break;
794                 case 9:
795                         npctalk "Worker: He was so amazed to see Kimi's opening eyes and his heart... It became like that.";
796                         sleep2 3000;
797                         npctalk "Worker: Anyhow, why my body... It's likely to float in the air.... Something strange.";
798                         break;
799                 case 10:
800                         npctalk "Worker: Kimi didn't hurt Grandpa! Kimi's wanted to save Grandpa! People are scared of Kimi Kimi is kind! Kimi is a good girl!";
801                         sleep2 3000;
802                         npctalk "Worker: Grandpa... I miss him. Grandpa, Grandpa...";
803                         break;
804                 }
805                 sleep2 3000;
806                 disablenpc instance_npcname( strnpcinfo(0) );
807                 if ('worker[.@num] == 0) {
808                         'worker[.@num] = 1;
809                         donpcevent instance_npcname("#fac2wpc") + "::OnStart";
810                 }
811                 pcblockmove getcharid(3),0;
812                 pcblockskill getcharid(3),0;
813                 end;
814         }
815         mes "[Worker]";
816         mes "What!? You are not one of us!!";
817         donpcevent instance_npcname( strnpcinfo(0) ) + "::OnAlert";
818         close;
819
820 OnAlert:
821         .@npc_name$ = instance_npcname( strnpcinfo(0) );
822         killmonster 'xm_d_map$, .@npc_name$ + "::OnMyMobDead";
823         .@num = atoi(strnpcinfo(2));
824         if (.@num == 8)
825                 npctalk "Worker: Guard! Guard!!";
826         else
827                 npctalk "Worker: Guard, Guard! Where are you?! Humans are here!!";
828         sleep 3000;
829         switch(.@num) {
830         case 9:
831                 setarray .@coord[0],233,27;
832                 break;
833         case 10:
834                 setarray .@coord[0],209,27;
835                 break;
836         default:
837                 getmapxy .@map$, .@coord[0], .@coord[1], UNITTYPE_NPC;
838                 break;
839         }
840         areamonster 'xm_d_map$,(.@coord[0]-8),(.@coord[1]-8),(.@coord[0]+8),(.@coord[1]+8), "Guard",2990,21, .@npc_name$ + "::OnMyMobDead";
841         disablenpc .@npc_name$;
842         if ('worker[.@num] == 0) {
843                 'worker[.@num] = 1;
844                 donpcevent instance_npcname("#fac2wpc") + "::OnStart";
845         }
846         initnpctimer;
847         end;
848 OnTimer60000:
849         killmonster 'xm_d_map$, instance_npcname( strnpcinfo(0) ) + "::OnMyMobDead";
850         stopnpctimer;
851         end;
852
853 OnMyMobDead:
854         end;
855
856 OnInstanceInit:
857         disablenpc instance_npcname( strnpcinfo(0) );
858         end;
859 }
860 1@xm_d,130,72,3 duplicate(Worker#1)     Worker#2        4_M_COOKIE
861 1@xm_d,134,34,1 duplicate(Worker#1)     Worker#3        4_M_COOKIE
862 1@xm_d,195,28,3 duplicate(Worker#1)     Worker#4        4_M_COOKIE
863 1@xm_d,228,30,1 duplicate(Worker#1)     Worker#5        4_M_COOKIE
864 1@xm_d,203,55,3 duplicate(Worker#1)     Worker#6        4_M_COOKIE
865 1@xm_d,132,52,1 duplicate(Worker#1)     Worker#7        4_M_COOKIE
866 1@xm_d,162,52,1 duplicate(Worker#1)     Worker#8        4_M_COOKIE
867 1@xm_d,242,17,5 duplicate(Worker#1)     Worker#9        4_M_COOKIE
868 1@xm_d,209,15,3 duplicate(Worker#1)     Worker#10       4_M_COOKIE
869
870
871 // Note : aegis script have OnClick part
872 1@xm_d,131,208,0        script  Captured Santa#2        4_M_SANTA,10,10,{
873         end;
874 OnTouch_:
875         disablenpc instance_npcname("Captured Santa#2");
876         enablenpc instance_npcname("Captured Santa#3");
877         donpcevent instance_npcname("Antonio#1") + "::OnStart";
878         enablenpc instance_npcname("#bgm04");
879         end;
880 }
881
882 1@xm_d,131,208,8        script  Captured Santa#3        4_M_SANTA,{
883         mes "[Captured Santa]";
884         mes "Even if no one owns it, its not right to steal it from everyone.";
885         close;
886
887 OnInstanceInit:
888         disablenpc instance_npcname( strnpcinfo(0) );
889         end;
890 }
891
892 1@xm_d,131,213,4        script  Antonio#1       4_M_ANTONIO,{
893         mes "[Antonio]";
894         mes "Hey, Santa. Stop being stuffy, you old man. Fair is fair after all, kekeke.";
895         close;
896
897 OnStart:
898         .@antonio$ = instance_npcname("Antonio#1");
899         .@santa$ = instance_npcname("Captured Santa#3");
900         sleep 3000;
901         npctalk "Antonio: Listen to me, Santa~ I mean, I like this factory.", .@antonio$;
902         sleep 3000;
903         npctalk "Antonio: No one owns it~ And there are a number of things I can use.", .@antonio$;
904         sleep 3000;
905         npctalk "Captured Santa: You silly! Just to be sure, I followed you. Now you steal from everyones factory!", .@santa$;
906         sleep 4000;
907         npctalk "Antonio: Hey, is this a big deal if I have surplus presents? I don't know about that~", .@antonio$;
908         sleep 4000;
909         npctalk "Captured Santa: Whew... Okay, but think about that how children feel when they got them.", .@santa$;
910         sleep 4000;
911         npctalk "Captured Santa: How they feel if they know you distributed the masterless things to them?", .@santa$;
912         sleep 4000;
913         npctalk "Antonio: Hmm...", .@antonio$;
914         sleep 2000;
915         npctalk "Antonio: Maybe... I will be happy?! Anyway, that's a present, kekekeke.", .@antonio$;
916         sleep 5000;
917         npctalk "Captured Santa: Who said the present itself is the problem! You'd better stop this theft, Antonio!", .@santa$;
918         sleep 5000;
919         mapannounce 'xm_d_map$, "Factory announcement: The sending preparations have finished in Factory No.3.", bc_map, "0x00ff44";
920         sleep 5000;
921         mapannounce 'xm_d_map$, "Factory announcement: Delivery employees, please stand by.", bc_map, "0x00ff44";
922         sleep 3000;
923         npctalk "Antonio: Oh! Wohuhu! A bunch of presents are dealayed. Let's have a party today?!", .@antonio$;
924         sleep 4000;
925         npctalk "Antonio: Hey, human. You can follow me if you'd like to help. I'm okay unless you disturb me!", .@antonio$;
926         sleep 4000;
927         disablenpc .@antonio$;
928         sleep 2000;
929         npctalk "Captured Santa: Tha.. That dude has no ethics!", .@santa$;
930         sleep 4000;
931         npctalk "Captured Santa: Hey, would you go kick that Antonio out? He might run away if you hit several times.", .@santa$;
932         sleep 5000;
933         npctalk "Captured Santa: Its not right to steal from the community!", .@santa$;
934
935         disablenpc instance_npcname("#bgm04");
936         enablenpc instance_npcname("#fac4wp");
937         enablenpc instance_npcname("#fac4wp2");
938         donpcevent instance_npcname("#fac3ct") + "::OnStart";
939         donpcevent instance_npcname("#fac3ct2") + "::OnStart";
940         donpcevent instance_npcname("#fac3ct3") + "::OnStart";
941         sleep 3000;
942         enablenpc instance_npcname("#bgm05");
943         end;
944 }
945
946 1@xm_d,131,208,0        script  #bgm04  -1,9,9,{
947 OnTouch:
948         playBGM "54";
949         end;
950 OnInstanceInit:
951         disablenpc instance_npcname( strnpcinfo(0) );
952         end;
953 }
954
955 1@xm_d,131,208,0        script  #bgm05  -1,9,9,{
956 OnTouch:
957         playBGM "105";
958         end;
959 OnInstanceInit:
960         disablenpc instance_npcname( strnpcinfo(0) );
961         end;
962 }
963
964 1@xm_d,1,5,3    script  #fac3ct CLEAR_NPC,{
965         end;
966 OnEnd:
967         killmonster 'xm_d_map$, instance_npcname( strnpcinfo(0) ) + "::OnMyMobDead";
968         end;
969 OnStart:
970         .@event$ = instance_npcname( strnpcinfo(0) ) + "::OnMyMobDead";
971         killmonster 'xm_d_map$, .@event$;
972         areamonster 'xm_d_map$,13,144,121,248, "Dancing Marionette",2994,37, .@event$;  // XM_MARIONETTE
973         areamonster 'xm_d_map$,13,144,121,248, "Decorated Evil Tree",2987,31, .@event$; // XM_TREE
974         areamonster 'xm_d_map$,13,144,121,248, "Abandoned Teddy bear",2995,43, .@event$;// XM_TEDDY_BEAR
975         areamonster 'xm_d_map$,13,144,121,248, "Creepy Demon",2992,31, .@event$;                // XM_LUDE
976         end;
977 OnMyMobDead:
978         end;
979 OnInstanceInit:
980         hideonnpc instance_npcname( strnpcinfo(0) );
981         end;
982 }
983
984 1@xm_d,1,5,3    script  #fac3ct2        CLEAR_NPC,{
985         end;
986 OnEnd:
987         killmonster 'xm_d_map$, instance_npcname( strnpcinfo(0) ) + "::OnMyMobDead";
988         end;
989 OnStart:
990         .@event$ = instance_npcname( strnpcinfo(0) ) + "::OnMyMobDead";
991         killmonster 'xm_d_map$, .@event$;
992         areamonster 'xm_d_map$,159,215,241,247, "Malicious Baby Ghost",2993,13, .@event$;       // XM_HYLOZOIST
993         areamonster 'xm_d_map$,159,215,241,247, "Decorated Evil Tree",2987,11, .@event$;        // XM_TREE
994         areamonster 'xm_d_map$,159,215,241,247, "Abandoned Teddy bear",2995,15, .@event$;       // XM_TEDDY_BEAR
995         areamonster 'xm_d_map$,159,215,241,247, "Creepy Demon",2992,11, .@event$;                       // XM_LUDE
996         end;
997 OnMyMobDead:
998         end;
999 OnInstanceInit:
1000         hideonnpc instance_npcname( strnpcinfo(0) );
1001         end;
1002 }
1003
1004 1@xm_d,1,5,3    script  #fac3ct3        CLEAR_NPC,{
1005         end;
1006 OnStart:
1007         if (rand(1,10) > 3)
1008                 areamonster 'xm_d_map$,13,144,121,248 ,"Antonio",2988,1, instance_npcname("#fac3ct3")+"::OnMyMobDead";// ANTONIO
1009         else
1010                 areamonster 'xm_d_map$,159,215,241,247, "Antonio",2988,1, instance_npcname("#fac3ct3")+"::OnMyMobDead";
1011         end;
1012
1013 OnMyMobDead:
1014         if (mobcount( 'xm_d_map$, instance_npcname("#fac3ct3") + "::OnMyMobDead" ) < 1)
1015                 initnpctimer;
1016         end;
1017
1018 OnTimer1000:
1019 OnEnd:
1020         killmonster 'xm_d_map$, instance_npcname( strnpcinfo(0) ) + "::OnMyMobDead";
1021         donpcevent instance_npcname("#fac3ct") + "::OnEnd";
1022         donpcevent instance_npcname("#fac3ct2") + "::OnEnd";
1023         donpcevent instance_npcname("#finalbs") + "::OnStart";
1024         disablenpc instance_npcname("Captured Santa#3");
1025         mapannounce 'xm_d_map$, "???: I won't harm you if you leave quietly without spoiling it for me.", bc_map, "0xff8800";
1026         stopnpctimer;
1027         end;
1028
1029 OnInstanceInit:
1030         hideonnpc instance_npcname( strnpcinfo(0) );
1031         end;
1032 }
1033
1034 1@xm_d,1,5,3    script  #finalbs        CLEAR_NPC,{
1035         end;
1036 OnStart:
1037         enablenpc instance_npcname("Catherine Jet Johnson#5");
1038         enablenpc instance_npcname("Celine Kimi#0");
1039         enablenpc instance_npcname("#fac5wp");
1040         // enablenpc instance_npcname("#fac5wp2");// never enabled
1041         enablenpc instance_npcname("#jeton1");
1042         end;
1043 OnInstanceInit:
1044         disablenpc instance_npcname( strnpcinfo(0) );
1045         end;
1046 }
1047
1048 /*
1049 // never enabled
1050 1@xm_d,160,208,0        script  #fac5wp2        WARPNPC,2,2,{
1051 OnTouch:
1052         warp 'xm_d_map$,145,208;
1053         end;
1054 OnInstanceInit:
1055         disablenpc instance_npcname( strnpcinfo(0) );
1056         end;
1057 }
1058 */
1059
1060 1@xm_d,233,183,3        script  Celine Kimi#0   4_F_KIMI,{
1061         mes "[Celine Kimi]";
1062         mes "Did you come here as well? Why all the humans are anxious to destroy what we built?";
1063         close;
1064 OnInstanceInit:
1065         disablenpc instance_npcname( strnpcinfo(0) );
1066         end;
1067 }
1068
1069 1@xm_d,222,183,0        script  #jeton1 -1,7,7,{
1070 OnTouch_:
1071         disablenpc instance_npcname("#jeton1");
1072         donpcevent instance_npcname("Catherine Jet Johnson#5") + "::OnStart";
1073         enablenpc instance_npcname("#bgm02");
1074         end;
1075 OnInstanceInit:
1076         disablenpc instance_npcname( strnpcinfo(0) );
1077         end;
1078 }
1079
1080 1@xm_d,222,183,0        script  #bgm02  -1,9,9,{
1081 OnTouch:
1082         playBGM "101";
1083         end;
1084 OnInstanceInit:
1085         disablenpc instance_npcname( strnpcinfo(0) );
1086         end;
1087 }
1088
1089 1@xm_d,222,183,6        script  Catherine Jet Johnson#5 4_F_SKULL06GIRL,{
1090         mes "[Catherine Jet Johnson]";
1091         mes "Wa.. Watch out! Kimi isn't under the normal status.";
1092         close;
1093
1094 OnStart:
1095         .@kimi$ = instance_npcname("Celine Kimi#0");
1096         sleep 2000;
1097         npctalk "Catherine Jet Johnson: Kimi! Listen to me. I didn't come to blame you here.";
1098         sleep 3000;
1099         npctalk "Celine Kimi: Everyone hates me!... You don't like me as well? This ugly and creepy doll likes me...", .@kimi$;
1100         sleep 4000;
1101         npctalk "Catherine Jet Johnson: Kimi, I heard about you from dolls here. The doll maker adored you so much!";
1102         sleep 4000;
1103         mapannounce 'xm_d_map$, "Phantom's yell: Lie!", bc_map, "0xff8800";
1104         sleep 1000;
1105         npctalk "Celine Kimi: Don't lie. If that's true, why didn't he see me with love in his eyes?", .@kimi$;
1106         sleep 4000;
1107         npctalk "Celine Kimi: Why didn't call my name? [Kimi] [Kimi!] I was anxious to hear the Grandpa's voice.", .@kimi$;
1108         sleep 4000;
1109         mapannounce 'xm_d_map$, "Phantom's yell: Yes, Kimi~ Father was frightened! He was scared of you~", bc_map, "0xff8800";
1110         sleep 3000;
1111         npctalk "Catherine Jet Johnson: No, don't listen to it, Kimi! He really cherished you.";
1112         sleep 3000;
1113         npctalk "Celine Kimi: Did he... cherish me?", .@kimi$;
1114         sleep 3000;
1115         npctalk "Catherine Jet Johnson: Yes, when you start to move, he was so plea...";
1116         sleep 1000;
1117         mapannounce 'xm_d_map$, "Phantom's yell: He was scared of your appearance and his heart stopped, Kimi~ You killed him!", bc_map, "0xff8800";
1118         sleep 3000;
1119         npctalk "Celine Kimi: D.. Did I.. kill him?...", .@kimi$;
1120         sleep 2000;
1121         npctalk "Catherine Jet Johnson: No, Kimi! I've realized that. I misunderstood you. Just he had a disease!";
1122         sleep 3000;
1123         npctalk "Celine Kimi: D.. Di.. Did I... kill... him?", .@kimi$;
1124         sleep 2000;
1125         mapannounce 'xm_d_map$, "Phantom's yell: See how you look, Kimi~ See the mirror~ How do yo feel? ", bc_map, "0xff8800";
1126         sleep 3000;
1127         npctalk "Celine Kimi: I... I...", .@kimi$;
1128         sleep 1000;
1129         mapannounce 'xm_d_map$, "Phantom's yell: Don't you agree you are frightening? No one loves you, Kimi~", bc_map, "0xff8800";
1130         sleep 3000;
1131         npctalk "Celine Kimi: Because of me, granpa was dead...", .@kimi$;
1132         specialeffect EF_MAPPILLAR2, AREA, .@kimi$;
1133         sleep 3000;
1134         npctalk "Catherine Jet Johnson: It became serious. Kimi is suffering. It would be dangerous under this condition!";
1135         specialeffect EF_MAPPILLAR2, AREA, .@kimi$;
1136         sleep 1000;
1137         mapannounce 'xm_d_map$, "Phantom's yell: Rage~ Sorrow~ No one cries for you, Kimi~", bc_map, "0xff8800";
1138         sleep 3000;
1139         npctalk "Catherine Jet Johnson: I will find the emergency exit to escape. Run away, adventurer!";
1140         sleep 3000;
1141         disablenpc instance_npcname("Catherine Jet Johnson#5");
1142         sleep 2000;
1143         disablenpc .@kimi$;
1144         donpcevent instance_npcname("#finalbs2") + "::OnStart";
1145         disablenpc instance_npcname("#bgm02");
1146         end;
1147
1148 OnInstanceInit:
1149         disablenpc instance_npcname( strnpcinfo(0) );
1150         end;
1151 }
1152
1153 1@xm_d,1,5,3    script  #finalbs2       CLEAR_NPC,{
1154         end;
1155 OnStart:
1156         stopnpctimer;
1157         enablenpc instance_npcname("#bgm03");
1158         .@event$ = instance_npcname("#finalbs2") + "::OnMyMobDead";
1159         killmonster 'xm_d_map$, .@event$;
1160         monster 'xm_d_map$,231,184, "Celine Kimi",2996,1, .@event$;// XM_CELINE_KIMI
1161         'celene_id = $@mobid[0];
1162         monster 'xm_d_map$,226,190, "Kimi's Phantom",2997,1, .@event$;// G_XM_CELINE_KIMI
1163         'phantom_id = $@mobid[0];
1164         setunitdata 'celene_id, UMOB_HP,20000000;
1165         setunitdata 'phantom_id,UMOB_HP,20000000;
1166
1167         unittalk 'celene_id, "I don't want to be deserted. I don't want to be abandoned.";
1168         initnpctimer;
1169         end;
1170
1171 OnMyMobDead:
1172         if (mobcount( 'xm_d_map$, instance_npcname("#finalbs2") + "::OnMyMobDead" ) < 1)
1173                 donpcevent instance_npcname("#finalbs2") + "::OnEnd";
1174         end;
1175
1176 OnEnd:
1177         stopnpctimer;
1178         killmonster 'xm_d_map$, instance_npcname( strnpcinfo(0) ) + "::OnMyMobDead";
1179         disablenpc instance_npcname("#bgm03");
1180         donpcevent instance_npcname("#finalbs_e") + "::OnStart";
1181         end;
1182
1183 OnTalk:
1184         .@chat_r = rand(1,10);
1185         if (.@chat_r == 1)
1186                 unittalk 'celene_id, "I will burn you with hell inferno.";
1187         else if (.@chat_r == 2)
1188                 unittalk 'celene_id, "Will you bear this flame?!";
1189         else if (.@chat_r == 3)
1190                 unittalk 'celene_id, "I shouldn't have done, but...";
1191         else if (.@chat_r == 4)
1192                 unittalk 'celene_id, "It's boiling!... Bear it if you can.";
1193         else if (.@chat_r == 5)
1194                 unittalk 'celene_id, "Breathe as much as you can. It'll be the last breath you make.";
1195         else if (.@chat_r == 6)
1196                 unittalk 'celene_id, "Frankly, I don't like fire.";
1197         else
1198                 unittalk 'celene_id, "Everyone is afraid of me! What have I done so wrong?!";
1199         end;
1200
1201 OnTimer1000:
1202         getunitdata 'celene_id, .@data;
1203         if ((.@data[UMOB_X] < 211 || .@data[UMOB_X] > 241 || .@data[UMOB_Y] < 166 || .@data[UMOB_Y] > 201) && (.@data[UMOB_X] > 0 || .@data[UMOB_Y] > 0)) {
1204                 mapannounce 'xm_d_map$, "Celine Kimi: No! I should keep my place!",bc_map,"0xff6666",FW_NORMAL,15;
1205                 donpcevent instance_npcname("#finalbs2") + "::Onfail";
1206         }
1207         end;
1208
1209 Onfail:
1210         stopnpctimer;
1211         killmonster 'xm_d_map$, instance_npcname( strnpcinfo(0) ) + "::OnMyMobDead";
1212         enablenpc instance_npcname("Celine Kimi#2");
1213         disablenpc instance_npcname("#bgm03");
1214         enablenpc instance_npcname("#kimion1");
1215         end;
1216
1217 OnTimer5000:
1218         donpcevent instance_npcname("#bssk01") + "::OnStart";
1219         end;
1220
1221 OnTimer10000:
1222         if (mobcount( 'xm_d_map$, instance_npcname("#finalbs2") + "::OnMyMobDead" ) > 1) {
1223                 .@npc_name$ = instance_npcname("#finalbs2");
1224                 getunitdata 'celene_id, .@MOB_HP1;
1225                 getunitdata 'phantom_id, .@MOB_HP2;
1226                 if (.@MOB_HP1[UMOB_HP] > .@MOB_HP2[UMOB_HP]) {
1227                         setarray .@mob_hp[0], .@MOB_HP1[UMOB_HP], .@MOB_HP2[UMOB_HP];
1228                         setarray .@string$[0],
1229                                 "You and I are the one! I will recover you!",
1230                                 "Celine Kimi recovers herself and her phantom ";
1231                         .@talk = 'celene_id;
1232                 }
1233                 else if (.@MOB_HP2[UMOB_HP] > .@MOB_HP1[UMOB_HP]) {
1234                         setarray .@mob_hp[0], .@MOB_HP2[UMOB_HP], .@MOB_HP1[UMOB_HP];
1235                         setarray .@string$[0],
1236                                 "I will restore you!!",
1237                                 "Celine Kimi's phantom recovers herself and her master ";
1238                         .@talk = 'phantom_id;
1239                 }
1240                 .@diff_hp = .@mob_hp[0] - .@mob_hp[1];
1241                 if (.@diff_hp > 100000) {
1242                         .@set_bs_hp = (.@diff_hp * 5) / 10;
1243                         .@MOB_HP3 = .@mob_hp[0] + .@set_bs_hp;
1244                         if (.@MOB_HP3 > 66666666)
1245                                 .@MOB_HP3 = 66666666;
1246                         setunitdata 'celene_id, UMOB_HP, .@MOB_HP3;
1247                         setunitdata 'phantom_id, UMOB_HP, .@MOB_HP3;
1248                         donpcevent instance_npcname("#eff_f01") + "::OnStart";
1249                         unittalk .@talk, .@string$[0];
1250                         sleep 1000;
1251                         mapannounce 'xm_d_map$,  .@string$[1] + .@set_bs_hp +" HP has been recovered.", bc_map, "0xff6666";
1252                         donpcevent instance_npcname("#heal_c") + "::OnStart";
1253                 }
1254                 initnpctimer;
1255         }
1256         end;
1257
1258 OnInstanceInit:
1259         hideonnpc instance_npcname( strnpcinfo(0) );
1260         end;
1261 }
1262
1263 1@xm_d,216,193,3        script  #eff_f01        CLEAR_NPC,{
1264         end;
1265 OnStart:
1266         for ( .@i = 1; .@i < 10; .@i++ )
1267                 specialeffect EF_HEARTCASTING, AREA, instance_npcname( "#eff_f0"+ .@i );
1268         end;
1269 OnInstanceInit:
1270         hideonnpc instance_npcname( strnpcinfo(0) );
1271         end;
1272 }
1273
1274 1@xm_d,226,193,3        script  #eff_f02        CLEAR_NPC,{
1275         end;
1276 OnInstanceInit:
1277         hideonnpc instance_npcname( strnpcinfo(0) );
1278         end;
1279 }
1280 1@xm_d,236,193,3        duplicate(#eff_f02)     #eff_f03        CLEAR_NPC
1281 1@xm_d,216,183,3        duplicate(#eff_f02)     #eff_f04        CLEAR_NPC
1282 1@xm_d,226,183,3        duplicate(#eff_f02)     #eff_f05        CLEAR_NPC
1283 1@xm_d,236,183,3        duplicate(#eff_f02)     #eff_f06        CLEAR_NPC
1284 1@xm_d,216,173,3        duplicate(#eff_f02)     #eff_f07        CLEAR_NPC
1285 1@xm_d,226,173,3        duplicate(#eff_f02)     #eff_f08        CLEAR_NPC
1286 1@xm_d,236,173,3        duplicate(#eff_f02)     #eff_f09        CLEAR_NPC
1287
1288 1@xm_d,1,5,3    script  #bssk01 CLEAR_NPC,{
1289         end;
1290 OnStart:
1291         .@r = rand(1,3);
1292         if (.@r == 1)
1293                 donpcevent instance_npcname("#bssk02") + "::OnStart";
1294         else if (.@r == 2)
1295                 donpcevent instance_npcname("#bssk03") + "::OnStart";
1296         end;
1297 OnInstanceInit:
1298         disablenpc instance_npcname( strnpcinfo(0) );
1299         end;
1300 }
1301
1302 1@xm_d,1,5,3    script  #bssk02 CLEAR_NPC,{
1303         end;
1304 OnStart:
1305         donpcevent instance_npcname("#finalbs2") + "::OnTalk";
1306         for ( .@i = 1; .@i < 5; .@i++ )
1307                 donpcevent instance_npcname( "#crssk"+ .@i ) + "::OnStart";
1308         end;
1309 OnInstanceInit:
1310         disablenpc instance_npcname( strnpcinfo(0) );
1311         end;
1312 }
1313
1314 1@xm_d,1,5,3    script  #bssk03 CLEAR_NPC,{
1315         end;
1316 OnStart:
1317         .@event$ = instance_npcname( strnpcinfo(0) ) + "::OnMyMobDead";
1318         killmonster 'xm_d_map$, .@event$;
1319         while (1) {
1320                 getunitdata 'celene_id, .@data;
1321                 .@x = .@data[UMOB_X] + rand(1,20) - 10;
1322                 .@y = .@data[UMOB_Y] + rand(1,20) - 10;
1323                 monster 'xm_d_map$,.@x,.@y, "#f_w_1",3038,1, .@event$;// HIDDEN_MOB7
1324                 .@mon_num++;
1325                 if (.@mon_num > 20)
1326                         break;
1327                 sleep 200;
1328         }
1329         sleep 6000;
1330         killmonster 'xm_d_map$, .@event$;
1331         end;
1332
1333 OnMyMobDead:
1334         end;
1335
1336 OnInstanceInit:
1337         hideonnpc instance_npcname( strnpcinfo(0) );
1338         end;
1339 }
1340
1341 1@xm_d,1,5,3    script  #crssk1 CLEAR_NPC,{
1342         end;
1343 OnStart:
1344         .@event$ = instance_npcname( strnpcinfo(0) ) + "::OnMyMobDead";
1345         killmonster 'xm_d_map$, .@event$;
1346         getunitdata 'celene_id, .@data;
1347         setarray .@coord[0], .@data[UMOB_X], .@data[UMOB_Y];
1348         .@num = atoi(strnpcinfo(2));
1349         .@index = ( .@num > 2 ? 1 : 0 );// x or y
1350         .@signe = pow(-1,.@num+1);
1351         while(1) {
1352                 .@coord[.@index] = .@coord[.@index] + (2 * .@signe);
1353                 .@coord[!.@index] = .@coord[!.@index] + rand(0,2) - 1;
1354                 monster 'xm_d_map$,.@coord[0], .@coord[1], "#f_w_1",3038,1, .@event$;
1355                 if (.@coord[0] < 211 || .@coord[0] > 241 || .@coord[1] < 166 || .@coord[1] > 201)
1356                         break;
1357                 sleep 200;
1358         }
1359         sleep 6000;
1360         killmonster 'xm_d_map$, .@event$;
1361         end;
1362 OnMyMobDead:
1363         end;
1364
1365 OnInstanceInit:
1366         hideonnpc instance_npcname( strnpcinfo(0) );
1367         end;
1368 }
1369 1@xm_d,1,5,3    duplicate(#crssk1)      #crssk2 CLEAR_NPC
1370 1@xm_d,1,5,3    duplicate(#crssk1)      #crssk3 CLEAR_NPC
1371 1@xm_d,1,5,3    duplicate(#crssk1)      #crssk4 CLEAR_NPC
1372
1373 1@xm_d,233,183,0        script  #kimion1        -1,7,7,{
1374 OnTouch_:
1375         disablenpc instance_npcname("#kimion1");
1376         donpcevent instance_npcname("Celine Kimi#2") + "::OnStart";
1377         end;
1378 OnInstanceInit:
1379         disablenpc instance_npcname( strnpcinfo(0) );
1380         end;
1381 }
1382
1383 1@xm_d,233,183,3        script  Celine Kimi#2   4_F_KIMI,{
1384         mes "[Celine Kimi]";
1385         mes "You also... come here to kill me?";
1386         close;
1387
1388 OnStart:
1389         npctalk "Celine Kimi: You also... come here to kill me?";
1390         specialeffect EF_MAPPILLAR2;
1391         sleep 5000;
1392         disablenpc instance_npcname("Celine Kimi#2");
1393         donpcevent instance_npcname("#finalbs2") + "::OnStart";
1394         end;
1395 OnInstanceInit:
1396         disablenpc instance_npcname( strnpcinfo(0) );
1397         end;
1398 }
1399
1400 1@xm_d,228,183,0        script  #bgm03  -1,25,25,{
1401 OnTouch:
1402         playBGM "123";
1403         end;
1404 OnInstanceInit:
1405         disablenpc instance_npcname( strnpcinfo(0) );
1406         end;
1407 }
1408
1409 1@xm_d,1,5,3    script  #heal_c CLEAR_NPC,{
1410         end;
1411 OnStart:
1412         if (rand(1,10) > 4)
1413                 initnpctimer;
1414         end;
1415 OnTimer3000:
1416         mapannounce 'xm_d_map$, "Celine Kimi and her phantom are shared their strength. They will be stronger than ever!",bc_map,"0xff6666";
1417         stopnpctimer;
1418         end;
1419
1420 OnInstanceInit:
1421         disablenpc instance_npcname( strnpcinfo(0) );
1422         end;
1423 }
1424
1425 1@xm_d,1,5,3    script  #finalbs_e      CLEAR_NPC,{
1426         end;
1427 OnStart:
1428         mapannounce 'xm_d_map$, "Celine Kimi: It is no use to defeat me! My body will be restored.",bc_map,"0xff6666",FW_NORMAL,15;
1429         enablenpc instance_npcname("#fac6wp");
1430         enablenpc instance_npcname("#jeton2");
1431         enablenpc instance_npcname("Catherine Jet Johnson#6");
1432         for ( .@i = 1; .@i <= 10; .@i++ )
1433                 enablenpc instance_npcname("Packaged Present#"+ .@i);
1434         sleep 6000;
1435         mapannounce 'xm_d_map$, "Catherine Jet Johnson's yell: Are you okay? Flee to the south emergency exit!",bc_map,"0xffff00";
1436         end;
1437
1438 OnInstanceInit:
1439         disablenpc instance_npcname( strnpcinfo(0) );
1440         end;
1441 }
1442
1443 1@xm_d,218,145,0        script  #jeton2 -1,4,4,{
1444 OnTouch_:
1445         disablenpc instance_npcname("#jeton2");
1446         donpcevent instance_npcname("Catherine Jet Johnson#6") + "::OnStart";
1447         end;
1448 OnInstanceInit:
1449         disablenpc instance_npcname( strnpcinfo(0) );
1450         end;
1451 }
1452
1453 1@xm_d,218,145,5        script  Catherine Jet Johnson#6 4_F_SKULL06GIRL,{
1454         end;
1455 OnStart:
1456         sleep 1000;
1457         npctalk "Catherine Jet Johnson: Unfortunately, I am failed to persuade Kimi.";
1458         sleep 3000;
1459         npctalk "Catherine Jet Johnson: What was the voice of phantom? Why it torments Kimi so harshly...";
1460         sleep 4000;
1461         npctalk "Catherine Jet Johnson: I guess that the curse of my face was form the unidentified voice.";
1462         sleep 4000;
1463         npctalk "Catherine Jet Johnson: Anyway, even Kimi, saying hates everyone, has collected her recollections here a lot.";
1464         sleep 6000;
1465         npctalk "Catherine Jet Johnson: I will put this thing safely even if her soul will return and she won't be disappointed.";
1466         sleep 5000;
1467         npctalk "Catherine Jet Johnson: Thanks to you, everything that I have wondered is completely resolved. Please call me again if you are going to send her to Heaven next time.";
1468         sleep 5000;
1469         npctalk "Catherine Jet Johnson: I will open the exit way out. I will go outside first, so just follow me.";
1470         sleep 3000;
1471         disablenpc instance_npcname("Catherine Jet Johnson#6");
1472         enablenpc instance_npcname("#exwp1");
1473         end;
1474 OnInstanceInit:
1475         disablenpc instance_npcname( strnpcinfo(0) );
1476         end;
1477 }
1478
1479 1@xm_d,218,150,5        script  #exwp1  PORTAL,{
1480         mes "Will you exit?";
1481         next;
1482         if (select( "Take a look around", "Go outside" ) == 1) {
1483                 mes "Stop the machine.";
1484                 close;
1485         }
1486         close2;
1487         warp "xmas",233,300;
1488         end;
1489
1490 OnInstanceInit:
1491         disablenpc instance_npcname( strnpcinfo(0) );
1492         end;
1493 }
1494
1495 1@xm_d,210,141,3        script  Packaged Present#1      4_TREASURE_BOX,{
1496         specialeffect EF_COIN;
1497         disablenpc instance_npcname( strnpcinfo(0) );
1498         initnpctimer;
1499         end;
1500
1501 OnTimer1000:
1502         switch( atoi(strnpcinfo(2)) ) {
1503         case 1:
1504                 .@num = rand(4,8);
1505                 for ( .@i = 0; .@i < .@num; .@i++ )
1506                         makeitem 7642,1, 'xm_d_map$, rand(208,212), rand(139,143);// Bloody_Coin
1507                 if (rand(1,1000) > 150)
1508                         makeitem 644,1, 'xm_d_map$,209,141;// Gift_Box;
1509                 if (rand(1,1000) > 600)
1510                         makeitem 617,1, 'xm_d_map$,210,141;// Old_Violet_Box;
1511                 if (rand(1,1000) > 900)
1512                         makeitem 22534,1, 'xm_d_map$,211,141;// Closedmind_Box
1513                 break;
1514         case 2:
1515                 .@num = rand(3,7);
1516                 for ( .@i = 0; .@i < .@num; .@i++ )
1517                         makeitem 7642,1, 'xm_d_map$, rand(212,216), rand(139,143);// Bloody_Coin
1518                 if (rand(1,1000) > 400)
1519                         makeitem 603,1, 'xm_d_map$,213,141;// Old_Blue_Box
1520                 if (rand(1,1000) > 700)
1521                         makeitem 616,1, 'xm_d_map$,214,141;// Old_Card_Album
1522                 if (rand(1,1000) > 950)
1523                         makeitem 13442,1, 'xm_d_map$,215,141;// Old_Parasol
1524                 break;
1525         case 3:
1526                 .@num = rand(2,6);
1527                 for ( .@i = 0; .@i < .@num; .@i++ )
1528                         makeitem 7642,1, 'xm_d_map$, rand(216,220), rand(139,143);// Bloody_Coin
1529                 if (rand(1,1000) > 850)
1530                         makeitem 7229,1, 'xm_d_map$,217,141;// Silver_Bullion
1531                 if (rand(1,1000) > 800)
1532                         makeitem 12246,1, 'xm_d_map$,218,141;// Magic_Card_Album
1533                 if (rand(1,1000) > 950)
1534                         makeitem 2486,1, 'xm_d_map$,219,141;// Shadow_Walk_
1535                 break;
1536         case 4:
1537                 .@num = rand(4,8);
1538                 for ( .@i = 0; .@i < .@num; .@i++ )
1539                         makeitem 7642,1, 'xm_d_map$, rand(220,224), rand(139,143);// Bloody_Coin
1540                 if (rand(1,1000) > 700)
1541                         makeitem 7228,1, 'xm_d_map$,221,141;// Gold_Bullion
1542                 if (rand(1,1000) > 600)
1543                         makeitem 617,1, 'xm_d_map$,222,141;// Old_Violet_Box
1544                 if (rand(1,1000) > 900)
1545                         makeitem 22534,1, 'xm_d_map$,223,141;// Closedmind_Box
1546                 break;
1547         case 5:
1548                 .@num = rand(3,7);
1549                 for ( .@i = 0; .@i < .@num; .@i++ )
1550                         makeitem 7642,1, 'xm_d_map$, rand(224,228), rand(139,143);// Bloody_Coin
1551                 if (rand(1,1000) > 150)
1552                         makeitem 644,1, 'xm_d_map$,225,141;// Gift_Box
1553                 if (rand(1,1000) > 700)
1554                         makeitem 616,1, 'xm_d_map$,226,141;// Old_Card_Album
1555                 if (rand(1,1000) > 950)
1556                         makeitem 2976,1, 'xm_d_map$,227,141;// Red_Lantern
1557                 break;
1558         case 6:
1559                 .@num = rand(2,6);
1560                 for ( .@i = 0; .@i < .@num; .@i++ )
1561                         makeitem 2976,1, 'xm_d_map$, rand(208,212), rand(134,138);// Red_Lantern
1562                 if (rand(1,1000) > 400)
1563                         makeitem 603,1, 'xm_d_map$,209,136;// Old_Blue_Box
1564                 if (rand(1,1000) > 800)
1565                         makeitem 12246,1, 'xm_d_map$,210,136;// Magic_Card_Album
1566                 if (rand(1,1000) > 950)
1567                         makeitem 2977,1, 'xm_d_map$,211,136;// Hurt_Mind
1568                 break;
1569         case 7:
1570                 .@num = rand(4,8);
1571                 for ( .@i = 0; .@i < .@num; .@i++ )
1572                         makeitem 7642,1, 'xm_d_map$, rand(212,216), rand(134,138);// Bloody_Coin
1573                 if (rand(1,1000) > 850)
1574                         makeitem 7229,1, 'xm_d_map$,213,136;// Silver_Bullion
1575                 if (rand(1,1000) > 600)
1576                         makeitem 617,1, 'xm_d_map$,214,136;// Old_Violet_Box
1577                 if (rand(1,1000) > 900)
1578                         makeitem 22534,1, 'xm_d_map$,215,136;// Closedmind_Box
1579                 break;
1580         case 8:
1581                 .@num = rand(3,7);
1582                 for ( .@i = 0; .@i < .@num; .@i++ )
1583                         makeitem 7642,1, 'xm_d_map$, rand(216,220), rand(134,138);// Bloody_Coin
1584                 if (rand(1,1000) > 700)
1585                         makeitem 7228,1, 'xm_d_map$,217,136;// Gold_Bullion
1586                 if (rand(1,1000) > 700)
1587                         makeitem 616,1, 'xm_d_map$,218,136;// Old_Card_Album
1588                 if (rand(1,1000) > 950)
1589                         makeitem 2978,1, 'xm_d_map$,219,136;// KindHeart
1590                 break;
1591         case 9:
1592                 .@num = rand(2,6);
1593                 for ( .@i = 0; .@i < .@num; .@i++ )
1594                         makeitem 7642,1, 'xm_d_map$, rand(220,224), rand(134,138);// Bloody_Coin
1595                 if (rand(1,1000) > 150)
1596                         makeitem 644,1, 'xm_d_map$,221,136;// Gift_Box
1597                 if (rand(1,1000) > 800)
1598                         makeitem 12246,1, 'xm_d_map$,222,136;// Magic_Card_Album
1599                 if (rand(1,1000) > 950)
1600                         makeitem 18848,1, 'xm_d_map$,223,136;// Lush_Rose
1601                 break;
1602         case 10:
1603                 .@num = rand(4,8);
1604                 for ( .@i = 0; .@i < .@num; .@i++ )
1605                         makeitem 7642,1, 'xm_d_map$, rand(224,228), rand(134,138);// Bloody_Coin
1606                 if (rand(1,1000) > 400)
1607                         makeitem 603,1, 'xm_d_map$,225,136;// Old_Blue_Box
1608                 if (rand(1,1000) > 600)
1609                         makeitem 617,1, 'xm_d_map$,226,136;// Old_Violet_Box
1610                 if (rand(1,1000) > 900)
1611                         makeitem 22534,1, 'xm_d_map$,227,136;// Closedmind_Box
1612                 break;
1613         }
1614         stopnpctimer;
1615         end;
1616
1617 OnInstanceInit:
1618         disablenpc instance_npcname( strnpcinfo(0) );
1619         end;
1620 }
1621 1@xm_d,214,141,3        duplicate(Packaged Present#1)   Packaged Present#2      4_TREASURE_BOX
1622 1@xm_d,218,141,3        duplicate(Packaged Present#1)   Packaged Present#3      4_TREASURE_BOX
1623 1@xm_d,222,141,3        duplicate(Packaged Present#1)   Packaged Present#4      4_TREASURE_BOX
1624 1@xm_d,226,141,3        duplicate(Packaged Present#1)   Packaged Present#5      4_TREASURE_BOX
1625 1@xm_d,210,136,3        duplicate(Packaged Present#1)   Packaged Present#6      4_TREASURE_BOX
1626 1@xm_d,214,136,3        duplicate(Packaged Present#1)   Packaged Present#7      4_TREASURE_BOX
1627 1@xm_d,218,136,3        duplicate(Packaged Present#1)   Packaged Present#8      4_TREASURE_BOX
1628 1@xm_d,222,136,3        duplicate(Packaged Present#1)   Packaged Present#9      4_TREASURE_BOX
1629 1@xm_d,226,136,3        duplicate(Packaged Present#1)   Packaged Present#10     4_TREASURE_BOX
1630
1631 // Warps
1632 //==========================================
1633 1@xm_d,79,129,0 warp2   #fac1wp2        2,2,1@xm_d,73,129
1634 1@xm_d,184,109,0        warp2   #fac2wp2        2,2,1@xm_d,170,129
1635 1@xm_d,130,178,0        warp2   #fac3wp 2,2,1@xm_d,130,193
1636 1@xm_d,130,184,0        warp2   #fac3wp2        2,2,1@xm_d,129,173
1637 1@xm_d,107,208,0        warp2   #fac4wp 2,2,1@xm_d,87,208
1638 1@xm_d,95,208,0 warp2   #fac4wp2        2,2,1@xm_d,115,208
1639 1@xm_d,152,208,0        warp2   #fac5wp 2,2,1@xm_d,167,208
1640 1@xm_d,205,159,0        warp2   #fac6wp 2,2,1@xm_d,205,147
1641
1642 // Instance GM Functions :: mx_xm_ad
1643 //==========================================
1644 1@xm_d,1,1,3    script  #adsw   CLEAR_NPC,{
1645         if (callfunc("F_GM_NPC",1854,0) == 1) {
1646                 mes "[Time Manager]";
1647                 mes "What time would you like to return?";
1648                 next;
1649                 switch (select("Cancel:Factory No.1 Complete:Factory No.2 Complete:Factory No.3 Complete:Boss Start:Boss Complete")) {
1650                 case 1:
1651                         break;
1652                 case 2:
1653                         transform 1246,180000;
1654                         enablenpc instance_npcname("#fac1bs");
1655                         mapannounce 'xm_d_map$, "Coordinator's announcement: Huh? Where's everyone! How dare you workers to be absent their line and muck around!",bc_map,"0xff8800";
1656                         warp 'xm_d_map$,70,125;
1657                         break;
1658                 case 3:
1659                         for ( .@i = 1; .@i <= 10; ++.@i )
1660                                 disablenpc instance_npcname( "Worker#" + .@i );
1661                         donpcevent instance_npcname("#fac2wpc") + "::OnStart";
1662                         warp 'xm_d_map$,131,210;
1663                         break;
1664                 case 4:
1665                         donpcevent instance_npcname("#fac3ct3") + "::OnEnd";
1666                         warp 'xm_d_map$,131,210;
1667                         break;
1668                 case 5:
1669                         donpcevent instance_npcname("#finalbs2") + "::OnStart";
1670                         warp 'xm_d_map$,215,182;
1671                         break;
1672                 case 6:
1673                         donpcevent instance_npcname("#finalbs2") + "::OnEnd";
1674                         warp 'xm_d_map$,215,182;
1675                         break;
1676                 }
1677         }
1678         close;
1679 }
1680
1681 1@xm_d,3,1,3    script  #adsw2  CLEAR_NPC,{
1682         if (callfunc("F_GM_NPC",1854,0) == 1) {
1683                 getunitdata 'Antonio, .@mob;
1684                 mapannounce 'xm_d_map$, "Factory announcement: Exist in " + .@mob[UMOB_X] + " - " + .@mob[UMOB_Y] + ".",bc_map,"0x00ff44";
1685         }
1686         end;
1687 }