@LabelIndex 109546
@StringIndex 0
class 0 fortress_ballista : citizen {
parameter:
	int	FameValue = 500;
	int	Armor = 40;
	int	Bomb = 196609;
	int	pledge_lv_req = 5;

handler:
	EventHandler CREATED() {
		myself.c_ai0 = gg::GetNullCreature();
	}

	EventHandler ATTACKED(attacker,damage,skill_name_id) {
		if( skill_name_id == Bomb && gg::Rand(100) < ( 100 - Armor ) ) {
			myself.c_ai0 = attacker;
			myself::Suicide();
		}
	}

	EventHandler MY_DYING() {
		if( myself::IsNullCreature(myself.c_ai0) == 1 ) {
			return;
		}
		if( myself::Fortress_GetPledgeSiegeState(myself.c_ai0) != 2 || ( myself::IsNullCreature(myself.c_ai0.master) == 0 && myself::Fortress_GetPledgeSiegeState(myself.c_ai0.master) != 2 ) ) {
			if( myself::GetPledgeSkillLevel(myself.c_ai0) < pledge_lv_req ) {
				return;
			}
			myself::UpdatePledgeNameValue(myself.c_ai0,FameValue);
			myself::ShowSystemMessage(myself.c_ai0,2217);
		}
	}

}
