Initial commit — WyntrWear v1.2.2 WotLK tabard reminder addon (2009)

This commit is contained in:
2026-04-05 09:26:23 -07:00
commit 3979f0e1ff
8 changed files with 523 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*.DS_Store
Thumbs.db

71
README.md Normal file
View File

@@ -0,0 +1,71 @@
# WyntrWear
A World of Warcraft addon for Wrath of the Lich King (WotLK, patch 3.2). Written in Lua, June 2009.
**Author:** Wyntrfylth of Skywall, `<Vendor Trash>`
---
## What It Does
WyntrWear reminds level 80 characters to equip a tabard when entering a 5-man instance, so you
don't waste a full run accumulating rep with the wrong faction.
On entering an instance it displays in the default chat frame either the name of the tabard you are
wearing, or a warning that you have no tabard equipped. If no tabard is equipped, a UI frame appears
with a checkbox to disable future checks for that character (useful for mains who are already exalted
with everything).
It also tracks reputation earned during the run and reports it when you swap or unequip your tabard.
---
## Commands
| Command | Effect |
|---|---|
| `/ww status` | Reports current tabard and standing with its faction |
| `/ww check` | Re-enables the instance-entry check if you previously disabled it |
| `/wyntrwear` | Same as `/ww` |
---
## Installation
Drop the `WyntrWear/` folder into your `Interface/AddOns/` directory and reload your UI.
**Interface version:** 3.2.0 (30200) — Wrath of the Lich King
---
## Supported Factions
WyntrWear tracks reputation for the five WotLK instance tabard factions:
- Argent Crusade
- Knights of the Ebon Blade
- Kirin Tor
- The Wyrmrest Accord
- Horde Expedition
---
## Files
| File | Purpose |
|---|---|
| `WyntrWear.lua` | All addon logic — event handling, rep tracking, slash commands |
| `WyntrWear.xml` | UI frame definition — the checkbox panel shown on instance entry |
| `WyntrWear.toc` | WoW addon manifest — interface version, metadata, load order |
| `wyntrwear.JPG` | Screenshot — addon UI in-game |
| `ww2.JPG` | Screenshot — rep tracking output in chat frame |
---
## Background
Six level-80 toons. A lot of instancing. A persistent habit of forgetting to swap tabards before
the first pull, then noticing mid-run that Horde Expedition rep had been accumulating instead of
Argent Crusade. WyntrWear was the fix.
Version 1.2.2 archived from the original distribution package.

251
WyntrWear.lua Normal file
View File

