Talk:API GetPvpTalentInfoByID

From Warcraft Wiki
Jump to navigation Jump to search

C_SpecializationInfo.GetAllSelectedPvpTalentIDs() can be used to get a table with the full set of selected PVP Talent IDs and then those IDs can be fed back into GetPvpTalentInfoByID(talentID) to obtain the same information that was previously available with this function. However, GetPvpTalentInfo() has been removed from the API effective 2018-07-17 Mltco78dhs (talk) 09:56, 18 July 2018 (UTC) There is an oddity where GetPvpTalentInfoByID(talentID) works from the command line but does not work from within Lua. The error information is also odd in that it gives a usage error referencing GetTalentInfoByID (not GetPvpTalentInfoByID). I'm going to try to deconstruct what's happening here, but it may take me a while. Mltco78dhs (talk) 10:25, 18 July 2018 (UTC)

Uber (talk)I was running into the same issue. I figured out today for whatever reason if you run the command straight (ex. for i = 1,4 do _, name = GetPvpTalentInfoByID(C_SpecializationInfo.GetPvpTalentSlotInfo(i).selectedTalentID) print(name) end) it works.

GetPvpTalentInfoByID and GetPvpTalentInfo are two different functions, Uber. The ...ById one still works just fine. This is the page for GetPvpTalentInfo only.Mltco78dhs (talk) 19:26:00 31 July 2018 (CST)

According to your post just before mine, since you can no longer use GetPvpTalentInfo() you were using GetPvpTalentInfoByID and running into an issue where it would work from command line but not from Lua. I was seeing the same issue and I posted a solution to said issue which works as in place of GetPvpTalenInfo() that works in Lua as well. Uber (talk)

Ah. I see it. I misunderstood your intent. Yes. It does work in Lua now. When I tried it on July 18, it did not. I'm guessing one of the many micro-patches fixed that. Mltco78dhs (talk) 04:47, 2 August 2018 (UTC)

--- I found out how to check if a unit has a certain pvp talent selected in BFA:

   function()
       local talent = C_SpecializationInfo.GetInspectSelectedPvpTalent("player",1) -- 1 is the trinket slot and 2,3,4 are talent slots
       if talent == 3555 then 
           return true
       end
   end

to find the ID (e.g. 3555) of any pvp talent you can log on any class and run this:

   function()
       local t = C_SpecializationInfo.GetAllSelectedPvpTalentIDs()
       for key,value in pairs(t) do print(key,value) end
   end

this prints a table where you can find all 4 IDs of pvp talents that you have currently selected.

(I ran these functions via WeakAuras) (sorry if I shouldn't be posting this here...I'm a nooby and was so excited when it worked after 12 hours trying to figure this out) -- Thehehe03 (talk) 09:36, 2018 September 27‎