//===== rAthena Script ======================================= 
//= Player Marriage
//===== By: ================================================== 
//= L0ne_W0lf
//===== Current Version: ===================================== 
//= 1.5
//===== Compatible With: ===================================== 
//= rAthena Project
//===== Description: ========================================= 
//= [Official Conversion]
//= Official Marriage script.
//= Added isloggedin() check, even though Aegis doesn't do it.
//= Currently does not support same-Sex marriages.
//= Old script located in: npc/custom/marriage.txt
//= - Variable in use: wedding_sign (max 1)
//= - Variable in use: $@wedding (max 1) 
//= - Variable in use: $@wed_groom$ $@wed_bride$
//===== Additional Comments: ================================= 
//= 1.0 First version. [L0ne_W0lf]
//= 1.1 Fixed a missing ")" [L0ne_W0lf]
//= 1.2 Corrected duration of Wedding status. [L0ne_W0lf]
//= 1.3 Changed permanent global variables to temporary ones. [Euphy]
//=     Added GM NPCs (commented).
//= 1.4 Added GM management function. [Euphy]
//= 1.5 Added Marriage Covenant item and VIP features. [Euphy]
//============================================================

prt_church,97,100,4	script	Wedding Staff#w	71,{
	cutin "wedding_marry01",2;
	if (countitem(6026) == 0) {

		// If the VIP system is enabled:
		// - Non-VIP players must use a Marriage Covenant to get married.
		// - VIP players may either pay the Zeny fee or use a Marriage Covenant.
		if (VIP_SCRIPT && !vip_status(VIP_STATUS_ACTIVE)) {
			mes "[Marry Happy]";
			mes "Sorry but you can't get married right now.";
			mes "The wedding is only available for subscribed players.";
			mes "But if you have a ^FF0000Marriage Covenant^000000, then you'll be able to get married!";
			goto L_End;
		}

	} else
		set .@covenant,1;
	if (Upper == 2) {
		mes "[Marry Happy]";
		mes "Hello~";
		mes "My name is Marry Happy";
		mes "and I'm here to provide you";
		mes "with information related to";
		mes "marriage. Now, did you";
		mes "have any questions?";
		next;
		if (select("I want to get married.:I don't need your help!") == 1) {
			mes "[Marry Happy]";
			mes "Oh, I'm sorry, but";
			mes "adopted characters";
			mes "aren't allowed to get";
			mes "married. For now, why";
			mes "don't you enjoy the simple";
			mes "pleasures of childhood?";
			goto L_End;
		}
		mes "[Marry Happy]";
		mes "Oh, of course you";
		mes "don't! Little children";
		mes "can't get married-- there";
		mes "are too many laws against";
		mes "that~ Aren't you the most";
		mes "adorable little thing?";
		goto L_End;
	}
	mes "[Marry Happy]";
	mes "Marriage is the beautiful";
	mes "union of two souls that have";
	mes "chosen to be together forever,";
	mes "to share their joy and lives.";
	mes "Is there a special someone";
	mes "like that in your life?";
	next;
	switch(select("Ask about Wedding Ceremony:Ask about Procedure:Apply for Wedding:We are the Invincible Single Army!")) {
	case 1:
		mes "[Marry Happy]";
		mes "Wise and benevolent";
		mes "King Tristram III used to";
		mes "conduct wedding ceremonies,";
		mes "but he's no longer able to do";
		mes "so because of his royal duties";
		mes "and freneticly paced schedule.";
		next;
		mes "[Marry Happy]";
		mes "Bishop Vomars, the bishop";
		mes "of love, is now the officiator";
		mes "of the marriage ceremony.";
		mes "He is truly a treasure to the";
		mes "Rune-Midgarts Kingdom.";
		next;
		mes "[Marry Happy]";
		mes "When you marry someone,";
		mes "it's for the rest of your life, so think carefully before making or";
		mes "accepting a marriage proposal.";
		mes "Keep in mind that a man can only";
		mes "marry a woman and vice versa.";
		next;
		mes "[Marry Happy]";
		mes "If you're lucky enough to";
		mes "find someone that you really";
		mes "want to spend the rest of your";
		mes "life with, you might want to pop the question. I hope everyone";
		mes "finds their perfect match~";
		break;
	case 2:
		mes "[Marry Happy]";
		mes "The first part of the";
		mes "wedding procedure is to";
		mes "complete the application.";
		mes "Once the bride and bridegroom";
		mes "have finished applying, they";
		mes "must form a party of two.";
		next;
		mes "[Marry Happy]";
		mes "After forming a party of two,";
		mes "the couple must then speak to";
		mes "Bishop Vomars. The bridegroom";
		mes "speaks first and must tell his";
		mes "bride's exact name to the Bishop. Otherwise, the ceremony will stop.";
		next;
		mes "[Marry Happy]";
		mes "Afterwards, the bride will";
		mes "speak to the Bishop and tell";
		mes "him the name of her groom.";
		mes "If these names are correctly";
		mes "told to the Bishop, they will";
		mes "be able to exchange rings.";
		next;
		mes "[Marry Happy]";
		mes "Once the wedding rings are";
		mes "exchanged, the couple is forever bound in matrimony. Of course,";
		mes "before this point, there are many chances to change your mind, so...";
		next;
		mes "[Marry Happy]";
		mes "If there are too many";
		mes "couples who want to get";
		mes "married at one time, please";
		mes "form a line and speak to Bishop";
		mes "Vomars in order since only one couple can be married at a time.";
		next;
		mes "[Marry Happy]";
		mes "Finally, be sure to tell";
		mes "Bishop Vomars your partner's";
		mes "exact name without wasting too much time. If you take too long,";
		mes "the ceremony will automatically stop and you'll have to try again.";
		next;
		mes "[Marry Happy]";
		mes "Brides need to remember";
		mes "that they only have 3 minutes";
		mes "to finish speaking to Bishop";
		mes "Vomars after their grooms";
		mes "have finished speaking to him.";
		next;
		if (select("Thanks, that helps a lot!:Easiest way to say my partner's name?") == 1) {
			mes "[Marry Happy]";
			mes "Well, I'm here to help";
			mes "weddings proceed as";
			mes "smoothly as possible.";
			mes "If there was something";
			mes "you didn't understand,";
			mes "feel free to ask me again.";
			goto L_End;
		}
		mes "[Marry Happy]";
		mes "The easiest way to write";
		mes "your partner's name for the";
		mes "bishop is to send a private";
		mes "message to your partner, and";
		mes "then left-click the name section that is left of the chat prompt.";
		next;
		mes "[Marry Happy]";
		mes "Press the ''Ctrl'' and ''C''";
		mes "keys to copy the name. Then,";
		mes "you can paste the name into";
		mes "the input prompt by pressing";
		mes "the ''Insert'' and ''Shift'' keys. That sounds easy, right?";
		next;
		mes "[Marry Happy]";
		mes "Alright, now let's try";
		mes "it. Practice giving me the";
		mes "name of your partner using";
		mes "the method I just described.";
		next;
		input .@partner$;
		mes "[Marry Happy]";
		mes "Alright, after you've";
		mes "decided to get married,";
		mes "come back to me and";
		mes "submit your application.";
		mes "I'll see you later, adventurer~";
		break;
	case 3:
		cutin "wedding_marry02",2;
		if (VIP_SCRIPT) {
			mes "[Marry Happy]";
			mes "^FF0000Wait!^000000";
			mes "^FF0000If your account in not a premium, you must have a Marriage Covenant to get married.^000000";
			mes "^FF0000Please check the current state of your account, and the one of your lover, before register for a wedding.^000000";
			next;
		}
		if (Sex == SEX_MALE) {
			mes "[Marry Happy]";
			mes "So you'd like to get married?";
			mes "As a groom, you need to prepare";
			if (.@covenant) {
				mes "^3377FF1 Tuxedo^000000 and give me your ^3377FF1 Marriage Covenant^000000.";
				mes "Brides have to provide their own Wedding Dresses and pay a fee";
				mes "of 1,200,000 zeny or also bring a Marriage Covenant.";
			} else {
				mes "^3377FF1 Tuxedo^000000 and pay ^3377FF1,300,000 zeny^000000.";
				mes "Brides have to provide their own Wedding Dresses and pay a fee";
				mes "of 1,200,000 zeny.";
			}
		} else {
			mes "[Marry Happy]";
			mes "So you'd like to get married?";
			mes "As a bride, you need to prepare";
			if (.@covenant) {
				mes "^3377FF1 Wedding Dress^000000 and give me your ^3377FFMarriage Covenant^000000.";
				mes "Grooms must bring a Tuxedo and pay";
				mes "1,300,000 zeny or also bring a Marriage Covenant.";
			} else {
				mes "^3377FF1 Wedding Dress^000000 and pay a fee of 1,200,000 zeny. Grooms must";
				mes "bring a Tuxedo and pay 1,300,000 zeny to get married.";
			}
		}
		next;
		mes "[Marry Happy]";
		mes "Brides and grooms also need";
		mes "to have ^3377FF1 Diamond Ring^000000 to be";
		mes "exchanged with their partners.";
		mes "You'll need all of these items";
		mes "prepared when you submit your";
		mes "wedding ceremony application.";
		next;
		mes "[Marry Happy]";
		mes "The prospective bride and";
		mes "groom must both complete";
		mes "application process before";
		mes "the wedding can take place.";
		mes "Now, would you like to";
		mes "apply for marriage?";
		next;
		if (select("Yes:No") == 1) {
			if (getpartnerid()) {
				cutin "wedding_marry02",2;
				mes "[Marry Happy]";
				mes "I'm sorry, but you can't";
				mes "apply for another marriage!";
				mes "I can't allow you to betray";
				mes "your spouse like that, and";
				mes "besides, polygamy isn't";
				mes "legal here in Rune-Midgarts.";
				break;
			}
			else if (wedding_sign == 1) {
				mes "[Marry Happy]";
				mes "Didn't you already";
				mes "complete the application?";
				mes "Hmm, make sure that your";
				mes "partner also finished the";
				mes "application process, and";
				mes "then talk to Bishop Vomars.";
				break;
			}
			else if (BaseLevel < 45) {
				mes "[Marry Happy]";
				mes "Hmm, you need to be";
				mes "strong enough to protect";
				mes "the one that you love before";
				mes "you can consider marriage.";
				mes "After you grow stronger,";
				mes "come and talk to me again.";
				goto L_End;
			}
			else if (countitem(2613) < 1) {
				mes "[Marry Happy]";
				mes "Mm? Did you forget to";
				mes "bring the Diamond Ring";
				mes "to exchange with your partner";
				mes "during the wedding ceremony?";
				mes "Look for it carefully and come";
				mes "back after you find it, okay?";
				goto L_End;
			}
			else if (Sex == SEX_FEMALE) {
				if (countitem(6026) == 0 && Zeny < 1200000) {
					mes "[Marry Happy]";
					mes "I'm sorry, but all brides";
					mes "must pay the 1,200,000";
					mes "zeny fee or bring a Marriage";
					mes "Covenant to proceed with the";
					mes "wedding ceremony. Perhaps";
					mes "you could ask your partner";
					mes "to help you with the funds?";
					goto L_End;
				}
				else if (countitem(2338) < 1) {
					mes "[Marry Happy]";
					mes "Oh dear, did you forget";
					mes "your Wedding Dress?";
					mes "Hurry and find it, then";
					mes "bring it to me-- you";
					mes "absolutely need it";
					mes "for the wedding!";
					goto L_End;
				}
			}
			else if (Sex == SEX_MALE) {
				if (countitem(6026) == 0 && Zeny < 1300000) {
					mes "[Marry Happy]";
					mes "I'm sorry, but you don't";
					mes "have the 1,300,000 zeny";
					mes "or the Marriage Covenant";
					mes "that all grooms must pay";
					mes "for the wedding ceremony.";
					mes "Did you misplace your money?";
					goto L_End;
				}
				else if (countitem(7170) < 1) {
					mes "[Marry Happy]";
					mes "Where's your Tuxedo?";
					mes "You absolutely have to";
					mes "wear it during the wedding";
					mes "ceremony! Find it, bring it";
					mes "to me, and then we can finally";
					mes "begin the wedding, okay?";
					goto L_End;
				}
			}
			mes "[Marry Happy]";
			mes "Well, it looks like you";
			mes "have everything ready.";
			mes "Although I'm not sure who";
			mes "your partner is, let me be";
			mes "the first to congratulate you";
			mes "on your upcoming wedding~";
			next;
			mes "[Marry Happy]";
			mes "Now, let's begin the";
			mes "application. Please write";
			mes "down your exact name here.";
			next;
			while(1) {
				input .@name$;
				if (.@name$ != strcharinfo(0)) {
					mes "[Marry Happy]";
					mes "Hmmm, you have to write";
					mes "down your name exactly as";
					mes "it is displayed. Maybe you";
					mes "need to copy and paste it?";
					mes "Anyway, let's try it again.";
					next;
				}
				else 
					break;
			}
			mes "[Marry Happy]";
			mes "Great, it looks like we";
			mes "finished your application.";
			mes "Remember that you'll need";
			mes "to tell Bishop Vomars your";
			mes "partner's exact name when";
			mes "you talk to him later, okay?";
			next;
			mes "[Marry Happy]";
			mes "When your partner is";
			mes "finished with the application";
			mes "process, both of you should";
			mes "speak to the Bishop to begin";
			mes "the wedding ceremony.";
			emotion ET_THROB;
			next;
			mes "[Marry Happy]";
			if (Sex == SEX_FEMALE) {
				mes "Since you're the bride,";
				mes "you need to wait for the";
				mes "groom to speak to Bishop";
				mes "Vomars first. When he's";
				mes "finished, it'll be your turn";
				mes "to speak to Bishop Vomars.";
				if (.@covenant)
					delitem 6026,1; //Marriage_Covenant
				else
					set Zeny, Zeny-1200000;
				delitem 2338,1; //Wedding_Dress
			}
			else {
				mes "Since you're the groom,";
				mes "you need to speak to the";
				mes "Bishop first. When you're";
				mes "finished, it will be your";
				mes "bride's turn to speak to";
				mes "Bishop Vomars.";
				if (.@covenant)
					delitem 6026,1; //Marriage_Covenant
				else
					set Zeny, Zeny-1300000;
				delitem 7170,1; //Tuxedo
			}
			delitem 2613,1; //Diamond_Ring
			set wedding_sign,1;
			goto L_End;
		}
		mes "[Marry Happy]";
		mes "No...?";
		mes "Well, when you're";
		mes "ready for marriage,";
		mes "feel free to come back to";
		mes "me so that you can apply,";
		mes "okay? Have a good day~";
		break;
	case 4:
		cutin "wedding_marry02",2;
		donpcevent "Single Army#Prontera::OnEnable";
		donpcevent "Single Army#Geffen::OnEnable";
		donpcevent "Single Army#Morocc::OnEnable";
		donpcevent "Single Army#Payon::OnEnable";
		donpcevent "Single Army#Amatsu::OnEnable";
		donpcevent "Single Army#Kunlun::OnEnable";
		emotion ET_HUK;
		mes "[Single Army]";
		mes "^CC9933You have to refine";
		mes "items on your own to";
		mes "make great equipment!^000000";
		emotion ET_ROCK, getnpcid(0, "Single Army#Prontera");
		next;
		mes "[Single Army]";
		mes "^330099It's a waste to";
		mes "form parties in";
		mes "dungeons! I can";
		mes "make it on my own!^000000";
		emotion ET_ROCK, getnpcid(0, "Single Army#Geffen");
		next;
		mes "[Single Army]";
		mes "^666666Hell, I've trained";
		mes "all by myself since";
		mes "birth, all the way";
		mes "to my job change!^000000";
		emotion ET_ROCK, getnpcid(0, "Single Army#Morocc");
		next;
		mes "[Single Army]";
		mes "^666600I CHOOSE to spend";
		mes "Christmas alone...";
		mes "playing Solitaire and";
		mes "doing crossword puzzles!^000000";
		emotion ET_ROCK, getnpcid(0, "Single Army#Payon");
		next;
		mes "[Single Army]";
		mes "^CC9966Women may break my";
		mes "spirit, but they'll never";
		mes "take... my FREEDOM!^000000";
		emotion ET_ROCK, getnpcid(0, "Single Army#Amatsu");
		next;
		mes "[Single Army]";
		mes "^669900...We're the free! We're";
		mes "the Invincible Single Army!^000000";
		emotion ET_ROCK, getnpcid(0, "Single Army#Kunlun");
		close2;
		cutin "wedding_marry01",255;
		emotion ET_SWEAT;
		donpcevent "Single Army#Prontera::OnInit";
		donpcevent "Single Army#Geffen::OnInit";
		donpcevent "Single Army#Morocc::OnInit";
		donpcevent "Single Army#Payon::OnInit";
		donpcevent "Single Army#Amatsu::OnInit";
		donpcevent "Single Army#Kunlun::OnInit";
		end;
	}
	close2;
	cutin "wedding_marry01",255;
	end;

