class 1 guard_bright : guard_stand
{
handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,221) == 1 && myself::OwnItemCount(talker,3239) == 1 && myself::OwnItemCount(talker,3243) == 0 && myself::OwnItemCount(talker,3264) == 0 && myself::OwnItemCount(talker,3267) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Testimony of Prosperity (Continue)");
			}
			if( myself::HaveMemo(talker,221) == 1 && myself::OwnItemCount(talker,3243) == 0 && myself::OwnItemCount(talker,3239) >= 1 && myself::OwnItemCount(talker,3264) >= 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Testimony of Prosperity (Continue)");
			}
			if( myself::HaveMemo(talker,221) == 1 && myself::OwnItemCount(talker,3239) >= 1 && myself::OwnItemCount(talker,3267) >= 1 && myself::OwnItemCount(talker,3243) == 0 && myself::OwnItemCount(talker,3264) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Testimony of Prosperity (Continue)");
			}
			if( myself::HaveMemo(talker,221) == 1 && myself::OwnItemCount(talker,3239) >= 1 && myself::OwnItemCount(talker,3243) >= 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Testimony of Prosperity (Continue)");
			}
			if( myself::HaveMemo(talker,221) == 1 && myself::OwnItemCount(talker,3240) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Testimony of Prosperity (Continue)");
			}
			if( myself::HaveMemo(talker,299) == 1 && myself::GetMemoState(talker,299) == ( ( 4 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Gather Ingredients for Pie (Continue)");
			}
			if( myself::HaveMemo(talker,299) == 1 && myself::GetMemoState(talker,299) == ( ( 5 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Gather Ingredients for Pie (Continue)");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,221) == 1 && myself::OwnItemCount(talker,3239) == 1 && myself::OwnItemCount(talker,3243) == 0 && myself::OwnItemCount(talker,3264) == 0 && myself::OwnItemCount(talker,3267) == 0 ) )
					{
						myself::SetCurrentQuestID(221);
						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,"guard_bright_q0221_01.htm");
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,221) == 1 && myself::OwnItemCount(talker,3243) == 0 && myself::OwnItemCount(talker,3239) >= 1 && myself::OwnItemCount(talker,3264) >= 1 ) )
					{
						myself::SetCurrentQuestID(221);
						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::OwnItemCount(talker,3265) < 20 || myself::OwnItemCount(talker,3266) < 10 )
						{
							myself::ShowPage(talker,"guard_bright_q0221_04.htm");
						}
						else if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
						{
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::ShowPage(talker,"guard_bright_q0221_05.htm");
							myself::DeleteItem1(talker,3265,myself::OwnItemCount(talker,3265));
							myself::DeleteItem1(talker,3266,myself::OwnItemCount(talker,3266));
							myself::DeleteItem1(talker,3264,1);
							myself::GiveItem1(talker,3267,1);
						}
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,221) == 1 && myself::OwnItemCount(talker,3239) >= 1 && myself::OwnItemCount(talker,3267) >= 1 && myself::OwnItemCount(talker,3243) == 0 && myself::OwnItemCount(talker,3264) == 0 ) )
					{
						myself::SetCurrentQuestID(221);
						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,"guard_bright_q0221_06.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,221) == 1 && myself::OwnItemCount(talker,3239) >= 1 && myself::OwnItemCount(talker,3243) >= 1 ) )
					{
						myself::SetCurrentQuestID(221);
						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,"guard_bright_q0221_07.htm");
					}
					break;
				}
				case 4:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,221) == 1 && myself::OwnItemCount(talker,3240) == 1 ) )
					{
						myself::SetCurrentQuestID(221);
						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,"guard_bright_q0221_08.htm");
					}
					break;
				}
				case 5:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,299) == 1 && myself::GetMemoState(talker,299) == ( ( 4 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(299);
						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,299,4);
						myself::ShowPage(talker,"guard_bright_q0299_0401.htm");
					}
					break;
				}
				case 6:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,299) == 1 && myself::GetMemoState(talker,299) == ( ( 5 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(299);
						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,"guard_bright_q0299_0502.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,quest_id,reply,talker)
	{
		if( ask == 221 )
		{
			myself::SetCurrentQuestID(221);
			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 == 221 )
		{
			if( reply == 1 )
			{
				myself::ShowPage(talker,"guard_bright_q0221_02.htm");
			}
			if( reply == 2 )
			{
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
				{
					talker.quest_last_reward_time = myself::GetCurrentTick();
					myself::ShowPage(talker,"guard_bright_q0221_03.htm");
					myself::GiveItem1(talker,3264,1);
				}
			}
		}
		if( ask == 299 )
		{
			myself::SetCurrentQuestID(299);
			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 == 299 )
		{
			i0 = myself::GetHTMLCookie(talker,299,( 5 - 1 ));
			if( i0 != -1 )
			{
				if( reply == 1 && myself::HaveMemo(talker,299) == 1 )
				{
					if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
					{
						talker.quest_last_reward_time = myself::GetCurrentTick();
						myself::GiveItem1(talker,7136,1);
						myself::ShowPage(talker,"guard_bright_q0299_0501.htm");
						myself::SetMemoState(talker,299,( ( 5 * 10 ) + 1 ));
						myself::SetFlagJournal(talker,299,6);
					}
				}
			}
		}
		super;
	}

}
