class 1 dawn_priest_gludin : ssq_npc_priest
{
property:
	TelPosList Position = {{"Necropolis of Sacrifice"; -41184; 206752; -3357; 5500; 0 }};

handler:
	EventHandler MENU_SELECTED(ask,i0,quest_id,reply,talker)
	{
		if( ask == 507 )
		{
			myself::SetCurrentQuestID(507);
			if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) )
			{
				myself::ShowSystemMessage(talker,1118);
				return;
			}
		}
		if( ask == 507 )
		{
			if( reply == 1 )
			{
				myself::ShowPage(talker,"ssq_npc_priest_q507_01.htm");
			}
			if( reply == 2 )
			{
				i0 = myself::GetMemoStateEx(talker,255,1);
				i0 = ( i0 % 100 );
				if( i0 >= 95 || i0 < 0 )
				{
					i0 = 0;
				}
				myself::SetMemoStateEx(talker,255,1,( i0 + 100 ));
				if( myself::HaveMemo(talker,505) )
				{
					myself::RemoveMemo(talker,505);
				}
				myself::DeleteItem1(talker,5901,myself::OwnItemCount(talker,5901));
				switch(gg::Rand(3))
				{
					case 0:
					{
						myself::InstantTeleport(talker,-80316,111356,-4896);
						break;
					}
					case 1:
					{
						myself::InstantTeleport(talker,-80226,111290,-4896);
						break;
					}
					case 2:
					{
						myself::InstantTeleport(talker,-80217,111435,-4896);
						break;
					}
				}
				myself::AddLog(1,talker,507);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
			}
		}
		super;
	}

}
