<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 3/24/2016 10:05:41 PM -->
<!-- CP EVENT SYSTEM -->
<GameData>
<!--
MODDERS: READ CAREFULLY!
There are four major tables here, and then sub-tables below that:
1.) Events - this is the main table for Player-level events.
This handles the prerequsities and limiters of all events you create.
2.) EventChoices - this is the main table for Player-level event choices.
All choices must have a parent event, and all choices alter player-level things only.
3.) CityEvents - this is the main table for City-level events.
This handles the prerequisites and limites of all city events you create.
4.) CityEventChoices - this is the main table for City-level event choices.
All choices must have a parent city event, and all choices alter city-level things only.
Rules:
1.) Do NOT mix Player and City level events in the XML. They don't interact. The exception to this rule is with linked events, which are discussed in (9) below.
2.) Make sure that every event choice has a parent event.
3.) All event choices have a 'duration' - this is required to create cooldowns between the same event firing a second+ time.
If you want the effects of an event to wear off after the event's duration, set 'Expires' to true.
4.) The only choice elements that can expire are as follows:
Player-level:
Promotions
BuildingClasses
Policies
Resources
Happiness
City Yield Changes
BuildingClass Yield Changes
City-level:
BuildingClasses
Happiness
City Yield Changes
BuildingClass Yield Changes
5.) If you are creating a multi-choice event, make sure that all Events and Event Choices have both Help and Description elements set.
6.) If you are creating a single-choice (i.e. a pure event), you only need to set Help and Description for the Choice (not the base Event).
7.) Make sure to set the NumChoices element for each event - 1 for single-choice events, 2+ for multi-choice events.
8.) Player and City level events can interact, though only through a 'chaining' system using the EventLinkertables below.
If you assign a City Event, for example, a linker value, the event will only fire if the player has had the player level event (i.e. the event's duration cooldown is still active).
Using this, you can chain events and event choices off of each other, though (for the sake of performance) you can only assign one of each of these values to each event/choice.
There are also options for 'no' event (i.e. two events can't be active at the same time) and 'otherplayer' (i.e. an event can only fire if another player has an event/choice active).
9.) Events and choices can be given the 'one-shot' status, meaning that, once the event/choice has fired or is taken by the player/city, it will never happen again for the player or that city.
Duration can still be used to affect expiration of effects, but the event will never happen again (or the choice will never appear in a choice list again).
-->
<!-- Note on Era and Gamespeed Scaling:
Era scaling of values works off of the following function:
Value x Era # = Scaled value.
Ancient = 0 (raised to 1 a minimum), Classical = 1, Medieval = 2, Reniassance = 3, Industrial = 4, Modern = 5, Atomic = 6, Information = 7
Example: 10 gold scaled in Medieval = 30 gold.
Gamespeed uses a set value in the GameSpeeds table. Normally they are as follows:
Epic = 2x
Marathon = 3x
Example: 10 Gold on Standard = 30 Gold on Marathon
CRITICAL: Notification and Event Choice Help text are capable of scaling along with the game's era and speed automatically, if you use the following variables:
Player Choice Help Text:
{1_YieldCost}
{2_InstantYield}
{3_CityYieldGlobal}
{4_Turns}
City Choice Help Text:
{1_YieldCost}
{2_InstantYield}
{3_CityYield}
{4_GPChange}
{5_Turns}
{6_SpyEventDuration} USE ONLY IF AN ESPIONAGE EVENT!
{7_PlayerEventEffect}
EventChoiceNotifications (see two tables below) also have access to this:
Player Choices:
{4_EventChoiceScalingHelper}
City Choices:
{5_EventChoiceScalingHelper}
These Notification Helpers grab the following scaling core information about the event:
Player:
Event Cost
Event Instant Yield
City Yield Change
Event Duration
Cities:
Event Cost
Event Instant Yield
City Yield Change
GPP Change
Event Duration
These elements are grabbed because they scale with era or gamespeed, and are thus variable.
ALL Help files are funneled through this, and Yields that can scale will be handled as they are above.
See the text files for my events to give you an idea of how this works!
!!!! NOTE: You can ignore all of this and write them manually, but using the variables above scales costs/yields/durations. !!!!
-->
<!-- LUA Support -->
<!-- Events System -->
<!-- Note: the following two game events fire when an event starts. -->
<!-- GameEvents.EventActivated(iPlayer, iEvent)-->
<!-- GameEvents.CityEventActivated(iPlayer, iCityID, iEvent)-->
<!-- Note: the following two game events fire when an event choice starts. -->
<!-- GameEvents.EventChoiceActivated(iPlayer, iChoice)-->
<!-- GameEvents.CityEventChoiceActivated(iPlayer, iCityID, iChoice)-->
<!-- Note: the following two game events fire when an event choice's duration value ends. -->
<!-- GameEvents.EventChoiceEnded(iPlayer, iChoice)-->
<!-- GameEvents.CityEventChoiceEnded(iPlayer, iCityID, iChoice)-->
<!-- Note: the following four game events need to return a bool of true/false - true will end the function, false will let it continue normally. -->
<!-- GameEvents.OverrideAIEvent(iPlayer, iEvent)-->
<!-- GameEvents.OverrideAICityEvent(iPlayer, iCityID, iEvent)-->
<!-- GameEvents.OverrideAIEventChoice(iPlayer, iChoice) -->
<!-- GameEvents.OverrideAICityEventChoice(iPlayer, iCityID, iChoice)-->
<!-- Note: the following two game events need to return a bool of true/false - false will count as a continue, true will let it continue normally. -->
<!-- GameEvents.EventCanTake(iPlayer, iEvent)-->
<!-- GameEvents.CityEventCanTake(iPlayer, iCityID, iEvent)-->
<!-- GameEvents.EventChoiceCanTake(iPlayer, iChoice)-->
<!-- GameEvents.CityEventChoiceCanTake(iPlayer, iCityID, iChoice)-->
<!-- Note: the following lua hook fires if a unit is created via the (city)eventchoice_freeunits or (city)eventchoice_freeunitclasses player and city event tables -->
<!-- GameEvents.EventUnitCreated(iPlayer, iEventChoice, CvUnit* pUnit)-->
<!-- Lua Functions
PLAYER EVENTS:
Player:DoStartEvent(EventTypes eEvent);
Fires a specific event, ignoring requirements/filters.
Player:GetEventCooldown(EventTypes eEvent);
Gets the integer value of the cooldown for an event
Player:SetEventCooldown(EventTypes eEvent, int iNewCooldown);
Sets the integer value of the cooldown for an event
PLAYER CHOICES:
Player:IsEventChoiceActive(EventChoiceTypes eEventChoice);
Gets whether or not a player event choice's cooldown is active or if it is a one-shot that has fired.
Player:DoEventChoice(EventChoiceTypes eEventChoice);
Fires a specific event choice. Used by UI.
Player:DoCancelEventChoice(EventChoiceTypes eEventChoice);
Cancels a specific choice, ignoring requirements/filters.
Player:GetEventChoiceCooldown(EventChoiceTypes eEventChoice);
Gets the integer value of the cooldown for an event choice
Player:SetEventChoiceCooldown(EventChoiceTypes eEventChoice, int iNewCooldown);
Sets the integer value of the cooldown for an event choice
Player:IsEventChoiceValid(EventChoiceTypes eEventChoice);
Let's you check to see if an event choice is valid. Used by UI.
CITY EVENTS:
City:DoCityStartEvent(CityEventTypes eEvent);
Fires a specific event, ignoring requirements/filters
Player:GetCityEventCooldown(CityEventTypes eEvent);
Gets the integer value of the cooldown for a city event
Player:SetCityEventCooldown(CityEventTypes eEvent, int iNewCooldown);
Sets the integer value of the cooldown for a city event
CITY CHOICES:
City:IsCityEventChoiceActive(CityEventChoiceTypes eEventChoice);
Gets whether or not a city event choice's cooldown is active or if it is a one-shot that has fired.
City:DoCityEventChoice(CityEventChoiceTypes eEventChoice);
Fires a specific event choice. Used by UI.
City:DoCancelCityEventChoice(CityEventChoiceTypes eEventChoice);
Cancels a specific event choice, ignoring requirements/filters.
Player:GetCityEventChoiceCooldown(CityEventChoiceTypes eEventChoice);
Gets the integer value of the cooldown for a city event choice
Player:SetCityEventChoiceCooldown(CityEventChoiceTypes eEventChoice, int iNewCooldown);
Sets the integer value of the cooldown for a city event choice
City:IsCityEventChoiceValid(CityEventChoiceTypes eEventChoice);
Let's you check to see if an event choice is valid. Used by UI.
-->
<Defines>
<!-- Minimum amount of time between any two events for Players/Cities. Scales with Gamespeed. Does not affect counters (i.e. cooldowns will still reduce),
but prevents events from firing during this time. If you set IgnoresGlobalCooldown true for an event, it will ignore this. -->
<Row Name="EVENT_MIN_DURATION_BETWEEN">
<Value>10</Value>
</Row>
<Row Name="CITY_EVENT_MIN_DURATION_BETWEEN">
<Value>25</Value>
</Row>
</Defines>
<!-- Table definitions -->
<!--== PLAYER LEVEL EVENTS == -->
<Table name="Events">
<Column name="ID" type="integer" primarykey="true" autoincrement="true"/>
<Column name="Type" type="text" notnull="true" unique="true"/>
<!-- Event Class - You don't have to set this, however you can use the follow categories to give players the options to enable/disable certain types of Events:
EVENT_CLASS_GOOD
EVENT_CLASS_BAD
EVENT_CLASS_NEUTRAL
EVENT_CLASS_TRADE
EVENT_CLASS_CIV_SPECIFIC
-->
<Column name="EventClass" type="text" reference="EventClassTypes(Type)" default="NULL"/>
<Column name="Description" type="text" reference="Language_en_US(Tag)"/>
<Column name="Help" type="text" reference="Language_en_US(Tag)"/>
<Column name="EventArt" type="text"/>
<Column name="EventAudio" type="text"/>
<!-- 0 = always fires, -1 = diabled, 1-100 = % chance of success. -->
<Column name="RandomChance" type="integer" default="0"/>
<!-- If an event fails its randomchance roll, this value is added to the next random chance roll. Happens every time it fails (until it succeeds, at which point it is reset) -->
<Column name="RandomChanceDelta" type="integer" default="0"/>
<!-- If set to true, this event can only fire once, ever, for the player -->
<Column name="IsOneShot" type="boolean" default="false"/>
<!-- This value determines whether or not an event, once fired for one player, immediately fires for all players. -->
<Column name="Global" type="boolean" default="false"/>
<!-- Era Scaling: boosts yield required for minimumstartyield table below. -->
<Column name="EraScaling" type="boolean" default="false"/>
<!-- Event Cooldown: sets distance in time between this event and next event of this type. Defaults to 30 turns. Means that the minimum time between any two events of this type is 30 turns. -->
<Column name="EventCooldown" type="integer" default="30"/>
<!-- Set NumChoices to 2+ if you are adding more than one choice to the event!! -->
<Column name="NumChoices" type="integer" default="1"/>
<!-- Allows the event to ignore the global cooldown defined above. Use sparingly! -->
<Column name="IgnoresGlobalCooldown" type="boolean" default="false"/>
<!-- Filters
Determine whether or not an Event can occur for the player.
-->
<Column name="MinimumNationalPopulation" type="integer" default="0"/>
<Column name="MinimumNumberCities" type="integer" default="0"/>
<Column name="RequiredCiv" type="text" reference="Civilizations(Type)" default="NULL"/>
<Column name="RequiredEra" type="text" reference="Eras(Type)" default="NULL"/>
<Column name="HasMetAMajorCiv" type="boolean" default="false"/>
<!-- Looks for negative gold or negative GPT, respectively. -->
<Column name="InDebt" type="boolean" default="false"/>
<Column name="LosingMoney" type="boolean" default="false"/>
<!-- Require x number of coastal cities to be available as a choice. -->
<Column name="MinimumNumCoastalCities" type="integer" default="0"/>
<!-- Only valid if you are under your trade route cap -->
<Column name="LessThanMaximumTradeRoutes" type="boolean" default="false"/>
<!-- Checks if empire is unhappy -->
<Column name="IsUnhappy" type="boolean" default="false"/>
<Column name="IsSuperUnhappy" type="boolean" default="false"/>
<!-- Note: obsoletes at this era, not after it -->
<Column name="ObsoleteEra" type="text" reference="Eras(Type)" default="NULL"/>
<Column name="ImprovementAnywhereRequired" type="text" reference="Improvements(Type)" default="NULL"/>
<Column name="RequiredPolicy" type="text" reference="Policies(Type)" default="NULL"/>
<Column name="RequiredIdeology" type="text" reference="PolicyBranchTypes(Type)" default="NULL"/>
<Column name="UnitClassRequired" type="text" reference="UnitClasses(Type)" default="NULL"/>
<Column name="PrereqTech" type="text" reference="Technologies(Type)" default="NULL"/>
<Column name="ObsoleteTech" type="text" reference="Technologies(Type)" default="NULL"/>
<!-- Checks to see if player's current religion is a Pantheon -->
<Column name="RequiresPantheon" type="boolean" default="false"/>
<!-- Checks for Official or Majority Religion of player -->
<Column name="RequiredReligion" type="text" reference="Religions(Type)" default="NULL"/>
<!-- JFD check - looks at player's state religion -->
<Column name="RequiredStateReligion" type="text" reference="Religions(Type)" default="NULL"/>
<Column name="RequiresAnyStateReligion" type="boolean" default="false"/>
<!-- Other -->
<Column name="RequiredAnywhereBuildingClass" type="text" reference="BuildingClasses(Type)" default="NULL"/>
<Column name="RequiredNowhereBuildingClass" type="text" reference="BuildingClasses(Type)" default="NULL"/>
<Column name="RequiresHolyCity" type="boolean" default="false"/>
<Column name="RequiresIdeology" type="boolean" default="false"/>
<Column name="RequiresWar" type="boolean" default="false"/>
<Column name="RequiresWarMinor" type="boolean" default="false"/>
<!-- C4DF Only -->
<Column name="IsVassalOfSomeone" type="boolean" default="false"/>
<Column name="IsMasterOfSomeone" type="boolean" default="false"/>
</Table>
<!-- Filters: -->
<!-- Note: this only checks national yields (Faith, Culture, Gold, Science, Golden Age Points). -->
<Table name="Event_MinimumStartYield">
<Column name="EventType" type="text" reference="Events(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="Yield" type="integer"/>
</Table>
<!-- Checks for ownership of resource type and number. Does not include trades. -->
<Table name="Event_MinimumResourceRequired">
<Column name="EventType" type="text" reference="Events(Type)"/>
<Column name="ResourceType" type="text" reference="Resources(Type)"/>
<Column name="Quantity" type="integer"/>
</Table>
<!-- Checks for number of cities with a nearby feature. Quantity = minimum number of cities required before event can fire. -->
<Table name="Event_MinimumFeatureRequired">
<Column name="EventType" type="text" reference="Events(Type)"/>
<Column name="FeatureType" type="text" reference="Features(Type)"/>
<Column name="Quantity" type="integer"/>
</Table>
<!-- This is the linker table for connecting events to one another. MAKE SURE THAT THIS TABLE APPEARS AFTER ALL EVENTS/CHOICES INCLUDED IN IT. You can have multiple of rows of these with the same event type to make specific events that need a specific setup to function (a la parent events above)-->
<Table name="Event_EventLinks">
<!-- This is the parent. This is the event/choice that will or will not fire based on your data below. -->
<Column name="EventType" type="text" reference="Events(Type)"/>
<!-- These four elements: set the event/event choice/city event/city event choice you want to link this event to.
You can add elements to each of these so that an event requires another event, event choice, city event, AND a city event choice if you want.
You'll notice one has the word 'linker' after it - this is to distinguish this event/choice from the event/choice defined above (i.e. the parent)
-->
<Column name="EventLinker" type="text" reference="Events(Type)"/>
<Column name="EventChoice" type="text" reference="EventChoices(Type)"/>
<Column name="CityEvent" type="text" reference="CityEvents(Type)"/>
<Column name="CityEventChoice" type="text" reference="CityEventChoices(Type)"/>
<!-- This makes the event link span all known players and all known player cities looking for the four elements above. Be sparing with this, can be expensive! -->
<Column name="CheckKnownPlayers" type="boolean" default="false"/>
<!-- Defaults to TRUE, meaning that any event/choice defined above must be active for the event to fire. Setting it to false makes it so that any event/choice defined above that is NOT active is the trigger.
Think of this as a boolean switch - if the state of the event(s) above are hoped to be inactive, make this false. If you want it active, leave it true.
-->
<Column name="CheckForActive" type="boolean" default="true"/>
</Table>
<!-- == PLAYER EVENT CHOICES == -->
<Table name="EventChoices">
<!-- You can make as many choices as you want - the window show expand (with a scroll bar) to acommodate them. But be reasonable! :) -->
<!-- Note - if NOT a multiple-choice event, only make one of these! -->
<Column name="ID" type="integer" primarykey="true" autoincrement="true"/>
<Column name="Type" type="text" notnull="true" unique="true"/>
<Column name="Description" type="text" reference="Language_en_US(Tag)"/>
<!-- Help is used for Tooltips, Description for button text -->
<Column name="Help" type="text" reference="Language_en_US(Tag)"/>
<!-- DisabledTooltip is used for Tooltips for choices that are not active but appear in choice list.
The DLL automatically explains to players WHY an event choice is unavailable, however you can use it you want to override the DLL. -->
<Column name="DisabledTooltip" type="text" reference="Language_en_US(Tag)"/>
<!-- Audio for when event window pops up. -->
<Column name="EventChoiceAudio" type="text" default="AS2D_EVENT_CHOICE"/>
<!-- If set to true, this event choice can only be chosen once, ever, by the player -->
<Column name="IsOneShot" type="boolean" default="false"/>
<!-- Defaults to 30. Set a different duration if the expiration timer matters. Otherwise, leave it at 30, as it is used by the Recent Events overview. -->
<Column name="EventDuration" type="integer" default="30"/>
<!-- Event Chance: Higher value = higher chance of success. Notification will spawn if an event fails. Default is always successful. -->
<Column name="EventChance" type="integer" default="0"/>
<!-- Era Scaling: boosts yield value on instant yield, GP Points, and yield costs tables (See below) based on Era. -->
<Column name="EraScaling" type="boolean" default="false"/>
<!-- Expires: set to true if you want policies/buildings/promotions/resources granted to disappear after the duration. -->
<Column name="Expires" type="boolean" default="false"/>
<!-- Variables
Attriutes granted by Event Choices. Unless noted, city-related choices affect all cities.
-->
<!-- EXCEPTION: Set this to true to make event choice elements that affect cities ONLY affect coastal cities. -->
<Column name="CoastalOnly" type="boolean" default="false"/>
<!-- EXCEPTION: Set this to true to make event choice elements that affect cities ONLY affect your Capital. -->
<Column name="CapitalEffectOnly" type="boolean" default="false"/>
<!-- ADDITION: Set this to true to make event_instantyield choice elements below that normally only affect your Capital affect ALL cities. -->
<Column name="YieldBonusAllCities" type="boolean" default="false"/>
<!-- Grants a Policy. -->
<Column name="EventPolicy" type="text" reference="Policies(Type)" default="NULL"/>
<!-- Grants a specified tech for free. -->
<Column name="EventTech" type="text" reference="Technologies(Type)" default="NULL"/>
<!-- Grants all owned units, and all units created while this is active a promotion. Only affects valid units. -->
<Column name="EventPromotion" type="text" reference="UnitPromotions(Type)" default="NULL"/>
<!-- Adds a building to all cities. -->
<Column name="EventBuildingClassGlobal" type="text" reference="BuildingClasses(Type)" default="NULL"/>
<Column name="EventFreePolicies" type="integer" default="0"/>
<Column name="EventFreeTechs" type="integer" default="0"/>
<Column name="FreeGreatPeople" type="integer" default="0"/>
<Column name="GoldenAgeTurns" type="integer" default="0"/>
<!-- Affects all cities -->
<Column name="WLTKDTurns" type="integer" default="0"/>
<Column name="ResistanceTurns" type="integer" default="0"/>
<!-- Happiness Boosts. Can be set to expire. PlayerHappiness applies to capital, HappinessPerCity applies to all cities. -->
<Column name="PlayerHappiness" type="integer" default="0"/>
<Column name="HappinessPerCity" type="integer" default="0"/>
<!-- Spawns X number of barbs near EVERY City. Unit type scales with player tech. -->
<Column name="RandomBarbarianSpawn" type="integer" default="0"/>
<!-- Spawns X number of owned units near EVERY City. Unit type scales with player tech. -->
<Column name="FreeUnitsTechAppropriate" type="integer" default="0"/>
<!-- Filters
Determines whether or not Event Choices appear in list of choices.
-->
<Column name="MinimumNationalPopulation" type="integer" default="0"/>
<Column name="MinimumNumberCities" type="integer" default="0"/>
<Column name="HasMetAMajorCiv" type="boolean" default="false"/>
<!-- Looks for negative gold or negative GPT, respectively. -->
<Column name="InDebt" type="boolean" default="false"/>
<Column name="LosingMoney" type="boolean" default="false"/>
<!-- Require x number of coastal cities to be available as a choice. -->
<Column name="MinimumNumCoastalCities" type="integer" default="0"/>
<!-- Only affects coastal cities-->
<Column name="AffectsCoastalCitiesOnly" type="boolean" default="false"/>
<!-- Only valid if you are under your trade route cap -->
<Column name="LessThanMaximumTradeRoutes" type="boolean" default="false"/>
<!-- Checks if empire is unhappy -->
<Column name="IsUnhappy" type="boolean" default="false"/>
<Column name="IsSuperUnhappy" type="boolean" default="false"/>
<Column name="RequiredCiv" type="text" reference="Civilizations(Type)" default="NULL"/>
<Column name="RequiredEra" type="text" reference="Eras(Type)" default="NULL"/>
<!-- Note: obsoletes at this era, not after it -->
<Column name="ObsoleteEra" type="text" reference="Eras(Type)" default="NULL"/>
<Column name="ImprovementAnywhereRequired" type="text" reference="Improvements(Type)" default="NULL"/>
<Column name="RequiredPolicy" type="text" reference="Policies(Type)" default="NULL"/>
<Column name="RequiredIdeology" type="text" reference="PolicyBranchTypes(Type)" default="NULL"/>
<Column name="UnitClassRequired" type="text" reference="UnitClasses(Type)" default="NULL"/>
<Column name="PrereqTech" type="text" reference="Technologies(Type)" default="NULL"/>
<Column name="ObsoleteTech" type="text" reference="Technologies(Type)" default="NULL"/>
<!-- Checks to see if player's current religion is a Pantheon -->
<Column name="RequiresPantheon" type="boolean" default="false"/>
<!-- Checks for Official or Majority Religion -->
<Column name="RequiredReligion" type="text" reference="Religions(Type)" default="NULL"/>
<!-- JFD check - looks at player's state religion -->
<Column name="RequiredStateReligion" type="text" reference="Religions(Type)" default="NULL"/>
<Column name="RequiresAnyStateReligion" type="boolean" default="false"/>
<!-- Other -->
<Column name="RequiredAnywhereBuildingClass" type="text" reference="BuildingClasses(Type)" default="NULL"/>
<Column name="RequiredNowhereBuildingClass" type="text" reference="BuildingClasses(Type)" default="NULL"/>
<Column name="RequiresHolyCity" type="boolean" default="false"/>
<!-- Requires any Ideology -->
<Column name="RequiresIdeology" type="boolean" default="false"/>
<Column name="RequiresWar" type="boolean" default="false"/>
<Column name="RequiresWarMinor" type="boolean" default="false"/>
<!-- C4DF Only -->
<Column name="IsVassalOfSomeone" type="boolean" default="false"/>
<Column name="IsMasterOfSomeone" type="boolean" default="false"/>
</Table>
<!-- Parent Event is ESSENTIAL - this table assigns choices to events. Make sure the EventType matches the name of an EventType from above! Must be BELOW the above tables. -->
<Table name="Event_ParentEvents">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="EventType" type="text" reference="Events(Type)"/>
</Table>
<!-- Note: This table fires BEFORE an event choice is checked to see if it succeeds. Use this to have an event that costs something, but may not actually succeed. -->
<!-- Use positive values here to make it a 'cost' -->
<Table name="EventChoice_EventCostYield">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="Yield" type="integer"/>
</Table>
<!-- The tables below fire AFTER an event has been found to succeed. Can use negative values here. -->
<!-- Note: these values all pass through your Capital. -->
<Table name="EventChoice_InstantYield">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="Yield" type="integer"/>
</Table>
<!-- Grants all cities a certain X yield per turn. Can be turned off via the 'expires' tag and a set duration. Can scale with era. Can also use coastal/capital valuation above to enable/disable certain cities from gaining the bonus. -->
<Table name="EventChoice_CityYield">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="Yield" type="integer"/>
</Table>
<!-- Grants all city buildings of a class (existing and future) a certain X yield per turn. Can be turned off via the 'expires' tag and a set duration. Can also use coastal/capital valuation above to enable/disable certain cities from gaining the bonus. -->
<Table name="EventChoice_BuildingClassYieldChange">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="BuildingClassType" type="text" reference="BuildingClasses(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="YieldChange" type="integer"/>
</Table>
<!-- Grants all city buildings of a class (existing and future) a certain X yield modifier. Can be turned off via the 'expires' tag and a set duration. Can also use coastal/capital valuation above to enable/disable certain cities from gaining the bonus. -->
<Table name="EventChoice_BuildingClassYieldModifier">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="BuildingClassType" type="text" reference="BuildingClasses(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="Modifier" type="integer"/>
</Table>
<!-- Grants a free resource. Can be set to expire. -->
<Table name="EventChoice_ResourceQuantity">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="ResourceType" type="text" reference="Resources(Type)"/>
<Column name="Quantity" type="integer"/>
</Table>
<!-- Grants features in all cities of a type a certain X yield per turn. Can be turned off via the 'expires' tag and a set duration. Can also use coastal/capital valuation above to enable/disable certain cities from gaining the bonus. -->
<Table name="EventChoice_FeatureYieldChange">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="FeatureType" type="text" reference="Features(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="YieldChange" type="integer"/>
</Table>
<!-- Grants improvements in all cities of a type a certain X yield per turn. Can be turned off via the 'expires' tag and a set duration. Can also use coastal/capital valuation above to enable/disable certain cities from gaining the bonus. -->
<Table name="EventChoice_ImprovementYieldChange">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="ImprovementType" type="text" reference="Improvements(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="YieldChange" type="integer"/>
</Table>
<!-- Grants resources in all cities of a type a certain X yield per turn. Can be turned off via the 'expires' tag and a set duration. Can also use coastal/capital valuation above to enable/disable certain cities from gaining the bonus. -->
<Table name="EventChoice_ResourceYieldChange">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="ResourceType" type="text" reference="Resources(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="YieldChange" type="integer"/>
</Table>
<!-- Grants terrains in all cities of a type a certain X yield per turn. Can be turned off via the 'expires' tag and a set duration. Can also use coastal/capital valuation above to enable/disable certain cities from gaining the bonus. -->
<Table name="EventChoice_TerrainYieldChange">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="TerrainType" type="text" reference="Terrains(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="YieldChange" type="integer"/>
</Table>
<!-- Grants specialists of a type in all cities a certain bonus X yield. Can be turned off via the 'expires' tag and a set duration. Can also use coastal/capital valuation above to enable/disable certain cities from gaining the bonus. -->
<Table name="EventChoice_SpecialistYieldChange">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="SpecialistType" type="text" reference="Specialists(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="YieldChange" type="integer"/>
</Table>
<!-- Creates Units in all cities (unless controlled for above) -->
<Table name="EventChoice_FreeUnitClasses">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="UnitClassType" type="text" reference="UnitClasses(Type)"/>
<Column name="Quantity" type="integer"/>
</Table>
<!-- Creates specific unit type in all cities (unless controlled for above) -->
<Table name="EventChoice_FreeUnits">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="UnitType" type="text" reference="Units(Type)"/>
<Column name="Quantity" type="integer"/>
</Table>
<!-- Convert Set Pop/Percent Pop to Religion-->
<Table name="EventChoice_ConvertNumPopToReligion">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="ReligionType" type="text" reference="Religions(Type)"/>
<Column name="Population" type="integer"/>
</Table>
<Table name="EventChoice_ConvertPercentPopToReligion">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="ReligionType" type="text" reference="Religions(Type)"/>
<Column name="Percent" type="integer"/>
</Table>
<!-- Unhappiness Modifier for CBP Happiness system. Affects ALL cities.
Yield match: YIELD_GOLD = Poverty, YIELD_SCIENCE = Illiteracy, YIELD_PRODUCTION = Safety, YIELD_CULTURE = illiteracy, YIELD_FAITH = Religious Minorities
Note that negative values reduce needs, while positive values increase them!
-->
<Table name="EventChoice_CityUnhappinessNeedMod">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="Yield" type="integer"/>
</Table>
<!-- Filters -->
<!-- Determines if a choice will appear in list. This only checks national yields (Faith, Culture, Gold, Science, Golden Age Points). -->
<Table name="EventChoice_MinimumStartYield">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="Yield" type="integer"/>
</Table>
<!-- Checks for ownership of resource type and number. Does not include trades. -->
<Table name="EventChoice_MinimumResourceRequired">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="ResourceType" type="text" reference="Resources(Type)"/>
<Column name="Quantity" type="integer"/>
</Table>
<!-- Checks for number of cities with a nearby feature. Quantity = minimum number of cities required before event can fire. -->
<Table name="EventChoice_MinimumFeatureRequired">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="FeatureType" type="text" reference="Features(Type)"/>
<Column name="Quantity" type="integer"/>
</Table>
<!-- AI Stuff -->
<!-- Note: if you don't set flavors for your choices, the AI will make a random choice (or will only choose from those with flavors). -->
<Table name="EventChoiceFlavors">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="FlavorType" type="text" reference="Flavors(Type)"/>
<Column name="Flavor" type="integer"/>
</Table>
<!-- This is the linker table for connecting events to one another. MAKE SURE THAT THIS TABLE APPEARS AFTER ALL EVENTS/CHOICES INCLUDED IN IT. You can have multiple of rows of these with the same event type to make specific events that need a specific setup to function (a la parent events above)-->
<Table name="EventChoice_EventLinks">
<!-- This is the parent. This is the event/choice that will or will not fire based on your data below. -->
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<!-- These four elements: set the event/event choice/city event/city event choice you want to link this event to.
You can add elements to each of these so that an event requires another event, event choice, city event, AND a city event choice if you want.
You'll notice one has the word 'linker' after it - this is to distinguish this event/choice from the event/choice defined above (i.e. the parent)
-->
<Column name="Event" type="text" reference="Events(Type)"/>
<Column name="EventChoiceLinker" type="text" reference="EventChoices(Type)"/>
<Column name="CityEvent" type="text" reference="CityEvents(Type)"/>
<Column name="CityEventChoice" type="text" reference="CityEventChoices(Type)"/>
<!-- This makes the event link span all known players and all known player cities looking for the four elements above. Be sparing with this, can be expensive! -->
<Column name="CheckKnownPlayers" type="boolean" default="false"/>
<!-- Defaults to TRUE, meaning that any event/choice defined above must be active for the event to fire. Setting it to false makes it so that any event/choice defined above that is NOT active is the trigger.
Think of this as a boolean switch - if the state of the event(s) above are hoped to be inactive, make this false. If you want it active, leave it true.
-->
<Column name="CheckForActive" type="boolean" default="true"/>
</Table>
<!-- Notifications -->
<!-- Note: this table is not required, however if you want to seed a notification to the player (or to all known players in the world) you need to use this -->
<!-- Make sure that NotificationType corresponds to a real NotificationType! -->
<!-- Also, note that player notifications seeds the following values:
{1_CivShortDescription}
{2_CivDescription}
{3_PlayerName}
{4_EventChoiceHelpText}
You can use any or all of these.
-->
<Table name="EventChoice_Notification">
<Column name="EventChoiceType" type="text" reference="EventChoices(Type)"/>
<Column name="NotificationType" type="text"/>
<Column name="Description" type="text" reference="Language_en_US(Tag)"/>
<Column name="ShortDescription" type="text" reference="Language_en_US(Tag)"/>
<Column name="IsWorldEvent" type="boolean" default="false"/>
<!-- These values are required by some times of notifications and pass into the gamedata/extravariable slots after the X/Y spots for a notification. -->
<Column name="NeedPlayerID" type="boolean" default="false"/>
<!-- Note that if you set NeedPlayerID to true, it takes over the slot where Variable1 goes, so Variable1 is inactive! -->
<Column name="Variable1" type="int" default="-1"/>
<Column name="Variable2" type="int" default="-1"/>
</Table>
<!--== CITY LEVEL EVENTS == -->
<Table name="CityEvents">
<Column name="ID" type="integer" primarykey="true" autoincrement="true"/>
<Column name="Type" type="text" notnull="true" unique="true"/>
<!-- Event Class - You don't have to set this, however you can use the follow categories to give players the options to enable/disable certain types of Events:
EVENT_CLASS_GOOD
EVENT_CLASS_BAD
EVENT_CLASS_NEUTRAL
EVENT_CLASS_TRADE
EVENT_CLASS_CIV_SPECIFIC
-->
<Column name="EventClass" type="text" reference="EventClassTypes(Type)" default="NULL"/>
<Column name="Description" type="text" reference="Language_en_US(Tag)"/>
<Column name="Help" type="text" reference="Language_en_US(Tag)"/>
<Column name="CityEventAudio" type="text"/>
<Column name="CityEventArt" type="text"/>
<!-- 0 = always fires, -1 = diabled, 1-100 = % chance of success. -->
<Column name="RandomChance" type="integer" default="0"/>
<!-- If an event fails its randomchance roll, this value is added to the next random chance roll. Happens every time it fails (until it succeeds, at which point it is reset) -->
<Column name="RandomChanceDelta" type="integer" default="0"/>
<!-- If set to true, this city event can only fire once, ever, for the city -->
<Column name="IsOneShot" type="boolean" default="false"/>
<!-- Event Cooldown: sets distance in time between this event and next. Defaults to 30 turns. Means that the minimum time between any two events of ANY type is 30 turns. -->
<Column name="EventCooldown" type="integer" default="30"/>
<!-- Set NumChoices to 2+ if adding 2 or more choices below!! -->
<Column name="NumChoices" type="integer" default="1"/>
<!-- Era Scaling: boosts yield required for minimumstartyield table below. -->
<Column name="EraScaling" type="boolean" default="false"/>
<!-- Allows the event to ignore the global cooldown defined above. Use sparingly! -->
<Column name="IgnoresGlobalCooldown" type="boolean" default="false"/>
<!-- Filters
Determine whether or not an Event can occur for the player.
-->
<Column name="MinimumCityPopulation" type="integer" default="0"/>
<Column name="MaximumCityPopulation" type="integer" default="0"/>
<Column name="RequiredCiv" type="text" reference="Civilizations(Type)" default="NULL"/>
<Column name="RequiredEra" type="text" reference="Eras(Type)" default="NULL"/>
<!-- Note: obsoletes at this era, not after it -->
<Column name="ObsoleteEra" type="text" reference="Eras(Type)" default="NULL"/>
<!-- Only Checks for local Improvements worked by City. -->
<Column name="ImprovementRequired" type="text" reference="Improvements(Type)" default="NULL"/>
<!-- Checks for nearby features/terrain. Can use natural wonders for features. -->
<Column name="NearbyFeature" type="text" reference="Features(Type)" default="NULL"/>
<Column name="NearbyTerrain" type="text" reference="Terrains(Type)" default="NULL"/>
<Column name="LocalResourceRequired" type="text" reference="Resources(Type)" default="NULL"/>
<Column name="RequiredPolicy" type="text" reference="Policies(Type)" default="NULL"/>
<Column name="RequiredIdeology" type="text" reference="PolicyBranchTypes(Type)" default="NULL"/>
<Column name="PrereqTech" type="text" reference="Technologies(Type)" default="NULL"/>
<Column name="ObsoleteTech" type="text" reference="Technologies(Type)" default="NULL"/>
<!-- Only Checks for local status. -->
<Column name="RequiredReligion" type="text" reference="Religions(Type)" default="NULL"/>
<!-- JFD Check - local only -->
<Column name="RequiredStateReligion" type="text" reference="Religions(Type)" default="NULL"/>
<Column name="RequiresAnyStateReligion" type="boolean" default="false"/>
<!-- Only Checks for local Buildings in City. -->
<Column name="RequiredBuildingClass" type="text" reference="BuildingClasses(Type)" default="NULL"/>
<Column name="CannotHaveBuildingClass" type="text" reference="BuildingClasses(Type)" default="NULL"/>
<!-- Only Checks for local status. -->
<Column name="HasTradeConnection" type="boolean" default="false"/>
<Column name="HasCityConnection" type="boolean" default="false"/>
<Column name="RequiresGarrison" type="boolean" default="false"/>
<Column name="RequiresHolyCity" type="boolean" default="false"/>
<Column name="RequiresIdeology" type="boolean" default="false"/>
<Column name="CapitalOnly" type="boolean" default="false"/>
<Column name="CoastalOnly" type="boolean" default="false"/>
<Column name="RiverOnly" type="boolean" default="false"/>
<Column name="RequiresWar" type="boolean" default="false"/>
<Column name="RequiresWarMinor" type="boolean" default="false"/>
<Column name="RequiresResistance" type="boolean" default="false"/>
<Column name="RequiresWLTKD" type="boolean" default="false"/>
<Column name="RequiresOccupied" type="boolean" default="false"/>
<Column name="RequiresRazing" type="boolean" default="false"/>
<Column name="HasAnyReligion" type="boolean" default="false"/>
<Column name="RequiresPuppet" type="boolean" default="false"/>
<Column name="HasMetAMajorCiv" type="boolean" default="false"/>
<!-- Looks for official (i.e. founded/holy city owned) religion, not majority! -->
<Column name="CityHasPlayerReligion" type="boolean" default="false"/>
<Column name="CityLacksPlayerReligion" type="boolean" default="false"/>
<!-- Looks for majority religion, not official (i.e. founded/holy city owned)! -->
<Column name="CityHasPlayerMajorityReligion" type="boolean" default="false"/>
<Column name="CityLacksPlayerMajorityReligion" type="boolean" default="false"/>
<!-- C4DF Only -->
<Column name="IsVassalOfSomeone" type="boolean" default="false"/>
<Column name="IsMasterOfSomeone" type="boolean" default="false"/>
<!-- Checks if city majority is a Pantheon -->
<Column name="RequiresPantheon" type="boolean" default="false"/>
<!-- Looks for negative gold or negative GPT, respectively. -->
<Column name="InDebt" type="boolean" default="false"/>
<Column name="LosingMoney" type="boolean" default="false"/>
<!-- Checks if empire is unhappy -->
<Column name="IsUnhappy" type="boolean" default="false"/>
<Column name="IsSuperUnhappy" type="boolean" default="false"/>
<Column name="RequiresNearbyNaturalWonder" type="boolean" default="false"/>
<Column name="RequiresNearbyMountain" type="boolean" default="false"/>
<!-- Allows the event to fire as a random event for a spy. City Choice Effects AFFECT CITY SPY IS IN. Uses a special table for getting event data, see below -->
<Column name="IsEspionage" type="boolean" default="false"/>
<!-- Espionage Setup Event for Spy Event Filter. Only need one per database, please.-->
<Column name="EspionageSetup" type="boolean" default="false"/>
<!-- Espionage Setup Event for Counterspy Spy Event Filter. Only need one per database, please.-->
<Column name="IsCounterSpy" type="boolean" default="false"/>
</Table>
<!-- Filter -->
<!-- Note: this only checks local yields (Food and Production). -->
<Table name="CityEvent_MinimumStartYield">
<Column name="CityEventType" type="text" reference="CityEvents(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="Yield" type="integer"/>
</Table>
<!-- This is the linker table for connecting events to one another. MAKE SURE THAT THIS TABLE APPEARS AFTER ALL EVENTS/CHOICES INCLUDED IN IT. You can have multiple of rows of these with the same event type to make specific events that need a specific setup to function (a la parent events above)-->
<Table name="CityEvent_EventLinks">
<!-- This is the parent. This is the event/choice that will or will not fire based on your data below. -->
<Column name="CityEventType" type="text" reference="CityEvents(Type)"/>
<!-- These four elements: set the event/event choice/city event/city event choice you want to link this event to.
You can add elements to each of these so that an event requires another event, event choice, city event, AND a city event choice if you want.
You'll notice one has the word 'linker' after it - this is to distinguish this event/choice from the event/choice defined above (i.e. the parent)
-->
<Column name="Event" type="text" reference="Events(Type)"/>
<Column name="EventChoice" type="text" reference="EventChoices(Type)"/>
<Column name="CityEventLinker" type="text" reference="CityEvents(Type)"/>
<Column name="CityEventChoice" type="text" reference="CityEventChoices(Type)"/>
<!-- This makes the event link span all known players and all known player cities looking for the four elements above. Be sparing with this, can be expensive! -->
<Column name="CheckKnownPlayers" type="boolean" default="false"/>
<!-- This looks only at the event city. Only works if you have a CityEvent or CityEventChoice defined above. Also does not work with CheckKnownPlayers-->
<Column name="CheckOnlyEventCity" type="boolean" default="false"/>
<!-- Defaults to TRUE, meaning that any event/choice defined above must be active for the event to fire. Setting it to false makes it so that any event/choice defined above that is NOT active is the trigger.
Think of this as a boolean switch - if the state of the event(s) above are hoped to be inactive, make this false. If you want it active, leave it true.
-->
<Column name="CheckForActive" type="boolean" default="true"/>
</Table>
<Table name="CityEventChoices">
<!-- You can make as many choices as you want - the window show expand (with a scroll bar) to acommodate them. But be reasonable! :) -->
<!-- Note - if NOT a multiple-choice event, only make one of these! -->
<Column name="ID" type="integer" primarykey="true" autoincrement="true"/>
<Column name="Type" type="text" notnull="true" unique="true"/>
<Column name="Description" type="text" reference="Language_en_US(Tag)"/>
<!-- Help is used for Tooltips, Description for button text -->
<Column name="Help" type="text" reference="Language_en_US(Tag)"/>
<!-- DisabledTooltip is used for Tooltips for choices that are not active but appear in choice list.
The DLL automatically explains to players WHY an event choice is unavailable, however you can use it you want to override the DLL. -->
<Column name="DisabledTooltip" type="text" reference="Language_en_US(Tag)"/>
<!-- Audio for when event popup activates . -->
<Column name="EventChoiceAudio" type="text" default="AS2D_EVENT_CHOICE"/>
<!-- If set to true, this city event choice can only be chosen once, ever, by the city -->
<Column name="IsOneShot" type="boolean" default="false"/>
<!-- Defaults to 30. Set a different duration if the expiration timer matters. Otherwise, leave it at 30, as it is used by the Recent Events overview. -->
<Column name="EventDuration" type="integer" default="30"/>
<!-- Event Chance: Higher value = higher chance of success. Notification will spawn if an event fails. Default is always successful. -->
<Column name="EventChance" type="integer" default="0"/>
<!-- Era Scaling: boosts yield value on instant yield, GP Points, and yield costs tables (See below) based on Era. -->
<Column name="EraScaling" type="boolean" default="false"/>
<!-- Expires: set to true if you want policies/buildings/promotions/resources granted to disappear after the duration. -->
<Column name="Expires" type="boolean" default="false"/>
<!-- VARIABLES
Attributes granted by City Event Choices
-->
<!-- Appplies chosen player event - useful for espionage. Note: due to coding, if you use this AND IsSpyBenefit, the player-level event will apply to spy owner but not the city event. This lets you give the spy owner a bonus and penalize the city owner in the same event-->
<Column name="TriggerPlayerEventChoice" type="text" reference="EventChoices(Type)" default="NULL"/>
<!-- Only affects local city. Destroys or adds a building type. -->
<Column name="EventBuildingClassDestruction" type="text" reference="BuildingClasses(Type)" default="NULL"/>
<Column name="EventBuildingClass" type="text" reference="BuildingClasses(Type)" default="NULL"/>
<!-- Checks all buildings in city for destruction. Mass disaster event. Integer is % chance of destruction. Note that this and CityEventChoice_BuildingClassDestructionChance use the same function, and the higher chance % trumps. -->
<Column name="CityWideBuildingDestructionChance" type="integer" default="0"/>
<!-- Local WLTKD Turns -->
<Column name="WLTKDTurns" type="integer" default="0"/>
<!-- Local Growth Mod %-->
<Column name="GrowthMod" type="integer" default="0"/>
<!-- Local Resistance Turns -->
<Column name="ResistanceTurns" type="integer" default="0"/>
<!-- Local Happiness Boost. Can be set to expire. -->
<Column name="CityHappiness" type="integer" default="0"/>
<!-- Pillage x number of SR around city. Resource chosen is random, but will be strategic. -->
<Column name="PillageCityStrategicNum" type="integer" default="0"/>
<!-- Chance of destruction for all buildings in city - use as a baseline for horrible disasters, etc. -->
<!-- Spawns X number of barbs near the City. Unit type scales with player tech. -->
<Column name="RandomBarbarianSpawn" type="integer" default="0"/>
<!-- Spawns X number of owned units near the City. Unit type scales with player tech. -->
<Column name="FreeUnitsTechAppropriate" type="integer" default="0"/>
<!-- Grants all units created by this city while this is active a promotion. Only affects valid units. -->
<Column name="EventPromotion" type="text" reference="UnitPromotions(Type)" default="NULL"/>
<!-- Converts City to Player Official (i.e. founded/holy city owned) Religion by x%.-->
<Column name="ConvertToPlayerReligionPercent" type="integer" default="0"/>
<!-- Converts City to Player Majority Religion by x% (can be official religion, but not necessarily so).-->
<Column name="ConvertToPlayerMajorityReligionPercent" type="integer" default="0"/>
<!-- Associates a Choice with an espionage outcome. Only used with Espionage actions. False means spy stuff won't trigger in post-event figuring. -->
<Column name="IsEspionageEffect" type="boolean" default="false"/>
<!-- Set to true for any mission that's part of the 'setup' phase for a Spy -->
<Column name="MissionSetup" type="boolean" default="false"/>
<!-- Effect applies to spy owner capital instead! Note: if you use -->
<Column name="IsSpyBenefit" type="boolean" default="false"/>
<!-- Bonus and/or cost etc. scale based on the potential of the city - higher potential = slower, but more reward! -->
<Column name="PotentialScaling" type="boolean" default="false"/>
<!-- Bonus and/or cost etc. scale based on the difference in techs with target player! Scales the potential value by a % amount-->
<Column name="ScienceScaling" type="integer" default="0"/>
<!-- Modifier to chance to be identified on a spy mission-->
<Column name="IDModifier" type="integer" default="0"/>
<!-- Modifier to chance to be killed on a spy mission-->
<Column name="DeathModifier" type="integer" default="0"/>
<!-- Minimum Spy Level -->
<Column name="SpyLevelRequired" type="integer" default="0"/>
<Column name="RequiresCounterSpy" type="boolean" default="false"/>
<Column name="ExpiresOnCounterSpyExit" type="boolean" default="false"/>
<!-- Affects duration of mission -->
<Column name="EspionageDifficultyMod" type="integer" default="0"/>
<!-- Damages city -->
<Column name="DamageCity" type="integer" default="0"/>
<!-- Damages garrison unit -->
<Column name="DamageGarrison" type="integer" default="0"/>
<!-- Prevents city healing for x turns -->
<Column name="SapCityTurns" type="integer" default="0"/>
<!-- Speeds up an espionage action if the city has a wonder under construction! -->
<Column name="WonderConstructionSpeedMod" type="integer" default="0"/>
<!-- Counterspy can affect city ranged strength %-->
<Column name="CityDefenseModifier" type="integer" default="0"/>
<!-- Increases spy city vision -->
<Column name="SpyVisionRange" type="integer" default="0"/>
<!-- Spies won't level up from this mission. -->
<Column name="NoLevelUp" type="boolean" default="false"/>
<!-- Mission ignores other local spies. -->
<Column name="IgnoreLocalForeignSpies" type="boolean" default="false"/>
<!-- Spy copies num techs; if it fails at end, it converts amount to GA turns -->
<Column name="StealNumTechs" type="integer" default="0"/>
<!-- Spy copies num GWs; if it fails at end, it converts amount to GA turns-->
<Column name="ForgeNumGW" type="integer" default="0"/>
<!-- FILTERS:
Values below determine whether or not a City Event Choice appears in the City list
-->
<Column name="MinimumCityPopulation" type="integer" default="0"/>
<Column name="MaximumCityPopulation" type="integer" default="0"/>
<Column name="RequiredCiv" type="text" reference="Civilizations(Type)" default="NULL"/>
<Column name="RequiredEra" type="text" reference="Eras(Type)" default="NULL"/>
<!-- Note: obsoletes at this era, not after it -->
<Column name="ObsoleteEra" type="text" reference="Eras(Type)" default="NULL"/>
<!-- Only Checks for local Improvements worked by City. -->
<Column name="ImprovementRequired" type="text" reference="Improvements(Type)" default="NULL"/>
<!-- Checks for nearby features/terrain. Can use natural wonders for features. -->
<Column name="NearbyFeature" type="text" reference="Features(Type)" default="NULL"/>
<Column name="NearbyTerrain" type="text" reference="Terrains(Type)" default="NULL"/>
<Column name="RequiredPolicy" type="text" reference="Policies(Type)" default="NULL"/>
<Column name="RequiredIdeology" type="text" reference="PolicyBranchTypes(Type)" default="NULL"/>
<Column name="LocalResourceRequired" type="text" reference="Resources(Type)" default="NULL"/>
<Column name="PrereqTech" type="text" reference="Technologies(Type)" default="NULL"/>
<Column name="ObsoleteTech" type="text" reference="Technologies(Type)" default="NULL"/>
<!-- Only Checks for local status. -->
<Column name="RequiredReligion" type="text" reference="Religions(Type)" default="NULL"/>
<!-- JFD Check - local only -->
<Column name="RequiredStateReligion" type="text" reference="Religions(Type)" default="NULL"/>
<Column name="RequiresAnyStateReligion" type="boolean" default="false"/>
<!-- Only Checks for local Buildings in City. -->
<Column name="RequiredBuildingClass" type="text" reference="BuildingClasses(Type)" default="NULL"/>
<Column name="CannotHaveBuildingClass" type="text" reference="BuildingClasses(Type)" default="NULL"/>
<!-- C4DF Only -->
<Column name="IsVassalOfSomeone" type="boolean" default="false"/>
<Column name="IsMasterOfSomeone" type="boolean" default="false"/>
<!-- Only Checks for local status. -->
<!-- Looks for official (i.e. founded/holy city owned) religion, not majority! -->
<Column name="CityHasPlayerReligion" type="boolean" default="false"/>
<Column name="CityLacksPlayerReligion" type="boolean" default="false"/>
<!-- Looks for majority religion, not official (i.e. founded/holy city owned)! -->
<Column name="CityHasPlayerMajorityReligion" type="boolean" default="false"/>
<Column name="CityLacksPlayerMajorityReligion" type="boolean" default="false"/>
<Column name="HasTradeConnection" type="boolean" default="false"/>
<Column name="HasCityConnection" type="boolean" default="false"/>
<Column name="RequiresGarrison" type="boolean" default="false"/>
<Column name="RequiresHolyCity" type="boolean" default="false"/>
<Column name="RequiresIdeology" type="boolean" default="false"/>
<Column name="CapitalOnly" type="boolean" default="false"/>
<Column name="CoastalOnly" type="boolean" default="false"/>
<Column name="RiverOnly" type="boolean" default="false"/>
<Column name="RequiresWar" type="boolean" default="false"/>
<Column name="RequiresWarMinor" type="boolean" default="false"/>
<Column name="RequiresResistance" type="boolean" default="false"/>
<Column name="RequiresWLTKD" type="boolean" default="false"/>
<Column name="RequiresOccupied" type="boolean" default="false"/>
<Column name="RequiresRazing" type="boolean" default="false"/>
<Column name="HasAnyReligion" type="boolean" default="false"/>
<Column name="RequiresPuppet" type="boolean" default="false"/>
<Column name="HasMetAMajorCiv" type="boolean" default="false"/>
<!-- Checks if city majority is a Pantheon -->
<Column name="RequiresPantheon" type="boolean" default="false"/>
<!-- Looks for negative gold or negative GPT, respectively. -->
<Column name="InDebt" type="boolean" default="false"/>
<Column name="LosingMoney" type="boolean" default="false"/>
<!-- Checks if empire is unhappy -->
<Column name="IsUnhappy" type="boolean" default="false"/>
<Column name="IsSuperUnhappy" type="boolean" default="false"/>
<Column name="RequiresNearbyNaturalWonder" type="boolean" default="false"/>
<Column name="RequiresNearbyMountain" type="boolean" default="false"/>
</Table>
<!-- Parent Event is essential - this table assigns choices to events. Make sure the CityEventType matches the name of an CityEventType from above! Must be BELOW the above tables. -->
<Table name="CityEvent_ParentEvents">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="CityEventType" type="text" reference="CityEvents(Type)"/>
</Table>
<!-- Note: This table fires BEFORE an event is checked to see if it succeeds. Use this to have an event that costs something, but may not actually succeed. -->
<!-- Use positive values here to make it a 'cost' -->
<Table name="CityEventChoice_EventCostYield">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="Yield" type="integer"/>
</Table>
<!-- The tables below fire AFTER an event has been found to succeed. Can use negative values here. -->
<Table name="CityEventChoice_InstantYield">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="Yield" type="integer"/>
</Table>
<!-- Grants this city a certain X yield per turn. Can be turned off via the 'expires' tag and a set duration. Can scale with era. -->
<Table name="CityEventChoice_CityYield">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="Yield" type="integer"/>
</Table>
<!-- Grants this city's buildings of a class (existing and future) a certain X yield per turn. Can be turned off via the 'expires' tag and a set duration. -->
<Table name="CityEventChoice_BuildingClassYieldChange">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="BuildingClassType" type="text" reference="BuildingClasses(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="YieldChange" type="integer"/>
</Table>
<!-- Grants this city's buildings of a class (existing and future) a certain X yield modifier. Can be turned off via the 'expires' tag and a set duration. -->
<Table name="CityEventChoice_BuildingClassYieldModifier">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="BuildingClassType" type="text" reference="BuildingClasses(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="Modifier" type="integer"/>
</Table>
<!-- Grants player a free resource. Can be set to expire. -->
<Table name="CityEventChoice_ResourceQuantity">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="ResourceType" type="text" reference="Resources(Type)"/>
<Column name="Quantity" type="integer"/>
</Table>
<!-- Grants this city's features of a type a certain X yield per turn. Can be turned off via the 'expires' tag and a set duration. -->
<Table name="CityEventChoice_FeatureYieldChange">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="FeatureType" type="text" reference="Features(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="YieldChange" type="integer"/>
</Table>
<!-- Grants this city's improvements of a type a certain X yield per turn. Can be turned off via the 'expires' tag and a set duration. -->
<Table name="CityEventChoice_ImprovementYieldChange">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="ImprovementType" type="text" reference="Improvements(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="YieldChange" type="integer"/>
</Table>
<!-- Grants this city's resources of a type a certain X yield per turn. Can be turned off via the 'expires' tag and a set duration. -->
<Table name="CityEventChoice_ResourceYieldChange">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="ResourceType" type="text" reference="Resources(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="YieldChange" type="integer"/>
</Table>
<!-- Grants this city's terrains of a type a certain X yield per turn. Can be turned off via the 'expires' tag and a set duration. -->
<Table name="CityEventChoice_TerrainYieldChange">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="TerrainType" type="text" reference="Terrains(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="YieldChange" type="integer"/>
</Table>
<!-- Grants this city's specialists of a type a certain bonus X yield. Can be turned off via the 'expires' tag and a set duration. -->
<Table name="CityEventChoice_SpecialistYieldChange">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="SpecialistType" type="text" reference="Specialists(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="YieldChange" type="integer"/>
</Table>
<!-- Note: make sure that the specialist you use here can make a Great Person! Can use negative values here if you want. -->
<Table name="CityEventChoice_GreatPersonPoints">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="SpecialistType" type="text" reference="Specialists(Type)"/>
<Column name="Points" type="integer"/>
</Table>
<!-- Note: Pillages up to the number indicated. Is random. Useful for storms, etc. -->
<Table name="CityEventChoice_ImprovementDestructionRandom">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="ImprovementType" type="text" reference="Improvements(Type)"/>
<Column name="Number" type="integer"/>
</Table>
<!-- Note: Chance indicates % chance of a building being destroyed in the City by an event. Useful for disasters, or if you want to give the player some control over a destruction event's outcome. -->
<Table name="CityEventChoice_BuildingClassDestructionChance">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="BuildingClassType" type="text" reference="BuildingClasses(Type)"/>
<Column name="Chance" type="integer"/>
</Table>
<!-- Note: Destroys up to the number indicated. Is random. Useful for storms, etc. -->
<Table name="CityEventChoice_FreeUnitClasses">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="UnitClassType" type="text" reference="UnitClasses(Type)"/>
<Column name="Quantity" type="integer"/>
</Table>
<!-- Creates specific unit type in the City -->
<Table name="CityEventChoice_FreeUnits">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="UnitType" type="text" reference="Units(Type)"/>
<Column name="Quantity" type="integer"/>
</Table>
<!-- Convert Set Pop/Percent Pop to Religion-->
<Table name="CityEventChoice_ConvertNumPopToReligion">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="ReligionType" type="text" reference="Religions(Type)"/>
<Column name="Population" type="integer"/>
</Table>
<Table name="CityEventChoice_ConvertPercentPopToReligion">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="ReligionType" type="text" reference="Religions(Type)"/>
<Column name="Percent" type="integer"/>
</Table>
<!-- Unhappiness Modifier for CBP Happiness system.
Yield match: YIELD_GOLD = Poverty, YIELD_SCIENCE = Illiteracy, YIELD_PRODUCTION = Safety, YIELD_CULTURE = illiteracy, YIELD_FAITH = Religious Minorities
Note that negative values reduce needs, while positive values increase them!
-->
<Table name="CityEventChoice_CityUnhappinessNeedMod">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="Yield" type="integer"/>
</Table>
<!-- Filters -->
<!-- Checks local yields as well (Food and Production). -->
<Table name="CityEventChoice_MinimumStartYield">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="YieldType" type="text" reference="Yields(Type)"/>
<Column name="Yield" type="integer"/>
</Table>
<!-- AI Stuff -->
<!-- Note: if you don't set flavors for your choices, the AI will make a random choice (or will only choose from those with flavors). -->
<Table name="CityEventChoiceFlavors">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="FlavorType" type="text" reference="Flavors(Type)"/>
<Column name="Flavor" type="integer"/>
</Table>
<!-- This is the linker table for connecting events to one another. MAKE SURE THAT THIS TABLE APPEARS AFTER ALL EVENTS/CHOICES INCLUDED IN IT. You can have multiple of rows of these with the same event type to make specific events that need a specific setup to function (a la parent events above)-->
<Table name="CityEventChoice_EventLinks">
<!-- This is the parent. This is the event/choice that will or will not fire based on your data below. -->
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<!-- These four elements: set the event/event choice/city event/city event choice you want to link this event to.
You can add elements to each of these so that an event requires another event, event choice, city event, AND a city event choice if you want.
You'll notice one has the word 'linker' after it - this is to distinguish this event/choice from the event/choice defined above (i.e. the parent)
-->
<Column name="Event" type="text" reference="Events(Type)"/>
<Column name="EventChoice" type="text" reference="EventChoices(Type)"/>
<Column name="CityEvent" type="text" reference="CityEvents(Type)"/>
<Column name="CityEventChoiceLinker" type="text" reference="CityEventChoices(Type)"/>
<!-- This makes the event link span all known players and all known player cities looking for the four elements above. Be sparing with this, can be expensive! -->
<Column name="CheckKnownPlayers" type="boolean" default="false"/>
<!-- This looks only at the event city. Only works if you have a CityEvent or CityEventChoice defined above. Also does not work with CheckKnownPlayers-->
<Column name="CheckOnlyEventCity" type="boolean" default="false"/>
<!-- Defaults to TRUE, meaning that any event/choice defined above must be active for the event to fire. Setting it to false makes it so that any event/choice defined above that is NOT active is the trigger.
Think of this as a boolean switch - if the state of the event(s) above are hoped to be inactive, make this false. If you want it active, leave it true.
-->
<Column name="CheckForActive" type="boolean" default="true"/>
</Table>
<!-- Notifications -->
<!-- Note: this table is not required, however if you want to seed a notification to the player (or to all known players in the world) you need to use this -->
<!-- Make sure that NotificationType corresponds to a real NotificationType! -->
<!-- Also, note that player notifications seeds the following values:
{1_CivShortDescription}
{2_CityName}
{3_CivDescription}
{4_PlayerName}
{5_EventChoiceHelpText}
You can use any or all of these.
-->
<Table name="CityEventChoice_Notification">
<Column name="CityEventChoiceType" type="text" reference="CityEventChoices(Type)"/>
<Column name="NotificationType" type="text"/>
<Column name="Description" type="text" reference="Language_en_US(Tag)"/>
<Column name="ShortDescription" type="text" reference="Language_en_US(Tag)"/>
<Column name="IsWorldEvent" type="boolean" default="false"/>
<Column name="EspionageEvent" type="boolean" default="false"/>
<!-- Grabs the coordinates for the city where the event fires - if left false, it returns -1/-1, so the camera won't move if the button is selected. -->
<Column name="NeedCityCoordinates" type="boolean" default="false"/>
<!-- Note that if you set NeedPlayerID to true, it takes over the slot where ExtraVariable goes, so ExtraVariable is inactive! -->
<Column name="NeedPlayerID" type="boolean" default="false"/>
<Column name="ExtraVariable" type="int" default="-1"/>
</Table>
<Table name="EventClassTypes">
<Column name="ID" type="integer" primarykey="true" autoincrement="true" />
<Column name="Type" type="text" notnull="true" unique="true" />
</Table>
<!-- Table data -->
<EventClassTypes>
<Row>
<ID>0</ID>
<Type>EVENT_CLASS_GOOD</Type>
</Row>
<Row>
<Type>EVENT_CLASS_NEUTRAL</Type>
</Row>
<Row>
<Type>EVENT_CLASS_BAD</Type>
</Row>
<Row>
<Type>EVENT_CLASS_TRADE</Type>
</Row>
<Row>
<Type>EVENT_CLASS_CIV_SPECIFIC</Type>
</Row>
</EventClassTypes>
<Audio_Sounds>
<Row>
<SoundID>SND_EVENT_CHOICE</SoundID>
<Filename>EventChoice</Filename>
<LoadType>DynamicResident</LoadType>
</Row>
</Audio_Sounds>
<Audio_2DSounds>
<Row>
<ScriptID>AS2D_EVENT_CHOICE</ScriptID>
<SoundID>SND_EVENT_CHOICE</SoundID>
<SoundType>GAME_SFX</SoundType>
<DontTriggerDuplicates>1</DontTriggerDuplicates>
<DontPlayMoreThan>1</DontPlayMoreThan>
<TaperSoundtrackVolume>-1.0</TaperSoundtrackVolume>
<MinVolume>100</MinVolume>
<MaxVolume>100</MaxVolume>
</Row>
</Audio_2DSounds>
</GameData>
<!-- ESPIONAGE TEXT FORMAT FOR DESCRIPTIONS
These values allow you to have spy names, city names, risk of death, etc. as values in your description for the event. Purely flavor.
{1_SpyRank}
{2_SpyName}
{3_CityName}
{4_ChanceToDie}
{5_ChanceToBeIdentified} -->