• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

stone position with quest done and without quest

Devlinn

Member
Joined
Mar 25, 2015
Messages
295
Reaction score
6
hey, here is possible create stone like
quest = not done
stone x,y = 5,5
quest = done
stone x,y = 6,6

so players without quest have stone at place 5,5
players with quest have stone at 7,7

how i can achieve this?
 
Depends on how the quest works. You can make movement on specific tile that checks player if he did the quest or not and create the stone.
 
Now I'm not really good at this but I have given it a try without testing. Might look really stupid. (Someone please tell me if there are things to make better and if I can get the getthingfrompos in one with a loop please tell me how)

Try this and see if you get any errors.
Put actionId to the tile that is walked on when the stones are supposed to spawn.
It is a movevent so in movements/movements.xml you need to add
XML:
<movevent event="StepIn" actionid="0000" script="addstone.lua"/>
And create file movements/scripts/addstone.lua
LUA:
local timetoreset = 1 -- Resets stone after X minutes
local stoneId = 1304 -- Id of the stone to spawn
local storage = 1001
local p = {
    Position(5, 5, 7), -- Stone if quest is not done
    Position(7, 7, 7), -- Stone if quest is done
}

function onStepIn(player, item, position, fromPosition)
    if getThingFromPos(p[1]) == stoneId then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "A stone is already summoned.")
        return false
    elseif getThingFromPos(p[2]) == stoneId then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "A stone is already summoned.")
        return false
    end
 
    if player:getStorageValue(storage) ~= 1 then
        local stone = Tile(p[1])
        Game.createItem(stoneId, 1, stonePos)
    
        addEvent(function(stonePos)
            stone:getItemById(stoneId):remove()     
        end, timetoreset * 60000, stone:getPosition())
    
    elseif player:getStorageValue(storage) >= 1 then
        local stone = Tile(p[2])
        Game.createItem(stoneId, 1, stonePos)
    
        addEvent(function(stonePos)
            stone:getItemById(stoneId):remove()     
        end, timetoreset * 60000, stone:getPosition())
    end
    return true
end
 
Back
Top