Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Register
Advertisement

Fires when the player enters a new zone.

ZONE_CHANGED_NEW_AREA

Payload[]

None

Details[]

  • For example this fires when moving from Duskwood to Stranglethorn Vale or Durotar into Orgrimmar.
  • In interface terms, this is anytime you get a new set of channels.
Related API GetChannelList
C_Map.GetMapInfo
GetZoneTextGetRealZoneText
Related Events ZONE_CHANGED

Example[]

When moving from Stormwind City to Elwynn Forest.

local function OnEvent(self, event, ...)
	local mapID = C_Map.GetBestMapForUnit("player")
	print(event, GetZoneText(), C_Map.GetMapInfo(mapID).name)
end

local f = CreateFrame("Frame")
f:RegisterEvent("ZONE_CHANGED_NEW_AREA")
f:SetScript("OnEvent", OnEvent)
> "ZONE_CHANGED_NEW_AREA", "Stormwind City", "Stormwind City"
> "ZONE_CHANGED_NEW_AREA", "Elwynn Forest", "Elwynn Forest
Advertisement