Welcome to the Browser-Base Game Zone forums!
The Idea Syrnia, Movoda, and Amaranthine all use a system where an item has a random percent chance to break. I don't much like this system. Many online 3D RPG's have a durability system, this is what I am thinking of using.Using a Durability system, every item that is created would have a durability value. So take for example, an Iron Hatchet has a durability of 10,000. Assuming when you chop a log your durability drops by 1, then you can chop 10,000 Logs. As soon as the durability hits 0, the item breaks.Of course, to make the system useful, we would have a way for you to take the item to a smith, tailor etc depending on the item, and have it repaired. However, the durability will slowly drop on the item. Take the above example, the Iron Hatchet. Say it's durability is almost to zero. You take it to a smith and he repairs it. But then, the max Durability of 10,000 would then become something like 9,750. Additionally, the amount that the max durability falls would be determined by the repairers skill level. If you have repaired that Iron Hatchet 39 times, that means the durability would be only 250 if the same skill level smith repaired it. If you went back to him to repair it, he could attempt to repair it but it would be unsuccessful and the item would be permanently broken. If the items durability is 1, and you use it once, it is automatically broken and disappears. When an item is made by a smith, it will have a durability level that is dependent on a random variable and the smiths experience.Each action would make the durability go down 1 point.Implementation Method How I would implement this is I would have a normal item entry. Such as a Iron Hatchet and I would set a max-durability value and a min-durability value. Items created can not exceed the max or min value. Then, when a user creates an item, it will be inserted into the inventory table with the current durability and max durability. With a new item, the durability and max durability would be the same. After each repair, the max durability would go down.
Why would having several durability levels be an issue?
Okay, so say I use your first example with PlayerID, ItemID, and ItemDurability wouldn't this become an issue with tens of thousands of items? Possibly more?
To clarify. Do you have 2 separate tables? One as "template" which describe the item permanent properties and second as "instance" that hold the template id and temporary/individual properties and is given to each player per item? you add min/max durability to templateyou add current durability to instance
player_inventory(playerid mediumint unsigned not null,slot tinyint unsigned not null,item_id mediumint unsigned not null,durability smallint unsigned not null,amount smallint unsigned not null,)