Simple tutorials for Tibia 7.6

Leveldoors

Disclosure:
This is originally made by Doom Stone, so reputations for him ^^
Are you getting sick for tutorials where is used language like "you are" = "u r". In this tutorial I use proper English, so enjoy

First, I'm gonna explain the level door system, what I found was the most simple. The client version It works is 7.6.

Okay, put this to your 'actions.xml' to lines, which start like "<!-- Doors -->"
(\server\data\actions/actions.xml)
Quote:
<action itemid="1209" script="doors_all.lua" />
<action itemid="1210" script="doors_all.lua" />
<action itemid="1211" script="doors_all.lua" />
<action itemid="1212" script="doors_all.lua" />
<action itemid="1213" script="doors_all.lua" />
<action itemid="1214" script="doors_all.lua" />
<action itemid="1219" script="doors_all.lua" />
<action itemid="1220" script="doors_all.lua" />
<action itemid="1221" script="doors_all.lua" />
<action itemid="1222" script="doors_all.lua" />
<action itemid="1223" script="doors_all.lua" />
<action itemid="1224" script="doors_all.lua" />
<action itemid="1225" script="doors_all.lua" />
<action itemid="1226" script="doors_all.lua" />
<action itemid="1227" script="doors_all.lua" />
<action itemid="1228" script="doors_all.lua" />
<action itemid="1229" script="doors_all.lua" />
<action itemid="1230" script="doors_all.lua" />
<action itemid="1231" script="doors_all.lua" />
<action itemid="1232" script="doors_all.lua" />
<action itemid="1233" script="doors_all.lua" />
<action itemid="1234" script="doors_all.lua" />
<action itemid="1235" script="doors_all.lua" />
<action itemid="1236" script="doors_all.lua" />
<action itemid="1237" script="doors_all.lua" />
<action itemid="1238" script="doors_all.lua" />
<action itemid="1239" script="doors_all.lua" />
<action itemid="1240" script="doors_all.lua" />
<action itemid="1241" script="doors_all.lua" />
<action itemid="1242" script="doors_all.lua" />
<action itemid="1243" script="doors_all.lua" />
<action itemid="1244" script="doors_all.lua" />
<action itemid="1245" script="doors_all.lua" />
<action itemid="1246" script="doors_all.lua" />
<action itemid="1247" script="doors_all.lua" />
<action itemid="1248" script="doors_all.lua" />
<action itemid="1249" script="doors_all.lua" />
<action itemid="1250" script="doors_all.lua" />
<action itemid="1251" script="doors_all.lua" />
<action itemid="1252" script="doors_all.lua" />
<action itemid="1253" script="doors_all.lua" />
<action itemid="1254" script="doors_all.lua" />
<action itemid="1255" script="doors_all.lua" />
<action itemid="1256" script="doors_all.lua" />
<action itemid="1257" script="doors_all.lua" />
<action itemid="1258" script="doors_all.lua" />
<action itemid="1259" script="doors_all.lua" />
<action itemid="1260" script="doors_all.lua" />
<action itemid="1261" script="doors_all.lua" />
<action itemid="1262" script="doors_all.lua" />
<action itemid="1539" script="doors_all.lua" />
<action itemid="1540" script="doors_all.lua" />
<action itemid="1541" script="doors_all.lua" />
<action itemid="1542" script="doors_all.lua" />
<action itemid="1634" script="doors_all.lua" />
<action itemid="1635" script="doors_all.lua" />
<action itemid="1636" script="doors_all.lua" />
<action itemid="1637" script="doors_all.lua" />
<action itemid="1638" script="doors_all.lua" />
<action itemid="1639" script="doors_all.lua" />
<action itemid="1640" script="doors_all.lua" />
<action itemid="1641" script="doors_all.lua" />
<action itemid="3535" script="doors_all.lua" />
<action itemid="3536" script="doors_all.lua" />
<action itemid="3537" script="doors_all.lua" />
<action itemid="3538" script="doors_all.lua" />
<action itemid="3539" script="doors_all.lua" />
<action itemid="3540" script="doors_all.lua" />
<action itemid="3541" script="doors_all.lua" />
<action itemid="3542" script="doors_all.lua" />
<action itemid="3543" script="doors_all.lua" />
<action itemid="3544" script="doors_all.lua" />
<action itemid="3545" script="doors_all.lua" />
<action itemid="3546" script="doors_all.lua" />
<action itemid="3547" script="doors_all.lua" />
<action itemid="3548" script="doors_all.lua" />
<action itemid="3549" script="doors_all.lua" />
<action itemid="3550" script="doors_all.lua" />
<action itemid="3551" script="doors_all.lua" />
<action itemid="3552" script="doors_all.lua" />
<action itemid="4913" script="doors_all.lua" />
<action itemid="4914" script="doors_all.lua" />
<action itemid="4915" script="doors_all.lua" />
<action itemid="4916" script="doors_all.lua" />
<action itemid="4917" script="doors_all.lua" />
<action itemid="4918" script="doors_all.lua" />
<action itemid="5082" script="doors_all.lua" />
<action itemid="5083" script="doors_all.lua" />
<action itemid="5084" script="doors_all.lua" />
<action itemid="5085" script="doors_all.lua" />

