@LabelIndex 103504
@StringIndex 12068
class 0 ai_amazkari : wizard_basic {
parameter:
	int	FieldCycle = 1;
	int	FieldCycle_Condition = 0;
	int	FieldCycle_Quantity = 50;
	int	Threshold_Level_Min = 10;
	int	Threshold_Level_Max = 100;
	int	BUFF01_ID = 303562753;
	int	BUFF02_ID = 303562754;
	int	BUFF03_ID = 303562755;
	int	INVIN01_ID = 355008513;

handler:
	EventHandler CREATED() {
		myself.i_ai0 = 0;
		myself.i_ai1 = 1;
		myself.i_ai2 = 0;
		myself.c_ai0 = gg::GetNullCreature();
		super;
	}

	EventHandler PARTY_DIED(private) {
		if( private != myself.sm ) {
			myself::Say(gg::MakeFString(1800124,"","","","",""));
			if( gg::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(BUFF01_ID)) >= 3 && myself.i_ai1 == 1 ) {
				myself::Say(gg::MakeFString(1800127,"","","","",""));
				myself.i_ai1 = 0;
				myself::RemoveAllDesire();
				myself::AddUseSkillDesire(myself.sm,INVIN01_ID,1,1,10000000000);
				myself::AddTimerEx(78001,( 10 * 1000 ));
			} else if( gg::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(BUFF01_ID)) == 2 ) {
				myself::RemoveAllDesire();
				myself::AddUseSkillDesire(myself.sm,BUFF03_ID,1,1,10000000000);
			} else if( gg::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(BUFF01_ID)) == 1 ) {
				myself::RemoveAllDesire();
				myself::AddUseSkillDesire(myself.sm,BUFF02_ID,1,1,10000000000);
			} else if( gg::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(BUFF01_ID)) <= 0 ) {
				myself::RemoveAllDesire();
				myself::AddUseSkillDesire(myself.sm,BUFF01_ID,1,1,10000000000);
			} else {
				gg::SetNpcParam(myself.sm,9,( myself.sm.hp + ( myself.sm.hp / 5 ) ));
			}
		}
	}

	EventHandler TIMER_FIRED_EX(timer_id,c0) {
		if( timer_id == 78001 ) {
			if( myself.i_ai1 == 0 ) {
				myself::Say(gg::MakeFString(1800125,"","","","",""));
				myself.i_ai1 = 1;
				myself::RemoveAllDesire();
				myself::AddUseSkillDesire(myself.sm,INVIN01_ID,1,1,10000000000);
			}
		} else if( timer_id == 78002 ) {
			c0 = myself.c_ai0;
			if( myself::IsNullCreature(c0) == 0 ) {
				myself::InstantTeleport(myself.sm,gg::FloatToInt(c0.x),gg::FloatToInt(c0.y),gg::FloatToInt(c0.z));
				myself::Say(gg::MakeFString(1000152,"","","","",""));
			}
		}
		super;
	}

	EventHandler ATTACKED(attacker) {
		if( gg::Rand(1000) < 25 ) {
			myself::Say(gg::MakeFString(1000105,"","","","",""));
			myself::BroadcastScriptEventEx(78010028,gg::GetIndexFromCreature(attacker),gg::GetIndexFromCreature(attacker),600);
		}
		super;
	}

	EventHandler SCRIPT_EVENT(script_event_arg1,script_event_arg2,c0) {
		if( script_event_arg1 == 78010001 ) {
			myself.c_ai0 = gg::GetCreatureFromIndex(script_event_arg2);
			myself::AddTimerEx(78002,( 25 * 1000 ));
		}
		super;
	}

	EventHandler MY_DYING(attacker) {
		if( myself::IsNullCreature(attacker) == 0 ) {
			myself::BroadcastScriptEventEx(78010029,gg::GetIndexFromCreature(attacker),gg::GetIndexFromCreature(attacker),1500);
		}
		super;
	}

}
