Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local helpers = Aptechka.helpers
- local _, playerClass = UnitClass("player")
- local isHealer = (playerClass == "PRIEST" or playerClass == "PALADIN" or playerClass == "SHAMAN" or playerClass == "DRUID")
- local A = helpers.AddAura
- local AD = helpers.AddAuraToDefault
- local DT = helpers.AddDispellType
- local ClickMacro = helpers.ClickMacro
- local Trace = helpers.AddTrace
- local config = AptechkaUserConfig
- -- importing helper functions
- --Here you can store personal settings, overriding fields in default configuration (located in Aptechka/config.lua).
- --You can add here anything, but note that first time when you add spell you automatically create new spell set.
- --(Because we add our own IndicatorAuras table which contains spell set, default one becomes unaccessible )
- --You may still edit default configuration table from here. It's called AptechkaDefaultConfig.
- --Refer to config.lua in core module for samples of what you can do here.
- --Also frame.lua contains default GridSkin and loadables.lua - boss debuffs and pvp spells
- config.TargetStatus = { name = "Target", assignto = { "border" }, color = {1,0.7,0.7}, priority = 98 }
- config.showSolo = true -- display unit button of your character even when you're not in the group
- config.disableBlizzardParty = false
- --config.UnitNameStatus = { name = "UnitName", assignto = { "text1" }, nametext = true, classcolor = false, color = {1,1,1}, priority = 20 }
- config.showParty = true
- config.cropNamesLen = 5
- --config.MainTankStatus = { name = "MainTank", priority = 60, assignto = { "border" }, color = {0.6,0.6,0.6} }
- config.hideBlizzardRaid = false
- config.incomingHealIgnorePlayer = true
- config.enableTraceHeals = false
- config.useCombatLogHealthUpdates = false
- config.enableVehicleSwap = false
- --config.TargetStatus = true -- disable target status
- --config.IncomingHealStatus = false -- disable incoming heal text
- config.HealthDificitStatus = { name = "HPD", assignto = { "text1" }, healthtext = true, priority = 20 }
- --config.disableManaBar = true
- config.useGroupAnchors = false -- Use separate anchors for each group.
- --config.AggroStatus = { name = "Aggro", assignto = { "spell4" }, color = { 0.7, 0, 0}, priority = 55 }
- config.AggroStatus = { name = "Aggro", assignto = { "raidbuff" }, color = { 0.7, 0, 0},priority = 55 }
- config.scale = 1.2
- --config.resize = { after = 21, to = 0.7 }, { after = 31, to = 0.8 } -- ONLY WORKS with group
- --config.resize = { after = 31, to = 0.9 } -- ONLY WORKS with group
- config.layouts = { -- works ONLY with group anchors disabled.
- -- layout functions are checked from first to last. function should return true to be accepted.
- function(self, members, role, spec)
- if role == "HEALER" and members > 6 then --resize after 27 for healers
- self:SetScale(1); return true
- end
- end,
- function(self, members, role, spec)
- if role ~= "HEALER" and members > 31 then --after 16 for non-healers
- self:SetScale(0.8); return true
- end
- end,
- function(self, members, role, spec)
- if role ~= "HEALER" and members > 16 then --after 16 for non-healers
- self:SetScale(0.95); return true
- end
- end,
- }
- if config.TargetBinding == nil then config.TargetBinding = "*type1" end
- --if isHealer then
- --config.skin = "GridSkin"
- --config.useGroupAnchors = false
- --else
- --config.unitGap = -2
- --config.useGroupAnchors = true
- --config.skin = "CTRaidAssist" --NoBorder"
- --config.ctraBackdropColor = {0,0,0,0.7}
- --config.ctraNoBorder = true
- --config.unitGap = -10
- --end
- --~ The first time A function is used, new spell set is created, and default one becomes unaccessible.
- --~ So if you want to just edit settings of some spells use AD.
- --~ --if playerClass == "PRIEST" then
- --~ -- AD{ id = 17, type = "HELPFUL", assignto = { "dispel" }, color = { 1, 1, 0}, showDuration = true } -- edit PWS spell in default config
- --~ --end
- --~ --This will overwrite default spells if character class is paladin.
- --~ if playerClass == "PALADIN" then
- --~ A{ id = 20217, type = "HELPFUL", assignto = { "raidbuff" }, color = { .6 , .3, 1}, isMissing = true } --Blessing of Kings
- --~ A{ id = 53563, type = "HELPFUL", assignto = { "spell2" }, showDuration = true, --Beacon
- --~ isMine = true,
- --~ color = { 0,1,0 },
- --~ --foreigncolor = { 0.96/2, 0.55/2, 0.73/2 },
- --~ }
- --~ end
- if playerClass == "DRUID" then
- --A{ id = 1126, type = "HELPFUL", assignto = { "bar1" }, color = { 235/255 , 145/255, 199/255}, isMissing = true } --Mark of the Wild
- A{ id = 33763, type = "HELPFUL", assignto = { "spell3", }, showDuration = true, isMine = true, color = { 0.5, 1, 0.5}, } --Lifebloom
- A{ id = 102351, type = "HELPFUL", assignto = { "spell2" }, priority = 70, color = {38/255, 221/255, 163/255}, isMine = true } --Cenarion Ward
- --A{ id = 774, type = "HELPFUL", assignto = { "spell1"}, pulse = true, color = { 1, 0.2, 1}, showDuration = true, isMine = true } --Rejuvenation
- --A{ id = 8936, type = "HELPFUL", assignto = { "topright" }, priority = 82, color = { 198/255, 233/255, 80/255}, showDuration = true, isMine = true } --Regrowth
- A{ id = 48438, type = "HELPFUL", assignto = { "spell5" }, pulse = true, color = { 0.4, 1, 0.4}, priority = 70, showDuration = true, isMine = true } --Wild Growth
- A{ id = 77761, type = "HELPFUL", assignto = { "icon" }, pulse = true, priority = 70, showDuration = true } -- Roar
- A{ id = 77764, type = "HELPFUL", assignto = { "icon" }, pulse = true, priority = 70, showDuration = true } -- Roar
- --config.UnitInRangeFunc = function(unit) return (IsSpellInRange(GetSpellInfo(774),unit) == 1) end
- --// Use Rejuvenation for range check. Usual UnitInRange is about 38yd, not 41, tho it's probably good to have that margin. Disabled by default.
- DT("Poison",{ assignto = { "dispel" }, showDuration = true, color = { 0, 0.6, 0},priority = 80 })
- DT("Curse", { assignto = { "dispel" }, showDuration = true, color = { 0.6, 0, 1}, priority = 81 })
- DT("Magic", { assignto = { "dispel" }, showDuration = true, color = { 0.2, 0.6, 1}, priority = 82 })
- end
- --~ -- HOW TO CHANGE SKIN LAYOUT FROM USERCONFIG
- --~ config.skin = "GridCustom"
- --~ config.useAnchors = "GridSkin" -- use parent skin anchors
- --~ config.GridCustomSettings = config.GridSkinSettings -- use parent skin settings (required)
- --~ config.GridCustom = function(self)
- --~ config.GridSkin(self)
- --~ -- how to create new icon
- --~ local icon2 = config.GridSkin_CreateIcon(self,24,24,0.4,"TOPLEFT",self,"TOPLEFT",0,0) -- w/h = 24, alpha = 0.4
- --~ self.icon2 = icon2
- --~
- --~ -- how to move existing indicators
- --~ self.spell2:ClearAllPoints() -- clear previous position
- --~ self.spell2:SetPoint("CENTER",self,"CENTER",0,0) -- set to center
- --~ -- same way to move text
- --~ self.text1:ClearAllPoints()
- --~ self.text1:SetPoint("TOP",self,"TOP",0,-5)
- --~
- --~ -- how to delete existsing indicators
- --~ self.raidbuff = nil
- --~
- --~ -- how to create new indicator
- --~ local newind = config.GridSkin_CreateIndicator(self,6,6,"TOPLEFT",self,"TOPLEFT",0,0) -- w/h = 6
- --~ self.spell4 = newind
- --~ -- change healthbar texture
- --~ self.health.bg:SetTexture([[Interface\AddOns\Aptechka\white]])
- --~ self.health:SetStatusBarTexture[[Interface\AddOns\Aptechka\white]]
- --~ end
- --~ -- HOW TO ADD NEW ZONES AND BOSS SPELLS FOR LOADING
- --~ AptechkaDefaultConfig.MapIDs[9001] = "Deathwing Lair"
- --~ -- Every zone with a map have it's own area id, you can found out current area id typing /dump GetCurrentMapAreaID()
- --~ -- In this case let's assume 9001 is the id of Deathwing Cave dungeon
- --~ -- Next we create a function which will add new spells to our current spell set
- --~ AptechkaDefaultConfig.LoadableDebuffs["Deathwing Lair"] = function()
- --~ A{ id = 999999, prototype = AptechkaUserConfig.BossDebuffPrototype } --BIG-BADA-BOOM
- --~ A{ id = 100500, priority = 45, prototype = AptechkaUserConfig.BossDebuffPrototype } --SHADOWFLAME!
- --~ A{ id = 666, color = { 0,0,1}, priority = 50, prototype = AptechkaUserConfig.BossDebuffPrototype } --DEATH FURY
- --~ end,
- --~ --Now when we enter Deathwing Cave, these spells will be loaded.
- --~ --Note that by using AptechkaDefaultConfig we're just editing default map id and loadable debuffs tables
- --~ --AptechkaUserConfig.BossDebuffPrototype is the default bossdebuff job object template
- --~ --prototype field means our new spells will inherit settings from that job object
- --~ --You can either change default prototype by:
- --~ --AptechkaDefaultConfig.BossDebuffPrototype.assignto = { "icon" } -- now all boss debuffs will be assigned to center icon
- --~ --Or you can create your our prototype in user config
- --~ --config.BossDebuffPrototype = { type = "HARMFUL", assignto = { "bossdebuff" }, color = { 1,0,0 }, priority = 40, pulse = true }
- --~ --Or you can forget about this prototype crap and use same syntax as for your own spells
- config.skin = "GridCustom"
- config.useAnchors = "GridSkin" -- use parent skin anchors
- config.GridCustomSettings = config.GridSkinSettings -- use parent skin settings
- config.unitGap = 7
- config.groupGap = 7
- config.GridCustom = function(self)
- config.GridSkin(self)
- self.absorb:ClearAllPoints()
- self.absorb:SetPoint("TOPRIGHT",self,"TOPRIGHT",-3,0)
- self.absorb:SetWidth(3)
- self.roleicon:ClearAllPoints()
- self.roleicon:SetPoint("TOPLEFT",self.health,"TOPLEFT",-6,-8)
- self.roleicon:SetWidth(14)
- self.roleicon:SetHeight(14)
- self.text1:SetPoint("CENTER",self,"CENTER",0,10)
- self.icon:SetAlpha(0.9)
- self.icon:ClearAllPoints()
- self.icon:SetPoint("CENTER",self,"CENTER",0,-5)
- self.raidicon:SetWidth(12)
- self.raidicon:SetHeight(12)
- self.raidicon:ClearAllPoints()
- self.raidicon:SetPoint("CENTER",self.health,"TOP",0,0)
- self.raidicon:SetAlpha(0.7)
- self.health.bg:SetTexture(nil)
- --self:SetBackdropColor(0,0,0,0.5)
- self.spell3:SetWidth(10)
- self.spell3:SetHeight(10)
- self.spell2:ClearAllPoints()
- self.spell2:SetPoint("LEFT",self,"LEFT",0,0)
- self.dispel:ClearAllPoints()
- self.dispel:SetPoint("TOP",self,"TOP",0,0)
- --self.text3:ClearAllPoints()
- --self.text3:SetPoint("TOP",self,"TOP",0,0)
- local newind = config.GridSkin_CreateIndicator(self,6,6,"TOPLEFT",self,"TOPLEFT",0,0)
- self.spell4 = newind
- local newind = config.GridSkin_CreateIndicator(self,6,6,"RIGHT",self,"RIGHT",0,0) -- w/h = 6
- self.spell5 = newind
- local SetJob_HealthBar = function(self, job)
- local c
- if job.classcolor then
- c = self.parent.classcolor
- elseif job.color then
- c = job.color
- end
- if c then
- self:SetStatusBarColor(unpack(c))
- self.bg:SetVertexColor(c[1]/2,c[2]/2,c[3]/2)
- end
- end
- local DebuffTypeColor = DebuffTypeColor
- local helpful_color = { r = 0, g = 1, b = 0}
- local SetJob_Icon = self.icon.SetJob
- local function MySetJob_DebuffIcon(self, job)
- SetJob_Icon(self, job)
- local color = job.color
- if color then
- self.debuffTypeTexture:SetVertexColor(color[1], color[2], color[3], color[4] or 0.6)
- else
- local debuffType = job.debuffType
- if debuffType == "Helpful" then
- color = helpful_color
- else
- color = debuffType and DebuffTypeColor[debuffType] or DebuffTypeColor["none"]
- end
- self.debuffTypeTexture:SetVertexColor(color.r, color.g, color.b, 0.6)
- end
- if job.isBossAura then
- self:SetScale(1.8)
- else
- self:SetScale(1)
- end
- end
- self.dicon1.SetJob = MySetJob_DebuffIcon
- self.dicon2.SetJob = MySetJob_DebuffIcon
- self.dicon3.SetJob = MySetJob_DebuffIcon
- self.health.SetJob = SetJob_HealthBar
- self.power.SetJob = SetJob_HealthBar
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement