class 1 monstereye_gazer : wizard_pa_ddmagic2_curse
{
handler:
	EventHandler MY_DYING(always_list,c1,code_info,i0,i4,i9,last_attacker,lparty,member,random1_list,target)
	{
		always_list = gg::AllocCodeInfoList();
		random1_list = gg::AllocCodeInfoList();
		target = last_attacker;
		always_list::SetInfo(0,target);
		target = last_attacker;
		if( myself::HaveMemo(target,42) == 1 && myself::GetMemoState(target,42) == ( ( 2 * 10 ) + 1 ) )
		{
			random1_list::SetInfo(1,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,42) == 1 && myself::GetMemoState(target,42) == ( ( 2 * 10 ) + 1 ) )
				{
					random1_list::SetInfo(1,target);
				}
			}
		}
		while( gg::IsNull(code_info = always_list::Next()) == 0 )
		{
			if( code_info.code == 0 )
			{
				myself::SetCurrentQuestID(330);
				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,330) == 1 && myself::OwnItemCount(c1,1420) == 1 && ( ( ( ( ( ( ( myself::OwnItemCount(c1,1424) + myself::OwnItemCount(c1,1425) ) + myself::OwnItemCount(c1,1429) ) + myself::OwnItemCount(c1,1430) ) + myself::OwnItemCount(c1,1433) ) + myself::OwnItemCount(c1,1437) ) + myself::OwnItemCount(c1,1438) ) + myself::OwnItemCount(c1,1441) ) < 5 && myself::OwnItemCount(c1,1439) == 1 && myself::OwnItemCount(c1,1440) < 30 )
					{
						i0 = gg::Rand(10);
						if( i0 < 7 )
						{
							c1.quest_last_reward_time = myself::GetCurrentTick();
							myself::GiveItem1(c1,1440,1);
							if( myself::OwnItemCount(c1,1440) == 30 )
							{
								myself::SoundEffect(c1,"ItemSound.quest_middle");
							}
							else
							{
								myself::SoundEffect(c1,"ItemSound.quest_itemget");
							}
						}
						else
						{
							c1.quest_last_reward_time = myself::GetCurrentTick();
							if( myself::OwnItemCount(c1,1440) == 29 )
							{
								myself::GiveItem1(c1,1440,1);
								myself::SoundEffect(c1,"ItemSound.quest_middle");
							}
							else
							{
								myself::GiveItem1(c1,1440,2);
								myself::SoundEffect(c1,"ItemSound.quest_itemget");
							}
						}
					}
				}
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 )
		{
			if( code_info.code == 1 )
			{
				myself::SetCurrentQuestID(42);
				target = code_info::RandomSelectOne();
				if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 )
				{
					i4 = gg::Rand(1000);
					if( i4 < 1000 && 1000 != 0 )
					{
						if( ( myself::OwnItemCount(target,7548) + 1 ) >= 30 )
						{
							if( myself::OwnItemCount(target,7548) < 30 )
							{
								myself::GiveItem1(target,7548,( 30 - myself::OwnItemCount(target,7548) ));
								myself::SoundEffect(target,"ItemSound.quest_middle");
								myself::SetFlagJournal(target,42,3);
							}
							if( ( ( 0 == 1 && myself::OwnItemCount(target,0) >= 0 ) || 0 == 0 ) && ( ( 0 == 1 && myself::OwnItemCount(target,0) >= 0 ) || 0 == 0 ) )
							{
								myself::SetMemoState(target,42,( ( 2 * 10 ) + 2 ));
							}
						}
						else
						{
							myself::GiveItem1(target,7548,1);
							myself::SoundEffect(target,"ItemSound.quest_itemget");
						}
					}
					else if( i4 < ( 1000 + 0 ) && 0 != 0 )
					{
					}
					else if( i4 < ( ( 1000 + 0 ) + 0 ) && 0 != 0 )
					{
					}
				}
			}
		}
		super;
	}

}
