View Single Post
09/17/14, 08:46 PM   #6
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by skobyjay View Post
I was able to get the event hooked up with the following args (looks like there was an "eventCode" arg as the first param)

local function OnSlotUpdate (eventCode, bagId, slotId, isNewItem, itemSoundCategory, updateReason)


Is it possible to "catch" this event and cancel it to prevent an item to be equipped? I'm a developer so i'm familiar with doing this in other languages, i'm just struggling to find alot of docs on Lua and ESO.

I really appreciate the help.
EVENT_INVENTORY_SINGLE_SLOT_UPDATE is fired after item is equipped. In this case you will probably need to hook EquipItem function.

Lua Code:
  1. local doNotWork = true
  2. ZO_PreHook("EquipItem", function(...) return doNotWork end)

ZO_PreHook([objectTable,] originalFunctionName, yourFunction) allows you to run your function before the actual function is called. Original function is called only if your function returns nil or false.
  Reply With Quote