OSDN Git Service

First version
[st-ro/stro.git] / npc / custom / etc / marriage.txt
1 //===== rAthena Script =======================================
2 //= Wedding Script
3 //===== By: ==================================================
4 //= AppleGirl, Evera
5 //===== Current Version: =====================================
6 //= 2.9
7 //===== Compatible With: =====================================
8 //= rAthena Project
9 //===== Description: =========================================
10 //= Fully working wedding script for all kind of weddings
11 //===== Additional Comments: =================================
12 // 1.1 Lesbian and Gay Weddings [ShadowLady]
13 // 2.0 Complete Rewrite [Skotlex]
14 // 2.9 Somewhat iRO-official NPC names [DracoRPG]
15 //============================================================
16
17 // Configuration Variables: 
18 -       script  marriage_init   -1,{
19 OnInit:
20         set $@wed_allow, 0;     //If 1, allows same sex marriages.
21         set $@wed_veil, 0;      //Set to 0 to disable veil check on the bride
22
23 //Id of the item that is traded for the wedding ring (use 0 to disable):
24         set $@wed_ring, 2613;
25
26         set $@wed_groom_reg, 1300000;   //Registration cost for the Groom
27         set $@wed_bride_reg, 1200000; //Registration cost for the Bride
28         set $@wed_divorce_fee, 50000;   //Divorcing fee
29         set $@wedding_effect, 1; //On who to display the FX: 0: Priest, 1: Bride, 2: Groom
30         end;
31 }
32
33 // Other Configuration:
34 // Line 61,62: Priest location, sprite and name.
35 // Line 437,438: Registration location, sprite and name. 
36 // Line 813,814: Divorcing location, sprite and name.
37
38 // Variable Notes:
39 // $wed_progress        Signals that there is a wedding in progress
40 // $wed_groom$ - Groom's name storage
41 // $wed_groom_sex - Groom's gender (for same marriage ring giving)
42 // $wed_bride$ - Bride's name storage
43 // $wed_bride_sex - Groom's gender (for same marriage ring giving)
44 // $wed_groom_progress - Notes the progress on the groom's part
45 // $wed_bride_progress - Notes the progress on the bride's part
46 // 0: Not registered. 1: Registered. 2: Accepted the partner. 3: Ready to
47 // Retrieve the ring. 4: Retrieved the ring. 5: All set to be wed. 6: Already
48 // a couple.
49 // ceremony.
50 // $wedding_effect_id - When wedding_effect is enabled, sets the ID of the
51 // player to show the effect on.
52 // $divorce_progress    signals that there is a divorce in progress
53 // $@divorcer$ name of the person who requested divorce
54 // $@divorcee id of the partner, who has to accept the divorce and pay.
55
56 //The Priest - official iRO sprite & in-dialog name (on-map name not confirmed)
57 prt_church,100,123,4    script  Vomars  60,{
58         set @name$,"Vomars";
59
60         function SF_wed_end;
61         function SF_equip_check;
62         function SF_Groom;
63         function SF_Bride;
64         function SF_AcceptGroom;
65         function SF_AcceptBride;
66         function SF_RetrieveRingM;
67         function SF_RetrieveRingF;
68         function SF_RingsAccepted;
69         function SF_StartCeremony;
70         
71         if (getpartnerid() > 0) {
72                 mes "["+@name$+"]";
73                 mes "You have my blessings, have a wonderful married life.";
74                 close;
75         }
76         if ($wed_progress == 0) { // Official iRO dialog
77                 mes "["+@name$+"]";
78                 mes "You must apply for";
79                 mes "marriage with Happy Marry";
80                 mes "before you can get married.";
81                 mes "Happy Marry will let you know";
82                 mes "what else you'll need to do";
83                 mes "to prepare for marriage";
84                 close;
85         } // End official iRO dialog
86         
87         if (strcharinfo(0) == $wed_groom$) {
88                 SF_Groom();
89                 end;
90         }
91         if (strcharinfo(0) == $wed_bride$) {
92                 SF_Bride();
93                 end;
94         }
95         mes "["+@name$+"]";
96         if ($wed_groom_progress == 0 || $wed_bride_progress == 0) {
97                 mes "There is a wedding being planned. I would appreciate it if you would not interrupt me.";
98                 close;
99         }
100         if ($wed_groom_progress == 6) {
101                 mes "I am wedding "+$wed_groom$+" and "+$wed_bride$+", and it's already too late to object. Please let me continue.";
102                 close;
103         }
104         mes "I am going to wed "+$wed_groom$+" and "+$wed_bride$+", do you have an objection to it?";
105         if (select("Sorry, please go on.","Yes, I actually do.") == 2) {
106                 //Abort
107                 npctalk @name$ +" : Ladies and gentlemen, "+strcharinfo(0)+" has an objection to the wedding!";
108                 SF_wed_end();
109                 mes "Why should they not be wed?";
110                 input $@msg$;
111                 npctalk @name$ +" : "+ strcharinfo(0) +"'s objection is: "+$@msg$;
112                 emotion e_sob;
113                 mes "I see...";
114         } else
115                 mes "Very well, go sit and enjoy the ceremony.";
116         close;
117
118 function SF_Groom {
119         if ($wed_bride_progress == 0) {
120                 mes "["+@name$+"]";
121                 mes "Looks like your bride has yet to arrive and register.";
122                 close;
123         }
124         if (SF_equip_check() == 0)
125                 close;
126
127         switch($wed_groom_progress) {
128         case 1:
129                 SF_AcceptBride();
130                 break;
131         case 2:
132                 mes "["+@name$+"]";
133                 mes "I am waiting for your partner to accept you to start the ceremony.";
134                 close;
135         case 3:
136                 SF_RetrieveRingM();
137                 break;
138         case 4:
139                 mes "["+@name$+"]";
140                 mes "Your partner's wedding ring hasn't been retrieved yet. The ceremony will start as soon as you both have claimed your rings.";
141                 close;
142         case 5:
143                 mes "["+@name$+"]";
144                 SF_StartCeremony();
145                 break;
146         default:
147                 mes "["+@name$+"]";
148                 mes "Please don't interrupt me now.";
149                 close;
150         }
151 }
152
153 function SF_Bride {
154         if ($wed_groom_progress == 0) {
155                 mes "["+@name$+"]";
156                 mes "Looks like your groom has yet to arrive and register.";
157                 close;
158         }
159
160         if (SF_equip_check() == 0)
161                 close;
162
163         switch ($wed_bride_progress) {
164         case 1:
165                 SF_AcceptGroom();
166                 break;
167         case 2:
168                 mes "["+@name$+"]";
169                 mes "I am waiting for your partner to accept you to start the ceremony.";
170                 close;
171         case 3:
172                 SF_RetrieveRingF();
173                 break;
174         case 4:
175                 mes "["+@name$+"]";
176                 mes "Your partner's wedding ring hasn't been retrieved yet. The ceremony will start as soon as you both have claimed your rings.";
177                 close;
178         case 5:
179                 mes "["+@name$+"]";
180                 SF_StartCeremony();
181                 break;
182         default:
183                 mes "["+@name$+"]";
184                 mes "Please don't interrupt me now.";
185                 close;
186         }
187 }
188
189 function SF_AcceptGroom {
190         mes "["+@name$+"]";
191         mes $wed_bride$+", "+$wed_groom$+" has requested to be your husband for the rest of your life. Do you accept?";
192         next;
193         switch(select("I need time to think about it.","No, I don't!","Yes, I do!")) {
194         case 1:
195                 mes "["+@name$+"]";
196                 mes "You what!?";
197                 mes "err.. *cough* *cough* very well... come back after you've made up your mind.";
198                 emotion e_ag;
199                 close;
200         case 2:
201                 mes "["+@name$+"]";
202                 mes "!!";
203                 mes "Ah... err... ehm... okay. You two seem to have some differences to settle first.";
204                 close2;
205                 emotion e_omg;
206                 npctalk @name$ +" : Ladies and gentlemen, "+$wed_bride$+" has rejected to marry "+$wed_groom$+"!";
207                 SF_wed_end();
208                 break;
209         case 3:
210                 set $wed_bride_progress,2;
211                 if ($wed_groom_progress == 2) {
212                         SF_RingsAccepted();
213                         break;
214                 }
215                 emotion e_ok;
216                 mes "["+@name$+"]";
217                 mes "After your groom approves, you will be given your rings, the ceremony will begin and you will be officially married.";
218                 close;
219         }
220 }
221
222 function SF_AcceptBride {
223         mes "["+@name$+"]";
224         mes $wed_groom$+", "+$wed_bride$+" has requested to be your wife for the rest of your life. Do you accept?";
225         next;
226         switch(select("I need time to think about it.","No, I don't!","Yes, I do!")) {
227         case 1:
228                 mes "["+@name$+"]";
229                 mes "You what!?";
230                 mes "err.. *cough* *cough* very well... come back after you've made up your mind.";
231                 emotion e_ag;
232                 close;
233         case 2:
234                 mes "["+@name$+"]";
235                 mes "!!";
236                 mes "Ah... err... ehm... okay. You two seem to have some differences to settle first.";
237                 emotion e_omg;
238                 close2;
239                 npctalk @name$ +" : Ladies and gentlemen, "+$wed_groom$+" has rejected to marry "+$wed_bride$+"!";
240                 SF_wed_end();
241                 break;
242         case 3:
243                 set $wed_groom_progress,2;
244                 if ($wed_bride_progress == 2) {
245                         SF_RingsAccepted();
246                         break;
247                 }
248                 emotion e_ok;
249                 mes "["+@name$+"]";
250                 mes "After your bride approves, you will be given your rings, the ceremony will begin and you will be officially married.";
251                 close;
252         }
253 }
254
255 function SF_RingsAccepted {
256         mes "["+@name$+"]";
257         mes "Now that you both have accepted, the wedding will begin. Please come forth, you and your partner, to retrieve your rings.";
258         set $wed_bride_progress,3;
259         set $wed_groom_progress,3;
260         announce $wed_groom$+" and "+$wed_bride$+"'s wedding ceremony will be held at the church!",8;
261         close2;
262         emotion e_lv;
263         npctalk @name$ +" : May the groom and bride please step forward and retrieve their rings?";
264 }
265
266 function SF_RetrieveRingM {
267         mes "["+@name$+"]";
268         if ($@wed_ring && countitem($@wed_ring) < 1) {
269                 mes "What happened to your "+getitemname($@wed_ring)+"? You didn't lose it... did you? We need it to continue with the ceremony!";
270                 close;
271         }
272         if ($wed_bride_sex)
273                 set @item, 2634;        //Groom's wedding ring
274         else
275                 set @item, 2635;        //Bride's wedding ring
276         if (getnameditem(@item,$wed_groom$) == 0) {
277                 mes "You don't seem to have enough space to carry the ring... go free up some space and come back to reclaim your partner's ring.";
278                 close;
279         }
280         mes "Here's the wedding ring for your bride.";
281         if ($@wed_ring) delitem $@wed_ring,1;
282         set $wed_groom_progress,4;
283         
284         if ($wed_bride_progress == 4)
285                 SF_StartCeremony();
286         else {
287                 mes "Once your bride retrieves the ring, the ceremony will begin.";
288                 close;
289         }
290 }
291
292 function SF_RetrieveRingF {
293         mes "["+@name$+"]";
294         if ($@wed_ring && countitem($@wed_ring) < 1) {
295                 mes "What happened to your "+getitemname($@wed_ring)+"? You didn't lose it... did you? We need it to continue with the ceremony!";
296                 close;
297         }
298         if ($wed_groom_sex)
299                 set @item, 2634;        //Groom's wedding ring
300         else
301                 set @item, 2635;        //Bride's wedding ring
302
303         if (getnameditem(@item,$wed_bride$) == 0) {
304                 mes "You don't seem to have enough space to carry the ring... go free up some space and come back to reclaim your partner's ring.";
305                 close;
306         }
307         mes "Here's the wedding ring for your groom.";
308         if ($@wed_ring) delitem $@wed_ring,1;
309         set $wed_bride_progress,4;
310
311         if ($wed_groom_progress == 4)
312                 SF_StartCeremony();
313         else {
314                 mes "Once your groom retrieves the ring, the ceremony will begin.";
315                 close;
316         }
317 }
318
319 function SF_StartCeremony {
320         mes "I will now start the wedding ceremony, and you will be declared forth husband and wife.";
321         set $wed_bride_progress,5;
322         set $wed_groom_progress,5;
323         set $@msg$,$wed_groom$;
324         if (strcharinfo(0) == $wed_groom$)
325                 set $@msg$,$wed_bride$;
326         if (marriage($@msg$) == 0) {
327                 next;
328                 mes "["+@name$+"]";
329                 mes "Where is "+$@msg$+"?? I can't marry you both if one is missing...";
330                 close;
331         }
332         set $wed_bride_progress,6;
333         set $wed_groom_progress,6;
334         initnpctimer;
335         close;
336 }
337
338 OnTimer1000:
339         npctalk @name$ +" : Ladies and Gentlemen, We will now join in holy matrimony these two lovers.";
340         end;
341         
342 OnTimer5000:
343         npctalk @name$ +" : Now more than ever, will both of your lives be entwined together as so will be your souls.";
344         end;
345
346 OnTimer10000:
347         npctalk @name$ +" : You will both honor and cherish each other through the best and worst of times.";
348         end;
349         
350 OnTimer15000:
351         npctalk @name$ +" : The safety and well being of your other will now also be your responsibility.";
352         end;
353         
354 OnTimer20000:
355         npctalk @name$ +" : May in sickness or good health, your love burn bright like no force can extinguish it.";
356         end;
357         
358 OnTimer25000:
359         npctalk @name$ +" : Those here stand witness to these vows bestowed upon you, you must act accordingly to them.";
360         end;
361         
362 OnTimer30000:
363         npctalk @name$ +" : Understanding that, we are nothing more but mortals on this earth, but this is our triumph.";
364         end;
365         
366 OnTimer35000:
367         npctalk @name$ +" : We here will now join these two mortal entities, and create an immortal love.";
368         end;
369         
370 OnTimer40000:
371         npctalk @name$ +" : "+ $wed_groom$ +", you have accepted to take "+$wed_bride$+" as your lawfully wedded wife,";
372         end;
373         
374 OnTimer45000:
375         npctalk @name$ +" : and you, "+$wed_bride$+", have accepted take "+$wed_groom$+" as your lawfully wedded husband.";
376         end;
377
378 OnTimer50000:
379         npctalk @name$ +" : And as such, now, by the powers vested in me...";
380         end;
381
382 OnTimer55000:
383         npctalk @name$ +" : I pronounce you Husband and Wife, you may kiss the bride and exchange rings.";
384         if ($wedding_effect_id && isloggedin($wedding_effect_id))
385         {
386                 attachrid($wedding_effect_id);
387                 wedding;
388                 detachrid;
389         } else
390                 wedding;
391         SF_wed_end();
392         stopnpctimer;
393         end;
394
395 //Subfunction: Checks that the groom/bride is still wearing their stuff.
396 function SF_equip_check {
397         if (Sex == SEX_MALE && getequipid(EQI_ARMOR) != 7170) {
398                 mes "["+@name$+"]";
399                 mes "Child, what did you do with your "+getitemname(7170)+"?";
400                 emotion e_dots;
401                 return 0;
402         }
403         if (Sex == SEX_FEMALE && getequipid(EQI_ARMOR) != 2338) {
404                 mes "["+@name$+"]";
405                 mes "Child, you are supposed to wear a "+getitemname(2338)+" at all times during the ceremony...";
406                 emotion e_dots;
407                 return 0;
408         }
409         if (Sex == SEX_FEMALE && $@wed_veil && getequipid(EQI_HEAD_TOP) != 2206) {
410                 mes "["+@name$+"]";
411                 mes "Child, you can't take off your "+getitemname(2206)+" yet....";
412                 emotion e_dots;
413                 return 0;
414         }
415         return 1;
416 }
417
418 //Subfunction: Resets wedding variables.
419 function SF_wed_end {
420         set $wed_groom$,"";
421         set $wed_groom_sex, 0;
422         set $wed_bride$,"";
423         set $wed_bride_sex, 0;
424         set $wed_groom_progress,0;
425         set $wed_bride_progress,0;
426         set $wed_progress,0;
427         set $wedding_effect_id,0;
428 }
429
430 OnInit:
431         if ($wed_groom_progress==6) {
432                 SF_wed_end();
433         }
434         end;
435 }
436
437 //Registration & Status
438 prt_church,106,99,3     script  Happy Marry     67,{
439         set @name$,"Marry";
440         if (getpartnerid() > 0) {
441                 mes "["+@name$+"]";
442                 mes "Isn't marriage beautiful?";
443                 close;
444         }
445         
446         function SF_WedProgress;
447         function SF_Principles;
448         function SF_Procedure;
449         function SF_Register;
450         function SF_TryRegister;
451
452         if ($wed_progress) {
453                 SF_WedProgress();
454                 end;
455         }
456         
457         do {
458                 mes "["+@name$+"]";
459                 mes "Marriage... is such a beautiful thing.";
460                 mes "Would you like to get married with someone?";
461                 next;
462                 set @menu, select(
463                         "I'll be single forever!",
464                         "Explain the principles of marriage.",
465                         "Explain the marriage procedure.",
466                         "I want to get married with someone."
467                 );
468                 switch (@menu) {
469                 case 1: //Quit
470                         mes "["+@name$+"]";
471                         mes "In that case, enjoy your bachelor's life.";
472                         close;
473                 case 2: //Principles
474                         SF_Principles();
475                         break;
476                 case 3: //Procedure
477                         SF_Procedure();
478                         break;
479                 case 4: //Register
480                         SF_Register();
481                         break;
482                 }
483         } while (@menu > 1);
484         end;
485
486 function SF_Register {
487         if ($@wed_allow) { //Role select
488                 mes "["+@name$+"]";
489                 mes "Very well, whom would you like to register as?";
490                 next;
491                 set @submenu, select("Groom","Bride","Cancel");
492         } else if (Sex == SEX_MALE) { //Groom
493                 mes "["+@name$+"]";
494                 mes "Very well, will you register as the Groom?";
495                 next;
496                 if (select("Yes","I've changed my mind.")==1)
497                         set @submenu, 1;
498                 else
499                         set @submenu, 3;
500         } else { //Bride
501                 mes "["+@name$+"]";
502                 mes "Very well, will you register as the Bride?";
503                 next;
504                 if (select("Yes","I've changed my mind.")==1)
505                         set @submenu, 2;
506                 else
507                         set @submenu, 3;
508         }
509         switch (@submenu) {
510         case 1: //Groom
511                 SF_TryRegister(0);
512                 set $wed_progress,1;
513                 mes "["+@name$+"]";
514                 mes "You are now registered as the groom.";
515                 mes "Tell your bride to register as soon as possible.";
516                 emotion e_hmm;
517                 initnpctimer;
518                 close;
519         case 2: //Bride
520                 SF_TryRegister(1);
521                 set $wed_progress,1;
522                 mes "["+@name$+"]";
523                 mes "You are now registered as the bride.";
524                 mes "Tell your groom to register as soon as possible.";
525                 emotion e_hmm;
526                 initnpctimer;
527                 close;
528         default: //Cancel
529                 mes "["+@name$+"]";
530                 mes "Come back when you are ready.";
531                 close;
532         }
533 }
534         
535 function SF_WedProgress {
536         if (strcharinfo(0) == $wed_groom$) {
537                 mes "["+@name$+"]";
538                 if ($wed_bride_progress > 0)
539                         mes "The Priest will handle the rest of the ceremony.";
540                 else
541                         mes "Tell your bride to register, what is taking so long? Time is running out.";
542                 close;
543         }
544         if (strcharinfo(0) == $wed_bride$) {
545                 mes "["+@name$+"]";
546                 if ($wed_groom_progress > 0) 
547                         mes "The Priest will handle the rest of the ceremony.";
548                 else
549                         mes "Tell your groom to register, what is taking so long? Time is running out.";
550                 close;
551         }
552         if (($wed_groom_progress == 0) && (Sex == SEX_MALE || $@wed_allow == 1)) {
553                 mes "["+@name$+"]";
554                 mes $wed_bride$+" is waiting for the groom to register. Are you the one who came to register as groom?";
555                 next;
556                 if (select("Yes, I am.","Sorry, you got the wrong person.") == 1) {
557                         SF_TryRegister(0);
558                         stopnpctimer;
559                         set $wed_groom_progress,1;
560                         mes "["+@name$+"]";
561                         mes "Very well, now go to the Priest to reaffirm your vows and the ceremony will begin."; 
562                         emotion e_no1;
563                         close2;
564                         npctalk @name$ +" : Registration finished. "+$wed_groom$+" and "+$wed_bride$+", please reaffirm your vows with the Priest.";
565                         emotion e_no1;
566                         end;
567                 } else {
568                         mes "["+@name$+"]";
569                         mes "I see. Sorry to have bothered you then.";
570                         close;
571                 }
572
573         }
574         if (($wed_bride_progress == 0) && (Sex == SEX_FEMALE || $@wed_allow == 1)) {
575                 mes "["+@name$+"]";
576                 mes $wed_groom$+" is waiting for the bride to register. Are you the one who came to register as the bride?";
577                 next;
578                 if(select("Yes, I am.","Sorry, you got the wrong person.") == 1) {
579                         SF_TryRegister(1);
580                         stopnpctimer;
581                         mes "["+@name$+"]";
582                         mes "Very well, now go to the Priest to reaffirm your vows and the ceremony will begin."; 
583                         emotion e_no1;
584                         close2;
585                         npctalk @name$ +" : Registration finished. "+$wed_groom$+" and "+$wed_bride$+", please reaffirm your vows with the Priest.";
586                         emotion e_no1;
587                         end;
588                 } else {
589                         mes "["+@name$+"]";
590                         mes "I see. Sorry to have bothered you then.";
591                         close;
592                 }
593         }
594         mes "["+@name$+"]";
595         mes "There is a wedding in progress.";
596         mes "Would you like to know the progress of said wedding?";
597         next;
598         if (select("Yes","No") != 1) {
599                 mes "["+@name$+"]";
600                 mes "Enjoy the wedding.";
601                 close;
602         }
603         //Display Progress
604         mes "["+@name$+"]";
605         switch ($wed_groom_progress) {
606         case 0:
607                 mes "The groom has not registered yet.";
608                 break;
609         case 1:
610                 mes "The groom, "+$wed_groom$+", has yet to accept the bride.";
611                 break;
612         case 2:
613                 mes "The groom, "+$wed_groom$+", is waiting for the bride's acceptance.";
614                 break;
615         case 3:
616                 mes "The groom, "+$wed_groom$+", has yet to retrieve the ring.";
617                 break;
618         case 4:
619                 mes "The groom, "+$wed_groom$+", is waiting for the bride to retrieve the ring.";
620                 break;
621         }
622         switch ($wed_bride_progress) {
623         case 0:
624                 mes "The bride has not registered yet.";
625                 break;
626         case 1:
627                 mes "The bride, "+$wed_bride$+", has yet to confirm the groom.";
628                 break;
629         case 2:
630                 mes "The bride, "+$wed_bride$+", is waiting for the groom's acceptance.";
631                 break;
632         case 3:
633                 mes "The bride, "+$wed_bride$+", has yet to retrieve the ring.";
634                 break;
635         case 4:
636                 mes "The bride, "+$wed_bride$+", is waiting for the groom to retrieve the ring.";
637                 break;
638         case 5:
639                 mes "We are just waiting for both "+$wed_groom$+" and "+$wed_bride$+" to be together to marry them.";
640                 break;
641         case 6:
642                 mes $wed_groom$+" and "+$wed_bride$+"'s wedding ceremony is already well on it's way.";
643                 break;
644         }
645         mes "Enjoy the remaining of the wedding.";
646         close;
647 }
648
649 OnInit:
650         if ($wed_groom_progress + $wed_bride_progress == 1)
651                 initnpctimer;
652         end;
653
654 OnTimer60000:
655         //Registration failed.
656         if ($wed_bride_progress == 1)
657                 set $@msg$, $wed_bride$;
658         else
659                 set $@msg$, $wed_groom$;
660
661         npctalk @name$ +" : Registration timed out. Is it that noone wants to marry "+$@msg$+"..?";
662         emotion e_hmm;
663         
664         set $wed_groom$,"";
665         set $wed_groom_sex, 0;
666         set $wed_bride$,"";
667         set $wed_bride_sex, 0;
668         set $wed_groom_progress,0;
669         set $wed_bride_progress,0;
670         set $wed_progress,0;
671         stopnpctimer;
672         end;
673
674 //Subfunction SF_TryRegister (int bride)
675 function SF_TryRegister {
676         set @bride, getarg(0);
677         set @type$, "groom";
678         if (@bride)
679                 set @type$, "bride";
680                 
681         mes "["+@name$+"]";
682         mes "Before registering as "+@type$+", let me check if you meet all the requirements...";
683         next;
684         if (Upper == 2) {
685                 mes "["+@name$+"]";
686                 mes "Oh dear, you are too young to be thinking of marriage!";
687                 emotion e_gasp;
688                 close;
689         }
690         if (Sex == SEX_MALE)
691                 set @item, 7170;
692         else
693                 set @item, 2338;
694         
695         if (getequipid(EQI_ARMOR) != @item) {
696                 mes "["+@name$+"]";
697                 mes "You should be wearing a "+getitemname(@item)+" if you want to get married.";
698                 close;
699         }
700         if (Sex == SEX_FEMALE && $@wed_veil && getequipid(EQI_HEAD_TOP) != 2206) {
701                 mes "["+@name$+"]";
702                 mes "Where is your "+getitemname(2206)+"? It's a necessary complement to your dress.";
703                 close;
704         }
705         if ($@wed_ring && countitem($@wed_ring) < 1) {
706                 mes "["+@name$+"]";
707                 mes "Where's the ring? You need a "+getitemname($@wed_ring)+" for the ring exchange, dear.";
708                 close;
709         }
710         if (@bride)
711                 set @cost, $@wed_bride_reg;
712         else 
713                 set @cost, $@wed_groom_reg;
714
715         if (Zeny < @cost) {
716                 mes "["+@name$+"]";
717                 mes "I am sorry, but you don't have enough to pay for the registration fee.";
718                 mes "Come back once you have collected "+@cost+"z."; 
719                 close;
720         }
721         set Zeny,Zeny-@cost;
722         sc_start SC_Wedding,3600000,1; //Start Wedding Effect (SC_WEDDING)
723         if (@bride) {
724                 set $wed_bride_progress,1;
725                 set $wed_bride$,strcharinfo(0);
726                 set $wed_bride_sex, Sex;
727                 if ($@wedding_effect == 1) //Store account id for effect.
728                         set $wedding_effect_id, getcharid(3);
729         } else {
730                 set $wed_groom_progress,1;
731                 set $wed_groom$,strcharinfo(0);
732                 set $wed_groom_sex, Sex;
733                 if ($@wedding_effect == 2) //Store account id for effect.
734                         set $wedding_effect_id, getcharid(3);
735         }
736 }
737
738 //Explain wedding principles...
739 function SF_Principles {
740         mes "["+@name$+"]";
741         mes "Weddings are performed by our local Priest with the intent of promoting love and peace among the loving couples.";
742         next;
743         mes "["+@name$+"]";
744         mes "The proposal must be done with prudence and courtesy, once the wedlocks have been made, they cannot be undone.";
745         next;
746         mes "["+@name$+"]";
747         mes "The two who have been joined by marriage must remain together forever until the day death do them apart.";
748         next;
749         mes "["+@name$+"]";
750         if ($@wed_allow == 1)
751                 mes "Altough normally only males can wed females (and viceversa), our local Priest is more open-minded than that and he permits all pairings regardless of gender.";
752         else
753                 mes "Males may only wed with females, and females only with males, the church will not consent any other kind of partnerships.";
754         next;
755         mes "["+@name$+"]";
756         mes "If there is a significant other with whom you want to spend the rest of your life with, then don't be shy to propose.";
757         next;
758         mes "["+@name$+"]";
759    mes "I wish for many blessings upon couples who wish to live happily ever after...";
760         next;
761 }
762
763 //Explain the wedding procedure...
764 function SF_Procedure {
765         mes "["+@name$+"]";
766         mes "First of all, both groom and bride must register with me.";
767         next;
768         if ($@wed_allow == 1) {
769                 mes "["+@name$+"]";
770                 mes "The registration requirements are:";
771                 mes "- Males must be wearing a "+getitemname(7170)+".";
772                 mes "- Females must be wearing a "+getitemname(2338)+".";
773                 if ($@wed_veil) mes "- Females must also wear a "+getitemname(2206)+".";
774                 if ($@wed_ring) mes "- Both must own a "+getitemname($@wed_ring)+" each.";
775                 if ($@wed_groom_reg > 0) mes "- The registration fee for the groom is "+$@wed_groom_reg+"z.";
776                 if ($@wed_bride_reg > 0) mes "- The registration fee for the bride is "+$@wed_bride_reg+"z.";
777         } else {
778                 mes "["+@name$+"]";
779                 mes "The registration requirements for the groom are:";
780                 mes "- To be wearing a "+getitemname(7170)+".";
781                 if ($@wed_ring) mes "- To own a "+getitemname($@wed_ring)+".";
782                 if ($@wed_groom_reg > 0) mes "- Pay a Registration fee of "+$@wed_groom_reg+"z.";
783                 next;
784                 mes "["+@name$+"]";
785                 mes "The registration requirements for the bride are:";
786                 mes "- To be wearing a "+getitemname(2338)+".";
787                 if ($@wed_veil) mes "- To be wearing a "+getitemname(2206)+".";
788                 if ($@wed_ring) mes "- To own a "+getitemname($@wed_ring)+".";
789                 if ($@wed_bride_reg > 0) mes "- Pay a Registration fee of "+$@wed_bride_reg+"z.";
790         }
791         next;
792         mes "["+@name$+"]";
793         mes "I shouldn't need to mention this, but adopted kids are too young to get married.";
794         mes "Both groom and bride must register within a minute of each other, or the wedding will be cancelled. So be sure you both are ready and meet the registration requirements beforehand.";
795         next;
796         mes "["+@name$+"]";
797         mes "After both have registered with me, you have to go pledge your vows to the Priest and accept your registered partner. If for some reason you reject your registered partner, the wedding will be cancelled...";
798         next;
799         mes "["+@name$+"]";
800         mes "If you both accept each other, then the wedding has been decided and the ceremony will begin.";
801         if ($@wed_ring) {
802                 mes "But first, you need to get your rings ready.";
803                 next;
804                 mes "["+@name$+"]";
805                 mes "Talk to the priest once more, and he will exchange your "+getitemname($@wed_ring)+" for a wedding ring. After you both have claimed the rings for exchanging, the ceremony will begin.";
806         }
807         next;
808         mes "["+@name$+"]";
809         mes "If there are various couples who desire to marry, you should keep in order, for the Priest can only handle one wedding at a time.";
810         next;
811 }
812 }
813
814 prt_church,94,99,4      script  Sister Lisa     79,{
815         set @name$,"Lisa";
816
817         function SF_DivorceEnd;
818         function SF_InProgress;
819         
820         if ($@divorce_progress==1) {
821                 goto SF_InProgress;
822                 end;
823         }
824         
825         do {
826                 mes "["+@name$+"]";
827                 mes "Divorcing can be such a sad event...";
828                 if (getpartnerid() == 0) {
829                         mes "People shouldn't make shallow vows to others, don't you think?";
830                         close;
831                 }
832                 mes "You wouldn't want to divorce, by any chance?";
833                 next;
834                 set @menu, select(
835                         "I am happy as I am, thank you.",
836                         "Explain the divorce.",
837                         "Explain Requirements.",
838                         "I want to divorce."
839                 );
840                 switch (@menu) {
841                 case 1:
842                         mes "["+@name$+"]";
843                         mes "Good to hear.";
844                         close;
845                 case 2: //Explanation
846                         mes "["+@name$+"]";
847                         mes "Even though it is said that once the wedlocks have been made they cannot be undone, sometimes it is necessary to undo our mistakes from the past..";
848                         next;
849                         mes "["+@name$+"]";
850                         mes "It is sad, but true. If you happen to have married the wrong person, it is possible to divorce, rather than spend the rest of your life with the wrong one.";
851                         next;
852                         break;
853                 case 3: //Requirement
854                         mes "["+@name$+"]";
855                         mes "In order to file for divorce, I need you both to agree to it.";
856                         mes "After you file in for divorce, your spouse has one minute to agree, and then you will both be divorced.";
857                         if ($@wed_divorce_fee > 0) mes "The fee is of "+$@wed_divorce_fee+"z and is paid by the person who confirms the divorce, so plan ahead of time how you will divide the costs.";
858                         next;
859                         break;
860                 case 4: //Divorce
861                         mes "["+@name$+"]";
862                         mes "You should not regret the choices you've made in life.";
863                         mes "Are you positively sure about getting divorced?";
864                         next;
865                         if (select("Wait... I need to think about it.","Absolutely") != 2) {
866                                 mes "["+@name$+"]";
867                                 mes "You should think this through.";
868                                 close;
869                         } 
870                         mes "["+@name$+"]";
871                         set $@divorcee,getpartnerid();
872                         set $@divorcer$,strcharinfo(0);
873                         set $@divorce_progress,1;
874                         initnpctimer;
875                         mes "Very well, get your partner to confirm, and I will collect the fee for filing the divorce then.";
876                         close;
877                 }
878         } while (@menu > 1);
879 end;
880
881 function SF_InProgress {
882         if (strcharinfo(0) == $@divorcer$) { 
883                 mes "["+@name$+"]";
884                 mes "...I am still waiting for your partner to confirm the divorce procedure.";
885                 close;
886         }
887         if (getcharid(0) != $@divorcee) {
888                 mes "["+@name$+"]";
889                 mes "I am in the progress of divorcing "+$@divorcer$+".";
890                 mes "Do you know who the spouse is?";
891                 close;
892         }
893         //Confirm...
894         mes "["+@name$+"]";
895         mes $@divorcer$+" has asked to divorce you. If you accept, and have the fee of "+$@wed_divorce_fee+"z at hand, I will proceed to divorce you two.";
896         mes "So, should I proceed with the divorce?";
897         next;
898         if (select("I don't want to divorce....","Yes, we have agreed to this.")!=2) {
899                 mes "["+@name$+"]";
900                 mes "I hope you can work things out.";
901                 emotion e_pat;
902                 goto SF_DivorceEnd;
903                 close;
904         }
905         if (Zeny < $@wed_divorce_fee) {
906                 mes "["+@name$+"]";
907                 mes "Well, I can't file your divorce because you don't have enough for the fee. Get your partner to lend you some?";
908                 close;
909         }
910         if (!(divorce())) {
911                 mes "["+@name$+"]";
912                 mes "Where has "+$@divorcer$+" gone to? I can't divorce you unless you both are here...";
913                 emotion e_swt2;
914                 close;
915         }
916         set Zeny,Zeny-$@wed_divorce_fee;
917         announce $@divorcer$+" has just divorced "+strcharinfo(0)+"...", 8;
918         mes "["+@name$+"]";
919         mes "Your divorce has been filed. You are no longer wed.";
920         emotion e_sob;
921         goto SF_DivorceEnd;
922         close;
923 }
924
925 function SF_DivorceEnd {
926         stopnpctimer;
927         set $@divorce_progress,0;
928         set $@divorcee,0;
929         set $@divorcer$,"";
930 }
931
932 OnTimer60000:
933         npctalk @name$ +" : Divorce confirmation time's is up. Where did "+$@divorcer$+"'s spouse go...";
934         emotion e_what;
935         SF_DivorceEnd();
936         end;
937 }