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

Changing the stairs direction

The extros

New Member
Joined
Jun 28, 2010
Messages
98
Reaction score
1
Need fast help with this..
Where can i change the position when you use a stair??
I want that when you use a stair it go you up and south of the stair sqm, but it now is taking you up and 1 sqm north from the stair... Please help!

P.D: SRRY FOR THE TITLE!!
 
Last edited:
data/items/items.xml

look for item.id = your_stair_id

Find something with floorchange, and just look at it, you will understand!
 
oh, thought it was a stair,

data/actions/actions.xml

look for itemid="1386"

Check were the file is located, open the source file and look in there.
 
<action itemid="1386" event="script" value="other/teleport.lua"/>


data/other/teleport.lua:

Code:
local UP_FLOORS = {1386, 3678, 5543, 8599, 10035}
local DRAW_WELL = 1369

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.itemid == DRAW_WELL and item.actionid ~= 100) then
		return false
	end

	if(isInArray(UP_FLOORS, item.itemid)) then
		fromPosition.z = fromPosition.z - 1
		fromPosition.y = fromPosition.y + 1

		fromPosition.stackpos = STACKPOS_GROUND
		if(item.actionid == 100 or getThingFromPos(fromPosition, false).itemid == 0) then
			fromPosition.y = fromPosition.y - 2
		end
	else
		fromPosition.z = fromPosition.z + 1
	end

	local pos, dir = getCreaturePosition(cid), SOUTH
	if(pos.x < fromPosition.x) then
		dir = EAST
	elseif(pos.x == fromPosition.x) then
		if(pos.y == fromPosition.y) then
			dir = getCreatureLookDirection(cid)
		elseif(pos.y > fromPosition.y) then
			dir = NORTH
		end
	elseif(pos.x > fromPosition.x) then
		dir = WEST
	end

	doTeleportThing(cid, fromPosition, false)
	doCreatureSetLookDirection(cid, dir)
	return true
end
 
replace all that text with this:

Lua:
local UP_FLOORS_NORTH = {3678, 5543, 8599, 10035}
local UP_FLOORS_SOUTH = {1386}
local DRAW_WELL = 1369

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.itemid == DRAW_WELL and item.actionid ~= 100) then
		return false
	end

	if(isInArray(UP_FLOORS_NORTH, item.itemid)) then
		fromPosition.z = fromPosition.z - 1
		fromPosition.y = fromPosition.y + 1

		fromPosition.stackpos = STACKPOS_GROUND
		if(item.actionid == 100 or getThingFromPos(fromPosition, false).itemid == 0) then
			fromPosition.y = fromPosition.y - 2
		end
	elseif(isInArray(UP_FLOORS_SOUTH, item.itemid)) then
		fromPosition.z = fromPosition.z + 1
		fromPosition.y = fromPosition.y + 1

		fromPosition.stackpos = STACKPOS_GROUND
		if(item.actionid == 100 or getThingFromPos(fromPosition, false).itemid == 0) then
			fromPosition.y = fromPosition.y - 2
		end
	else
		fromPosition.z = fromPosition.z + 1
	end

	local pos, dir = getCreaturePosition(cid), SOUTH
	if(pos.x < fromPosition.x) then
		dir = EAST
	elseif(pos.x == fromPosition.x) then
		if(pos.y == fromPosition.y) then
			dir = getCreatureLookDirection(cid)
		elseif(pos.y > fromPosition.y) then
			dir = NORTH
		end
	elseif(pos.x > fromPosition.x) then
		dir = WEST
	end

	doTeleportThing(cid, fromPosition, false)
	doCreatureSetLookDirection(cid, dir)
	return true
end
 
Back
Top