I am trying to create my own UnitAbility similar to how `ABILITY_TRADE_ROUTE_PLUNDER_IMMUNITY_SEA` or `ABILITY_ECONOMIC_GOLDEN_AGE_PLUNDER_IMMUNITY` works. Here's the code:
The database entries go in, but I cannot grant that ability to any unit, even with Firetuner (in the code, I use
a MODIFIER_PLAYER_UNITS_GRANT_ABILITY modifier).
After some investigation, I realize that certain ability can only be granted to certain unit, including in Firetuner. For example, Pikeman has their own `ABILITY_ANTI_CALVARY` and that ability cannot be added for any other unit class. It's the same for `ABILITY_TRADE_ROUTE_PLUNDER_IMMUNITY_SEA` or `ABILITY_ECONOMIC_GOLDEN_AGE_PLUNDER_IMMUNITY`.
It's interesting and I guess it's some kind of optimization, because the modifier for Golden Age simply grants ABILITY_ECONOMIC_GOLDEN_AGE_PLUNDER_IMMUNITY to every units (there is no condition), however checking in the Firetuner, only Traders get that ability.
However, I cannot find any reference in the database about which ability can go to which unit/unit classes. Can someone point it out to me? Thanks!
Code:
INSERT INTO UnitAbilities(UnitAbilityType, Name, Description, Inactive) VALUES
('ABILITY_TRADER_MERCENARIES_PLUNDER_IMMUNITY', 'LOC_ABILITY_TRADER_MERCENARIES_PLUNDER_IMMUNITY_NAME', 'LOC_ABILITY_TRADER_MERCENARIES_PLUNDER_IMMUNITY_DESC', 1);
INSERT INTO UnitAbilityModifiers(UnitAbilityType, ModifierId) VALUES
('ABILITY_TRADER_MERCENARIES_PLUNDER_IMMUNITY', 'TRADER_MERCENARIES_IMMUNITY_LAND'),
('ABILITY_TRADER_MERCENARIES_PLUNDER_IMMUNITY', 'TRADER_MERCENARIES_IMMUNITY_SEA');
The database entries go in, but I cannot grant that ability to any unit, even with Firetuner (in the code, I use
a MODIFIER_PLAYER_UNITS_GRANT_ABILITY modifier).
After some investigation, I realize that certain ability can only be granted to certain unit, including in Firetuner. For example, Pikeman has their own `ABILITY_ANTI_CALVARY` and that ability cannot be added for any other unit class. It's the same for `ABILITY_TRADE_ROUTE_PLUNDER_IMMUNITY_SEA` or `ABILITY_ECONOMIC_GOLDEN_AGE_PLUNDER_IMMUNITY`.
It's interesting and I guess it's some kind of optimization, because the modifier for Golden Age simply grants ABILITY_ECONOMIC_GOLDEN_AGE_PLUNDER_IMMUNITY to every units (there is no condition), however checking in the Firetuner, only Traders get that ability.
However, I cannot find any reference in the database about which ability can go to which unit/unit classes. Can someone point it out to me? Thanks!