the first thing you need to do is go to youre server folder > data > pvparena(s).xml
open it: then you will see something like this:
<?xml version=”1.0”?>
<pvparena exitx=”213” exity=”119” exitz=”7”>
<!—if you are changing this change also lever.lua—>
<tile x=”207” y=”123” z=”7”/>
<tile x=”208” y=”123” z=”7”/>
<tile x=”209” y=”123” z=”7”/>
<tile x=”210” y=”123” z=”7”/>
<tile x=”211” y=”123” z=”7”/>
<tile x=”212” y=”123” z=”7”/>
<tile x=”213” y=”123” z=”7”/>
<tile x=”214” y=”123” z=”7”/>
<tile x=”215” y=”123” z=”7”/>
<tile x=”216” y=”123” z=”7”/>
<tile x=”217” y=”123” z=”7”/>
<tile x=”218” y=”123” z=”7”/>
<tile x=”219” y=”123” z=”7”/>
<tile x=”207” y=”124” z=”7”/>
<tile x=”208” y=”124” z=”7”/>
<tile x=”209” y=”124” z=”7”/>
<tile x=”210” y=”124” z=”7”/>
<tile x=”211” y=”124” z=”7”/>
<tile x=”212” y=”124” z=”7”/>
</pvparena>
<pvparena exitx=”213” exity=”119” exitz=”7”> this is the exit of ur pvp arena so, when you killed some1 he goes to that point.
<tile x=”212” y=”124” z=”7”/> those are the tiles in ur pvp arena, place all tiles of your pvp arena in here.
if you try to start your server now and he won’t load try something like </pvparenas>
or something.
now your pvp arena is ready , you only need to make a switch (not necaserry)
data > actions > scripts , if you don’t have a leverarena.lua or something like that make a new .lua
add this:
—pvp arena lever
function onUse(cid, item, frompos, item2, topos)
if item.uid 7005 and item.itemid 1945 then
player1pos = {x=205, y=126, z=7, stackpos=253}
player1 = getThingfromPos(player1pos)
player2pos = {x=221, y=126, z=7, stackpos=253}
player2 = getThingfromPos(player2pos)
if player1.itemid > 0 and player2.itemid > 0 then
arenalevel = 50
player1level = getPlayerLevel(player1.uid)
player2level = getPlayerLevel(player2.uid)
if player1level >= arenalevel and player2level >= arenalevel then
for arenax = 172,180 do
for arenay = 541,549 do
arenapos = {x=arenax, y=arenay, z=7, stackpos=253}
arenacreature = getThingfromPos(arenapos)
if arenacreature.itemid > 2 then
doPlayerSendCancel(cid,”Wait for current duel to end.”)
return 1
end
end
end
nplayer1pos = {x=209, y=126, z=7}
nplayer2pos = {x=218, y=126, z=7}
doSendMagicEffect(player1pos,2)
doSendMagicEffect(player2pos,2)
doTeleportThing(player1.uid,nplayer1pos)
doTeleportThing(player2.uid,nplayer2pos)
doSendMagicEffect(nplayer1pos,10)
doSendMagicEffect(nplayer2pos,10)
doPlayerSendTextMessage(player1.uid,18,”FIGHT!”)
doPlayerSendTextMessage(player2.uid,18,”FIGHT!”)
else
doPlayerSendCancel(cid,”Both fighters must be level 50.”)
end
else
doPlayerSendCancel(cid,”You need 2 players for a duel.”)
end
else
return 0
end
return 1
end
player1pos = {x=205, y=126, z=7, stackpos=253} positions of the players where they need to stand to get teleported. change player2pos to.
arenalevel= ... here the level you want.
i think that’s all you need.
the last thing to do is go to data > actions > actions.xml
<action uniqueid =”7005” script=”leverarena.lua” />
<action itemid=”1945” script=”leverarena.lua” />
add this 2 in the list , i forget which ,just try :P
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
Simple tutorials for Tibia 7.6
Making items on GM
Easy way to make a restarter
Raids
Previous article: How to create NPC
Next article: Custom monsters