class 1 pet_wizard_use_2skill : default_npc
{
parameter:
	int	DDMagic = 1024257;
	int	Heal = 1031169;

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

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

	EventHandler MENU_SELECTED(talker,ask,reply,action_id,i0,c0,so0)
	{
		switch(action_id)
		{
			case 1005:
			{
				if( myself.sm.level < 70 )
				{
					i0 = ( myself.sm.level / 10 );
					if( i0 < 0 )
					{
						i0 = 1;
					}
				}
				else
				{
					i0 = ( 7 + ( ( myself.sm.level - 70 ) / 5 ) );
				}
				if( i0 > 12 )
				{
					i0 = 12;
				}
				i0 = ( i0 + DDMagic );
				if( myself::Skill_GetConsumeMP(i0) < myself.sm.mp && myself::Skill_GetConsumeHP(i0) < myself.sm.hp && myself::Skill_InReuseDelay(i0) == 0 )
				{
					myself::RemoveAllAttackDesire();
					myself::AddUseSkillDesireEx(myself.master.target_id,i0,0,reply,ask,1000000,0);
					myself::AddAttackDesireEx(myself.master.target_id,1,0,50000);
				}
				break;
			}
			case 1006:
			{
				if( myself.sm.level < 70 )
				{
					i0 = ( myself.sm.level / 10 );
					if( i0 < 0 )
					{
						i0 = 1;
					}
				}
				else
				{
					i0 = ( 7 + ( ( myself.sm.level - 70 ) / 5 ) );
				}
				if( i0 > 12 )
				{
					i0 = 12;
				}
				i0 = ( i0 + Heal );
				if( myself::Skill_GetConsumeMP(i0) < myself.sm.mp && myself::Skill_GetConsumeHP(i0) < myself.sm.hp && myself::Skill_InReuseDelay(i0) == 0 )
				{
					myself::AddUseSkillDesireEx(myself.sm.id,i0,0,reply,ask,1000000,0);
				}
				break;
			}
		}
	}

	EventHandler USE_SKILL_FINISHED(target,skill_name_id,i0,reply,ask)
	{
		if( myself.sm.level < 70 )
		{
			i0 = ( myself.sm.level / 10 );
			if( i0 < 0 )
			{
				i0 = 1;
			}
		}
		else
		{
			i0 = ( 7 + ( ( myself.sm.level - 70 ) / 5 ) );
		}
		if( i0 > 12 )
		{
			i0 = 12;
		}
		i0 = ( i0 + Heal );
		if( skill_name_id == i0 )
		{
			if( myself::Skill_GetConsumeMP(i0) < myself.sm.mp && myself::Skill_GetConsumeHP(i0) < myself.sm.hp && myself::Skill_InReuseDelay(i0) == 0 )
			{
				myself::RemoveAllAttackDesire();
				myself::AddUseSkillDesireEx(myself.master.target_id,i0,0,reply,ask,1000000,0);
				myself::AddAttackDesireEx(myself.master.target_id,1,0,50000);
			}
		}
	}

}
