Yes it can be done, but it is more complicated than just adding a normal resource production running all the time, such as merchant that gives you gildar. The reason is that influence is by nature a global resource, so you can't just produce it all the time.
What we need to do is create an intermediary resource and produce that. The intermediary resource will be local instead of global, so it will only function when you are in a city. Then we turn the intermediary resource into real influence using some XML magic.
Here is some sample XML that adds +1 Influence when in a city if the character has the Attunement trait.
<?xml version="1.0"?>
<Container>
<AbilityBonus InternalName="AttunementAbility">
<AbilityBonusOption InternalName="Attunement">
<GameModifier>
<ModType>Resource</ModType>
<Attribute>FakeInfluence</Attribute>
<Value>1</Value>
<Provides>+1 Influence per turn if stationed in a city</Provides>
</GameModifier>
</AbilityBonusOption>
</AbilityBonus>
<ResourceType InternalName="FakeInfluence">
<DisplayName>Growth</DisplayName>
<Description>Growth is the amount your population increases each season.</Description>
<Type>FakeInfluence</Type>
<IconColor>0,0,0</IconColor>
<Icon>Gfx//Icons//Prestige_Icon.png</Icon>
<ClothIcon>gfx\\TacticalIcons\\MetalOre_1.png</ClothIcon>
<HideInHiergamenon>1</HideInHiergamenon>
<ModelColor>0,0,0</ModelColor>
<Worth>1</Worth>
<Global>0</Global>
<Rarity>0.0</Rarity>
<Shared>0</Shared>
<Stored>0</Stored>
<TradedByCaravans>0</TradedByCaravans>
<Medallions InternalName="Prestige_Res_Medallions">
<All>Res_Ores_Plains.png</All>
</Medallions>
</ResourceType>
<CityResourceEffectDef InternalName="FakeInfluenceToRealInfluence">
<InputResource>FakeInfluence</InputResource>
<OutputResource>DiplomaticCapital</OutputResource>
<ResourceForMultiplierOnInput>FakeInfluenceToRealInfluence</ResourceForMultiplierOnInput>
<EffectType>Harvest</EffectType>
</CityResourceEffectDef>
<PlayerAbilityType InternalName="A_Additive_FakeInfluenceToRealInfluence">
<DisplayName>Base Research Per Population</DisplayName>
<Description>How much research each unit of population produces in a city.</Description>
<Icon>Icon_Level.png</Icon>
<DefaultValue>1</DefaultValue>
</PlayerAbilityType>
<ResourceType InternalName="FakeInfluenceToRealInfluence">
<DisplayName>Research Per Population</DisplayName>
<Description>Amount of research each unit of population produces.</Description>
<Type>FakeInfluenceToRealInfluence</Type>
<IconColor>0,0,0</IconColor>
<!--<Icon>Gfx//Icons//dude_icon.png</Icon>-->
<Icon>Gfx//Icons//Icon_Population.png</Icon>
<HideInHiergamenon>1</HideInHiergamenon>
<ModelColor>0,0,0</ModelColor>
<Worth>0</Worth>
<Global>0</Global>
<Stored>0</Stored>
<Rarity>0.0</Rarity>
<Shared>0</Shared>
<TradedByCaravans>0</TradedByCaravans>
<ShownInGlobalDisplay>0</ShownInGlobalDisplay>
<Medallions InternalName="Population_Res_Medallions">
<All>Res_Ores_Plains.png</All>
</Medallions>
</ResourceType>
</Container>
I have highlighted some important bits above in case you want to try to understand it.
To learn more about production rules, check out https://forums.elementalgame.com/419061