时间:2025-03-11
在WLK怀旧服中,DK职业以其独特的技能和战斗机制吸引了众多玩家。为了更好地提升游戏体验,许多玩家开始使用WeakAuras(简称WA)来定制自己的战斗界面。今天,我们将分享一些DK战斗界面的WA代码,并进行详细解析,帮助大家打造一个高效且个性化的战斗环境。
首先,我们来看一个基础的DK资源监控WA代码。这个代码可以帮助你实时了解符文、符文能量以及死亡骑士的主要冷却时间。
aura = { [1] = { type = "aura", event = "Cooldown Progress (Spell)", spellids = {48792, 49016, 49020}, durationFunction = "return select(5, GetSpellInfo(spellID))", name = "DK Cooldowns", regionType = "icon", icon = true, color = {r=1,g=0,b=0,a=1}, x = 0, y = 0, width = 64, height = 64, anchorPoint = "CENTER", frameStrata = "LOW", frameLevel = 1, fontSize = 12, textFlags = "", textPosition = "TOP", textColor = {r=1,g=1,b=1,a=1}, displayText = "[cd]", cooldownTextSize = 12, hideCountdownNumbers = false, desaturate = false, stackTextPosition = "BOTTOMRIGHT", stackTextXOffset = 0, stackTextYOffset = 0, stackTextColor = {r=1,g=1,b=1,a=1}, stackTextSize = 12, texture = "Interface\\Icons\\ability_deathknight_bloodboil", backdrop = false, backdropColor = {r=0,g=0,b=0,a=0.5}, backdropBorderColor = {r=0,g=0,b=0,a=1}, animate = "none", animation = {}, actions = {}, triggers = {}, custom = [[ local function update(self, event, ...) if event == "COOLDOWN_UPDATE" then self:UpdateCooldown() end end return { type = "custom", events = "COOLDOWN_UPDATE", func = update, } ]], }, }
这段代码创建了一个显示DK主要技能冷却时间的图标。通过设置spellids
,你可以指定要监控的技能ID。此外,还可以调整图标的大小、位置、颜色等属性,以适应你的个人喜好。
接下来,我们介绍一个用于监控符文状态的代码。这个功能对于DK来说至关重要,因为符文是其核心资源之一。
aura = { [1] = { type = "dynamicgroup", event = "Runes Update", name = "Rune Tracker", regionType = "dynamicgroup", group = { { type = "progress", event = "Runes Update", name = "Rune", regionType = "progress", fillColor = {r=1,g=0,b=0,a=1}, emptyColor = {r=0.5,g=0.5,b=0.5,a=1}, borderColor = {r=0,g=0,b=0,a=1}, width = 32, height = 8, x = 0, y = 0, anchorPoint = "CENTER", reverseFill = false, smoothGradient = false, startAngle = 0, endAngle = 360, rotation = 0, min = 0, max = 10, value = "return rune.charges", textFormat = "percent", fontSize = 12, textFlags = "", textPosition = "CENTER", textColor = {r=1,g=1,b=1,a=1}, backdrop = false, backdropColor = {r=0,g=0,b=0,a=0.5}, backdropBorderColor = {r=0,g=0,b=0,a=1}, animate = "none", animation = {}, actions = {}, triggers = {}, custom = [[ local function update(self, event, ...) for i = 1, 6 do local rune = WeakAuras.regions["Rune"..i] rune:SetValue(RuneFrame.rune[i].charges) end end return { type = "custom", events = "RUNE_POWER_UPDATE", func = update, } ]], }, }, dynamic = true, spacing = 4, layout = "horizontal", horizontalAnchorPoint = "LEFT", verticalAnchorPoint = "TOP", direction = "left", wrapAfter = 6, width = 200, height = 8, x = 0, y = 0, anchorPoint = "CENTER", backdrop = false, backdropColor = {r=0,g=0,b=0,a=0.5}, backdropBorderColor = {r=0,g=0,b=0,a=1}, animate = "none", animation = {}, actions = {}, triggers = {}, custom = [[ local function update(self, event, ...) for i = 1, 6 do local rune = WeakAuras.regions["Rune"..i] rune:SetValue(RuneFrame.rune[i].charges) end end return { type = "custom", events = "RUNE_POWER_UPDATE", func = update, } ]], }, }
此代码创建了一个动态组,用于显示每个符文的状态。通过调整width
和height
,你可以改变每个符文条的大小。同时,还可以设置layout
参数来决定符文条的排列方式。
最后,如果你想了解更多关于WLK怀旧服DK的攻略和技巧,欢迎访问57k手游。这里不仅有丰富的游戏资讯,还有活跃的社区等待着你的加入!