Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Parabéns, seu tópico de conteúdo foi aprovado!
Muito obrigado pela sua contribuição, nós do Tibia King agradecemos.
Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.

Spoiler

Congratulations, your content has been approved!
Thank you for your contribution, we of Tibia King we are grateful.
Your content will help many other users, you received +1 REP.

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites

Sistema inovador!! Parabéns, funcionando perfeitamente!!

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
10 minutos atrás, Vodkart disse:

Sistema inovador!! Parabéns, funcionando perfeitamente!!

 

Valeu :) Espero que seja útil ao pessoal. 

Contato:

 

Link para o post
Compartilhar em outros sites
  • 7 months later...

Dwarfer o sistema está incrível. Mas estou recebendo o seguinte erro quando o monstro surge:

 [Error - Action Interface]
[15:49:04.826] In a timer event called from:
[15:49:04.829] function onUse(cid, item, fromPosition, itemEx, toPosition)

[15:49:04.832] domodlib('Job_func')
[15:49:04.834] local n = getNamesByItemDesc(item)

[15:49:04.836] if n[1] ~= nil and n[1] ~= getPlayerName(cid) then
[15:49:04.838]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can not work now here. "..n[1].." is working or was working recently.")
[15:49:04.845] end

[15:49:04.847] local info = getSysPos(cid, toPosition)
[15:49:04.849] local center = info.c
[15:49:04.851] local monster_pos = info.m
[15:49:04.853] local order_pos = info.o
[15:49:04.855] local p = getPlayerPosition(cid)
[15:49:04.856] local rank = tonumber(item.actionid - 4420)
[15:49:04.858] local text = "{"..getPlayerName(cid).."} is working here."


[15:49:04.861] if getPlayerStorageValue(cid, stor.rank) < rank then
[15:49:04.865]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your rank is not enough to work here. Join or promote.")
[15:49:04.872] end

[15:49:04.874] if getPlayerStorageValue(cid, stor.main_tab) ~= -1 then
[15:49:04.877]     setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[15:49:04.880]     if isPlayer(cid) then
[15:49:04.882]         stopEvent(event[cid])
[15:49:04.883]         table.remove(event,cid)
[15:49:04.885]     end
[15:49:04.886]     addEvent(function()
[15:49:04.888]     if isPlayer(cid) then
[15:49:04.890]     doItemSetAttribute(getThingFromPos(toPosition).uid, "description", "")
[15:49:04.892]     end
[15:49:04.893]     end,(times.deal+2)*1000)
[15:49:04.895]     setPlayerStorageValue(cid, stor.main_tab, -1)
[15:49:04.898]     setPlayerStorageValue(cid, stor.scroll, -1)
[15:49:04.900]     setPlayerStorageValue(cid, stor.comp_tab, -1)
[15:49:04.902]     local newpos = info.c
[15:49:04.904]     doTeleportThing(cid, newpos)
[15:49:04.907]     doSendMagicEffect(newpos, CONST_ME_TELEPORT)
[15:49:04.909]     doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[15:49:04.912]     return true
[15:49:04.913] end

[15:49:04.915] if getPlayerStorageValue(cid, stor.lever) - os.time() > 0 then
[15:49:04.919]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to wait "..(getPlayerStorageValue(cid, stor.lever)-os.time()).." seconds to work again.")
[15:49:04.925] end

[15:49:04.927] for i, v in pairs (getStockItens(cid, toPosition)) do
[15:49:04.931]     addItemTable(cid, {v, 0}, stor.main_tab)
[15:49:04.934] end

[15:49:04.936] for k, j in pairs(getStockItens(cid, toPosition)) do
[15:49:04.939]     addItemTable(cid, {j, 0}, stor.comp_tab)
[15:49:04.942] end

[15:49:04.943] doCleanTile(center)
[15:49:04.944] doCleanTile(order_pos)
[15:49:04.946] doItemSetAttribute(item.uid, "description", text)
[15:49:04.948] setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[15:49:04.951] doTeleportThing(cid, center)
[15:49:04.953] doSendMagicEffect(center, CONST_ME_TELEPORT)
[15:49:04.955] doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[15:49:04.957] addEvent(doActions, 2000, cid, p, center, monster_pos, order_pos, rank)

[15:49:04.960] end:onUse
[15:49:04.961] Description:
[15:49:04.962] data/lib/050-function.lua:241: attempt to index a boolean value
[15:49:04.965] stack traceback:
[15:49:04.966]  data/lib/050-function.lua:241: in function 'getItemNameById'
[15:49:04.972]  [string "event = {}..."]:102: in function 'createOrder'
[15:49:04.974]  [string "event = {}..."]:21: in function <[string "event = {}..."]:15>

Poderia me ajudar? Desde-já agradeço :) 

547657261_assinaturatibiaking.jpg.c1cc2728d9b7e7142cd10bf237f3370d.jpg

'' Uma ideia é apenas uma ideia, até ser desenvolvida, mastigada, retratada, analisada e por fim se tornar uma boa ideia. ''

Link para o post
Compartilhar em outros sites
Em 12/04/2018 em 15:52, Alienbear disse:

Dwarfer o sistema está incrível. Mas estou recebendo o seguinte erro quando o monstro surge:


 [Error - Action Interface]
[15:49:04.826] In a timer event called from:
[15:49:04.829] function onUse(cid, item, fromPosition, itemEx, toPosition)

[15:49:04.832] domodlib('Job_func')
[15:49:04.834] local n = getNamesByItemDesc(item)

[15:49:04.836] if n[1] ~= nil and n[1] ~= getPlayerName(cid) then
[15:49:04.838]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can not work now here. "..n[1].." is working or was working recently.")
[15:49:04.845] end

[15:49:04.847] local info = getSysPos(cid, toPosition)
[15:49:04.849] local center = info.c
[15:49:04.851] local monster_pos = info.m
[15:49:04.853] local order_pos = info.o
[15:49:04.855] local p = getPlayerPosition(cid)
[15:49:04.856] local rank = tonumber(item.actionid - 4420)
[15:49:04.858] local text = "{"..getPlayerName(cid).."} is working here."


[15:49:04.861] if getPlayerStorageValue(cid, stor.rank) < rank then
[15:49:04.865]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your rank is not enough to work here. Join or promote.")
[15:49:04.872] end

[15:49:04.874] if getPlayerStorageValue(cid, stor.main_tab) ~= -1 then
[15:49:04.877]     setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[15:49:04.880]     if isPlayer(cid) then
[15:49:04.882]         stopEvent(event[cid])
[15:49:04.883]         table.remove(event,cid)
[15:49:04.885]     end
[15:49:04.886]     addEvent(function()
[15:49:04.888]     if isPlayer(cid) then
[15:49:04.890]     doItemSetAttribute(getThingFromPos(toPosition).uid, "description", "")
[15:49:04.892]     end
[15:49:04.893]     end,(times.deal+2)*1000)
[15:49:04.895]     setPlayerStorageValue(cid, stor.main_tab, -1)
[15:49:04.898]     setPlayerStorageValue(cid, stor.scroll, -1)
[15:49:04.900]     setPlayerStorageValue(cid, stor.comp_tab, -1)
[15:49:04.902]     local newpos = info.c
[15:49:04.904]     doTeleportThing(cid, newpos)
[15:49:04.907]     doSendMagicEffect(newpos, CONST_ME_TELEPORT)
[15:49:04.909]     doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[15:49:04.912]     return true
[15:49:04.913] end

[15:49:04.915] if getPlayerStorageValue(cid, stor.lever) - os.time() > 0 then
[15:49:04.919]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to wait "..(getPlayerStorageValue(cid, stor.lever)-os.time()).." seconds to work again.")
[15:49:04.925] end

[15:49:04.927] for i, v in pairs (getStockItens(cid, toPosition)) do
[15:49:04.931]     addItemTable(cid, {v, 0}, stor.main_tab)
[15:49:04.934] end

[15:49:04.936] for k, j in pairs(getStockItens(cid, toPosition)) do
[15:49:04.939]     addItemTable(cid, {j, 0}, stor.comp_tab)
[15:49:04.942] end

[15:49:04.943] doCleanTile(center)
[15:49:04.944] doCleanTile(order_pos)
[15:49:04.946] doItemSetAttribute(item.uid, "description", text)
[15:49:04.948] setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[15:49:04.951] doTeleportThing(cid, center)
[15:49:04.953] doSendMagicEffect(center, CONST_ME_TELEPORT)
[15:49:04.955] doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[15:49:04.957] addEvent(doActions, 2000, cid, p, center, monster_pos, order_pos, rank)

[15:49:04.960] end:onUse
[15:49:04.961] Description:
[15:49:04.962] data/lib/050-function.lua:241: attempt to index a boolean value
[15:49:04.965] stack traceback:
[15:49:04.966]  data/lib/050-function.lua:241: in function 'getItemNameById'
[15:49:04.972]  [string "event = {}..."]:102: in function 'createOrder'
[15:49:04.974]  [string "event = {}..."]:21: in function <[string "event = {}..."]:15>

Poderia me ajudar? Desde-já agradeço :) 

 

Acho que você tentou usar com menos de 3 monstros para algum rank, não foi? Altere a linha:

