Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.83 KB | None | 0 0
  1. if UnitClass("player") == "Warrior" then
  2.  
  3. local version = 2.2
  4.  
  5. function WHUD_Variables_Init()
  6. WHUD_RegisterEvent("ACTIONBAR_SLOT_CHANGED")
  7. WHUD_UPDATE_SPELLINFO()
  8. end
  9.  
  10. WHUD_DEFAULT_VARS = {
  11. VERSION = version,
  12. Ragebar = {
  13. enabled = true,
  14. X = 0,
  15. Y = -100,
  16. scale = 1,
  17. strata = "HIGH",
  18. transparency = 1,
  19. fontsize = 25,
  20. texture = "ragebar1",
  21. font = "Fishfingers",
  22. },
  23. Cooldowns = {
  24. enabled = true,
  25. X = 0,
  26. Y = -50,
  27. scale = 1,
  28. strata = "HIGH",
  29. transparency = 1,
  30. flashtime = 2,
  31. fading = true,
  32. fadetime = 2,
  33. trinkets = true,
  34. racials = true,
  35. },
  36. Overpower = {
  37. enabled = true,
  38. X = 0,
  39. Y = 50,
  40. scale = 1,
  41. strata = "HIGH",
  42. transparency = 1,
  43. MSG = "USE OVERPOWER NOW",
  44. mode = "text",
  45. pve = true,
  46. font = "Fishfingers",
  47. timerfont = "Fishfingers",
  48. },
  49. Alerts = {
  50. enabled = true,
  51. X = 0,
  52. Y = 120,
  53. scale = 1,
  54. strata = "HIGH",
  55. transparency = 1,
  56. fontsize = 33,
  57. font = "Fishfingers",
  58. -- MODE
  59. ["Battleshout"] = true,
  60. ["Weightstone"] = true,
  61. ["Salvation"] = true,
  62. ["Execute"] = true,
  63. },
  64. Glow = {
  65. ["Overpower"] = true,
  66. ["Execute"] = true,
  67. ["Battleshout"] = true,
  68. },
  69. Options = {
  70. X = 0,
  71. Y = 400,
  72. },
  73. }
  74. WHUD_IMPORTANTSPELLS = {
  75. "Bloodthirst",
  76. "Whirlwind",
  77. "Intercept",
  78. "Charge",
  79. "Disarm",
  80. "Mocking Blow",
  81. "Bloodrage",
  82. "Retaliation",
  83. "Shield Wall",
  84. "Recklessness",
  85. "Death Wish",
  86. "Shield Block",
  87. "Berserker Rage",
  88. "Intimidating Shout",
  89. "Challenging Shout",
  90. "Taunt",
  91. "Mortal Strike",
  92. "Shield Slam",
  93. -- RACIALS
  94. "War Stomp",
  95. "Blood Fury",
  96. "Will of the Forsaken",
  97. "Berserking",
  98. "Escape Artist",
  99. "Shadowmeld",
  100. "Stone Form",
  101. -- ALERT
  102. "Battle Shout",
  103. }
  104. WHUD_RACIALS = {
  105. "War Stomp",
  106. "Blood Fury",
  107. "Will of the Forsaken",
  108. "Berserking",
  109. "Escape Artist",
  110. "Shadowmeld",
  111. "Stone Form",
  112. }
  113. WHUD_SPELLINFO = {}
  114. WHUD_SPELLS = {}
  115. for i=1,table.getn(WHUD_IMPORTANTSPELLS) do
  116. WHUD_SPELLINFO[WHUD_IMPORTANTSPELLS[i]] = {1,0,0} -- default value for the important spells
  117. WHUD_SPELLS[table.getn(WHUD_SPELLS)+1] = WHUD_IMPORTANTSPELLS[i]
  118. if i == table.getn(WHUD_IMPORTANTSPELLS) then
  119. WHUD_SPELLINFO["Trinket1"] = {0,0,0} WHUD_SPELLINFO["Trinket2"] = {0,0,0} -- default values for the trinkets
  120. WHUD_SPELLINFO["Overpower"] = {1,0,0} WHUD_SPELLS[table.getn(WHUD_SPELLS)+1] = "Overpower"
  121. WHUD_SPELLINFO["Revenge"] = {1,0,0} WHUD_SPELLS[table.getn(WHUD_SPELLS)+1] = "Revenge"
  122. WHUD_SPELLINFO["Pummel"] = {1,0,0} WHUD_SPELLS[table.getn(WHUD_SPELLS)+1] = "Pummel"
  123. WHUD_SPELLINFO["Shield Bash"] = {1,0,0} WHUD_SPELLS[table.getn(WHUD_SPELLS)+1] = "Shield Bash"
  124. WHUD_SPELLINFO["Execute"] = {1,0,0} WHUD_SPELLS[table.getn(WHUD_SPELLS)+1] = "Execute"
  125. end
  126. end
  127.  
  128. function WHUD_Variables_Update()
  129. if WHUD_VARS.VERSION < version then
  130. if WHUD_VARS.VERSION < 1.5 then
  131. if WHUD_VARS.Overpower.mode == nil then
  132. WHUD_VARS.Overpower.mode = "text"
  133. end
  134. end
  135. if WHUD_VARS.VERSION < 1.6 then
  136. if WHUD_VARS.Cooldowns.trinkets == nil then
  137. WHUD_VARS.Cooldowns.trinkets = true
  138. end
  139. end
  140. if WHUD_VARS.VERSION < 1.7 then
  141. if WHUD_VARS.Cooldowns.fadeout then
  142. WHUD_VARS.Cooldowns.fadeout = nil
  143. end
  144. if WHUD_VARS.Cooldowns.fading == nil then
  145. WHUD_VARS.Cooldowns.fading = true
  146. WHUD_VARS.Cooldowns.fadetime = 2
  147. end
  148. if WHUD_VARS.Alerts == nil then
  149. WHUD_VARS.Alerts = {
  150. X = 0,
  151. Y = 100,
  152. scale = 1,
  153. strata = "HIGH",
  154. fontsize = 35,
  155. ["Battleshout"] = true,
  156. ["Weightstone"] = true,
  157. ["Salvation"] = true,
  158. }
  159. end
  160. end
  161. if WHUD_VARS.VERSION < 2.0 then
  162. WHUD_VARS.Glow = {
  163. ["Overpower"] = true,
  164. ["Execute"] = true,
  165. ["Battleshout"] = true,
  166. }
  167. WHUD_VARS.Alerts["Execute"] = true
  168. WHUD_VARS.Alerts.transparency = 1
  169. WHUD_VARS.Alerts.enabled = true
  170. WHUD_VARS.Alerts.font = "Fishfingers"
  171. WHUD_VARS.Overpower.font = "Fishfingers"
  172. WHUD_VARS.Overpower.timerfont = "Fishfingers"
  173. WHUD_VARS.Overpower.pve = true
  174. WHUD_VARS.Overpower.transparency = 1
  175. WHUD_VARS.Ragebar.texture = "ragebar1"
  176. WHUD_VARS.Ragebar.font = "Fishfingers"
  177. WHUD_VARS.Options = {
  178. X = 0,
  179. Y = 400,
  180. }
  181. if WHUD_VARS.VERSION < 2.1 then
  182. WHUD_VARS.Cooldowns.racials = true
  183. end
  184. end
  185. WHUD_VARS.VERSION = version
  186. end
  187. end
  188.  
  189. function WHUD_UPDATE_SPELLINFO()
  190. -- updating the spellinfos, if the actionbar has been modified
  191. for i=1,100 do
  192. local name = GetSpellName(i,"player")
  193. if name == nil then return
  194. else
  195. for check=1,table.getn(WHUD_IMPORTANTSPELLS)do
  196. if name == WHUD_IMPORTANTSPELLS[check] then
  197. -- slotID,startTime,endTime
  198. WHUD_SPELLINFO[name] = {i,0,0};
  199. end
  200. end
  201. -- Overpower/Revenge/Shield Bash/Pummel are no longer in the list and need to be checked extra ; Execute is also extra, for the glow
  202. if name == "Overpower" then WHUD_SPELLINFO[name] = {i,0,0};
  203. elseif name == "Revenge" then WHUD_SPELLINFO[name] = {i,0,0};
  204. elseif name == "Pummel" then WHUD_SPELLINFO[name] = {i,0,0};
  205. elseif name == "Shield Bash" then WHUD_SPELLINFO[name] = {i,0,0};
  206. elseif name == "Execute" then WHUD_SPELLINFO[name] = {i,0,0};
  207. end
  208. end
  209. end
  210. end
  211.  
  212. function WHUD_Variables_Reset()
  213. WHUD_VARS = nil
  214. WHUD_VARS = WHUD_DEFAULT_VARS
  215. WHUD_Ragebar_VarUpdate()
  216. WHUD_Overpower_VarUpdate()
  217. WHUD_Cooldowns_VarUpdate()
  218. WHUD_Alerts_VarUpdate()
  219. DEFAULT_CHAT_FRAME:AddMessage(" >> |cff8f4108WarriorHUD|r reset complete. Loaded default settings.")
  220. end
  221.  
  222. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement