class 1 guild_master_lv2 : guild_master
{
parameter:
	int	lv1_class1 = -1;
	int	lv1_class2 = -1;
	int	lv2_class11 = -1;
	int	lv2_class12 = -1;
	int	lv2_class13 = -1;
	int	lv2_class21 = -1;
	int	lv2_class22 = -1;
	int	lv2_class23 = -1;
	int	proof11 = 0;
	int	proof12 = 0;
	int	proof13 = 0;
	int	proof21 = 0;
	int	proof22 = 0;
	int	proof23 = 0;

handler:
	EventHandler CLASS_CHANGE_REQUESTED(talker,occupation_name_id)
	{
		if( myself::IsInCategory(6,talker.occupation) )
		{
			myself::ShowPage(talker,fnYouAreSecondClass);
		}
		else if( myself::IsInCategory(7,talker.occupation) )
		{
			myself::ShowPage(talker,fnYouAreThirdClass);
		}
		else if( lv2_class11 != -1 && occupation_name_id == lv2_class11 && talker.occupation == lv1_class1 )
		{
			if( talker.level < 20 )
			{
				if( myself::OwnItemCount(talker,proof11) == 0 )
				{
					myself::ShowPage(talker,fnLowLevelNoProof11);
				}
				else
				{
					myself::ShowPage(talker,fnLowLevel11);
				}
			}
			else if( myself::OwnItemCount(talker,proof11) == 0 )
			{
				myself::ShowPage(talker,fnNoProof11);
			}
			else
			{
				myself::DeleteItem1(talker,proof11,myself::OwnItemCount(talker,proof11));
				myself::GiveItem1(talker,8869,15);
				myself::ClassChange(talker,lv2_class11);
				myself::ShowSystemMessage(talker,1308);
				myself::ShowPage(talker,fnAfterClassChange11);
			}
		}
		if( lv2_class12 != -1 && occupation_name_id == lv2_class12 && talker.occupation == lv1_class1 )
		{
			if( talker.level < 20 )
			{
				if( myself::OwnItemCount(talker,proof12) == 0 )
				{
					myself::ShowPage(talker,fnLowLevelNoProof12);
				}
				else
				{
					myself::ShowPage(talker,fnLowLevel12);
				}
			}
			else if( myself::OwnItemCount(talker,proof12) == 0 )
			{
				myself::ShowPage(talker,fnNoProof12);
			}
			else
			{
				myself::DeleteItem1(talker,proof12,myself::OwnItemCount(talker,proof12));
				myself::GiveItem1(talker,8869,15);
				myself::ClassChange(talker,lv2_class12);
				myself::ShowSystemMessage(talker,1308);
				myself::ShowPage(talker,fnAfterClassChange12);
			}
		}
		if( lv2_class13 != -1 && occupation_name_id == lv2_class13 && talker.occupation == lv1_class1 )
		{
			if( talker.level < 20 )
			{
				if( myself::OwnItemCount(talker,proof13) == 0 )
				{
					myself::ShowPage(talker,fnLowLevelNoProof13);
				}
				else
				{
					myself::ShowPage(talker,fnLowLevel13);
				}
			}
			else if( myself::OwnItemCount(talker,proof13) == 0 )
			{
				myself::ShowPage(talker,fnNoProof13);
			}
			else
			{
				myself::DeleteItem1(talker,proof13,myself::OwnItemCount(talker,proof13));
				myself::GiveItem1(talker,8869,15);
				myself::ClassChange(talker,lv2_class13);
				myself::ShowSystemMessage(talker,1308);
				myself::ShowPage(talker,fnAfterClassChange13);
			}
		}
		if( lv2_class21 != -1 && occupation_name_id == lv2_class21 && talker.occupation == lv1_class2 )
		{
			if( talker.level < 20 )
			{
				if( myself::OwnItemCount(talker,proof21) == 0 )
				{
					myself::ShowPage(talker,fnLowLevelNoProof21);
				}
				else
				{
					myself::ShowPage(talker,fnLowLevel21);
				}
			}
			else if( myself::OwnItemCount(talker,proof21) == 0 )
			{
				myself::ShowPage(talker,fnNoProof21);
			}
			else
			{
				myself::DeleteItem1(talker,proof21,myself::OwnItemCount(talker,proof21));
				myself::GiveItem1(talker,8869,15);
				myself::ClassChange(talker,lv2_class21);
				myself::ShowSystemMessage(talker,1308);
				myself::ShowPage(talker,fnAfterClassChange21);
			}
		}
		if( lv2_class22 != -1 && occupation_name_id == lv2_class22 && talker.occupation == lv1_class2 )
		{
			if( talker.level < 20 )
			{
				if( myself::OwnItemCount(talker,proof22) == 0 )
				{
					myself::ShowPage(talker,fnLowLevelNoProof22);
				}
				else
				{
					myself::ShowPage(talker,fnLowLevel22);
				}
			}
			else if( myself::OwnItemCount(talker,proof22) == 0 )
			{
				myself::ShowPage(talker,fnNoProof22);
			}
			else
			{
				myself::DeleteItem1(talker,proof22,myself::OwnItemCount(talker,proof22));
				myself::GiveItem1(talker,8869,15);
				myself::ClassChange(talker,lv2_class22);
				myself::ShowSystemMessage(talker,1308);
				myself::ShowPage(talker,fnAfterClassChange22);
			}
		}
		if( lv2_class23 != -1 && occupation_name_id == lv2_class23 && talker.occupation == lv1_class2 )
		{
			if( talker.level < 20 )
			{
				if( myself::OwnItemCount(talker,proof23) == 0 )
				{
					myself::ShowPage(talker,fnLowLevelNoProof23);
				}
				else
				{
					myself::ShowPage(talker,fnLowLevel23);
				}
			}
			else if( myself::OwnItemCount(talker,proof23) == 0 )
			{
				myself::ShowPage(talker,fnNoProof23);
			}
			else
			{
				myself::DeleteItem1(talker,proof23,myself::OwnItemCount(talker,proof23));
				myself::GiveItem1(talker,8869,15);
				myself::ClassChange(talker,lv2_class23);
				myself::ShowSystemMessage(talker,1308);
				myself::ShowPage(talker,fnAfterClassChange23);
			}
		}
	}

}
