class 1 raid_wizard : raid_private_standard
{
parameter:
	int	Debuff_a = -1;
	int	DDMagic_a = -1;

handler:
	EventHandler CREATED()
	{
		myself.c_ai0 = myself.sm;
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id)
	{
		if( timer_id == 1001 )
		{
			if( myself.c_ai0 != myself.sm && myself::DistFromMe(myself.c_ai0) < 200 )
			{
				myself::AddFleeDesire(myself.c_ai0,100000000);
			}
		}
		super;
	}

	EventHandler ATTACKED(attacker,damage)
	{
		myself.c_ai0 = attacker;
		if( myself.boss.alive == 0 )
		{
			if( ( attacker.is_pc != 0 || myself::IsInCategory(11,attacker.npc_class_id) ) && gg::Rand(( 2 * 15 )) < 1 )
			{
				myself::AddUseSkillDesire(attacker,DDMagic_a,0,1,1000000);
			}
			if( myself::GetAbnormalLevel(attacker,myself::Skill_GetAbnormalType(Debuff_a)) == -1 && gg::Rand(( 5 * 15 )) < 1 )
			{
				myself::AddUseSkillDesire(attacker,Debuff_a,0,1,1000000);
			}
		}
		if( myself.sm.in_peacezone != 0 )
		{
			myself::InstantTeleport(myself.sm,myself.start_x,myself.start_y,myself.start_z);
			myself::RemoveAllAttackDesire();
		}
	}

	EventHandler PARTY_ATTACKED(attacker,private,damage)
	{
		if( attacker.level >= ( myself.sm.level + 8 ) )
		{
			if( ( attacker.is_pc != 0 || myself::IsInCategory(11,attacker.npc_class_id) ) && gg::Rand(( ( 2 * 15 ) * 10 )) < 1 )
			{
				myself::AddUseSkillDesire(attacker,DDMagic_a,0,1,1000000);
			}
			if( myself::GetAbnormalLevel(attacker,myself::Skill_GetAbnormalType(Debuff_a)) == -1 && gg::Rand(( ( 5 * 15 ) * 10 )) < 1 )
			{
				myself::AddUseSkillDesire(attacker,Debuff_a,0,1,1000000);
			}
		}
		else if( ( attacker.is_pc != 0 || myself::IsInCategory(11,attacker.npc_class_id) ) && gg::Rand(( 2 * 15 )) < 1 )
		{
			myself::AddUseSkillDesire(attacker,DDMagic_a,0,1,1000000);
		}
		if( myself::GetAbnormalLevel(attacker,myself::Skill_GetAbnormalType(Debuff_a)) == -1 && gg::Rand(( 5 * 15 )) < 1 )
		{
			myself::AddUseSkillDesire(attacker,Debuff_a,0,1,1000000);
		}
		super;
	}

	EventHandler SEE_SPELL(speller,skill_name_id)
	{
		if( gg::Rand(( 2 * 15 )) < 1 )
		{
			myself::AddUseSkillDesire(speller,DDMagic_a,0,1,1000000);
		}
		if( myself::GetAbnormalLevel(speller,myself::Skill_GetAbnormalType(Debuff_a)) == -1 && gg::Rand(( 5 * 15 )) < 1 )
		{
			myself::AddUseSkillDesire(speller,Debuff_a,0,1,1000000);
		}
		super;
	}

}
