class 1 varka_silenos_hunter : warrior_ag_physicalspecial_stone
{
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,605) == 1 && ( ( ( ( ( ( ( ( ( myself::OwnItemCount(target,7211) + myself::OwnItemCount(target,7212) ) + myself::OwnItemCount(target,7213) ) + myself::OwnItemCount(target,7214) ) + myself::OwnItemCount(target,7215) ) == 0 && myself::OwnItemCount(target,7216) < 100 ) || ( myself::OwnItemCount(target,7211) >= 1 && myself::OwnItemCount(target,7216) < 200 ) ) || ( myself::OwnItemCount(target,7212) >= 1 && myself::OwnItemCount(target,7216) < 300 ) ) || ( myself::OwnItemCount(target,7213) >= 1 && myself::OwnItemCount(target,7216) < 300 ) ) || ( myself::OwnItemCount(target,7214) >= 1 && myself::OwnItemCount(target,7216) < 400 ) ) )
		{
			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,605) == 1 && ( ( ( ( ( ( ( ( ( myself::OwnItemCount(target,7211) + myself::OwnItemCount(target,7212) ) + myself::OwnItemCount(target,7213) ) + myself::OwnItemCount(target,7214) ) + myself::OwnItemCount(target,7215) ) == 0 && myself::OwnItemCount(target,7216) < 100 ) || ( myself::OwnItemCount(target,7211) >= 1 && myself::OwnItemCount(target,7216) < 200 ) ) || ( myself::OwnItemCount(target,7212) >= 1 && myself::OwnItemCount(target,7216) < 300 ) ) || ( myself::OwnItemCount(target,7213) >= 1 && myself::OwnItemCount(target,7216) < 300 ) ) || ( myself::OwnItemCount(target,7214) >= 1 && myself::OwnItemCount(target,7216) < 400 ) ) )
				{
					random1_list::SetInfo(0,target);
				}
			}
		}
		target = last_attacker;
		always_list::SetInfo(1,target);
		if( gg::IsNull(lparty) == 0 )
		{
			for(i9 = 0; i9 < lparty.member_count; i9 = ( i9 + 1 ))
			{
				target = myself::GetMemberOfParty(lparty,i9);
				always_list::SetInfo(1,target);
			}
		}
		target = last_attacker;
		if( myself::HaveMemo(target,606) == 1 && myself::GetMemoState(target,606) == ( ( 1 * 10 ) + 1 ) )
		{
			random1_list::SetInfo(2,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,606) == 1 && myself::GetMemoState(target,606) == ( ( 1 * 10 ) + 1 ) )
				{
					random1_list::SetInfo(2,target);
				}
			}
		}
		while( gg::IsNull(code_info = always_list::Next()) == 0 )
		{
			if( code_info.code == 1 )
			{
				myself::SetCurrentQuestID(611);
				while( gg::IsNull(target = code_info::Next()) == 0 )
				{
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 )
					{
						myself::SetCurrentQuestID(611);
						if( myself::OwnItemCount(target,7225) >= 1 )
						{
							myself::DeleteItem1(target,7225,myself::OwnItemCount(target,7225));
							myself::GiveItem1(target,7224,1);
						}
						else if( myself::OwnItemCount(target,7224) >= 1 )
						{
							myself::DeleteItem1(target,7224,myself::OwnItemCount(target,7224));
							myself::GiveItem1(target,7223,1);
						}
						else if( myself::OwnItemCount(target,7223) >= 1 )
						{
							myself::DeleteItem1(target,7223,myself::OwnItemCount(target,7223));
							myself::GiveItem1(target,7222,1);
						}
						else if( myself::OwnItemCount(target,7222) >= 1 )
						{
							myself::DeleteItem1(target,7222,myself::OwnItemCount(target,7222));
							myself::GiveItem1(target,7221,1);
						}
						else if( myself::OwnItemCount(target,7221) >= 1 )
						{
							myself::DeleteItem1(target,7221,myself::OwnItemCount(target,7221));
						}
						if( myself::HaveMemo(target,611) )
						{
							myself::RemoveMemo(target,611);
							myself::AddLog(2,target,611);
							myself::DeleteItem1(target,7226,myself::OwnItemCount(target,7226));
							myself::DeleteItem1(target,7227,myself::OwnItemCount(target,7227));
							myself::DeleteItem1(target,7228,myself::OwnItemCount(target,7228));
						}
						if( myself::HaveMemo(target,612) )
						{
							myself::RemoveMemo(target,612);
							myself::AddLog(2,target,612);
							myself::DeleteItem1(target,7234,myself::OwnItemCount(target,7234));
						}
						if( myself::HaveMemo(target,613) )
						{
							myself::RemoveMemo(target,613);
							myself::AddLog(2,target,613);
							myself::DeleteItem1(target,7240,myself::OwnItemCount(target,7240));
						}
						if( myself::HaveMemo(target,614) )
						{
							myself::RemoveMemo(target,614);
							myself::AddLog(2,target,614);
							myself::DeleteItem1(target,7241,myself::OwnItemCount(target,7241));
						}
						if( myself::HaveMemo(target,615) )
						{
							myself::RemoveMemo(target,615);
							myself::AddLog(2,target,615);
							myself::DeleteItem1(target,7242,myself::OwnItemCount(target,7242));
						}
						if( myself::HaveMemo(target,616) )
						{
							myself::RemoveMemo(target,616);
							myself::AddLog(2,target,616);
							myself::DeleteItem1(target,7244,myself::OwnItemCount(target,7244));
						}
					}
				}
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 )
		{
			switch(code_info.code)
			{
				case 0:
				{
					myself::SetCurrentQuestID(605);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 )
					{
						i4 = gg::Rand(1000);
						if( i4 < 521 )
						{
							myself::GiveItem1(target,7216,1);
							myself::SoundEffect(target,"ItemSound.quest_itemget");
						}
					}
					break;
				}
				case 2:
				{
					myself::SetCurrentQuestID(606);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 )
					{
						i4 = gg::Rand(1000);
						if( i4 < 522 )
						{
							myself::GiveItem1(target,7233,( gg::Rand(QuestDropCountRate) + 1 ));
							myself::SoundEffect(target,"ItemSound.quest_itemget");
						}
					}
					break;
				}
			}
		}
		super;
	}

	EventHandler ATTACKED(attacker,damage)
	{
		myself::SetCurrentQuestID(609);
		if( myself::HaveMemo(attacker,609) && myself::GetMemoState(attacker,609) == 2 )
		{
			myself::SetMemoState(attacker,609,3);
			myself::CreateOnePrivateEx(1031684,"udans_eye",0,0,myself::FloatToInt(myself.sm.x),myself::FloatToInt(myself.sm.y),myself::FloatToInt(myself.sm.z),0,0,0,0);
			if( myself::Skill_GetConsumeMP(1164033) < myself.sm.mp && myself::Skill_GetConsumeHP(1164033) < myself.sm.hp && myself::Skill_InReuseDelay(1164033) == 0 )
			{
				myself::AddUseSkillDesire(attacker,1164033,0,1,10000000);
			}
		}
		super;
	}

}
