How do I set uniqueId for the specified item?
Lua:
local teleportToPosition = Position(30627, 32461, 8)
local bossPosition = Position(30626, 32457, 8)
local function removeTeleport(position)
local teleportItem = Tile(position):getItemById(1387)
if teleportItem then
teleportItem:remove()
position:sendMagicEffect(CONST_ME_POFF)
bossPosition:sendMagicEffect(CONST_ME_POFF)
end
local parchment = Game.createItem(6022, 1, bossPosition)
if parchment then
parchment:setActionId(59567) <<-----
end
end
function onKill(creature, target)
local targetMonster = target:getMonster()
if not targetMonster then
return true
end
if targetMonster:getName():lower() == 'numb the weakened' then
local position = targetMonster:getPosition()
position:sendMagicEffect(CONST_ME_TELEPORT)
local item = Game.createItem(1387, 1, position)
if item:isTeleport() then
item:setDestination(teleportToPosition)
end
targetMonster:say('Numb ran into teleporter! It will disappear in 2 minutes. Enter it!', TALKTYPE_MONSTER_SAY, 0, 0, position)
--remove portal after 2 min
addEvent(removeTeleport, 2 * 60 * 1000, position)
end
return true
end