- -- ----------------------------
- -- Table structure for storage
- -- ----------------------------
- CREATE TABLE `storage` (
- `owner` int(11) NOT NULL,
- `itemnum` int(11) NOT NULL,
- `itemtype` int(11) NOT NULL,
- `refine` int(11) NOT NULL,
- `durability` int(11) NOT NULL DEFAULT '40',
- `lifespan` int(11) NOT NULL DEFAULT '100',
- `slotnum` int(11) NOT NULL,
- `count` int(11) NOT NULL DEFAULT '1',
- `stats` int(11) NOT NULL DEFAULT '0',
- `socketed` int(11) NOT NULL DEFAULT '0',
- `appraised` int(11) NOT NULL DEFAULT '0',
- `gem` int(11) NOT NULL DEFAULT '0',
- UNIQUE KEY `ow_slot` (`owner`,`slotnum`)
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
And mileage (for mileage storage):
- -- ----------------------------
- -- Table structure for mileage
- -- ----------------------------
- CREATE TABLE `mileage` (
- `owner` int(11) NOT NULL DEFAULT '0',
- `itemnum` int(11) NOT NULL DEFAULT '0',
- `itemtype` int(11) NOT NULL DEFAULT '0',
- `refine` int(11) NOT NULL DEFAULT '0',
- `durability` int(11) NOT NULL DEFAULT '40',
- `lifespan` int(11) NOT NULL DEFAULT '100',
- `slotnum` int(11) NOT NULL DEFAULT '0',
- `count` int(11) NOT NULL DEFAULT '1',
- `stats` int(11) NOT NULL DEFAULT '0',
- `socketed` int(11) NOT NULL DEFAULT '0',
- `appraised` int(11) NOT NULL DEFAULT '0',
- `gem` int(11) NOT NULL DEFAULT '0',
- UNIQUE KEY `ow_slot` (`owner`,`slotnum`)
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
As you can see, it's quite like the same BUT with a unique key on owner and slotnum. SO, all PHP (os whatever) scripts must be VERY careful when adding items to a player's storage (regular or itemmall). All items MUST have a different slotnum number or else MySQL will kick you in the nuts
Just a little note, of course "owner" is the Account ID, not the character ID
Another one, if you can, add the items one after another in itemmall as in this one there can be no gaps between each item (RoseNA requirement). It's done automatically in game (reorganized) but if you can do it...
Edit:
There are 160 slots in storage, and 48 in mileage storage:
- #define MAX_STORAGE 160
- #define MAX_ITEMMALL 48
Name of database changed.