feat: add RepairAllItems for vendor auto-repair addons

RepairAllItems(useGuildBank) sends CMSG_REPAIR_ITEM to repair all
equipped items at the current vendor. Checks CanMerchantRepair before
sending. Optional useGuildBank flag for guild bank repairs.

One of the most commonly needed addon functions — enables auto-repair
addons to fix all gear in a single call when visiting a repair vendor.
This commit is contained in:
Kelsi 2026-03-22 23:32:20 -07:00
parent 397185d33c
commit 0a2667aa05

View file

@ -5062,6 +5062,15 @@ void LuaEngine::registerCoreAPI() {
lua_pushboolean(L, 1); // isCastable
return 4;
}},
// --- Repair ---
{"RepairAllItems", [](lua_State* L) -> int {
auto* gh = getGameHandler(L);
if (gh && gh->getVendorItems().canRepair) {
bool useGuildBank = lua_toboolean(L, 1) != 0;
gh->repairAll(gh->getVendorGuid(), useGuildBank);
}
return 0;
}},
// --- Trade API ---
{"AcceptTrade", [](lua_State* L) -> int {
auto* gh = getGameHandler(L);