How to block the use of items during the event? I don't want to add this code in every file. I am currently using this:
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_MAGICWALL)
local storageEventJoin = 1000
function onCastSpell(creature, variant, isHotkey)
if creature:getStorageValue(storageEventJoin) > 0 then
doCreatureSay(creature, "You cannot use this item in an event.", TALKTYPE_ORANGE_1)
return false
end
return combat:execute(creature, variant)
end