L_End:
	close2;
	cutin "",255;
	end;
}

prt_church,97,102,0	script	Single Army#Prontera	105,{
	mes "[Single Army]";
	mes "^CC9933You have to refine";
	mes "items on your own to";
	mes "make great equipment!^000000";
	close;

OnInit:
	hideonnpc "Single Army#Prontera";
	end;

OnEnable:
	hideoffnpc "Single Army#Prontera";
	emotion ET_GO;
	end;
}

prt_church,98,102,0	script	Single Army#Geffen	705,{
	mes "[Single Army]";
	mes "^330099It's a waste to";
	mes "form parties in";
	mes "dungeons! I can";
	mes "make it on my own!^000000";
	close;

OnInit:
	hideonnpc "Single Army#Geffen";
	end;

OnEnable:
	hideoffnpc "Single Army#Geffen";
	emotion ET_GO;
	end;
}

prt_church,99,102,0	script	Single Army#Morocc	707,{
	mes "[Single Army]";
	mes "^666666Hell, I've trained";
	mes "all by myself since";
	mes "birth, all the way";
	mes "to my job change!^000000";
	close;

OnInit:
	hideonnpc "Single Army#Morocc";
	end;

OnEnable:
	hideoffnpc "Single Army#Morocc";
	emotion ET_GO;
	end;
}

