class 1 summon_magicalattack : petfix
{
parameter:
	int	DDMagic = 1024257;

handler:
	EventHandler CREATED()
	{
		myself::AddPetDefaultDesire_Follow(20.000000);
		super;
	}

	EventHandler NO_DESIRE()
	{
		myself::AddPetDefaultDesire_Follow(20.000000);
	}

	EventHandler MENU_SELECTED(ask,reply,i0,c0)
	{
		i0 = myself.master.target_index;
		if( i0 <= 0 )
		{
			return;
		}
		c0 = myself::GetCreatureFromIndex(i0);
		if( c0 )
		{
			if( myself::Skill_GetConsumeMP(DDMagic) < myself.sm.mp && myself::Skill_GetConsumeHP(DDMagic) < myself.sm.hp && myself::Skill_InReuseDelay(DDMagic) == 0 )
			{
				myself::AddUseSkillDesireEx(myself.master.target_id,DDMagic,0,reply,ask,1000000,0);
			}
		}
	}

}
