class 1 paint : merchant_for_newbie
{
property:
	BuySellList SellList0 = {{"pants";15};{"shirt";15};{"leather_pants";15};{"leather_shirt";15};{"hard_leather_pants";15};{"wooden_gaiters";15};{"wooden_breastplate";15};{"tights_pants";15};{"tights_shirt";15};{"bone_breastplate";15};{"bone_gaiters";15};{"leather_shield";15};{"small_shield";15};{"buckler";15};{"round_shield";15};{"short_gloves";15};{"short_leather_gloves";15};{"gloves";15};{"leather_gloves";15};{"apprentice_s_shoes";15};{"cloth_shoes";15};{"leather_sandals";15};{"crude_leather_shoes";15};{"cotton_shoes";15};{"leather_shoes";15};{"low_boots";15};{"cloth_cap";15};{"leather_cap";15};{"wooden_helmet";15};{"leather_helmet";15};{"cotton_shirt";15};{"striped_cotton_shirt";15}};
	BuySellList SellList1 = {{"hose";15};{"tunic";15};{"cotton_hose";15};{"cotton_tunic";15};{"feriotic_hose";15};{"feriotic_tunic";15};{"leather_hose";15};{"leather_tunic";15};{"hose_of_devotion";15};{"tunic_of_devotion";15};{"leather_shield";15};{"small_shield";15};{"buckler";15};{"round_shield";15};{"short_gloves";15};{"short_leather_gloves";15};{"gloves";15};{"leather_gloves";15};{"apprentice_s_shoes";15};{"cloth_shoes";15};{"leather_sandals";15};{"crude_leather_shoes";15};{"cotton_shoes";15};{"leather_shoes";15};{"low_boots";15};{"cloth_cap";15};{"leather_cap";15};{"wooden_helmet";15};{"leather_helmet";15};{"cotton_shirt";15};{"striped_cotton_shirt";15}};

handler:
	EventHandler TALK_SELECTED(fhtml0,i0,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,264) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Keen Claws");
			}
			if( myself::HaveMemo(talker,264) == 1 && myself::OwnItemCount(talker,1367) < 50 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Keen Claws");
			}
			if( myself::HaveMemo(talker,264) == 1 && myself::OwnItemCount(talker,1367) >= 50 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Keen Claws");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					if( _from_choice == 0 || myself::HaveMemo(talker,264) == 0 )
					{
						myself::SetCurrentQuestID(264);
						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) < 26 )
						{
							if( talker.level >= 3 )
							{
								myself::FHTML_SetFileName(fhtml0,"paint_q0264_02.htm");
								myself::FHTML_SetInt(fhtml0,"quest_id",264);
								myself::ShowFHTML(talker,fhtml0);
							}
							else
							{
								myself::ShowPage(talker,"paint_q0264_01.htm");
							}
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,264) == 1 && myself::OwnItemCount(talker,1367) < 50 ) )
					{
						myself::SetCurrentQuestID(264);
						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,"paint_q0264_04.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,264) == 1 && myself::OwnItemCount(talker,1367) >= 50 ) )
					{
						myself::SetCurrentQuestID(264);
						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::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
						{
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,1367,myself::OwnItemCount(talker,1367));
							i0 = gg::Rand(17);
							if( i0 == 0 )
							{
								myself::GiveItem1(talker,4633,1);
								myself::SoundEffect(talker,"ItemSound.quest_jackpot");
							}
							else if( i0 < 2 )
							{
								myself::GiveItem1(talker,57,2000);
							}
							else if( i0 < 5 )
							{
								myself::GiveItem1(talker,5140,1);
							}
							else if( i0 < 8 )
							{
								myself::GiveItem1(talker,735,1);
								myself::GiveItem1(talker,57,50);
							}
							else if( i0 < 11 )
							{
								myself::GiveItem1(talker,737,1);
							}
							else if( i0 < 14 )
							{
								myself::GiveItem1(talker,734,1);
							}
							else
							{
								myself::GiveItem1(talker,35,1);
								myself::GiveItem1(talker,57,50);
							}
							myself::ShowPage(talker,"paint_q0264_05.htm");
							myself::RemoveMemo(talker,264);
							myself::AddLog(2,talker,264);
							myself::SoundEffect(talker,"ItemSound.quest_finish");
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker)
	{
		if( quest_id == 264 )
		{
			myself::SetCurrentQuestID(264);
			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::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
			{
				talker.quest_last_reward_time = myself::GetCurrentTick();
				myself::SetMemo(talker,264);
				myself::AddLog(1,talker,264);
				myself::SetFlagJournal(talker,264,1);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowPage(talker,"paint_q0264_03.htm");
			}
			return;
		}
		super;
	}

}
