it's not like you have paid the developer and you are entitled to anything. But SURE go to Skada, since they don't even manage to track the Mage Crystal in a correct way.
Btw Recount was updated an hour ago and the error is gone.
I wanted to do a little BladeFlurry thingie and didn't want to do a whole addon for it. So I added a new frame, registered the combatlog event and tried to get arg12 (spellID since BladeFlurry is considered SPELL_DAMAGE) to work but not much luck so far.
I have read on the main page that kgPanels only registers the first 10 arguments - so is there a way to get my spellID or do I have to put it in a seperate addon?
I got a little problem with some regular expressions. I already had a look in the LUA tutorial thingie and also googled for it, but either I don't understand regex or wow doesn't like me. I guess the first =)
well I simply want to replace a number
########
with
##.###.###
well since the number can be anything from 0 to ~40m, I cannot use string.gsub(cur, "^(-?%d+)(%d%d%d)(%d%d%d)", "%1.%2.%3") since it wouldn't cover the case when the number is below 1m. I tried inserting some ? and * but well I think I got it wrong.
(the code above is from one of the tutorials and is normally used in a while loop, but since my number is always below 100m I don't need a loop.. I think)
That's an even better fix - nice one.
Since I don't have much experience with the 3d models and I only knew that it worked in x-perl I had a quick look on how they solved the problem and, as I wanted it, someone with more experience developed a "clean" code example.
Well I have finally found a fix for the Worgen Male 3D Picture issue.
okay, to be fair - I have "stolen" most of the code from the X-Perl Addon, to be exact from PlayerLin, who had fixed it there.
Pitbull4_Portrait/Portrait.lua - Line 111++ (just add the new funtion and replace the old one)
-- Some models have camera views switched for face/body or just don't look right with face
local alternateCamera = {
[21717] = true, -- Dragonmaw Wrangler
[21718] = true, -- Dragonmaw Subjugator
[21719] = true, -- Dragonmaw Drake-Rider
[21720] = true, -- Dragonmaw Shaman
[22231] = true, -- Dragonmaw Elite
[22252] = true, -- Dragonmaw Peon
[23188] = true, -- Dragonmaw Transporter
[28859] = true, -- Malygos
[33136] = true, -- Guardian of Yogg-Saron
[33687] = true, -- Chillmaw
[33845] = true, -- Quel'dorei Steed
[37230] = true, -- Spire Frostwyrm (ICC)
[37955] = true, -- Blood Queen Lana'thel
[40561] = true, -- Deep Corruptor
[41378] = true, -- Maloriak (Blackwing Depths)
[39392] = true, -- Faceless Corruptor
}
local dragonmawIllusion = GetSpellInfo(42016)
local function model_OnUpdate(self, elapsed)
local frame = self:GetParent()
local style = frame.Portrait.style
local full_body = PitBull4_Portrait:GetLayoutDB(frame).full_body
if style == "pirate" then
self:SetUnit(frame.unit)
self:Undress()
self:TryOn(9636)
self:TryOn(6795)
self:TryOn(6835)
self:TryOn(6836)
self:TryOn(2955)
self:TryOn(3935)
if not full_body then
self:SetCamera(0)
end
elseif style == "three_dimensional" then
if not frame.Portrait.falling_back then
self:SetUnit(frame.unit)
local guid = UnitGUID(frame.unit)
local fullbody
--PlayerLin: Added other checks, UnitIsPlayer check isn't enough and it's weird...
-- if UnitIsPlayer(argUnit) or UnitIsEnemy(argUnit, "target") or UnitIsFriend(argUnit, "target") then
--Male Worgen 3D Portrait fix, thanks sontix.
if string.find(tostring(self:GetModel()), "worgenmale", 1, true) ~= nil then
fullbody = true
else
fullbody = UnitBuff(frame.unit, dragonmawIllusion)
end
-- end
local id = guid and tonumber(strsub(guid, -13, -9), 16)
if (alternateCamera[id] or fullbody) then
self:SetCamera(1)
elseif not full_body then
self:SetCamera(0)
end
else
self:SetModelScale(4.25)
self:SetPosition(0, 0, -1.5)
self:SetModel([[Interface\Buttons\talktomequestionmark.mdx]])
end
-- work around a Blizzard bug that causes model frames not to
-- adjust their alpha realtive to their parent frames alpha after
-- the model is updated. So we nudge the alpha down a bit and
-- then back up to get it to update.
self:SetAlpha(0.9999999)
self:SetAlpha(1)
end
if type(self:GetModel()) == "string" then
-- the portrait was set properly, we can stop trying to set the portrait
self:SetScript("OnUpdate", nil)
end
end
Credits go to PlayerLin for the fix, I just "ported" it to PitBull !
well as I said it worked with my Wyvern Sting/Freezing Trap and so on.. but I dunno how it is displayed in the Combat Log - but after my raid this evening I'll test it.
.. and I can't find the reason why. Well sort of - but since I'm not THAT good with LUA it would be nice if someone could give me a hint. You don't have to "repair" all broken stuff - a link to a thread (if there's something I missed) is enough.
Addon:
SpellAlert_SpellData = {}
SpellAlert_SpellData.aggroSpells = {
34477, -- Misdirection / Irreführung
57934, -- Tricks of the Trade / Schurkenhandel
50720 -- Vigilance / Wachsamkeit
}
SpellAlert_SpellData.buffSpells = {
10060, -- Power Infusion / Seele der Macht
48788, -- Lay on Hands / Handauflegen
10278, -- Hand of Protection / Hand des Schutzes
47788, -- Guardian Spirit / Schutzgeist
49016, -- Hysteria / Bösartigkeit
29166 -- Innervate / Anregen
}
SpellAlert_SpellData.ccSpells = {
118, -- Polymorph / Verwandlung
9484, -- Shackle Undead / Untote Fesseln
18658, -- Hibernate / Winterschlaf
14309, -- Freezing Trap / Eiskältefalle
60210, -- Freezing Arrow / Eiskältepfeil
51724, -- Sap / Kopfnuss
20066, -- Repentance / Buße
5782, -- Fear / Furcht
2094, -- Blind / Blenden
51514, -- Hex / Verhexen
49012 -- Wyvern Sting / Stich des Flügeldrachen
}
local enable_ccSpells = true
local enable_buffSpells = true
local enable_aggroSpells = true
local enable_interruptSpells = false
local enable_dispelSpells = false
local chat_output = "SELF" -- "SELF", "SAY", "PARTY" or "RAID"
SpellAlert = AceLibrary("AceAddon-2.0"):new("AceConsole-2.0","AceDB-2.0","AceEvent-2.0")
addon = SpellAlert
local ccSpells = SpellAlert_SpellData.ccSpells
local buffSpells = SpellAlert_SpellData.buffSpells
local aggroSpells = SpellAlert_SpellData.aggroSpells
local AceEvent = AceLibrary("AceEvent-2.0")
function addon:OnEnable()
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
end
local ccSpellNames = {}
-- Create array for CC Spell IDs
for _, v in ipairs(ccSpells) do
local spellName = GetSpellInfo(v)
ccSpellNames[spellName] = true
end
local buffSpellNames = {}
-- Create array for Buff Spell IDs
for _, v in ipairs(buffSpells) do
local spellName = GetSpellInfo(v)
buffSpellNames[spellName] = true
end
local aggroSpellNames = {}
-- Create array for Aggro Spell IDs
for _, v in ipairs(aggroSpells) do
local spellName = GetSpellInfo(v)
aggroSpellNames[spellName] = true
end
local function geticon(flag)
if bit.band(flag, COMBATLOG_OBJECT_SPECIAL_MASK) ~= 0 then
for i=1,8 do
local mask = COMBATLOG_OBJECT_RAIDTARGET1 * (2 ^ (i - 1))
local mark = (bit.band(flag, mask) == mask)
if mark then return i end
end
end
return nil
end
local function geticonstring(number)
local path = COMBATLOG_OBJECT_RAIDTARGET1 * (number ^ (number - 1))
local format = "|Hicon:"..path..":dest|h|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_"..number..".blp:0|t|h"
return format
end
-- Check Combat Log for CC breaks
function addon:COMBAT_LOG_EVENT_UNFILTERED(timestamp, subevent, srcGUID, srcname, srcflags, dstGUID, dstname, dstflags, spellID, spellname, spellschool, extraspellID, extraspellname, extraspellschool, auratype)
local output = nil
local say_out = nil
if (subevent == "SPELL_AURA_BROKEN" or subevent == "SPELL_AURA_BROKEN_SPELL" or subevent == "SPELL_AURA_REMOVED")
and ccSpellNames[spellname]
and (bit.band(dstflags, COMBATLOG_OBJECT_REACTION_HOSTILE) ~= 0)
and enable_ccSpells then
local srcicon = geticon(srcflags)
local srcout = srcicon and geticonstring(srcicon)..srcname or srcname
local dsticon = geticon(dstflags)
local dstout = dsticon and geticonstring(dsticon)..dstname or dstname
if (subevent == "SPELL_AURA_BROKEN" and enable_ccSpells) then
link = "|Hspell:"..spellID.."|h["..spellname.."]|h"
output = ("|cffff4000%s|r on |cff0080ff%s|r <- |cff808080%s|r"):format(link, dstout, srcout)
say_out = (spellname.." on "..dstout.." <- "..srcout)
elseif (subevent == "SPELL_AURA_BROKEN_SPELL" and enable_ccSpells)then
link = "|Hspell:"..spellID.."|h["..spellname.."]|h"
link2 = "|Hspell:"..extraspellID.."|h["..extraspellname.."]|h"
output = ("|cffff4000%s|r on |cff0080ff%s|r <- |cff808080%s's %s|r"):format(link, dstout, srcout, link2)
say_out = (spellname.." on "..dstout.." <- "..srcout.."'s "..extraspellname)
elseif (subevent == "SPELL_AURA_REMOVED" and (spellID == 51514 or spellID == 20066) and enable_ccSpells)then
link = "|Hspell:"..spellID.."|h["..spellname.."]|h"
output = ("|cffff4000%s|r on |cff0080ff%s|r <- |cff808080%s|r"):format(link, dstout, srcout)
say_out = (spellname.." on "..dstout.." <- "..srcout)
end
elseif (subevent == "SPELL_CAST_SUCCESS" and buffSpellNames[spellname] and enable_buffSpells) then
link = "|Hspell:"..spellID.."|h["..spellname.."]|h"
output = ("|cff80ff00%s|r -> |cff0080ff%s|r by |cff808080%s|r"):format(link, dstname, srcname)
say_out = (spellname.." -> "..dstname.." by "..srcname)
elseif (subevent == "SPELL_CAST_SUCCESS" and aggroSpellNames[spellname] and enable_aggroSpells) then
link = "|Hspell:"..spellID.."|h["..spellname.."]|h"
output = ("|cffffff00%s|r -> |cff0080ff%s|r by |cff808080%s|r"):format(link, dstname, srcname)
say_out = (spellname.." -> "..dstname.." by "..srcname)
end
if (subevent == "SPELL_INTERRUPT") and enable_interruptSpells
and (bit.band(dstflags, COMBATLOG_OBJECT_REACTION_HOSTILE) ~= 0) then
-- if srcname~=UnitName("player") then return end
link = "|Hspell:"..extraspellID.."|h["..extraspellname.."]|h"
output = ("|cffffc000%s|r from |cff0080ff%s|r <// |cff808080%s|r"):format(link, dstname, srcname)
say_out = ("Interrupted "..extraspellname.." from "..dstname.." by "..srcname)
elseif (subevent == "SPELL_DISPEL" or subevent == "SPELL_STOLEN") and enable_dispelSpells
and (bit.band(dstflags, COMBATLOG_OBJECT_REACTION_HOSTILE) ~= 0) then
-- if srcname~=UnitName("player") then return end
link = "|Hspell:"..extraspellID.."|h["..extraspellname.."]|h"
output = ("|cff00c0ff%s|r on |cff0080ff%s|r >> |cff808080%s|r"):format(link, dstname, srcname)
say_out = (extraspellname.." on "..dstname.." dispelled by "..srcname)
end
if output then
if (chat_output == "SELF") then
self:Print(output)
else
SendChatMessage(say_out, chat_output)
end
end
end
It's supposed to check for certain Buffs or CC breaks and post them into the Chat window.
Errors:
1x SpellAlert-1.0\SpellAlert.lua:56: table index is nil
1x SpellAlert-1.0\SpellAlert.lua:49: AceEvent-2.0: Cannot register event "COMBAT_LOG_EVENT_UNFILTERED" to method "COMBAT_LOG_EVENT_UNFILTERED", it does not exist
AceAddon-2.0-91100 (Ace2):979: in function <Ace2\AceAddon-2.0\AceAddon-2.0.lua:973>
<in C code>: ?
AceEvent-2.0-91097 (Ace2):260: in function `TriggerEvent'
AceEvent-2.0-91097 (Ace2):910: in function <Ace2\AceEvent-2.0\AceEvent-2.0.lua:903>
Before the Patch the Addon worked flawless w/o any problems and I didn't saw any great changes in the API (at least what I read about it - maybe I missed sth).
the original function is local and called within another local one (with the local variables and stuff aswell). So I guess there's no other way than altering the original code, right ?
0
Btw Recount was updated an hour ago and the error is gone.
0
I wanted to do a little BladeFlurry thingie and didn't want to do a whole addon for it. So I added a new frame, registered the combatlog event and tried to get arg12 (spellID since BladeFlurry is considered SPELL_DAMAGE) to work but not much luck so far.
I have read on the main page that kgPanels only registers the first 10 arguments - so is there a way to get my spellID or do I have to put it in a seperate addon?
0
0
I got a little problem with some regular expressions. I already had a look in the LUA tutorial thingie and also googled for it, but either I don't understand regex or wow doesn't like me. I guess the first =)
well I simply want to replace a number
########
with
##.###.###
well since the number can be anything from 0 to ~40m, I cannot use string.gsub(cur, "^(-?%d+)(%d%d%d)(%d%d%d)", "%1.%2.%3") since it wouldn't cover the case when the number is below 1m. I tried inserting some ? and * but well I think I got it wrong.
(the code above is from one of the tutorials and is normally used in a while loop, but since my number is always below 100m I don't need a loop.. I think)
any help ? ._.
0
Since I don't have much experience with the 3d models and I only knew that it worked in x-perl I had a quick look on how they solved the problem and, as I wanted it, someone with more experience developed a "clean" code example.
nice one.
0
okay, to be fair - I have "stolen" most of the code from the X-Perl Addon, to be exact from PlayerLin, who had fixed it there.
Pitbull4_Portrait/Portrait.lua - Line 111++ (just add the new funtion and replace the old one)
Credits go to PlayerLin for the fix, I just "ported" it to PitBull !
0
Wyvern Sting Works
Freezing Trap aswell
Does not show that the CC was removed.
you're right .. well maybe they change sth about it - but if not I'll guess I have to live with it.
0
0
0
0
Addon:
It's supposed to check for certain Buffs or CC breaks and post them into the Chat window.
Errors:
Before the Patch the Addon worked flawless w/o any problems and I didn't saw any great changes in the API (at least what I read about it - maybe I missed sth).
Thanks in advance.
0
0
0
@broes - yeah kinda like I actually DID it
but I didn't want to alter the original code (like I did now).
Also "PitBull4.Controls.MakeAura(frame)" is mostly (99%+) set as a local at the beginning of the function
0
the original function is local and called within another local one (with the local variables and stuff aswell). So I guess there's no other way than altering the original code, right ?