oen432
Legendary OT User
Town Portals
More Diablo style additions. This time Town Portals. Scrolls that can be used to create a portal that will teleport us back to our town. If we use special portal in a town, we can get back to where we created our portal (which then will be removed). Can be customized to allow only portal creator to use it or anyone. Also when portal should be removed, when creator goes back or anyone goes back. Duration can be set too, after passed time, teleport will be removed.
More Diablo style additions. This time Town Portals. Scrolls that can be used to create a portal that will teleport us back to our town. If we use special portal in a town, we can get back to where we created our portal (which then will be removed). Can be customized to allow only portal creator to use it or anyone. Also when portal should be removed, when creator goes back or anyone goes back. Duration can be set too, after passed time, teleport will be removed.
Installation
- Open
data/movements/movements.xml
. - Add
XML:
<movevent event="StepIn" actionid="5623" script="town_portal.lua" /> <movevent event="StepIn" actionid="5624" script="town_portal.lua" />
- Open
data/creaturescripts/creaturescripts.xml
. - Add
XML:
<event type="logout" name="TownPortalsLogout" script="town_portal.lua" />
- Open
data/actions/actions.xml
- Add
XML:
<action itemid="5952" script="custom/town_portal_scroll.lua" />
- Download
town_portals.rar
from attachment at the bottom of this post. - Copy
town_portal_scroll.lua
todata/actions/scripts/custom/town_portal_scroll.lua
. - Copy
town_portal.lua
todata/creaturescripts/scripts/town_portal.lua
. - Copy
town_portal.lua
todata/movements/scripts/town_portal.lua
.
Configuration
Create item using map editor and set Action ID 5623
. This is your Town Portal tile where players can step on and teleport back to their created portal.Save that item position in configuration table
TOWN_PORTALS
.Every configuration is in -
data/movements/scripts/town_portal.lua
.
Lua:
TOWN_PORTALS = {
creatorOnly = true, -- only portal creator can teleport back to town
creatorDestroy = true, -- remove Town Portal only when creator teleports back, false = destroy portal when any player teleports back
duration = -1, -- in seconds, for how long should created portal be active, -1 = unlimited
townText = "Town Portal", -- Text on the portal in a town, nil = nothing
portalText = nil, -- text on the portal create by a player, nil = Town Name
townPortals = { -- list of Town Portals in towns that are used to teleport back to player portal
Position(1000, 1000, 7)
}
}
Changelog
[1.0.1] - 2019-03-26- Disabled using scroll if player is near city temple
- Now after using scroll when portal is active, old portal is destroyed
- Release version
Attachments
-
town_portals-1_0_1.rar2.9 KB · Views: 68 · VirusTotal
Last edited: