1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 16:15:31 +00:00
openmw-tes3mp/components/openmw-mp/NetworkMessages.hpp
Koncord c27351c19e Implement inventory functions
AddItem, RemoveItem, GetItemName, GetItemCount, GetItemHealth, GetInventorySize SendInventory
Example:
```lua
tes3mp.AddItem(pid, "glass dagger", 1, 50)
tes3mp.AddItem(pid, "glass dagger", 1, -1)
tes3mp.SendInventory(pid)
tes3mp.RemoveItem(pid, "glass dagger", 1)
tes3mp.SendInventory(pid)
local invSize = tes3mp.GetInventorySize(pid) - 1
for i = 0, invSize do
    print(("%s %d %d"):format(tes3mp.GetItemName(pid, i), tes3mp.GetItemCount(pid, i), tes3mp.GetItemHealth(pid, i)))
end
```
2016-10-23 02:57:49 +08:00

38 lines
688 B
C++

//
// Created by koncord on 05.01.16.
//
#ifndef OPENMW_NETWORKMESSAGES_HPP
#define OPENMW_NETWORKMESSAGES_HPP
#include <MessageIdentifiers.h>
enum GameMessages
{
ID_GAME_BASE_INFO = ID_USER_PACKET_ENUM+1,
ID_GAME_CHARGEN,
ID_GAME_POS,
ID_GAME_DYNAMICSTATS,
ID_GAME_ATTACK,
ID_USER_MYID,
ID_GAME_EQUIPMENT,
ID_USER_DISCONNECTED,
ID_GAME_DIE,
ID_GAME_RESURRECT,
ID_CHAT_MESSAGE,
ID_GAME_CELL,
ID_GAME_DRAWSTATE,
ID_GAME_ATTRIBUTE,
ID_GAME_SKILL,
ID_GAME_LEVEL,
ID_GAME_CHARCLASS,
ID_HANDSHAKE,
ID_LOADED,
ID_GUI_MESSAGEBOX,
ID_GAME_TIME,
ID_GAME_INVENTORY
};
#endif //OPENMW_NETWORKMESSAGES_HPP