class 1 guard_coleman : guard_fixed
{
handler:
	EventHandler TALK_SELECTED(fhtml0,quest_id,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,360) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Plunder Their Supplies");
			}
			if( myself::HaveMemo(talker,360) == 1 && myself::OwnItemCount(talker,5872) == 0 && myself::OwnItemCount(talker,5870) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Plunder Their Supplies (Continue)");
			}
			if( myself::HaveMemo(talker,360) == 1 && myself::OwnItemCount(talker,5872) > 0 && myself::OwnItemCount(talker,5870) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Plunder Their Supplies (Continue)");
			}
			if( myself::HaveMemo(talker,360) == 1 && myself::OwnItemCount(talker,5872) > 0 && myself::OwnItemCount(talker,5870) > 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Plunder Their Supplies (Continue)");
			}
			if( myself::HaveMemo(talker,360) == 1 && myself::OwnItemCount(talker,5872) == 0 && myself::OwnItemCount(talker,5870) > 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Plunder Their Supplies (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,360) == 0 )
					{
						myself::SetCurrentQuestID(360);
						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 < 52 )
							{
								myself::ShowPage(talker,"guard_coleman_q0360_01.htm");
							}
							else if( talker.level >= 52 )
							{
								myself::ShowPage(talker,"guard_coleman_q0360_02.htm");
							}
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,360) == 1 && myself::OwnItemCount(talker,5872) == 0 && myself::OwnItemCount(talker,5870) == 0 ) )
					{
						myself::SetCurrentQuestID(360);
						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_coleman_q0360_05.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,360) == 1 && myself::OwnItemCount(talker,5872) > 0 && myself::OwnItemCount(talker,5870) == 0 ) )
					{
						myself::SetCurrentQuestID(360);
						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::GiveItem1(talker,57,( ( myself::OwnItemCount(talker,5872) * 100 ) + 6000 ));
							myself::DeleteItem1(talker,5872,myself::OwnItemCount(talker,5872));
							myself::ShowPage(talker,"guard_coleman_q0360_06.htm");
							myself::AddLog(3,talker,360);
						}
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,360) == 1 && myself::OwnItemCount(talker,5872) > 0 && myself::OwnItemCount(talker,5870) > 0 ) )
					{
						myself::SetCurrentQuestID(360);
						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::GiveItem1(talker,57,( ( ( myself::OwnItemCount(talker,5872) * 100 ) + 6000 ) + ( myself::OwnItemCount(talker,5870) * 6000 ) ));
							myself::DeleteItem1(talker,5872,myself::OwnItemCount(talker,5872));
							myself::DeleteItem1(talker,5870,myself::OwnItemCount(talker,5870));
							myself::ShowPage(talker,"guard_coleman_q0360_07.htm");
							myself::AddLog(3,talker,360);
						}
					}
					break;
				}
				case 4:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,360) == 1 && myself::OwnItemCount(talker,5872) == 0 && myself::OwnItemCount(talker,5870) > 0 ) )
					{
						myself::SetCurrentQuestID(360);
						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::GiveItem1(talker,57,( ( 6000 * myself::OwnItemCount(talker,5870) ) + 6000 ));
							myself::DeleteItem1(talker,5870,myself::OwnItemCount(talker,5870));
							myself::ShowPage(talker,"guard_coleman_q0360_08.htm");
							myself::AddLog(3,talker,360);
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

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

	EventHandler MENU_SELECTED(ask,fhtml0,quest_id,reply,talker)
	{
		if( ask == 360 )
		{
			myself::SetCurrentQuestID(360);
			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 == 360 )
		{
			if( reply == 1 && myself::HaveMemo(talker,360) == 0 )
			{
				myself::FHTML_SetFileName(fhtml0,"guard_coleman_q0360_03.htm");
				myself::FHTML_SetInt(fhtml0,"quest_id",360);
				myself::ShowFHTML(talker,fhtml0);
			}
			if( reply == 2 && myself::HaveMemo(talker,360) == 1 )
			{
				myself::ShowPage(talker,"guard_coleman_q0360_09.htm");
			}
			if( reply == 3 && myself::HaveMemo(talker,360) == 1 )
			{
				myself::RemoveMemo(talker,360);
				myself::SoundEffect(talker,"ItemSound.quest_finish");
				myself::ShowPage(talker,"guard_coleman_q0360_10.htm");
				myself::AddLog(2,talker,360);
			}
		}
		super;
	}

}
