@LabelIndex 64064
@StringIndex 9978
class 0 ai_agit03_giselle : default_npc {
parameter:
	int	DDMagic = 458752001;
	int	SelfRangeBuff_a = 458752001;
	string	AreaName1 = "ai_agit03_giselle_area_1";
	string	AreaName2 = "ai_agit03_giselle_area_2";

handler:
	EventHandler CREATED() {
		myself::Shout(gg::MakeFString(1010637,"","","","",""));
		myself::AddTimerEx(1003,1000);
		super;
	}

	EventHandler NO_DESIRE() {
		myself::AddDoNothingDesire(5,5);
	}

	EventHandler TIMER_FIRED_EX(timer_id) {
		if( timer_id == 1003 ) {
			if( myself::Skill_GetConsumeMP(SelfRangeBuff_a) < myself.sm.mp && myself::Skill_GetConsumeHP(SelfRangeBuff_a) < myself.sm.hp && myself::Skill_InReuseDelay(SelfRangeBuff_a) == 0 ) {
				myself::AddUseSkillDesire(myself.sm,SelfRangeBuff_a,1,1,1000000);
			}
			myself::AddTimerEx(1003,300000);
		}
		super;
	}

	EventHandler ATTACKED(attacker,private,damage) {
		if( attacker.is_pc != 0 || myself::IsInCategory(12,attacker.class_id) ) {
			myself::AddAttackDesire(attacker,1,( ( ( damage / myself.sm.max_hp ) / 0.050000 ) * 1000 ));
		}
		if( myself::DistFromMe(attacker) > 300 && gg::Rand(( 25 * 30 )) < 1 ) {
			if( myself::Skill_GetConsumeMP(DDMagic) < myself.sm.mp && myself::Skill_GetConsumeHP(DDMagic) < myself.sm.hp && myself::Skill_InReuseDelay(DDMagic) == 0 ) {
				myself::AddUseSkillDesire(attacker,DDMagic,0,1,1000000);
			}
		}
	}

	EventHandler MY_DYING() {
		myself::Shout(gg::MakeFString(1010625,"","","","",""));
		gg::Area_SetOnOff(AreaName1,0);
		gg::Area_SetOnOff(AreaName2,0);
	}

}
