@LabelIndex 12377
@StringIndex 0
class 0 feud_manager : merchant {
parameter:
	string	fnNoBadge = "gludio_feud_manager002.htm";
	string	fnAlreadyNoble = "gludio_feud_manager005.htm";
	string	fnNotEnoughLv = "gludio_feud_manager006.htm";
	string	fnNobleDone = "gludio_feud_manager007.htm";
	string	fnLowLevel = "gludio_feud_manager008.htm";
	int	item_feud_badge = 13757;

handler:
	EventHandler TALKED(talker) {
		if( ( myself::IsInCategory(8,talker.occupation) || myself::IsInCategory(9,talker.occupation) ) && talker.level >= 40 ) {
			myself::ShowPage(talker,fnHi);
		} else {
			myself::ShowPage(talker,fnLowLevel);
		}
	}

	EventHandler MENU_SELECTED(talker,ask,reply) {
		if( ask == 23000 ) {
			if( gg::OwnItemCount(talker,item_feud_badge) > 0 ) {
				myself::ShowMultisell(reply,talker);
			} else {
				myself::ShowPage(talker,fnNoBadge);
			}
		} else if( ask == 23060 ) {
			if( gg::OwnItemCount(talker,item_feud_badge) > 99 ) {
				if( talker.nobless_type == 1 ) {
					myself::ShowPage(talker,fnAlreadyNoble);
				} else if( talker.level < 75 ) {
					myself::ShowPage(talker,fnNotEnoughLv);
				} else {
					myself::SetNobless(talker);
					myself::SetOneTimeQuestFlag(talker,235,1);
					myself::SetOneTimeQuestFlag(talker,236,1);
					myself::ShowPage(talker,fnNobleDone);
					myself::DeleteItem1(talker,item_feud_badge,100);
				}
			} else {
				myself::ShowPage(talker,fnNoBadge);
			}
		}
		super;
	}

}
