View Single Post
03/18/23, 06:54 AM   #7
Shuba00
 
Shuba00's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2023
Posts: 20
Originally Posted by Baertram View Post
Event_zone_changed does not fire for all changed zones afaik, only if you are e.g. inside a city and step out to the worldmap again etc.

Try EVENT_PLAYER_ACTIVATED instead (fires after login, loading screens where you changed a zone etc.). You can do the zone check there, by using
API functions like

Lua Code:
  1. local zoneIndex = GetCurrentMapZoneIndex()
  2. --Either:
  3. local zoneName = zo_strformat(SI_UNIT_NAME, GetZoneNameByIndex(zoneIndex))
  4. --or if you also need the zoneId:
  5. local zoneId = GetZoneId(zoneIndex)
  6. local zoneName = zo_strformat(SI_UNIT_NAME, GetZoneNameById(zoneId))
  7.  
  8. --Parent zoneId is the id of the parent's zone, e.g. if you are inside a delve in Alik'r Desert the zoneId is the one of the delve and the parentZoneId is the one of the zone (e.g. Alik'r)
  9. loca parentZoneId = GetarentZoneId(zoneId)
etc.

TY , this helped me a lot
  Reply With Quote