local config = {
bosses={---aid of portal, position where it sends, value it sets, text it shows
[1001] = {pos={x=210, y=1991, z=7, stackpos=1}, value=1, text="Entered the Cave"},
function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) == TRUE then
if(config.bosses[item.actionid]) then
local t= config.bosses[item.actionid]
if getPlayerStorageValue(cid, config.storage)< t.value then
setPlayerStorageValue(cid, config.storage, t.value)
end
doTeleportThing(cid, t.pos)
doSendMagicEffect(getCreaturePosition(cid),10)
doCreatureSay(cid,t.text,TALKTYPE_ORANGE_1)
elseif(config.mainroom[item.actionid]) then
local t= config.mainroom[item.actionid]
if getPlayerStorageValue(cid, config.storage)>=t.value then
doTeleportThing(cid, t.pos)
doSendMagicEffect(getCreaturePosition(cid),10)
doCreatureSay(cid,t.text,TALKTYPE_ORANGE_1)
else
doTeleportThing(cid, fromPosition)
doSendMagicEffect(getCreaturePosition(cid),10)
doCreatureSay(cid, 'You don\'t have enough energy to enter this portal', TALKTYPE_ORANGE_1)
end
elseif(config.portals[item.actionid]) then
local t= config.portals[item.actionid]
doTeleportThing(cid, t.pos)
doSendMagicEffect(getCreaturePosition(cid),10)
doCreatureSay(cid,t.text,TALKTYPE_ORANGE_1)
end
end
end