Originally Posted by merlight
Is there any? This function is in the wiki, but it has been removed http://www.esoui.com/forums/showthre...entKeepForKeep
For example when I get EVENT_KEEP_UNDER_ATTACK_CHANGED on a lumbermill, I want to know the ID of the keep it belongs to. Of course I can build a lookup table using GetResourceKeepForKeep, but that'd be stupid if there was a function for just that
|
I don't know anything about the pvp stuff, Just trying to spark an idea here.
But doesn't the event itself give it to you as the 2nd parameter
(integer keepId)? Or is the lumbermill considered a keep and its that ID it gives you?
Lua Code:
EVENT_KEEP_UNDER_ATTACK_CHANGED (integer eventCode, integer keepId, integer battlegroundContext, bool underAttack)
If that keep ID refers to the lumbermill, then I am thinking
do you have to be within a certain vicinity (close to the keep/lumbermill) to actually receive that event? If so then the closest keep is probably the parent one you are looking for, so could you use this:
Lua Code:
local parentKeepId = GetClosestKeepOfType(keepType, resourceType, battlegroundContext)
-- maybe with these parameters --
local parentKeepId = GetClosestKeepOfType(KEEPTYPE_KEEP, RESOURCETYPE_NONE, battlegroundContext)
-- I dont know what battlegroundContext is, but it gets passed to you in your event --
If its not KEEPTYPE_KEEP, maybe one of these:
Lua Code:
KEEPTYPE_ARTIFACT_GATE
KEEPTYPE_ARTIFACT_KEEP
KEEPTYPE_BORDER_KEEP
KEEPTYPE_KEEP
KEEPTYPE_OUTPOST
KEEPTYPE_RESOURCE