// Excalibur Quest NPC
// By: Syrus22
// Version 1.0
// Any comments or questions PM me on the Yare forums
// Description: This is a simple item quest NPC. The player must find an
// Angel Band, a Heaven Ring, and an Emperium. If they do they will receive
// the Excalibur.
prt_castle.gat,81,171,5	script	Mysterious King	108,{
mes "[Excalibur Quest Rep]";
mes "Hello Adventurer.";
mes "I'm glad to announce that we are sponsoring a hunt for the legendary sword, Excalibur. Or more appropriately a hunt for certain rare items that can be traded in for the legendary sword.";
next;
goto ExMenu;
    ExMenu:
	menu "Required Items",ExItems,"Create Excalibur",ExCreate,"End",ExEnd;

    ExItems:
        mes "[Excalibur Quest Rep]";
        mes "You need the following items to create the Excalibur.";
        mes "Angel Band";
	mes "Heaven Ring";
	mes "Emperium";
        next;
	goto ExMenu;

    ExCreate:
        mes "[Excalibur Quest Rep]";
	mes "Let me check your inventory!";
	next;
	if(countitem(2254)<1) goto NoAngel;
	if(countitem(2282)<1) goto NoHeaven;
	if(countitem(714)<1) goto NoEmp;
        goto ExGive;

	    NoAngel:
		mes "[Excalibur Quest Rep]";
		mes "Sorry but you must have at least 1 Angel Band.";
		mes "Come back after you get ALL the items.";
		close;

	    NoHeaven:
		mes "[Excalibur Quest Rep]";
		mes "Sorry but you must have at least 1 Heaven Ring.";
		mes "Come back after you get ALL the items.";
		close;

	    NoEmp:
		mes "[Excalibur Quest Rep]";
		mes "Sorry but you must have at least 1 Emperium.";
		mes "Come back after you get ALL the items.";
		close;

	    ExGive:
		mes "[Excalibur Quest Rep]";
		mes "Congratulations. You have collected all necessary items. I give to you the Excalibur!!!";
		delitem 2254,1;
		delitem 2282,1;
		delitem 714,1;
		getitem 1137,1;
		mes "Thank you for your participation!";
		close;

    ExEnd:
        mes "[Excalibur Quest Rep]";
	mes "Good bye then. Hope you try the quest!";
        close;
close;    }
}
