[Vanilla] Make Units 25% cheaper to purchase as a trait?

fb2017

Chieftain
Joined
Oct 8, 2017
Messages
53
How can I make units 25% cheaper to purchase. I want it to cost the normal production quantity, but not the gold quantity. Any tips?
 
Saladin's Righteousness of Faith comes to mind.

Code:
<TraitModifiers>
   <Row TraitType="TRAIT_LEADER_RIGHTEOUSNESS_OF_FAITH" ModifierId="TRAIT_RELIGIOUS_BUILDING_DISCOUNT"/>
</TraitModifiers>

<Modifiers>
       <Row>
           <ModifierId>TRAIT_RELIGIOUS_BUILDING_DISCOUNT</ModifierId>
           <ModifierType>MODIFIER_PLAYER_ADJUST_RELIGION_BUILDING_DISCOUNT</ModifierType>
       </Row>
</Modifiers>

<ModifierArguments>
       <Row>
           <ModifierId>TRAIT_RELIGIOUS_BUILDING_DISCOUNT</ModifierId>
           <Name>Discount</Name>
           <Value>90</Value>
       </Row>
</ModifierArguments>

Maybe adapt that using the land/sea domain sets.
 
Saladin's Righteousness of Faith comes to mind.

Code:
<TraitModifiers>
   <Row TraitType="TRAIT_LEADER_RIGHTEOUSNESS_OF_FAITH" ModifierId="TRAIT_RELIGIOUS_BUILDING_DISCOUNT"/>
</TraitModifiers>

<Modifiers>
       <Row>
           <ModifierId>TRAIT_RELIGIOUS_BUILDING_DISCOUNT</ModifierId>
           <ModifierType>MODIFIER_PLAYER_ADJUST_RELIGION_BUILDING_DISCOUNT</ModifierType>
       </Row>
</Modifiers>

<ModifierArguments>
       <Row>
           <ModifierId>TRAIT_RELIGIOUS_BUILDING_DISCOUNT</ModifierId>
           <Name>Discount</Name>
           <Value>90</Value>
       </Row>
</ModifierArguments>

Maybe adapt that using the land/sea domain sets.
I'm not quite sure what you mean with land/sea domain sets. I can't make an effect for the modifier, so I don't know how to change faith to gold and building to unit.
 
Have you tried? Did this in about 10 minutes.
iwz3HHc.png

Notice the production cost is still 40, but the gold cost is 120 since its ( 40 * 4 * 0.75 ). So... yeah. Can be done.
 
So I did the above post for only the warrior as a proof of concept. But since you wanted to make everything all combat units cheaper I simply added it to an inner table. And bam...
66Z2WtO.png


Of course this is just my interpretation as what you mean by "Units", since I presume you mean all combat units. Initially I did use domains to pick out the units, but I found formations better since it distinguishes between combat and civilian... anyway... Here is the code I used to do it. You can edit the SELECT * FROM Unit WHERE ... bit to narrow down exactly which units should be cheaper (Currently its set to non-unique, gold purchasable only, combat units)

Code:
INSERT INTO   Types
       (Type,                                           Kind           )
VALUES   ('TRAIT_CIVILIZATION_TEST1',           'KIND_TRAIT'   );

INSERT INTO   Traits
       (TraitType,                               Name,                                           Description                                           )
VALUES   ('TRAIT_CIVILIZATION_TEST1',   'Making units cheaper',   'Makes all unit purchasing 25% Cheaper.'   );

INSERT INTO   CivilizationTraits
       (CivilizationType,               TraitType)
VALUES   ('CIVILIZATION_THELUNARARMYS_CIV',   'TRAIT_CIVILIZATION_TEST1');


INSERT INTO Modifiers
       (ModifierId, ModifierType)
SELECT 'TRAIT_CHEAPER_' || UnitType, 'MODIFIER_PLAYER_CITIES_ADJUST_UNIT_PURCHASE_COST'
FROM (SELECT * FROM Units WHERE (FormationClass LIKE "%_COMBAT") AND (TraitType IS NULL) AND (PurchaseYield LIKE "%_GOLD"));

INSERT INTO TraitModifiers
    (TraitType, ModifierId)
SELECT 'TRAIT_CIVILIZATION_TEST1','TRAIT_CHEAPER_' || UnitType
FROM (SELECT * FROM Units WHERE (FormationClass LIKE "%_COMBAT") AND (TraitType IS NULL) AND (PurchaseYield LIKE "%_GOLD"));

INSERT INTO ModifierArguments
       (ModifierId, Name, Type, Value)
SELECT   'TRAIT_CHEAPER_' || UnitType, 'UnitType', 'ARGTYPE_IDENTITY', UnitType
FROM (SELECT * FROM Units WHERE (FormationClass LIKE "%_COMBAT") AND (TraitType IS NULL) AND (PurchaseYield LIKE "%_GOLD"));

INSERT INTO ModifierArguments
       (ModifierId, Name, Type, Value)
SELECT   'TRAIT_CHEAPER_' || UnitType, 'Amount', 'ARGTYPE_IDENTITY', '25'
FROM (SELECT * FROM Units WHERE (FormationClass LIKE "%_COMBAT") AND (TraitType IS NULL) AND (PurchaseYield LIKE "%_GOLD"));

(and yes I should be using a temp sub table, but im lazy)
 
Back
Top Bottom