class 1 summon_magicalattack2 : petfix
{
parameter:
	int	RangeDD = 1024257;
	int	RangeDebuff = 1024257;
	int	DeBuff = 1033473;

handler:
	EventHandler CREATED()
	{
		myself::AddPetDefaultDesire_Follow(20.000000);
		myself::AddTimerEx(2001,60000);
		myself::Summon_SetOption(0,900);
		myself::AddUseSkillDesireEx(myself.master.id,DeBuff,0,1,1,1000000,1073741824);
		super;
	}

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

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

	EventHandler TIMER_FIRED_EX(timer_id)
	{
		if( timer_id == 2001 )
		{
			myself::AddTimerEx(2001,60000);
			myself::AddUseSkillDesireEx(myself.master.id,DeBuff,0,1,1,1000000,1073741824);
		}
	}

}