@@ -0,0 +1,251 @@
function WyntrWear_OnLoad(frame)
SlashCmdList["WYNTRWEAR"] = WyntrWear_CmdHandler;
SLASH_WYNTRWEAR1 = "/wyntrwear";
SLASH_WYNTRWEAR2 = "/ww";
NEUTRAL_MIN = 0;
NEUTRAL_MAX = 3000;
FRIENDLY_MIN = 3001;
FRIENDLY_MAX = 9000;
HONORED_MIN = 9001;
HONORED_MAX = 21000;
REVERED_MIN = 21001;
REVERED_MAX = 42000;
EXALTED_MIN = 42001;
EXALTED_MAX = 43000;
HORDE_EXPEDITION = "Horde Expedition";
startRep = nil;
totalEarned = nil;
oldTabard = nil;
atExalted = false;
wrathNames = {"Argent Crusade", "Knights of the Ebon Blade", "Kirin Tor", "The Wyrmrest Accord", "Horde Expedition"};
if (IsEquippedItemType("Tabard")) then
tabardName = GetInventoryItemLink("player", GetInventorySlotInfo("TabardSlot"));
else
tabardName = HORDE_EXPEDITION;
end
oldTabard = tabardName;
startRep = getRepData(tabardName, false);
frame:Hide();
frame:RegisterForDrag("leftButton");
frame:RegisterEvent("ADDON_LOADED");
frame:RegisterEvent("PLAYER_ENTERING_WORLD");
frame:RegisterEvent("UNIT_INVENTORY_CHANGED");
DEFAULT_CHAT_FRAME:AddMessage("WyntrWear: wyntrwear loaded...");
end
function processTabardName(tabardName)
local found, _, itemString = string.find(tabardName, "^|c%x+|H(.+)|h%[.*%]");
if (found) then
local linkType, itemID = strsplit(":", itemString);
local itemName = GetItemInfo(itemID);
itemName = string.gsub(itemName, "Tabard", "");
itemName = string.gsub(itemName, "of", "");
itemName = string.gsub(itemName, "the", "");
itemName = string.gsub(itemName, "^%s*(.-)%s*$", "%1"); -- trim()
itemName = string.gsub(itemName, " ", " "); -- eliminate x2 spaces
return itemName;
else
return tabardName;
end
end
function getRepData(tabardName, printRep)
local itemName = tabardName;
local factionIndex = 1;
local lastFactionName = nil;
local repString;
local basePoints;
local demoninator;
local repLevel;
local foundName = false;
local oldTabardIsWrath = false;
local factionColor;
local colorTemplate = "|cff%02x%02x%02x";
local r, g, b;
if (printRep == nil) then printRep = true; end
--DEFAULT_CHAT_FRAME:AddMessage("WWDB: getRepData(" .. tabardName .. ")");
if (tabardName ~= HORDE_EXPEDITION) then
itemName = processTabardName(tabardName);
end
if (oldTabard ~= HORDE_EXPEDITION) then
oldTabard = processTabardName(oldTabard);
end
--DEFAULT_CHAT_FRAME:AddMessage("WWDB: Processed itemName = " .. itemName);
repeat
local name, description, standingId, bottomValue, topValue, earnedValue, atWarWith,
canToggleAtWar, isHeader, isCollapsed, hasRep, isWatched, isChild = GetFactionInfo(factionIndex);
if (name == lastFactionName) then
break;
elseif (name == nil) then
break;
else
lastFactionName = name;
for i = 1, #wrathNames do
if (name == wrathNames[i]) then
foundName = true; -- is this a wotlk faction name?
end
oVal = string.find(wrathNames[i], oldTabard);
if (oVal ~= nil) then
oldTabardIsWrath = true;
end
end
oVal = string.find(name, oldTabard);
if (oVal ~= nil and startRep ~= nil and oldTabardIsWrath) then
totalEarned = earnedValue - startRep;
if (totalEarned ~= nil and totalEarned > 0) then
DEFAULT_CHAT_FRAME:AddMessage("WyntrWear: You earned " .. totalEarned .. " reputation with " .. oldTabard ..".");
end
--DEFAULT_CHAT_FRAME:AddMessage("WWDB: start rep: " .. startRep ..", earnedValue: " .. earnedValue);
else
totalEarned = 0;
end
if (itemName ~= nil and name ~= nil) then
tVal = string.find(name, itemName);
if (tVal ~= nil and foundName) then
--DEFAULT_CHAT_FRAME:AddMessage("earnedValue = " .. earnedValue);
if (earnedValue > EXALTED_MIN) then
repLevel = "exalted";
atExalted = true;
basePoints = earnedValue - REVERED_MAX;
denominator = EXALTED_MAX - EXALTED_MIN;
r = 0.6;
g = 0.2;
b = 0.8;
elseif (earnedValue > REVERED_MIN) then
repLevel = "revered";
basePoints = earnedValue - HONORED_MAX;
denominator = REVERED_MAX - REVERED_MIN;
r = 0.25;
g = 0.4;
b = 0.9;
elseif (earnedValue > HONORED_MIN) then
repLevel = "honored";
basePoints = earnedValue - FRIENDLY_MAX;
denominator = HONORED_MAX - HONORED_MIN
r = 0;
g = 1;
b = 0;
elseif (earnedValue > FRIENDLY_MIN) then
repLevel = "friendly";
basePoints = earnedValue - NEUTRAL_MAX;
denominator = FRIENDLY_MAX - FRIENDLY_MIN;
r = 1;
g = 1;
b = 1;
elseif (earnedValue > NEUTRAL_MIN) then
repLevel = "neutral";
basePoints = earnedValue;
denominator = topvalue;
r = 0.75;
g = 0.75;
b = 0.75;
else
repLevel = "bad";
end
if (repLevel ~= "bad") then
if (printRep) then
repString = string.format("%.2f", tostring((basePoints/denominator)*100));
colorString = format(colorTemplate, r * 255, g * 255, b * 255);
DEFAULT_CHAT_FRAME:AddMessage("WyntrWear: Currently at " .. repString .. "% of " .. colorString .. repLevel .. "|r reputation with " .. name .. ".");
end
return earnedValue, totalEarned;
end
end
else
return; -- error trap: for some reason itemName got zapped to nil...fuggit - return
end
end
factionIndex = factionIndex + 1;
until (factionIndex > 200)
end
function checkRep()
if (startRep == nil) then
startRep = getRepData(tabardName, true);
oldTabard = tabardName;
else
startRep = getRepData(tabardName, true);
oldTabard = tabardName;
end
end
function WyntrWear_OnEvent(frame, event, ...)
if (event == "PLAYER_ENTERING_WORLD") then
if ((UnitLevel("player") > 79) and not wynWearLoad) then
inInstance, instanceType = IsInInstance();
if (instanceType == "party") then
if (not IsEquippedItemType("Tabard")) then
frame:Show();
else -- check to see which tabard is being worn and if it generates rep
tabardName = GetInventoryItemLink("player", GetInventorySlotInfo("TabardSlot"));
local found, _, itemString = string.find(tabardName, "^|c%x+|H(.+)|h%[.*%]");
tabardFaction = strsub(itemString, 15);
end
end
end
if (IsEquippedItemType("Tabard")) then
tabardName = GetInventoryItemLink("player", GetInventorySlotInfo("TabardSlot"));
DEFAULT_CHAT_FRAME:AddMessage("WyntrWear: Wearing: " .. tabardName .. ".");
if (atExalted) then
DEFAULT_CHAT_FRAME:AddMessage("|cffff0000WyntrWear: You are at exalted with this faction and should consider using a different tabard.");
end
else
tabardName = HORDE_EXPEDITION;
DEFAULT_CHAT_FRAME:AddMessage("WyntrWear: Not wearing a tabard.");
end
elseif (event == "ADDON_LOADED") then
if (wynWearLoad == nil) then
wynWearLoad = false;
end
elseif (event == "UNIT_INVENTORY_CHANGED") then
local repEarnedThisTabard = 0;
local newTabard = GetInventoryItemLink("player", GetInventorySlotInfo("TabardSlot"));
if (newTabard ~= tabardName) then -- if this evaluates true - the tabard change triggered the event
atExalted = false;
if (IsEquippedItemType("Tabard")) then
tabardName = newTabard;
DEFAULT_CHAT_FRAME:AddMessage("WyntrWear: Tabard equipped: " .. tabardName);
checkRep();
elseif (UnitLevel("player") > 67 and oldTabard ~= HORDE_EXPEDITION) then
DEFAULT_CHAT_FRAME:AddMessage("WyntrWear: Tabard unequipped.");
tabardName = HORDE_EXPEDITION;
checkRep();
end
end
end
end
function wynCheckBoxFunction()
wynWearLoad = wynCheckBox1:GetChecked();
end
function WyntrWear_CmdHandler(str)
frame = getglobal("wynFrame1");
if (frame) then
if (frame:IsVisible()) then
frame:Hide();
end
end
if (str == "status") then
if (IsEquippedItemType("Tabard")) then
tabardName = GetInventoryItemLink("player", GetInventorySlotInfo("TabardSlot"));
DEFAULT_CHAT_FRAME:AddMessage("WyntrWear: You are wearing " .. tabardName .. ".");
getRepData(tabardName, true);
else
if (UnitLevel("player") > 67) then
DEFAULT_CHAT_FRAME:AddMessage("WyntrWear: You are not wearing a tabard.");
getRepData(HORDE_EXPEDITION, true);
end
end
elseif (str == "check") then
DEFAULT_CHAT_FRAME:AddMessage("WyntrWear check forced for next time you enter an instance.");
wynWearLoad = false;
else
DEFAULT_CHAT_FRAME:AddMessage("WyntrWear: Usage: /{ww}|{wyntrwear} {status}|{check}\nstatus: tells if you are currently wearing a tabard.\ncheck - forces check to be performed upon entering instance.");
end
end

