class 1 catseye_bandit : warrior_passive
{
handler:
	EventHandler MY_DYING(always_list,c1,code_info,i9,last_attacker,lparty,member,random1_list,target)
	{
		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(403);
				target = code_info::RandomSelectOne();
				if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 )
				{
					c1 = myself::GetLastAttacker();
					myself::Say(myself::MakeFString(40307,"","","","",""));
					if( myself::HaveMemo(myself.c_quest2,403) && myself::OwnItemCount(myself.c_quest2,1185) > 0 && myself.i_quest2 == 1 )
					{
						switch(gg::Rand(4))
						{
							case 0:
							{
								if( myself::OwnItemCount(myself.c_quest2,1186) == 0 )
								{
									myself::GiveItem1(myself.c_quest2,1186,1);
									if( ( ( ( myself::OwnItemCount(myself.c_quest2,1186) + myself::OwnItemCount(myself.c_quest2,1187) ) + myself::OwnItemCount(myself.c_quest2,1188) ) + myself::OwnItemCount(myself.c_quest2,1189) ) >= 3 )
									{
										myself::SoundEffect(myself.c_quest2,"ItemSound.quest_middle");
										myself::SetFlagJournal(myself.c_quest2,403,6);
									}
									else
									{
										myself::SoundEffect(myself.c_quest2,"ItemSound.quest_itemget");
									}
								}
								break;
							}
							case 1:
							{
								if( myself::OwnItemCount(myself.c_quest2,1187) == 0 )
								{
									myself::GiveItem1(myself.c_quest2,1187,1);
									if( ( ( ( myself::OwnItemCount(myself.c_quest2,1186) + myself::OwnItemCount(myself.c_quest2,1187) ) + myself::OwnItemCount(myself.c_quest2,1188) ) + myself::OwnItemCount(myself.c_quest2,1189) ) >= 3 )
									{
										myself::SoundEffect(myself.c_quest2,"ItemSound.quest_middle");
										myself::SetFlagJournal(myself.c_quest2,403,6);
									}
									else
									{
										myself::SoundEffect(myself.c_quest2,"ItemSound.quest_itemget");
									}
								}
								break;
							}
							case 2:
							{
								if( myself::OwnItemCount(myself.c_quest2,1188) == 0 )
								{
									myself::GiveItem1(myself.c_quest2,1188,1);
									if( ( ( ( myself::OwnItemCount(myself.c_quest2,1186) + myself::OwnItemCount(myself.c_quest2,1187) ) + myself::OwnItemCount(myself.c_quest2,1188) ) + myself::OwnItemCount(myself.c_quest2,1189) ) >= 3 )
									{
										myself::SoundEffect(myself.c_quest2,"ItemSound.quest_middle");
										myself::SetFlagJournal(myself.c_quest2,403,6);
									}
									else
									{
										myself::SoundEffect(myself.c_quest2,"ItemSound.quest_itemget");
									}
								}
								break;
							}
							case 3:
							{
								if( myself::OwnItemCount(myself.c_quest2,1189) == 0 )
								{
									myself::GiveItem1(myself.c_quest2,1189,1);
									if( ( ( ( myself::OwnItemCount(myself.c_quest2,1186) + myself::OwnItemCount(myself.c_quest2,1187) ) + myself::OwnItemCount(myself.c_quest2,1188) ) + myself::OwnItemCount(myself.c_quest2,1189) ) >= 3 )
									{
										myself::SoundEffect(myself.c_quest2,"ItemSound.quest_middle");
										myself::SetFlagJournal(myself.c_quest2,403,6);
									}
									else
									{
										myself::SoundEffect(myself.c_quest2,"ItemSound.quest_itemget");
									}
								}
								break;
							}
						}
					}
				}
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 )
		{
		}
		super;
	}

	EventHandler ATTACKED(attacker,damage,weapon_class_id)
	{
		myself::SetCurrentQuestID(403);
		if( myself::HaveMemo(attacker,403) )
		{
			switch(myself.i_quest2)
			{
				case 0:
				{
					myself.c_quest2 = attacker;
					if( myself.c_quest2.equiped_weapon_class_id != 1181 && myself.c_quest2.equiped_weapon_class_id != 1182 )
					{
						myself.i_quest2 = 2;
					}
					else
					{
						myself::Say(myself::MakeFString(40306,"","","","",""));
						myself.i_quest2 = 1;
					}
					break;
				}
				case 1:
				{
					if( myself.c_quest2.equiped_weapon_class_id != 1181 && myself.c_quest2.equiped_weapon_class_id != 1182 )
					{
						myself.i_quest2 = 2;
					}
					if( myself.c_quest2 != attacker )
					{
						myself.i_quest2 = 2;
					}
					break;
				}
				case 2:
				{
					break;
				}
			}
		}
		super;
	}

}
