local config = {
position = { x = 82, y = 369, z = 6 },
destination = { x = 84, y = 374, z = 7 },
item_enable_id = 1481,
item_disable_id = 1485,
boss_name = 'Demon',
boss_position = Position(0, 0, 0)
}
function onStepIn(player, item, position, fromPos)
if isPlayer(player) then
local coal_basin = getTileItemById(config.position, config.item_enable_id)
if coal_basin then
if coal_basin.itemid == config.item_enable_id then
doPlayerSendTextMessage(player, MESSAGE_EVENT_DEFAULT, 'Sorry, not posible.')
doTeleportThing(player, fromPos)
doSendMagicEffect(fromPos, CONST_ME_TELEPORT)
return true
end end
doTransformItem(coal_basin.uid, config.item_enable_id)
doTeleportThing(player, config.destination)
doSendMagicEffect(config.destination, CONST_ME_TELEPORT)
doSummonCreature(config.boss_name, config.boss_position)
player:registerEvent("boss_onkill")
end
return true
end
boss_onKillBoss = function(player, name)
local boss_name = config.boss_name
local name = name
if name == boss_name then
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, 'Has eliminado al boss.')
local nextPosReward= Position(0, 0, 0)
doTeleportThing(player, nextPosReward)
doSendMagicEffect(nextPosReward, CONST_ME_TELEPORT)
local coal_basin = getTileItemById(config.position, config.item_enable_id)
if coal_basin then
if coal_basin.itemid == config.item_enable_id then
doTransformItem(coal_basin.uid, config.item_disable_id)
return true
end end
end
return true
end