class 1 cloister_protector : warrior_ag_casting_3skill_magical2
{
handler:
	EventHandler MY_DYING(i4,i9,lparty,last_attacker,target)
	{
		target = last_attacker;
		if( gg::IsNull(lparty) == 0 )
		{
			for(i9 = 0; i9 < lparty.member_count; i9 = ( i9 + 1 ))
			{
				target = myself::GetMemberOfParty(lparty,i9);
				if( myself::HaveMemo(target,639) == 1 && myself::GetMemoState(target,639) == 4 )
				{
					myself::SetCurrentQuestID(639);
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 )
					{
						i4 = gg::Rand(100);
						if( i4 < 52 )
						{
							myself::GiveItem1(target,8069,1);
							myself::SoundEffect(target,"ItemSound.quest_itemget");
						}
					}
				}
			}
		}
		else if( myself::HaveMemo(target,639) == 1 && myself::GetMemoState(target,639) == 4 )
		{
			myself::SetCurrentQuestID(639);
			if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 )
			{
				i4 = gg::Rand(100);
				if( i4 < 52 )
				{
					myself::GiveItem1(target,8069,1);
					myself::SoundEffect(target,"ItemSound.quest_itemget");
				}
			}
		}
		super;
	}

}