prt_church,100,102,0	script	Single Army#Payon	708,{
	mes "[Single Army]";
	mes "^666600I CHOOSE to spend";
	mes "Christmas alone...";
	mes "playing Solitaire and";
	mes "doing crossword puzzles!^000000";
	close;

OnInit:
	hideonnpc "Single Army#Payon";
	end;

OnEnable:
	hideoffnpc "Single Army#Payon";
	emotion ET_GO;
	end;
}

prt_church,101,102,0	script	Single Army#Amatsu	767,{
	mes "[Single Army]";
	mes "^CC9966Women may break my";
	mes " spirit, but they'll never";
	mes "take... my FREEDOM!^000000";
	close;

OnInit:
	hideonnpc "Single Army#Amatsu";
	end;

OnEnable:
	hideoffnpc "Single Army#Amatsu";
	emotion ET_GO;
	end;
}

prt_church,102,102,0	script	Single Army#Kunlun	780,{
	mes "[Single Army]";
	mes "^669900...We're the free! We're";
	mes "the Invincible Single Army!^000000";
	close;

OnInit:
	hideonnpc "Single Army#Kunlun";
	end;

OnEnable:
	hideoffnpc "Single Army#Kunlun";
	emotion ET_GO;
	end;
}

prt_church,100,128,4	script	Bishop#w	60,{
	cutin "wedding_bomars01",2;
	if (Upper == 2) {
		mes "[Vomars]";
		mes "Greetings, child.";
		mes "Are you lost? Hmmm.";
		mes "Do you know where your";
		mes "mommy and daddy are?";
		close2;
		cutin "wedding_bomars01",255;
		end;
	}

	if (!getpartnerid()) {
		if (!$@wedding) {
			if (wedding_sign == 1) {
				getpartymember(getcharid(1));
				set .@partymembercount,$@partymembercount;
				if (.@partymembercount == 2) {
					if (Sex == SEX_MALE) {
						set $@wedding,1;
						initnpctimer;
						mes "[Vomars]";
						mes "Young lovers, please";
						mes "remember this moment for";
						mes "the rest of your lives. May your future be blessed with peace";
						mes "and joy. May the love you share";
						mes "grow with each passing day.";
						next;
						mapannounce "prt_church","It's the marriage proposal from the groom, Mr. " + strcharinfo(0) + "...",bc_map;
						mes "[Vomars]";
						mes "Until the end of the";
						mes "world, may you stand";
						mes "by the side of the one";
						mes "whom you love, to support";
						mes "her and protect her. Now, may";
						mes "I know the name of your bride?";
						next;
						input $@wed_bride$;
						mes "[Vomars]";
						mes "Mr. " + strcharinfo(0) + "...";
						mes "Do you swear on your life";
						mes "that you will forever cherish";
						mes "and care for your bride,";
						mes "Miss " + $@wed_bride$ + "?";
						next;
						select("I do.");
						set $@wed_groom$,strcharinfo(0);
						mes "[Vomars]";
						mes "Now, it is time for";
						mes "your bride to make";
						mes "her wedding vows.";
						mes "If she will come forward...";
						close2;
						mapannounce "prt_church","The groom, Mr. " + strcharinfo(0) + ", has made his vows to Miss " + $@wed_bride$ + "...",bc_map;
						cutin "",255;
						end;
					}
					mes "[Vomars]";
					mes "I'm sorry, but the groom";
					mes "must speak to me first in";
					mes "order to begin the wedding.";
					mes "It's old fashioned protocol,";
					mes "but I'll admit that it does";
					mes "keep things running smoothly.";
					goto L_End;
				}
				mes "[Vomars]";
				mes "Before you can be";
				mes "married, you must";
				mes "first form a party of";
				mes "two with your partner.";
				mes "Then, we can proceed";
				mes "with the ceremony.";
				goto L_End;
			}
			mes "[Vomars]";
			mes "You must apply for";
			mes "marriage with Happy Marry";
			mes "before you can get married.";
			mes "Happy Marry will let you know";
			mes "what else you'll need to do";
			mes "to prepare for marriage.";
			goto L_End;
		}
		else if ($@wedding == 1) {
			if (wedding_sign == 1) {
				getpartymember(getcharid(1));
				set .@partymembercount,$@partymembercount;
				if (.@partymembercount == 2) {
					if (Sex == SEX_FEMALE) {
						if (strcharinfo(0) == $@wed_bride$) {
							mes "[Vomars]";
							mes "Young lovers, please";
							mes "remember this moment for";
							mes "the rest of your lives. May your future be blessed with peace";
							mes "and joy. May the love you share";
							mes "grow with each passing day.";
							next;
							mapannounce "prt_church","Let's hear what the bride, Miss "+$@wed_bride$+", has to say...",bc_map;
							mes "[Vomars]";
							mes "Miss "+$@wed_bride$+"...";
							mes "Do you swear to stay";
							mes "true to "+$@wed_groom$+",";
							mes "to be by his side, no matter";
							mes "what the dangers may be?";
							next;
							if (select("^FF0000No.^000000:I do.") == 1) {
								cutin "wedding_bomars03",2;
								mapannounce "prt_church","Next couple, please proceed...",bc_map;
								mes "[Vomars]";
								mes "So "+$@wed_groom$;
								mes "isn't the one you";
								mes "want to marry? Hmm.";
								mes "I'm truly sorry for this";
								mes "misunderstanding...";
								set $@wedding,0;
								close2;
								stopnpctimer;
								cutin "",255;
								end;
							}
							mes "[Vomars]";
							mes "Do you truly swear";
							mes "fidelity and patience?";
							mes "Will you marry "+$@wed_groom$+"?";
							next;
							if (select("Yes, I do.:^FF0000No.^000000") == 1) {
								if (isloggedin(getcharid(3,$@wed_groom$))) {
									if (marriage($@wed_groom$)) {
										//Call Wedding effect
										wedding;
										//Give ring to Bride, and change to wedding sprite.
										sc_start SC_Wedding,3600000,1;
										getitem 2635,1; //Bride_Ring
										//Give ring to Groom, and change to wedding sprite.
										attachrid(getcharid(3,$@wed_groom$));
										sc_start SC_Wedding,3600000,1;
										getitem 2634,1; //Bridegroom_Ring
										detachrid;
										//Switch Script progression back to Bride
										attachrid(getcharid(3,$@wed_bride$));
										cutin "wedding_bomars02",2;
										mapannounce "prt_church","I now pronounce you, "+$@wed_groom$+" and "+$@wed_bride$+", husband and wife.",bc_map;
										mes "[Vomars]";
										mes "By the power invested";
										mes "in me as Royal Bishop of";
										mes "the Rune-Midgarts Kingdom,";
										mes "I now pronounce you husband";
										mes "and wife. May your future be";
										mes "blessed with many great joys.";
										next;
										mes "[Vomars]";
										mes "And lastly...";
										mes "Always be happy,";
										mes "dear "+$@wed_bride$+"...";
										set $@wed_groom$,"";
										set $@wed_bride$,"";
										set $@wedding,0;
										close2;
										stopnpctimer;
										cutin "",255;
										detachrid;
										end;
									}
								}
								cutin "wedding_bomars03",2;
								mes "[Vomars]";
								mes "Hm. It seems that";
								mes "your groom left before";
								mes "the ceremony has finished";
								mes "Please try again once he's";
								mes "returned.";
								goto L_End;
							}
							else {
								cutin "wedding_bomars03",2;
								mapannounce "prt_church","Alas! "+$@wed_bride$+" has rejected "+$@wed_groom$+"'s marriage proposal!",bc_map;
								mes "[Vomars]";
								mes "Hm. It seems that";
								mes "you've changed your";
								mes "mind. Although I feel";
								mes "sorry for the groom, you";
								mes "must do what your heart";
								mes "tells you is right. Now, run!";
							}
							set $@wed_groom$,"";
							set $@wed_bride$,"";
							set $@wedding,0;
							close2;
							stopnpctimer;
							cutin "",255;
							end;
						}
						callsub S_Busy;
					}
					callsub S_Busy;
				}
				callsub S_Busy;
			}
			if (strcharinfo(0) == $@wed_bride$) {
				mes "[Vomars]";
				mes "Hm? It appears that";
				mes "Happy Marry still hasn't";
				mes "received your marriage";
				mes "application. Please speak";
				mes "to her so that we can begin";
				mes "the wedding ceremony.";
				goto L_End;
			}
			callsub S_Busy;
		}
		callsub S_Busy;
	}
	mes "[Vomars]";
	mes "I wish you eternal";
	mes "happiness. No matter";
	mes "how dark the present may";
	mes "be, always stand by your";
	mes "loved one's side and look";
	mes "to the future with hope.";

