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

Solved Desert quest solo

antonio664

Member
Joined
Jan 9, 2013
Messages
130
Reaction score
5
What 's to do here so you do not need 4 vocations?
Edit: solved!
>
Code:
local config = {
    {fromPosition = Position(32673, 32085, 8), toPosition = Position(32670, 32071, 8), sacrificePosition = Position(32673, 32094, 8), sacrificeId = 2376}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    item:transform(item.itemid == 1945 and 1946 or 1945)

    if item.itemid ~= 1945 then
        return true
    end

    local position = player:getPosition()

    local players = {}
    for i = 1, #config do
        local creature = Tile(config[i].fromPosition):getTopCreature()
        if not creature or not creature:isPlayer() then
            player:sendCancelMessage('You need one player of each vocation for this quest.')
            position:sendMagicEffect(CONST_ME_POFF)
            return true
        end


        local sacrificeItem = Tile(config[i].sacrificePosition):getItemById(config[i].sacrificeId)
        if not sacrificeItem then
            player:sendCancelMessage(creature:getName() .. ' is missing ' .. (creature:getSex() == PLAYERSEX_FEMALE and 'her' or 'his') .. ' sacrifice on the altar.')
            position:sendMagicEffect(CONST_ME_POFF)
            return true
        end

        players[#players + 1] = creature
    end

    for i = 1, #players do
        local sacrificeItem = Tile(config[i].sacrificePosition):getItemById(config[i].sacrificeId)
        if sacrificeItem then
            sacrificeItem:remove()
        end

        players[i]:getPosition():sendMagicEffect(CONST_ME_POFF)
        players[i]:teleportTo(config[i].toPosition)
        config[i].toPosition:sendMagicEffect(CONST_ME_TELEPORT)
    end
    return true
end
 
Last edited:
Back
Top