------------------------------------------------------------------------------ -- Whisper Me or Email Me at Seglberg@live.com -- Seglberg (Horde) on Thrall -- -- Thanks to Ephemerality for Helping me with the "Default Watch" Feature ------------------------------------------------------------------------------ RepWatch = LibStub("AceAddon-3.0"):NewAddon("|cffFF9900R|cffFFCC00e|cffFFCC33p|cffFFFF00W|cffFFFF33a|cffFFFF66t|cffFFFF99c|cffFFFFCCh", "AceEvent-3.0", "AceConsole-3.0") -------------------------------------| --This Build's Version Information: | -------------------------------------| RepWatch.Revision = "80" RepWatch.Version = "3.0 Beta (Revision " .. RepWatch.Revision .. ")" -------------------------------------| --Notes Displayed in Addon: | -------------------------------------| RepWatch.Notes = "This is a Developmental Version of RepWatch\n\nIf you are NOT a beta tester for RepWatch please download a stable release version.\n\n\nThis Beta Version Supports:\n>) Championing System for Level 80\n>) Slight Change of Options Menu\n>) Ability to Shut Off Auto-off Messages Only\n>) Ability to have Default Faction automatically change depending on Championing Tabard\n\nIn Next Update:\n>) RepWatch Will NO Longer Move the Map to the Current Zone when Looking at it. This useage of the map by RepWatch got annoying if you were looking at the map while doing something such as taking a flight path" --RepWatch.Notes = "This Version Works for |cff6495EDWrath of the Lich King|r.\n\nSupport for more locations are constantly being added!\nCheck for Updates Often\n\n\n|cff6495EDEnjoy Wrath of the Lich King Release!|r\n\n\n|cffff0000Beta Testers Needed!|r" RepWatch.VersionDesc = "\n\n\n\n\n|cffFF9900[R|cffFFCC00e|cffFFCC33p|cffFFFF00W|cffFFFF33a|cffFFFF66t|cffFFFF99c|cffFFFFCCh|r]|cffFF8C00 Version: " .. RepWatch.Version .. "\nAuthor: Seglberg (Horde) of Thrall|r" -------------------------------------| --Determines Client's TOC Version local tocVersion = select(4, GetBuildInfo()) --#############-- --# Functions #-- --#############-- ------------------------------------- function RepWatch:OnInitialize() ------------------------------------- --Called When the Addon is Loaded --Determines Information about the Player RepWatch.playerLevel = UnitLevel("player") RepWatch.playerFaction = UnitFactionGroup("player") --Initally sets tabardFaction to None to bypass error when Options originally load RepWatch.tabardFaction = "None" --Register the Database RepWatch.db = LibStub("AceDB-3.0"):New("RepWatchDB", RepWatch:GetDefaults(), "Char") --Register Options Table and Menu LibStub("AceConfig-3.0"):RegisterOptionsTable("RepWatch", RepWatch:GetOptions()) --Adds Menu to Blizzard's Menu self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("RepWatch", "RepWatch") --Register the /RepWatch Chat Command self:RegisterChatCommand("RepWatch", "ChatCommand") end ------------------------------------- ------------------------------------- ------------------------------------- function RepWatch:OnEnable() ------------------------------------- --Called When the Addon is Enabled --Register Event Triggers RepWatch:RegisterEvent("ZONE_CHANGED_NEW_AREA") --Fires everytime Channels Switch RepWatch:RegisterEvent("ZONE_CHANGED") --Fires everytime Subzones Switch RepWatch:RegisterEvent("ZONE_CHANGED_INDOORS") --Fires everytime subzones changes in a city RepWatch:RegisterEvent("PLAYER_LOGIN") --Fires everytime the Player logs on RepWatch:RegisterEvent("UNIT_INVENTORY_CHANGED") --Fires everytime a unit's inventory changes --Print off Version and Enable Message print("|cffFF9900R|cffFFCC00e|cffFFCC33p|cffFFFF00W|cffFFFF33a|cffFFFF66t|cffFFFF99c|cffFFFFCCh|r v." .. RepWatch.Version .. " Loaded. Author: Seglberg.") self:Print("Type /RepWatch for Options Menu") self:Print("Please Report Bugs at: |cffCDCD00seglberg@live.com|r") RepWatch.itemLink = GetInventoryItemLink("player", 19) RepWatch.tabardName = GetItemInfo(RepWatch.itemLink) RepWatch.currentTabard = RepWatch.tabardName RepWatch.tabardFaction = wrathTabards[RepWatch.tabardName] LibStub("AceConfig-3.0"):RegisterOptionsTable("RepWatch", RepWatch:GetOptions()) RepWatch:wrathTables() --RepWatch:SetdisplayAutooff() end ------------------------------------- ------------------------------------- ------------------------------------- function RepWatch:OnDisable() ------------------------------------- --called when the Addon is Disabled end ------------------------------------- ------------------------------------- ------------------------------------- function RepWatch:ChatCommand(input) ------------------------------------- PlaySound("AuctionWindowOpen") --Handles chat command input if not input or input:trim() == "" then print("|cffFF9900R|cffFFCC00e|cffFFCC33p|cffFFFF00W|cffFFFF33a|cffFFFF66t|cffFFFF99c|cffFFFFCCh|r v." .. RepWatch.Version, "|rOptions Opened") --Options Menu is Opened Differently Depending on if Client Build is 3.0 or Not if tocVersion >= 30000 then --RepWatch:Print("Build is WoTLK") --Debug Line InterfaceOptionsFrame_OpenToCategory(self.optionsFrame) else --RepWatch:Print("Build is NOT WoTLK") --Debug Line InterfaceOptionsFrame_OpenToFrame(self.optionsFrame) end else --LibStub("AceConfigDialog-3.0").HandleCommand(RepWatch, "RepWatch", input) RepWatch:Print("Command Not Available, type /RepWatch for Options Menu") --InterfaceOptionsFrame_OpenToFrame(self.optionsFrame) end end ------------------------------------- ------------------------------------- ------------------------------------- function RepWatch:UNIT_INVENTORY_CHANGED() ------------------------------------- RepWatch.itemLink = GetInventoryItemLink("player", 19) RepWatch.tabardName = GetItemInfo(RepWatch.itemLink) RepWatch.tabardFaction = wrathTabards[RepWatch.tabardName] if (RepWatch.tabardName ~= RepWatch.currentTabard) then LibStub("AceConfig-3.0"):RegisterOptionsTable("RepWatch", RepWatch:GetOptions()) RepWatch:wrathTables() RepWatch:ZONE_CHANGED() RepWatch.fromTabardChange = true RepWatch:SetdefaultFaction() RepWatch.fromTabardChange = false RepWatch.currentTabard = RepWatch.tabardName end end ------------------------------------- function RepWatch:PLAYER_LOGIN() ------------------------------------- --RepWatch:ZONE_CHANGED_NEW_AREA() end ------------------------------------- function RepWatch:UPDATE_FACTION() ------------------------------------- --RepWatch:Print("Update Faction Fired") --Debug Line RepWatch:ZONE_CHANGED_NEW_AREA() RepWatch:UnregisterEvent("UPDATE_FACTION") end ------------------------------------- function RepWatch:ZONE_CHANGED_INDOORS() ------------------------------------- --RepWatch.Print("Zone Changed Indoors Fired") RepWatch:ZONE_CHANGED_NEW_AREA() end ------------------------------------- function RepWatch:ZONE_CHANGED() ------------------------------------- --RepWatch.Print("Zone Changed Fired") RepWatch:ZONE_CHANGED_NEW_AREA() end ------------------------------------- function RepWatch:ZONE_CHANGED_NEW_AREA() ------------------------------------- RepWatch:wrathTables() --Variables RepWatch.cCode = 0 RepWatch.zoneFound = 0 RepWatch.subZoneFound = 0 RepWatch.noDisplay = 0 RepWatch.currentWatched = GetWatchedFactionInfo() --RepWatch:Print("Current Watched:",RepWatch.currentWatched) --Debug Line -- RepWatch.cCode Variable Legend -- -1 :: BG Map -- 0 :: World Map/ No Map -- 1 :: Kalimador -- 2 :: Eastern Kingdoms -- 3 :: Outland -- 4 :: Northrend SetMapToCurrentZone() RepWatch.cCode = GetCurrentMapContinent() if (RepWatch.cCode == -1) then RepWatch.zoneFound = 0 RepWatch.noDisplay = 0 --RepWatch.Print("RepWatch Debug","Change in a Battleground") --Debug Line ------|Warsong Gulch|------ if (self.db.char.battlegroundWSG) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = BGWSG RepWatch.zoneFound = RepWatch:ChangeBGRep(tableName) self.colorCode = "|cffFF6347" end ------|Arathi Basin|------ if (self.db.char.battlegroundAB) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = BGAB RepWatch.zoneFound = RepWatch:ChangeBGRep(tableName) self.colorCode = "|cffFF6347" end ------|Alterac Valley|------ if (self.db.char.battlegroundAV) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = BGAV RepWatch.zoneFound = RepWatch:ChangeBGRep(tableName) self.colorCode = "|cffFF6347" end --Code Below is Temporary! ----|REMOVE ONCE BLIZZARD FIXES THEIR INTERNAL CODE|---- if (self.db.char.wrathDalaran) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = RepWatch.WrathDalaranCity RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cff63B8FF" end end if (self.db.char.wrathDalaranFaction) and (RepWatch.subZoneFound == 0) then tableName = WrathDalaranReps RepWatch.subZoneFound = RepWatch:ChangeSubRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cff63B8FF" end end ----|REMOVE ONCE BLIZZARD FIXES THEIR INTERNAL CODE|---- elseif (RepWatch.cCode == 1) then RepWatch.zoneFound = 0 RepWatch.noDisplay = 0 --RepWatch.Print("RepWatch Debug","Change in Kalimador") -----|Classic City 1|----- if (self.db.char.classicCity1) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = ClassicCity1 RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cffF4A460" end end -----|Classic City 2|----- if (self.db.char.classicCity2) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = ClassicCity2 RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cffF4A460" end end -----|Classic City 3|----- if (self.db.char.classicCity3) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = ClassicCity3 RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cffF4A460" end end -----|Burning Crusade City|------ if (self.db.char.bcCity) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = BCCity RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cffADFF2F" end end -----|Classic Subzones|----- if (self.db.char.classicSubzones) and (RepWatch.subZoneFound == 0) then tableName = ClassicSubzones RepWatch.subZoneFound = RepWatch:ChangeSubRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cffF4A460" end end -----|Classic Minor Cities|----- if (self.db.char.classicCities) and (RepWatch.subZoneFound == 0) then tableName = ClassicCities RepWatch.subZoneFound = RepWatch:ChangeSubRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cffF4A460" end end -----|Classic Instances|----- if (self.db.char.classicInstances) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = ClassicInstances RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cffF4A460" end end -----|Burning Crusade Subzones|----- if (self.db.char.bcSubzones) and (RepWatch.subZoneFound == 0) then tableName = BCSubzones RepWatch.subZoneFound = RepWatch:ChangeSubRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cffADFF2F" end end -----|Burning Crusade Minor Cities|----- if (self.db.char.bcCities) and (RepWatch.subZoneFound == 0) then tableName = BCCities RepWatch.subZoneFound = RepWatch:ChangeSubRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cffADFF2F" end end -----|Burning Crusade Instances|----- if (self.db.char.bcInstances) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = BCInstances RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cffADFF2F" end end -----|WotlK Instances|----- if (self.db.char.wrathInstances) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = WrathInstances RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cff63B8FF" end end elseif (RepWatch.cCode == 2) then RepWatch.zoneFound = 0 RepWatch.noDisplay = 0 --RepWatch.Print("RepWatch Debug","Change in Eastern Kingdoms") -----|Wrath Minor Cities|----- if (self.db.char.wrathCities) and (RepWatch.subZoneFound == 0) then tableName = WrathCities RepWatch.subZoneFound = RepWatch:ChangeSubRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cff63B8FF" end end -----|Classic City 1|----- if (self.db.char.classicCity1) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = ClassicCity1 RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cffF4A460" end end -----|Classic City 2|----- if (self.db.char.classicCity2) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = ClassicCity2 RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cffF4A460" end end -----|Classic City 3|----- if (self.db.char.classicCity3) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = ClassicCity3 RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cffF4A460" end end -----|Burning Crusade City|------ if (self.db.char.bcCity) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = BCCity RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cffADFF2F" end end -----|Classic Subzones|----- if (self.db.char.classicSubzones) and (RepWatch.subZoneFound == 0) then tableName = ClassicSubzones RepWatch.subZoneFound = RepWatch:ChangeSubRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cffF4A460" end end -----|Classic Minor Cities|----- if (self.db.char.classicCities) and (RepWatch.subZoneFound == 0) then tableName = ClassicCities RepWatch.subZoneFound = RepWatch:ChangeSubRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cffF4A460" end end -----|Classic Instances|----- if (self.db.char.classicInstances) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = ClassicInstances RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cffF4A460" end end -----|Burning Crusade Subzones|----- if (self.db.char.bcSubzones) and (RepWatch.subZoneFound == 0) then tableName = BCSubzones RepWatch.subZoneFound = RepWatch:ChangeSubRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cffADFF2F" end end -----|Burning Crusade Minor Cities|----- if (self.db.char.bcCities) and (RepWatch.subZoneFound == 0) then tableName = BCCities RepWatch.subZoneFound = RepWatch:ChangeSubRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cffADFF2F" end end -----|Burning Crusade Instances|----- if (self.db.char.bcInstances) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = BCInstances RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cffADFF2F" end end -----|WotlK Instances|----- if (self.db.char.wrathInstances) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = WrathInstances RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cff63B8FF" end end elseif (RepWatch.cCode == 3) then RepWatch.zoneFound = 0 RepWatch.noDisplay = 0 --RepWatch.Print("RepWatch Debug","Change in Outland") -----|Burning Crusade Shattrath City|----- if (self.db.char.bcShatt) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = BCShattrath RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cffADFF2F" end end -----|Burning Crusade Shattrath Reputations|----- if (self.db.char.bcShatt) and (RepWatch.subZoneFound == 0) then tableName = BCShattrathReps RepWatch.subZoneFound = RepWatch:ChangeSubRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cffADFF2F" end end -----|Burning Crusade Subzones|----- if (self.db.char.bcSubzones) and (RepWatch.subZoneFound == 0) then tableName = BCSubzones RepWatch.subZoneFound = RepWatch:ChangeSubRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cffADFF2F" end end -----|Burning Crusade Minor Cities|----- if (self.db.char.bcCities) and (RepWatch.subZoneFound == 0) then tableName = BCCities RepWatch.subZoneFound = RepWatch:ChangeSubRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cffADFF2F" end end -----|Burning Crusade Instances|----- if (self.db.char.bcInstances) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = BCInstances RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cffADFF2F" end end else --RepWatch.Print("RepWatch Debug","Change in Northrend") --Debug Line -----|WotlK Subzones|----- if (self.db.char.wrathSubzones) and (RepWatch.subZoneFound == 0) then tableName = WrathSubzones RepWatch.subZoneFound = RepWatch:ChangeSubRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cff63B8FF" end end -----|WotlK Minor Cities|----- if (self.db.char.wrathCities) and (RepWatch.subZoneFound == 0) then tableName = WrathCities RepWatch.subZoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cff63B8FF" end end -----|WotlK Dalaran City|----- if (self.db.char.wrathDalaran) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = WrathDalaranCity RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cff63B8FF" end end -----|WotlK Dalaran City Reputations|----- if (self.db.char.wrathDalaranFaction) and (RepWatch.subZoneFound == 0) then tableName = WrathDalaranReps RepWatch.subZoneFound = RepWatch:ChangeSubRep(tableName) if (RepWatch.subZoneFound == 1) then self.colorCode = "|cff63B8FF" end end -----|WotlK Instances|----- if (self.db.char.wrathInstances) and (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then tableName = WrathInstances RepWatch.zoneFound = RepWatch:ChangeRep(tableName) if (RepWatch.zoneFound == 1) then self.colorCode = "|cff63B8FF" end end end --Checks the showInChat Option for Display --Checks to make sure Display isnt shown for a Faction that is already being watched --RepWatch:Print("Value Checks:\ncurrentWatched:",RepWatch.currentWatched,"\nfactionName:",RepWatch.factionName) --Debug Line if (self.db.char.showDisplay == false) or (RepWatch.currentWatched == RepWatch.factionName) then --RepWatch:Print("Setting noDisplay to 1") --Debug Line RepWatch.noDisplay = 1 end if (RepWatch.zoneFound == 0) and (RepWatch.subZoneFound == 0) then -- Registers Update Faction Which: -- Since No Faction Was Found with the Area waits for a New Faction to be Discovered and then Tries to Switch to that Faction -- Once a Faction has been found the Event is Unregistered to stop any interference with Normal RepWatch actions. -- Default Watch will still take place however if a Faction is discovered it will have higher presidence than Default Watch. -- -- Example: Character Enters "Vengeance Landing" for the First Time however the addon cannot switch the Rep Bar because The Hand of Vengeance -- Is not a Valid Faction for that Character Yet. Once the Character talks to an NPC and discovers that Faction the Reputation Bar will then -- Change to The Hand of Vengeance. RepWatch:RegisterEvent("UPDATE_FACTION") --RepWatch:Print("Registered UPDATE_FACTION") --Debug Line self.usedDefault = 1 --RepWatch:Print("Value of Default Faction: " .. RepWatch.db.char.defaultFaction) --Debug Line if (GetWatchedFactionInfo() == GetFactionInfo(RepWatch.db.char.defaultFaction - 2)) then --RepWatch:Print("Setting noDisplay to 1 (inside defaultWatch)") --Debug Line RepWatch.noDisplay = 1 end if (GetWatchedFactionInfo() == nil) and (self.db.char.defaultFaction == 1) then RepWatch.noDisplay = 1 end if (self.db.char.defaultFaction == 1) then SetWatchedFactionIndex(0) if (RepWatch.noDisplay ~= 1) and (RepWatch.db.char.displayAutoOff) then RepWatch:Print("Auto-Off") end elseif (self.db.char.defaultFaction ~= 2) then SetWatchedFactionIndex(self.db.char.defaultFaction - 2) if (RepWatch.noDisplay ~= 1) then self:Print("Changing To: [|cffFFD700" .. GetFactionInfo(self.db.char.defaultFaction - 2) .. "|r]") end end end --RepWatch:Print("Value Check on noDisplay:",RepWatch.noDisplay) --Debug Line if (RepWatch.noDisplay == 0) then if (RepWatch.zoneFound == 1) or (RepWatch.subZoneFound == 1) then self:Print("Changing To: [" .. self.colorCode .. RepWatch.factionName .. "|r]") end end RepWatch.initialLogin = 0 end ------------------------------------- ------------------------------------- ------------------------------------- function RepWatch:ChangeRep(tableName) ------------------------------------- --RepWatch:Print(tableName) --RepWatch:Print(tableName[GetRealZoneText()]) --Debug Line --Sets the Watched Faction using Real Zone Text for factionIndex = 1, GetNumFactions() do RepWatch.factionName = GetFactionInfo(factionIndex) --RepWatch:Print(RepWatch.factionName) if RepWatch.factionName == tableName[GetRealZoneText()] then if (select(6, GetFactionInfo(factionIndex)) == 42999) then if (self.db.char.changeExalted) then SetWatchedFactionIndex(factionIndex) else return (0) end else SetWatchedFactionIndex(factionIndex) end return (1) end end --[[MOVE TO SEPERATE FUNCTION]]-- --Sets the Watched Faction using Real Zone Text but with a internal table for WoTLK instances to determine if it is Heroic or Regular difficulty for factionIndex = 1, GetNumFactions() do RepWatch.factionName = GetFactionInfo(factionIndex) --RepWatch:Print(RepWatch.factionName) if (WrathInstances[GetRealZoneText()] ~= nil) then if RepWatch.factionName == WrathInstances[GetRealZoneText()][GetCurrentDungeonDifficulty()] then if (select(6, GetFactionInfo(factionIndex)) == 42999) then if (self.db.char.changeExalted) then SetWatchedFactionIndex(factionIndex) else return (0) end else SetWatchedFactionIndex(factionIndex) end return (1) end end end --Sets the Watched Faction using Minimap Zone Text for factionIndex = 1, GetNumFactions() do RepWatch.factionName = GetFactionInfo(factionIndex) if RepWatch.factionName == tableName[GetMinimapZoneText()] then if (select(6, GetFactionInfo(factionIndex)) == 42999) then if (self.db.char.changeExalted) then SetWatchedFactionIndex(factionIndex) else return (0) end else SetWatchedFactionIndex(factionIndex) end return (1) end end return (0) end ------------------------------------- ------------------------------------- ------------------------------------- function RepWatch:ChangeBGRep(tableName) ------------------------------------- --RepWatch:Print("Table Name:", tableName) --Sets the Watched Faction for factionIndex = 1, GetNumFactions() do RepWatch.factionName = GetFactionInfo(factionIndex) if RepWatch.factionName == tableName[UnitFactionGroup("player")][GetRealZoneText()] then if (select(6, GetFactionInfo(factionIndex)) == 42999) then self.isExalted = 1 if (self.db.char.changeExalted) then SetWatchedFactionIndex(factionIndex) else return (0) end else SetWatchedFactionIndex(factionIndex) end return (1) end end return (0) end ------------------------------------- ------------------------------------- ------------------------------------- function RepWatch:ChangeSubRep(tableName) ------------------------------------- --Sets the Watched Faction using Real Zone Text for factionIndex = 1, GetNumFactions() do RepWatch.subfactionName = GetFactionInfo(factionIndex) if RepWatch.subfactionName == tableName[GetRealZoneText()] then RepWatch.factionName = RepWatch.subfactionName if (select(6, GetFactionInfo(factionIndex)) == 42999) then self.isExalted = 1 if (self.db.char.changeExalted) then SetWatchedFactionIndex(factionIndex) else return (0) end else SetWatchedFactionIndex(factionIndex) end return (1) end end --Sets the Watched Faction using Sub Zone Text for factionIndex = 1, GetNumFactions() do RepWatch.factionName2 = GetFactionInfo(factionIndex) if RepWatch.factionName2 == tableName[GetSubZoneText()] then RepWatch.noDisplay = 0 if (GetWatchedFactionInfo() == tableName[GetSubZoneText()]) then RepWatch.noDisplay = 1 end RepWatch.factionName = RepWatch.factionName2 if (select(6, GetFactionInfo(factionIndex)) == 42999) then self.isExalted = 1 if (self.db.char.changeExalted) then SetWatchedFactionIndex(factionIndex) else return (0) end else SetWatchedFactionIndex(factionIndex) end return (1) end end return (0) end ------------------------------------- ------------------------------------- ------------------------------------- local function Main() ------------------------------------- --[[ START WORKING ON MOVING EVERYTHING TO A MAIN FUNCTION ]]-- end ------------------------------------- -------------------------------------