local name = monsters[number][math.random(1, #monsters)]

Para:

local name = monsters[number][math.random(1, #monsters[number])]

 

Contato:

 

Link para o post
Compartilhar em outros sites
Em 15/04/2018 em 14:26, Dwarfer disse:

 

Acho que você tentou usar com menos de 3 monstros para algum rank, não foi? Altere a linha:


local name = monsters[number][math.random(1, #monsters)]

Para:


local name = monsters[number][math.random(1, #monsters[number])]

 

Meu caro @Dwarfer agradeço a intenção de ajudar, mas continua o mesmo erro quando o player clica na alavanca para jogar, 1 ou 2 segundos já da esse erro. 

Adoraria usar o sistema, espero de coração que consiga resolver. Abraço.

547657261_assinaturatibiaking.jpg.c1cc2728d9b7e7142cd10bf237f3370d.jpg

'' Uma ideia é apenas uma ideia, até ser desenvolvida, mastigada, retratada, analisada e por fim se tornar uma boa ideia. ''

Link para o post
Compartilhar em outros sites

Resolvido o problema, o mapa precisa ficar igual ao do TÓPICO, balcões elevados e itens com o AID 4420 como explicado. 

Obrigado

547657261_assinaturatibiaking.jpg.c1cc2728d9b7e7142cd10bf237f3370d.jpg

'' Uma ideia é apenas uma ideia, até ser desenvolvida, mastigada, retratada, analisada e por fim se tornar uma boa ideia. ''

Link para o post
Compartilhar em outros sites
  • 1 month later...
Em 16/08/2017 em 17:45, Dwarfer disse:

ACABOU A MOLEZA! Você que sempre fez os NPC's trabalharem dia e noite, disponíveis a qualquer momento mesmo que seja apenas para receber um "hi, buy rope, yes". A COISA MUDOU! Agora você vai ter que ralar. E olhe que os monstros estão com muito gold para gastar devido às mortes de aventureiros, despreparados de AOL ou de bençãos, que acabam por deixar dinheiro nas suas backpacks. VÁ TRABALHAR, SEU VAGAB..! 

 

Depois dessa ladainha toda, estava eu testando algumas funções, umas coisitas aqui e ali e ao misturar tudo saiu isso aí meio que sem querer. Tem uns pontos que podem ser melhorados, mas como disse serviu apenas como uns testes para mim, mas resolvi compartilhar, mesmo sendo simplesinho. Acho que será útil para servidor com um pouquinho de RPG. Testado em TFS 0.4 e versão 8.60.

 

O Job System é um sistema no qual o player atenderá pedidos dos monstros. Cada pedido correto, o player ganha 1 job point que pode ser utilizado para comprar itens no npc ou como você queira fazer, em quests, acessos, seja lá o que for. O funcionamento é demonstrado no vídeo abaixo:

 

 

 

Segue o código do sistema (MOD) e do NPC.

 

jobsystem.xml

 

  Mostrar conteúdo oculto


<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Job System" version="1.0" author="Dwarfer" contact="tibiaking.com" enabled="yes">
<config name="Job_func"><![CDATA[

event = {}
monsters = {
[1] = {"Amazon", "Dwarf", "Elf Scout"},
[2] = {"Barbarian Bloodwalker", "Dwarf Guard", "Warlock"},
[3] = {"Vampire Bride", "Dwarf Geomancer", "Infernalist"}
}

times = {
deal = 30,
lever = 2
}

stor = {job_points = 13330, main_tab = 13331, comp_tab = 13332, scroll = 13333, lever = 13334, rank = 13335}

function doActions(cid, p, center, monsterpos, order_pos, number)
        if isPlayer(cid) then
            if getPlayerStorageValue(cid, stor.main_tab) ~= - 1 then
                updateTable(cid, stor.comp_tab)               
                local name = monsters[number][math.random(1, #monsters)]
                createBuyer(name, monsterpos, center)
                createOrder(cid, order_pos, name)
                addEvent(function()
                if isMonster(getThingFromPos(monsterpos).uid) then
                    reaction(getThingFromPos(monsterpos).uid)
                    end
                    end,times.deal*500)
                addEvent(checkDeal, times.deal*1000, cid, monsterpos, order_pos) 
            else
                addEvent(function()
                if isPlayer(cid) then
                local creature = getTopCreature(monsterpos)
                if creature.type > 0 then
                        doRemoveCreature(creature.uid)
                    end
                stopEvent(event[cid])
                table.remove(event,cid)
                end
                end, 2000)
            end
        end
    event[cid] = addEvent(doActions, (times.deal+5)*1000, cid, p, center, monsterpos, order_pos, number)
end

function updateTable(cid, storage)
local x = {}
for i = 1, #getPlayerStorageTable(cid, storage) do
table.insert(x,getPlayerStorageTable(cid, storage)[i])
end
for i, k in pairs(x) do
local rand = math.random(1, 10)
k.type = rand 
setPlayerStorageTable(cid, storage, x)
end
end


function checkDeal(cid, pos, order_pos)
    pos.stackpos = 1
    local monster = getThingFromPos(pos).uid
    if getPlayerStorageValue(cid, stor.scroll) == -1 then 
            doCreatureSay(monster, "Arghh! Accept my order!", TALKTYPE_ORANGE_1)
            doSendMagicEffect(pos, CONST_ME_POFF)
            doRemoveCreature(monster)
            resetConfig(cid, stor.main_tab)
            local scroll = getTileItemById(order_pos, 1949).uid
            if scroll > 0 then
                doRemoveItem(scroll)
                doSendMagicEffect(order_pos, CONST_ME_POFF)
            end
        return true
    end

    if compareStorageTables(getPlayerStorageTable(cid, stor.main_tab), getPlayerStorageTable(cid, stor.comp_tab)) then
        doCreatureSay(monster, "Thank you!", TALKTYPE_ORANGE_1)
        doSendMagicEffect(pos, CONST_ME_STUN)
        local current = getPlayerStorageValue(cid, stor.job_points)
        setPlayerStorageValue(cid, stor.job_points, current + 1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE , "You earned a Job Point! Now you have: ["..getPlayerStorageValue(cid, stor.job_points).."]")
         doRemoveCreature(monster)
   else
        doCreatureSay(monster, "I didn't order this.", TALKTYPE_ORANGE_1)
        doSendMagicEffect(pos, CONST_ME_POFF)
         doRemoveCreature(monster)
    end
          resetConfig(cid, stor.main_tab)
end

function checkOrder(cid) 
        if isPlayer(cid) then
            if getPlayerStorageValue(cid, stor.scroll) == 1 then
                stopEvent(event[cid])
                table.remove(event,cid)
            end
        end
    event[cid] = addEvent(checkOrder, 1000, cid)
end

function createOrder(cid, pos, writer)
local str,n = "-- "..writer.." order: --\n\n",0
for i = 1,#getPlayerStorageTable(cid, stor.comp_tab) do
n = n + 1
str = str..""..getPlayerStorageTable(cid, stor.comp_tab)[i].type.."  "..getItemNameById(getPlayerStorageTable(cid, stor.comp_tab)[i].id).."\n"
end
local effects = {26, 27, 55}
doSendMagicEffect(pos, effects[math.random(1, #effects)])
local order = doCreateItem(1949, 1, pos)
doSetItemText(order, str, writer)
doItemSetAttribute(order, "aid", 4420)
end

function createBuyer(name, pos, lookPos)
doSummonCreature(name, pos)
local direction = getDirectionTo(pos, lookPos)
pos.stackpos = 1
doCreatureSetLookDirection(getThingFromPos(pos).uid, direction)
end

function reaction(uid) 
look = getCreatureLookDirection(uid)
for i = 1, 20 do
    addEvent(function()
        if isMonster(uid) then
            if i <= 20 then
                look = look < 3 and look + 1 or 0
                doCreatureSetLookDirection(uid, look)
            end
        end
    end, 600*i)
end
doCreatureSay(uid, "delay...", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(uid), CONST_ME_SLEEP)
return true
end

function getItemTableInfo(cid, param)
for i, v in pairs(getPlayerStorageTable(cid, stor.main_tab)) do
    if tonumber(param) == v.id then
        return {index = tonumber(i), id = param, type = v.type}
    end
end
return {}
end

function addType(cid, item, storage)
local x = {}
for i = 1, #getPlayerStorageTable(cid, storage) do
table.insert(x,getPlayerStorageTable(cid, storage)[i])
end
for i, k in pairs(x) do
if tonumber(k.id) == tonumber(item) then
    k.type = k.type + 1
    setPlayerStorageTable(cid, storage, x)
end
end
local count = getItemTableInfo(cid, item).type
local text = "Got " ..count.. " " .. getItemNameById(item).. ""..(count > 1 and "'s" or "")  
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, text)
end

function resetConfig(cid, storage)
local x = {}
for i = 1, #getPlayerStorageTable(cid, storage) do
table.insert(x,getPlayerStorageTable(cid, storage)[i])
end
for i, k in pairs(x) do
    k.type = 0
    setPlayerStorageTable(cid, storage, x)
end
        setPlayerStorageValue(cid, stor.scroll, -1)
end

function compareStorageTables(t1, t2)
local ty1 = type(t1)
local ty2 = type(t2)
if ty1 ~= ty2 then return false end
if ty1 ~= 'table' and ty2 ~= 'table' then return t1 == t2 end
for k1,v1 in pairs(t1) do
local v2 = t2[k1]
if v2 == nil or not compareStorageTables(v1,v2) then return false end
end
for k2,v2 in pairs(t2) do
local v1 = t1[k2]
if v1 == nil or not compareStorageTables(v1,v2) then return false end
end
return true
end

function isInTable(cid, item, storage)
for _,i in pairs(getPlayerStorageTable(cid, storage))do
if tonumber(i.id) == tonumber(item) then
return true
end
end
return false
end

function setPlayerStorageTable(cid, storage, tab)
local tabstr = "&"
for i,x in pairs(tab) do
tabstr = tabstr .. i .. "," .. x.id .. "," .. x.type..";"
end
setPlayerStorageValue(cid, storage, tabstr:sub(1, #tabstr-1))
end

function getPlayerStorageTable(cid, storage)
local tabstr = getPlayerStorageValue(cid, storage)
local tab = {}
if type(tabstr) ~= "string" then
return {}
end
if tabstr:sub(1,1) ~= "&" then
return {}
end
local tabstr = tabstr:sub(2, #tabstr)
local a = string.explode(tabstr, ";")
for i,x in pairs(a) do
local b = string.explode(x, ",")
tab[tonumber(b[1]) or b[1]] = {id = tonumber(b[2]) or b[2], type = tonumber(b[3])}
end
return tab
end

function addItemTable(cid, item, storage)
local x = {}
for i = 1,#getPlayerStorageTable(cid, storage) do
table.insert(x,getPlayerStorageTable(cid, storage)[i])
end
if x ~= 0 then
table.insert(x,{id = tonumber(item[1]), type = tonumber(item[2])})
setPlayerStorageTable(cid, storage, x)
else
setPlayerStorageTable(cid, storage, {item})
end
end

function getStockItens(cid, pos)
local info, items = getSysPos(cid, pos), {}
for i = 1, 3 do
    local position = info["it"..i]
    position.stackpos = 3
    local item = getThingFromPos(position)
        if not isInArray({8046, 8047}, item.itemid) then
            table.insert(items, item.itemid)
        else
            position.stackpos = 4
            local item = getThingFromPos(info["it"..i])
            table.insert(items, item.itemid)
        end
end
return items
end

function getSysPos(cid, pos)  
local p = getPlayerPosition(cid)
for x = pos.x - 1, pos.x + 1 do
for y = pos.y - 1, pos.y + 1 do
local c = {x = x, y = y, z = pos.z}
local d = getDistanceBetween(p, c)
if d == 2 and (c.x == pos.x or c.y == pos.y) and isWalkable(c) then
local y = {"x", "y", "z"}
for i, v in pairs(y) do
y[i] = pos[v]-c[v]
end
local sys = {}
for i = 1, 6 do
sys[i] = {x = c.x, y = c.y, z = c.z}
end
if y[1] == 0 then
sys[2].x = c.x + y[2]*2
sys[3].x = c.x + y[2]
for i = 4, 6 do
sys[i].x = c.x - y[2]
sys[i].y = c.y + (5-i)*y[2]
end
else
sys[2].y = c.y - y[1]*2
sys[3].y = c.y - y[1]
for i = 4, 6 do
sys[i].x = c.x - (5-i)*y[1]
sys[i].y = c.y + y[1]
end
end
return {c = sys[1], m = sys[2], o = sys[3], it1 = sys[4], it2 = sys[5], it3 = sys[6]}               
end
end
end
end

function isWalkable(pos, proj)
if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then
return false
end
local n = not proj and 3 or 2
for i = 0, 255 do
pos.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid ~= 0 and not isCreature(tile.uid) then
if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
return false
end
end
end
return true
end
function getDescription(item) 
for i,x in pairs(getItemDescriptions(item.uid)) do 
if i == "special" then 
return x
end 
end
end 
function getNamesByItemDesc(item)
local names = {}
local str = getDescription(item)
string.gsub(str, "{(.-)}", function(a) table.insert(names, tostring(a)) end)
return names
end]]></config>
<action actionid="4420" event="script"><![CDATA[
domodlib('Job_func')
if getPlayerStorageValue(cid, stor.main_tab) == -1 then 
    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You aren't working to use this item.")
end
local item = getThingFromPos(toPosition).itemid
if item ~= 1949 then
    addType(cid, item, stor.main_tab)
    return true
end]]></action>
<action actionid="4421;4422;4423" event="script"><![CDATA[ 
domodlib('Job_func')
local n = getNamesByItemDesc(item)

if n[1] ~= nil and n[1] ~= getPlayerName(cid) then
    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can not work now here. "..n[1].." is working or was working recently.")
end    

local info = getSysPos(cid, toPosition)
local center = info.c
local monster_pos = info.m
local order_pos = info.o
local p = getPlayerPosition(cid)
local rank = tonumber(item.actionid - 4420)
local text = "{"..getPlayerName(cid).."} is working here."


if getPlayerStorageValue(cid, stor.rank) < rank then
    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your rank is not enough to work here. Join or promote.")
end

if getPlayerStorageValue(cid, stor.main_tab) ~= -1 then
    setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
    if isPlayer(cid) then
        stopEvent(event[cid])
        table.remove(event,cid)
    end
    addEvent(function() 
    if isPlayer(cid) then 
    doItemSetAttribute(getThingFromPos(toPosition).uid, "description", "") 
    end
    end,(times.deal+2)*1000)
    setPlayerStorageValue(cid, stor.main_tab, -1)
    setPlayerStorageValue(cid, stor.scroll, -1)
    setPlayerStorageValue(cid, stor.comp_tab, -1)
    local newpos = info.c
    doTeleportThing(cid, newpos)
    doSendMagicEffect(newpos, CONST_ME_TELEPORT)
    doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
    return true
end

if getPlayerStorageValue(cid, stor.lever) - os.time() > 0 then
    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to wait "..(getPlayerStorageValue(cid, stor.lever)-os.time()).." seconds to work again.")
end

for i, v in pairs (getStockItens(cid, toPosition)) do 
    addItemTable(cid, {v, 0}, stor.main_tab) 
end

for k, j in pairs(getStockItens(cid, toPosition)) do
    addItemTable(cid, {j, 0}, stor.comp_tab)
end

doCleanTile(center)
doCleanTile(order_pos)
doItemSetAttribute(item.uid, "description", text)
setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
doTeleportThing(cid, center)
doSendMagicEffect(center, CONST_ME_TELEPORT)
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
addEvent(doActions, 2000, cid, p, center, monster_pos, order_pos, rank)
]]></action>
<movevent type="RemoveItem" actionid="4420" event="script"><![CDATA[
domodlib('Job_func')
function onRemoveItem(item, tile, lastpos, cid)
if not isPlayer(cid) then
return true
end
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTMOVEABLE)
doTeleportThing(item.uid, lastpos, true)
return true
end]]></movevent>
<movevent type="StepIn" actionid="4420" event="script"><![CDATA[
doTeleportThing(cid, fromPosition)]]></movevent>
<event type="login" name="JobScroll" event="script"><![CDATA[
domodlib('Job_func')
function onLogin(cid)
registerCreatureEvent(cid, "CheckScroll")
return true
end]]></event>
domodlib('Job_func')
<event type="textedit" name="CheckScroll" event="script"><![CDATA[
function onTextEdit(cid, item, newText)
if item.actionid == 4420 then
local order = getThingPos(item.uid)
doCreatureSay(cid, "Order accepted.", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid)
doSendMagicEffect(order, CONST_ME_POFF)
setPlayerStorageValue(cid, stor.scroll, 1)
end    
return true
end]]></event>
</mod>

 

 

 

CONFIGURAÇÃO:

 

Desde que configure corretamente o mapa, não tem praticamente nada para modificar. 


monsters = {
[1] = {"Amazon", "Dwarf", "Elf Scout"},
[2] = {"Barbarian Bloodwalker", "Dwarf Guard", "Warlock"},
[3] = {"Vampire Bride", "Dwarf Geomancer", "Infernalist"}
}

 


times = {
deal = 30,
lever = 2
}

Aqui deal é o tempo em segundos entre cada pedido. Lever é o tempo em minutos para poder usar a alavanca novamente. Aconselho deixá-los nesses valores, já testei e funcionou certinho assim.

 

A configuração ocorre praticamente no mapa:

 

1 - Crie uma "loja" do mesmo tamanho e com a mesma configuração que as mostradas no vídeo e na imagem abaixo. Apenas com a posição do meio livre.

 

YKtCVeV.png

 

Não importa a "orientação" da loja. A única exigência é que a alavanca sempre esteja do lado do braço direito do char, conforme a imagem.

 

MUITO IMPORTANTE: NÃO USE ITENS STACKABLES NA LOJA

 

zKDk80q.png

 

2. Definindo o rank da loja:

ALAVANCA DE ACTION ID:

 

4421 - Rank Apprentice

4422 - Rank Merchant

4423 - Rank Rashid

 

3. Todos os itens que não devem ser arrastados (itens da loja ou de decoração que não devam ser arrastados como o royal axe que mostrei lá no vídeo) devem receber o actionid 4420.

 

4. Os pisos onde os monstros serão criados devem ter actionid 4420. Além disso, ser área no-pvp e no logout (apenas por precaução).

 

5. Toda a área restante deve ser Protection Zone (PZ). Além disso, os locais do centro da loja onde os players ficarão devem ser No Logout Area.

 

 

Dwarfer.xml

 

  Mostrar conteúdo oculto


<?xml version="1.0" encoding="UTF-8"?>
<npc name="Dwarfer" script="job.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="66"/>
	<parameters>
    <parameter key="message_greet" value="Hail, |PLAYERNAME|! Do you want {join} the Jobbers Guild? You can want to know more {about} us or {check} your points. Also, you can {promote} or only {trade}." />
	</parameters>
</npc>

 

 

 

job.lua

 

  Mostrar conteúdo oculto


local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid

function doPlayerRemoveStorage(cid, storage, count)
local current = getPlayerStorageValue(cid, storage)
if current - count < 0 then
return false
else
setPlayerStorageValue(cid, storage, current - count)
end
return true
end

local t = {
stor_job_points = 13330,
stor_rank = 13335, 
promote = {tomerchant = 50, torashid = 100},

apprentice_rank = {-- Apprentice
[2154] = {price = 1}, 
[2158] = {price = 3},
[2155] = {price = 7},
[2156] = {price = 100}
},

merchant_rank = { -- Merchant
[1998] = {price = 15}, 
[5950] = {price = 25},
[1987] = {price = 70},
[2402] = {price = 100}
},

rashid_rank = { -- Rashid
[9993] = {price = 15}, 
[9992] = {price = 25},
[9992] = {price = 70},
[7399] = {price = 100}}
}

function itemsList(rank)
local list = {}
if rank >= 1 then
    for var, ret in pairs(t.apprentice_rank) do
        table.insert(list, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
    end
    if rank >= 2 then
        for var, ret in pairs(t.merchant_rank) do
            table.insert(list, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
        end
    end
    if rank == 3 then
        for var, ret in pairs(t.rashid_rank) do
            table.insert(list, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
        end
    end
end
return list
end

local msg = string.lower(msg)
local rank = getPlayerStorageValue(cid, t.stor_rank) 
local shop = itemsList(rank)
local ranks = {"Apprentice", "Merchant", "Rashid"}
local value = (rank == 1 and tonumber(t.promote.tomerchant) or tonumber(t.promote.torashid))
if msgcontains(msg, 'join') then
    if getPlayerStorageValue(cid, t.stor_rank) <= 0 then
        setPlayerStorageValue(cid, t.stor_job_points, 0)
        setPlayerStorageValue(cid, t.stor_rank, 1)
        rank = getPlayerStorageValue(cid, t.stor_rank) 
        npcHandler:say("Now you are a member of Jobbers Guild. Work hard, young "..ranks[rank].."!", cid)
        talkState[talkUser] = 0
    else
        npcHandler:say("You are already a member of the guild. Work, work, work!", cid)
        talkState[talkUser] = 0
    end
elseif msgcontains(msg, 'about') then
    text = "We create this guild to protect every worker against abuse. Can you believe some people were complaining about a backpack costing only 200 gps? "
    npcHandler:say(text.."Well, when working, you have to accept the order and give the correct items to the buyer.", cid)
    talkState[talkUser] = 0
elseif msgcontains(msg, 'check') then
    if getPlayerStorageValue(cid, t.stor_rank) > 0 then
        npcHandler:say("You are a "..ranks[rank].." and you have "..getPlayerStorageValue(cid, t.stor_job_points).." job points.", cid)
        talkState[talkUser] = 0
    else
        npcHandler:say("You are not a member of our guild yet.", cid)
        talkState[talkUser] = 0
    end
elseif msgcontains(msg, 'promote') then
    if getPlayerStorageValue(cid, t.stor_rank) <= 0 then
        npcHandler:say("You are not a member of our guild yet.", cid)
        talkState[talkUser] = 0
        return true
    end
    if rank == 3 then
        npcHandler:say("Hey, my friend. You worked hard to our guild. All members recognize your efforts. Thank you, dear Rashid.", cid)
        talkState[talkUser] = 0
        return true
    end
    npcHandler:say("Haaaouupa! The guild's ancients are realizing your hard work, "..ranks[rank]..". Do you want to be promoted to "..ranks[rank+1].." for " .. value .. " points?", cid)
    talkState[talkUser] = 1
elseif talkState[talkUser] == 1 then
    if msgcontains(msg, 'yes') then
        if getPlayerStorageValue(cid, t.stor_job_points) >= value then
       	 	setPlayerStorageValue(cid, t.stor_rank, rank + 1)
		doPlayerRemoveStorage(cid, t.stor_job_points, value)
        		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLY_AREA)
       		 npcHandler:say("Welcome, new "..ranks[rank+1]..". AND GO TO WORK!", cid)
        		talkState[talkUser] = 0
        else
            npcHandler:say("You don't have job points necessary to be promoted. Back to work!", cid)
        		talkState[talkUser] = 0
        end
    else
        npcHandler:say("Right. (whisper: Lazy...)", cid)
        talkState[talkUser] = 0
    end
end

local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
         for i, v in pairs(shop) do
            if item == v.id and not doPlayerRemoveStorage(cid, t.stor_job_points, v.buy) then
                npcHandler:say("You need "..v.buy.." job points. GO TO WORK!", cid)
                talkState[talkUser] = 0
                return true
            end
        end		
    doPlayerAddItem(cid, item)
    npcHandler:say("The guild is excited with your performance!", cid)
    talkState[talkUser] = 0
return true
end
if msgcontains(msg, 'trade') then
if rank < 1 then npcHandler:say("You need join the Jobbers Guild before trade.", cid) return true end
    openShopWindow(cid, shop, onBuy, onSell)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

 

 

Configuração do NPC:

 


promote = {tomerchant = 50, torashid = 100},

tomerchant = 50 -> São necessários 50 pontos no rank Apprentice para avançar

torashid = 100 -> São necessários 100 pontos no rank Merchant para avançar

 


entice_rank = {-- Apprentice
[2154] = {price = 1}, 
[2158] = {price = 3},
[2155] = {price = 7},
[2156] = {price = 100}
},

merchant_rank = { -- Merchant
[1998] = {price = 15}, 
[5950] = {price = 25},
[1987] = {price = 70},
[2402] = {price = 100}
},

rashid_rank = { -- Rashid
[9993] = {price = 15}, 
[9992] = {price = 25},
[9992] = {price = 70},
[7399] = {price = 100}}
}

 

[id_do_item] = {price = preço do item}  que aparecerá na lista do NPC. 

 

É isso aí, seus vagal's :) 

image.thumb.png.01fe0141af354ae92dd276a5e9442b4b.png 

fiz tudo certinho mais da esses erro enorme quando clico na alavanca é entro no quadrado poderia me ajudar

 

eh se possível me dizer onde troco os items que fica em cima da mesinha

Link para o post
Compartilhar em outros sites
  • 1 month later...

@Dwarfer esse erro é de quando eu puxo a alavanca que eu entro no sqm

Spoiler

[2/7/2018 16:55:43] [Error - Action Interface] 
[2/7/2018 16:55:43] function onUse(cid, item, fromPosition, itemEx, toPosition)

[2/7/2018 16:55:43] domodlib('Job_func')
[2/7/2018 16:55:43] local n = getNamesByItemDesc(item)

[2/7/2018 16:55:44] if n[1] ~= nil and n[1] ~= getPlayerName(cid) then
[2/7/2018 16:55:44]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Nao Pode Trabalhar Aqui Agora. "..n[1].." Esta Trabalhando Ou Estava Trabalhando Recentemente.")
[2/7/2018 16:55:44] end    

[2/7/2018 16:55:44] local info = getSysPos(cid, toPosition)
[2/7/2018 16:55:44] local center = info.c
[2/7/2018 16:55:44] local monster_pos = info.m
[2/7/2018 16:55:44] local order_pos = info.o
[2/7/2018 16:55:44] local p = getPlayerPosition(cid)
[2/7/2018 16:55:44] local rank = tonumber(item.actionid - 4420)
[2/7/2018 16:55:45] local text = "{"..getPlayerName(cid).."} Esta Trabalhando Aqui."


[2/7/2018 16:55:45] if getPlayerStorageValue(cid, stor.rank) < rank then
[2/7/2018 16:55:45]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Classificacao Nao É Suficiente Para Trabalhar Aqui. Participe Da Equipe Ou Suba De Nivel.")
[2/7/2018 16:55:45] end

[2/7/2018 16:55:45] if getPlayerStorageValue(cid, stor.main_tab) ~= -1 then
[2/7/2018 16:55:45]     setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:55:45]     if isPlayer(cid) then
[2/7/2018 16:55:45]         stopEvent(event[cid])
[2/7/2018 16:55:45]         table.remove(event,cid)
[2/7/2018 16:55:46]     end
[2/7/2018 16:55:46]     addEvent(function() 
[2/7/2018 16:55:46]     if isPlayer(cid) then 
[2/7/2018 16:55:46]     doItemSetAttribute(getThingFromPos(toPosition).uid, "description", "") 
[2/7/2018 16:55:46]     end
[2/7/2018 16:55:46]     end,(times.deal+2)*1000)
[2/7/2018 16:55:46]     setPlayerStorageValue(cid, stor.main_tab, -1)
[2/7/2018 16:55:46]     setPlayerStorageValue(cid, stor.scroll, -1)
[2/7/2018 16:55:46]     setPlayerStorageValue(cid, stor.comp_tab, -1)
[2/7/2018 16:55:47]     local newpos = info.c
[2/7/2018 16:55:47]     doTeleportThing(cid, newpos)
[2/7/2018 16:55:47]     doSendMagicEffect(newpos, CONST_ME_TELEPORT)
[2/7/2018 16:55:47]     doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:55:47]     return true
[2/7/2018 16:55:47] end

[2/7/2018 16:55:47] if getPlayerStorageValue(cid, stor.lever) - os.time() > 0 then
[2/7/2018 16:55:47]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Deve Esperar "..(getPlayerStorageValue(cid, stor.lever)-os.time()).." Segundos, Para Poder Trabalhar Novamente.")
[2/7/2018 16:55:47] end

[2/7/2018 16:55:47] for i, v in pairs (getStockItens(cid, toPosition)) do 
[2/7/2018 16:55:48]     addItemTable(cid, {v, 0}, stor.main_tab) 
[2/7/2018 16:55:48] end

[2/7/2018 16:55:48] for k, j in pairs(getStockItens(cid, toPosition)) do
[2/7/2018 16:55:48]     addItemTable(cid, {j, 0}, stor.comp_tab)
[2/7/2018 16:55:48] end

[2/7/2018 16:55:48] doCleanTile(center)
[2/7/2018 16:55:48] doCleanTile(order_pos)
[2/7/2018 16:55:48] doItemSetAttribute(item.uid, "description", text)
[2/7/2018 16:55:49] setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:55:49] doTeleportThing(cid, center)
[2/7/2018 16:55:49] doSendMagicEffect(center, CONST_ME_TELEPORT)
[2/7/2018 16:55:49] doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:55:49] addEvent(doActions, 2000, cid, p, center, monster_pos, order_pos, rank)

[2/7/2018 16:55:49] end:onUse
[2/7/2018 16:55:49] Description: 
[2/7/2018 16:55:49] [string "LuaInterface::loadBuffer"]:11: attempt to index local 'info' (a nil value)
[2/7/2018 16:55:49] stack traceback:
[2/7/2018 16:55:50]     [string "LuaInterface::loadBuffer"]:11: in function <[string "LuaInterface::loadBuffer"]:1>
[2/7/2018 16:55:50] sqlite3_prepare_v2(): SQLITE ERROR: no such table: z_ots_guildcomunication (SELECT * FROM z_ots_guildcomunication WHERE "type" = 'login';)

[2/7/2018 16:56:9] [Error - Action Interface] 
[2/7/2018 16:56:9] In a timer event called from: 
[2/7/2018 16:56:9] function onUse(cid, item, fromPosition, itemEx, toPosition)

[2/7/2018 16:56:9] domodlib('Job_func')
[2/7/2018 16:56:10] local n = getNamesByItemDesc(item)

[2/7/2018 16:56:10] if n[1] ~= nil and n[1] ~= getPlayerName(cid) then
[2/7/2018 16:56:10]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Nao Pode Trabalhar Aqui Agora. "..n[1].." Esta Trabalhando Ou Estava Trabalhando Recentemente.")
[2/7/2018 16:56:10] end    

[2/7/2018 16:56:10] local info = getSysPos(cid, toPosition)
[2/7/2018 16:56:10] local center = info.c
[2/7/2018 16:56:10] local monster_pos = info.m
[2/7/2018 16:56:10] local order_pos = info.o
[2/7/2018 16:56:10] local p = getPlayerPosition(cid)
[2/7/2018 16:56:10] local rank = tonumber(item.actionid - 4420)
[2/7/2018 16:56:11] local text = "{"..getPlayerName(cid).."} Esta Trabalhando Aqui."


[2/7/2018 16:56:11] if getPlayerStorageValue(cid, stor.rank) < rank then
[2/7/2018 16:56:11]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Classificacao Nao É Suficiente Para Trabalhar Aqui. Participe Da Equipe Ou Suba De Nivel.")
[2/7/2018 16:56:11] end

[2/7/2018 16:56:11] if getPlayerStorageValue(cid, stor.main_tab) ~= -1 then
[2/7/2018 16:56:11]     setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:11]     if isPlayer(cid) then
[2/7/2018 16:56:11]         stopEvent(event[cid])
[2/7/2018 16:56:11]         table.remove(event,cid)
[2/7/2018 16:56:12]     end
[2/7/2018 16:56:12]     addEvent(function() 
[2/7/2018 16:56:12]     if isPlayer(cid) then 
[2/7/2018 16:56:12]     doItemSetAttribute(getThingFromPos(toPosition).uid, "description", "") 
[2/7/2018 16:56:12]     end
[2/7/2018 16:56:12]     end,(times.deal+2)*1000)
[2/7/2018 16:56:12]     setPlayerStorageValue(cid, stor.main_tab, -1)
[2/7/2018 16:56:12]     setPlayerStorageValue(cid, stor.scroll, -1)
[2/7/2018 16:56:12]     setPlayerStorageValue(cid, stor.comp_tab, -1)
[2/7/2018 16:56:12]     local newpos = info.c
[2/7/2018 16:56:13]     doTeleportThing(cid, newpos)
[2/7/2018 16:56:13]     doSendMagicEffect(newpos, CONST_ME_TELEPORT)
[2/7/2018 16:56:13]     doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:13]     return true
[2/7/2018 16:56:13] end

[2/7/2018 16:56:13] if getPlayerStorageValue(cid, stor.lever) - os.time() > 0 then
[2/7/2018 16:56:13]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Deve Esperar "..(getPlayerStorageValue(cid, stor.lever)-os.time()).." Segundos, Para Poder Trabalhar Novamente.")
[2/7/2018 16:56:13] end

[2/7/2018 16:56:13] for i, v in pairs (getStockItens(cid, toPosition)) do 
[2/7/2018 16:56:13]     addItemTable(cid, {v, 0}, stor.main_tab) 
[2/7/2018 16:56:14] end

[2/7/2018 16:56:14] for k, j in pairs(getStockItens(cid, toPosition)) do
[2/7/2018 16:56:14]     addItemTable(cid, {j, 0}, stor.comp_tab)
[2/7/2018 16:56:14] end

[2/7/2018 16:56:14] doCleanTile(center)
[2/7/2018 16:56:14] doCleanTile(order_pos)
[2/7/2018 16:56:14] doItemSetAttribute(item.uid, "description", text)
[2/7/2018 16:56:14] setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:14] doTeleportThing(cid, center)
[2/7/2018 16:56:14] doSendMagicEffect(center, CONST_ME_TELEPORT)
[2/7/2018 16:56:15] doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:15] addEvent(doActions, 2000, cid, p, center, monster_pos, order_pos, rank)

[2/7/2018 16:56:15] end:onUse
[2/7/2018 16:56:15] Description: 
[2/7/2018 16:56:15] (luaDoCreateMonster) Cannot create monster: Amazon
[2/7/2018 16:56:15] [Warning - Npc::createNpc] Cannot find npc with name: Amazon.

[2/7/2018 16:56:15] [Error - Action Interface] 
[2/7/2018 16:56:15] In a timer event called from: 
[2/7/2018 16:56:16] function onUse(cid, item, fromPosition, itemEx, toPosition)

[2/7/2018 16:56:16] domodlib('Job_func')
[2/7/2018 16:56:16] local n = getNamesByItemDesc(item)

[2/7/2018 16:56:16] if n[1] ~= nil and n[1] ~= getPlayerName(cid) then
[2/7/2018 16:56:16]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Nao Pode Trabalhar Aqui Agora. "..n[1].." Esta Trabalhando Ou Estava Trabalhando Recentemente.")
[2/7/2018 16:56:16] end    

[2/7/2018 16:56:17] local info = getSysPos(cid, toPosition)
[2/7/2018 16:56:17] local center = info.c
[2/7/2018 16:56:17] local monster_pos = info.m
[2/7/2018 16:56:17] local order_pos = info.o
[2/7/2018 16:56:17] local p = getPlayerPosition(cid)
[2/7/2018 16:56:17] local rank = tonumber(item.actionid - 4420)
[2/7/2018 16:56:17] local text = "{"..getPlayerName(cid).."} Esta Trabalhando Aqui."


[2/7/2018 16:56:17] if getPlayerStorageValue(cid, stor.rank) < rank then
[2/7/2018 16:56:17]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Classificacao Nao É Suficiente Para Trabalhar Aqui. Participe Da Equipe Ou Suba De Nivel.")
[2/7/2018 16:56:17] end

[2/7/2018 16:56:18] if getPlayerStorageValue(cid, stor.main_tab) ~= -1 then
[2/7/2018 16:56:18]     setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:18]     if isPlayer(cid) then
[2/7/2018 16:56:18]         stopEvent(event[cid])
[2/7/2018 16:56:18]         table.remove(event,cid)
[2/7/2018 16:56:18]     end
[2/7/2018 16:56:18]     addEvent(function() 
[2/7/2018 16:56:18]     if isPlayer(cid) then 
[2/7/2018 16:56:18]     doItemSetAttribute(getThingFromPos(toPosition).uid, "description", "") 
[2/7/2018 16:56:19]     end
[2/7/2018 16:56:19]     end,(times.deal+2)*1000)
[2/7/2018 16:56:19]     setPlayerStorageValue(cid, stor.main_tab, -1)
[2/7/2018 16:56:19]     setPlayerStorageValue(cid, stor.scroll, -1)
[2/7/2018 16:56:19]     setPlayerStorageValue(cid, stor.comp_tab, -1)
[2/7/2018 16:56:19]     local newpos = info.c
[2/7/2018 16:56:19]     doTeleportThing(cid, newpos)
[2/7/2018 16:56:19]     doSendMagicEffect(newpos, CONST_ME_TELEPORT)
[2/7/2018 16:56:19]     doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:19]     return true
[2/7/2018 16:56:19] end

[2/7/2018 16:56:20] if getPlayerStorageValue(cid, stor.lever) - os.time() > 0 then
[2/7/2018 16:56:20]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Deve Esperar "..(getPlayerStorageValue(cid, stor.lever)-os.time()).." Segundos, Para Poder Trabalhar Novamente.")
[2/7/2018 16:56:20] end

[2/7/2018 16:56:20] for i, v in pairs (getStockItens(cid, toPosition)) do 
[2/7/2018 16:56:20]     addItemTable(cid, {v, 0}, stor.main_tab) 
[2/7/2018 16:56:20] end

[2/7/2018 16:56:20] for k, j in pairs(getStockItens(cid, toPosition)) do
[2/7/2018 16:56:20]     addItemTable(cid, {j, 0}, stor.comp_tab)
[2/7/2018 16:56:21] end

[2/7/2018 16:56:21] doCleanTile(center)
[2/7/2018 16:56:21] doCleanTile(order_pos)
[2/7/2018 16:56:21] doItemSetAttribute(item.uid, "description", text)
[2/7/2018 16:56:21] setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:21] doTeleportThing(cid, center)
[2/7/2018 16:56:21] doSendMagicEffect(center, CONST_ME_TELEPORT)
[2/7/2018 16:56:21] doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:22] addEvent(doActions, 2000, cid, p, center, monster_pos, order_pos, rank)

[2/7/2018 16:56:22] end:onUse
[2/7/2018 16:56:22] Description: 
[2/7/2018 16:56:22] (luaDoCreateNpc) Npc with name 'Amazon' not found

[2/7/2018 16:56:22] [Error - Action Interface] 
[2/7/2018 16:56:22] In a timer event called from: 
[2/7/2018 16:56:22] function onUse(cid, item, fromPosition, itemEx, toPosition)

[2/7/2018 16:56:23] domodlib('Job_func')
[2/7/2018 16:56:23] local n = getNamesByItemDesc(item)

[2/7/2018 16:56:23] if n[1] ~= nil and n[1] ~= getPlayerName(cid) then
[2/7/2018 16:56:23]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Nao Pode Trabalhar Aqui Agora. "..n[1].." Esta Trabalhando Ou Estava Trabalhando Recentemente.")
[2/7/2018 16:56:23] end    

[2/7/2018 16:56:24] local info = getSysPos(cid, toPosition)
[2/7/2018 16:56:24] local center = info.c
[2/7/2018 16:56:24] local monster_pos = info.m
[2/7/2018 16:56:24] local order_pos = info.o
[2/7/2018 16:56:24] local p = getPlayerPosition(cid)
[2/7/2018 16:56:24] local rank = tonumber(item.actionid - 4420)
[2/7/2018 16:56:24] local text = "{"..getPlayerName(cid).."} Esta Trabalhando Aqui."


[2/7/2018 16:56:25] if getPlayerStorageValue(cid, stor.rank) < rank then
[2/7/2018 16:56:25]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Classificacao Nao É Suficiente Para Trabalhar Aqui. Participe Da Equipe Ou Suba De Nivel.")
[2/7/2018 16:56:25] end

[2/7/2018 16:56:25] if getPlayerStorageValue(cid, stor.main_tab) ~= -1 then
[2/7/2018 16:56:25]     setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:25]     if isPlayer(cid) then
[2/7/2018 16:56:25]         stopEvent(event[cid])
[2/7/2018 16:56:25]         table.remove(event,cid)
[2/7/2018 16:56:25]     end
[2/7/2018 16:56:26]     addEvent(function() 
[2/7/2018 16:56:26]     if isPlayer(cid) then 
[2/7/2018 16:56:26]     doItemSetAttribute(getThingFromPos(toPosition).uid, "description", "") 
[2/7/2018 16:56:26]     end
[2/7/2018 16:56:26]     end,(times.deal+2)*1000)
[2/7/2018 16:56:26]     setPlayerStorageValue(cid, stor.main_tab, -1)
[2/7/2018 16:56:26]     setPlayerStorageValue(cid, stor.scroll, -1)
[2/7/2018 16:56:26]     setPlayerStorageValue(cid, stor.comp_tab, -1)
[2/7/2018 16:56:26]     local newpos = info.c
[2/7/2018 16:56:27]     doTeleportThing(cid, newpos)
[2/7/2018 16:56:27]     doSendMagicEffect(newpos, CONST_ME_TELEPORT)
[2/7/2018 16:56:27]     doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:27]     return true
[2/7/2018 16:56:27] end

[2/7/2018 16:56:27] if getPlayerStorageValue(cid, stor.lever) - os.time() > 0 then
[2/7/2018 16:56:27]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Deve Esperar "..(getPlayerStorageValue(cid, stor.lever)-os.time()).." Segundos, Para Poder Trabalhar Novamente.")
[2/7/2018 16:56:27] end

[2/7/2018 16:56:28] for i, v in pairs (getStockItens(cid, toPosition)) do 
[2/7/2018 16:56:28]     addItemTable(cid, {v, 0}, stor.main_tab) 
[2/7/2018 16:56:28] end

[2/7/2018 16:56:28] for k, j in pairs(getStockItens(cid, toPosition)) do
[2/7/2018 16:56:28]     addItemTable(cid, {j, 0}, stor.comp_tab)
[2/7/2018 16:56:28] end

[2/7/2018 16:56:29] doCleanTile(center)
[2/7/2018 16:56:29] doCleanTile(order_pos)
[2/7/2018 16:56:29] doItemSetAttribute(item.uid, "description", text)
[2/7/2018 16:56:29] setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:29] doTeleportThing(cid, center)
[2/7/2018 16:56:29] doSendMagicEffect(center, CONST_ME_TELEPORT)
[2/7/2018 16:56:29] doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:29] addEvent(doActions, 2000, cid, p, center, monster_pos, order_pos, rank)

