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

Edited desert quest

xexam

New Member
Joined
Aug 3, 2010
Messages
172
Reaction score
1
Hello! I need someone to help me with my quest :)

3523ejm.png


players have to put Soul Orbs (instead of sword, crossbow, spellbook and apple) on the coal basins. Four players have to stand on the tiles (like in desert quest) but instead of teleporting them, I want to create teleport (which disappear in 30 seconds) when the lever is pushed. Can someone edit this script for me?

local config = {
-- level needed to make the quest
level = 400,

-- if players should be able to do the quest unlimited amount of times (not conflicting quest rewards)
redo = {
status = false, -- true = unlimited, false = once
storageValue = 61111 -- only if status is false this will be used
},

-- vocation requirement, positions and item configuration
{
vocations = {1, 5},
itemId = 2175,
playerPos = {x=32677, y=32089, z=8}, -- Initial position in the Stone tile
newPos = {x=32671, y=32069, z=8}, -- Position of the teleport that will be created.
itemPos = {x=32679, y=32089, z=8} -- Position of first soul orb.
},

{
vocations = {2, 6},
itemId = 2674,
playerPos = {x=32669, y=32089, z=8}, -- Initial position in the Stone tile
newPos = {x=32672, y=32069, z=8}, -- Position of the teleport that will be created.
itemPos = {x=32667, y=32089, z=8} -- Position of second soul orb.
},

{
vocations = {3, 7},
itemId = 2455,
playerPos = {x=32673, y=32085, z=8}, -- Initial position in the Stone tile
newPos = {x=32671, y=32070, z=8}, -- Position of the teleport that will be created.
itemPos = {x=32673, y=32084, z=8} -- Position of third soul orb.
},

{
vocations = {4, 8},
itemId = 2376,
playerPos = {x=32673, y=32093, z=8}, -- Initial position in the Stone tile
newPos = {x=32672, y=32070, z=8}, --Position of the teleport that will be created.
itemPos = {x=32673, y=32094, z=8} --Position of fourth soul orb.
}
}

function onUse(cid)
local players = {}
for _, v in ipairs(config) do

v.playerPos.stackpos = 253
local player = getThingfromPos(v.playerPos).uid

if isPlayer(player) == FALSE then
return doPlayerSendCancel(cid, "There are not enough players.")
elseif getPlayerLevel(player) < config.level then
players.level = true
elseif isInArray(v.vocations, getPlayerVocation(player)) == FALSE then
players.vocation = true
elseif config.redo.status and getPlayerStorageValue(cid, config.redo.storageValue) ~= TRUE then
players.done = true
else
v.itemPos.stackpos = 1
local item = getThingfromPos(v.itemPos)

if item.itemid ~= v.itemId then
players.item = true
else
table.insert(players, player)
end
end
end

if players.level then
doPlayerSendCancel(cid, "All players need to be level " .. config.level .. " or above.")
elseif players.vocation then
doPlayerSendCancel(cid, "All players must stand on the correct tiles.")
elseif players.done then
doPlayerSendCancel(cid, "A player in your team has already done this quest.")
elseif players.item then
doPlayerSendCancel(cid, "Soul orbs must be on the correct positions.")
else
for k, player in ipairs(players) do
doSendMagicEffect(getCreaturePosition(player), CONST_ME_POFF)
doTeleportThing(player, config[k].newPos)
doSendMagicEffect(getCreaturePosition(player), CONST_ME_TELEPORT)
end
end

return TRUE
end
 
the thing is I dont know how to add params to create the teleport, if I knew, I wouldn't ask here for help
but if it helps, I want the teleport to create in posTP1 and take to posTP2 and disappear in 30 seconds
 
Lua:
local
	level, storage =
	400,	9001
local
	create,		destination =
{x=100, y=100, z=7}, {x=100, y=100, z=7}

local t = {
	[{1, 5}] = {
		player = {x=32677, y=32089, z=8},
		item = {x=32679, y=32089, z=8}
	},

	[{2, 6}] = {
		player = {x=32669, y=32089, z=8},
		item = {x=32667, y=32089, z=8}
	},

	[{3, 7}] = {
		player = {x=32673, y=32085, z=8},
		item = {x=32673, y=32084, z=8}
	},

	[{4, 8}] = {
		player = {x=32673, y=32093, z=8},
		item = {x=32673, y=32094, z=8}
	}
}

local function close(pos)
	doRemoveItem(getTileItemById(create, 1387).uid)
	doTransformItem(getTileItemById(pos, 1946).uid, 1945)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		local f = {}
		for k, v in pairs(t) do
			local p = getTopCreature(v.player).uid
			if p == 0 or not isPlayer(p) then
				return doPlayerSendCancel(cid, 'There are not enough players.')
			elseif getPlayerLevel(p) < level then
				doPlayerSendCancel(cid, 'All players need to be level ' .. level .. ' or above.')
			elseif not table.find(k, getPlayerVocation(p)) then
				return doPlayerSendCancel(cid, 'All players must stand on the correct tiles.')
			elseif getCreatureStorage(p, storage) == 1 then
				return doPlayerSendCancel(cid, 'A player in your team has already done this quest.')
			else
				v.item.stackpos = 1
				f[i] = getThingfromPos(v.item)
				if f[i].itemid ~= 5944 then
					return doPlayerSendCancel(cid, 'Soul orbs must be on the correct positions.')
				end
			end
		end
		for i = 1, #f do
			doSendMagicEffect(getThingPos(f[i]), CONST_ME_MAGIC_RED)
			doRemoveItem(f[i], 1)
		end
		doCreatureSay(cid, 'The portal has opened.', TALKTYPE_ORANGE_1)
		doCreateTeleport(1387, destination, create)
		doTransformItem(item.uid, 1946)
		addEvent(close, 30000, fromPosition)
	else
		doPlayerSendCancel(cid, 'There is already an open portal.')
	end
	return true
end
 
try s/
Code:
				f[i] = getThingfromPos(v.item)
				if f[i].itemid ~= 5944 then
/
Code:
				table.insert(f, getThingfromPos(v.item))
				if f[#f].itemid ~= 5944 then
 
try s/
Code:
				f[i] = getThingfromPos(v.item)
				if f[i].itemid ~= 5944 then
/
Code:
				table.insert(f, getThingfromPos(v.item))
				if f[#f].itemid ~= 5944 then


when all players are on positions and soul orb also, it says "Soul orbs must be on correct positions"
i guess its because you replaced if f.itemid ~= 5944 then with if f[#f].itemid ~= 5944 then and there is still a parameter in next lines:

for i = 1, #f do
doSendMagicEffect(getThingPos(f), CONST_ME_MAGIC_RED)
doRemoveItem(f, 1)


so maybe it's the reason why teleport doesnt create and soul orbs doesny disappear. Can you fix it please?
 
Back
Top