Quantcast
WoWInterface - View Single Post - Detecting World PvP Zones
View Single Post
06-15-15, 11:02 AM   #6
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,289
Originally Posted by Banknorris View Post
I try to avoid to use SetMapToCurrentZone() as much as I can (so far I could totally avoid it) because it will interfere with the user watching another map. The alternative approach that works well is to use GetInstanceInfo()

Code:
local _,_,_,_,_,_,_,zone = GetInstanceInfo()
if zone==1191 then
	print("I am in Ashran")
elseif zone==732 then
	print("I am in Tol Barad")
end
This approach does NOT work in Wintergrasp though because when you are there you will get the 571 return which is the Northrend id both during Wintergrasp battle or between battles (when it is like any Northrend zone).
You can use this to detect if the battle is active or not:

http://wowprogramming.com/docs/api/GetWorldPVPAreaInfo
  Reply With Quote