There does not appear to be a convenient API for that, but I'd like to be proven wrong.
Originally Posted by millanzarreta
I have tested the IsSpellKnown function to detect if an ability is known, but the result is always "false" even if you have selected it and with war mode on, and even if this is an active spell and not a passive spell.
|
IsSpellKnown() works for me with the spell ID returned by the aforementioned
GetPvpTalentInfoByID()
For example the Holy Priest [Greater Heal] pvp talent:
Lua Code:
"|cff71d5ff|Hpvptal:112|h[Greater Heal]|h|r"
"|cff71d5ff|Hspell:289666:0|h[Greater Heal]|h|r"
/dump GetPvpTalentInfoByID(112) -- 6th return is the spell id
/dump IsSpellKnown(289666) -- returns true when usable and false when not
IsPlayerSpell() seems to work for both passive/non-passive pvp talents, while
IsSpellKnown() only works for non-passive pvp talents.
Lua Code:
local function ArePvpTalentsActive()
local talents = C_SpecializationInfo.GetAllSelectedPvpTalentIDs()
for _, pvptalent in pairs(talents) do
local spellID = select(6, GetPvpTalentInfoByID(pvptalent))
if IsPlayerSpell(spellID) then
return true
end
end
end
local function OnEvent(self, event, ...)
local status = ArePvpTalentsActive() and "active" or "not active"
print("PvP Talents are "..status)
end
local f = CreateFrame("Frame")
f:RegisterEvent("SPELLS_CHANGED")
f:SetScript("OnEvent", OnEvent)
Originally Posted by millanzarreta
since even without War Mode you can activate PvP to enter combat with other players (it can be activated manually, or it also remains activated for 5 minutes when you deactivate WarMode in a city ).
|
Activating it manually with warmode off and using /pvp did not seem to activate the pvp talents for me. But I assume it does indeed get activated when you enter combat with other players.