View Single Post
01/27/15, 09:31 PM   #3
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
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:
  1. local iZoneIdex, iPoiIndex = GetCurrentSubZonePOIIndices()
  2. if iZoneIdex == 353 and iPoiIndex == 74 then
  3.     d("In dragonstar")
  4. end

**** EDIT: ****************************************
I should have clarified you asked how to detect the change. You could check it in the EVENT_ZONE_CHANGED
Lua Code:
  1. local function onZoneChanged(eventCode, zoneName, subZoneName, newSubzone)    
  2. if subZoneName == GetPOIInfo(353, 74) then
  3.       d("I'M IN DRAGONSTAR")
  4. else
  5.       d("I'm not in dragonstar")
  6. end
  7.  
  8. 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:
  1. local iZoneIdex, iPoiIndex = GetCurrentSubZonePOIIndices()
  2. if iZoneIdex == 353 and iPoiIndex == 74 then
  3.     d("In dragonstar")
  4. end
  5.  
  6. local objectiveName, objectiveLevel, startDescription, finishedDescription = GetPOIInfo(iZoneIdex, iPoiIndex)
  7. if iZoneIdex == 353 and objectiveName == "Dragonstar" then
  8.     d("Also in dragonstar")
  9. end

Last edited by circonian : 01/27/15 at 10:27 PM.
  Reply With Quote