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

MOVEMENTS--- POI tiles --- (Strangely stoped working)

Exiled Pain

Fervid Learner
Joined
Jan 8, 2008
Messages
552
Reaction score
4
Sup, I had some reports from players that throne stepins stop working. It was working fine for the past months before I updated to TFS.4
I'm cheking the code and everything seems ok. I've tryed changing it several times, tryed different ways and for some reasson it doesn't work. So please help.

I'm using TFS .4 now. Everythink works fine except this, no console errors, nothing that could tell me that something is wrong.
In game map editor in this tile I have the actionid: 12198

So now the 2 problems:
1) When I use the original tiles.lua file, it just pushes me back and tells me: "The tile seems to be protected against unwanted intruders."
2)If I take out
Code:
if(item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) <= 0) then
		pushBack(cid, position, fromPosition, true)
		return true
	end
It wont push me back no more, but still, the thing won't work. Even tryed using regular tiles, and nothing.

Here are my scripts:
movements.xml
Code:
<movevent event="StepIn" actionid="12198" script="aztek/poiapocalypsethrone.lua" />

poiapocalypsethrone.lua script
Code:
local increasingItemID = {426}
local decreasingItemID = {425}
function onStepIn(cid, item, position, fromPosition)
	if isInArray(increasingItemID, item.itemid) == TRUE then
		doTransformItem(item.uid, item.itemid - 1)
		if item.actionid == 12198 and getPlayerStorageValue(cid,5303) == -1 then
			doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
                        setPlayerStorageValue(cid,5303,1)
                        doTeleportThing(cid, {x = getPlayerPosition(cid).x + 5, y = getPlayerPosition(cid).y + 1, z = getPlayerPosition(cid).z }, TRUE)
                        doPlayerSendTextMessage(cid,22,"You have enter the Apocalypse throne.")
else 
doTeleportThing(cid, {x = getPlayerPosition(cid).x + 2, y = getPlayerPosition(cid).y + 1, z = getPlayerPosition(cid).z }, TRUE)
			doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
                       doPlayerSendTextMessage(cid,22,"You already had enter the Apocalypse throne.")
		end
	end
	return TRUE
end

and if it helps the original tiles.lua script
Code:
local config = {
	maxLevel = getConfigInfo('maximumDoorLevel')
}

local increasingItems = {[416] = 417, [426] = 425, [446] = 447, [3216] = 3217, [3202] = 3215, [11059] = 11060}
local decreasingItems = {[417] = 416, [425] = 426, [447] = 446, [3217] = 3216, [3215] = 3202, [11060] = 11059}
local depots = {2589, 2590, 2591, 2592}

local checkCreature = {isPlayer, isMonster, isNpc}
local function pushBack(cid, position, fromPosition, displayMessage)
	doTeleportThing(cid, fromPosition, false)
	doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
	if(displayMessage) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
	end
end

function onStepIn(cid, item, position, fromPosition)
	if(not increasingItems[item.itemid]) then
		return false
	end

	if(not isPlayerGhost(cid)) then
		doTransformItem(item.uid, increasingItems[item.itemid])
	end

	if(item.actionid >= 194 and item.actionid <= 196) then
		local f = checkCreature[item.actionid - 193]
		if(f(cid)) then
			pushBack(cid, position, fromPosition, false)
		end

		return true
	end

	if(item.actionid >= 191 and item.actionid <= 193) then
		local f = checkCreature[item.actionid - 190]
		if(not f(cid)) then
			pushBack(cid, position, fromPosition, false)
		end

		return true
	end

	if(not isPlayer(cid)) then
		return true
	end

	if(item.actionid == 189 and not isPremium(cid)) then
		pushBack(cid, position, fromPosition, true)
		return true
	end

	local gender = item.actionid - 186
	if(isInArray({PLAYERSEX_FEMALE,  PLAYERSEX_MALE, PLAYERSEX_GAMEMASTER}, gender)) then
		if(gender ~= getPlayerSex(cid)) then
			pushBack(cid, position, fromPosition, true)
		end

		return true
	end

	local skull = item.actionid - 180
	if(skull >= SKULL_NONE and skull <= SKULL_BLACK) then
		if(skull ~= getCreatureSkullType(cid)) then
			pushBack(cid, position, fromPosition, true)
		end

		return true
	end

	local group = item.actionid - 150
	if(group >= 0 and group < 30) then
		if(group > getPlayerGroupId(cid)) then
			pushBack(cid, position, fromPosition, true)
		end

		return true
	end

	local vocation = item.actionid - 100
	if(vocation >= 0 and vocation < 50) then
		local playerVocationInfo = getVocationInfo(getPlayerVocation(cid))
		if(playerVocationInfo.id ~= vocation and playerVocationInfo.fromVocation ~= vocation) then
			pushBack(cid, position, fromPosition, true)
		end

		return true
	end

	if(item.actionid >= 1000 and item.actionid <= config.maxLevel) then
		if(getPlayerLevel(cid) < item.actionid - 1000) then
			pushBack(cid, position, fromPosition, true)
		end

		return true
	end

	if(item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) <= 0) then
		pushBack(cid, position, fromPosition, true)
		return true
	end

	if(getTileInfo(position).protection) then
		local depotPos, depot = getCreatureLookPosition(cid), {}
		depotPos.stackpos = STACKPOS_GROUND
		while(true) do
			if(not getTileInfo(depotPos).depot) then
				break
			end

			depotPos.stackpos = depotPos.stackpos + 1
			depot = getThingFromPos(depotPos)
			if(depot.uid == 0) then
				break
			end

			if(isInArray(depots, depot.itemid)) then
				local depotItems = getPlayerDepotItems(cid, getDepotId(depot.uid))
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Your depot contains " .. depotItems .. " item" .. (depotItems > 1 and "s" or "") .. ".")
				break
			end
		end

		return true
	end

	return false
end

function onStepOut(cid, item, position, fromPosition)
	if(not decreasingItems[item.itemid]) then
		return false
	end

	if(not isPlayerGhost(cid)) then
		doTransformItem(item.uid, decreasingItems[item.itemid])
		return true
	end

	return false
end

So please help me out, I really don't get whats wrong.
Thanks in advance for the help
 
hmm try removing the, at the teleport part

Code:
doTeleportThing(cid, {x = getPlayerPosition(cid).x + 2, y = getPlayerPosition(cid).y + 1, z = getPlayerPosition(cid).z }, TRUE)
make it
Code:
doTeleportThing(cid, {x = getPlayerPosition(cid).x + 2, y = getPlayerPosition(cid).y + 1, z = getPlayerPosition(cid).z } TRUE)
 
nop, not working, it won't even let me step on the tile... still sending me "The tile seems to be protected against unwanted intruders."
and if I remove the
Code:
if(item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) <= 0) then
		pushBack(cid, position, fromPosition, true)
		return true
	end
nothing happens, it only stays there on top of the tile.
Double checked the the action id 12198 placed in tile on the map editor, and everything is in order... but not working. please help me out
 
well nvm sees I had to rewrite to code from scratch and for some reasson is working again... odd but working anyhow... thanks anyway
 
Back
Top