View Single Post
02/03/24, 11:34 AM   #3
Mouton
 
Mouton's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2018
Posts: 9
There's no way I found so far to check this prior the activation. You can still use

Code:
EVENT_COLLECTIBLE_USE_RESULT (number eventCode, CollectibleUsageBlockReason result, boolean isAttemptingActivation)
To try to get why the use failed (UseCollectible function does not return anything if I remember) https://esoapi.uesp.net/current/data...lectible.html=

You can still check for the main cases before activation:

Code:
if not (IsMounted() or IsUnitReincarnating("player") or IsUnitSwimming("player") or IsUnitDead("player") or GetUnitStealthState("player") ~= STEALTH_STATE_NONE) then
  -- Do things
end
But I could not find a proper way to check this before.

(On top, collectible activation is not consistent from where it's used, making it hard to track on some other way if you want prevent it, but you wan still override the global function that is used, sometimes:

Code:
local Prev_ZO_CollectibleData_Use = UseCollectible

function UseCollectible(collectibleId, actorCategory)
    -- Do or check something
    Prev_ZO_CollectibleData_Use(collectibleId, actorCategory)
end
)

Last edited by Mouton : 02/03/24 at 11:38 AM.
  Reply With Quote