class 1 warrior_casting_3skill_magical3_stone : warrior_casting_3skill_magical3
{
parameter:
	int	DeBuff1 = 1155841;

handler:
	EventHandler ATTACKED(attacker)
	{
		if( attacker.is_pc != 0 )
		{
			if( myself::OwnItemCount(attacker,FriendShip1) >= 1 || myself::OwnItemCount(attacker,FriendShip2) >= 1 || myself::OwnItemCount(attacker,FriendShip3) >= 1 || myself::OwnItemCount(attacker,FriendShip4) >= 1 || myself::OwnItemCount(attacker,FriendShip5) >= 1 )
			{
				if( myself::Skill_GetConsumeMP(DeBuff1) < myself.sm.mp && myself::Skill_GetConsumeHP(DeBuff1) < myself.sm.hp && myself::Skill_InReuseDelay(DeBuff1) == 0 )
				{
					myself::AddUseSkillDesire(attacker,DeBuff1,0,1,1000000);
				}
				myself::RemoveAttackDesire(attacker.id);
			}
			else
			{
				super;
			}
		}
		else if( myself::IsInCategory(11,attacker.npc_class_id) != 0 )
		{
			if( myself::OwnItemCount(attacker.master,FriendShip1) >= 1 || myself::OwnItemCount(attacker.master,FriendShip2) >= 1 || myself::OwnItemCount(attacker.master,FriendShip3) >= 1 || myself::OwnItemCount(attacker.master,FriendShip4) >= 1 || myself::OwnItemCount(attacker.master,FriendShip5) >= 1 )
			{
				if( myself::Skill_GetConsumeMP(DeBuff1) < myself.sm.mp && myself::Skill_GetConsumeHP(DeBuff1) < myself.sm.hp && myself::Skill_InReuseDelay(DeBuff1) == 0 )
				{
					myself::AddUseSkillDesire(attacker,DeBuff1,0,1,1000000);
				}
				myself::RemoveAttackDesire(attacker.id);
			}
			else
			{
				super;
			}
		}
		else
		{
			super;
		}
	}

	EventHandler CLAN_ATTACKED(attacker)
	{
		if( attacker.is_pc != 0 )
		{
			if( myself::OwnItemCount(attacker,FriendShip1) >= 1 || myself::OwnItemCount(attacker,FriendShip2) >= 1 || myself::OwnItemCount(attacker,FriendShip3) >= 1 || myself::OwnItemCount(attacker,FriendShip4) >= 1 || myself::OwnItemCount(attacker,FriendShip5) >= 1 )
			{
				if( myself::Skill_GetConsumeMP(DeBuff1) < myself.sm.mp && myself::Skill_GetConsumeHP(DeBuff1) < myself.sm.hp && myself::Skill_InReuseDelay(DeBuff1) == 0 )
				{
					myself::AddUseSkillDesire(attacker,DeBuff1,0,1,1000000);
				}
				myself::RemoveAttackDesire(attacker.id);
			}
			else
			{
				super;
			}
		}
		else if( myself::IsInCategory(11,attacker.npc_class_id) != 0 )
		{
			if( myself::OwnItemCount(attacker.master,FriendShip1) >= 1 || myself::OwnItemCount(attacker.master,FriendShip2) >= 1 || myself::OwnItemCount(attacker.master,FriendShip3) >= 1 || myself::OwnItemCount(attacker.master,FriendShip4) >= 1 || myself::OwnItemCount(attacker.master,FriendShip5) >= 1 )
			{
				if( myself::Skill_GetConsumeMP(DeBuff1) < myself.sm.mp && myself::Skill_GetConsumeHP(DeBuff1) < myself.sm.hp && myself::Skill_InReuseDelay(DeBuff1) == 0 )
				{
					myself::AddUseSkillDesire(attacker,DeBuff1,0,1,1000000);
				}
				myself::RemoveAttackDesire(attacker.id);
			}
			else
			{
				super;
			}
		}
		else
		{
			super;
		}
	}

	EventHandler SEE_SPELL(speller,skill_name_id,target,f0,i0)
	{
		if( myself::Skill_GetEffectPoint(skill_name_id) > 0 )
		{
			if( speller.is_pc != 0 )
			{
				if( myself::OwnItemCount(speller,FriendShip1) >= 1 || myself::OwnItemCount(speller,FriendShip2) >= 1 || myself::OwnItemCount(speller,FriendShip3) >= 1 || myself::OwnItemCount(speller,FriendShip4) >= 1 || myself::OwnItemCount(speller,FriendShip5) >= 1 )
				{
					if( myself::Skill_GetConsumeMP(DeBuff1) < myself.sm.mp && myself::Skill_GetConsumeHP(DeBuff1) < myself.sm.hp && myself::Skill_InReuseDelay(DeBuff1) == 0 )
					{
						myself::AddUseSkillDesire(speller,DeBuff1,0,1,1000000);
					}
					myself::RemoveAttackDesire(speller.id);
				}
				else
				{
					super;
				}
			}
			else if( myself::IsInCategory(11,speller.npc_class_id) != 0 )
			{
				if( myself::OwnItemCount(speller.master,FriendShip1) >= 1 || myself::OwnItemCount(speller.master,FriendShip2) >= 1 || myself::OwnItemCount(speller.master,FriendShip3) >= 1 || myself::OwnItemCount(speller.master,FriendShip4) >= 1 || myself::OwnItemCount(speller.master,FriendShip5) >= 1 )
				{
					if( myself::Skill_GetConsumeMP(DeBuff1) < myself.sm.mp && myself::Skill_GetConsumeHP(DeBuff1) < myself.sm.hp && myself::Skill_InReuseDelay(DeBuff1) == 0 )
					{
						myself::AddUseSkillDesire(speller,DeBuff1,0,1,1000000);
					}
					myself::RemoveAttackDesire(speller.id);
				}
				else
				{
					super;
				}
			}
			else
			{
				super;
			}
		}
	}

}
