• 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!

MoveEvent RME-Lazy-Teleport-System by andu

andu

Sold 649 scripts, 25 maps and 9 events!
Joined
Aug 7, 2009
Messages
969
Solutions
17
Reaction score
353
GitHub
olrios
Twitch
olrios
Edit: version 1.1, updated files in attachement


RME-Lazy-Teleport-System by andu (for TFS 1.0+)
Creating and configuring teleports is now easier!



Normal Teleports, Quest teleports, Level Teleports and Quick Teleports
and all in one 2kb LUA file!


Lua with XML code is in zip attachement.



How it works?



Quick Teleports:

If you want to make a quick teleport in RME put actionid equal to:

HOW_MANY_TILES_FORWARD + (DIRECTION * 10) + 100

For example teleport 6 SQM left it would be action id:
6 + 1 * 10 + 100 = 116

1575024362788.png

Directions are: north 0, east 1, south 2, west 3
Actionid 140 teleports 1 level down, actionid 141 teleports 1 level up.

No need to configure anything more in lua! Your quick teleport already works!




Level Teleports:

Level teleports can be used only by players with X level or higher, like level doors!

To make a level teleport you have to put actionid equal to:

REQUIRED_LEVEL + 1000

Exactly the same way as you configure level doors!

For required minimum level 60 - action id have to be 1060

Last step is to put uniqueid on teleport and configure destination of teleport.
In your RME-Lazy-Teleport-System.lua something like this:

[5536] = {8540, 8369, 3},

You can easly copy and paste destination with RME 3.0+ (right click on map and choose 'copy position')


1575025414026.png

Now teleport will work only if you have atleast level 60 and will teleport players to position (8540, 8369, 3)

I know that you can set destination in RME for certain teleports. But what if you want to make a wooden tile what can teleport players?
Many RL Tibia teleports aren't configured in items.otb so you cannot set thier destination in RME w/o editing your client.
With this system now you can! Easly!

This system is fully compatible with actual source system. So you can use both of them together!



Quest Teleports:

Quest teleports are teleports what can be used only by players with specified storage id.

To make a quest teleport you have to put action id equal to:

REQUIRED_STORAGE_ID + 10000

For example quest have storage id equal to 3792 then you have to put action id equal to:

3792 + 10000 = 13792

Last step is to put uniqueid on teleport and configure destination of teleport. The same like with level teleports:

[5537] = {8140, 8269, 8},




Normal Teleports:

They will only teleport to destination.
It may be useful if you want to use different itemids what cannot have set detination in RME.

To do a normal teleport just set on them uniqueid and configure it in lua file. In the same way as you configure level or quest teleports:

[5540] = {5000, 5931, 7},



1575025771851.png


You can use any itemid for that. But before you have to be sure you added them to your movements.xml

Here is the list im using (also included it in the attachement):

<movevent event="StepIn" itemid="5068" script="RME_lazy_teleport_system.lua" />

<movevent event="StepIn" itemid="5069" script="RME_lazy_teleport_system.lua" />
<movevent event="StepIn" itemid="26138" script="RME_lazy_teleport_system.lua" />
<movevent event="StepIn" itemid="26139" script="RME_lazy_teleport_system.lua" />
<movevent event="StepIn" itemid="26140" script="RME_lazy_teleport_system.lua" />
<movevent event="StepIn" itemid="25417" script="RME_lazy_teleport_system.lua" />
<movevent event="StepIn" itemid="25403" script="RME_lazy_teleport_system.lua" />
<movevent event="StepIn" itemid="22677" script="RME_lazy_teleport_system.lua" />
<movevent event="StepIn" itemid="22657" script="RME_lazy_teleport_system.lua" />
<movevent event="StepIn" itemid="22456" script="RME_lazy_teleport_system.lua" />
<movevent event="StepIn" itemid="19598" script="RME_lazy_teleport_system.lua" />
<movevent event="StepIn" itemid="19599" script="RME_lazy_teleport_system.lua" />
<movevent event="StepIn" itemid="21721" script="RME_lazy_teleport_system.lua" />

<movevent event="StepIn" itemid="9110" script="RME_lazy_teleport_system.lua" />



Bonus teleport:



1575025909561.png


"The teleport seems to be using unknown magic. Strange."





 

Attachments

  • RME-Lazy-Teleport-System by andu.zip
    2.9 KB · Views: 29 · VirusTotal
Last edited:
Update 1.2.1 (bugfix)

Lua:
local minGroupToPassWithoutLevelAndStorage = 3
local config = {
--  [uniqueid] = {posx, posy, posz},
    [5532] = {8540, 8369, 3},
    [5533] = {8174, 8625, 14},
}

local function teleportBack(self, pos, msg)
    return self:sendTextMessage(MESSAGE_INFO_DESCR, msg) and self:teleportTo(pos, true)
end

function onStepIn(creature, item, position, fromPosition)
    if not creature:isPlayer() then return false end
    if item.actionid >= 100 and item.actionid < 140 then
        local dir = math.floor((item.actionid - 100) / 10)
        local steps = item.actionid - math.floor(item.actionid / 10) * 10
        if steps == 0 then steps = 10 end
        position:getNextPosition(dir, steps)
    end
    if item.actionid == 140 or item.actionid == 141 then
        position = Position(position.x, position.y + 1, position.z + 1 - (item.actionid - 140) * 2)
        creature:setDirection(2)
    end
    if creature:getGroup():getId() < minGroupToPassWithoutLevelAndStorage then
        if item.actionid > 1000 and item.actionid < 10000 and creature:getLevel() < item.actionid - 1000 then
            return teleportBack(creature, fromPosition, "You need atleast " ..(item.actionid - 1000).. " level to use this portal.")
        end
        if item.actionid > 10000 and creature:getStorageValue(item.actionid - 10000) == -1 then
            return teleportBack(creature, fromPosition, "The portal seems to be sealed against unwanted intruders.")
        end
    end
    if (item.actionid > 141 or item.actionid == 0) then
        if config[item.uid] then
            position = Position(config[item.uid][1], config[item.uid][2], config[item.uid][3])
        else
            teleportBack(creature, fromPosition, "The portal uses unknown magic. Strange.")
            return false
        end
    end
    creature:teleportTo(position)
    position:sendMagicEffect(CONST_ME_TELEPORT)
    fromPosition:sendMagicEffect(CONST_ME_TELEPORT)
    return true
end
 
Last edited:
Back
Top