This commit is contained in:
2024-08-24 22:45:34 +02:00
parent d163cf93eb
commit 9749f5a6eb
20 changed files with 484 additions and 484 deletions

View File

@@ -1,42 +1,42 @@
-- QUEST_POI_UPDATE QUEST_DETAIL QUEST_COMPLETE QUEST_GREETING QUEST_PROGRESS GOSSIP_SHOW -- QUEST_POI_UPDATE QUEST_DETAIL QUEST_COMPLETE QUEST_GREETING QUEST_PROGRESS GOSSIP_SHOW
function(e) function(e)
if e == "QUEST_POI_UPDATE" then if e == "QUEST_POI_UPDATE" then
CloseGossip() CloseGossip()
elseif e == "QUEST_DETAIL" then elseif e == "QUEST_DETAIL" then
AcceptQuest() AcceptQuest()
elseif e == "QUEST_COMPLETE" then elseif e == "QUEST_COMPLETE" then
if GetNumQuestChoices() <= 1 then if GetNumQuestChoices() <= 1 then
GetQuestReward(1) GetQuestReward(1)
end end
elseif e == "GOSSIP_SHOW" then elseif e == "GOSSIP_SHOW" then
local quests = GetNumGossipAvailableQuests() local quests = GetNumGossipAvailableQuests()
local completedQuests = GetNumGossipActiveQuests() local completedQuests = GetNumGossipActiveQuests()
local options = GetNumGossipOptions() local options = GetNumGossipOptions()
if completedQuests > 0 and options == 0 then if completedQuests > 0 and options == 0 then
for i = 1, completedQuests do for i = 1, completedQuests do
SelectGossipActiveQuest(i) SelectGossipActiveQuest(i)
end end
end end
if quests > 0 and options == 0 then if quests > 0 and options == 0 then
SelectGossipAvailableQuest(1) SelectGossipAvailableQuest(1)
end end
if options == 1 and quests + completedQuests == 0 then if options == 1 and quests + completedQuests == 0 then
SelectGossipOption(1) SelectGossipOption(1)
end end
elseif e == "QUEST_GREETING" then elseif e == "QUEST_GREETING" then
local quests = GetNumGossipAvailableQuests() local quests = GetNumGossipAvailableQuests()
local completedQuests = GetNumGossipActiveQuests() local completedQuests = GetNumGossipActiveQuests()
if completedQuests > 0 then if completedQuests > 0 then
for i = 1, completedQuests do for i = 1, completedQuests do
SelectActiveQuest(1) SelectActiveQuest(1)
end end
end end
if quests > 0 then if quests > 0 then
SelectAvailableQuest(1) SelectAvailableQuest(1)
end end
elseif e == "QUEST_PROGRESS" then elseif e == "QUEST_PROGRESS" then
if IsQuestCompletable(i) then if IsQuestCompletable(i) then
CompleteQuest() CompleteQuest()
end end
end end
end end

View File

@@ -1,4 +1,4 @@
-- BAG_UPDATE -- BAG_UPDATE
function(e) function(e)
aura_env.update() aura_env.update()
end end

View File

@@ -1,30 +1,30 @@
local function getItemLink(container, slot) local function getItemLink(container, slot)
return select(7, GetContainerItemInfo(container, slot)) or "" return select(7, GetContainerItemInfo(container, slot)) or ""
end end
local function getBindType(container, slot) local function getBindType(container, slot)
return select(14, GetItemInfo(getItemLink(container, slot))) or 0 return select(14, GetItemInfo(getItemLink(container, slot))) or 0
end end
local function isBoe(container, slot) local function isBoe(container, slot)
return getBindType(container, slot) == 1 return getBindType(container, slot) == 1
end end
local showGlow = function(container, slot) local showGlow = function(container, slot)
ActionButton_ShowOverlayGlow(_G["ElvUI_ContainerFrameBag" .. container .. "Slot" .. slot]) ActionButton_ShowOverlayGlow(_G["ElvUI_ContainerFrameBag" .. container .. "Slot" .. slot])
end end
local hideGlow = function(container, slot) local hideGlow = function(container, slot)
ActionButton_HideOverlayGlow(_G["ElvUI_ContainerFrameBag" .. container .. "Slot" .. slot]) ActionButton_HideOverlayGlow(_G["ElvUI_ContainerFrameBag" .. container .. "Slot" .. slot])
end end
aura_env.update = function() aura_env.update = function()
for container = 0, 4 do for container = 0, 4 do
for slot = 1, GetContainerNumSlots(container) do for slot = 1, GetContainerNumSlots(container) do
print(C_Item.IsBound(ItemLocation:CreateFromBagAndSlot(container, slot))) print(C_Item.IsBound(ItemLocation:CreateFromBagAndSlot(container, slot)))
if isBoe(container, slot) then if isBoe(container, slot) then
showGlow(container, slot) showGlow(container, slot)
else else
hideGlow(container, slot) hideGlow(container, slot)
end end
end end
end end
end end

View File

@@ -1,18 +1,18 @@
Haven't found a way of determining whether an item is soulbound or not without tooltip scanning which I don't want to do Haven't found a way of determining whether an item is soulbound or not without tooltip scanning which I don't want to do
local cTip = CreateFrame("GameTooltip","PrivTooltip",nil,"GameTooltipTemplate") local cTip = CreateFrame("GameTooltip","PrivTooltip",nil,"GameTooltipTemplate")
local function IsSoulbound(bag, slot) local function IsSoulbound(bag, slot)
cTip:SetOwner(UIParent, "ANCHOR_NONE") cTip:SetOwner(UIParent, "ANCHOR_NONE")
cTip:SetBagItem(bag, slot) cTip:SetBagItem(bag, slot)
cTip:Show() cTip:Show()
for i = 1,cTip:NumLines() do for i = 1,cTip:NumLines() do
if(_G[name.."TooltipTextLeft"..i]:GetText()==ITEM_SOULBOUND) then if(_G[name.."TooltipTextLeft"..i]:GetText()==ITEM_SOULBOUND) then
cTip:Hide() cTip:Hide()
return true return true
end end
end end
cTip:Hide() cTip:Hide()
return false return false
end end
Some guy says this is good Some guy says this is good

View File

@@ -1,20 +1,20 @@
function(progress, r1, g1, b1, a1, r2, g2, b2, a2) function(progress, r1, g1, b1, a1, r2, g2, b2, a2)
-- if aura_env.state.IsActive then -- if aura_env.state.IsActive then
-- ActionButton_ShowOverlayGlow(aura_env.region.icon) -- ActionButton_ShowOverlayGlow(aura_env.region.icon)
-- else -- else
-- ActionButton_HideOverlayGlow(aura_env.region.icon) -- ActionButton_HideOverlayGlow(aura_env.region.icon)
-- end -- end
if aura_env.state.IsActive then if aura_env.statee.IsActive then
aura_env.region.icon:SetDesaturated(false) aura_env.region.icon:SetDesaturated(false)
return r1, g1, b1, a1 return r1, g1, b1, a1
end end
if aura_env.IsOnCooldown then if aura_env.IsOnCooldown then
aura_env.region.icon:SetDesaturated(true) aura_env.region.icon:SetDesaturated(true)
return r1, g1, b1, a1 return r1, g1, b1, a1
end end
aura_env.region.icon:SetDesaturated(false) aura_env.region.icon:SetDesaturated(false)
return r2, g2, b2, 0.6 return r2, g2, b2, 0.6
end end

View File

@@ -1,4 +1,4 @@
function(allstates) function(allstates)
aura_env.HandleEvent(allstates) aura_env.HandleEvent(allstates)
return true return true
end end

View File

