class 1 grendel_b : warrior_aggressive_physicalspecial
{
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,618) == 1 && myself::GetMemoState(target,618) == ( ( 2 * 10 ) + 1 ) )
		{
			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,618) == 1 && myself::GetMemoState(target,618) == ( ( 2 * 10 ) + 1 ) )
				{
					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(618);
				target = code_info::RandomSelectOne();
				if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 )
				{
					i4 = gg::Rand(1000);
					if( i4 < 500 && 500 != 0 )
					{
						if( ( myself::OwnItemCount(target,7265) + 1 ) >= 50 )
						{
							if( myself::OwnItemCount(target,7265) <= 50 )
							{
								myself::GiveItem1(target,7265,( 50 - myself::OwnItemCount(target,7265) ));
								myself::SoundEffect(target,"ItemSound.quest_middle");
							}
							if( ( ( 0 == 1 && myself::OwnItemCount(target,0) >= 0 ) || 0 == 0 ) && ( ( 0 == 1 && myself::OwnItemCount(target,0) >= 0 ) || 0 == 0 ) )
							{
								myself::SetFlagJournal(target,618,3);
								myself::SetMemoState(target,618,( ( 2 * 10 ) + 2 ));
							}
						}
						else
						{
							myself::GiveItem1(target,7265,1);
							myself::SoundEffect(target,"ItemSound.quest_itemget");
						}
					}
					else if( i4 < ( 500 + 0 ) && 0 != 0 )
					{
					}
					else if( i4 < ( ( 500 + 0 ) + 0 ) && 0 != 0 )
					{
					}
				}
			}
		}
		super;
	}

}
