--]] Made by t0kenz [[--
--]] OTLand username: tokenzz [[--
-- <!-- The Ancients Tombs Quest -->
-- <moveevent event="StepIn" actionid="13002" script="Quests/The Ancient Tombs Quest/helmet.lua"/>
-- <moveevent event="AddItem" tileitem="1" itemid="2159" script="Quests/The Ancient Tombs Quest/coalbasin_onadditem.lua"/>
-- <moveevent event="StepIn" actionid="6010" script="Quests/The Ancient Tombs Quest/coalbasin_onadditem.lua"/>
-- <moveevent event="StepIn" actionid="6006" script="Quests/The Ancient Tombs Quest/coalbasin_onadditem.lua"/>
-- <moveevent event="StepIn" actionid="6008" script="Quests/The Ancient Tombs Quest/coalbasin_onadditem.lua"/>
-- <moveevent event="StepIn" actionid="6017" script="Quests/The Ancient Tombs Quest/coalbasin_onadditem.lua"/>
-- <moveevent event="StepIn" actionid="5999" script="Quests/The Ancient Tombs Quest/coalbasin_onadditem.lua"/>
-- <moveevent event="StepIn" actionid="6012" script="Quests/The Ancient Tombs Quest/coalbasin_onadditem.lua"/>
-- <moveevent event="StepIn" actionid="6004" script="Quests/The Ancient Tombs Quest/coalbasin_onadditem.lua"/>
-- <moveevent event="StepIn" actionid="6014" script="Quests/The Ancient Tombs Quest/coalbasin_onadditem.lua"/>
local config = {
[1] = { -- Vashresamun
coalbasin_pos = {x = 33276, y = 32552, z = 14, stackpos = 1},
playerCheck = {x = 33276, y = 32553, z = 14, stackpos = 0}, -- Check if player is standing on the tile
scarab_coin = 2159,
tp_in = {x = 33271, y = 32553, z = 14},
tile_aid_back = 6010,
tp_out = {x = 33277, y = 32553, z = 14}
},
[2] = { -- Dipthrah
coalbasin_pos = {x = 33073, y = 32589, z = 13, stackpos = 1},
playerCheck = {x = 33073, y = 32590, z = 13}, -- Check if player is standing on the tile
scarab_coin = 2159,
tp_in = {x = 33079, y = 32589, z = 13},
tile_aid_back = 6006,
tp_out = {x = 33072, y = 32590, z = 13}
},
[3] = { -- Mahrdis
coalbasin_pos = {x = 33240, y = 32855, z = 13, stackpos = 1},
playerCheck = {x = 33073, y = 32590, z = 13}, -- Check if player is standing on the tile
scarab_coin = 2159,
tp_in = {x = 33246, y = 32850, z = 13},
tile_aid_back = 6008,
tp_out = {x = 33239, y = 32856, z = 13}
},
[4] = { -- Morguthis
coalbasin_pos = {x = 33233, y = 32692, z = 13, stackpos = 1},
playerCheck = {x = 33234, y = 32692, z = 13}, -- Check if player is standing on the tile
scarab_coin = 2159,
tp_in = {x = 33234, y = 32687, z = 13},
tile_aid_back = 6017,
tp_out = {x = 33235, y = 32694, z = 13}
},
[5] = { -- Omruc
coalbasin_pos = {x = 33098, y = 32816, z = 13, stackpos = 1},
playerCheck = {x = 33097, y = 32816, z = 13}, -- Check if player is standing on the tile
scarab_coin = 2159,
tp_in = {x = 33093, y = 32824, z = 13},
tile_aid_back = 5999,
tp_out = {x = 33097, y = 32815, z = 13}
},
[6] = {
coalbasin_pos = {x = 33135, y = 32682, z = 12, stackpos = 1},
playerCheck = {x = 33135, y = 32683, z = 12}, -- Check if player is standing on the tile
scarab_coin = 2159,
tp_in = {x = 33130, y = 32683, z = 12},
tile_aid_back = 6012,
tp_out = {x = 33136, y = 32683, z = 12}
},
[7] = {
coalbasin_pos = {x = 33293, y = 32741, z = 13, stackpos = 1},
playerCheck = {x = 33293, y = 32742, z = 13}, -- Check if player is standing on the tile
scarab_coin = 2159,
tp_in = {x = 33299, y = 32742, z = 13},
tile_aid_back = 6004,
tp_out = {x = 33292, y = 32742, z = 13}
},
[8] = {
coalbasin_pos = {x = 33161, y = 32831, z = 10, stackpos = 1},
playerCheck = {x = 33162, y = 32831, z = 10}, -- Check if player is standing on the tile
scarab_coin = 2159,
tp_in = {x = 33156, y = 32832, z = 10},
tile_aid_back = 6014,
tp_out = {x = 33162, y = 32832, z = 10}
},
}
function onAddItem(moveItem, position, cid)
-- If the scarab coin is placed on the coal basin (if going in)
for i = 1, #config do
if(getTileItemById(config[i].coalbasin_pos, config[i].scarab_coin).uid > 0) then -- check if there is a scarab coin placed on the coal basin in the tomb
if moveItem.itemid == 2159 and isPlayer(config[i].playerCheck) then
doRemoveItem(getThingFromPos(config[i].coalbasin_pos).uid, 1)
doTeleportThing(cid, config[i].tp_in)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doSendMagicEffect(position, CONST_ME_TELEPORT)
doSendMagicEffect(config[i].coalbasin_pos, CONST_ME_HITBYFIRE)
break
end
end
return true
end
end
function onStepIn(cid, item, position, fromPosition)
if not isPlayer(cid) then
return true
end
-- if going out
for i = 1, #config do
if item.actionid == config[i].tile_aid_back then
doTeleportThing(cid, config[i].tp_out)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doSendMagicEffect(position, CONST_ME_TELEPORT)
break
end
end
return true
end