@@ -1,100 +1,100 @@
local CooldownType = { local CooldownType = {
New = function(self) New = function(self)
local o = {} local o = {}
setmetatable(o, self) setmetatable(o, self)
self.__index = self self.__index = self
return o return o
end, end,
} }
local NullType = CooldownType:New() local NullType = CooldownType:New()
NullType.GetActiveInfo = function(self) NullType.GetActiveInfo = function(self)
return false, 0, 0 return false, 0, 0
end end
local TotemType = CooldownType:New() local TotemType = CooldownType:New()
TotemType.GetActiveInfo = function(self) TotemType.GetActiveInfo = function(self)
for i = 1, 4 do for i = 1, 4 do
local present, name, start, duration = GetTotemInfo(i) local present, name, start, duration = GetTotemInfo(i)
if present and name == self.name then if present and name == self.name then
return true, start, duration return true, start, duration
end end
end end
return false, 0, 0 return false, 0, 0
end end
local Cooldown = { local Cooldown = {
New = function(self, type, spellid, keybind) New = function(self, type, spellid, keybind)
local o = { local o = {
["type"] = type, ["type"] = type,
["spellid"] = spellid, ["spellid"] = spellid,
["name"] = GetSpellInfo(spellid), ["name"] = GetSpellInfo(spellid),
["icon"] = GetSpellTexture(spellid), ["icon"] = GetSpellTexture(spellid),
["keybind"] = keybind, ["keybind"] = keybind,
} }
setmetatable(o, self) setmetatable(o, self)
self.__index = self self.__index = self
return o return o
end, end,
GetCooldownInfo = function(self) GetCooldownInfo = function(self)
local start, duration = GetSpellCooldown(self.spellid) local start, duration = GetSpellCooldown(self.spellid)
return start > 0 and duration > aura_env.gcdThreshold, start, duration return start > 0 and duration > aura_env.gcdThreshold, start, duration
end, end,
GetActiveInfo = function(self) GetActiveInfo = function(self)
return self.type:GetActiveInfo() return self.type:GetActiveInfo()
end end
} }
aura_env.cooldowns = { aura_env.cooldowns = {
[5394] = Cooldown:New(TotemType, 5394, "C"), -- Healing Stream Totem [5394] = Cooldown:New(TotemType, 5394, "C"), -- Healing Stream Totem
[2484] = Cooldown:New(TotemType, 2484, "SY"), -- Earthbind Totem [2484] = Cooldown:New(TotemType, 2484, "SY"), -- Earthbind Totem
[8143] = Cooldown:New(TotemType, 8143, "S5"), -- Tremor Totem [8143] = Cooldown:New(TotemType, 8143, "S5"), -- Tremor Totem
[8177] = Cooldown:New(TotemType, 8177, "5"), -- Grounding Totem [8177] = Cooldown:New(TotemType, 8177, "5"), -- Grounding Totem
[108273] = Cooldown:New(TotemType, 108273, "S4"), -- Windwalk Totem [108273] = Cooldown:New(TotemType, 108273, "S4"), -- Windwalk Totem
[108270] = Cooldown:New(TotemType, 108270, "SF"), -- Stone Bulwark Totem [108270] = Cooldown:New(TotemType, 108270, "SF"), -- Stone Bulwark Totem
} }
aura_env.gcdThreshold = 1.5 aura_env.gcdThreshold = 1.5
aura_env.Update = function(allstates, cd) aura_env.Update = function(allstates, cd)
local state = allstates[cd.spellid] or {} local state = allstates[cd.spellid] or {}
state.IsOnCooldown = cd:GetCooldownInfo() state.IsOnCooldown = cd:GetCooldownInfo()
state.IsActive = cd:GetActiveInfo() state.IsActive = cd:GetActiveInfo()
state.Keybind = cd.keybind state.Keybind = cd.keybind
if state.IsOnCooldown and not state.IsActive then if state.IsOnCooldown and not state.IsActive then
local _, start, duration = cd:GetCooldownInfo() local _, start, duration = cd:GetCooldownInfo()
state.progressType = "timed" state.progressType = "timed"
state.duration = duration state.duration = duration
state.expirationTime = start + duration state.expirationTime = start + duration
elseif state.IsOnCooldown and state.IsActive then elseif state.IsOnCooldown and state.IsActive then
local _, start, duration = cd:GetActiveInfo() local _, start, duration = cd:GetActiveInfo()
state.progressType = "timed" state.progressType = "timed"
state.duration = duration state.duration = duration
state.expirationTime = start + duration state.expirationTime = start + duration
end end
state.changed = true state.changed = true
state.show = true state.show = true
state.name = cd.name state.name = cd.name
state.icon = cd.icon state.icon = cd.icon
state.spellid = cd.spellid state.spellid = cd.spellid
allstates[cd.spellid] = state allstates[cd.spellid] = state
end end
aura_env.UpdateAll = function(allstates) aura_env.UpdateAll = function(allstates)
for _, v in pairs(aura_env.cooldowns) do for _, v in pairs(aura_env.cooldowns) do
aura_env.Update(allstates, v) aura_env.Update(allstates, v)
end end
end end
aura_env.HandleEvent = function(allstates) aura_env.HandleEvent = function(allstates)
-- TODO: Handle events better -- TODO: Handle events better
-- On cooldown begin -> trigger update on relevant spell -- On cooldown begin -> trigger update on relevant spell
-- On totem die -> same -- On totem die -> same
-- On buff remove -- On buff remove
-- On debuff remove -- On debuff remove
-- On... Whatever else might happen -- On... Whatever else might happen
aura_env.UpdateAll(allstates) aura_env.UpdateAll(allstates)
end end

