class 1 angel_iconoclasis_3 : lv3_dwarf
{
handler:
	EventHandler MY_DYING(always_list,code_info,i9,last_attacker,lparty,member,npc0,random1_list,target)
	{
		always_list = gg::AllocCodeInfoList();
		random1_list = gg::AllocCodeInfoList();
		target = last_attacker;
		always_list::SetInfo(0,target);
		while( gg::IsNull(code_info = always_list::Next()) == 0 )
		{
			if( code_info.code == 0 )
			{
				myself::SetCurrentQuestID(100);
				target = code_info::RandomSelectOne();
				if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 )
				{
					if( target.is_pc == 1 )
					{
						if( myself::HaveMemo(target,100) == 1 && target.occupation == 57 && myself::GetMemoState(target,100) == 7 && myself::OwnItemCount(target,7360) == 0 && target.dbid == myself.sm.param2 )
						{
							myself::Say(myself::MakeFString(10052,"","","","",""));
							myself::GiveItem1(target,7360,1);
							myself::SetFlagJournal(target,100,9);
							myself::SoundEffect(target,"ItemSound.quest_middle");
						}
					}
					npc0 = gg::GetNPCFromID(myself.sm.param3);
					if( gg::IsNull(npc0) == 0 )
					{
						npc0.i_quest0 = 0;
					}
				}
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 )
		{
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(c0,npc0,timer_id)
	{
		myself::SetCurrentQuestID(100);
		if( timer_id == 99901 )
		{
			c0 = myself::GetCreatureFromIndex(myself.sm.param1);
			if( c0 )
			{
				if( c0.is_pc == 1 )
				{
					myself::Say(myself::MakeFString(10050,c0.name,"","","",""));
				}
			}
		}
		else if( timer_id == 99902 )
		{
			myself::Say(myself::MakeFString(10051,"","","","",""));
			npc0 = gg::GetNPCFromID(myself.sm.param3);
			if( gg::IsNull(npc0) == 0 )
			{
				npc0.i_quest0 = 0;
			}
			myself::Despawn();
		}
		super;
	}

	EventHandler CREATED()
	{
		myself::SetCurrentQuestID(100);
		myself::AddTimerEx(99901,500);
		myself::AddTimerEx(99902,( 1000 * 300 ));
		super;
	}

}
