@LabelIndex 113114
@StringIndex 13584
class 0 rim_basic : warrior_basic {
parameter:
	int	Type = 0;
	int	Buff = 284426241;
	int	Debuff = 374800385;
	string	MyMakerName = "rim25_trr_testm1";
	int	Max_Npc = 7;
	int	Max_Npc2 = 9;
	int	Point_Kill_Basic = 10;
	int	Point_Kill_Sp_A = 20;
	int	Point_Kill_Sp_B = 50;
	int	Point_UseSkill = 1;
	int	Point_UseSpell = 1;
	int	Point_ModHP = 4;
	int	Point_ModMP = 2;
	int	Point_LevDiff_PC = 3;
	int	Point_LevDiff_NonPC = 1;
	int	Point_WeaknessKill = 2;
	int	Point_MobUseSkill1 = 1;
	int	Point_MobUseSkill2 = 2;
	int	Point_ClanAggro = 2;
	int	Point_Buff = 2;
	int	PrivatesNorm = 1022452;
	int	PrivatesSpA = 1022453;
	int	PrivatesSpB = 1022454;
	string	Privates_AI = "rim_basic";
	int	Prob_Chain_N_A = 400;
	int	Prob_Chain_N_B = 200;
	int	Prob_Chain_A_A = 150;
	int	Prob_Chain_A_B = 300;
	int	Prob_Chain_B_B = 100;
	int	Prob_Chain_FastKill_NonMag = 50;
	int	Prob_Chain_FastKill_Magic = 200;
	int	DefaultCombatTime = 10;
	int	Penalty_CombatTimeLong = 15;
	int	Prob_Overheat = 100;
	int	AutoDispawnTime = 30;
	int	Prob_Susceptibilty_Norm = 10;
	int	Prob_Susceptibilty_P_skill = 50;
	int	Prob_Susceptibilty_Checktime = 10;
	int	TM_CombatTimeCheck = 78001;
	int	TM_AutoDispawnTimeCheck = 78002;
	int	TM_Prob_Susceptibilty = 78003;
	int	id_ab_hawk_eye = 0;
	int	id_abnormal_invincibility = 172;
	int	id_all_speed_down = 2;
	int	id_armor_fire = 7;
	int	id_armor_holy = 8;
	int	id_armor_unholy = 9;
	int	id_armor_water = 10;
	int	id_armor_wind = 11;
	int	id_attack_speed_up_bow = 12;
	int	id_attack_time_down = 13;
	int	id_avoid_skill = 166;
	int	id_avoid_up = 16;
	int	id_avoid_up_special = 17;
	int	id_berserker = 18;
	int	id_cancel_prob_down = 25;
	int	id_casting_time_down = 26;
	int	id_cheap_magic = 28;
	int	id_counter_skill = 165;
	int	id_cp_up = 167;
	int	id_critical_dmg_up = 30;
	int	id_critical_prob_up = 32;
	int	id_decrease_weight_penalty = 48;
	int	id_detect_weakness = 50;
	int	id_dmg_shield = 51;
	int	id_duelist_spirit = 55;
	int	id_elemental_armor = 246;
	int	id_focus_dagger = 59;
	int	id_force_meditation = 183;
	int	id_heal_effect_up = 61;
	int	id_heal_power_up = 198;
	int	id_hero_buff = 62;
	int	id_hero_debuff = 63;
	int	id_hit_up = 65;
	int	id_holy_attack = 66;
	int	id_hp_regen_up = 69;
	int	id_improve_crt_rate_dmg_up = 251;
	int	id_improve_hp_mp_up = 250;
	int	id_improve_ma_md_up = 249;
	int	id_improve_pa_pd_up = 248;
	int	id_improve_shield_rate_defence_up = 252;
	int	id_improve_speed_avoid_up = 253;
	int	id_improve_vampiric_haste = 262;
	int	id_instinct = 221;
	int	id_invincibility = 171;
	int	id_iron_shield = 188;
	int	id_kamael_special = 203;
	int	id_life_force_kamael = 236;
	int	id_life_force_orc = 70;
	int	id_life_force_others = 71;
	int	id_ma_up = 79;
	int	id_ma_up_special = 237;
	int	id_magic_critical_up = 72;
	int	id_majesty = 73;
	int	id_max_breath_up = 74;
	int	id_max_hp_up = 76;
	int	id_max_mp_up = 77;
	int	id_md_up = 82;
	int	id_md_up_attr = 83;
	int	id_might_mortal = 84;
	int	id_mirage = 184;
	int	id_mp_cost_down = 85;
	int	id_mp_regen_up = 88;
	int	id_multi_buff = 89;
	int	id_pa_pd_up = 93;
	int	id_pa_up = 94;
	int	id_pa_up_special = 96;
	int	id_pd_up = 98;
	int	id_pd_up_bow = 99;
	int	id_pd_up_special = 100;
	int	id_pinch = 101;
	int	id_polearm_attack = 103;
	int	id_possession = 104;
	int	id_preserve_abnormal = 105;
	int	id_public_slot = 106;
	int	id_recharge_up = 199;
	int	id_reduce_drop_penalty = 108;
	int	id_reflect_abnormal = 109;
	int	id_resist_bleeding = 110;
	int	id_resist_debuff_dispel = 111;
	int	id_resist_derangement = 112;
	int	id_resist_holy_unholy = 113;
	int	id_resist_poison = 114;
	int	id_resist_shock = 115;
	int	id_resist_spiritless = 116;
	int	id_resurrection_special = 164;
	int	id_reuse_delay_down = 117;
	int	id_root_magically = 120;
	int	id_root_physically = 119;
	int	id_seed_of_knight = 243;
	int	id_shield_defence_up = 121;
	int	id_shield_prob_up = 122;
	int	id_snipe = 127;
	int	id_speed_up = 147;
	int	id_speed_up_special = 148;
	int	id_stealth = 151;
	int	id_t_crt_dmg_down = 220;
	int	id_target_lock = 240;
	int	id_thrill_fight = 224;
	int	id_touch_of_life = 155;
	int	id_transfer_damage = 189;
	int	id_transform = 204;
	int	id_transform_scrifice = 259;
	int	id_vampiric_attack = 162;
	int	Log_normal_Kill = 1001;
	int	Log_spA_Kill = 1002;
	int	Log_spB_Kill = 1003;
	int	Log_pc_useSkill = 1004;
	int	Log_pc_useSpell = 1005;
	int	Log_pc_ModHpMp = 1006;
	int	Log_pc_LevDiff = 1009;
	int	Log_pc_Buff = 1010;
	int	Log_mob_useSkill1 = 1011;
	int	Log_mob_useSkill2 = 1012;
	int	Log_CombatTimeLong = 1016;
	int	Log_ClanAggro = 1017;
	int	babble_mode = 0;
	int	log_mode = 1;

handler:
	EventHandler CREATED(c0) {
		myself.i_ai0 = 0;
		if( Type == 1 ) {
			myself.i_ai0 = Point_Kill_Sp_A;
			myself::AddTimerEx(TM_AutoDispawnTimeCheck,( AutoDispawnTime * 1000 ));
		} else if( Type == 2 ) {
			myself.i_ai0 = Point_Kill_Sp_B;
			myself::AddTimerEx(TM_AutoDispawnTimeCheck,( ( AutoDispawnTime * 2 ) * 1000 ));
		} else {
			myself.i_ai0 = Point_Kill_Basic;
		}
		myself.i_ai1 = 0;
		myself.i_ai2 = 0;
		myself.i_ai3 = 0;
		myself.i_ai4 = 0;
		myself::AddTimerEx(TM_Prob_Susceptibilty,( Prob_Susceptibilty_Checktime * 1000 ));
		if( myself.sm.param1 == 1000 ) {
			c0 = gg::GetCreatureFromID(myself.sm.param2);
			if( myself::IsNullCreature(c0) == 0 ) {
				myself::AddHateInfo(c0,500,0,1,1);
				myself::AddAttackDesire(c0,1,1000);
			}
		}
		super;
	}

	EventHandler ATTACKED(attacker,skill_name_id,skill_id,damage,i0,f0,f1,f2,f3) {
		if( myself::IsNullCreature(attacker) == 0 ) {
			if( myself.i_ai1 <= 1 && attacker.is_pc == 1 ) {
				i0 = ( ( myself.sm.level - attacker.level ) * Point_LevDiff_PC );
				if( i0 != 0 ) {
					myself.i_ai0 = ( myself.i_ai0 + i0 );
					if( babble_mode == 1 ) {
						myself::Say("  : " + gg::IntToStr(i0));
					}
					if( log_mode == 1 ) {
						gg::AddLogEx(Log_pc_LevDiff,attacker,i0,0);
					}
				}
				f0 = attacker.hp;
				f1 = attacker.max_hp;
				f2 = attacker.mp;
				f3 = attacker.max_mp;
				myself.i_ai2 = gg::FloatToInt(f0);
				myself.i_ai3 = gg::FloatToInt(f2);
				if( myself::IsInCategory(3,attacker.occupation) != 1 || myself::IsInCategory(85,attacker.occupation) != 1 || myself::IsInCategory(92,attacker.occupation) != 1 || myself::IsInCategory(90,attacker.occupation) != 1 ) {
					i0 = 0;
					if( gg::GetAbnormalLevel(attacker,id_ab_hawk_eye) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_ab_hawk_eye) );
					}
					if( gg::GetAbnormalLevel(attacker,id_abnormal_invincibility) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_abnormal_invincibility) );
					}
					if( gg::GetAbnormalLevel(attacker,id_all_speed_down) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_all_speed_down) );
					}
					if( gg::GetAbnormalLevel(attacker,id_armor_fire) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_armor_fire) );
					}
					if( gg::GetAbnormalLevel(attacker,id_armor_holy) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_armor_holy) );
					}
					if( gg::GetAbnormalLevel(attacker,id_armor_unholy) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_armor_unholy) );
					}
					if( gg::GetAbnormalLevel(attacker,id_armor_water) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_armor_water) );
					}
					if( gg::GetAbnormalLevel(attacker,id_armor_wind) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_armor_wind) );
					}
					if( gg::GetAbnormalLevel(attacker,id_attack_speed_up_bow) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_attack_speed_up_bow) );
					}
					if( gg::GetAbnormalLevel(attacker,id_attack_time_down) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_attack_time_down) );
					}
					if( gg::GetAbnormalLevel(attacker,id_avoid_skill) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_avoid_skill) );
					}
					if( gg::GetAbnormalLevel(attacker,id_avoid_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_avoid_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_avoid_up_special) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_avoid_up_special) );
					}
					if( gg::GetAbnormalLevel(attacker,id_berserker) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_berserker) );
					}
					if( gg::GetAbnormalLevel(attacker,id_cancel_prob_down) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_cancel_prob_down) );
					}
					if( gg::GetAbnormalLevel(attacker,id_casting_time_down) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_casting_time_down) );
					}
					if( gg::GetAbnormalLevel(attacker,id_cheap_magic) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_cheap_magic) );
					}
					if( gg::GetAbnormalLevel(attacker,id_counter_skill) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_counter_skill) );
					}
					if( gg::GetAbnormalLevel(attacker,id_cp_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_cp_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_critical_dmg_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_critical_dmg_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_critical_prob_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_critical_prob_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_decrease_weight_penalty) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_decrease_weight_penalty) );
					}
					if( gg::GetAbnormalLevel(attacker,id_detect_weakness) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_detect_weakness) );
					}
					if( gg::GetAbnormalLevel(attacker,id_dmg_shield) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_dmg_shield) );
					}
					if( gg::GetAbnormalLevel(attacker,id_duelist_spirit) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_duelist_spirit) );
					}
					if( gg::GetAbnormalLevel(attacker,id_elemental_armor) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_elemental_armor) );
					}
					if( gg::GetAbnormalLevel(attacker,id_focus_dagger) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_focus_dagger) );
					}
					if( gg::GetAbnormalLevel(attacker,id_force_meditation) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_force_meditation) );
					}
					if( gg::GetAbnormalLevel(attacker,id_heal_effect_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_heal_effect_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_heal_power_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_heal_power_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_hero_buff) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_hero_buff) );
					}
					if( gg::GetAbnormalLevel(attacker,id_hero_debuff) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_hero_debuff) );
					}
					if( gg::GetAbnormalLevel(attacker,id_hit_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_hit_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_holy_attack) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_holy_attack) );
					}
					if( gg::GetAbnormalLevel(attacker,id_hp_regen_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_hp_regen_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_improve_crt_rate_dmg_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_improve_crt_rate_dmg_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_improve_hp_mp_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_improve_hp_mp_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_improve_ma_md_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_improve_ma_md_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_improve_pa_pd_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_improve_pa_pd_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_improve_shield_rate_defence_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_improve_shield_rate_defence_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_improve_speed_avoid_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_improve_speed_avoid_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_improve_vampiric_haste) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_improve_vampiric_haste) );
					}
					if( gg::GetAbnormalLevel(attacker,id_instinct) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_instinct) );
					}
					if( gg::GetAbnormalLevel(attacker,id_invincibility) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_invincibility) );
					}
					if( gg::GetAbnormalLevel(attacker,id_iron_shield) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_iron_shield) );
					}
					if( gg::GetAbnormalLevel(attacker,id_kamael_special) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_kamael_special) );
					}
					if( gg::GetAbnormalLevel(attacker,id_life_force_kamael) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_life_force_kamael) );
					}
					if( gg::GetAbnormalLevel(attacker,id_life_force_orc) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_life_force_orc) );
					}
					if( gg::GetAbnormalLevel(attacker,id_life_force_others) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_life_force_others) );
					}
					if( gg::GetAbnormalLevel(attacker,id_ma_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_ma_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_ma_up_special) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_ma_up_special) );
					}
					if( gg::GetAbnormalLevel(attacker,id_magic_critical_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_magic_critical_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_majesty) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_majesty) );
					}
					if( gg::GetAbnormalLevel(attacker,id_max_breath_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_max_breath_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_max_hp_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_max_hp_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_max_mp_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_max_mp_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_md_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_md_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_md_up_attr) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_md_up_attr) );
					}
					if( gg::GetAbnormalLevel(attacker,id_might_mortal) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_might_mortal) );
					}
					if( gg::GetAbnormalLevel(attacker,id_mirage) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_mirage) );
					}
					if( gg::GetAbnormalLevel(attacker,id_mp_cost_down) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_mp_cost_down) );
					}
					if( gg::GetAbnormalLevel(attacker,id_mp_regen_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_mp_regen_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_multi_buff) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_multi_buff) );
					}
					if( gg::GetAbnormalLevel(attacker,id_pa_pd_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_pa_pd_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_pa_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_pa_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_pa_up_special) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_pa_up_special) );
					}
					if( gg::GetAbnormalLevel(attacker,id_pd_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_pd_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_pd_up_bow) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_pd_up_bow) );
					}
					if( gg::GetAbnormalLevel(attacker,id_pd_up_special) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_pd_up_special) );
					}
					if( gg::GetAbnormalLevel(attacker,id_pinch) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_pinch) );
					}
					if( gg::GetAbnormalLevel(attacker,id_polearm_attack) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_polearm_attack) );
					}
					if( gg::GetAbnormalLevel(attacker,id_possession) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_possession) );
					}
					if( gg::GetAbnormalLevel(attacker,id_preserve_abnormal) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_preserve_abnormal) );
					}
					if( gg::GetAbnormalLevel(attacker,id_public_slot) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_public_slot) );
					}
					if( gg::GetAbnormalLevel(attacker,id_recharge_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_recharge_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_reduce_drop_penalty) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_reduce_drop_penalty) );
					}
					if( gg::GetAbnormalLevel(attacker,id_reflect_abnormal) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_reflect_abnormal) );
					}
					if( gg::GetAbnormalLevel(attacker,id_resist_bleeding) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_resist_bleeding) );
					}
					if( gg::GetAbnormalLevel(attacker,id_resist_debuff_dispel) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_resist_debuff_dispel) );
					}
					if( gg::GetAbnormalLevel(attacker,id_resist_derangement) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_resist_derangement) );
					}
					if( gg::GetAbnormalLevel(attacker,id_resist_holy_unholy) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_resist_holy_unholy) );
					}
					if( gg::GetAbnormalLevel(attacker,id_resist_poison) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_resist_poison) );
					}
					if( gg::GetAbnormalLevel(attacker,id_resist_shock) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_resist_shock) );
					}
					if( gg::GetAbnormalLevel(attacker,id_resist_spiritless) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_resist_spiritless) );
					}
					if( gg::GetAbnormalLevel(attacker,id_resurrection_special) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_resurrection_special) );
					}
					if( gg::GetAbnormalLevel(attacker,id_reuse_delay_down) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_reuse_delay_down) );
					}
					if( gg::GetAbnormalLevel(attacker,id_root_magically) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_root_magically) );
					}
					if( gg::GetAbnormalLevel(attacker,id_root_physically) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_root_physically) );
					}
					if( gg::GetAbnormalLevel(attacker,id_seed_of_knight) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_seed_of_knight) );
					}
					if( gg::GetAbnormalLevel(attacker,id_shield_defence_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_shield_defence_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_shield_prob_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_shield_prob_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_snipe) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_snipe) );
					}
					if( gg::GetAbnormalLevel(attacker,id_speed_up) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_speed_up) );
					}
					if( gg::GetAbnormalLevel(attacker,id_speed_up_special) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_speed_up_special) );
					}
					if( gg::GetAbnormalLevel(attacker,id_stealth) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_stealth) );
					}
					if( gg::GetAbnormalLevel(attacker,id_t_crt_dmg_down) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_t_crt_dmg_down) );
					}
					if( gg::GetAbnormalLevel(attacker,id_target_lock) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_target_lock) );
					}
					if( gg::GetAbnormalLevel(attacker,id_thrill_fight) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_thrill_fight) );
					}
					if( gg::GetAbnormalLevel(attacker,id_touch_of_life) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_touch_of_life) );
					}
					if( gg::GetAbnormalLevel(attacker,id_transfer_damage) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_transfer_damage) );
					}
					if( gg::GetAbnormalLevel(attacker,id_transform) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_transform) );
					}
					if( gg::GetAbnormalLevel(attacker,id_transform_scrifice) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_transform_scrifice) );
					}
					if( gg::GetAbnormalLevel(attacker,id_vampiric_attack) > 0 ) {
						i0 = ( i0 + gg::GetAbnormalLevel(attacker,id_vampiric_attack) );
					}
					if( i0 > 0 ) {
						if( babble_mode == 1 ) {
							myself::Say(":" + gg::IntToStr(( ( i0 / 10 ) * Point_Buff )));
						}
						myself.i_ai0 = ( myself.i_ai0 - gg::FloatToInt(( ( i0 / 10 ) * Point_Buff )) );
						if( log_mode == 1 ) {
							gg::AddLogEx(Log_pc_Buff,attacker,gg::FloatToInt(( ( i0 / 10 ) * Point_Buff )),0);
						}
					}
				}
				if( myself.i_ai1 < 1 ) {
					if( babble_mode == 1 ) {
						myself::Say("PC   ˆ ");
					}
					myself::AddTimerEx(TM_CombatTimeCheck,( DefaultCombatTime * 1000 ));
				}
				if( myself.i_ai1 < 2 ) {
					myself.i_ai1 = 2;
				}
			}
			if( ( damage >= ( myself.sm.max_hp * 0.660000 ) && myself.i_ai4 >= 0 && ( myself::Maker_GetNpcCount() < Max_Npc || ( ( PrivatesSpB == 1022481 || PrivatesSpB == 1022484 ) && myself::Maker_GetNpcCount() < Max_Npc2 ) ) ) && myself::InMyTerritory(myself::Maker_GetNpcCount() < Max_Npc2) == 1 ) {
				if( babble_mode == 1 ) {
					myself::Say("1  ");
				}
				if( gg::Skill_IsMagic(skill_name_id) == 0 ) {
					myself.i_ai4 = Prob_Chain_FastKill_Magic;
				} else {
					myself.i_ai4 = Prob_Chain_FastKill_NonMag;
				}
				if( babble_mode == 1 ) {
					myself::Say(" " + gg::IntToStr(( myself.i_ai4 / 10 )) + "%");
				}
				if( ( ( Type == 2 && gg::Rand(1000) < ( Prob_Chain_B_B + myself.i_ai4 ) ) || ( Type == 1 && gg::Rand(1000) < ( Prob_Chain_A_B + myself.i_ai4 ) ) ) || ( Type == 0 && gg::Rand(1000) < ( Prob_Chain_N_B + myself.i_ai4 ) ) ) {
					if( babble_mode == 1 ) {
						myself::Say("1 :B ");
					}
					myself::CreateOnePrivateEx(PrivatesSpB,Privates_AI,0,0,gg::FloatToInt(myself.sm.x),gg::FloatToInt(myself.sm.y),gg::FloatToInt(myself.sm.z),0,1000,attacker.id,0);
					myself.i_ai4 = -1;
				} else if( ( Type == 1 && gg::Rand(1000) < ( Prob_Chain_A_A + myself.i_ai4 ) ) || ( Type == 0 && gg::Rand(1000) < ( Prob_Chain_N_A + myself.i_ai4 ) ) ) {
					if( babble_mode == 1 ) {
						myself::Say("1 :A ");
					}
					myself::CreateOnePrivateEx(PrivatesSpA,Privates_AI,0,0,gg::FloatToInt(myself.sm.x),gg::FloatToInt(myself.sm.y),gg::FloatToInt(myself.sm.z),0,1000,attacker.id,0);
					myself.i_ai4 = -2;
				} else if( babble_mode == 1 ) {
					myself::Say("1 : ");
				}
				myself.i_ai4 = -99;
			}
			if( attacker.is_pc == 0 && ( myself::IsInCategory(35,attacker.class_id) == 1 || myself::IsInCategory(12,attacker.class_id) == 1 ) ) {
				i0 = gg::FloatToInt(( ( ( ( myself.sm.level - attacker.level ) + 3 ) * Point_LevDiff_NonPC ) / 2 ));
				if( i0 < 0 ) {
					myself.i_ai0 = ( myself.i_ai0 + i0 );
					if( babble_mode == 1 ) {
						myself::Say("/  : " + gg::IntToStr(i0));
					}
					if( log_mode == 1 ) {
						gg::AddLogEx(Log_pc_LevDiff,attacker,i0,0);
					}
				}
				if( myself.i_ai1 <= 0 ) {
					if( babble_mode == 1 ) {
						myself::Say("/   ˆ ");
					}
					myself::AddTimerEx(TM_CombatTimeCheck,( DefaultCombatTime * 1000 ));
					myself.i_ai1 = 1;
				}
			}
			if( skill_name_id > 0 ) {
				if( babble_mode == 1 ) {
					myself::Say(" ");
				}
				if( myself::Skill_GetEffectPoint(skill_name_id) < 0 && gg::FloatToInt(( myself::Skill_GetEffectPoint(skill_name_id) / 100 )) != 0 && ( myself::Skill_GetConsumeMP(skill_name_id) > 0 || myself::Skill_GetConsumeHP(skill_name_id) > 0 ) ) {
					if( gg::Skill_IsMagic(skill_name_id) == 0 ) {
						if( skill_id == 503 || skill_id == 368 ) {
							i0 = gg::FloatToInt(( ( myself::Skill_GetEffectPoint(skill_name_id) / 1000 ) * Point_UseSkill ));
						} else {
							i0 = gg::FloatToInt(( ( myself::Skill_GetEffectPoint(skill_name_id) / 100 ) * Point_UseSkill ));
						}
						if( babble_mode == 1 ) {
							myself::Say("    :  +" + gg::IntToStr(i0));
						}
						myself.i_ai0 = ( myself.i_ai0 - i0 );
						if( log_mode == 1 ) {
							gg::AddLogEx(Log_pc_useSkill,attacker,i0,0);
						}
						if( gg::Rand(100) <= Prob_Susceptibilty_P_skill && gg::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(Debuff)) <= 0 ) {
							if( babble_mode == 1 ) {
								myself::Say("    " + gg::IntToStr(gg::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(Debuff))));
							}
							myself::AddUseSkillDesire(myself.sm,Debuff,0,1,100000000);
						}
					} else {
						i0 = gg::FloatToInt(( ( myself::Skill_GetEffectPoint(skill_name_id) / 100 ) * Point_UseSpell ));
						if( babble_mode == 1 ) {
							myself::Say("    :  +" + gg::IntToStr(i0));
						}
						myself.i_ai0 = ( myself.i_ai0 - i0 );
						if( log_mode == 1 ) {
							gg::AddLogEx(Log_pc_useSpell,attacker,i0,0);
						}
					}
				}
			}
		} else if( babble_mode == 1 ) {
			myself::Say(" ");
		}
		if( Type == 2 && myself.sm.hp <= ( myself.sm.max_hp * 0.300000 ) && gg::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(Buff)) <= 0 ) {
			if( babble_mode == 1 ) {
				myself::Say(" ");
			}
			myself::AddUseSkillDesire(myself.sm,Buff,0,1,10000000);
		}
		if( myself.sm.hp <= ( myself.sm.max_hp * 0.050000 ) && gg::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(Debuff)) > 0 ) {
			myself.i_ai0 = ( myself.i_ai0 + Point_WeaknessKill );
			if( babble_mode == 1 ) {
				myself::Say("   ");
			}
		} else if( babble_mode == 1 ) {
			myself::Say("   ");
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id,i0) {
		if( timer_id == TM_CombatTimeCheck && myself.sm.hp > 0 && myself.i_ai0 > 0 ) {
			i0 = ( ( myself.i_ai0 * Penalty_CombatTimeLong ) / 100 );
			myself.i_ai0 = ( myself.i_ai0 - i0 );
			if( babble_mode == 1 ) {
				myself::Say(" ˆˆ: " + gg::IntToStr(i0));
			}
			if( log_mode == 1 ) {
				gg::AddLogExWithoutCreature(Log_CombatTimeLong,i0,0);
			}
			myself::AddTimerEx(TM_CombatTimeCheck,( DefaultCombatTime * 1000 ));
		} else if( timer_id == TM_AutoDispawnTimeCheck && myself.sm.hp > 0 ) {
			if( babble_mode == 1 ) {
				myself::Say("NPC  ˆ");
			}
			myself::Despawn();
		} else if( timer_id == TM_Prob_Susceptibilty ) {
			if( gg::Rand(100) <= Prob_Susceptibilty_Norm && gg::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(Debuff)) <= 0 ) {
				if( babble_mode == 1 ) {
					myself::Say("   " + gg::IntToStr(gg::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(Debuff))));
				}
				myself::AddUseSkillDesire(myself.sm,Debuff,0,1,100000000);
			}
			myself::AddTimerEx(TM_Prob_Susceptibilty,( Prob_Susceptibilty_Checktime * 1000 ));
		}
		super;
	}

	EventHandler SEE_SPELL(speller,skill_name_id,target,f0,i0) {
		if( target == speller && myself::Skill_GetEffectPoint(skill_name_id) > 0 && gg::FloatToInt(( myself::Skill_GetEffectPoint(skill_name_id) / 100 )) != 0 ) {
			if( gg::Skill_IsMagic(skill_name_id) != 0 ) {
				i0 = gg::FloatToInt(( ( myself::Skill_GetEffectPoint(skill_name_id) / 100 ) * Point_UseSkill ));
				if( babble_mode == 1 ) {
					myself::Say("PC    :  +" + gg::IntToStr(i0));
				}
				myself.i_ai0 = ( myself.i_ai0 + i0 );
				if( log_mode == 1 ) {
					gg::AddLogEx(Log_pc_useSkill,speller,i0,0);
				}
			} else {
				i0 = gg::FloatToInt(( ( myself::Skill_GetEffectPoint(skill_name_id) / 100 ) * Point_UseSpell ));
				if( babble_mode == 1 ) {
					myself::Say("PC    :  +" + gg::IntToStr(i0));
				}
				myself.i_ai0 = ( myself.i_ai0 + i0 );
				if( log_mode == 1 ) {
					gg::AddLogEx(Log_pc_useSpell,speller,i0,0);
				}
			}
		}
		super;
	}

	EventHandler USE_SKILL_FINISHED(target,skill_name_id,success) {
		if( success == 1 ) {
			if( skill_name_id == Buff ) {
				myself.i_ai0 = ( myself.i_ai0 - Point_MobUseSkill2 );
				if( babble_mode == 1 ) {
					myself::Say("   :  " + gg::IntToStr(Point_MobUseSkill2));
					myself::Say(" :" + gg::IntToStr(myself::Skill_GetAbnormalType(Buff)));
				}
				if( log_mode == 1 ) {
					gg::AddLogEx(Log_mob_useSkill2,target,Point_MobUseSkill2,0);
				}
			} else if( skill_name_id == Debuff ) {
				if( babble_mode == 1 ) {
					myself::Say(" :  " + gg::IntToStr(gg::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(Debuff))));
				}
			} else {
				myself.i_ai0 = ( myself.i_ai0 - Point_MobUseSkill1 );
				if( babble_mode == 1 ) {
					myself::Say("   :  " + gg::IntToStr(Point_MobUseSkill1));
				}
				if( log_mode == 1 ) {
					gg::AddLogEx(Log_mob_useSkill1,target,Point_MobUseSkill1,0);
				}
			}
		}
		super;
	}

	EventHandler CLAN_ATTACKED(attacker,victim,damage,skill_name_id) {
		if( myself.i_ai1 == 0 ) {
			if( babble_mode == 1 ) {
				myself::Say(" :  " + gg::IntToStr(Point_ClanAggro));
			}
			myself.i_ai0 = ( myself.i_ai0 - Point_ClanAggro );
			myself.i_ai1 = 1;
			if( log_mode == 1 ) {
				gg::AddLogEx(Log_ClanAggro,attacker,Point_ClanAggro,0);
			}
		}
		if( Type == 2 && victim.hp <= ( victim.max_hp * 0.300000 ) && gg::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(Buff)) <= 0 ) {
			if( babble_mode == 1 ) {
				myself::Say(" ");
			}
			myself::AddUseSkillDesire(myself.sm,Buff,1,1,10000000);
		}
		super;
	}

	EventHandler MY_DYING(last_attacker,maker0,i0,i1,f0,f1,f2,f3) {
		if( myself::IsNullCreature(last_attacker) == 0 ) {
			if( myself.i_ai4 >= 0 && myself::InMyTerritory(myself.sm) == 1 ) {
				if( myself::GetOverhitBonus(myself.sm) > 1 ) {
					f0 = myself::GetOverhitBonus(myself.sm);
					if( babble_mode == 1 ) {
						myself::Say(":" + gg::IntToStr(gg::FloatToInt(f0)));
					}
					if( myself::GetOverhitBonus(myself.sm) >= 1.300000 ) {
						if( babble_mode == 1 ) {
							myself::Say(":   + 40%");
						}
						myself.i_ai4 = ( myself.i_ai4 + ( Prob_Overheat * 4 ) );
					} else if( myself::GetOverhitBonus(myself.sm) >= 1.200000 ) {
						if( babble_mode == 1 ) {
							myself::Say(":   + 30%");
						}
						myself.i_ai4 = ( myself.i_ai4 + ( Prob_Overheat * 3 ) );
					} else if( babble_mode == 1 ) {
						myself::Say(":   + 20%");
					}
					myself.i_ai4 = ( myself.i_ai4 + ( Prob_Overheat * 2 ) );
				}
				if( myself::Maker_GetNpcCount() < Max_Npc || ( ( PrivatesSpB == 1022481 || PrivatesSpB == 1022484 ) && myself::Maker_GetNpcCount() < Max_Npc2 ) ) {
					if( babble_mode == 1 ) {
						myself::Say(" " + gg::IntToStr(( myself.i_ai4 / 10 )) + "%");
					}
					if( ( ( Type == 2 && gg::Rand(1000) < ( Prob_Chain_B_B + myself.i_ai4 ) ) || ( Type == 1 && gg::Rand(1000) < ( Prob_Chain_A_B + myself.i_ai4 ) ) ) || ( Type == 0 && gg::Rand(1000) < ( Prob_Chain_N_B + myself.i_ai4 ) ) ) {
						if( babble_mode == 1 ) {
							myself::Say(":B ");
						}
						myself::CreateOnePrivateEx(PrivatesSpB,Privates_AI,0,0,gg::FloatToInt(myself.sm.x),gg::FloatToInt(myself.sm.y),gg::FloatToInt(myself.sm.z),0,1000,last_attacker.id,0);
						myself.i_ai4 = -1;
					} else if( ( Type == 1 && gg::Rand(1000) < ( Prob_Chain_A_A + myself.i_ai4 ) ) || ( Type == 0 && gg::Rand(1000) < ( Prob_Chain_N_A + myself.i_ai4 ) ) ) {
						if( babble_mode == 1 ) {
							myself::Say(":A ");
						}
						myself::CreateOnePrivateEx(PrivatesSpA,Privates_AI,0,0,gg::FloatToInt(myself.sm.x),gg::FloatToInt(myself.sm.y),gg::FloatToInt(myself.sm.z),0,1000,last_attacker.id,0);
						myself.i_ai4 = -2;
					} else if( babble_mode == 1 ) {
						myself::Say(": ");
					}
					myself.i_ai4 = -99;
				}
			}
			if( babble_mode == 1 ) {
				myself::Say("  :" + gg::IntToStr(myself.i_ai0));
			}
			if( myself.i_ai2 != 0 && myself.i_ai3 != 0 && last_attacker.is_pc == 1 ) {
				f0 = last_attacker.hp;
				f1 = last_attacker.max_hp;
				f2 = last_attacker.mp;
				f3 = last_attacker.max_mp;
				if( babble_mode == 1 ) {
					myself::Say("HP: " + gg::IntToStr(gg::FloatToInt(( ( ( f0 - myself.i_ai2 ) / f1 ) * 10 ))) + "0%");
					myself::Say("MP: " + gg::IntToStr(gg::FloatToInt(( ( ( f2 - myself.i_ai3 ) / f3 ) * 10 ))) + "0%");
				}
				i0 = ( Point_ModHP * gg::FloatToInt(( ( ( f0 - myself.i_ai2 ) / f1 ) * 10 )) );
				i0 = ( i0 + ( Point_ModMP * gg::FloatToInt(( ( ( f2 - myself.i_ai3 ) / f3 ) * 10 )) ) );
				myself.i_ai0 = ( myself.i_ai0 + i0 );
				if( babble_mode == 1 ) {
					myself::Say("HP :" + gg::IntToStr(i0));
				}
				if( log_mode == 1 ) {
					gg::AddLogEx(Log_pc_ModHpMp,last_attacker,i0,0);
				}
			} else if( babble_mode == 1 ) {
				myself::Say("HP :    !");
			}
			if( Type == 1 && myself.i_ai0 > ( Point_Kill_Sp_A * 3 ) ) {
				if( babble_mode == 1 ) {
					myself::Say("  ");
				}
				myself.i_ai0 = ( Point_Kill_Sp_A * 3 );
			} else if( Type == 2 && myself.i_ai0 > ( Point_Kill_Sp_B * 3 ) ) {
				if( babble_mode == 1 ) {
					myself::Say("  ");
				}
				myself.i_ai0 = ( Point_Kill_Sp_B * 3 );
			} else if( Type == 0 && myself.i_ai0 > ( Point_Kill_Basic * 3 ) ) {
				if( babble_mode == 1 ) {
					myself::Say("  ");
				}
				myself.i_ai0 = ( Point_Kill_Basic * 3 );
			}
			i1 = myself::InstantZone_GetId();
			maker0 = gg::InstantZone_GetNpcMaker(i1,MyMakerName);
			if( gg::IsNull(maker0) == 0 ) {
				if( myself.i_ai4 < 0 && myself.i_ai4 != -99 ) {
					if( babble_mode == 1 ) {
						myself::Say(" ˆ");
					}
					gg::SendMakerScriptEvent(maker0,78010046,myself.i_ai4,0);
				} else if( babble_mode == 1 ) {
					myself::Say("  ");
				}
				gg::SendMakerScriptEvent(maker0,78010046,0,0);
				if( babble_mode == 1 ) {
					gg::ShowOnScreenMsgStr(last_attacker,3,0,0,0,1,0,3000,0," :" + gg::IntToStr(myself.i_ai0));
				}
				if( log_mode == 1 ) {
					if( Type == 1 ) {
						gg::AddLogEx(Log_spA_Kill,last_attacker,Point_Kill_Sp_A,0);
					} else if( Type == 2 ) {
						gg::AddLogEx(Log_spB_Kill,last_attacker,Point_Kill_Sp_B,0);
					} else {
						gg::AddLogEx(Log_normal_Kill,last_attacker,Point_Kill_Basic,0);
					}
				}
				gg::SendMakerScriptEvent(maker0,78010044,myself.i_ai0,0);
			} else if( babble_mode == 1 ) {
				myself::Say(" ");
			}
		} else if( babble_mode == 1 ) {
			myself::Say(" ");
		}
	}

	EventHandler SCRIPT_EVENT(script_event_arg1,script_event_arg2,script_event_arg3) {
		if( script_event_arg1 == 1000 ) {
			if( babble_mode == 1 ) {
				myself::Say("  ");
			}
			myself::Despawn();
		}
	}

	EventHandler NO_DESIRE() {
		myself::AddMoveAroundDesire(500,500);
	}

}