View File

@@ -1,5 +1,5 @@
-- ACTIONBAR_UPDATE_COOLDOWN -- ACTIONBAR_UPDATE_COOLDOWN
function(allstates, e) function(allstates, e)
aura_env.processEvent(allstates) aura_env.processEvent(allstates)
return true return true
end end

View File

@@ -1,68 +1,68 @@
aura_env.trackedSpells = { aura_env.trackedSpells = {
20271, -- Judgement 20271, -- Judgement
26573, -- Consecration 26573, -- Consecration
209202, -- Eye of Tyr 209202, -- Eye of Tyr
213652, -- Hand of the Protector 213652, -- Hand of the Protector
31935, -- Avenger's Shield 31935, -- Avenger's Shield
53600, -- Shield of the Righteous 53600, -- Shield of the Righteous
1044, -- Hand of Freedom 1044, -- Hand of Freedom
155145, -- Arcane Torrent 155145, -- Arcane Torrent
853, -- Hammer of Justice 853, -- Hammer of Justice
6940, -- Hand of Sacrifice 6940, -- Hand of Sacrifice
31850, -- Ardent Defender 31850, -- Ardent Defender
86659, -- Guardian of Ancient Kings 86659, -- Guardian of Ancient Kings
204018, -- Blessing of Spellwarding 204018, -- Blessing of Spellwarding
} }
local iconDisplayDuration = 0.4 local iconDisplayDuration = 0.4
local gcdDuration = 1.5 local gcdDuration = 1.5
aura_env.cache = {} aura_env.cache = {}
for k, spellId in pairs(aura_env.trackedSpells) do for k, spellId in pairs(aura_env.trackedSpells) do
aura_env.cache[spellId] = { aura_env.cache[spellId] = {
ready = true, ready = true,
hasCharges = false, hasCharges = false,
} }
if GetSpellCharges(spellId) then if GetSpellCharges(spellId) then
aura_env.cache[spellId].hasCharges = true aura_env.cache[spellId].hasCharges = true
aura_env.cache[spellId].charges = select(1, GetSpellCharges(spellId)) aura_env.cache[spellId].charges = select(1, GetSpellCharges(spellId))
end end
end end
aura_env.processEvent = function(allstates) aura_env.processEvent = function(allstates)
for k, spellId in pairs(aura_env.trackedSpells) do for k, spellId in pairs(aura_env.trackedSpells) do
-- Handle spells with charges -- Handle spells with charges
local isReady local isReady
if (aura_env.cache[spellId].hasCharges) then if (aura_env.cache[spellId].hasCharges) then
local charges = select(1, GetSpellCharges(spellId)) local charges = select(1, GetSpellCharges(spellId))
if (charges > aura_env.cache[spellId].charges) then if (charges > aura_env.cache[spellId].charges) then
isReady = true isReady = true
aura_env.cache[spellId].charges = charges aura_env.cache[spellId].charges = charges
else else
isReady = false isReady = false
aura_env.cache[spellId].charges = charges aura_env.cache[spellId].charges = charges
end end
else else
isReady = select(2, GetSpellCooldown(spellId)) < gcdDuration isReady = select(2, GetSpellCooldown(spellId)) < gcdDuration
end end
if (not aura_env.cache[spellId].ready and isReady) then if (not aura_env.cache[spellId].ready and isReady) then
local icon = select(3, GetSpellInfo(spellId)) local icon = select(3, GetSpellInfo(spellId))
allstates[spellId] = { allstates[spellId] = {
show = true, show = true,
changed = true, changed = true,
index = GetTime(), index = GetTime(),
resort = true, resort = true,
icon = icon, icon = icon,
progressType = "timed", progressType = "timed",
expirationTime = GetTime() + iconDisplayDuration, expirationTime = GetTime() + iconDisplayDuration,
duration = iconDisplayDuration, duration = iconDisplayDuration,
autoHide = true, autoHide = true,
} }
end end
aura_env.cache[spellId].ready = isReady aura_env.cache[spellId].ready = isReady
end end
end end

