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

Remove stair PVP tibia 0.4

zabuzo

Well-Known Member
Joined
Jun 10, 2016
Messages
238
Reaction score
54
Remove stair PVP tibia 0.4

I really love tibia PVP...
But there is only one thing i HATE and so much other people rates...

Stair PVP... A noob stay up and down stairs to dont die...
It is detestable...


I was thinking to how block it and get free to this plage.

That's my ideias:

1- to rope need use only upside rope hole
Like is on tibianic, like was on old tibia...
If have only one thing upside the rope hole, u cant get up...

2- When you move upside a stair like
latest

latest

latest


You lose 50% your speed or get a paralyze

How to do it guys? It's so good to all servers!



========================================

Thats my actions/scripts/tools/rope.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(toPosition.x == CONTAINER_POSITION) then
     doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
     return true
   end

   toPosition.stackpos = STACKPOS_GROUND
   local itemGround = getThingFromPos(toPosition)
   if(isInArray(SPOTS, itemGround.itemid)) then
     doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
     return true
   elseif(isInArray(ROPABLE, itemEx.itemid)) then
     local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
     if(hole.itemid > 0) then
       doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, false)
     else
       doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
     end

     return true
   end

   return false
end

That's is my player.cpp
http://hastebin.com/dukisoyayi.cpp
 
Last edited:
movement onStepIn itemId (all stairs/holes)
exhaust storage value (os.time() + exhaust in seconds)
if exhaust storage value > os.time() and pzblock/skull/whatever pvp condition -> walkback
 
Code:
function print_r ( t )
local print_r_cache={}
local function sub_print_r(t,indent)
if (print_r_cache[tostring(t)]) then
print(indent.."*"..tostring(t))
else
print_r_cache[tostring(t)]=true
if (type(t)=="table") then
for pos,val in pairs(t) do
if (type(val)=="table") then
print(indent.."["..pos.."] => "..tostring(t).." {")
sub_print_r(val,indent..string.rep(" ",string.len(pos)+8))
print(indent..string.rep(" ",string.len(pos)+6).."}")
else
print(indent.."["..pos.."] => "..tostring(val))
end
end
else
print(indent..tostring(t))
end
end
end
sub_print_r(t," ")
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(toPosition.x == CONTAINER_POSITION) then
     doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
     return true
   end

   toPosition.stackpos = STACKPOS_GROUND
   local itemGround = getThingFromPos(toPosition)
   if(isInArray(SPOTS, itemGround.itemid)) then
     print_r(getTileThingByPos(toPosition))
     doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
     return true
   elseif(isInArray(ROPABLE, itemEx.itemid)) then
     local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
     if(hole.itemid > 0) then
       print_r(getTileThingByPos(toPosition))
       doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, false)
     else
       doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
     end

     return true
   end

   return false
end


With no trash on
Code:
 [actionid] => 0
 [uid] => 70004
 [itemid] => 8278
 [type] => 0

With 5gps on:
Code:
 [actionid] => 0
 [uid] => 70005
 [itemid] => 8278
 [type] => 0
 
try changing
Code:
print_r(getTileThingByPos(toPosition))
to
Code:
print_r(getTileThingByPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 1}))
and use with gps on it
 
Code:
function print_r ( t )
local print_r_cache={}
local function sub_print_r(t,indent)
if (print_r_cache[tostring(t)]) then
print(indent.."*"..tostring(t))
else
print_r_cache[tostring(t)]=true
if (type(t)=="table") then
for pos,val in pairs(t) do
if (type(val)=="table") then
print(indent.."["..pos.."] => "..tostring(t).." {")
sub_print_r(val,indent..string.rep(" ",string.len(pos)+8))
print(indent..string.rep(" ",string.len(pos)+6).."}")
else
print(indent.."["..pos.."] => "..tostring(val))
end
end
else
print(indent..tostring(t))
end
end
end
sub_print_r(t," ")
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(toPosition.x == CONTAINER_POSITION) then
     doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
     return true
   end

   toPosition.stackpos = STACKPOS_GROUND
   local itemGround = getThingFromPos(toPosition)
   if(isInArray(SPOTS, itemGround.itemid)) then
     print_r(getTileThingByPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 1}))
     doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
     return true
   elseif(isInArray(ROPABLE, itemEx.itemid)) then
     local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
     if(hole.itemid > 0) then
       print_r(getTileThingByPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 1}))
       doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, false)
     else
       doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
     end

     return true
   end

   return false
end

