ra_temple,116,174,3	script	Nemma#ra_temple	4_F_TRAINEE,{
	cutin "ra_nemma02",2;
	if ($rachel_donate < 20) {
		if (ra_have_donated == 0) {
			cutin "ra_nemma03",2;
			mes "[Priestess Nemma]";
			mes "Good day, adventurer.";
			mes "May I ask what brings";
			mes "you to the temple today?";
			next;
			if (select("Just sight-seeing.", "I came to pray.") == 1) {
				cutin "ra_nemma01",2;
				mes "[Priestess Nemma]";
				mes "I guess most foreigners";
				mes "aren't familiar with our";
				mes "faith, so I suppose they";
				mes "wouldn't come here to pray...";
				mes "Well, I hope you enjoy your";
				mes "time here, adventurer.";
				callsub L_End;
			}
			mes "[Priestess Nemma]";
			mes "Oh! I'm glad to see that";
			mes "our kind of spirituality is";
			mes "practiced in other countries~";
			mes "You know, we at the Temple of";
			mes "Cheshrumnir will be hosting a";
			mes "festival here at the temple.";
			next;
			cutin "ra_nemma01",2;
			mes "[Priestess Nemma]";
			mes "We're accepting donations";
			mes "for the festival, so we'd be";
			mes "grateful if you could make";
			mes "a contribution. Regardless,";
			mes "we invite you to celebrate the";
			mes "grace of the goddess with us.";
			emotion e_ho;
			next;
			mes "[Priestess Nemma]";
			mes "There's one High Priest that";
			mes "disagrees with collecting money";
			mes "from the temple's patrons, but";
			mes "it's up to you if you want to";
			mes "give or not. If you donate, you";
			mes "might be able to win a prize!";
			next;
			mes "[Priestess Nemma]";
			mes "You can use our Lottery Tickets";
			mes "to win something nice from our";
			mes "Temple Storage. However, you";
			mes "donate the 50,000 zeny for each";
			mes "Lottery Ticket, which also happens to be the minimum donation amount.";
			next;
			cutin "ra_nemma03",2;
			mes "[Priestess Nemma]";
			mes "The prizes that are given to";
			mes "donators are also randomly";
			mes "chosen, so I have no way of";
			mes "telling you what you'd get.";
			mes "Would you be interested";
			mes "in making a donation?";
			next;
			if (select("No, thanks.", "Sure.") == 1) {
				cutin "ra_nemma01",2;
				mes "[Priestess Nemma]";
				mes "I understand. Well,";
				mes "maybe some other time.";
				mes "May Freya bless you on";
				mes "all your journeys. May the";
				mes "grace of the goddess always";
				mes "support us in all that we do~";
				callsub L_End;
			}
			mes "[Priestess Nemma]";
			mes "Great! How much would you";
			mes "like to donate? We can only";
			mes "accept donations in increments";
			mes "of 50,000 zeny, and we can only";
			mes "accept up to 150,000 zeny at once. It's a bit complicated, I know...";
			next;
			switch(select("50,000z - 1 Lottery Ticket", "100,000z - 2 Lottery Ticket", "150,000z - 3 Lottery Ticket", "Cancel")) {
			case 1:
				callsub S_Donate,1,"50,000";
				break;
			case 2:
				callsub S_Donate,2,"100,000";
				break;
			case 3:
				callsub S_Donate,3,"150,000";
				break;
			case 4:
				cutin "ra_nemma02",2;
				mes "[Priestess Nemma]";
				mes "I understand that it takes";
				mes "some thought to part with an";
				mes "amount of money like 50,000";
				mes "zeny. Even so, Freya is always";
				mes "protecting you, wherever you go~";
				break;
			}
			callsub L_End;
		}
		else {
			cutin "ra_nemma03",2;
			mes "[Priestess Nemma]";
			mes "Oh, you're " + strcharinfo(PC_NAME) + "!";
			mes "Welcome back! I remember";
			mes "that you donated just a little";
			mes "while ago. So what brings you";
			mes "to the temple today, hmm?";
			next;
			switch(select("I've come to donate again.", "Just sight-seeing.", "I came to attend the service.", "I just wanted to see you again.")) {
			case 1:
				mes "[Priestess Nemma]";
				mes "You've come to make another";
				mes "donation? Splendid! How much";
				mes "would you like to donate this";
				mes "time? Remember that we can only";
				mes "accept donations in increments of";
				mes "50,000 zeny up to 150,000 zeny.";
				next;
				switch(select("50,000z - 1 Lottery Ticket", "100,000z - 2 Lottery Ticket", "150,000z - 3 Lottery Ticket", "Cancel")) {
				case 1:
					callsub S_Donate,1,"50,000";
					break;
				case 2:
					callsub S_Donate,2,"100,000";
					break;
				case 3:
					callsub S_Donate,3,"150,000";
					break;
				case 4:
					cutin "ra_nemma02",2;
					mes "[Priestess Nemma]";
					mes "I understand that it takes";
					mes "some thought to part with an";
					mes "amount of money like 50,000";
					mes "zeny. Even so, Freya is always";
					mes "protecting you, wherever you go~";
					break;
				}
				callsub L_End;
			case 2:
				mes "[Priestess Nemma]";
				mes "Oh! If you'd like some";
				mes "information about our temple,";
				mes "why don't you ask Priestess";
				mes "Pano at the Help Desk inside?";
				next;
				mes "[Priestess Nemma]";
				mes "Penno will also redeem";
				mes "your Lottery Tickets for";
				mes "prizes, although she doesn't";
				mes "really seem to enjoy that job.";
				mes "Well, anyway, she'll help";
				mes "you out. See you later!";
				break;
			case 3:
				mes "[Priestess Nemma]";
				mes "You're here for the";
				mes "service? That's great~";
				mes "I hope you find the sense";
				mes "of calm that you can only";
				mes "get from goddess Freya~";
				break;
			case 4:
				mes "[Priestess Nemma]";
				mes "Oh, how sweet of you~";
				break;
			}
			callsub L_End;
		}
	}
	else {
		if (MISC_QUEST & 8192) {
			cutin "ra_nemma01",2;
			mes "[Priestess Nemma]";
			mes "Welcome to our temple!";
			callsub L_End;
		}
		if (ra_tem_q < 1) {
			mes "[Priestess Nemma]";
			mes "Hello, there!";
			mes "...............................";
			mes "Um, for some reason, the";
			mes "temple gate hasn't opened yet";
			mes "But it should be open now. Well";
			mes "this happens sometimes so...";
			next;
			mes "[Priestess Nemma]";
			mes "See, there's this auto locking";
			mes "system that was added to the";
			mes "gate when this temple was";
			mes "built, but now it's more of";
			mes "an annoyance than security.";
			next;
			mes "[Priestess Nemma]";
			mes "Every time someone messes";
			mes "with the lock, or if it breaks,";
			mes "we have to wait until it auto";
			mes "resets itself before it works";
			mes "again. No one can fix it";
			mes "really quickly, you know...";
			next;
			mes "[Priestess Nemma]";
			mes "^333333*Sniff*^000000 What should I do?";
			mes "The auto reset never takes";
			mes "this long, and I really need";
			mes "to go inside. ^333333*Sob*^000000 P-Panno!";
			mes "Panno, I neeeed heeeeelp~!";
			ra_tem_q = 1;
			callsub L_End;
		}
		else if ((ra_tem_q >= 1) && (ra_tem_q < 10)) {
			mes "[Priestess Nemma]";
			mes "If the gate's locked, then";
			mes "I've just got to find that";
			mes "secret entrance. Some kids";
			mes "supposedly use it to enter";
			mes "and play pranks in the temple,";
			mes "but I don't know who they are...";
			next;
			mes "[Priestess Nemma]";
			mes "Panno would know";
			mes "what to do... I think.";
			mes "Ooh, Panno, help me!";
			callsub L_End;
		}
		else if (ra_tem_q == 10) {
			cutin "ra_nemma04",2;
			mes "[Priestess Nemma]";
			mes "Oh, "+strcharinfo(PC_NAME)+"!";
			mes "The gate just opened and";
			mes "I was able to get inside";
			mes "the temple! ^333333*Whew*^000000 I was";
			mes "getting really worried";
			mes "about it for awhile.";
			next;
			mes "[Priestess Nemma]";
			mes "This is the first time that the";
			mes "gate locked up since Panno";
			mes "was assigned to her post in";
			mes "the temple. I thought maybe";
			mes "something happened and";
			mes "she got in trouble, you know?";
			next;
			cutin "ra_nemma02",2;
			mes "[Priestess Nemma]";
			mes "Wait, wait...";
			mes "I'm outside. What if";
			mes "the gate locks up again?";
			mes "Oooh, what should I do?!";
			callsub L_End;
		}
		else if (ra_tem_q == 11) {
			emotion e_ho;
			cutin "ra_nemma03",2;
			mes "[Priestess Nemma]";
			mes "Hey, "+strcharinfo(PC_NAME)+"~!";
			mes "We reached our target!";
			mes "Isn't that great? We're no";
			mes "longer asking for donations,";
			mes "but you can still redeem your";
			mes "Lottery Tickets inside, okay?";
			callsub L_End;
		}
		else if (ra_tem_q == 12) {
			mes "[Priestess Nemma]";
			mes "Mmm... I know what";
			mes "I can do! I can ask for";
			mes "Firecrackers! Yes, that'll";
			mes "be fun for the festival.";
			mes "Hey, do you know where";
			mes "those things are sold?";
			next;
			cutin "ra_nemma01",2;
			mes "[Priestess Nemma]";
			mes "I, uh, can't give you";
			mes "much... But if you would";
			mes "bring me some Firecrackers,";
			mes "then I'll pray for your good";
			mes "fortune. Sorry, but that's";
			mes "all I can really offer.";
			next;
			cutin "ra_nemma04",2;
			mes "[Priestess Nemma]";
			mes "Hey, bring me";
			mes "a lot of Firecrackers,";
			mes "like, ^FF000020 of them^000000! Thank";
			mes "you thank you thank you!";
			ra_tem_q = 13;
			callsub L_End;
		}
		else if (ra_tem_q == 13) {
			mes "[Priestess Nemma]";
			mes "Hey, did you bring me";
			mes "^FF000020 Firecrackers^000000? Mmm?";
			next;
			if(select("Yes.", "No, not yet.") == 1) {
				cutin "ra_nemma01",2;
				mes "[Priestess Nemma]";
				mes "Let's see...";
				next;
				if (countitem(Fire_Cracker) >= 20) {
					cutin "ra_nemma04",2;
					delitem Fire_Cracker,20;
					getexp RENEWAL_EXP?50000:200000,0;
					ra_tem_q = 14;
					mes "[Priestess Nemma]";
					mes "Yay!";
					mes "Firecrackers!";
					mes "Oh, let me pray";
					mes "for your good fortune!";
					next;
					mes "^3355FFPriestess Nemma prayed";
					mes "fervently for your good";
					mes "fortune. It feels like";
					mes "it's actually working...^000000";
					next;
					cutin "ra_nemma04",2;
					mes "[Priestess Nemma]";
					mes "I'm done!";
					mes "Now it's time";
					mes "to play! Hm, maybe";
					mes "our pope would like";
					mes "to see these too?";
					callsub L_End;
				}
				cutin "ra_nemma02",2;
				mes "[Priestess Nemma]";
				mes "Awww...";
				mes "This isn't enough";
				mes "Firecrackers. I mean,";
				mes "I know it's like a donation,";
				mes "but still. How much fun are";
				mes "fireworks if there isn't a lot?";
			}
			else {
				cutin "ra_nemma01",2;
				mes "[Priestess Nemma]";
				mes "Awww...";
				mes "Well, I don't really";
				mes "have much to pay you";
				mes "back with, anyway~";
			}
			callsub L_End;
		}
		else {
			cutin "ra_nemma01",2;
			mes "[Priestess Nemma]";
			mes "Welcome to our temple!";
		}
		callsub L_End;
	}

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

