How to change unit strength vs cities via modifiers or lua?

luei333

Warlord
Joined
May 25, 2014
Messages
185
Pretty simple idea, but I don't know if it can be done, or at least easily. I'd like to decrease or increase unit strength vs cities and district defenses via a modifier (ie, as a leader trait), or via lua if that's not possible.

The only thing I've found that changes strength vs cities is a unit's Bombard value, like the siege units have. however, I can't seem to find any modifiers or effects that can change that value, and even having a negative Bombard value doesn't seem to impact the unit's strength vs cities.

Perhaps there's a requirement that the enemy is a city, but I haven't found anything like that in my search yet. If it is possible via lua, please do let me know, as I haven't taken the dive into learning the new lua structure and functions, etc.
 
Check out the UnitPromotions.xml for the promotion's that grant that ability. As far as I know you would use PLAYER_UNITS_GRANT _ABILITY or something. Also check UnitAbilities.xml for preslav suzerain bonus (Balkan calvary) and Leaders.xml for preslav ability to see about how to use grant ability. Also Teddy's leader trait of +5 combat on home continent would be achieved the exact same way.
 
Oh man, I didn't think there were promotions for extra strength vs cities, but then I guess I just never build a navy, because there are 2 promotions in the naval ranged tree that have that exact effect. And one in the Siege promotions that I just missed for some reason. The requirement type, for reference, is REQUIREMENT_PLOT_DISTRICT_IS_DEFENDED. I'm dumb!
 
the requirementid for the bonus against units in districts is DEFENDER_IS_OCCUPYING_DISTRICT_REQUIREMENT. You could try the requirementid (not requirementsetid) OPPONENT_PLOT_IS_CITY_CENTER_REQUIREMENT. Obviously your modifiertype is MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH
 
the requirementid for the bonus against units in districts is DEFENDER_IS_OCCUPYING_DISTRICT_REQUIREMENT. You could try the requirementid (not requirementsetid) OPPONENT_PLOT_IS_CITY_CENTER_REQUIREMENT. Obviously your modifiertype is MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH

Well, the Requirement Set for Bombardment's (naval ranged) modifier is BOMBARDMENT_REQUIREMENTS, and Rolling Barrage's (naval ranged also) requirement set is ROLLING_BARRAGE_REQUIREMENTS, which both test for both the PLAYER_IS_ATTACKER_REQUIREMENTS and PLOT_DISTRICT_IS_DEFENDED_REQUIREMENTS (type: REQUIREMENT_PLOT_DISTRICT_IS_DEFENDED) requirements; Shells' (siege) requirement set is SHELLS_REQUIREMENTS, which tests for OPPONENT_IS_DISTRICT (type: REQUIREMENT_OPPONENT_IS_DISTRICT). All promotions have the same wording for their effects, but it looks like Bombardment and Rolling Barrage might only hit outer defenses, while Shells hits both inner and outer defenses? Not sure, warrants some testing, really.
 
Back
Top Bottom