L_End:
	close2;
	cutin  "",255;
	end;

S_Busy:
	if ($@wed_groom$ != "" && $@wed_bride$ != "") {
		mes "[Vomars]";
		mes "The wedding of";
		mes "Miss "+ $@wed_bride$ +" and";
		mes "Mister "+ $@wed_groom$;
		mes "is currently in progress.";
		mes "Please keep your voice down.";
		goto L_End;
	}
	mes "[Vomars]";
	mes "I'm conducting a wedding";
	mes "for another couple now, so";
	mes "please wait patiently for your";
	mes "turn. Thanks for understanding...";
	goto L_End;

OnStop:
	stopnpctimer;
	end;

OnReset:
	set $@wed_groom$,"";
	set $@wed_bride$,"";
	set $@wedding,0;
	end;

OnTimer180000:
	mapannounce "prt_church","You've responded too slowly... Next couple, please proceed.",bc_map;
	donpcevent "Bishop#w::OnReset";
	stopnpctimer;
	end;
}

prt_church,28,178,4	script	The King of Rune-Midgarts	108,{
	callfunc "F_GM_NPC";
	mes "[Vomars]";
	mes "Wh-who are you?";
	mes "You must know the";
	mes "password to invoke";
	mes "my awesome powers.";
	next;
	if (callfunc("F_GM_NPC",1854,0) < 1) {
		mes "[Vomars]";
		mes "This is";
		mes "no place for";
		mes "fooling around.";
		close2;
		warp "prt_church",101,102;
		end;
	}
	mes "[Wedding Switch]";
	mes "Is there a problem with";
	mes "the wedding ceremony?";
	mes "I can reset the Bishop";
	mes "Vomars NPC if you like.";
	next;
	switch(select("No, thanks:RESET")) {
	case 1:
		mes "[Wedding Switch]";
		mes "Alright, then.";
		mes "However, if the";
		mes "Bishop Vomars";
		mes "NPC is stuck, it may";
		mes "be best to reset it.";
		close;
	case 2:
		donpcevent "Bishop#w::OnStop";
		donpcevent "Bishop#w::OnReset";
		mapannounce "prt_church","You've responded too slowly... Next couple, please proceed.",bc_map;
		mes "[Wedding Switch]";
		mes "The Bishop Vomars NPC";
		mes "has now been reactivated.";
		mes "It should now be possible";
		mes "to proceed with weddings.";
		close;
	}
}