10
WyntrWear.toc Normal file
View File

@@ -0,0 +1,10 @@
## Interface: 30200
## Title: WyntrWear
## Author: Wyntrfylth of Skywall
## Version: 1.0
## Notes: Reminds you, upon entering instance, to equip a tabard.
## eMail: wyntrfylth@me.com
## DefaultState: Disabled
## LoadOnDemand: 0
## SavedVariablesPerCharacter: wynWearLoad
WyntrWear.xml

140
WyntrWear.xml Normal file
View File

@@ -0,0 +1,140 @@
<Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.blizzard.com/wow/ui/">
<Script file="WyntrWear.lua" />
<Frame name="wynFrame1" parent="UIParent" visible="false" toplevel="true" movable="true" enableMouse="true">
<Size>
<AbsDimension x="296" y="173" />
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset x="0" y="0" />
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\DressUpFrame\DressUpBackground-Scourge1" edgeFile="Interface\DialogFrame\UI-DialogBox-Border">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11" />
</BackgroundInsets>
<TileSize>
<AbsValue val="32" />
</TileSize>
<EdgeSize>
<AbsValue val="32" />
</EdgeSize>
</Backdrop>
<Frames>
<Button name="ButtonClose" inherits="UIPanelButtonTemplate" text="Thanks, Wyn!">
<Size>
<AbsDimension x="98" y="30" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="104" y="-88" />
</Anchor>
</Anchors>
<Scripts>
<OnClick>wynFrame1:Hide();</OnClick>
</Scripts>
</Button>
<Button name="$parent_Button1" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-3" y="-3"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<CheckButton name="wynCheckBox1" inherits="UICheckButtonTemplate" text="CheckButton1">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="49" y="-123" />
</Anchor>
</Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString name="FontString3" inherits="GameFontNormal" text="Skip tabard checks for this toon">
<Size>
<AbsDimension x="215" y="20" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="15" y="-7" />
</Anchor>
</Anchors>
<Color r="0" g="0.5" b="0" />
</FontString>
</Layer>
</Layers>
<Scripts>
<OnClick>
wynCheckBoxFunction();
</OnClick>
</Scripts>
</CheckButton>
</Frames>
<Layers>
<Layer level="FANCYHEADER">
<Texture name="wynHeader" file="Interface\DialogFrame\UI-DialogBox-Header">
<Size>
<AbsDimension x="356" y="64"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="12"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString inherits="GameFontNormalLarge" text="WyntrWear 1.0">
<Anchors>
<Anchor point="TOP" relativeTo="wynHeader">
<Offset>
<AbsDimension x="0" y="-14"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
<Layer level="OVERLAY">
<FontString name="FontString1" inherits="GameFontNormal" text="Wyntr sez...">
<Size>
<AbsDimension x="79" y="20" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="19" y="-27" />
</Anchor>
</Anchors>
<Color r="0" g="1" b="0" />
</FontString>
<FontString name="FontString2" inherits="GameFontNormal" text="Put Your Tabard On!">
<Size>
<AbsDimension x="137" y="20" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="80" y="-53" />
</Anchor>
</Anchors>
<Color r="1" g="0" b="0" />
<Shadow>
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
<Color r="0" g="0.25" b="0" />
</Shadow>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
WyntrWear_OnLoad(self);
</OnLoad>
<OnEvent>
WyntrWear_OnEvent(self, event, ...)
</OnEvent>
<OnDragStart>self:StartMoving();</OnDragStart>
<OnDragStop>self:StopMovingOrSizing();</OnDragStop>
</Scripts>
</Frame>
</Ui>

