@LabelIndex 48729
@StringIndex 0
class 0 wizard_healer : wizard_ddmagic2 {
parameter:
	int	Heal = 66519055;
	int	Buff = 263979009;
	int	DeBuff = 265748488;

handler:
	EventHandler CREATED() {
		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 = 0;
		myself.i_ai2 = 0;
	}

	EventHandler ATTACKED(attacker,i0) {
		i0 = gg::Rand(100);
		if( i0 < 33 && gg::FloatToInt(( ( myself.sm.hp / myself.sm.max_hp ) * 100 )) > 50 ) {
			if( myself.i_ai2 == 0 ) {
				myself::AddFleeDesireEx(attacker,500,1000000);
				if( myself::GetPathfindFailCount() > 3 && attacker == myself.top_desire_target && gg::FloatToInt(myself.sm.hp) != gg::FloatToInt(myself.sm.max_hp) ) {
					myself.i_ai2 = 1;
				}
			} else {
				super;
			}
		} else {
			super;
		}
	}

	EventHandler CLAN_ATTACKED(attacker,victim,i0) {
		i0 = gg::Rand(100);
		if( victim.hp > ( victim.max_hp / 2 ) ) {
			if( i0 < 33 ) {
				if( myself::Skill_GetConsumeMP(Buff) < myself.sm.mp && myself::Skill_GetConsumeHP(Buff) < myself.sm.hp && myself::Skill_InReuseDelay(Buff) == 0 ) {
					myself::AddUseSkillDesire(victim,Buff,1,1,1000000);
				}
				if( myself::Skill_GetConsumeMP(DeBuff) < myself.sm.mp && myself::Skill_GetConsumeHP(DeBuff) < myself.sm.hp && myself::Skill_InReuseDelay(DeBuff) == 0 ) {
					myself::AddUseSkillDesire(attacker,DeBuff,0,1,1000000);
				}
			}
		} else if( i0 < 50 ) {
			if( myself::Skill_GetConsumeMP(Heal) < myself.sm.mp && myself::Skill_GetConsumeHP(Heal) < myself.sm.hp && myself::Skill_InReuseDelay(Heal) == 0 ) {
				myself::AddUseSkillDesire(victim,Heal,1,1,1000000);
			}
		}
		super;
	}

	EventHandler CLAN_DIED(attacker) {
		myself::AddFleeDesireEx(attacker,500,1000000);
	}

}
