Home › Lua API › Deal

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

Deal

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

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
AddItemOfType Deal:AddItemOfType(arg1: string/number, arg2?: any, arg3?: any, arg4?: any, arg5?: any[HksObject])
args: arg1 — A constant from the Lua table DealItemTypes.; arg2 — Id of a player.; arg3 — Id of a player (the scripts name the argument playerID / owner). (inferred)
touches (inferred from the code): writes Diplomacy::Deal::Instance::m_Items
gameplay — 0x6cdbb0 0x6ce270
ClearItemsByType Deal:ClearItemsByType(arg1?: number, arg2?: number, arg3?: number) (or nothing)
touches (inferred from the code): writes Diplomacy::Deal::Instance::m_Items
gameplay — 0x6cdda0 0x6ce460
ClearItemsByValue Deal:ClearItemsByValue(eFromPlayer?: number, eToPlayer?: number, eType?: number, uiSubType?: number, uiForType?: any[HksObject]) (or nothing)
touches (inferred from the code): writes Diplomacy::Deal::Instance::m_Items
gameplay — 0x6cdfc0 0x6ce680
FindItemByID Deal:FindItemByID(uiID?: number) → DealItem (or nothing)
touches (inferred from the code): reads Diplomacy::Deal::Instance::m_Items
gameplay — 0x6ce100 0x6ce7c0
FindItemByType Deal:FindItemByType(eType: string/number[Types], arg2?: any, arg3?: any, arg4?: any[HksObject]) ⚠
args: eType — A constant from the Lua table DealItemTypes.; arg2 — A constant from the Lua table DealAgreementTypes.; arg3 — Id of a player.
touches (inferred from the code): reads Diplomacy::Deal::Instance::m_Items
gameplay — 0x6ce180 0x6ce840
FindItemByValueType Deal:FindItemByValueType(eType: string/number[Types], arg2?: number, uiForType: string/number, arg4?: any, arg5?: any[HksObject]) → DealItem (or nothing)
args: eType — A constant from the Lua table DealItemTypes.; arg2 — A constant from the Lua table DealItemSubTypes.; arg4 — Id of a player.
touches (inferred from the code): reads Diplomacy::Deal::Instance::m_Items
gameplay — 0x6ce2c0 0x6ce980
FindItemsByType Deal:FindItemsByType(arg1: string/number[Types], arg2?: any, arg3?: any, arg4?: any[HksObject]) → DealItem[] (or nothing) ⚠
args: arg1 — A constant from the Lua table DealItemTypes.; arg2 — A constant from the Lua table DealItemSubTypes.; arg3 — Id of a player.
touches (inferred from the code): reads Diplomacy::Deal::Instance::m_ePlayer1
gameplay — 0x6ce420 0x6ceae0
FindItemsByValueType Deal:FindItemsByValueType(arg1: string/number[Types], arg2?: number, arg3: string/number, arg4?: any, arg5?: any[HksObject]) → DealItem[] (or nothing)
touches (inferred from the code): reads Diplomacy::Deal::Instance::m_ePlayer1
gameplay — 0x6ce5f0 0x6cecb0
GetItemCount Deal:GetItemCount(arg1?: number, arg2?: number, arg3?: number) → number
args: arg1 — Id of a player.; arg2 — Id of a player.
touches (inferred from the code): reads Diplomacy::Deal::Instance::m_Items
gameplay — 0x6ce840 0x6cef00
GetItemParent Deal:GetItemParent(pkChildItem: DealItem) → DealItem (or nothing)
args: pkChildItem — A DealItem object (the scripts pass a variable named pDealItem).
touches (inferred from the code): reads Diplomacy::Deal::Instance::m_Items
gameplay — 0x6cea70 0x6cf130
GetOtherPlayerID Deal:GetOtherPlayerID(ePlayer?: number) → number (PlayerTypes)
touches (inferred from the code): reads Diplomacy::Deal::Instance::m_ePlayer1
returns: Id of a player (as in Players[id]).
gameplay — 0x6ceb30 0x6cf1f0
GetPlayer1ID Deal:GetPlayer1ID() → number
touches (inferred from the code): reads Diplomacy::Deal::Instance::m_ePlayer1
gameplay — 0x6cebb0 0x6cf270
GetPlayer2ID Deal:GetPlayer2ID() → number gameplay — 0x6cec00 0x6cf2c0
HasUnacceptableItems Deal:HasUnacceptableItems() → boolean
touches (inferred from the code): reads Diplomacy::Deal::Instance::m_Items
gameplay — 0x6cec50 0x6cf310
IsDemand Deal:IsDemand() → boolean gameplay — 0x6ceca0 0x6cf360
IsGift Deal:IsGift() → boolean gameplay — 0x6cece0 0x6cf3a0
IsValid Deal:IsValid()
touches (inferred from the code): reads Diplomacy::Deal::Instance::m_ePlayer1, Diplomacy::Deal::Instance::m_Items
gameplay — 0x6ced20 0x6cf3e0
Items Deal.Items() → table, function gameplay — 0x6cee50 0x6cf510
RemoveItem Deal:RemoveItem(uiIndex: DealItem) (or nothing)
args: uiIndex — A string.
touches (inferred from the code): writes Diplomacy::Deal::Instance::m_Items
gameplay — 0x6ceff0 0x6cf6b0
RemoveItemByID Deal:RemoveItemByID(uiID: integer) → boolean
touches (inferred from the code): writes Diplomacy::Deal::Instance::m_Items
gameplay — 0x6cf090 0x6cf750
SetUnacceptableItem Deal:SetUnacceptableItem(index: integer) (or nothing)
touches (inferred from the code): reads Diplomacy::Deal::Instance::m_Items
gameplay — 0x6cf0f0 0x6cf7b0
SetUnacceptableItemByID Deal:SetUnacceptableItemByID(uiID: integer) (or nothing)
touches (inferred from the code): reads Diplomacy::Deal::Instance::m_Items
gameplay — 0x6cf140 0x6cf800
Validate Deal:Validate() → number (Diplomacy::Deal::ValidationResult)
touches (inferred from the code): writes Diplomacy::Deal::Instance::m_Items
gameplay — 0x6cf190 0x6cf850