[2/7/2018 16:56:29] end:onUse
[2/7/2018 16:56:30] Description: 
[2/7/2018 16:56:30] (luaDoCreatureSetLookDir) Creature not found

[2/7/2018 16:56:30] [Error - Action Interface] 
[2/7/2018 16:56:30] In a timer event called from: 
[2/7/2018 16:56:30] function onUse(cid, item, fromPosition, itemEx, toPosition)

[2/7/2018 16:56:30] domodlib('Job_func')
[2/7/2018 16:56:30] local n = getNamesByItemDesc(item)

[2/7/2018 16:56:30] if n[1] ~= nil and n[1] ~= getPlayerName(cid) then
[2/7/2018 16:56:30]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Nao Pode Trabalhar Aqui Agora. "..n[1].." Esta Trabalhando Ou Estava Trabalhando Recentemente.")
[2/7/2018 16:56:30] end    

[2/7/2018 16:56:31] local info = getSysPos(cid, toPosition)
[2/7/2018 16:56:31] local center = info.c
[2/7/2018 16:56:31] local monster_pos = info.m
[2/7/2018 16:56:31] local order_pos = info.o
[2/7/2018 16:56:31] local p = getPlayerPosition(cid)
[2/7/2018 16:56:31] local rank = tonumber(item.actionid - 4420)
[2/7/2018 16:56:31] local text = "{"..getPlayerName(cid).."} Esta Trabalhando Aqui."


