Home › Lua API › PlayerTreasury

Available out of the box. Usable from Lua in the unmodified game.

PlayerTreasury

14 methods. Symbol/current columns are function addresses (RVA) of the native wrapper.

Community reference for this object: PlayerTreasury (Sukrit Tan, external).

Signatures are recovered from the game code. ⚠ = partly understood (arguments may be missing or approximate). ? after a name = optional argument. Types: integer/number are Lua numbers, enum-typed arguments show the C++ type in brackets. Two signatures mean the method is registered separately for the UI and the gameplay state and each wrapper was decoded on its own. "same code as" in the Symbol column means the compiler merged identical functions: those methods share one wrapper and cannot be told apart by address.

Method Signature Where Reference Symbol Current
CanAfford PlayerTreasury:CanAfford(uiCityID?: number, arg2: string/number, eFormation?: number) → boolean
touches (inferred from the code): reads Cache::Player::Instance::m_kConstant+0x8
✓ exists at runtime (not called)
ui-cache yes ↗ 0x6b61c0 0x6b6740
ChangeGoldBalance PlayerTreasury:ChangeGoldBalance(iDelta: number) (or nothing)
touches (inferred from the code): writes Player::Treasury::m_xGoldBalance; reads Player::Treasury::m_xGoldBalance, Player::Instance::m_id
gameplay yes ↗ 0x6f76c0 0x6f7e00
ChangeGoldBalanceByPercentage PlayerTreasury:ChangeGoldBalanceByPercentage(iDelta?: number) (or nothing)
touches (inferred from the code): writes Player::Treasury::m_xGoldBalance; reads Player::Treasury::m_xGoldBalance, Player::Instance::m_id
gameplay yes ↗ 0x6f7740 0x6f7e80
GetBuildingMaintenance UI state: PlayerTreasury:GetBuildingMaintenance() → number
gameplay state: PlayerTreasury:GetBuildingMaintenance() → number
touches (inferred from the code): reads Cache::Player::Treasury::m_Variants+0xc
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x6b62b0 0x6b6830
GetDistrictMaintenance UI state: PlayerTreasury:GetDistrictMaintenance() → number
gameplay state: PlayerTreasury:GetDistrictMaintenance() → number
touches (inferred from the code): reads Cache::Player::Treasury::m_Variants+0x10
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x6b6300 0x6b6880
GetGoldBalance PlayerTreasury:GetGoldBalance() → number
touches (inferred from the code): reads Cache::Player::Treasury::m_Variants+0x8
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x6b6350 0x6b68d0
GetGoldYield UI state: PlayerTreasury:GetGoldYield() → number
gameplay state: PlayerTreasury:GetGoldYield() → number (FixedPoint)
touches (inferred from the code): reads Cache::Player::Treasury::m_GoldYield+0x8, Cache::Player::Treasury::m_GoldYield+0x40, Cache::Player::Treasury::m_GoldYield+0x38, Cache::Player::Treasury::m_GoldYield+0x10, Cache::Player::Treasury::m_GoldYield+0x48 …
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x6b63c0 0x6b6940
GetGoldYieldToolTip PlayerTreasury:GetGoldYieldToolTip(arg1?: any, arg2?: any) → string
✓ exists at runtime (not called)
ui-cache yes ↗ 0x6b6430 —
GetMaintDiscountPerUnit PlayerTreasury:GetMaintDiscountPerUnit() → number
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x6b6440 0x6b69c0
GetTotalMaintenance UI state: PlayerTreasury:GetTotalMaintenance() → number
gameplay state: PlayerTreasury:GetTotalMaintenance() → number (FixedPoint)
touches (inferred from the code): reads Cache::Player::Treasury::m_TotalMaintenance+0x8, Cache::Player::Treasury::m_TotalMaintenance+0x40, Cache::Player::Treasury::m_TotalMaintenance+0x38, Cache::Player::Treasury::m_TotalMaintenance+0x10, Cache::Player::Treasury::m_TotalMaintenance+0x48 …
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x6b6490 0x6b6a10
GetTotalMaintenanceToolTip PlayerTreasury:GetTotalMaintenanceToolTip(arg1?: any, arg2?: any) → string
✓ exists at runtime (not called)
ui-cache yes ↗ 0x6b64e0 —
GetUnitMaintenance UI state: PlayerTreasury:GetUnitMaintenance() → number
gameplay state: PlayerTreasury:GetUnitMaintenance() → number
touches (inferred from the code): reads Cache::Player::Treasury::m_Variants+0x14
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x6b64f0 0x6b6a70
GetWMDMaintenance UI state: PlayerTreasury:GetWMDMaintenance() → number
gameplay state: PlayerTreasury:GetWMDMaintenance() → number
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x6b6540 0x6b6ac0
SetGoldBalance PlayerTreasury:SetGoldBalance(xNewValue: number) (or nothing)
touches (inferred from the code): writes Player::Treasury::m_xGoldBalance; reads Player::Treasury::m_xGoldBalance, Player::Instance::m_id
gameplay yes ↗ 0x6f7a40 0x6f8180