Quantcast
WoWInterface - View Single Post - Detecting World PvP Zones
View Single Post
06-18-15, 12:21 PM   #15
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,059
Ashran doesn't appear to be considered world pvp by IsInActiveWorldPVP() but GetZonePVPInfo() returns "combat" for the type and "true" for the second argument (which is incorrectly documented as meaning FFA and I'm not entirely sure what it means).

Depending on your definition of active pvp, I think something like this should work.

Lua Code:
  1. local function IsAreaActivePVP()
  2.     local _, instanceType = IsInInstance()
  3.     if instanceType == 'pvp' then return true end
  4.     local pvpType, isSubZonePVP = GetZonePVPInfo()
  5.     if pvpType == 'arena' or (pvpType == 'combat' and (isSubZonePVP or IsInActiveWorldPVP())) then return true end
  6.     return false
  7. end

Last edited by semlar : 06-18-15 at 01:37 PM.
  Reply With Quote