class 1 radia : merchant
{
property:
	BuySellList SellList0 = {{"tights_pants";10};{"tights_shirt";10};{"bone_breastplate";10};{"bone_gaiters";10};{"piece_bone_breastplate";10};{"bronze_breastplate";10};{"hard_leather_gaiters";10};{"piece_bone_gaiters";10};{"hard_leather_shirt";10};{"bronze_gaiters";10};{"puma_skin_gaiters";10};{"ring_breastplate";10};{"puma_skin_shirt";10};{"iron_plate_gaiters";10};{"lion_skin_gaiters";10};{"lion_skin_shirt";10};{"scale_mail";10};{"compound_scale_mail";10};{"dwarven_scale_mail";10};{"mithril_breastplate";10};{"mithril_gaiters";10};{"reinforce_leather_gaiters";10};{"scale_gaiters";10};{"blast_plate";10};{"compound_scale_gaiters";10};{"dwarven_scale_gaiters";10};{"mithril_banded_mail";10};{"mithril_banded_gaiters";10};{"reinforce_leather_shirt";10};{"brigandine_gaiters";10};{"brigandine";10};{"manticor_skin_shirt";10};{"manticor_skin_gaiters";10};{"round_shield";10};{"bone_shield";10};{"bronze_shield";10};{"aspis";10};{"hoplon";10};{"kite_shield";10};{"leather_gloves";10};{"bracer";10};{"excellence_leather_gloves";10};{"leather_gauntlet";10};{"gauntlet";10};{"gauntlet_of_repose_of_the_soul";10};{"low_boots";10};{"boots";10};{"leather_boots";10};{"blue_buckskin_boots";10};{"iron_boots";10};{"boots_of_power";10};{"leather_helmet";10};{"hard_leather_helmet";10};{"bone_helmet";10};{"bronze_helmet";10};{"helmet";10};{"mithril_boots";10};{"chain_mail_shirt";10};{"chain_gaiters";10};{"tempered_mithril_shirt";10};{"eldarake";10};{"tempered_mithril_gaiters";10};{"chain_boots";10};{"plate_leather_boots";10};{"dwarven_chain_boots";10};{"boots_of_seal";10};{"reinforce_mithril_gloves";10};{"chain_gloves";10};{"chain_shield";10};{"cotton_shirt";10};{"linen_shirt";10};{"striped_cotton_shirt";10};{"striped_linen_shirt";10}};

handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( talker.level >= 60 && myself::HaveMemo(talker,34) == 0 && myself::GetOneTimeQuestFlag(talker,34) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"In Search of Cloth");
			}
			if( talker.level < 60 && myself::HaveMemo(talker,34) == 0 && myself::GetOneTimeQuestFlag(talker,34) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"In Search of Cloth");
			}
			if( myself::HaveMemo(talker,34) == 0 && myself::GetOneTimeQuestFlag(talker,34) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"In Search of Cloth (End)");
			}
			if( myself::HaveMemo(talker,34) == 1 && myself::GetOneTimeQuestFlag(talker,34) == 0 && myself::GetMemoState(talker,34) == ( ( 1 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"In Search of Cloth (Continue)");
			}
			if( myself::HaveMemo(talker,34) == 1 && myself::GetOneTimeQuestFlag(talker,34) == 0 && myself::GetMemoState(talker,34) == ( ( 2 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"In Search of Cloth (Continue)");
			}
			if( myself::HaveMemo(talker,34) == 1 && myself::GetOneTimeQuestFlag(talker,34) == 0 && myself::GetMemoState(talker,34) == ( ( 3 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"In Search of Cloth (Continue)");
			}
			if( ( ( myself::HaveMemo(talker,34) == 1 && ( ( 1 == 1 && myself::OwnItemCount(talker,7161) >= 1 ) || 1 == 0 ) ) && myself::GetOneTimeQuestFlag(talker,34) == 0 ) && myself::GetMemoState(talker,34) == ( ( 5 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"In Search of Cloth (Continue)");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					if( _from_choice == 0 || ( talker.level >= 60 && myself::HaveMemo(talker,34) == 0 && myself::GetOneTimeQuestFlag(talker,34) == 0 ) )
					{
						myself::SetCurrentQuestID(34);
						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( ( ( ( 1 == 1 && myself::OwnItemCount(talker,7164) >= 1 ) || 1 == 0 ) && ( ( 0 == 1 && myself::GetOneTimeQuestFlag(talker,0) == 1 ) || 0 == 0 ) ) && ( ( 0 == 1 && talker.subjob_id != 0 ) || 0 == 0 ) )
							{
								myself::FHTML_SetFileName(fhtml0,"radia_q0034_0101.htm");
								myself::FHTML_SetInt(fhtml0,"quest_id",34);
								myself::ShowFHTML(talker,fhtml0);
							}
							else
							{
								myself::ShowPage(talker,"radia_q0034_0102.htm");
							}
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( talker.level < 60 && myself::HaveMemo(talker,34) == 0 && myself::GetOneTimeQuestFlag(talker,34) == 0 ) )
					{
						myself::SetCurrentQuestID(34);
						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,"radia_q0034_0103.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,34) == 0 && myself::GetOneTimeQuestFlag(talker,34) == 1 ) )
					{
						myself::SetCurrentQuestID(34);
						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,"finishedquest.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,34) == 1 && myself::GetOneTimeQuestFlag(talker,34) == 0 && myself::GetMemoState(talker,34) == ( ( 1 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(34);
						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,"radia_q0034_0105.htm");
					}
					break;
				}
				case 4:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,34) == 1 && myself::GetOneTimeQuestFlag(talker,34) == 0 && myself::GetMemoState(talker,34) == ( ( 2 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(34);
						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::SetHTMLCookie(talker,34,2);
						myself::ShowPage(talker,"radia_q0034_0201.htm");
					}
					break;
				}
				case 5:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,34) == 1 && myself::GetOneTimeQuestFlag(talker,34) == 0 && myself::GetMemoState(talker,34) == ( ( 3 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(34);
						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,"radia_q0034_0302.htm");
					}
					break;
				}
				case 6:
				{
					if( _from_choice == 0 || ( ( ( myself::HaveMemo(talker,34) == 1 && ( ( 1 == 1 && myself::OwnItemCount(talker,7161) >= 1 ) || 1 == 0 ) ) && myself::GetOneTimeQuestFlag(talker,34) == 0 ) && myself::GetMemoState(talker,34) == ( ( 5 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(34);
						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::SetHTMLCookie(talker,34,5);
						if( ( ( 1 == 1 && myself::OwnItemCount(talker,1866) >= 3000 ) || 1 == 0 ) && ( ( 1 == 1 && myself::OwnItemCount(talker,1868) >= 5000 ) || 1 == 0 ) )
						{
							myself::ShowPage(talker,"radia_q0034_0501.htm");
						}
						else
						{
							myself::ShowPage(talker,"radia_q0034_0502.htm");
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker)
	{
		if( quest_id == 34 )
		{
			myself::SetCurrentQuestID(34);
			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,34);
				myself::SetMemoState(talker,34,( ( 1 * 10 ) + 1 ));
				myself::AddLog(1,talker,34);
				myself::SetFlagJournal(talker,34,1);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowPage(talker,"radia_q0034_0104.htm");
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,i1,quest_id,reply,talker)
	{
		if( ask == 34 )
		{
			myself::SetCurrentQuestID(34);
			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 == 34 )
		{
			i0 = myself::GetHTMLCookie(talker,34,( 3 - 1 ));
			if( i0 != -1 )
			{
				if( reply == 1 && myself::HaveMemo(talker,34) == 1 && myself::GetOneTimeQuestFlag(talker,34) == 0 )
				{
					if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
					{
						talker.quest_last_reward_time = myself::GetCurrentTick();
						myself::ShowPage(talker,"radia_q0034_0301.htm");
						myself::SetMemoState(talker,34,( ( 3 * 10 ) + 1 ));
						myself::SetFlagJournal(talker,34,3);
					}
				}
			}
		}
		if( ask == 34 )
		{
			myself::SetCurrentQuestID(34);
			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 == 34 && myself::GetOneTimeQuestFlag(talker,34) == 0 )
		{
			i0 = myself::GetHTMLCookie(talker,34,( 6 - 1 ));
			if( i0 != -1 )
			{
				if( reply == 3 && myself::HaveMemo(talker,34) == 1 && myself::GetOneTimeQuestFlag(talker,34) == 0 )
				{
					if( ( ( ( 1 == 1 && myself::OwnItemCount(talker,7161) >= 1 ) || 1 == 0 ) && ( ( 1 == 1 && myself::OwnItemCount(talker,1868) >= 5000 ) || 1 == 0 ) ) && ( ( 1 == 1 && myself::OwnItemCount(talker,1866) >= 3000 ) || 1 == 0 ) )
					{
						if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
						{
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,7161,1);
							myself::DeleteItem1(talker,1868,5000);
							myself::DeleteItem1(talker,1866,3000);
							myself::GiveItem1(talker,7076,1);
						}
						myself::AddLog(2,talker,34);
						myself::RemoveMemo(talker,34);
						myself::SetOneTimeQuestFlag(talker,34,1);
						myself::SoundEffect(talker,"ItemSound.quest_finish");
						myself::ShowPage(talker,"radia_q0034_0601.htm");
					}
					else
					{
						myself::ShowPage(talker,"radia_q0034_0602.htm");
					}
				}
			}
		}
		super;
	}

}
