class 1 rune_ghost2 : citizen
{
handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,22) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Tragedy in Von Hellman Forest (Continue)");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			if( _code == 0 )
			{
				if( _from_choice == 0 || myself::HaveMemo(talker,22) == 1 )
				{
					myself::SetCurrentQuestID(22);
					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.sm.param2 != talker.dbid )
					{
						myself::ShowPage(talker,"rune_ghost2_q0022_01a.htm");
						myself::SoundEffect(talker,"AmbSound.d_horror_15");
					}
					else if( myself.sm.param2 == talker.dbid )
					{
						myself::ShowPage(talker,"rune_ghost2_q0022_01.htm");
						myself::SoundEffect(talker,"AmbSound.d_horror_15");
					}
				}
			}
			return;
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(c0,npc0,timer_id)
	{
		myself::SetCurrentQuestID(22);
		if( timer_id == 2201 )
		{
			npc0 = gg::GetNPCFromID(myself.sm.param3);
			if( gg::IsNull(npc0) == 0 )
			{
				npc0.i_quest0 = 0;
			}
			myself::Say(myself::MakeFString(2251,"","","","",""));
			myself::Despawn();
		}
		else if( timer_id == 2202 )
		{
			npc0 = gg::GetNPCFromID(myself.sm.param3);
			if( gg::IsNull(npc0) == 0 )
			{
				npc0.i_quest0 = 0;
			}
			myself::Despawn();
		}
		super;
	}

	EventHandler CREATED(c0)
	{
		myself::SetCurrentQuestID(22);
		myself::AddTimerEx(2201,( 1000 * 120 ));
		c0 = myself::GetCreatureFromIndex(myself.sm.param1);
		if( c0 )
		{
			myself::Say(myself::MakeFString(2250,c0.name,"","","",""));
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker)
	{
		if( ask == 22 )
		{
			myself::SetCurrentQuestID(22);
			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 == 22 )
		{
			if( reply == 6 )
			{
				myself::ShowPage(talker,"rune_ghost2_q0022_04.htm");
				myself::SoundEffect(talker,"AmbSound.d_horror_03");
			}
			if( reply == 7 )
			{
				myself::SetMemoState(talker,22,5);
				myself::ShowPage(talker,"rune_ghost2_q0022_08.htm");
				myself::AddTimerEx(2202,( 1000 * 3 ));
				myself::SetFlagJournal(talker,22,8);
			}
		}
		super;
	}

}
