WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   Script that checks if I learned PvP Talent and display tooltip accordingly (https://www.wowinterface.com/forums/showthread.php?t=58293)

Cretch21 10-15-20 07:14 PM

Script that checks if I learned PvP Talent and display tooltip accordingly
 
Hey guys, I'm looking to see if its possible to create a script that can identify if I've chosen a specific PvP Talent and then display it on my bars. If I haven't chosen that specific PvP Talent, it would then display a different (baseline) ability. Does it sound doable? Thank you!

Cretch21 10-15-20 07:49 PM

And if someone develops this there will definitely be a donation headed your way!

Sylen 10-16-20 06:13 AM

I remember this beeing not possible as it is not supported by the Blizzard API since they switched from the Legion design to the BfA / SL design.

Cretch21 10-16-20 11:39 AM

On Reddit, user "Draakex" was able to show me a script he/she uses that is almost what I'm looking for.

local frame = CreateFrame("FRAME", "PvPTalentMacros");
frame:RegisterEvent("PLAYER_PVP_TALENT_UPDATE");
frame:RegisterEvent("ADDON_LOADED");
frame:RegisterEvent("PLAYER_ENTERING_WORLD");
local function eventHandler(self, event, ...)
for mi = 1, _G.MAX_ACCOUNT_MACROS + _G.MAX_CHARACTER_MACROS do
local name, icon, body = GetMacroInfo(mi)
local currentSpec = GetSpecialization()
local playerClass, englishClass = UnitClass("player")
if englishClass == "PRIEST" and currentSpec == 1 then
print(englishClass,currentSpec,name)
if string.find(body,"Archangel") then
local G=GetSpellInfo SetMacroSpell(name, G"Archangel(PvP Talent)" or G"Dark Archangel(PvP Talent)")
break
end
end
end
end
frame:SetScript("OnEvent", eventHandler);

The only difference is that it displays two different PvP Talents. I would like a script that either displays the PvP Talent if its talented, or displays a baseline ability if its not.


All times are GMT -6. The time now is 07:22 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI