mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-01-29 01:30:04 +00:00
Load item tables + price implementation
This commit is contained in:
@@ -3,8 +3,12 @@
|
||||
#include "CNShardServer.hpp"
|
||||
#include "Player.hpp"
|
||||
|
||||
struct Item {
|
||||
bool tradeable, sellable;
|
||||
int buyPrice, sellPrice, stackSize, level; // TODO: implement more as needed
|
||||
};
|
||||
struct VendorListing {
|
||||
int sort, type, iID, price;
|
||||
int sort, type, iID;
|
||||
};
|
||||
|
||||
namespace ItemManager {
|
||||
@@ -14,6 +18,7 @@ namespace ItemManager {
|
||||
BANK = 3
|
||||
};
|
||||
// hopefully this is fine since it's never modified after load
|
||||
extern std::map<std::pair<int32_t, int32_t>, Item> ItemData; // <id, type> -> data
|
||||
extern std::map<int32_t, std::vector<VendorListing>> VendorTables;
|
||||
|
||||
void init();
|
||||
@@ -36,4 +41,6 @@ namespace ItemManager {
|
||||
void chestOpenHandler(CNSocket* sock, CNPacketData* data);
|
||||
|
||||
int findFreeSlot(Player *plr);
|
||||
bool isItemRegistered(int32_t id, int32_t type);
|
||||
Item getItemData(int32_t id, int32_t type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user