@@ -23,13 +23,17 @@ local strlowerCache = TMW.strlowerCache
2323
2424local _ , pclass = UnitClass (" Player" )
2525
26+ local wipe =
27+ wipe
2628local GetTalentInfo , GetNumTalents , GetGlyphLink , GetSpellInfo =
2729 GetTalentInfo , GetNumTalents , GetGlyphLink , GetSpellInfo
2830local GetSpecializationInfo , GetNumSpecializationsForClassID , GetSpecializationInfoForClassID , GetNumClasses , GetClassInfo =
2931 GetSpecializationInfo , GetNumSpecializationsForClassID , GetSpecializationInfoForClassID , GetNumClasses , GetClassInfo
3032local GetNumBattlefieldScores , RequestBattlefieldScoreData , GetBattlefieldScore , GetNumArenaOpponents , GetArenaOpponentSpec =
3133 GetNumBattlefieldScores , RequestBattlefieldScoreData , GetBattlefieldScore , GetNumArenaOpponents , GetArenaOpponentSpec
32-
34+ local UnitAura , IsInJailersTower , C_SpecializationInfo , GetPvpTalentInfoByID =
35+ UnitAura , IsInJailersTower , C_SpecializationInfo , GetPvpTalentInfoByID
36+
3337local ConditionCategory = CNDT :GetCategory (" TALENTS" , 1.4 , L [" CNDTCAT_TALENTS" ], true , false )
3438
3539
@@ -353,8 +357,9 @@ function CNDT:PLAYER_TALENT_UPDATE()
353357 wipe (Env .TalentMap )
354358 for tier = 1 , MAX_TALENT_TIERS do
355359 for column = 1 , NUM_TALENT_COLUMNS do
356- local id , name , _ , selected = GetTalentInfo (tier , column , 1 )
360+ local id , name , _ , selected , available , _ , _ , _ , _ , _ , grantedByAura = GetTalentInfo (tier , column , 1 )
357361 local lower = name and strlowerCache [name ]
362+ selected = selected or grantedByAura
358363 if lower then
359364 Env .TalentMap [lower ] = selected
360365 Env .TalentMap [id ] = selected
@@ -404,6 +409,7 @@ ConditionCategory:RegisterCondition(9, "TALENTLEARNED", {
404409
405410CNDT .Env .AzeriteEssenceMap = {}
406411CNDT .Env .AzeriteEssenceMap_MAJOR = {}
412+ local C_AzeriteEssence = C_AzeriteEssence
407413function CNDT :AZERITE_ESSENCE_UPDATE ()
408414 wipe (Env .AzeriteEssenceMap )
409415 wipe (Env .AzeriteEssenceMap_MAJOR )
@@ -460,6 +466,66 @@ for i, kind in TMW:Vararg("", "_MAJOR") do
460466 })
461467end
462468
469+ local AnimaPowWatcher = TMW :NewModule (" ANIMAPOW" , " AceEvent-3.0" )
470+ local currentAnimaPows = {}
471+ Env .CurrentAnimaPows = currentAnimaPows
472+ function AnimaPowWatcher :Init ()
473+ self :RegisterEvent (" PLAYER_ENTERING_WORLD" , " OnLocationUpdate" )
474+ self :OnLocationUpdate ()
475+ end
476+ function AnimaPowWatcher :OnLocationUpdate ()
477+ if IsInJailersTower () and not self .watching then
478+ self :RegisterEvent (" UNIT_AURA" )
479+ self .watching = true
480+ self :UNIT_AURA (nil , " player" )
481+ elseif not IsInJailersTower () and self .watching then
482+ wipe (currentAnimaPows )
483+ TMW :Fire (" TMW_ANIMA_POWER_COUNT_CHANGED" )
484+ self :UnregisterEvent (" UNIT_AURA" )
485+ self .watching = false
486+ end
487+ end
488+ function AnimaPowWatcher :UNIT_AURA (_ , unit )
489+ if unit ~= " player" then return end
490+
491+ for i = 1 , 300 do
492+ local name , _ , count , _ , _ , _ , _ , _ , _ , spellID = UnitAura (" player" , i , " MAW" );
493+ if not spellID then return end
494+ if count == 0 then
495+ count = 1 ;
496+ end
497+
498+ if currentAnimaPows [spellID ] ~= count then
499+ currentAnimaPows [spellID ] = count ;
500+ currentAnimaPows [strlowerCache [name ]] = count ;
501+ TMW :Fire (" TMW_ANIMA_POWER_COUNT_CHANGED" )
502+ end
503+ end
504+ end
505+
506+
507+ ConditionCategory :RegisterCondition (9.4 , " ANIMAPOW" , {
508+ text = L [" UIPANEL_ANIMAPOW" ],
509+ range = 5 ,
510+ unit = PLAYER ,
511+ name = function (editbox )
512+ editbox :SetTexts (L [" SPELLTOCHECK" ], L [" CNDT_ONLYFIRST" ])
513+ end ,
514+ useSUG = true ,
515+ icon = 3528304 ,
516+ tcoords = CNDT .COMMON .standardtcoords ,
517+ funcstr = function (ConditionObject , c )
518+ AnimaPowWatcher :Init ()
519+ return [[ (CurrentAnimaPows[LOWER(c.NameFirst)] or 0) c.Operator c.Level]]
520+ end ,
521+ events = function (ConditionObject , c )
522+ return
523+ ConditionObject :GenerateNormalEventString (" TMW_ANIMA_POWER_COUNT_CHANGED" )
524+ end ,
525+ })
526+
527+
528+
463529
464530
465531ConditionCategory :RegisterCondition (9 , " PTSINTAL" , {
0 commit comments