49
readme.txt Normal file
View File

@@ -0,0 +1,49 @@
WyntrWear 1.0
I have, as of this writing, six level-80 toons, all of which are active. With the exception of my
main, Wyntrfylth, all need to gain reputation with the various WotLK factions.
I do a lot of instancing.
I seem to have problems remembering to equip a tabard so as to maximize my reputation farming. At some
point, while progressing through the instance, I'll glance down at the message window and see that I've
been accumulating rep with Horde Expedition.
Joy.
So, I have to wait until I'm out-of-combat and equip the tabard of my factional choice.
Thus, this mod: WyntrWear.
WyntrWear simply checks to see if you have a tabard equipped when you enter an instance, and only checks
for a tabard if your current character is higher than level 79. (80+)
There is a single option presented in the UI as a checkbox which allows you to disable all future tabard
checks for the current toon. (I needed this on my main as he's full of rep.)
If you accidently disable future checks for your toon and you wish to re-enable checks, type:
/ww check
And WyntrWear will resume checking to see if you're wearing a tabard whenever you enter an instance.
Upon entering an instance, WyntWear will display, in the default chat frame, a message consisting of
either the name of the tabard you are wearing, or that you're not wearing a tabard.
------------------------
command line options:
/ww or /wyntrwear
status - if tabard is equipped, display tabard name, otherwise inform that no tabard is equipped.
check - forces frame-ui to be displayed the next time this toon enters an instance.
------------------------
That's it!
Happy Rep Farming!
Wyntrfylth of Skywall
<Vendor Trash>
June 15, 2009

BIN
ww2.JPG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
wyntrwear.JPG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB