@LabelIndex 14066
@StringIndex 4088
class 0 warrior_run_away_clan_attacked : warrior {
parameter:

handler:
	EventHandler CLAN_ATTACKED(attacker,victim,damage,i6,i5,f0) {
		if( myself.p_state != 3 && myself.sm.hp > 0 ) {
			i5 = gg::Rand(100);
			if( i5 < 50 ) {
				myself::Say(gg::MakeFString(1000009,"","","","",""));
			} else if( i5 < 75 ) {
				myself::Say(gg::MakeFString(1000010,"","","","",""));
			} else {
				myself::Say(gg::MakeFString(1000011,"","","","",""));
			}
			myself::AddFleeDesire(attacker,30);
		} else if( attacker.is_pc != 0 || myself::IsInCategory(12,attacker.class_id) ) {
			f0 = 0;
			if( SetHateGroup >= 0 ) {
				if( myself::IsInCategory(SetHateGroup,attacker.occupation) ) {
					f0 = ( f0 + SetHateGroupRatio );
				}
			}
			if( attacker.occupation == SetHateOccupation ) {
				f0 = ( f0 + SetHateOccupationRatio );
			}
			if( SetHateRace == attacker.race ) {
				f0 = ( f0 + SetHateRaceRatio );
			}
			f0 = ( ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) ) );
			myself::AddAttackDesire(attacker,1,( f0 * 30 ));
		}
	}

}