Now in the 'scripts' folder, there should be one file which is named like "door_all.lua" - change it to "doors_all.lua", open it and place this there:
Quote:
-- Complete Door File
-- Made for 7.6
-- By Doom Stone

function onUse(cid, item, frompos, item2, topos)

if item.actionid == 0 then
if item.itemid == 1209 or item.itemid == 1231 or item.itemid == 1249 or item.itemid == 2544 or item.itemid == 4913 then
doTransformItem(item.uid, item.itemid+2)

elseif item.itemid == 1210 or item.itemid == 1219 or item.itemid == 1223 or item.itemid == 1227 or item.itemid == 1232 or item.itemid == 1237 or item.itemid == 1241 or item.itemid == 1245 or item.itemid == 1250 or item.itemid == 1255 or item.itemid == 1259 or item.itemid == 1539 or item.itemid == 3545 or item.itemid == 3547 or item.itemid == 3549 or item.itemid == 3551 or item.itemid == 4914 or item.itemid == 5082 then
doTransformItem(item.uid, item.itemid+1)

elseif item.itemid == 1211 or item.itemid == 1220 or item.itemid == 1224 or item.itemid == 1228 or item.itemid == 1233 or item.itemid == 1238 or item.itemid == 1242 or item.itemid == 1246 or item.itemid == 1251 or item.itemid == 1256 or item.itemid == 1260 or item.itemid == 1540 or item.itemid == 3546 or item.itemid == 3548 or item.itemid == 3550 or item.itemid == 3552 or item.itemid == 4915 or item.itemid == 5083 then
doorpos = {x=frompos.x, y=frompos.y, z=frompos.z, stackpos=253}
getplayer = getThingfromPos(doorpos)
if getplayer.itemid > 0 then
npos = {x=frompos.x+1, y=frompos.y, z=frompos.z}
doTeleportThing(getplayer.uid, npos)
doTransformItem(item.uid, item.itemid-1)
else
doTransformItem(item.uid, item.itemid-1)
end


elseif item.itemid == 1212 or item.itemid == 1234 or item.itemid == 1252 or item.itemid == 3535 or item.itemid == 4916 then
doTransformItem(item.uid, item.itemid+2)

elseif item.itemid == 1213 or item.itemid == 1221 or item.itemid == 1225 or item.itemid == 1229 or item.itemid == 1235 or item.itemid == 1239 or item.itemid == 1243 or item.itemid == 1247 or item.itemid == 1253 or item.itemid == 1257 or item.itemid == 1261 or item.itemid == 1541 or item.itemid == 3536 or item.itemid == 3538 or item.itemid == 3540 or item.itemid == 3542 or item.itemid == 4917 or item.itemid == 5084 then
doTransformItem(item.uid, item.itemid+1)

elseif item.itemid == 1214 or item.itemid == 1222 or item.itemid == 1226 or item.itemid == 1230 or item.itemid == 1236 or item.itemid == 1240 or item.itemid == 1244 or item.itemid == 1248 or item.itemid == 1254 or item.itemid == 1258 or item.itemid == 1262 or item.itemid == 1542 or item.itemid == 3537 or item.itemid == 3539 or item.itemid == 3541 or item.itemid == 3543 or item.itemid == 4918 or item.itemid == 5085 then
doorpos = {x=frompos.x, y=frompos.y, z=frompos.z, stackpos=253}
getplayer = getThingfromPos(doorpos)
if getplayer.itemid > 0 then
npos = {x=frompos.x, y=frompos.y+1, z=frompos.z}
doTeleportThing(getplayer.uid, npos)
doTransformItem(item.uid, item.itemid-1)
else
doTransformItem(item.uid, item.itemid-1)
end


elseif item.itemid == 1634 or item.itemid == 1636 or item.itemid == 1638 or item.itemid == 1640 then
doTransformItem(item.uid, item.itemid+1)

elseif item.itemid == 1635 or item.itemid == 1637 or item.itemid == 1639 or item.itemid == 1641 then
doTransformItem(item.uid, item.itemid-1)
else
return 0
end

elseif item.actionid > 0 then
level = item.actionid-1000 -- Action ID's below 100 are reserved
if level > 0 then
if getPlayerLevel(cid) >= level then
pos = getPlayerPosition(cid)

if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y+1
else
pos.y = topos.y-1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x+1
else
pos.x = topos.x-1
end
else
doPlayerSendTextMessage(cid, 22, 'Stand in front of the door.')
return 1
end
doTeleportThing(cid, pos)
doSendMagicEffect(topos, 12)
else
doPlayerSendTextMessage(cid, 22, 'You need level ' .. level .. ' to pass this door.')
end

return 1
else
return 0
end
end

return 1
end

After doing these and saving them, go to your 'Map Editor' and place any DOOR where you want, then right click 'Properties' and put on Action ID field like this: 1020 if you want it for 20 level characters. Or like: 1125, if you want it for 125 level characters etc..

********************************
Quest-making tutorial

Disclosure:
Made by me, not copied from anyone

Go to your 'Map Editor', open your 'server.otbm' and place a CHEST where ever you want, then right click on it, and "Properties" and add the ID of you selected item to 'Unique ID'. Simple as that.

********************************
Teleport leading

Disclosure:
Made by me, not copied from anyone

Open you 'Map Editor', open your 'server.otbm' and place a Teleport to the place of our choise. Now right click on it, "Properties" and place the cordinate of the place you want it to lead on places 'x', 'y' and 'z'.

Quote:
<--> = X
/\
| = Y
\/
The floor ('7' is the mainfloor) = Z

********************************
Houses (multiple floored and non-square shaped houses INCLUDED)

Open your 'Map Editor' and open your 'server.otbm'.
Find a nice place for a new house, create the walls and open your 'houses.xml
(\server\data/houses.xml)

This is my from my new map, "Outcast I"

Quote:
</house>
<house name="Outcast I">
<tiles fromx="102" fromy="56" fromz="7" tox="105" toy="60" toz="7"/>
</house>

In the map editor, go to your house's top right corner
Quote:
o____
|~~~|
and check it's cordination and place it to:
Quote:
<houses>
<house name="House name">
<tiles fromx="" fromy="" fromz="" tox="" toy="" toz=""/>
</house>

Then go to your houses lower left corner
Quote:
|~~~|
|____o

and place that cordinate to:
Quote:
<houses>
<house name="House name">
<tiles fromx="" fromy="" fromz="" tox="" toy="" toz=""/>
</house>

Then is should look (depending on cordinates and name of your house) like this:
Quote:
<houses>
<house name="Throne Room I">
<tiles fromx="111" fromy="129" fromz="7" tox="119" toy="135" toz="7"/>
</house>

Now that was for one-floored houses, another one is for multiple floored
Quote:
<houses>
<house name="House name">
<tiles fromx="" fromy="" fromz="" tox="" toy="" toz="7"/>
<tiles fromx="" fromy="" fromz="" tox="" toy="" toz="6"/>

This has the same trick, but change the top right cordinate to the right one and lower left one too (If needed) and most importantly: change the floor! ('z')

Now the trickiest: Houses shaped NOT like square!
Example:
Quote:
___.......___
|~~|___|~~|
|___|~~|_ _|
......|___|

Like this "Mickie Mouse" house.
First put the cordinates of the room that is the most to the left
Quote:
o___
|~~|
|___o

Then the next room, with same style.
REMEMBER, IMPORTANT!
If the tile is already in use, DO NOT place it to another line (The floor is not counted)
Quote:
<houses>
<house name="House name">
<tiles fromx="~" fromy="~" fromz="~" tox="62" toy="85" toz="~"/>
<tiles fromx="62" fromy="85" fromz="~" tox="~" toy="~" toz="~"/>


The houses frontdoor!

Then go to your 'houses' folder
(\server\data\houses)
Create a new .xml file (or make a copy of an older one), name the file as the name of your created house, then paste this there:
Quote:
<?xml version="1.0"?>
<house><frontdoor x="" y="" z=""/><owner name=""/></house>

And to cordinates, put the cordinate of your door there. Name the owner like you want.

Quote:
<--> = X
/\
| = Y
\/
The floor ('7' is the mainfloor) = Z

Related Articles
Action scripts tutorial
Open Tibia Server - creation
Open Tibia Server for absolute beginners
Ots map quests - otserv
Otserver - ot server general
Basic Tibia ots tutorials
Making items on GM
Easy way to make a restarter
Raids


Previous article: Making items on GM
Next article: Tibia without lag