View File

@@ -1,28 +1,28 @@
-- COMBAT_LOG_EVENT_UNFILTERED -- COMBAT_LOG_EVENT_UNFILTERED
function(allstates, e, ...) function(allstates, e, ...)
local iconDisplayDuration = 0.5 local iconDisplayDuration = 0.5
local se = select(2, ...) local se = select(2, ...)
if (se ~= "SPELL_AURA_APPLIED") then return end if (se ~= "SPELL_AURA_APPLIED") then return end
local target = select(9, ...) local target = select(9, ...)
if (target ~= UnitName("player")) then return end if (target ~= UnitName("player")) then return end
local auraType = select(15, ...) local auraType = select(15, ...)
if (auraType ~= "DEBUFF") then return end if (auraType ~= "DEBUFF") then return end
local spellId = select(12, ...) local spellId = select(12, ...)
print(select(3, GetSpellInfo(spellId))) print(select(3, GetSpellInfo(spellId)))
allstates[spellId] = { allstates[spellId] = {
show = true, show = true,
changed = true, changed = true,
index = GetTime(), index = GetTime(),
resort = true, resort = true,
icon = select(3, GetSpellInfo(spellId)), icon = select(3, GetSpellInfo(spellId)),
name = select(13, ...), name = select(13, ...),
progressType = "timed", progressType = "timed",
expirationTime = GetTime() + iconDisplayDuration, expirationTime = GetTime() + iconDisplayDuration,
duration = iconDisplayDuration, duration = iconDisplayDuration,
autoHide = true, autoHide = true,
} }
return true return true
end end

View File

@@ -1,5 +1,5 @@
-- DevTools_Dump(aura_env.region) -- DevTools_Dump(aura_env.region)
-- aura_env.region:SetParent(aura_env.state.frame) -- aura_env.region:SetParent(aura_env.state.frame)
aura_env.region:ClearAllPoints() aura_env.region:ClearAllPoints()
aura_env.region:SetPoint("TOPLEFT", aura_env.state.frame.AuraWatch, "TOPLEFT", 0, 0) aura_env.region:SetPoint("TOPLEFT", aura_env.statee.frame.AuraWatch, "TOPLEFT", 0, 0)
aura_env.region:Show() aura_env.region:Show()

View File

@@ -1,29 +1,29 @@
local raidFrames = ElvUF_Raid local raidFrames = ElvUF_Raid
local group1, group2, group3, group4, group5, group6 = raidFrames:GetChildren() local group1, group2, group3, group4, group5, group6 = raidFrames:GetChildren()
local groups = { group1, group2, group3, group4, group5, group6 } local groups = { group1, group2, group3, group4, group5, group6 }
aura_env.players = {} aura_env.players = {}
for _, group in ipairs(groups) do for _, group in ipairs(groups) do
local playerFrame1, playerFrame2, playerFrame3, playerFrame4, playerFrame5 = group:GetChildren() local playerFrame1, playerFrame2, playerFrame3, playerFrame4, playerFrame5 = group:GetChildren()
local playerFrames = { playerFrame1, playerFrame2, playerFrame3, playerFrame4, playerFrame5 } local playerFrames = { playerFrame1, playerFrame2, playerFrame3, playerFrame4, playerFrame5 }
for _, player in ipairs(playerFrames) do for _, player in ipairs(playerFrames) do
if player.Name:IsVisible() then if player.Name:IsVisible() then
aura_env.players[#aura_env.players + 1] = player aura_env.players[#aura_env.players + 1] = player
end end
end end
end end
local specs = { local specs = {
-- We can't get unit spec.......... -- We can't get unit spec..........
-- Best we can do is class -- Best we can do is class
-- That fucking sucks -- That fucking sucks
} }
aura_env.Player = { aura_env.Player = {
new = function(self, player) new = function(self, player)
setmetatable({}, self) setmetatable({}, self)
self.frame = nil self.frame = nil
self.danger = 0 self.danger = 0
return self return self
end, end,
} }

View File

@@ -1,22 +1,22 @@
-- TSU -- TSU
function(allstates, e) function(allstates, e)
if aura_env.players == nil then if aura_env.players == nil then
aura_env.players = {} aura_env.players = {}
end end
for _,player in ipairs(aura_env.players) do for _,player in ipairs(aura_env.players) do
allstates[player.Name:GetText()] = { allstates[player.Name:GetText()] = {
show = true, show = true,
changed = true, changed = true,
name = 0.13, name = 0.13,
frame = player, frame = player,
icon = player.RaidIcon, icon = player.RaidIcon,
progressType = "static", progressType = "static",
value = 1, value = 1,
total = 1, total = 1,
autoHide = true, autoHide = true,
resort = true, resort = true,
} }
end end
return true return true
end end

View File

@@ -1,7 +1,7 @@
-- COMBAT_LOG_EVENT_UNFILTERED -- COMBAT_LOG_EVENT_UNFILTERED
function(allstates, e, ...) function(allstates, e, ...)
local caster = select(6, ...) local caster = select(6, ...)
local target = select(10, ...) local target = select(10, ...)
aura_env.processEvent(allstates, caster, target) aura_env.processEvent(allstates, caster, target)
end end

View File

@@ -1,90 +1,90 @@
if not WeakAurasSaved.Cyka then WeakAurasSaved.Cyka = {} end if not WeakAurasSaved.Cyka then WeakAurasSaved.Cyka = {} end
if not WeakAurasSaved.Cyka.Cache then WeakAurasSaved.Cyka.Cache = {} end if not WeakAurasSaved.Cyka.Cache then WeakAurasSaved.Cyka.Cache = {} end
if not WeakAurasSaved.Cyka.Cache.PlayerInfo then WeakAurasSaved.Cyka.Cache.PlayerInfo = {} end if not WeakAurasSaved.Cyka.Cache.PlayerInfo then WeakAurasSaved.Cyka.Cache.PlayerInfo = {} end
local allianceRaces = { local allianceRaces = {
"Draenai", "Draenai",
"Dwarf", "Dwarf",
"Gnome", "Gnome",
"Human", "Human",
"Night Elf", "Night Elf",
"Worgen" "Worgen"
} }
PlayerController = { PlayerController = {
nearbyPlayers = {}, nearbyPlayers = {},
addPlayer = function(self, name) addPlayer = function(self, name)
self.nearbyPlayers[name] = Player:New(name) self.nearbyPlayers[name] = Player:New(name)
end, end,
getPlayers = function(self) getPlayers = function(self)
end, end,
process = function(guid) process = function(guid)
if (self.nearbyPlayers[guid] == nil) then if (self.nearbyPlayers[guid] == nil) then
self.addPlayer(guid) self.addPlayer(guid)
else else
end end
end end
} }
Player = { Player = {
guid = nil, guid = nil,
lastSighted = nil, lastSighted = nil,
info = nil, info = nil,
update = function(self) update = function(self)
self.lastSighted = GetTime() self.lastSighted = GetTime()
end, end,
getFormatted = function(self) getFormatted = function(self)
-- Color by class -- Color by class
-- Format time -- Format time
return info.name .. " " .. self.lastSighted return info.name .. " " .. self.lastSighted
end end
} }
PlayerInfo = { PlayerInfo = {
class = nil, class = nil,
race = nil, race = nil,
name = nil, name = nil,
isHostile = nil, isHostile = nil,
} }
function Player:New(guid) function Player:New(guid)
o = {} o = {}
setmetatable(o, self) setmetatable(o, self)
self.__index = self self.__index = self
o.guid = guid or "" o.guid = guid or ""
o.lastSighted = GetTime() o.lastSighted = GetTime()
o.info = PlayerInfo:New(guid) o.info = PlayerInfo:New(guid)
return o return o
end end
function PlayerInfo:New(guid) function PlayerInfo:New(guid)
o = {} o = {}
setmetatable(o, self) setmetatable(o, self)
self.__index = self self.__index = self
local info local info
if WeakAurasSaved.Cyka.Cache.PlayerInfo[guid] then if WeakAurasSaved.Cyka.Cache.PlayerInfo[guid] then
info = WeakAurasSaved.Cyka.Cache.PlayerInfo[guid] info = WeakAurasSaved.Cyka.Cache.PlayerInfo[guid]
else else
info = GetPlayerInfoByGUID(guid) info = GetPlayerInfoByGUID(guid)
WeakAurasSaved.Cyka.Cache.PlayerInfo[guid] = { WeakAurasSaved.Cyka.Cache.PlayerInfo[guid] = {
class = info.class, class = info.class,
race = info.race, race = info.race,
name = info.name, name = info.name,
isHostile = allianceRaces[race] ~= nil isHostile = allianceRaces[race] ~= nil
} }
end end
o.class = info.class or "" o.class = info.class or ""
o.race = info.race or "" o.race = info.race or ""
o.name = info.name or "" o.name = info.name or ""
o.isHostile = info.isHostile or true o.isHostile = info.isHostile or true
return o return o
end end
aura_env.processEvent = function(caster, target) aura_env.processEvent = function(caster, target)
PlayerController:process(caster) PlayerController:process(caster)
PlayerController:process(target) PlayerController:process(target)
end end

View File

@@ -1,8 +1,8 @@
-- SPELL_UPDATE_CHARGES -- SPELL_UPDATE_CHARGES
function(e) function(e)
local charges = aura_env.getCharges() local charges = aura_env.getCharges()
if (charges ~= aura_env.currentCharges) then if (charges ~= aura_env.currentCharges) then
aura_env.currentCharges = charges aura_env.currentCharges = charges
return true return true
end end
end end

View File

@@ -1,5 +1,5 @@
aura_env.getCharges = function() aura_env.getCharges = function()
return select(1, GetSpellCharges(53600)) return select(1, GetSpellCharges(53600))
end end
aura_env.currentCharges = 0 aura_env.currentCharges = 0

View File

@@ -1,3 +1,3 @@
function() function()
return aura_env.getCharges() return aura_env.getCharges()
end end

View File

@@ -1,8 +1,8 @@
aura_env.findAura = function(LFname) aura_env.findAura = function(LFname)
for i = 1, 40 do for i = 1, 40 do
local name = UnitAura("player", i) local name = UnitAura("player", i)
if (name == LFname) then if (name == LFname) then
return i return i
end end
end end
end end

View File

@@ -1,3 +1,3 @@
function() function()
return -select(17, UnitAura("player", aura_env.findAura("Shield of the Righteous"))) .. "%" return -select(17, UnitAura("player", aura_env.findAura("Shield of the Righteous"))) .. "%"
end end