prt_church,20,179,4	script	Divorce Staff	71,{
	callfunc "F_GM_NPC";
	mes "[Bad Ending]";
	mes "Uh oh...";
	mes "You know I can't";
	mes "do anything for you.";
	next;
	if (callfunc("F_GM_NPC",1854,0) < 1) {
		mes "[Bad Ending]";
		mes "Hmm...";
		mes "You really";
		mes "shouldn't be";
		mes "in this place...";
		close;
	}
	mes "[Bad Ending]";
	mes "Great, you know the";
	mes "password! Now, did you";
	mes "want me to remove the";
	mes "Wedding Ring in your";
	mes "inventory?";
	next;
	switch(select("Drop 1 Wedding Ring.:Keep it.")) {
	case 1:
		set .@ring, (Sex == SEX_MALE)?2634:2635; //Bridegroom_Ring, Bride_Ring
		if (countitem(.@ring)) {
			delitem .@ring,1;
			mes "[Bad Ending]";
			mes "It's done!";
		} else {
			mes "[Bad Ending]";
			mes "I couldn't find";
			mes "the Wedding Ring...";
			mes "Please make sure";
			mes "that it's not equipped.";
		}
		close;
	case 2:
		mes "[Bad Ending]";
		mes "You sure you want";
		mes "to keep that ring?";
		mes "Alright, but if it becomes";
		mes "a problem, you come to me.";
		close;
	}
}

