@LabelIndex 103565
@StringIndex 12126
class 0 ai_sinmaster : warrior_basic {
parameter:
	int	mode = 0;
	int	time_interval = 3600;
	int	Skill01_Probablity = 0;
	int	Skill02_Probablity = 0;

handler:
	EventHandler CREATED() {
		myself.i_ai0 = 7;
		myself.i_ai1 = 1;
		myself.i_ai2 = 1;
		myself::AddTimerEx(78001,( time_interval * 1000 ));
		super;
	}

	EventHandler SCRIPT_EVENT(script_event_arg1,script_event_arg2,i0,c0) {
		if( script_event_arg1 == 78010006 ) {
			myself.i_ai1 = 0;
		} else if( script_event_arg1 == 78010007 ) {
			myself.i_ai2 = 0;
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id) {
		if( timer_id == 78001 ) {
			if( myself.i_ai1 != 1 ) {
				myself.i_ai1 = 1;
			}
			if( myself.i_ai2 != 1 ) {
				myself.i_ai2 = 1;
			}
			myself::AddTimerEx(78001,( time_interval * 1000 ));
		}
		super;
	}

	EventHandler PARTY_ATTACKED(attacker,i0) {
		if( mode == 0 ) {
			i0 = gg::Rand(15000);
		} else {
			i0 = gg::Rand(10000);
		}
		if( i0 <= 150 ) {
			if( myself.i_ai2 != 1 && i0 <= 50 ) {
				myself::AddUseSkillDesire(attacker,Skill02_ID,0,1,( myself.i_ai0 * 1000000 ));
			} else if( myself.i_ai1 != 1 ) {
				myself::AddUseSkillDesire(attacker,Skill01_ID,0,1,( myself.i_ai0 * 1000000 ));
			}
		}
		super;
	}

	EventHandler PARTY_DIED(private) {
		if( private != myself.sm ) {
			myself.i_ai0 = ( myself.i_ai0 - 1 );
			if( myself.i_ai0 <= 2 ) {
				myself::Say(gg::MakeFString(1800112,"","","","",""));
				myself::Despawn();
			}
		}
	}

}