[2/7/2018 16:56:32] if getPlayerStorageValue(cid, stor.rank) < rank then
[2/7/2018 16:56:32]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Classificacao Nao É Suficiente Para Trabalhar Aqui. Participe Da Equipe Ou Suba De Nivel.")
[2/7/2018 16:56:32] end

[2/7/2018 16:56:32] if getPlayerStorageValue(cid, stor.main_tab) ~= -1 then
[2/7/2018 16:56:32]     setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:32]     if isPlayer(cid) then
[2/7/2018 16:56:32]         stopEvent(event[cid])
[2/7/2018 16:56:32]         table.remove(event,cid)
[2/7/2018 16:56:32]     end
[2/7/2018 16:56:33]     addEvent(function() 
[2/7/2018 16:56:33]     if isPlayer(cid) then 
[2/7/2018 16:56:33]     doItemSetAttribute(getThingFromPos(toPosition).uid, "description", "") 
[2/7/2018 16:56:33]     end
[2/7/2018 16:56:33]     end,(times.deal+2)*1000)
[2/7/2018 16:56:33]     setPlayerStorageValue(cid, stor.main_tab, -1)
[2/7/2018 16:56:33]     setPlayerStorageValue(cid, stor.scroll, -1)
[2/7/2018 16:56:33]     setPlayerStorageValue(cid, stor.comp_tab, -1)
[2/7/2018 16:56:33]     local newpos = info.c
[2/7/2018 16:56:33]     doTeleportThing(cid, newpos)
[2/7/2018 16:56:33]     doSendMagicEffect(newpos, CONST_ME_TELEPORT)
[2/7/2018 16:56:33]     doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:34]     return true
[2/7/2018 16:56:34] end

