Advertisement
fr0z3night

zDEAD WoW Addon Edit - WQTips - (Rep Item [Errors]) C&P

Oct 16th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.98 KB | None | 0 0
  1. -- Item Reputation Only, Not Fully Tested, Just making a backup here
  2.  
  3. local addonName
  4. WorldQuestTips = CreateFrame("Frame"), {};
  5.  
  6. local version = 1.25
  7. local versionSuffix = ""
  8.  
  9. local playerName = UnitName("player")
  10. local profileKey = playerName.."-"..GetRealmName()
  11. local gender = UnitSex("player");
  12. local level = UnitLevel("player")
  13. local _,playerClass = UnitClass("player")
  14.  
  15. local debugging
  16.  
  17. local repitems = {
  18.  
  19. -- 7 LEGION EXPANSION
  20.  
  21. -- Argussian Reach (Argus)
  22. ["152954"] = 2170, -- Argussian Reach - BoA - 750
  23. ["152959"] = 2170, -- Argussian Reach - BoP - 250
  24. ["152960"] = 2170, -- Argussian Reach - BoA - 250
  25. ["152961"] = 2170, -- Argussian Reach - BoP - 750
  26. -- 2170, << Argussian Reach Exalted
  27. -- 2167, << Argussian Reach Paragon
  28. -- Army Of The Light (Argus)
  29. ["152955"] = 2165, -- Army Of The Light BoA 750
  30. ["152956"] = 2165, -- Army Of The Light BoA 750
  31. ["152957"] = 2165, -- Army Of The Light BoA 250
  32. ["152958"] = 2165, -- Army Of The Light BoP 250
  33. -- 2165, << Army Of The Light Exalted
  34. -- 2166, << Army Of The Light Paragon
  35. -- Dreamweavers (Val'sharah)
  36. ["139021"] = 1883, -- Dreamweavers - BoP - 250
  37. ["141339"] = 1883, -- Dreamweavers - BoA - 250
  38. ["141988"] = 1883, -- Dreamweavers - BoP - 1500
  39. ["146936"] = 1883, -- Dreamweavers - BoP - 250
  40. ["146942"] = 1883, -- Dreamweavers - BoA - 250
  41. ["147411"] = 1883, -- Dreamweavers - BoP - 1500
  42. ["150926"] = 1883, -- Dreamweavers - BoA - 1500
  43. -- 1883, << Dreamweavers Exalted
  44. -- 2088, << Dreamweavers Paragon
  45. -- Court of Farondis (Aszuna)
  46. ["139023"] = 1900, -- Farondis - BoP - 250
  47. ["141340"] = 1900, -- Farondis - BoA - 250
  48. ["141989"] = 1900, -- Farondis - BoP - 1500
  49. ["146937"] = 1900, -- Farondis - BoP - 250
  50. ["146943"] = 1900, -- Farondis - BoA - 250
  51. ["147410"] = 1900, -- Farondis - BoP - 1500
  52. ["150927"] = 1900, -- Farondis - BoP - 1500
  53. -- 1900, << Farondis Exalted
  54. -- 2087, << Farondis Paragon
  55. -- Highmountain Tribe (Highmountain)
  56. ["139024"] = 1828, -- Highmountain - BoP - 250
  57. ["141341"] = 1828, -- Highmountain - BoA - 250
  58. ["141990"] = 1828, -- Highmountain - BoP - 1500
  59. ["146938"] = 1828, -- Highmountain - BoP - 250
  60. ["146944"] = 1828, -- Highmountain - BoA - 250
  61. ["147412"] = 1828, -- Highmountain - BoP - 1500
  62. ["150928"] = 1828, -- Highmountain - BoA - 1500
  63. -- 1828, << Highmountain Exalted
  64. -- 2085, << Highmountain Paragon
  65. -- Legionfall (Broken Shore)
  66. ["146949"] = 2045, -- Legionfall - BoP - 250
  67. ["146950"] = 2045, -- Legionfall - BoA - 250
  68. ["147727"] = 2045, -- Legionfall - BoP - 750
  69. ["152464"] = 2045, -- Legionfall - BoP - 750
  70. -- 2045, << Legionfall Exalted
  71. -- 2091, << Legionfall Paragon
  72. -- Nightfallen (Suramar)
  73. ["139026"] = 1859, -- Nightfallen - BoP - 250
  74. ["140260"] = 1859, -- Nightfallen - BoP - 25
  75. ["141343"] = 1859, -- Nightfallen - BoA - 250
  76. ["141870"] = 1859, -- Nightfallen - BoP - 100
  77. ["141992"] = 1859, -- Nightfallen - BoP - 750
  78. ["146940"] = 1859, -- Nightfallen - BoP - 250
  79. ["146946"] = 1859, -- Nightfallen - BoA - 250
  80. ["147413"] = 1859, -- Nightfallen - BoP - 750
  81. ["147416"] = 1859, -- Nightfallen - BoP - 100
  82. ["150930"] = 1859, -- Nightfallen - BoA - 750
  83. -- 1859, << Nightfallen Exalted
  84. -- 2089, << Nightfallen Paragon
  85. -- Valarjar (Stormheim)
  86. ["139020"] = 1948, -- Valarjar - BoP - 250
  87. ["141338"] = 1948, -- Valarjar - BoA - 250
  88. ["141987"] = 1948, -- Valarjar - BoP - 1500
  89. ["146935"] = 1948, -- Valarjar - BoP - 250
  90. ["146941"] = 1948, -- Valarjar - BoA - 250
  91. ["147414"] = 1948, -- Valarjar - BoP - 1500
  92. ["150925"] = 1948, -- Valarjar - BoA - 1500
  93. -- 1948, << Valarjar Exalted
  94. -- 2086, << Valarjar Paragon
  95. -- Wardens (Aszuna)
  96. ["139025"] = 1894, -- Wardens - BoP - 250
  97. ["141342"] = 1894, -- Wardens - BoA - 250
  98. ["141991"] = 1894, -- Wardens - BoP - 750
  99. ["141992"] = 1894, -- Wardens - BoP - 750
  100. ["146939"] = 1894, -- Wardens - BoP - 250
  101. ["146945"] = 1894, -- Wardens - BoA - 250
  102. ["147415"] = 1894, -- Wardens - BoP - 1500
  103. ["150929"] = 1894, -- Wardens - BoA - 1500
  104. -- 1894, << Wardens Exalted
  105. -- 2090, << Wardens Paragon
  106. -- All Legion Factions (ALL)
  107. ["153113"] = 1948, -- All Legion Factions - BoA - 1000
  108.  
  109. -- 6 DRAENOR EXPANSION
  110.  
  111. -- Arakkoa Outcasts
  112. ["119136"] = 1515, -- Arakkoa Outcasts Tabard
  113. -- Council of Exarchs
  114. ["119135"] = 1731, -- Council of Exarchs Tabard
  115. -- Frostwolf Orcs (H)
  116. ["119133"] = 1445, -- Frostwolf Tabard
  117. -- Laughing Skull Orcs (H)
  118. ["119138"] = 1708, -- Laughing Skull Orcs Tabard
  119. -- Sha'tari Defense (A)
  120. ["119140"] = 1710, -- Sha'tari Defense Tabard
  121. -- Steamwheedle "Preservation" Society
  122. ["119137"] = 1711, -- Steamwheedle Society Tabard
  123. -- Vol'jin's Spear (H)
  124. ["115518"] = 1681, -- Vol'jin's Spear Tabard
  125. -- Wrynn's Vanguard (A)
  126. ["115517"] = 1682, -- Wrynn's Vanguard Tabard
  127. -- Order of the Awakened
  128. ["128450"] = 1849, -- Order of the Awakened Tabard
  129. -- Saberstalkers
  130. ["128449"] = 1850, -- Saberstalkers Tabard
  131.  
  132. -- 5 PANDARIA EXPANSION
  133.  
  134. -- Racial Tabards
  135. ["83079"] = 1353, -- Tushui Tabard
  136. ["83080"] = 1352, -- Huojin Tabard
  137. -- Shado-Pan, Townlong Steppes
  138. ["89800"] = 1270, -- Shado-Pan Tabard
  139. ["94223"] = 1270, -- Shado-Pan BoA 1000
  140. ["143936"] = 1270, -- Shado-Pan BoA 300
  141. -- Shado-Pan Assault, Raid
  142. ["97131"] = 1435, -- Shado-Pan Assault Tabard
  143. ["95496"] = 1435, -- Shado-Pan Assault BoA 100
  144. ["143945"] = 1341, -- Shado-Pan Assault BoA 300
  145. -- August Celestials
  146. ["89799"] = 1341, -- August Celestials Tabard
  147. ["94225"] = 1341, -- August Celestials BoA 1000
  148. ["143938"] = 1341, -- August Celestials BoA 300
  149. -- Order Of The Cloud Serpent, Jade Forest
  150. ["89796"] = 1271, -- Cloud Serpent Tabard
  151. ["143942"] = 1271, -- Cloud Serpent BoA 300
  152. -- Emperor Shaohao (Timeless Isle)
  153. ["143947"] = 1492, -- Emperor Shaohao BoA 500
  154. -- Tillers, Valley of the Four Winds
  155. ["89784"] = 1272, -- Tillers Tabard
  156. ["143941"] = 1272, -- Tillers BoA 300
  157. -- Tillers (Social), Valley of the Four Winds
  158. ["79266"] = 1282, -- FishFellreed - BoP - ???
  159. -- 1275, -- Ella - BoP - ???
  160. ["79267"] = 1278, -- Sho - BoP - ???
  161. -- 1273, -- Jogu The Drunk - BoP - ???
  162. ["79265"] = 1276, -- Old Hillpaw - BoP - ???
  163. -- 1277, -- Chee Chee - BoP - ???
  164. ["79264"] = 1279, -- Haohan - BoP - ???
  165. -- 1280, -- Tina Mudclaw - BoP - ???
  166. ["79268"] = 1283, -- Farmer Fung - BoP - ???
  167. -- 1281, -- Gina Mudclaw - BoP - ???
  168. -- Klaxxi, Dread Wastes
  169. ["89798"] = 1337, -- Klaxxi Tabard
  170. ["94226"] = 1337, -- Klaxxi - BoA - 1000
  171. ["143935"] = 1337, -- Klaxxi - BoA - 300
  172. -- Lorewalkers
  173. ["89795"] = 1345, -- Lorewalkers Tabard
  174. -- Golden Lotus
  175. ["89797"] = 1269, -- Golden Lotus Tabard
  176. ["94227"] = 1269, -- Golden Lotus BoA 1000
  177. ["90815"] = 1269, -- Golden Lotus BoA ??
  178. ["90816"] = 1269, -- Golden Lotus BoA ??
  179. ["143937"] = 1269, -- Golden Lotus BoA 300
  180. -- Anglers, Krasarang Wilds
  181. ["89401"] = 1302, -- Anglers Tabard
  182. ["143946"] = 1302, -- Anglers BoA 300
  183. -- Kirin Tor Offensive (Alliance)
  184. ["95591"] = 1387, -- Kirin Tor Offensive Tabard
  185. ["95489"] = 1387, -- Kirin Tor Offensive BoA 25
  186. ["95490"] = 1387, -- Kirin Tor Offensive BoA 250
  187. -- Sunreaver Onslaught (Horde)
  188. ["95592"] = 1388, -- Sunreaver Onslaught Tabard
  189. ["95488"] = 1388, -- Sunreaver Onslaught BoA 250
  190. ["95487"] = 1388, -- Sunreaver Onslaught BoA 25
  191. ["143939"] = 1388, -- Sunreaver Onslaught BoA 300
  192.  
  193. ["143943"] = 1375, -- Dominance Offensive BoA 300
  194.  
  195. -- 4 CATACLYSM EXPANSION
  196.  
  197. -- Cataclysm Racial
  198. ["64882"] = 1134, -- Gilneas Tabard
  199. ["64884"] = 1133, -- Bilgewater Cartel Tabard
  200. -- Twilight Highlands
  201. ["65908"] = 1174, -- Wildhammer Clan Tabard
  202. ["133151"] = 1174, -- Wildhammer Clan BoA 500
  203. ["65909"] = 1172, -- Dragonmaw Clan Tabard
  204. ["133150"] = 1172, -- Dragonmaw Clan BoA 500
  205. -- Uldum
  206. ["65904"] = 1173, -- Ramkahen Tabard
  207. ["133154"] = 1173, -- Ramkahen BoA 500
  208. -- Vashjir
  209. ["65905"] = 1135, -- Earthen Ring Tabard
  210. ["133159"] = 1135, -- Earthen Ring BoA 500
  211. -- Mount Hyjal
  212. ["65906"] = 1158, -- Guardians of Hyjal Tabard
  213. ["133152"] = 1158, -- Guardians of Hyjal BoA 500
  214. -- Deepholm
  215. ["65907"] = 1171, -- Therazane Tabard
  216. ["133160"] = 1171, -- Therazane BoA 500
  217. -- Tol Barad
  218. ["63379"] = 1177, -- Baradin's Wardens Tabard
  219. ["63378"] = 1178, -- Hellscream's Reach Tabard
  220.  
  221. -- 3 WRATH EXPANSION
  222.  
  223. -- Argent Crusade
  224. ["43154"] = 1106, -- Argent Crusade Tabard
  225. ["129942"] = 1106, -- Argent Crusade BoA 500
  226. -- Ebon Blade
  227. ["43155"] = 1098, -- Ebon Blade Tabard
  228. ["129941"] = 1098, -- Ebon Blade BoA 500
  229. -- Kirin Tor
  230. ["43157"] = 1090, -- Kirin Tor Tabard
  231. ["129940"] = 1090, -- Kirin Tor BoA 500
  232. -- Sons Of Hodir
  233. ["129943"] = 1119, -- Sons Of Hodir BoA 500
  234. -- Wyrmrest Accord
  235. ["43156"] = 1091, -- Wyrmrest Accord Tabard
  236. ["129944"] = 1091, -- Wyrmrest Accord BoA 500
  237. -- Alliance Vanguard
  238. ["129955"] = 1037, -- Alliance Vanguard BoA 500
  239. -- Horde Expedition
  240. ["129954"] = 1052, -- Horde Expedition BoA 500
  241.  
  242. -- 2 OUTLAND EXPANSION
  243.  
  244. -- Outland Racial (Added in Wrath)
  245. ["45580"] = 930, -- Exodar Tabard
  246. ["45585"] = 911, -- Silvermoon City Tabard
  247. -- Hellfire Peninsula
  248. ["23999"] = 946, -- Honor Hold Tabard
  249. ["129948"] = 946, -- Honor Hold BoA 500
  250. ["24004"] = 947, -- Thrallmar Tabard
  251. ["129947"] = 947, -- Thrallmar BoA 500
  252. -- Zangarmarsh
  253. ["31804"] = 942, -- Cenarion Expedition Tabard
  254. ["129949"] = 942, -- Cenarion Expedition BoA 500
  255. ["31775"] = 970, -- Sporeggar Tabard
  256. -- Terokkar Forest
  257. ["32445"] = 1031, -- Skyguard Tabard
  258. -- Shattrath
  259. ["31779"] = 932, -- Aldor Tabard
  260. ["31780"] = 934, -- Scryers Tabard
  261. ["31778"] = 1011, -- Lower City Tabard
  262. ["129951"] = 1011, -- Lower City BoA 500
  263. ["31781"] = 935, -- Sha'tar Tabard
  264. ["129946"] = 935, -- Sha'tar BoA 500
  265. -- Nagrand
  266. ["31774"] = 978, -- Kurenai Tabard
  267. ["31773"] = 941, -- Mag'har Tabard
  268. ["31776"] = 933, -- Consortium Tabard
  269. ["129945"] = 933, -- Consortium BoA 500
  270. -- Blades Edge Mountain
  271. ["32828"] = 1038, -- Ogri'la Tabard
  272. --
  273. ["31777"] = 989, -- Keepers of Time Tabard
  274. ["129950"] = 989, -- Keepers of Time BoA 500
  275. -- Sunwell Plateau
  276. ["35221"] = 1077, -- Shattered Sun Tabard
  277.  
  278. -- 1 CLASSIC
  279.  
  280. -- Classic Racial (Added in Wrath)
  281. ["45579"] = 69, -- Darnassus Tabard
  282. ["45578"] = 54, -- Gnomeregan Tabard
  283. ["45577"] = 47, -- Ironforge Tabard
  284. ["45574"] = 72, -- Stormwind Tabard
  285. ["45582"] = 530, -- Darkspear Tabard
  286. ["45581"] = 76, -- Orgrimmar Tabard
  287. ["45584"] = 81, -- Thunder Bluff Tabard
  288. ["45583"] = 68, -- Undercity Tabard
  289.  
  290. -- PVP Tabards?
  291. ["20132"] = 509, -- Arathor Battle Tabard
  292. ["20131"] = 510, -- Battle Tabard of the Defilers
  293. }
  294.  
  295.  
  296.  
  297. local function addRepToToolTip( self, factionID )
  298. if WorldQuestTipsData.global.options.showRepOnItems then
  299. local factionName,_,factionStanding,barMin,barMax,value = GetFactionInfoByID( factionID );
  300. barMax = (barMax - barMin)/1000;
  301. local barValue = math.floor( (value - barMin)/100 ) / 10
  302. local factionStandingtext = GetText("FACTION_STANDING_LABEL"..factionStanding, gender);
  303. local colour = "|cff808080"
  304. if factionStanding < 8 then
  305. factionStandingtext = factionStandingtext.." "..barValue.."k /"..barMax.."k"
  306. colour = "|cffffd100"
  307. end
  308. if not ( factionStanding == 8 and not WorldQuestTipsData.global.options.showExalted ) then
  309. _G[ self:GetName().."TextLeft2" ]:SetText( colour..factionStandingtext.."\124r\n".._G[ self:GetName().."TextLeft2" ]:GetText().." ")
  310. end
  311.  
  312. if WorldQuestTipsData.global.options.showAltRepOnItems then
  313. for i = 1, self:NumLines() do
  314. -- if string.find(_G[ self:GetName().."TextLeft"..i ]:GetText(),ITEM_BNETACCOUNTBOUND) and IsAltKeyDown() then
  315. if string.find(_G[ self:GetName().."TextLeft"..i ]:GetText(),ITEM_BNETACCOUNTBOUND) or string.find(_G[ self:GetName().."TextLeft"..i ]:GetText(),ITEM_BIND_TO_BNETACCOUNT) then
  316. for k,v in pairs( WorldQuestTipsData ) do
  317. if k ~= "global" and k ~= "version" and k ~= profileKey then
  318. if v.info and v.info.level > 100 then
  319. local color = RAID_CLASS_COLORS[v.info.class]
  320. local level = ""
  321. if v.info.level < 110 then level = "|cffffffff ("..v.info.level..")" end
  322. -- if not ( string.find( v.reps[ factionID ], "|cff808080" ) and not WorldQuestTipsData.global.options.showExalted ) then
  323. -- self:AddDoubleLine( v.info.name..level, v.reps[factionID], color.r, color.g, color.b )
  324. end
  325. end
  326. end
  327. end
  328. end
  329. end
  330. end
  331. self:Show()
  332. end
  333. --end
  334.  
  335. hooksecurefunc(ItemRefTooltip, "SetHyperlink", function(self, link)
  336. local type, id = string.match(link,"^(%a+):(%d+)")
  337. if type == "item" and repitems[ id ] then
  338. addRepToToolTip( self, repitems[ id ] )
  339. end
  340. end)
  341.  
  342. GameTooltip:HookScript("OnTooltipSetItem", function(self)
  343. local link = select(2, self:GetItem())
  344. if link then
  345. local id = string.match(link, "item:(%d*)")
  346. if id and repitems[ id ] then
  347. addRepToToolTip( self, repitems[ id ] )
  348. end
  349. end
  350. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement