I don't know for sure if POIIndices ever change. I've only been messing with them & the map for the last couple of days, but I don't recall seeing any of them change value.
Maybe someone else with more experience with them could comment on that, but this seems to work:
Lua Code:
local iZoneIdex, iPoiIndex = GetCurrentSubZonePOIIndices()
if iZoneIdex == 353 and iPoiIndex == 74 then
d("In dragonstar")
end
**** EDIT: ****************************************
I should have clarified you asked how to detect the change. You could check it in the EVENT_ZONE_CHANGED
Lua Code:
local function onZoneChanged(eventCode, zoneName, subZoneName, newSubzone)
if subZoneName == GetPOIInfo(353, 74) then
d("I'M IN DRAGONSTAR")
else
d("I'm not in dragonstar")
end
EVENT_MANAGER:RegisterForEvent(WaypointIt.name, EVENT_ZONE_CHANGED, onZoneChanged)
**************************************************
Or if you want to be safe, use the POIIndex to get the objectiveName and see if its "Dragonstar"
Lua Code:
local iZoneIdex, iPoiIndex = GetCurrentSubZonePOIIndices()
if iZoneIdex == 353 and iPoiIndex == 74 then
d("In dragonstar")
end
local objectiveName, objectiveLevel, startDescription, finishedDescription = GetPOIInfo(iZoneIdex, iPoiIndex)
if iZoneIdex == 353 and objectiveName == "Dragonstar" then
d("Also in dragonstar")
end