class 1 rooney1 : citizen
{
parameter:
	string	fnHi = "blacksmith_of_wind_rooney001.htm";

handler:
	EventHandler CREATED()
	{
		myself::SetTimerPeriod(1800);
	}

	EventHandler TIMER_FIRED(i6)
	{
		i6 = gg::Rand(120);
		if( i6 > 110 )
		{
			myself::InstantTeleport(myself.sm,179815,-115465,-3598);
		}
		else if( i6 > 100 )
		{
			myself::InstantTeleport(myself.sm,178091,-119661,-4087);
		}
		else if( i6 > 90 )
		{
			myself::InstantTeleport(myself.sm,190447,-117063,-3280);
		}
		else if( i6 > 80 )
		{
			myself::InstantTeleport(myself.sm,189472,-111287,-3280);
		}
		else if( i6 > 70 )
		{
			myself::InstantTeleport(myself.sm,183442,-111453,-3615);
		}
		else if( i6 > 60 )
		{
			myself::InstantTeleport(myself.sm,175916,-113220,-3471);
		}
		else if( i6 > 50 )
		{
			myself::InstantTeleport(myself.sm,178880,-112665,-5821);
		}
		else if( i6 > 40 )
		{
			myself::InstantTeleport(myself.sm,181809,-109360,-5830);
		}
		else if( i6 > 30 )
		{
			myself::InstantTeleport(myself.sm,186321,-109182,-5865);
		}
		else if( i6 > 20 )
		{
			myself::InstantTeleport(myself.sm,184699,-116825,-6102);
		}
		else if( i6 > 10 )
		{
			myself::InstantTeleport(myself.sm,180717,-116163,-6102);
		}
	}

	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( talker.level >= 74 && myself::HaveMemo(talker,617) == 1 && myself::OwnItemCount(talker,7264) >= 1200 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Gather the Flames - In Progress");
			}
			if( talker.level < 74 && myself::HaveMemo(talker,617) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Gather the Flames");
			}
			if( talker.level >= 74 && myself::HaveMemo(talker,617) == 1 && myself::OwnItemCount(talker,7264) < 1200 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Gather the Flames - 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 >= 74 && myself::HaveMemo(talker,617) == 1 && myself::OwnItemCount(talker,7264) >= 1200 ) )
					{
						myself::SetCurrentQuestID(617);
						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,"blacksmith_of_wind_rooney_q617_001.htm");
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( talker.level < 74 && myself::HaveMemo(talker,617) == 0 ) )
					{
						myself::SetCurrentQuestID(617);
						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,"blacksmith_of_wind_rooney_q617_004.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( talker.level >= 74 && myself::HaveMemo(talker,617) == 1 && myself::OwnItemCount(talker,7264) < 1200 ) )
					{
						myself::SetCurrentQuestID(617);
						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,"blacksmith_of_wind_rooney_q617_002.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker)
	{
		if( ask == 617 )
		{
			myself::SetCurrentQuestID(617);
			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::HaveMemo(talker,617) == 1 )
			{
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
				{
					talker.quest_last_reward_time = myself::GetCurrentTick();
					switch(reply)
					{
						case 1:
						{
							myself::GiveItem1(talker,6881,1);
							break;
						}
						case 2:
						{
							myself::GiveItem1(talker,6883,1);
							break;
						}
						case 3:
						{
							myself::GiveItem1(talker,6885,1);
							break;
						}
						case 4:
						{
							myself::GiveItem1(talker,6887,1);
							break;
						}
						case 5:
						{
							myself::GiveItem1(talker,6891,1);
							break;
						}
						case 6:
						{
							myself::GiveItem1(talker,6893,1);
							break;
						}
						case 7:
						{
							myself::GiveItem1(talker,6895,1);
							break;
						}
						case 8:
						{
							myself::GiveItem1(talker,6897,1);
							break;
						}
						case 9:
						{
							myself::GiveItem1(talker,6899,1);
							break;
						}
						case 10:
						{
							myself::GiveItem1(talker,7580,1);
							break;
						}
					}
					myself::ShowPage(talker,"blacksmith_of_wind_rooney_q617_003.htm");
					myself::DeleteItem1(talker,7264,1200);
					myself::AddLog(3,talker,617);
				}
			}
			else
			{
				myself::ShowPage(talker,"noquest.htm");
			}
		}
		super;
	}

}
