-
[Help] How works the durability system in the game (S6)?
Hi,
TL;DR (3 questions)
Why magic equipments have their durability set from the MagicDurability variable whereas non-magic equipments are set from the Durability variable?
Why when I try to repair an magic equipment its base durability is set to 0?
Why magic equipments have their Durability variable set to 0 whereas non-magic equipments have their MagicDurability set to 0?
I'm using the x-team (muemu) server emulator to run a S6 client.
After a lot of tweak in the code I'm facing what I think it is a problem: magic items such as Staffs are being sold in a NPC with 0 durability for items +0 (and 5 durability for items +5, there is a function that calculates the base durability of an item based on the item's level - an item +5 for instance is sold in NPC with durability of 5/40, where 40 is the MagicDurability value). Also when I try to repair any of these items (using both the inventory-repair system or with a NPC like the blacksmith), in the cases when I buy the item from an NPC with some durability, after repairing it becomes 0 durability.
I'm studying in the server code to understand the problem but I think I'm not getting something right here. All functions I found in the server code takes the ITEM_INFO's Durability variable when repairing and when calculating the base durability of the item (the initial durability, not the max durability). However for some odd reason magic items have this variable set to 0 in the item.txt and the max durability is set on the ITEM_INFO's MagicDurability variable.
From what I got, non-magic items have either their base and max durability set from the ITEM_INFO's Durability variable but for some (yet) unknown reason, magic items have their base durability set from ITEM_INFO's Durability variable whereas their max durability is set from the MagicDurability variable. The problem is that converting a fresh (not changed) item.bmd to use in the server, all magic equipments have their Durability set to 0 (which causes the problem described above).
Does anyone have any clue about what is happening here? Please consider that I'm very new to the game and I'm still learning how its little details works.
Thanks in advance.
- - - Updated - - -
Just found the problem (when I was rewriting the item.txt load function I missed something regarding it.
Please ignore this topic.
-