melia
melia copied to clipboard
Add warehouse
Add the ability to store items at a warehouse NPC. Last time I actively played the game, the storage was not shared between characters, but in our implementation this needs to be possible. Ideally, we'll want the system to be so flexible that you could technically open any warehouse at any time. This way we'll be able to add character, account, guild or whatever-else-warehouses.
We have a branch (old/add-warehouse) where work on this was started a couple years ago, but we didn't get very far and the packets in it might also be outdated by now.
Just to make sure our works do not overlap I would like to mention I have basic implementation of warehouse ready. So far I have:
- Open warehouse from anywhere (npc or command)
- Add/Remove items from warehouse
- Items saved to SQL database (created new table for it)
Things I am still working on:
- An issue where the client does not automatically update items retrieved from warehouse. When retrieving items the official behaviour is to receive two CZ_WAREHOUSE_CMD packets (one empty and one with the actual retrieved item) which I don't fully understand why.
- Stackable items in warehouse (currently only single stack items work)
- Warehouse expansion
- Team warehouse (account-wide warehouse)
Gotcha 👍
Basic storage has been finished by now (thanks kenedos), though we don't have team storage yet, nor a complete implementation that is flexible enough to handle arbitrary storages. I think we can consider this issue closed once we at least have team storage.
I experimented a little with using the personal storage for other purposes, and while I ran into some hiccups, the basic functionality is now there. I used that opportunity to add a simplified team storage. Essentially it's a second personal storage that all characters share. With that I'm going to consider this issue completed for the moment, as the most essential storage functions exist now.