diff --git a/GearSetManager.lua b/GearSetManager.lua new file mode 100644 index 0000000..9121c24 --- /dev/null +++ b/GearSetManager.lua @@ -0,0 +1,52 @@ +GearSetManagerDB = GearSetManagerDB or {} + +local function SaveSet(name) + local gearSet = {} + for i = 1, 19 do + gearSet[i] = GetInventoryItemLink("player", i) + end + GearSetManagerDB[name] = gearSet + print("Gear set '" .. name .. "' saved for " .. UnitName("player") .. ".") +end + +local function LoadSet(name) + local gearSet = GearSetManagerDB[name] + if not gearSet then + print("No gear set named '" .. name .. "'.") + return + end + for i = 1, 19 do + if gearSet[i] then + EquipItemByName(gearSet[i], i) + end + end + print("Gear set '" .. name .. "' equipped.") +end + +local function RemoveSet(name) + GearSetManagerDB[name] = nil + print("Gear set '" .. name .. "' removed.") +end + +local function ListSets() + print("Saved gear sets for " .. UnitName("player") .. ":") + for name, _ in pairs(GearSetManagerDB) do + print("- " .. name) + end +end + +SLASH_GSM1 = "/gsm" +SlashCmdList["GSM"] = function(msg) + local command, rest = msg:match("^(%S*)%s*(.-)$") + if command == "save" and rest ~= "" then + SaveSet(rest) + elseif command == "load" and rest ~= "" then + LoadSet(rest) + elseif command == "remove" and rest ~= "" then + RemoveSet(rest) + elseif command == "list" then + ListSets() + else + print("Usage: /gsm save/load/remove/list [set name]") + end +end diff --git a/GearSetManager.toc b/GearSetManager.toc new file mode 100644 index 0000000..c06bc8e --- /dev/null +++ b/GearSetManager.toc @@ -0,0 +1,6 @@ +## Interface: 11500 +## Title: GearSet Manager +## Notes: Manage and switch gear sets easily. +## Author: HELLFIRE +## SavedVariablesPerCharacter: GearSetManagerDB +GearSetManager.lua \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3261d91 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +# Gear Set Manager for World of Warcraft + +## Overview + +The Gear Set Manager is an addon for World of Warcraft that allows players to save, load, and manage multiple gear sets. This utility simplifies switching between different sets of equipment for various in-game activities. + +## Features + +- **Save Gear Sets:** Save the current equipment of your character under a custom name. +- **Load Gear Sets:** Quickly equip a previously saved set of gear. +- **Remove Gear Sets:** Delete saved gear sets that are no longer needed. +- **List Gear Sets:** View a list of all saved gear sets for your character. + +## Commands + +The addon introduces the following slash commands for easy management of gear sets: + +- `/gsm save [set name]`: Saves your current gear under the specified set name. +- `/gsm load [set name]`: Equips the gear set associated with the specified set name. +- `/gsm remove [set name]`: Removes the specified gear set from your saved sets. +- `/gsm list`: Displays a list of all saved gear sets. + +## Installation + +1. Download the addon file. +2. Extract the contents to your World of Warcraft `Interface/AddOns` directory. +3. Restart World of Warcraft or use the `/reload` command in-game. + +## Usage + +After installation, you can use the slash commands in the game to manage your gear sets. For example, to save your current gear set as "Raid Gear", type `/gsm save Raid Gear` in the chat. You can then load this set anytime using `/gsm load Raid Gear`. + +## Contributing + +Contributions to the Gear Set Manager are welcome. Please submit pull requests or issues through the addon's GitHub repository. + +## License + +This addon is released under the GNU General Public License v3.0 (GPLv3). For more details, see the [GPLv3 License](https://www.gnu.org/licenses/gpl-3.0.en.html). + +## Disclaimer + +This is a third-party addon for World of Warcraft. It is not affiliated with, endorsed, or sponsored by Blizzard Entertainment, Inc. + +--- + +Enjoy managing your gear sets in World of Warcraft!