[2/7/2018 16:56:34] if getPlayerStorageValue(cid, stor.lever) - os.time() > 0 then
[2/7/2018 16:56:34]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Deve Esperar "..(getPlayerStorageValue(cid, stor.lever)-os.time()).." Segundos, Para Poder Trabalhar Novamente.")
[2/7/2018 16:56:34] end

[2/7/2018 16:56:34] for i, v in pairs (getStockItens(cid, toPosition)) do 
[2/7/2018 16:56:34]     addItemTable(cid, {v, 0}, stor.main_tab) 
[2/7/2018 16:56:34] end

[2/7/2018 16:56:35] for k, j in pairs(getStockItens(cid, toPosition)) do
[2/7/2018 16:56:35]     addItemTable(cid, {j, 0}, stor.comp_tab)
[2/7/2018 16:56:35] end

[2/7/2018 16:56:35] doCleanTile(center)
[2/7/2018 16:56:35] doCleanTile(order_pos)
[2/7/2018 16:56:35] doItemSetAttribute(item.uid, "description", text)
[2/7/2018 16:56:35] setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:35] doTeleportThing(cid, center)
[2/7/2018 16:56:35] doSendMagicEffect(center, CONST_ME_TELEPORT)
[2/7/2018 16:56:35] doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:35] addEvent(doActions, 2000, cid, p, center, monster_pos, order_pos, rank)

[2/7/2018 16:56:36] end:onUse
[2/7/2018 16:56:36] Description: 
[2/7/2018 16:56:36] data/lib/100-shortcut.lua:260: attempt to index a boolean value
[2/7/2018 16:56:36] stack traceback:
[2/7/2018 16:56:36]     data/lib/100-shortcut.lua:260: in function 'getItemNameById'
[2/7/2018 16:56:36]     [string "event = {}..."]:102: in function 'createOrder'
[2/7/2018 16:56:36]     [string "event = {}..."]:21: in function <[string "event = {}..."]:15>

 

Editado por Emanueldk (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
9 horas atrás, Emanueldk disse:

@Dwarfer esse erro é de quando eu puxo a alavanca que eu entro no sqm

  Ocultar conteúdo

[2/7/2018 16:55:43] [Error - Action Interface] 
[2/7/2018 16:55:43] function onUse(cid, item, fromPosition, itemEx, toPosition)

[2/7/2018 16:55:43] domodlib('Job_func')
[2/7/2018 16:55:43] local n = getNamesByItemDesc(item)

[2/7/2018 16:55:44] if n[1] ~= nil and n[1] ~= getPlayerName(cid) then
[2/7/2018 16:55:44]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Nao Pode Trabalhar Aqui Agora. "..n[1].." Esta Trabalhando Ou Estava Trabalhando Recentemente.")
[2/7/2018 16:55:44] end    

[2/7/2018 16:55:44] local info = getSysPos(cid, toPosition)
[2/7/2018 16:55:44] local center = info.c
[2/7/2018 16:55:44] local monster_pos = info.m
[2/7/2018 16:55:44] local order_pos = info.o
[2/7/2018 16:55:44] local p = getPlayerPosition(cid)
[2/7/2018 16:55:44] local rank = tonumber(item.actionid - 4420)
[2/7/2018 16:55:45] local text = "{"..getPlayerName(cid).."} Esta Trabalhando Aqui."


[2/7/2018 16:55:45] if getPlayerStorageValue(cid, stor.rank) < rank then
[2/7/2018 16:55:45]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Classificacao Nao É Suficiente Para Trabalhar Aqui. Participe Da Equipe Ou Suba De Nivel.")
[2/7/2018 16:55:45] end

[2/7/2018 16:55:45] if getPlayerStorageValue(cid, stor.main_tab) ~= -1 then
[2/7/2018 16:55:45]     setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:55:45]     if isPlayer(cid) then
[2/7/2018 16:55:45]         stopEvent(event[cid])
[2/7/2018 16:55:45]         table.remove(event,cid)
[2/7/2018 16:55:46]     end
[2/7/2018 16:55:46]     addEvent(function() 
[2/7/2018 16:55:46]     if isPlayer(cid) then 
[2/7/2018 16:55:46]     doItemSetAttribute(getThingFromPos(toPosition).uid, "description", "") 
[2/7/2018 16:55:46]     end
[2/7/2018 16:55:46]     end,(times.deal+2)*1000)
[2/7/2018 16:55:46]     setPlayerStorageValue(cid, stor.main_tab, -1)
[2/7/2018 16:55:46]     setPlayerStorageValue(cid, stor.scroll, -1)
[2/7/2018 16:55:46]     setPlayerStorageValue(cid, stor.comp_tab, -1)
[2/7/2018 16:55:47]     local newpos = info.c
[2/7/2018 16:55:47]     doTeleportThing(cid, newpos)
[2/7/2018 16:55:47]     doSendMagicEffect(newpos, CONST_ME_TELEPORT)
[2/7/2018 16:55:47]     doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:55:47]     return true
[2/7/2018 16:55:47] end

[2/7/2018 16:55:47] if getPlayerStorageValue(cid, stor.lever) - os.time() > 0 then
[2/7/2018 16:55:47]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Deve Esperar "..(getPlayerStorageValue(cid, stor.lever)-os.time()).." Segundos, Para Poder Trabalhar Novamente.")
[2/7/2018 16:55:47] end

[2/7/2018 16:55:47] for i, v in pairs (getStockItens(cid, toPosition)) do 
[2/7/2018 16:55:48]     addItemTable(cid, {v, 0}, stor.main_tab) 
[2/7/2018 16:55:48] end

[2/7/2018 16:55:48] for k, j in pairs(getStockItens(cid, toPosition)) do
[2/7/2018 16:55:48]     addItemTable(cid, {j, 0}, stor.comp_tab)
[2/7/2018 16:55:48] end

[2/7/2018 16:55:48] doCleanTile(center)
[2/7/2018 16:55:48] doCleanTile(order_pos)
[2/7/2018 16:55:48] doItemSetAttribute(item.uid, "description", text)
[2/7/2018 16:55:49] setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:55:49] doTeleportThing(cid, center)
[2/7/2018 16:55:49] doSendMagicEffect(center, CONST_ME_TELEPORT)
[2/7/2018 16:55:49] doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:55:49] addEvent(doActions, 2000, cid, p, center, monster_pos, order_pos, rank)

[2/7/2018 16:55:49] end:onUse
[2/7/2018 16:55:49] Description: 
[2/7/2018 16:55:49] [string "LuaInterface::loadBuffer"]:11: attempt to index local 'info' (a nil value)
[2/7/2018 16:55:49] stack traceback:
[2/7/2018 16:55:50]     [string "LuaInterface::loadBuffer"]:11: in function <[string "LuaInterface::loadBuffer"]:1>
[2/7/2018 16:55:50] sqlite3_prepare_v2(): SQLITE ERROR: no such table: z_ots_guildcomunication (SELECT * FROM z_ots_guildcomunication WHERE "type" = 'login';)

[2/7/2018 16:56:9] [Error - Action Interface] 
[2/7/2018 16:56:9] In a timer event called from: 
[2/7/2018 16:56:9] function onUse(cid, item, fromPosition, itemEx, toPosition)

[2/7/2018 16:56:9] domodlib('Job_func')
[2/7/2018 16:56:10] local n = getNamesByItemDesc(item)

[2/7/2018 16:56:10] if n[1] ~= nil and n[1] ~= getPlayerName(cid) then
[2/7/2018 16:56:10]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Nao Pode Trabalhar Aqui Agora. "..n[1].." Esta Trabalhando Ou Estava Trabalhando Recentemente.")
[2/7/2018 16:56:10] end    

[2/7/2018 16:56:10] local info = getSysPos(cid, toPosition)
[2/7/2018 16:56:10] local center = info.c
[2/7/2018 16:56:10] local monster_pos = info.m
[2/7/2018 16:56:10] local order_pos = info.o
[2/7/2018 16:56:10] local p = getPlayerPosition(cid)
[2/7/2018 16:56:10] local rank = tonumber(item.actionid - 4420)
[2/7/2018 16:56:11] local text = "{"..getPlayerName(cid).."} Esta Trabalhando Aqui."


[2/7/2018 16:56:11] if getPlayerStorageValue(cid, stor.rank) < rank then
[2/7/2018 16:56:11]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Classificacao Nao É Suficiente Para Trabalhar Aqui. Participe Da Equipe Ou Suba De Nivel.")
[2/7/2018 16:56:11] end

[2/7/2018 16:56:11] if getPlayerStorageValue(cid, stor.main_tab) ~= -1 then
[2/7/2018 16:56:11]     setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:11]     if isPlayer(cid) then
[2/7/2018 16:56:11]         stopEvent(event[cid])
[2/7/2018 16:56:11]         table.remove(event,cid)
[2/7/2018 16:56:12]     end
[2/7/2018 16:56:12]     addEvent(function() 
[2/7/2018 16:56:12]     if isPlayer(cid) then 
[2/7/2018 16:56:12]     doItemSetAttribute(getThingFromPos(toPosition).uid, "description", "") 
[2/7/2018 16:56:12]     end
[2/7/2018 16:56:12]     end,(times.deal+2)*1000)
[2/7/2018 16:56:12]     setPlayerStorageValue(cid, stor.main_tab, -1)
[2/7/2018 16:56:12]     setPlayerStorageValue(cid, stor.scroll, -1)
[2/7/2018 16:56:12]     setPlayerStorageValue(cid, stor.comp_tab, -1)
[2/7/2018 16:56:12]     local newpos = info.c
[2/7/2018 16:56:13]     doTeleportThing(cid, newpos)
[2/7/2018 16:56:13]     doSendMagicEffect(newpos, CONST_ME_TELEPORT)
[2/7/2018 16:56:13]     doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:13]     return true
[2/7/2018 16:56:13] end