With no trash
Code:
[actionid] => 0
[uid] => 0
[itemid] => 0
[type] => 0

With 5 gps on
Code:
 [actionid] => 0
 [uid] => 70003
 [itemid] => 2148
 [type] => 5
 
Last edited:
ok so
Code:
local tmp = getTileThingByPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 1})
if tmp.id ~= 0 and tmp.id < 100000 then
return false
end
should fix ur issue
 
edited code, i think it should work now?
if theres items + player on tile, stackpos 1 should return the item on tile, if only player tmp.id will be CID e.g >20000000 something
 
ok so
Code:
local tmp = getTileThingByPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 1})
if tmp.id ~= 0 and tmp.id < 100000 then
return false
end
should fix ur issue

You mean this?
Code:
function print_r ( t )
local print_r_cache={}
local function sub_print_r(t,indent)
if (print_r_cache[tostring(t)]) then
print(indent.."*"..tostring(t))
else
print_r_cache[tostring(t)]=true
if (type(t)=="table") then
for pos,val in pairs(t) do
if (type(val)=="table") then
print(indent.."["..pos.."] => "..tostring(t).." {")
sub_print_r(val,indent..string.rep(" ",string.len(pos)+8))
print(indent..string.rep(" ",string.len(pos)+6).."}")
else
print(indent.."["..pos.."] => "..tostring(val))
end
end
else
print(indent..tostring(t))
end
end
end
sub_print_r(t," ")
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(toPosition.x == CONTAINER_POSITION) then
     doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
     return true
   end
   local tmp = getTileThingByPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 1})
     doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
     return true
   end

   toPosition.stackpos = STACKPOS_GROUND
   local itemGround = getThingFromPos(toPosition)
   if(isInArray(SPOTS, itemGround.itemid)) then
     --print_r(getTileThingByPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 1}))
     doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
     return true
   elseif(isInArray(ROPABLE, itemEx.itemid)) then
     local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
     if(hole.itemid > 0) then
       --print_r(getTileThingByPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 1}))
       doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, false)
     else
       doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
     end

     return true
   end

   return false
end


...

Not work. I can get up with trash or without
 
change
Code:
local tmp = getTileThingByPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 1})
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return true
end
to
Code:
local tmp = getTileThingByPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 1})
if tmp.id ~= 0 and tmp.id < 100000 then
return false
end
 
change
Code:
local tmp = getTileThingByPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 1})
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return true
end
to
Code:
local tmp = getTileThingByPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 1})
if tmp.id ~= 0 and tmp.id < 100000 then
return false
end

Code:
[19:35:16.020] [Error - Action Interface]
[19:35:16.020] data/actions/scripts/tools/rope.lua:onUse
[19:35:16.020] Description:
[19:35:16.020] data/actions/scripts/tools/rope.lua:32: attempt to compare nil with number
[19:35:16.020] stack traceback:
[19:35:16.020]    data/actions/scripts/tools/rope.lua:32: in function <data/actions/scripts/tools/rope.lua:26>

[19:35:18.619] [Error - Action Interface]
[19:35:18.619] data/actions/scripts/tools/rope.lua:onUse
[19:35:18.619] Description:
[19:35:18.619] data/actions/scripts/tools/rope.lua:32: attempt to compare nil with number
[19:35:18.619] stack traceback:
[19:35:18.619]    data/actions/scripts/tools/rope.lua:32: in function <data/actions/scripts/tools/rope.lua:26>

[19:35:22.619] [Error - Action Interface]
[19:35:22.619] data/actions/scripts/tools/rope.lua:onUse
[19:35:22.619] Description:
[19:35:22.619] data/actions/scripts/tools/rope.lua:32: attempt to compare nil with number
[19:35:22.619] stack traceback:
[19:35:22.619]    data/actions/scripts/tools/rope.lua:32: in function <data/actions/scripts/tools/rope.lua:26>
 
change
Code:
if tmp.id ~= 0 and tmp.id < 100000 then
to
Code:
if tmp and tmp.id ~= 0 and tmp.id < 100000 then
maybe

Code:
[19:38:09.754] [Error - Action Interface]
[19:38:09.754] data/actions/scripts/tools/rope.lua:onUse
[19:38:09.754] Description:
[19:38:09.754] data/actions/scripts/tools/rope.lua:32: attempt to compare nil with number
[19:38:09.754] stack traceback:
[19:38:09.754]    data/actions/scripts/tools/rope.lua:32: in function <data/actions/scripts/tools/rope.lua:26>
 
Back
Top