class 1 suki : citizen
{
handler:
	EventHandler CREATED()
	{
		myself::AddTimerEx(2001,( ( 1000 * 60 ) * 10 ));
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id,i0)
	{
		if( timer_id == 2001 )
		{
			i0 = gg::Rand(1000);
			if( i0 < 200 )
			{
				myself::InstantTeleport(myself.sm,68148,72328,-3640);
				myself::AddTimerEx(2001,( ( 1000 * 60 ) * 10 ));
			}
			if( i0 >= 200 && i0 < 400 )
			{
				myself::InstantTeleport(myself.sm,67841,77949,-3648);
				myself::AddTimerEx(2001,( ( 1000 * 60 ) * 10 ));
			}
			if( i0 >= 400 && i0 < 600 )
			{
				myself::InstantTeleport(myself.sm,72784,77949,-3264);
				myself::AddTimerEx(2001,( ( 1000 * 60 ) * 10 ));
			}
			if( i0 >= 600 && i0 < 800 )
			{
				myself::InstantTeleport(myself.sm,75817,73416,-3632);
				myself::AddTimerEx(2001,( ( 1000 * 60 ) * 10 ));
			}
			if( i0 >= 800 && i0 < 1000 )
			{
				myself::InstantTeleport(myself.sm,70044,67611,-3548);
				myself::AddTimerEx(2001,( ( 1000 * 60 ) * 10 ));
			}
		}
		super;
	}

	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( talker.level >= 36 && myself::HaveMemo(talker,653) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Wild Maiden");
			}
			if( myself::HaveMemo(talker,653) == 1 && myself::GetMemoState(talker,653) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Wild Maiden - In Progress");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					if( _from_choice == 0 || ( talker.level >= 36 && myself::HaveMemo(talker,653) == 0 ) )
					{
						myself::SetCurrentQuestID(653);
						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( myself::GetMemoCount(talker) < 25 )
						{
							myself::FHTML_SetFileName(fhtml0,"suki_q0653_001.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",653);
							myself::ShowFHTML(talker,fhtml0);
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,653) == 1 && myself::GetMemoState(talker,653) == 1 ) )
					{
						myself::SetCurrentQuestID(653);
						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;
						}
						myself::ShowPage(talker,"suki_q0653_003.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker)
	{
		if( quest_id == 653 )
		{
			if( myself::OwnItemCount(talker,736) >= 1 )
			{
				myself::DeleteItem1(talker,736,1);
				myself::SetMemo(talker,653);
				myself::SetMemoState(talker,653,1);
				myself::AddLog(1,talker,653);
				myself::SetFlagJournal(talker,653,1);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowPage(talker,"suki_q0653_003.htm");
				myself::Despawn();
			}
			else
			{
				myself::ShowPage(talker,"suki_q0653_002.htm");
			}
		}
		super;
	}

}