prt_church,22,179,4	script	Remarry Staff	71,{
	callfunc "F_GM_NPC";
	mes "[Wedding Again]";
	mes "Hmm...?";
	mes "What exactly are";
	mes "you doing here?";
	next;
	if (callfunc("F_GM_NPC",1854,0) < 1) {
		mes "[Wedding Again]";
		mes "Ahk!";
		mes "An adventurer";
		mes "like you shouldn't";
		mes "be in this place!";
		close;
	}
	if (getpartnerid()) {
		mes "[Wedding Again]";
		mes "Hmm...";
		mes "I can only create";
		mes "a Wedding Ring if the";
		mes "character is married.";
		close;
	}
	mes "[Wedding Again]";
	mes "Ah, I see that you";
	mes "know the password.";
	mes "Alright, if you somehow";
	mes "lost your Wedding Ring,";
	mes "I can make you a new one.";
	next;
	switch(select("Make new Wedding Ring.:Cancel.")) {
	case 1:
		set .@ring, (Sex == SEX_MALE)?2634:2635; //Bridegroom_Ring, Bride_Ring
		if (countitem(.@ring) || isequipped(.@ring)) {
			mes "[Wedding Again]";
			mes "Wait, wait...";
			mes "You're wearing your";
			mes "Wedding Ring. I better";
			mes "not make you another since";
			mes "you don't need more than one.";
		} else {
			getitem .@ring,1;
			mes "[Wedding Again]";
			mes "Here you go~";
			mes "It's your brand";
			mes "new Wedding Ring!";
		}
		close;
	case 2:
		mes "[Wedding Again]";
		mes "Alright. If you ever";
		mes "lose your Wedding Ring,";
		mes "come to me if you happen";
		mes "to need a new one, okay?";
		close;
	}
}
