Any easy way to detect that pvp talents are active?
Hi!
I thought it would be easy, but I can't find any way to detect if PvP talents are active or not, is there any way or function to detect this? From what I have tested, the logic that PvP talents follow is: - Always active in instantiated PvP zones (arena, BGs, brawls) - Never active in instantiated PvE zones (dungeons, raids, scenarios, ...) - Always active in Free for All PvP areas of the world (regardless of the selected war mode) - Always active in the open world when you have War Mode On - In the open world with War Mode Off, PvP talents are deactivated, but if you enter PvP combat they are activated, and they are deactivated again after a while Based on the above, a certain logic can be built to detect if PvP talents are available or not. But the last point is the most problematic 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 ). 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. I have also tested the IsSpellUsable function, but the result is always "true". The GetPvpTalentInfoByID(talentId) function gives information about whether you have the selected talent or not, but not whether it is active or not at a certain time. And something similar for the GetPvpTalentSlotInfo(slot) function. The UnitIsPVP("player") function is the closest thing I know of, but it doesn't work either, since it only tells you if the player is marked for PvP, but this does not necessarily mean that they have active PvP talents. For example, you are flagged for PvP in hostile zones even if you have war mode off. What do you think is the best way to detect that you have active PvP talents? Is there an easy way to detect it or do you have to check in which area you are and in some cases also check if you have the PvP Mode On or Off? |
There does not appear to be a convenient API for that, but I'd like to be proven wrong.
Quote:
IsSpellKnown() works for me with the spell ID returned by the aforementioned GetPvpTalentInfoByID() For example the Holy Priest [Greater Heal] pvp talent: Lua Code:
IsPlayerSpell() seems to work for both passive/non-passive pvp talents, while IsSpellKnown() only works for non-passive pvp talents. Lua Code:
Quote:
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. |
Weird how people make a lengthy post on their problem and then just, don't respond
|
Ohh please don't be mad, it's only been two days, lately I've had hard work and I couldn't do much about this. Although I have been able to see the reply, I wanted to answer you after having tried your solution and verify if it worked for me or if there was a problem to give you my opinion. Tomorrow is Friday and I will be able to dedicate more time to this. Seriously, thanks a lot for the help :)
|
Quote:
Quote:
Good point about the SPELLS_CHANGED event, seems to fire always when PvP talents go ON or OFF (although obviously it can also be triggered on many other occasions, it's ok for what I needed) Quote:
I used your function with minor modifications: Lua Code:
I add a previous check of IsInInstance() to fast-check if the player is in PvP instance or PvE instance, where as far as I know the PvP talents are always enabled and disabled respectively. Surely this is not necessary, but it seems better to me this way. Thank you a lot, greetings :) |
Glad I could help
|
All times are GMT -6. The time now is 03:41 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI