1 //===== rAthena Script =======================================
3 //===== By: ==================================================
5 //===== Current Version: =====================================
7 //===== Compatible With: =====================================
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 //============================================================
17 // Configuration Variables:
18 - script marriage_init -1,{
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
23 //Id of the item that is traded for the wedding ring (use 0 to disable):
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
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.
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
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.
56 //The Priest - official iRO sprite & in-dialog name (on-map name not confirmed)
57 prt_church,100,123,4 script Vomars 60,{
61 function SF_equip_check;
64 function SF_AcceptGroom;
65 function SF_AcceptBride;
66 function SF_RetrieveRingM;
67 function SF_RetrieveRingF;
68 function SF_RingsAccepted;
69 function SF_StartCeremony;
71 if (getpartnerid() > 0) {
73 mes "You have my blessings, have a wonderful married life.";
76 if ($wed_progress == 0) { // Official iRO dialog
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";
85 } // End official iRO dialog
87 if (strcharinfo(0) == $wed_groom$) {
91 if (strcharinfo(0) == $wed_bride$) {
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.";
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.";
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) {
107 npctalk @name$ +" : Ladies and gentlemen, "+strcharinfo(0)+" has an objection to the wedding!";
109 mes "Why should they not be wed?";
111 npctalk @name$ +" : "+ strcharinfo(0) +"'s objection is: "+$@msg$;
115 mes "Very well, go sit and enjoy the ceremony.";
119 if ($wed_bride_progress == 0) {
121 mes "Looks like your bride has yet to arrive and register.";
124 if (SF_equip_check() == 0)
127 switch($wed_groom_progress) {
133 mes "I am waiting for your partner to accept you to start the ceremony.";
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.";
148 mes "Please don't interrupt me now.";
154 if ($wed_groom_progress == 0) {
156 mes "Looks like your groom has yet to arrive and register.";
160 if (SF_equip_check() == 0)
163 switch ($wed_bride_progress) {
169 mes "I am waiting for your partner to accept you to start the ceremony.";
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.";
184 mes "Please don't interrupt me now.";
189 function SF_AcceptGroom {
191 mes $wed_bride$+", "+$wed_groom$+" has requested to be your husband for the rest of your life. Do you accept?";
193 switch(select("I need time to think about it.","No, I don't!","Yes, I do!")) {
197 mes "err.. *cough* *cough* very well... come back after you've made up your mind.";
203 mes "Ah... err... ehm... okay. You two seem to have some differences to settle first.";
206 npctalk @name$ +" : Ladies and gentlemen, "+$wed_bride$+" has rejected to marry "+$wed_groom$+"!";
210 set $wed_bride_progress,2;
211 if ($wed_groom_progress == 2) {
217 mes "After your groom approves, you will be given your rings, the ceremony will begin and you will be officially married.";
222 function SF_AcceptBride {
224 mes $wed_groom$+", "+$wed_bride$+" has requested to be your wife for the rest of your life. Do you accept?";
226 switch(select("I need time to think about it.","No, I don't!","Yes, I do!")) {
230 mes "err.. *cough* *cough* very well... come back after you've made up your mind.";
236 mes "Ah... err... ehm... okay. You two seem to have some differences to settle first.";
239 npctalk @name$ +" : Ladies and gentlemen, "+$wed_groom$+" has rejected to marry "+$wed_bride$+"!";
243 set $wed_groom_progress,2;
244 if ($wed_bride_progress == 2) {
250 mes "After your bride approves, you will be given your rings, the ceremony will begin and you will be officially married.";
255 function SF_RingsAccepted {
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;
263 npctalk @name$ +" : May the groom and bride please step forward and retrieve their rings?";
266 function SF_RetrieveRingM {
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!";
273 set @item, 2634; //Groom's wedding ring
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.";
280 mes "Here's the wedding ring for your bride.";
281 if ($@wed_ring) delitem $@wed_ring,1;
282 set $wed_groom_progress,4;
284 if ($wed_bride_progress == 4)
287 mes "Once your bride retrieves the ring, the ceremony will begin.";
292 function SF_RetrieveRingF {
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!";
299 set @item, 2634; //Groom's wedding ring
301 set @item, 2635; //Bride's wedding ring
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.";
307 mes "Here's the wedding ring for your groom.";
308 if ($@wed_ring) delitem $@wed_ring,1;
309 set $wed_bride_progress,4;
311 if ($wed_groom_progress == 4)
314 mes "Once your groom retrieves the ring, the ceremony will begin.";
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) {
329 mes "Where is "+$@msg$+"?? I can't marry you both if one is missing...";
332 set $wed_bride_progress,6;
333 set $wed_groom_progress,6;
339 npctalk @name$ +" : Ladies and Gentlemen, We will now join in holy matrimony these two lovers.";
343 npctalk @name$ +" : Now more than ever, will both of your lives be entwined together as so will be your souls.";
347 npctalk @name$ +" : You will both honor and cherish each other through the best and worst of times.";
351 npctalk @name$ +" : The safety and well being of your other will now also be your responsibility.";
355 npctalk @name$ +" : May in sickness or good health, your love burn bright like no force can extinguish it.";
359 npctalk @name$ +" : Those here stand witness to these vows bestowed upon you, you must act accordingly to them.";
363 npctalk @name$ +" : Understanding that, we are nothing more but mortals on this earth, but this is our triumph.";
367 npctalk @name$ +" : We here will now join these two mortal entities, and create an immortal love.";
371 npctalk @name$ +" : "+ $wed_groom$ +", you have accepted to take "+$wed_bride$+" as your lawfully wedded wife,";
375 npctalk @name$ +" : and you, "+$wed_bride$+", have accepted take "+$wed_groom$+" as your lawfully wedded husband.";
379 npctalk @name$ +" : And as such, now, by the powers vested in me...";
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))
386 attachrid($wedding_effect_id);
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) {
399 mes "Child, what did you do with your "+getitemname(7170)+"?";
403 if (Sex == SEX_FEMALE && getequipid(EQI_ARMOR) != 2338) {
405 mes "Child, you are supposed to wear a "+getitemname(2338)+" at all times during the ceremony...";
409 if (Sex == SEX_FEMALE && $@wed_veil && getequipid(EQI_HEAD_TOP) != 2206) {
411 mes "Child, you can't take off your "+getitemname(2206)+" yet....";
418 //Subfunction: Resets wedding variables.
419 function SF_wed_end {
421 set $wed_groom_sex, 0;
423 set $wed_bride_sex, 0;
424 set $wed_groom_progress,0;
425 set $wed_bride_progress,0;
427 set $wedding_effect_id,0;
431 if ($wed_groom_progress==6) {
437 //Registration & Status
438 prt_church,106,99,3 script Happy Marry 67,{
440 if (getpartnerid() > 0) {
442 mes "Isn't marriage beautiful?";
446 function SF_WedProgress;
447 function SF_Principles;
448 function SF_Procedure;
449 function SF_Register;
450 function SF_TryRegister;
459 mes "Marriage... is such a beautiful thing.";
460 mes "Would you like to get married with someone?";
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."
471 mes "In that case, enjoy your bachelor's life.";
486 function SF_Register {
487 if ($@wed_allow) { //Role select
489 mes "Very well, whom would you like to register as?";
491 set @submenu, select("Groom","Bride","Cancel");
492 } else if (Sex == SEX_MALE) { //Groom
494 mes "Very well, will you register as the Groom?";
496 if (select("Yes","I've changed my mind.")==1)
502 mes "Very well, will you register as the Bride?";
504 if (select("Yes","I've changed my mind.")==1)
514 mes "You are now registered as the groom.";
515 mes "Tell your bride to register as soon as possible.";
523 mes "You are now registered as the bride.";
524 mes "Tell your groom to register as soon as possible.";
530 mes "Come back when you are ready.";
535 function SF_WedProgress {
536 if (strcharinfo(0) == $wed_groom$) {
538 if ($wed_bride_progress > 0)
539 mes "The Priest will handle the rest of the ceremony.";
541 mes "Tell your bride to register, what is taking so long? Time is running out.";
544 if (strcharinfo(0) == $wed_bride$) {
546 if ($wed_groom_progress > 0)
547 mes "The Priest will handle the rest of the ceremony.";
549 mes "Tell your groom to register, what is taking so long? Time is running out.";
552 if (($wed_groom_progress == 0) && (Sex == SEX_MALE || $@wed_allow == 1)) {
554 mes $wed_bride$+" is waiting for the groom to register. Are you the one who came to register as groom?";
556 if (select("Yes, I am.","Sorry, you got the wrong person.") == 1) {
559 set $wed_groom_progress,1;
561 mes "Very well, now go to the Priest to reaffirm your vows and the ceremony will begin.";
564 npctalk @name$ +" : Registration finished. "+$wed_groom$+" and "+$wed_bride$+", please reaffirm your vows with the Priest.";
569 mes "I see. Sorry to have bothered you then.";
574 if (($wed_bride_progress == 0) && (Sex == SEX_FEMALE || $@wed_allow == 1)) {
576 mes $wed_groom$+" is waiting for the bride to register. Are you the one who came to register as the bride?";
578 if(select("Yes, I am.","Sorry, you got the wrong person.") == 1) {
582 mes "Very well, now go to the Priest to reaffirm your vows and the ceremony will begin.";
585 npctalk @name$ +" : Registration finished. "+$wed_groom$+" and "+$wed_bride$+", please reaffirm your vows with the Priest.";
590 mes "I see. Sorry to have bothered you then.";
595 mes "There is a wedding in progress.";
596 mes "Would you like to know the progress of said wedding?";
598 if (select("Yes","No") != 1) {
600 mes "Enjoy the wedding.";
605 switch ($wed_groom_progress) {
607 mes "The groom has not registered yet.";
610 mes "The groom, "+$wed_groom$+", has yet to accept the bride.";
613 mes "The groom, "+$wed_groom$+", is waiting for the bride's acceptance.";
616 mes "The groom, "+$wed_groom$+", has yet to retrieve the ring.";
619 mes "The groom, "+$wed_groom$+", is waiting for the bride to retrieve the ring.";
622 switch ($wed_bride_progress) {
624 mes "The bride has not registered yet.";
627 mes "The bride, "+$wed_bride$+", has yet to confirm the groom.";
630 mes "The bride, "+$wed_bride$+", is waiting for the groom's acceptance.";
633 mes "The bride, "+$wed_bride$+", has yet to retrieve the ring.";
636 mes "The bride, "+$wed_bride$+", is waiting for the groom to retrieve the ring.";
639 mes "We are just waiting for both "+$wed_groom$+" and "+$wed_bride$+" to be together to marry them.";
642 mes $wed_groom$+" and "+$wed_bride$+"'s wedding ceremony is already well on it's way.";
645 mes "Enjoy the remaining of the wedding.";
650 if ($wed_groom_progress + $wed_bride_progress == 1)
655 //Registration failed.
656 if ($wed_bride_progress == 1)
657 set $@msg$, $wed_bride$;
659 set $@msg$, $wed_groom$;
661 npctalk @name$ +" : Registration timed out. Is it that noone wants to marry "+$@msg$+"..?";
665 set $wed_groom_sex, 0;
667 set $wed_bride_sex, 0;
668 set $wed_groom_progress,0;
669 set $wed_bride_progress,0;
674 //Subfunction SF_TryRegister (int bride)
675 function SF_TryRegister {
676 set @bride, getarg(0);
682 mes "Before registering as "+@type$+", let me check if you meet all the requirements...";
686 mes "Oh dear, you are too young to be thinking of marriage!";
695 if (getequipid(EQI_ARMOR) != @item) {
697 mes "You should be wearing a "+getitemname(@item)+" if you want to get married.";
700 if (Sex == SEX_FEMALE && $@wed_veil && getequipid(EQI_HEAD_TOP) != 2206) {
702 mes "Where is your "+getitemname(2206)+"? It's a necessary complement to your dress.";
705 if ($@wed_ring && countitem($@wed_ring) < 1) {
707 mes "Where's the ring? You need a "+getitemname($@wed_ring)+" for the ring exchange, dear.";
711 set @cost, $@wed_bride_reg;
713 set @cost, $@wed_groom_reg;
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.";
722 sc_start SC_Wedding,3600000,1; //Start Wedding Effect (SC_WEDDING)
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);
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);
738 //Explain wedding principles...
739 function SF_Principles {
741 mes "Weddings are performed by our local Priest with the intent of promoting love and peace among the loving couples.";
744 mes "The proposal must be done with prudence and courtesy, once the wedlocks have been made, they cannot be undone.";
747 mes "The two who have been joined by marriage must remain together forever until the day death do them apart.";
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.";
753 mes "Males may only wed with females, and females only with males, the church will not consent any other kind of partnerships.";
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.";
759 mes "I wish for many blessings upon couples who wish to live happily ever after...";
763 //Explain the wedding procedure...
764 function SF_Procedure {
766 mes "First of all, both groom and bride must register with me.";
768 if ($@wed_allow == 1) {
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.";
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.";
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.";
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.";
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...";
800 mes "If you both accept each other, then the wedding has been decided and the ceremony will begin.";
802 mes "But first, you need to get your rings ready.";
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.";
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.";
814 prt_church,94,99,4 script Sister Lisa 79,{
817 function SF_DivorceEnd;
818 function SF_InProgress;
820 if ($@divorce_progress==1) {
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?";
832 mes "You wouldn't want to divorce, by any chance?";
835 "I am happy as I am, thank you.",
836 "Explain the divorce.",
837 "Explain Requirements.",
845 case 2: //Explanation
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..";
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.";
853 case 3: //Requirement
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.";
862 mes "You should not regret the choices you've made in life.";
863 mes "Are you positively sure about getting divorced?";
865 if (select("Wait... I need to think about it.","Absolutely") != 2) {
867 mes "You should think this through.";
871 set $@divorcee,getpartnerid();
872 set $@divorcer$,strcharinfo(0);
873 set $@divorce_progress,1;
875 mes "Very well, get your partner to confirm, and I will collect the fee for filing the divorce then.";
881 function SF_InProgress {
882 if (strcharinfo(0) == $@divorcer$) {
884 mes "...I am still waiting for your partner to confirm the divorce procedure.";
887 if (getcharid(0) != $@divorcee) {
889 mes "I am in the progress of divorcing "+$@divorcer$+".";
890 mes "Do you know who the spouse is?";
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?";
898 if (select("I don't want to divorce....","Yes, we have agreed to this.")!=2) {
900 mes "I hope you can work things out.";
905 if (Zeny < $@wed_divorce_fee) {
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?";
912 mes "Where has "+$@divorcer$+" gone to? I can't divorce you unless you both are here...";
916 set Zeny,Zeny-$@wed_divorce_fee;
917 announce $@divorcer$+" has just divorced "+strcharinfo(0)+"...", 8;
919 mes "Your divorce has been filed. You are no longer wed.";
925 function SF_DivorceEnd {
927 set $@divorce_progress,0;
933 npctalk @name$ +" : Divorce confirmation time's is up. Where did "+$@divorcer$+"'s spouse go...";