S_Donate:
	cutin "ra_nemma01",2;
	mes "[Priestess Nemma]";
	mes "So, " + strcharinfo(PC_NAME) + "...";
	mes "I just want to make sure:";
	mes "You want to donate "+getarg(1);
	mes "zeny, and receive "+getarg(0)+" Lottery";
	if(getarg(0) == 1) mes "Ticket. Is that correct?";
	else mes "Tickets. Is that correct?";
	next;
	if (select("No", "Yes") == 1) {
		mes "[Priestess Nemma]";
		mes "Oh, I see. Well, if you";
		mes "don't have enough zeny with";
		mes "you, then you can just come";
		mes "back and donate later. Our";
		mes "goddess Freya smiles on the";
		mes "generous and rewards the patient!";
		return;
	}
	if (Zeny >= getarg(0)*50000) {
		if (!checkweight(Temple_Lottery_Ticket,getarg(0))) {
			cutin "ra_nemma02",2;
			mes "[Priestess Nemma]";
			mes "I can scarcely believe it...";
			mes "You're carrying so much stuff,";
			mes "you don't even have enough";
			mes "room for a Lottery Ticket.";
			mes "You'd better put some of";
			mes "your things in Storage, yes?";
			next;
			cutin "ra_nemma01",2;
			mes "[Priestess Nemma]";
			mes "Don't worry, I'll still be";
			mes "here after you make more";
			mes "space available in your";
			mes "Inventory. Hurry back, and";
			mes "donate if you can, okay?";
			return;
		}
		$rachel_donate += getarg(0);
		getitem Temple_Lottery_Ticket,getarg(0);
		Zeny -= getarg(0)*50000;
		ra_have_donated = 1;
		if ($rachel_donate > 9999) {
			cutin "ra_nemma03",2;
			mes "[Priestess Nemma]";
			mes "There you are~";
			mes "Thanks so much for";
			mes "your donation! I'm sure";
			mes "that Freya is smiling down";
			mes "upon you, and will reward";
			mes "you for your generosity~";
			return;
		}
		else {
			.@Remaining = 20-$rachel_donate;
			cutin "ra_nemma03",2;
			mes "[Priestess Nemma]";
			mes "Thank you so much! We'll be";
			mes "continuing to accept donations";
			mes "until we reach our target. Once";
			mes "we receive "+.@Remaining+" more donations";
			mes "in increments of 50,000 zeny,";
			mes "our fundraiser will finish.";
			next;
			mes "[Priestess Nemma]";
			mes "If you're feeling so";
			mes "inclined, come back later";
			mes "and make another contribution.";
			mes "Thanks again, and may Freya";
			mes "always watch over you.";
			return;
		}
	}
	else {
		mes "[Priestess Nemma]";
		mes "I'm sorry, but you have";
		mes "less than "+@Donate$+" zeny...";
		mes "I know it's asking a lot,";
		mes "but those are the rules that";
		mes "I've been told to follow, so...";
		mes "Well, maybe another time, yes?";
		return;
	}
}
