Advertisement
Guest User

Untitled

a guest
Aug 16th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.07 KB | None | 0 0
  1. local helpers = Aptechka.helpers
  2. local _, playerClass = UnitClass("player")
  3. local isHealer = (playerClass == "PRIEST" or playerClass == "PALADIN" or playerClass == "SHAMAN" or playerClass == "DRUID")
  4. local A = helpers.AddAura
  5. local AD = helpers.AddAuraToDefault
  6. local DT = helpers.AddDispellType
  7. local ClickMacro = helpers.ClickMacro
  8. local Trace = helpers.AddTrace
  9. local config = AptechkaUserConfig
  10. -- importing helper functions
  11.  
  12. --Here you can store personal settings, overriding fields in default configuration (located in Aptechka/config.lua).
  13. --You can add here anything, but note that first time when you add spell you automatically create new spell set.
  14. --(Because we add our own IndicatorAuras table which contains spell set, default one becomes unaccessible )
  15. --You may still edit default configuration table from here. It's called AptechkaDefaultConfig.
  16. --Refer to config.lua in core module for samples of what you can do here.
  17. --Also frame.lua contains default GridSkin and loadables.lua - boss debuffs and pvp spells
  18.  
  19. config.TargetStatus = { name = "Target", assignto = { "border" }, color = {1,0.7,0.7}, priority = 98 }
  20. config.showSolo = true -- display unit button of your character even when you're not in the group
  21. config.disableBlizzardParty = false
  22. --config.UnitNameStatus = { name = "UnitName", assignto = { "text1" }, nametext = true, classcolor = false, color = {1,1,1}, priority = 20 }
  23. config.showParty = true
  24. config.cropNamesLen = 5
  25. --config.MainTankStatus = { name = "MainTank", priority = 60, assignto = { "border" }, color = {0.6,0.6,0.6} }
  26. config.hideBlizzardRaid = false
  27. config.incomingHealIgnorePlayer = true
  28. config.enableTraceHeals = false
  29. config.useCombatLogHealthUpdates = false
  30. config.enableVehicleSwap = false
  31. --config.TargetStatus = true -- disable target status
  32. --config.IncomingHealStatus = false -- disable incoming heal text
  33. config.HealthDificitStatus = { name = "HPD", assignto = { "text1" }, healthtext = true, priority = 20 }
  34. --config.disableManaBar = true
  35. config.useGroupAnchors = false -- Use separate anchors for each group.
  36. --config.AggroStatus = { name = "Aggro", assignto = { "spell4" }, color = { 0.7, 0, 0}, priority = 55 }
  37. config.AggroStatus = { name = "Aggro", assignto = { "raidbuff" }, color = { 0.7, 0, 0},priority = 55 }
  38. config.scale = 1.2
  39. --config.resize = { after = 21, to = 0.7 }, { after = 31, to = 0.8 } -- ONLY WORKS with group
  40. --config.resize = { after = 31, to = 0.9 } -- ONLY WORKS with group
  41. config.layouts = { -- works ONLY with group anchors disabled.
  42. -- layout functions are checked from first to last. function should return true to be accepted.
  43. function(self, members, role, spec)
  44. if role == "HEALER" and members > 6 then --resize after 27 for healers
  45. self:SetScale(1); return true
  46. end
  47. end,
  48. function(self, members, role, spec)
  49. if role ~= "HEALER" and members > 31 then --after 16 for non-healers
  50. self:SetScale(0.8); return true
  51. end
  52. end,
  53. function(self, members, role, spec)
  54. if role ~= "HEALER" and members > 16 then --after 16 for non-healers
  55. self:SetScale(0.95); return true
  56. end
  57. end,
  58. }
  59.  
  60.  
  61. if config.TargetBinding == nil then config.TargetBinding = "*type1" end
  62.  
  63. --if isHealer then
  64. --config.skin = "GridSkin"
  65. --config.useGroupAnchors = false
  66. --else
  67. --config.unitGap = -2
  68. --config.useGroupAnchors = true
  69. --config.skin = "CTRaidAssist" --NoBorder"
  70. --config.ctraBackdropColor = {0,0,0,0.7}
  71. --config.ctraNoBorder = true
  72. --config.unitGap = -10
  73. --end
  74.  
  75. --~ The first time A function is used, new spell set is created, and default one becomes unaccessible.
  76. --~ So if you want to just edit settings of some spells use AD.
  77. --~ --if playerClass == "PRIEST" then
  78. --~ -- AD{ id = 17, type = "HELPFUL", assignto = { "dispel" }, color = { 1, 1, 0}, showDuration = true } -- edit PWS spell in default config
  79. --~ --end
  80.  
  81. --~ --This will overwrite default spells if character class is paladin.
  82. --~ if playerClass == "PALADIN" then
  83. --~ A{ id = 20217, type = "HELPFUL", assignto = { "raidbuff" }, color = { .6 , .3, 1}, isMissing = true } --Blessing of Kings
  84. --~ A{ id = 53563, type = "HELPFUL", assignto = { "spell2" }, showDuration = true, --Beacon
  85. --~ isMine = true,
  86. --~ color = { 0,1,0 },
  87. --~ --foreigncolor = { 0.96/2, 0.55/2, 0.73/2 },
  88. --~ }
  89. --~ end
  90.  
  91. if playerClass == "DRUID" then
  92. --A{ id = 1126, type = "HELPFUL", assignto = { "bar1" }, color = { 235/255 , 145/255, 199/255}, isMissing = true } --Mark of the Wild
  93. A{ id = 33763, type = "HELPFUL", assignto = { "spell3", }, showDuration = true, isMine = true, color = { 0.5, 1, 0.5}, } --Lifebloom
  94. A{ id = 102351, type = "HELPFUL", assignto = { "spell2" }, priority = 70, color = {38/255, 221/255, 163/255}, isMine = true } --Cenarion Ward
  95. --A{ id = 774, type = "HELPFUL", assignto = { "spell1"}, pulse = true, color = { 1, 0.2, 1}, showDuration = true, isMine = true } --Rejuvenation
  96. --A{ id = 8936, type = "HELPFUL", assignto = { "topright" }, priority = 82, color = { 198/255, 233/255, 80/255}, showDuration = true, isMine = true } --Regrowth
  97. A{ id = 48438, type = "HELPFUL", assignto = { "spell5" }, pulse = true, color = { 0.4, 1, 0.4}, priority = 70, showDuration = true, isMine = true } --Wild Growth
  98. A{ id = 77761, type = "HELPFUL", assignto = { "icon" }, pulse = true, priority = 70, showDuration = true } -- Roar
  99. A{ id = 77764, type = "HELPFUL", assignto = { "icon" }, pulse = true, priority = 70, showDuration = true } -- Roar
  100.  
  101. --config.UnitInRangeFunc = function(unit) return (IsSpellInRange(GetSpellInfo(774),unit) == 1) end
  102. --// Use Rejuvenation for range check. Usual UnitInRange is about 38yd, not 41, tho it's probably good to have that margin. Disabled by default.
  103.  
  104. DT("Poison",{ assignto = { "dispel" }, showDuration = true, color = { 0, 0.6, 0},priority = 80 })
  105. DT("Curse", { assignto = { "dispel" }, showDuration = true, color = { 0.6, 0, 1}, priority = 81 })
  106. DT("Magic", { assignto = { "dispel" }, showDuration = true, color = { 0.2, 0.6, 1}, priority = 82 })
  107. end
  108.  
  109.  
  110. --~ -- HOW TO CHANGE SKIN LAYOUT FROM USERCONFIG
  111. --~ config.skin = "GridCustom"
  112. --~ config.useAnchors = "GridSkin" -- use parent skin anchors
  113. --~ config.GridCustomSettings = config.GridSkinSettings -- use parent skin settings (required)
  114. --~ config.GridCustom = function(self)
  115. --~ config.GridSkin(self)
  116. --~ -- how to create new icon
  117. --~ local icon2 = config.GridSkin_CreateIcon(self,24,24,0.4,"TOPLEFT",self,"TOPLEFT",0,0) -- w/h = 24, alpha = 0.4
  118. --~ self.icon2 = icon2
  119. --~
  120. --~ -- how to move existing indicators
  121. --~ self.spell2:ClearAllPoints() -- clear previous position
  122. --~ self.spell2:SetPoint("CENTER",self,"CENTER",0,0) -- set to center
  123. --~ -- same way to move text
  124. --~ self.text1:ClearAllPoints()
  125. --~ self.text1:SetPoint("TOP",self,"TOP",0,-5)
  126. --~
  127. --~ -- how to delete existsing indicators
  128. --~ self.raidbuff = nil
  129. --~
  130. --~ -- how to create new indicator
  131. --~ local newind = config.GridSkin_CreateIndicator(self,6,6,"TOPLEFT",self,"TOPLEFT",0,0) -- w/h = 6
  132. --~ self.spell4 = newind
  133. --~ -- change healthbar texture
  134. --~ self.health.bg:SetTexture([[Interface\AddOns\Aptechka\white]])
  135. --~ self.health:SetStatusBarTexture[[Interface\AddOns\Aptechka\white]]
  136. --~ end
  137.  
  138.  
  139. --~ -- HOW TO ADD NEW ZONES AND BOSS SPELLS FOR LOADING
  140. --~ AptechkaDefaultConfig.MapIDs[9001] = "Deathwing Lair"
  141. --~ -- Every zone with a map have it's own area id, you can found out current area id typing /dump GetCurrentMapAreaID()
  142. --~ -- In this case let's assume 9001 is the id of Deathwing Cave dungeon
  143. --~ -- Next we create a function which will add new spells to our current spell set
  144. --~ AptechkaDefaultConfig.LoadableDebuffs["Deathwing Lair"] = function()
  145. --~ A{ id = 999999, prototype = AptechkaUserConfig.BossDebuffPrototype } --BIG-BADA-BOOM
  146. --~ A{ id = 100500, priority = 45, prototype = AptechkaUserConfig.BossDebuffPrototype } --SHADOWFLAME!
  147. --~ A{ id = 666, color = { 0,0,1}, priority = 50, prototype = AptechkaUserConfig.BossDebuffPrototype } --DEATH FURY
  148. --~ end,
  149. --~ --Now when we enter Deathwing Cave, these spells will be loaded.
  150. --~ --Note that by using AptechkaDefaultConfig we're just editing default map id and loadable debuffs tables
  151.  
  152. --~ --AptechkaUserConfig.BossDebuffPrototype is the default bossdebuff job object template
  153. --~ --prototype field means our new spells will inherit settings from that job object
  154. --~ --You can either change default prototype by:
  155. --~ --AptechkaDefaultConfig.BossDebuffPrototype.assignto = { "icon" } -- now all boss debuffs will be assigned to center icon
  156. --~ --Or you can create your our prototype in user config
  157. --~ --config.BossDebuffPrototype = { type = "HARMFUL", assignto = { "bossdebuff" }, color = { 1,0,0 }, priority = 40, pulse = true }
  158. --~ --Or you can forget about this prototype crap and use same syntax as for your own spells
  159.  
  160.  
  161. config.skin = "GridCustom"
  162. config.useAnchors = "GridSkin" -- use parent skin anchors
  163. config.GridCustomSettings = config.GridSkinSettings -- use parent skin settings
  164. config.unitGap = 7
  165. config.groupGap = 7
  166. config.GridCustom = function(self)
  167. config.GridSkin(self)
  168. self.absorb:ClearAllPoints()
  169. self.absorb:SetPoint("TOPRIGHT",self,"TOPRIGHT",-3,0)
  170. self.absorb:SetWidth(3)
  171. self.roleicon:ClearAllPoints()
  172. self.roleicon:SetPoint("TOPLEFT",self.health,"TOPLEFT",-6,-8)
  173. self.roleicon:SetWidth(14)
  174. self.roleicon:SetHeight(14)
  175. self.text1:SetPoint("CENTER",self,"CENTER",0,10)
  176. self.icon:SetAlpha(0.9)
  177. self.icon:ClearAllPoints()
  178. self.icon:SetPoint("CENTER",self,"CENTER",0,-5)
  179. self.raidicon:SetWidth(12)
  180. self.raidicon:SetHeight(12)
  181. self.raidicon:ClearAllPoints()
  182. self.raidicon:SetPoint("CENTER",self.health,"TOP",0,0)
  183. self.raidicon:SetAlpha(0.7)
  184. self.health.bg:SetTexture(nil)
  185. --self:SetBackdropColor(0,0,0,0.5)
  186. self.spell3:SetWidth(10)
  187. self.spell3:SetHeight(10)
  188. self.spell2:ClearAllPoints()
  189. self.spell2:SetPoint("LEFT",self,"LEFT",0,0)
  190. self.dispel:ClearAllPoints()
  191. self.dispel:SetPoint("TOP",self,"TOP",0,0)
  192. --self.text3:ClearAllPoints()
  193. --self.text3:SetPoint("TOP",self,"TOP",0,0)
  194. local newind = config.GridSkin_CreateIndicator(self,6,6,"TOPLEFT",self,"TOPLEFT",0,0)
  195. self.spell4 = newind
  196. local newind = config.GridSkin_CreateIndicator(self,6,6,"RIGHT",self,"RIGHT",0,0) -- w/h = 6
  197. self.spell5 = newind
  198. local SetJob_HealthBar = function(self, job)
  199. local c
  200. if job.classcolor then
  201. c = self.parent.classcolor
  202. elseif job.color then
  203. c = job.color
  204. end
  205. if c then
  206. self:SetStatusBarColor(unpack(c))
  207. self.bg:SetVertexColor(c[1]/2,c[2]/2,c[3]/2)
  208. end
  209. end
  210. local DebuffTypeColor = DebuffTypeColor
  211. local helpful_color = { r = 0, g = 1, b = 0}
  212. local SetJob_Icon = self.icon.SetJob
  213. local function MySetJob_DebuffIcon(self, job)
  214. SetJob_Icon(self, job)
  215. local color = job.color
  216. if color then
  217. self.debuffTypeTexture:SetVertexColor(color[1], color[2], color[3], color[4] or 0.6)
  218. else
  219. local debuffType = job.debuffType
  220. if debuffType == "Helpful" then
  221. color = helpful_color
  222. else
  223. color = debuffType and DebuffTypeColor[debuffType] or DebuffTypeColor["none"]
  224. end
  225. self.debuffTypeTexture:SetVertexColor(color.r, color.g, color.b, 0.6)
  226. end
  227.  
  228. if job.isBossAura then
  229. self:SetScale(1.8)
  230. else
  231. self:SetScale(1)
  232. end
  233. end
  234. self.dicon1.SetJob = MySetJob_DebuffIcon
  235. self.dicon2.SetJob = MySetJob_DebuffIcon
  236. self.dicon3.SetJob = MySetJob_DebuffIcon
  237. self.health.SetJob = SetJob_HealthBar
  238. self.power.SetJob = SetJob_HealthBar
  239. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement