@@ -138,6 +138,7 @@ local defaults = {
138
138
139
139
-- Default companions
140
140
companions = {
141
+ [" 1" ] = CompanionDefaults (false , " 1" , " Level Up" , " " , soundOptions .broncena , " DING! Bron Cena says grats on level %s!" , nil , " PLAYER_LEVEL_UP" ),
141
142
[" 333961" ] = CompanionDefaults (false , " 333961" , " Bron Cena" , " " , soundOptions .broncena , " And his name is BRON CENA!" ),
142
143
[" 324739" ] = CompanionDefaults (true , " 324739" , " Kyrian Steward" , " " , soundOptions .metalgear , " A wild %s appears!" , 0.8 ),
143
144
[" 368241" ] = CompanionPlayerDefaults (true , " 368241" , " Wo Speed Buff" , " " , soundOptions .yaketysax , nil , nil , " SPELL_AURA_APPLIED" ),
@@ -603,17 +604,20 @@ end
603
604
604
605
function BronCena :OnEnable ()
605
606
BronCena :RegisterEvent (" COMBAT_LOG_EVENT_UNFILTERED" )
607
+ BronCena :RegisterEvent (" PLAYER_LEVEL_UP" )
606
608
if self .parsingTooltip == nil then
607
609
self .parsingTooltip = CreateFrame (" GameTooltip" , APPNAME .. " Tooltip" , WorldFrame , " GameTooltipTemplate" )
608
610
end
609
611
end
610
612
611
613
function BronCena :OnDisable ()
612
614
self :Debug (" OnDisable" )
615
+ BronCena :UnregisterEvent (" PLAYER_LEVEL_UP" )
613
616
BronCena :UnregisterEvent (" COMBAT_LOG_EVENT_UNFILTERED" )
614
617
end
615
618
616
619
local getOwner = function (sourceFlags )
620
+ if sourceFlags == nill then return nill end
617
621
if bit .band (sourceFlags , COMBATLOG_OBJECT_REACTION_HOSTILE ) == COMBATLOG_OBJECT_REACTION_HOSTILE then return " hostile" end
618
622
if bit .band (sourceFlags , COMBATLOG_OBJECT_AFFILIATION_PARTY ) == COMBATLOG_OBJECT_AFFILIATION_PARTY then return " party" end
619
623
if bit .band (sourceFlags , COMBATLOG_OBJECT_AFFILIATION_RAID ) == COMBATLOG_OBJECT_AFFILIATION_RAID then return " raid" end
@@ -622,20 +626,22 @@ local getOwner = function(sourceFlags)
622
626
return nil
623
627
end
624
628
625
- function BronCena :COMBAT_LOG_EVENT_UNFILTERED (...)
629
+ function BronCena :PLAYER_LEVEL_UP (subevent , newLevel )
630
+ self :TriggerBron (1 , subevent , tostring (newLevel ), nil )
631
+ end
626
632
633
+ function BronCena :COMBAT_LOG_EVENT_UNFILTERED (...)
627
634
local timestamp , subevent , _ , sourceGUID , sourceName , sourceFlags , sourceRaidFlags , destGUID , destName , destFlags , destRaidFlags , spellId , spellName = CombatLogGetCurrentEventInfo ()
635
+ self :TriggerBron (spellId , subevent , destName , sourceFlags )
636
+ end
637
+
638
+ function BronCena :TriggerBron (spellId , subevent , destName , sourceFlags )
628
639
629
640
if self .db .profile .disabled == true then
630
641
-- self:Debug("Add-on is disabled")
631
642
return
632
643
end
633
644
634
- -- Debug: We can log out summoned units to help figure out spell ids to support new summons.
635
- if subevent == " SPELL_SUMMON" then
636
- -- self:Printf("%s summoned %s using %s (%d)", tostring(sourceName), tostring(destName), tostring(spellName), tostring(spellId))
637
- end
638
-
639
645
-- See if this spellId is supported
640
646
local companion = self .db .profile .companions [tostring (spellId )]
641
647
0 commit comments