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

Mw trapping ladders

Ceriano

New Member
Joined
May 13, 2009
Messages
9
Reaction score
0
when someone use a mw here:
81096709.gif

people can't go up.
Can someone help me?
 
post the actions/scripts/other/teleport.lua script and tell me id of that magic wall.
 
teleport.lua
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

fromPosition.stackpos = STACKPOS_GROUND
if(isInArray(UP_FLOORS, item.itemid)) then
fromPosition.z = fromPosition.z - 1
fromPosition.y = fromPosition.y + 1
if(doTileQueryAdd(cid, fromPosition, 4, false) ~= RETURNVALUE_NOERROR) then
fromPosition.y = fromPosition.y - 2
end
else
fromPosition.z = fromPosition.z + 1
end

if(doTileQueryAdd(cid, fromPosition, 4, false) ~= RETURNVALUE_NOERROR) then
return false
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

Magic Wall
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)

function onCastSpell(cid, var)
doDecayItem(doCreateItem(1497, 1, variantToPosition(var)))
return doCombat(cid, combat, var)
end

Same thing happens with wilds growth runes
 
Use this teleport.lua
Lua:
local UP_FLOORS = {1386, 3678, 5543, 8599, 10035}
local FIELDS = {1497, 1499, 11095, 11096}
local DRAW_WELL = 1369

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

	local check = false
	fromPosition.stackpos = STACKPOS_GROUND
	if(isInArray(UP_FLOORS, item.itemid)) then
		fromPosition.z = fromPosition.z - 1
		fromPosition.y = fromPosition.y + 1
		if(doTileQueryAdd(cid, fromPosition, 38, false) ~= RETURNVALUE_NOERROR) then
			local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
			if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
				fromPosition.y = fromPosition.y - 2
			else
				check = true
			end
		end
	else
		fromPosition.z = fromPosition.z + 1
	end

	if(not check and doTileQueryAdd(cid, fromPosition, 38, false) ~= RETURNVALUE_NOERROR) then
		local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
		if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
			return false
		end
	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
 
You have this in movements.xml?
Lua:
	<movevent type="StepIn" itemid="1497" event="function" value="onStepInField"/>
	<movevent type="AddItem" itemid="1497" event="function" value="onAddField"/>
 
Back
Top