class 1 spirit_of_mirrors2 : warrior_passive
{
handler:
	EventHandler MY_DYING(always_list,c1,code_info,i9,last_attacker,lparty,member,random1_list,target,weapon_class_id)
	{
		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(104);
				target = code_info::RandomSelectOne();
				if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 )
				{
					c1 = myself::GetLastAttacker();
					if( c1.master )
					{
						c1 = c1.master;
					}
					if( myself::HaveMemo(c1,104) == 1 && myself.sm.last_blow_weapon_class_id == 748 && myself::OwnItemCount(c1,1136) == 0 && myself::OwnItemCount(c1,748) > 0 )
					{
						myself::DeleteItem1(c1,748,1);
						myself::GiveItem1(c1,1136,1);
						if( ( ( myself::OwnItemCount(c1,1135) + myself::OwnItemCount(c1,1136) ) + myself::OwnItemCount(c1,1137) ) >= 2 )
						{
							myself::SetFlagJournal(c1,104,3);
						}
						myself::SoundEffect(c1,"ItemSound.quest_middle");
						myself::SetMemoState(c1,104,2);
					}
				}
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 )
		{
		}
		super;
	}

}