[2/7/2018 16:56:13] if getPlayerStorageValue(cid, stor.lever) - os.time() > 0 then
[2/7/2018 16:56:13]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Deve Esperar "..(getPlayerStorageValue(cid, stor.lever)-os.time()).." Segundos, Para Poder Trabalhar Novamente.")
[2/7/2018 16:56:13] end

[2/7/2018 16:56:13] for i, v in pairs (getStockItens(cid, toPosition)) do 
[2/7/2018 16:56:13]     addItemTable(cid, {v, 0}, stor.main_tab) 
[2/7/2018 16:56:14] end

[2/7/2018 16:56:14] for k, j in pairs(getStockItens(cid, toPosition)) do
[2/7/2018 16:56:14]     addItemTable(cid, {j, 0}, stor.comp_tab)
[2/7/2018 16:56:14] end

[2/7/2018 16:56:14] doCleanTile(center)
[2/7/2018 16:56:14] doCleanTile(order_pos)
[2/7/2018 16:56:14] doItemSetAttribute(item.uid, "description", text)
[2/7/2018 16:56:14] setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:14] doTeleportThing(cid, center)
[2/7/2018 16:56:14] doSendMagicEffect(center, CONST_ME_TELEPORT)
[2/7/2018 16:56:15] doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:15] addEvent(doActions, 2000, cid, p, center, monster_pos, order_pos, rank)

[2/7/2018 16:56:15] end:onUse
[2/7/2018 16:56:15] Description: 
[2/7/2018 16:56:15] (luaDoCreateMonster) Cannot create monster: Amazon
[2/7/2018 16:56:15] [Warning - Npc::createNpc] Cannot find npc with name: Amazon.

[2/7/2018 16:56:15] [Error - Action Interface] 
[2/7/2018 16:56:15] In a timer event called from: 
[2/7/2018 16:56:16] function onUse(cid, item, fromPosition, itemEx, toPosition)

[2/7/2018 16:56:16] domodlib('Job_func')
[2/7/2018 16:56:16] local n = getNamesByItemDesc(item)

[2/7/2018 16:56:16] if n[1] ~= nil and n[1] ~= getPlayerName(cid) then
[2/7/2018 16:56:16]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Nao Pode Trabalhar Aqui Agora. "..n[1].." Esta Trabalhando Ou Estava Trabalhando Recentemente.")
[2/7/2018 16:56:16] end    

[2/7/2018 16:56:17] local info = getSysPos(cid, toPosition)
[2/7/2018 16:56:17] local center = info.c
[2/7/2018 16:56:17] local monster_pos = info.m
[2/7/2018 16:56:17] local order_pos = info.o
[2/7/2018 16:56:17] local p = getPlayerPosition(cid)
[2/7/2018 16:56:17] local rank = tonumber(item.actionid - 4420)
[2/7/2018 16:56:17] local text = "{"..getPlayerName(cid).."} Esta Trabalhando Aqui."


[2/7/2018 16:56:17] if getPlayerStorageValue(cid, stor.rank) < rank then
[2/7/2018 16:56:17]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Classificacao Nao É Suficiente Para Trabalhar Aqui. Participe Da Equipe Ou Suba De Nivel.")
[2/7/2018 16:56:17] end

[2/7/2018 16:56:18] if getPlayerStorageValue(cid, stor.main_tab) ~= -1 then
[2/7/2018 16:56:18]     setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:18]     if isPlayer(cid) then
[2/7/2018 16:56:18]         stopEvent(event[cid])
[2/7/2018 16:56:18]         table.remove(event,cid)
[2/7/2018 16:56:18]     end
[2/7/2018 16:56:18]     addEvent(function() 
[2/7/2018 16:56:18]     if isPlayer(cid) then 
[2/7/2018 16:56:18]     doItemSetAttribute(getThingFromPos(toPosition).uid, "description", "") 
[2/7/2018 16:56:19]     end
[2/7/2018 16:56:19]     end,(times.deal+2)*1000)
[2/7/2018 16:56:19]     setPlayerStorageValue(cid, stor.main_tab, -1)
[2/7/2018 16:56:19]     setPlayerStorageValue(cid, stor.scroll, -1)
[2/7/2018 16:56:19]     setPlayerStorageValue(cid, stor.comp_tab, -1)
[2/7/2018 16:56:19]     local newpos = info.c
[2/7/2018 16:56:19]     doTeleportThing(cid, newpos)
[2/7/2018 16:56:19]     doSendMagicEffect(newpos, CONST_ME_TELEPORT)
[2/7/2018 16:56:19]     doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:19]     return true
[2/7/2018 16:56:19] end

[2/7/2018 16:56:20] if getPlayerStorageValue(cid, stor.lever) - os.time() > 0 then
[2/7/2018 16:56:20]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Deve Esperar "..(getPlayerStorageValue(cid, stor.lever)-os.time()).." Segundos, Para Poder Trabalhar Novamente.")
[2/7/2018 16:56:20] end

[2/7/2018 16:56:20] for i, v in pairs (getStockItens(cid, toPosition)) do 
[2/7/2018 16:56:20]     addItemTable(cid, {v, 0}, stor.main_tab) 
[2/7/2018 16:56:20] end

[2/7/2018 16:56:20] for k, j in pairs(getStockItens(cid, toPosition)) do
[2/7/2018 16:56:20]     addItemTable(cid, {j, 0}, stor.comp_tab)
[2/7/2018 16:56:21] end

[2/7/2018 16:56:21] doCleanTile(center)
[2/7/2018 16:56:21] doCleanTile(order_pos)
[2/7/2018 16:56:21] doItemSetAttribute(item.uid, "description", text)
[2/7/2018 16:56:21] setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:21] doTeleportThing(cid, center)
[2/7/2018 16:56:21] doSendMagicEffect(center, CONST_ME_TELEPORT)
[2/7/2018 16:56:21] doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:22] addEvent(doActions, 2000, cid, p, center, monster_pos, order_pos, rank)

[2/7/2018 16:56:22] end:onUse
[2/7/2018 16:56:22] Description: 
[2/7/2018 16:56:22] (luaDoCreateNpc) Npc with name 'Amazon' not found

[2/7/2018 16:56:22] [Error - Action Interface] 
[2/7/2018 16:56:22] In a timer event called from: 
[2/7/2018 16:56:22] function onUse(cid, item, fromPosition, itemEx, toPosition)

[2/7/2018 16:56:23] domodlib('Job_func')
[2/7/2018 16:56:23] local n = getNamesByItemDesc(item)

[2/7/2018 16:56:23] if n[1] ~= nil and n[1] ~= getPlayerName(cid) then
[2/7/2018 16:56:23]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Nao Pode Trabalhar Aqui Agora. "..n[1].." Esta Trabalhando Ou Estava Trabalhando Recentemente.")
[2/7/2018 16:56:23] end    

[2/7/2018 16:56:24] local info = getSysPos(cid, toPosition)
[2/7/2018 16:56:24] local center = info.c
[2/7/2018 16:56:24] local monster_pos = info.m
[2/7/2018 16:56:24] local order_pos = info.o
[2/7/2018 16:56:24] local p = getPlayerPosition(cid)
[2/7/2018 16:56:24] local rank = tonumber(item.actionid - 4420)
[2/7/2018 16:56:24] local text = "{"..getPlayerName(cid).."} Esta Trabalhando Aqui."


[2/7/2018 16:56:25] if getPlayerStorageValue(cid, stor.rank) < rank then
[2/7/2018 16:56:25]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Classificacao Nao É Suficiente Para Trabalhar Aqui. Participe Da Equipe Ou Suba De Nivel.")
[2/7/2018 16:56:25] end

[2/7/2018 16:56:25] if getPlayerStorageValue(cid, stor.main_tab) ~= -1 then
[2/7/2018 16:56:25]     setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:25]     if isPlayer(cid) then
[2/7/2018 16:56:25]         stopEvent(event[cid])
[2/7/2018 16:56:25]         table.remove(event,cid)
[2/7/2018 16:56:25]     end
[2/7/2018 16:56:26]     addEvent(function() 
[2/7/2018 16:56:26]     if isPlayer(cid) then 
[2/7/2018 16:56:26]     doItemSetAttribute(getThingFromPos(toPosition).uid, "description", "") 
[2/7/2018 16:56:26]     end
[2/7/2018 16:56:26]     end,(times.deal+2)*1000)
[2/7/2018 16:56:26]     setPlayerStorageValue(cid, stor.main_tab, -1)
[2/7/2018 16:56:26]     setPlayerStorageValue(cid, stor.scroll, -1)
[2/7/2018 16:56:26]     setPlayerStorageValue(cid, stor.comp_tab, -1)
[2/7/2018 16:56:26]     local newpos = info.c
[2/7/2018 16:56:27]     doTeleportThing(cid, newpos)
[2/7/2018 16:56:27]     doSendMagicEffect(newpos, CONST_ME_TELEPORT)
[2/7/2018 16:56:27]     doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:27]     return true
[2/7/2018 16:56:27] end

[2/7/2018 16:56:27] if getPlayerStorageValue(cid, stor.lever) - os.time() > 0 then
[2/7/2018 16:56:27]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Deve Esperar "..(getPlayerStorageValue(cid, stor.lever)-os.time()).." Segundos, Para Poder Trabalhar Novamente.")
[2/7/2018 16:56:27] end

[2/7/2018 16:56:28] for i, v in pairs (getStockItens(cid, toPosition)) do 
[2/7/2018 16:56:28]     addItemTable(cid, {v, 0}, stor.main_tab) 
[2/7/2018 16:56:28] end

[2/7/2018 16:56:28] for k, j in pairs(getStockItens(cid, toPosition)) do
[2/7/2018 16:56:28]     addItemTable(cid, {j, 0}, stor.comp_tab)
[2/7/2018 16:56:28] end

[2/7/2018 16:56:29] doCleanTile(center)
[2/7/2018 16:56:29] doCleanTile(order_pos)
[2/7/2018 16:56:29] doItemSetAttribute(item.uid, "description", text)
[2/7/2018 16:56:29] setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:29] doTeleportThing(cid, center)
[2/7/2018 16:56:29] doSendMagicEffect(center, CONST_ME_TELEPORT)
[2/7/2018 16:56:29] doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:29] addEvent(doActions, 2000, cid, p, center, monster_pos, order_pos, rank)

[2/7/2018 16:56:29] end:onUse
[2/7/2018 16:56:30] Description: 
[2/7/2018 16:56:30] (luaDoCreatureSetLookDir) Creature not found

[2/7/2018 16:56:30] [Error - Action Interface] 
[2/7/2018 16:56:30] In a timer event called from: 
[2/7/2018 16:56:30] function onUse(cid, item, fromPosition, itemEx, toPosition)

[2/7/2018 16:56:30] domodlib('Job_func')
[2/7/2018 16:56:30] local n = getNamesByItemDesc(item)

