mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-27 05:23:51 +00:00
feat(repair): DBC-based repair cost estimation and UI display
Calculate repair costs client-side using DurabilityCosts.dbc and DurabilityQuality.dbc. Block repair when player can't afford it and only apply optimistic durability/gold updates when cost is verified. Show repair cost next to the Repair All button in the vendor window.
This commit is contained in:
parent
3dec33ecf1
commit
53244d025c
7 changed files with 160 additions and 14 deletions
|
|
@ -1202,6 +1202,8 @@ void EntityController::updateItemOnValuesUpdate(const UpdateBlock& block,
|
|||
const uint32_t prevDur = it->second.curDurability;
|
||||
it->second.curDurability = val;
|
||||
inventoryChanged = true;
|
||||
LOG_DEBUG("Item durability update: guid=0x", std::hex, block.guid,
|
||||
std::dec, " dur ", prevDur, "->", val, "/", it->second.maxDurability);
|
||||
// Warn once when durability drops below 20% for an equipped item.
|
||||
const uint32_t maxDur = it->second.maxDurability;
|
||||
if (maxDur > 0 && val < maxDur / 5u && prevDur >= maxDur / 5u) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue