@LabelIndex 16500
@StringIndex 0
class 0 party_private_casting_enchant : party_private {
parameter:
	int	Buff = 263979009;

handler:
	EventHandler CREATED() {
		myself.i_ai0 = 0;
		myself.i_ai1 = 0;
		super;
	}

	EventHandler ATTACKED(attacker,damage) {
		if( attacker.is_pc != 0 || myself::IsInCategory(12,attacker.class_id) ) {
			if( myself.i_ai1 == 0 && gg::Rand(100) < 33 && gg::FloatToInt(( ( myself.sm.hp / myself.sm.max_hp ) * 100 )) > 50 ) {
				if( myself::Skill_GetConsumeMP(Buff) < myself.sm.mp && myself::Skill_GetConsumeHP(Buff) < myself.sm.hp && myself::Skill_InReuseDelay(Buff) == 0 ) {
					myself::AddUseSkillDesire(myself.sm,Buff,1,1,1000000);
				}
				myself.i_ai1 = 1;
			}
		}
		super;
	}

	EventHandler SCRIPT_EVENT(script_event_arg1,script_event_arg2) {
		if( script_event_arg1 == 11039 ) {
			myself::Despawn();
		}
	}

}