[2/7/2018 16:56:30] if n[1] ~= nil and n[1] ~= getPlayerName(cid) then
[2/7/2018 16:56:30]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Nao Pode Trabalhar Aqui Agora. "..n[1].." Esta Trabalhando Ou Estava Trabalhando Recentemente.")
[2/7/2018 16:56:30] end    

[2/7/2018 16:56:31] local info = getSysPos(cid, toPosition)
[2/7/2018 16:56:31] local center = info.c
[2/7/2018 16:56:31] local monster_pos = info.m
[2/7/2018 16:56:31] local order_pos = info.o
[2/7/2018 16:56:31] local p = getPlayerPosition(cid)
[2/7/2018 16:56:31] local rank = tonumber(item.actionid - 4420)
[2/7/2018 16:56:31] local text = "{"..getPlayerName(cid).."} Esta Trabalhando Aqui."


[2/7/2018 16:56:32] if getPlayerStorageValue(cid, stor.rank) < rank then
[2/7/2018 16:56:32]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Classificacao Nao É Suficiente Para Trabalhar Aqui. Participe Da Equipe Ou Suba De Nivel.")
[2/7/2018 16:56:32] end

[2/7/2018 16:56:32] if getPlayerStorageValue(cid, stor.main_tab) ~= -1 then
[2/7/2018 16:56:32]     setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:32]     if isPlayer(cid) then
[2/7/2018 16:56:32]         stopEvent(event[cid])
[2/7/2018 16:56:32]         table.remove(event,cid)
[2/7/2018 16:56:32]     end
[2/7/2018 16:56:33]     addEvent(function() 
[2/7/2018 16:56:33]     if isPlayer(cid) then 
[2/7/2018 16:56:33]     doItemSetAttribute(getThingFromPos(toPosition).uid, "description", "") 
[2/7/2018 16:56:33]     end
[2/7/2018 16:56:33]     end,(times.deal+2)*1000)
[2/7/2018 16:56:33]     setPlayerStorageValue(cid, stor.main_tab, -1)
[2/7/2018 16:56:33]     setPlayerStorageValue(cid, stor.scroll, -1)
[2/7/2018 16:56:33]     setPlayerStorageValue(cid, stor.comp_tab, -1)
[2/7/2018 16:56:33]     local newpos = info.c
[2/7/2018 16:56:33]     doTeleportThing(cid, newpos)
[2/7/2018 16:56:33]     doSendMagicEffect(newpos, CONST_ME_TELEPORT)
[2/7/2018 16:56:33]     doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:34]     return true
[2/7/2018 16:56:34] end

[2/7/2018 16:56:34] if getPlayerStorageValue(cid, stor.lever) - os.time() > 0 then
[2/7/2018 16:56:34]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Deve Esperar "..(getPlayerStorageValue(cid, stor.lever)-os.time()).." Segundos, Para Poder Trabalhar Novamente.")
[2/7/2018 16:56:34] end

[2/7/2018 16:56:34] for i, v in pairs (getStockItens(cid, toPosition)) do 
[2/7/2018 16:56:34]     addItemTable(cid, {v, 0}, stor.main_tab) 
[2/7/2018 16:56:34] end

[2/7/2018 16:56:35] for k, j in pairs(getStockItens(cid, toPosition)) do
[2/7/2018 16:56:35]     addItemTable(cid, {j, 0}, stor.comp_tab)
[2/7/2018 16:56:35] end

[2/7/2018 16:56:35] doCleanTile(center)
[2/7/2018 16:56:35] doCleanTile(order_pos)
[2/7/2018 16:56:35] doItemSetAttribute(item.uid, "description", text)
[2/7/2018 16:56:35] setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[2/7/2018 16:56:35] doTeleportThing(cid, center)
[2/7/2018 16:56:35] doSendMagicEffect(center, CONST_ME_TELEPORT)
[2/7/2018 16:56:35] doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[2/7/2018 16:56:35] addEvent(doActions, 2000, cid, p, center, monster_pos, order_pos, rank)

[2/7/2018 16:56:36] end:onUse
[2/7/2018 16:56:36] Description: 
[2/7/2018 16:56:36] data/lib/100-shortcut.lua:260: attempt to index a boolean value
[2/7/2018 16:56:36] stack traceback:
[2/7/2018 16:56:36]     data/lib/100-shortcut.lua:260: in function 'getItemNameById'
[2/7/2018 16:56:36]     [string "event = {}..."]:102: in function 'createOrder'
[2/7/2018 16:56:36]     [string "event = {}..."]:21: in function <[string "event = {}..."]:15>

 

 

Crie a loja exatamente como está na imagem que vai funcionar.

Contato:

 

Link para o post
Compartilhar em outros sites

@Dwarfer ta certo, mais quando eu dou use na alavanca e nos itens da esse erro

quando da use na alanvaca que voce ja estra dentro da loja, dentro do sqm

Spoiler

[3/7/2018 11:23:56] [Error - Action Interface] 
[3/7/2018 11:23:56] function onUse(cid, item, fromPosition, itemEx, toPosition)

[3/7/2018 11:23:56] domodlib('Job_func')
[3/7/2018 11:23:56] local n = getNamesByItemDesc(item)

[3/7/2018 11:23:56] if n[1] ~= nil and n[1] ~= getPlayerName(cid) then
[3/7/2018 11:23:56]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Nao Pode Trabalhar Aqui Agora. "..n[1].." Esta Trabalhando Ou Estava Trabalhando Recentemente.")
[3/7/2018 11:23:56] end    

[3/7/2018 11:23:56] local info = getSysPos(cid, toPosition)
[3/7/2018 11:23:57] local center = info.c
[3/7/2018 11:23:57] local monster_pos = info.m
[3/7/2018 11:23:57] local order_pos = info.o
[3/7/2018 11:23:57] local p = getPlayerPosition(cid)
[3/7/2018 11:23:57] local rank = tonumber(item.actionid - 4420)
[3/7/2018 11:23:57] local text = "{"..getPlayerName(cid).."} Esta Trabalhando Aqui."


[3/7/2018 11:23:57] if getPlayerStorageValue(cid, stor.rank) < rank then
[3/7/2018 11:23:57]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Classificacao Nao É Suficiente Para Trabalhar Aqui. Participe Da Equipe Ou Suba De Nivel.")
[3/7/2018 11:23:57] end

[3/7/2018 11:23:57] if getPlayerStorageValue(cid, stor.main_tab) ~= -1 then
[3/7/2018 11:23:57]     setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[3/7/2018 11:23:57]     if isPlayer(cid) then
[3/7/2018 11:23:57]         stopEvent(event[cid])
[3/7/2018 11:23:57]         table.remove(event,cid)
[3/7/2018 11:23:57]     end
[3/7/2018 11:23:57]     addEvent(function() 
[3/7/2018 11:23:57]     if isPlayer(cid) then 
[3/7/2018 11:23:57]     doItemSetAttribute(getThingFromPos(toPosition).uid, "description", "") 
[3/7/2018 11:23:57]     end
[3/7/2018 11:23:57]     end,(times.deal+2)*1000)
[3/7/2018 11:23:57]     setPlayerStorageValue(cid, stor.main_tab, -1)
[3/7/2018 11:23:57]     setPlayerStorageValue(cid, stor.scroll, -1)
[3/7/2018 11:23:57]     setPlayerStorageValue(cid, stor.comp_tab, -1)
[3/7/2018 11:23:57]     local newpos = info.c
[3/7/2018 11:23:57]     doTeleportThing(cid, newpos)
[3/7/2018 11:23:57]     doSendMagicEffect(newpos, CONST_ME_TELEPORT)
[3/7/2018 11:23:58]     doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[3/7/2018 11:23:58]     return true
[3/7/2018 11:23:58] end

[3/7/2018 11:23:58] if getPlayerStorageValue(cid, stor.lever) - os.time() > 0 then
[3/7/2018 11:23:58]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Deve Esperar "..(getPlayerStorageValue(cid, stor.lever)-os.time()).." Segundos, Para Poder Trabalhar Novamente.")
[3/7/2018 11:23:58] end

[3/7/2018 11:23:58] for i, v in pairs (getStockItens(cid, toPosition)) do 
[3/7/2018 11:23:58]     addItemTable(cid, {v, 0}, stor.main_tab) 
[3/7/2018 11:23:58] end

[3/7/2018 11:23:58] for k, j in pairs(getStockItens(cid, toPosition)) do
[3/7/2018 11:23:58]     addItemTable(cid, {j, 0}, stor.comp_tab)
[3/7/2018 11:23:58] end

[3/7/2018 11:23:58] doCleanTile(center)
[3/7/2018 11:23:58] doCleanTile(order_pos)
[3/7/2018 11:23:58] doItemSetAttribute(item.uid, "description", text)
[3/7/2018 11:23:58] setPlayerStorageValue(cid, stor.lever, times.lever*60 + os.time())
[3/7/2018 11:23:58] doTeleportThing(cid, center)
[3/7/2018 11:23:58] doSendMagicEffect(center, CONST_ME_TELEPORT)
[3/7/2018 11:23:58] doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
[3/7/2018 11:23:58] addEvent(doActions, 2000, cid, p, center, monster_pos, order_pos, rank)

[3/7/2018 11:23:58] end:onUse
[3/7/2018 11:23:58] Description: 
[3/7/2018 11:23:58] [string "LuaInterface::loadBuffer"]:11: attempt to index local 'info' (a nil value)
[3/7/2018 11:23:58] stack traceback:
[3/7/2018 11:23:58]     [string "LuaInterface::loadBuffer"]:11: in function <[string "LuaInterface::loadBuffer"]:1>
 

 

quando da use nos itens dentro da loja fala que voce nao esta trabalhando para usar este item

Spoiler

[3/7/2018 11:22:46] [Error - Action Interface] 
[3/7/2018 11:22:46] function onUse(cid, item, fromPosition, itemEx, toPosition)
[3/7/2018 11:22:46] domodlib('Job_func')
[3/7/2018 11:22:46] if getPlayerStorageValue(cid, stor.main_tab) == -1 then 
[3/7/2018 11:22:46]     return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Nao Esta Trabalhando Para Usar Este Item.")
[3/7/2018 11:22:46] end
[3/7/2018 11:22:46] local item = getThingFromPos(toPosition).itemid
[3/7/2018 11:22:47] if item ~= 1949 then
[3/7/2018 11:22:47]     addType(cid, item, stor.main_tab)
[3/7/2018 11:22:47]     return true
[3/7/2018 11:22:47] end
[3/7/2018 11:22:47] end:onUse
[3/7/2018 11:22:47] Description: 
[3/7/2018 11:22:47] [string "event = {}..."]:156: attempt to compare number with nil
[3/7/2018 11:22:47] stack traceback:
[3/7/2018 11:22:47]     [string "event = {}..."]:156: in function 'addType'
[3/7/2018 11:22:47]     [string "LuaInterface::loadBuffer"]:8: in function <[string "LuaInterface::loadBuffer"]:1>

 

Editado por Emanueldk (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo