Home › Lua API › CombatManager

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

CombatManager

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

Community reference for this object: CombatManager (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
CanAttackTarget CombatManager.CanAttackTarget(pkAttacker: Unit[const Unit::Instance], pkDefender: Unit[const District::Instance], eCombatType?: integer[CombatTypes]) → boolean
args: eCombatType — Value of the CombatTypes enum (a type index).
gameplay yes ↗ 0x5aa520 0x5ab350
GenerateCombatResults CombatManager.GenerateCombatResults(arg1: Unit, pkUnit: Unit[Unit::Instance], x: integer/Plot, y?: integer) gameplay yes ↗ 0x5aa640 0x5ab470
GetBestDefender CombatManager.GetBestDefender(eAttackingPlayer: Unit[PlayerTypes], x: integer/Plot, y?: integer) → number, number (or nothing)
args: eAttackingPlayer — Id of a player (as in Players[id]).
gameplay yes ↗ 0x5aa930 0x5ab760
GetBestInterceptor CombatManager.GetBestInterceptor(pkAttacker: Unit[const Unit::Instance], x: integer/Plot, y?: integer) → number, number (or nothing) gameplay yes ↗ 0x5aaaa0 0x5ab8d0
IsAttackChangeWarState CombatManager.IsAttackChangeWarState(arg1: Unit, x: integer/Plot, y?: integer, arg4?: integer) → number[]
args: x — Plot x coordinate (plot:GetX()).; y — Plot y coordinate (plot:GetY()).
gameplay yes ↗ 0x5aab90 0x5ab9c0
SimulateAttackInto CombatManager.SimulateAttackInto() ⚠ gameplay yes ↗ 0x5ab950 0x5ac780
SimulateAttackVersus CombatManager.SimulateAttackVersus(arg1: Unit, pkUnit: Unit[Unit::Instance], arg3: number/string[CombatTypes])
args: arg3 — Value of the CombatTypes enum (a type index).
gameplay yes ↗ 0x5ab970 0x5ac7a0
SimulatePriorityAttackInto CombatManager.SimulatePriorityAttackInto() ⚠ gameplay yes ↗ 0x5abe10 0x5acc40