@LabelIndex 102246
@StringIndex 11836
class 0 raid_duke_devil : warrior_basic {
parameter:
	int	Buff = 458752001;
	int	silhouette = 1025541;
	string	ai_type = "duke_devil_s_explosion";

handler:
	EventHandler CREATED(maker0) {
		myself.i_ai3 = 0;
		myself.i_ai2 = 0;
		myself::EffectMusic(myself.sm,8000,"Rm01_A");
		myself::RegisterGlobalMap(14,myself.sm.id);
		myself::SetDBValue(myself.sm,0);
		myself::AddTimerEx(9990,( 60 * 1000 ));
		maker0 = gg::GetNpcMaker("gludio57_1926_011m1");
		if( gg::IsNull(maker0) == 0 ) {
			gg::SendMakerScriptEvent(maker0,1000,0,0);
		}
		super;
	}

	EventHandler ATTACKED(attacker) {
		myself.i_ai2 = myself::GetCurrentTick();
		if( myself.sm.db_value == 0 || myself.sm.db_value == 1 ) {
			myself::SetDBValue(myself.sm,2);
		}
		if( myself.sm.hp < ( myself.sm.max_hp * 0.500000 ) && myself.i_ai3 == 0 ) {
			myself::AddUseSkillDesire(myself.sm,Skill03_ID,1,0,1000000);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) + 200 ),gg::FloatToInt(myself.sm.y),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) - 200 ),gg::FloatToInt(myself.sm.y),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) - 100 ),( gg::FloatToInt(myself.sm.y) - 140 ),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) - 100 ),( gg::FloatToInt(myself.sm.y) + 140 ),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) + 100 ),( gg::FloatToInt(myself.sm.y) - 140 ),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) + 100 ),( gg::FloatToInt(myself.sm.y) + 140 ),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself.i_ai3 = 1;
		} else if( myself.sm.hp < ( myself.sm.max_hp * 0.100000 ) && myself.i_ai3 == 1 ) {
			myself::AddUseSkillDesire(myself.sm,Skill03_ID,1,0,1000000);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) + 200 ),gg::FloatToInt(myself.sm.y),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) - 200 ),gg::FloatToInt(myself.sm.y),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) - 100 ),( gg::FloatToInt(myself.sm.y) - 140 ),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) - 100 ),( gg::FloatToInt(myself.sm.y) + 140 ),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) + 100 ),( gg::FloatToInt(myself.sm.y) - 140 ),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) + 100 ),( gg::FloatToInt(myself.sm.y) + 140 ),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself.i_ai3 = 2;
		}
		if( gg::Rand(10000) < 10 ) {
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) + 200 ),gg::FloatToInt(myself.sm.y),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) - 200 ),gg::FloatToInt(myself.sm.y),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) - 100 ),( gg::FloatToInt(myself.sm.y) - 140 ),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) - 100 ),( gg::FloatToInt(myself.sm.y) + 140 ),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) + 100 ),( gg::FloatToInt(myself.sm.y) - 140 ),gg::FloatToInt(myself.sm.z),0,0,0,0);
			myself::CreateOnePrivateEx(silhouette,ai_type,0,0,( gg::FloatToInt(myself.sm.x) + 100 ),( gg::FloatToInt(myself.sm.y) + 140 ),gg::FloatToInt(myself.sm.z),0,0,0,0);
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id) {
		if( timer_id == 9990 ) {
			if( myself::GetCurrentTick() > ( ( 5 * 60 ) + myself.i_ai2 ) ) {
				myself::InstantTeleportInMyTerritory(-22204,277056,-9903,50);
				myself::SetDBValue(myself.sm,0);
			}
			myself::AddTimerEx(9990,( 60 * 1000 ));
		}
		super;
	}

	EventHandler MY_DYING(maker0) {
		myself::SetDBValue(myself.sm,0);
		myself::RegisterGlobalMap(14,-1);
		maker0 = gg::GetNpcMaker("gludio57_1926_011m1");
		if( gg::IsNull(maker0) == 0 ) {
			gg::SendMakerScriptEvent(maker0,1001,0,0);
		}
		super;
	}

	EventHandler SCRIPT_EVENT(script_event_arg1,script_event_arg2,script_event_arg3) {
		if( script_event_arg1 == 192834489 ) {
			if( myself.sm.db_value == 0 ) {
				myself.i_ai2 = myself::GetCurrentTick();
				myself::SetDBValue(myself.sm,1);
			}
		}
		super;
	}

}
