mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-25 16:30:15 +00:00
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:
parent
397185d33c
commit
0a2667aa05
1 changed files with 9 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue