I'm trying to make a spell that sends, items on the ground to a specific depot (I frankestained, disintegrate and exori flam, to get item data, that part works flawlessly), but i cant access mailbox functions from the lua file even if i make it public, my c++ is beyond poor. I know this is a beyond noob question, but I wasn't able to google my way out of this.
Lua:
local dead_human = {
4240, 4241, 4242, 4247, 4248
}
local removalLimit = 10
function onCastSpell(creature, variant)
local position = variant:getPosition()
local tile = Tile(position)
if tile then
local items = tile:getItems()
if items then
for i, item in ipairs(items) do
if item:getType():isMovable() and item:getActionId() == 0 and not table.contains(dead_human, item:getId()) then
mailbox:getDestination(item,"Mierdaseca","Carlin")
mailbox:sendItem(item)
broadcastMessage(tostring(item))
end
if i == removalLimit then
break
end
end
end
end
position:sendMagicEffect(CONST_ME_POFF)
return true
end