• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Movement ( Enchanting)

SasirO

Banned User
Joined
Apr 30, 2009
Messages
559
Reaction score
0
Since this script is outdated i would like to have it updated xd
Im also getting debug in tibia while entering the action tile.
if anyone could do this, then it would be great, thanks in advance

PHP:
  function onStepIn(cid, item, pos)
local ice = {x=427, y=503, z=7}
local fire = {x=424, y=503, z=7}
local energy = {x=424, y=505, z=7}
local earth = {x=427, y=505, z=7}
        if getPlayerLookDir(cid) == 0 then
                newdir = 2
        elseif getPlayerLookDir(cid) == 1 then
                newdir = 3
        elseif getPlayerLookDir(cid) == 2 then
                newdir = 0
        else
                newdir = 1
        end
        if item.actionid == 7801 then
                if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
                        doTeleportThing(cid, ice)
                        doSendMagicEffect(ice, 10)
                else
                        doPlayerSay(cid, "Only Premium Druids of level 30 or higher are able to enter this portal", 16)
                        doMoveCreature(cid, newdir)
                end
        elseif item.actionid == 7802 then
                if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
                        doTeleportThing(cid, earth)
                        doSendMagicEffect(earth, 10)
                else
                        doPlayerSay(cid, "Only Premium Druids of level 30 or higher are able to enter this portal", 16)
                        doMoveCreature(cid, newdir)
                end
        elseif item.actionid == 7803 then
                if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
                        doTeleportThing(cid, fire)
                        doSendMagicEffect(fire, 10)
                else
                        doPlayerSay(cid, "Only Premium Sorcerers of level 30 or higher are able to enter this portal", 16)
                        doMoveCreature(cid, newdir)
                end
        elseif item.actionid == 7804 then
                if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
                        doTeleportThing(cid, energy)
                        doSendMagicEffect(energy, 10)
                else
                        doPlayerSay(cid, "Only Premium Sorcerers of level 30 or higher are able to enter this portal", 16)
                        doMoveCreature(cid, newdir)
                end
        end
return TRUE
end

PHP:
<movevent type="StepIn" actionid="7801" event="script" value="alterstp.lua" />
<movevent type="StepIn" actionid="7802" event="script" value="alterstp.lua" />
<movevent type="StepIn" actionid="7803" event="script" value="alterstp.lua" />
<movevent type="StepIn" actionid="7804" event="script" value="alterstp.lua" />
 
working script:
Code:
  function onStepIn(cid, item, position, fromPosition)
local ice = {x=88, y=464, z=7}
local fire = {x=460, y=378, z=7}
local energy = {x=611, y=765, z=4}
local earth = {x=92, y=509, z=7}

        if item.actionid == 7801 then
                if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
                        doTeleportThing(cid, ice)
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
                else
                        doPlayerSendCancel(cid, "Only Premium Druids of level 30 or higher are able to enter this portal")
                        doTeleportThing(cid, fromPosition)
                end
        elseif item.actionid == 7802 then
                if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
                        doTeleportThing(cid, earth)
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
                else
                        doPlayerSendCancel(cid, "Only Premium Druids of level 30 or higher are able to enter this portal")
                        doTeleportThing(cid, fromPosition)
                end
        elseif item.actionid == 7803 then
                if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
                        doTeleportThing(cid, fire)
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
                else
                        doPlayerSendCancel(cid, "Only Premium Sorcerers of level 30 or higher are able to enter this portal")
                        doTeleportThing(cid, fromPosition)
                end
        elseif item.actionid == 7804 then
                if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
                        doTeleportThing(cid, energy)
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
                else
                        doPlayerSendCancel(cid, "Only Premium Sorcerers of level 30 or higher are able to enter this portal")
                        doTeleportThing(cid, fromPosition)
                end
        end
return TRUE
end
 
Code:
local portals =
{
    [7801] = {position = {x = 427, y = 503, z = 7}, vocations = {2, 6}, level = 30, premium = true, str = "Druids"}, 
    [7802] = {position = {x = 424, y = 503, z = 7}, vocations = {2, 6}, level = 30, premium = true, str = "Druids"}, 
    [7803] = {position = {x = 424, y = 505, z = 7}, vocations = {1, 5}, level = 30, premium = true, str = "Sorcerers"}, 
    [7804] = {position = {x = 427, y = 505, z = 7}, vocations = {1, 5}, level = 30, premium = true, str = "Sorcerers"}
}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if(getPlayerLookDir(cid) == 0) then
        newdir = 2
    elseif(getPlayerLookDir(cid) == 1) then
        newdir = 3
    elseif(getPlayerLookDir(cid) == 2) then
        newdir = 0
    else
        newdir = 1
    end
    local portal = portals[item.actionid]
    if(portal) then
        if(isPremium(cid) and portal.premium and isInArray(portal.vocations, getPlayerVocation(cid)) and getPlayerLevel(cid) >= portal.level) then
            doTeleportThing(cid, portal.position)
            doSendMagicEffect(portal.position, CONST_ME_TELEPORT)
        else
            doCreatureSay(cid, "Only Premium " .. portal.str .. " of level " .. portal.level .. " or higher are able to enter this portal", TALKTYPE_ORANGE_1, fromPosition)
            doMoveCreature(cid, newdir)
        end
    end
    return true
end
 
working script:
Code:
  function onStepIn(cid, item, position, fromPosition)
local ice = {x=88, y=464, z=7}
local fire = {x=460, y=378, z=7}
local energy = {x=611, y=765, z=4}
local earth = {x=92, y=509, z=7}

        if item.actionid == 7801 then
                if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
                        doTeleportThing(cid, ice)
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
                else
                        doPlayerSendCancel(cid, "Only Premium Druids of level 30 or higher are able to enter this portal")
                        doTeleportThing(cid, fromPosition)
                end
        elseif item.actionid == 7802 then
                if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
                        doTeleportThing(cid, earth)
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
                else
                        doPlayerSendCancel(cid, "Only Premium Druids of level 30 or higher are able to enter this portal")
                        doTeleportThing(cid, fromPosition)
                end
        elseif item.actionid == 7803 then
                if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
                        doTeleportThing(cid, fire)
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
                else
                        doPlayerSendCancel(cid, "Only Premium Sorcerers of level 30 or higher are able to enter this portal")
                        doTeleportThing(cid, fromPosition)
                end
        elseif item.actionid == 7804 then
                if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
                        doTeleportThing(cid, energy)
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
                else
                        doPlayerSendCancel(cid, "Only Premium Sorcerers of level 30 or higher are able to enter this portal")
                        doTeleportThing(cid, fromPosition)
                end
        end
return TRUE
end


Could you make the code to leave the shrine area too :)
 
Back
Top