Legion DB2 item durability

Good time of the day!

Since the removal of the item_template table from the world database, it became harder to find information about the items. I’m trying to create an “universal” library for Laravel, which will allow perform many operations requested by the users on the forum, like character boost. However, so far i’m not able to find the procedure of calculation of durability for the item.

Can anyone point me to the formula for calculating it (like get id from that DB2, then go to that DB2, get the value from that field and then use that formula), or maybe there is a DB2 file which already has it’s value established?

I’ve tried to look for it here , however, i don’t quite get how to get the durability value from the DB2 files (well, i’ve no idea where to look for it).

Any help is really appreciated!

The formula used by TC can be found here

https://github.com/TrinityCore/TrinityCore/blob/b49fa9658a436c31ffc40100d5a55bee5a3f861e/src/server/game/Globals/ObjectMgr.cpp#L2515

Disclaimer: I made it all up. It gave me the closest results compared to retail values but I cannot guarantee its 100% blizzlike.

@Shauren thanks alot! I’ve found some materials explaining on how to calculate it on the wowpedia, but your implementation is way better