class 1 requiem_behemoth_3 : warrior_pa_corpse_zombie_ddmagic
{
handler:
	EventHandler MY_DYING(always_list,code_info,i4,i9,last_attacker,lparty,member,random1_list,target)
	{
		always_list = gg::AllocCodeInfoList();
		random1_list = gg::AllocCodeInfoList();
		target = last_attacker;
		if( myself::HaveMemo(target,633) == 1 && ( myself::GetMemoState(target,633) == ( ( 1 * 10 ) + 1 ) || myself::GetMemoState(target,633) == ( ( 1 * 10 ) + 2 ) ) )
		{
			random1_list::SetInfo(0,target);
		}
		if( gg::IsNull(lparty) == 0 )
		{
			for(i9 = 0; i9 < lparty.member_count; i9 = ( i9 + 1 ))
			{
				target = myself::GetMemberOfParty(lparty,i9);
				if( myself::HaveMemo(target,633) == 1 && ( myself::GetMemoState(target,633) == ( ( 1 * 10 ) + 1 ) || myself::GetMemoState(target,633) == ( ( 1 * 10 ) + 2 ) ) )
				{
					random1_list::SetInfo(0,target);
				}
			}
		}
		while( gg::IsNull(code_info = always_list::Next()) == 0 )
		{
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 )
		{
			if( code_info.code == 0 )
			{
				myself::SetCurrentQuestID(633);
				target = code_info::RandomSelectOne();
				if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 )
				{
					i4 = gg::Rand(1000);
					if( i4 < 408 )
					{
						myself::GiveItem1(target,7545,1);
						myself::SoundEffect(target,"ItemSound.quest_itemget");
					}
				}
			}
		}
		super;
	}

}
