View Single Post
Author Message
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-12-2016 , 19:15   Sven Co-op 5.0 gamedata thread
Reply With Quote #1

For SC 5.0 to be supported properly in AMXX, I think it would be a good idea to create a thread (just like this one) where we gather all game data, and once enough is gathered, update AMXX with all our findings. This includes private data offsets, network messages information, hamdata, useful signatures for Okapi/Orpheu, etc...


I had some fun today in IDA and successfully pulled out a lot of useful information regarding CItemInventory. My main goal for this update is to find ways to control the new item inventory system through AMXX plugins.
What I have currently are some private data offsets of CItemInventory (item_inventory) and I've analyzed two messages that come with it, InvAdd and InvRemove.

I didn't have real names for these offsets so I named them myself following the naming convention that Valve mostly uses.
Updated, uses real names now - everything that's exposed to AngelScript. Every offset is byte-aligned, so divide then by 4 for use in some natives, like get_pdata_int().
Spoiler

What these do can be found in: https://sites.google.com/site/svenma...item_inventory

InvAdd arguments go as:
Code:
Long (item_inventory index)
Byte (m_fHolderCanDrop)
Byte (m_fHolderKeepOnRespawn)
Byte (m_flWeight & 0xFF)
Byte ((m_flWeight >> 8) & 0xFF)
Byte ((m_flWeight >> 16) & 0xFF)
Byte ((m_flWeight >> 24)
String (m_pszItemName)
String (m_pszDisplayName)
String (m_pszDescription)
String (pev->model)
and InvRemove:
Code:
Long (item_inventory index)
Byte (true on respawn, false otherwise)
Also, there seems to be this kind of structure:
Code:
InventoryList
{
	CItemInventory* pItem;
	InventoryList* pNext;
}
and there seems to be a pointer to it (InventoryList*) at CBaseMonster + 320(80). This would be useful for finding out what items a player has in their inventory.

Your turn now!

Last edited by klippy; 10-18-2016 at 07:54.
klippy is offline