@LabelIndex 26161
@StringIndex 0
class 0 raid_wizard : raid_private_standard {
parameter:
	int	Debuff_a = 458752001;
	int	DDMagic_a = 458752001;

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

	EventHandler TIMER_FIRED_EX(timer_id) {
		if( timer_id == 1001 ) {
			if( myself::IsNullCreature(myself.c_ai0) == 0 && 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::IsMyBossAlive() == 0 ) {
			if( ( attacker.is_pc != 0 || myself::IsInCategory(12,attacker.class_id) ) && gg::Rand(( 2 * 15 )) < 1 ) {
				myself::AddUseSkillDesire(attacker,DDMagic_a,0,1,1000000);
			}
			if( gg::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(12,attacker.class_id) ) && gg::Rand(( ( 2 * 15 ) * 10 )) < 1 ) {
				myself::AddUseSkillDesire(attacker,DDMagic_a,0,1,1000000);
			}
			if( gg::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(12,attacker.class_id) ) && gg::Rand(( 2 * 15 )) < 1 ) {
			myself::AddUseSkillDesire(attacker,DDMagic_a,0,1,1000000);
		}
		if( gg::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( gg::GetAbnormalLevel(speller,myself::Skill_GetAbnormalType(Debuff_a)) == -1 && gg::Rand(( 5 * 15 )) < 1 ) {
			myself::AddUseSkillDesire(speller,Debuff_a,0,1,1000000);
		}
		super;
	}

}
