class 1 harit_lizardm_matriarch : warrior_aggressive_physicalspecial
{
handler:
	EventHandler MY_DYING(always_list,c0,c1,c2,code_info,i0,i1,i2,i3,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;
		always_list::SetInfo(1,target);
		while( gg::IsNull(code_info = always_list::Next()) == 0 )
		{
			switch(code_info.code)
			{
				case 0:
				{
					myself::SetCurrentQuestID(337);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 )
					{
						c1 = myself::GetLastAttacker();
						if( c1.master )
						{
							c1 = c1.master;
						}
						i1 = myself::Party_GetCount(c1);
						i2 = 0;
						if( ( ( i1 == 0 && ( myself::GetMemoState(c1,337) == 21110 || myself::GetMemoState(c1,337) == 21100 || myself::GetMemoState(c1,337) == 21010 || myself::GetMemoState(c1,337) == 21000 || myself::GetMemoState(c1,337) == 20110 || myself::GetMemoState(c1,337) == 20100 || myself::GetMemoState(c1,337) == 20010 || myself::GetMemoState(c1,337) == 20000 ) ) && myself::OwnItemCount(c1,3858) == 0 ) && myself::HaveMemo(c1,337) == 1 )
						{
							c2 = c1;
						}
						for(i0 = 0; i0 < i1; i0 = ( i0 + 1 ))
						{
							c0 = myself::Party_GetCreature(c1,i0);
							if( ( ( myself::GetMemoState(c0,337) == 21110 || myself::GetMemoState(c0,337) == 21100 || myself::GetMemoState(c0,337) == 21010 || myself::GetMemoState(c0,337) == 21000 || myself::GetMemoState(c0,337) == 20110 || myself::GetMemoState(c0,337) == 20100 || myself::GetMemoState(c0,337) == 20010 || myself::GetMemoState(c0,337) == 20000 ) && myself::OwnItemCount(c0,3858) == 0 ) && myself::HaveMemo(c0,337) == 1 )
							{
								i3 = gg::Rand(1000);
								if( i2 < i3 )
								{
									i2 = i3;
									c2 = c0;
								}
							}
						}
						if( 1 && myself::IsNullCreature(c2) == 0 && myself::DistFromMe(c2) <= 1500 && gg::Rand(5) == 0 )
						{
							c2.quest_last_reward_time = myself::GetCurrentTick();
							myself::CreateOnePrivate(1027172,"harit_lizardman_zealot",0,1);
							myself::CreateOnePrivate(1027172,"harit_lizardman_zealot",0,1);
							myself::CreateOnePrivate(1027172,"harit_lizardman_zealot",0,1);
						}
					}
					break;
				}
				case 1:
				{
					myself::SetCurrentQuestID(336);
					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,336) && myself::GetMemoState(c1,336) == 2 && myself::OwnItemCount(c1,3812) == 0 )
						{
							if( gg::Rand(2) == 1 )
							{
								c1.quest_last_reward_time = myself::GetCurrentTick();
								myself::GiveItem1(c1,3812,1);
								myself::SoundEffect(c1,"ItemSound.quest_itemget");
								myself::SetFlagJournal(c1,336,3);
							}
						}
					}
					break;
				}
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 )
		{
		}
		super;
	}

}
