ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Wish List (https://www.esoui.com/forums/forumdisplay.php?f=177)
-   -   [implemented] Events for dark anchor and dark fissure completed (https://www.esoui.com/forums/showthread.php?t=8618)

Keldor 06/25/19 06:25 AM

[implemented] Events for dark anchor and dark fissure completed
 
Currently there is the EVENT_EXPERIENCE_GAIN which has this two event codes.
  • PROGRESS_REASON_DARK_ANCHOR_CLOSED
  • PROGRESS_REASON_DARK_FISSURE_CLOSED

This events are only triggered on the first time a dark anchor or dark fissure has been completed (black POI)

It would be nice to have an event that triggers at every completed dark anchor or dark fissure like EVENT_DARK_ANCHOR_COMPLETED and EVENT_DARK_FISSURE_COMPLETED.

I tried to achieve this with many approches but i don't come to an acceptable result in the ESO-Database Export addon. It would be nice if such an event could be added to the game.

Thanks!

Keldor

t31os 07/02/19 01:12 PM

Have you tried hooking the world events?


https://wiki.esoui.com/Events#World_Events


Dolmens presumably(i could certainly be wrong) are a world/region event, maybe there's some information passed along during those events you can use to determine dolmen (dark anchor) events specifically.

Kyoma 07/07/19 11:47 AM

Quote:

Originally Posted by t31os (Post 38554)
Have you tried hooking the world events?


https://wiki.esoui.com/Events#World_Events


Dolmens presumably(i could certainly be wrong) are a world/region event, maybe there's some information passed along during those events you can use to determine dolmen (dark anchor) events specifically.

No, currently World Events are for dragons in Elsweyr only, which is why the request is being made. :)

Keldor 02/18/20 06:31 AM

Quote:

Originally Posted by Kyoma (Post 38570)
No, currently World Events are for dragons in Elsweyr only, which is why the request is being made. :)

Thats right, I've tested the suggested methods to detect a closed anchor but without success. :)

Keldor 06/08/21 05:52 AM

I want to share my current solution for this request. Thanks to votan who sent me some code snippets from his AddOn that I could use as base for my solution! :)
I'm now using the EVENT_EXPERIENCE_GAIN event in combination with the following code.

Lua Code:
  1. POIEventType = {
  2.     NONE = 0,
  3.     DARK_ANCHOR = 1,
  4.     ABYSSAL_GEYSERS = 2,
  5.     HARROWSTORM = 3,
  6. }
  7.  
  8. -- Lookup table for zones that can have the for example dark anchors
  9. POIZoneTypes = {}
  10. POIZoneTypes.DarkAnchors = {
  11.     [3] = 1,
  12.     [19] = 1,
  13.     [20] = 1,
  14.     [41] = 1,
  15.     [57] = 1,
  16.     [58] = 1,
  17.     [92] = 1,
  18.     [101] = 1,
  19.     [103] = 1,
  20.     [104] = 1,
  21.     [108] = 1,
  22.     [117] = 1,
  23.     [181] = 1,
  24.     [381] = 1,
  25.     [382] = 1,
  26.     [383] = 1,
  27. }
  28. POIZoneTypes.AbyssalGeysers = {
  29.     [1011] = 1,
  30. }
  31. POIZoneTypes.Harrowstorms = {
  32.     [1160] = 1,
  33.     [1207] = 1,
  34. }
  35.  
  36. function MyAddon.EventExperienceUpdate(_, reason)
  37.  
  38.     if reason == PROGRESS_REASON_SCRIPTED_EVENT then
  39.  
  40.         local poiType = POIEventType.NONE
  41.         local px, py = GetMapPlayerPosition("player")
  42.         local zoneIndex = GetCurrentMapZoneIndex()
  43.         local x, y, icon
  44.  
  45.         for poiIndex = 1, GetNumPOIs(zoneIndex) do
  46.  
  47.             x, y, _, icon = GetPOIMapInfo(zoneIndex, poiIndex)
  48.  
  49.             if icon == "/esoui/art/icons/poi/poi_portal_complete.dds" or icon == "/esoui/art/icons/poi/poi_portal_incomplete.dds" then
  50.  
  51.                 x, y = x - px, y - py
  52.                 x, y = x * x, y * y
  53.  
  54.                 if (x + y) < 0.0001 then
  55.  
  56.                     local zoneId = tonumber(GetZoneId(zoneIndex))
  57.                     local parentZoneId = tonumber(GetParentZoneId(zoneId))
  58.  
  59.                     if type(POIZoneTypes.DarkAnchors[zoneId]) ~= "nil" or type(POIZoneTypes.DarkAnchors[parentZoneId]) ~= "nil" then
  60.                         poiType = POIEventType.DARK_ANCHOR
  61.                         break
  62.                     elseif type(POIZoneTypes.AbyssalGeysers[zoneId]) ~= "nil" or type(POIZoneTypes.AbyssalGeysers[parentZoneId]) ~= "nil" then
  63.                         poiType = POIEventType.ABYSSAL_GEYSERS
  64.                         break
  65.                     elseif type(POIZoneTypes.Harrowstorms[zoneId]) ~= "nil" or type(POIZoneTypes.Harrowstorms[parentZoneId]) ~= "nil" then
  66.                         poiType = POIEventType.HARROWSTORM
  67.                         break
  68.                     end
  69.                 end
  70.             end
  71.         end
  72.  
  73.         -- Use poiType to check what kind of POI event has finished
  74.         -- Example:
  75.         if poiType == POIEventType.DARK_ANCHOR then
  76.             -- Do something
  77.         end
  78.     end
  79. end
  80.  
  81. EVENT_MANAGER:RegisterForEvent("MyAddon", EVENT_EXPERIENCE_GAIN, MyAddon.EventExperienceUpdate)

Calamath 09/24/21 02:43 AM

Update32
 
As previously announced, starting with Update 32,
you can use ESOUI to get notifications of the start and end of Dark Anchor world events.

I have confirmed this with PTS 7.2.0.
The following notifications are made in line with the Dark Anchor world event.

Activation:
(1)EVENT_WORLD_EVENT_ACTIVE_LOCATION_CHANGED
(2)EVENT_WORLD_EVENT_ACTIVATED

Deactivation:
(1)EVENT_WORLD_EVENT_DEACTIVATED

The dark anchor seems to be assigned a unique worldEventInstanceId for each zone,
and as you know, the POI where the dark anchor is activated will change each time.

If the player is in the same zone,
the poiIndex of the active dark anchor can be determined by passing the worldEventInstanceId notified by the event as an argument to GetWorldEventPOIInfo().

Note that if you have already obtained the database of poiIndex of the dark anchor, you can use GetPOIWorldEventInstanceId().
Only the active dark anchor will return worldEventInstanceId as the return value.
Inactive dark anchors will return 0 as now.

Congratulations.

- Calamath


All times are GMT -6. The time now is 12:18 AM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2014 - 2020 MMOUI