Ir para conteúdo
  • Cadastre-se

Vitorelias

Membro
  • Total de itens

    116
  • Registro em

  • Última visita

  • Dias Ganhos

    2

Posts postados por Vitorelias

  1. 1 hora atrás, GM Vortex disse:
    
    
    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)
        function lowerTable(tabela) -- by vodkart
            local tab = {}
            for var, ret in pairs(tabela) do
                tab[var:lower()] = ret
            end
            return tab
        end
    
        if not npcHandler:isFocused(cid) then
            return false
        end
    
        local talkUser, msg = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid, msg:lower()
        local viagens = {
            ['dark city'] = {premium = false, level = 0, cost = 200, destination = {x=766, y=1090, z=6}},
        }
    
        local travel = lowerTable(viagens)
    
        if travel[msg] then
            local player = Player(cid)
            local var = travel[msg]
    
            if var.level > 0 and player:getLevel() < var.level then
                npcHandler:say("Sorry but you must be level " .. var.level .. " to travel to this place.", cid)
                return true
            elseif var.premium and not isPremium(cid) then
                npcHandler:say("Sorry, to go to " .. msg .. " it is necessary to be VIP.", cid)
                return true
            else
                local cost = var.cost
                local playerMoney = player:getMoney()
                local playerBankBalance = player:getBankBalance()
                
                if playerMoney < cost and playerBankBalance >= cost then
                    player:withdrawMoneyFromBank(cost)
                elseif playerMoney < cost and playerBankBalance < cost then
                    npcHandler:say("Sorry, you don't have enough money in your backpack or in the bank.", cid)
                    return true
                else
                    player:removeMoney(cost)
                end
    
                npcHandler:say("Bon voyage!!", cid)
                npcHandler:releaseFocus(cid)
                local playerPos = getCreaturePosition(cid)
                Position(playerPos):sendMagicEffect(CONST_ME_TELEPORT)
                doTeleportThing(cid, var.destination)
    			npcHandler:say("The boat lost its way and stopped in Magician, Careful!", cid)
            end
        else
            npcHandler:say("I don't sail to this city...", cid)
        end
    
        return true
    end
    
    npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
    npcHandler:addModule(FocusModule:new())

     

    Bom dia man! deu erro no console

     

    Lua Script Error: [Npc interface]
    data/npc/scripts/claudiao.lua:onCreatureSay
    data/npc/scripts/claudiao.lua:58: attempt to call method 'withdrawMoneyFromBank' (a nil value)
    stack traceback:
            [C]: in function 'withdrawMoneyFromBank'
            data/npc/scripts/claudiao.lua:58: in function 'callback'
            data/npc/lib/npcsystem/npchandler.lua:411: in function 'onCreatureSay'
            data/npc/scripts/capitao batata.lua:15: in function <data/npc/scripts/claudiao.lua:14>

     

     

     

    meu modules.lua 

     

     

     

      function Player.removeMoneyNpc(self, amount)
        local moneyCount = self:getMoney()
        local bankCount = self:getBankBalance()
        if amount > moneyCount + bankCount then
            return false
        end
    
        self:removeMoney(math.min(amount, moneyCount))
        if amount > moneyCount then
            local newBalance = bankCount - math.max(amount - moneyCount, 0)
            self:setBankBalance(newBalance)
            if moneyCount == 0 then
                self:sendTextMessage(MESSAGE_INFO_DESCR, ("Você pagou %d gps da sua conta bancária. Seu saldo foi de %d para %d gps."):format(amount, bankCount, newBalance))
            else
                self:sendTextMessage(MESSAGE_INFO_DESCR, ("You paid %d from inventory and %d gold from bank account. Your account balance went from %d to %d gps."):format(moneyCount, amount - moneyCount, bankCount, newBalance))
            end
        end
        return true
    end

     

     

    eu tenho esse outro npc aqui e funciona normalmente das duas maneiras, quiser usar como base

     

    Citar

    local keywordHandler = KeywordHandler:new()
    local npcHandler = NpcHandler:new(keywordHandler)
    NpcSystem.parseParameters(npcHandler)
     
            
            
    -- OTServ event handling functions start
    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
    -- OTServ event handling functions end
       


    -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
    local travelNode = keywordHandler:addKeyword({'fort'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja ir para Fort em troca de 300 gps?'})
        travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 300, destination = {x=768, y=1088, z=6} })
        travelNode:addChildKeyword({'sim'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 300, destination = {x=768, y=1088, z=6} })
        


        -- Makes sure the npc reacts when you say hi, bye etc.
    npcHandler:addModule(FocusModule:new())

     

  2. .Qual servidor ou website você utiliza como base? 

    tfs 1.2 10.98

     

    Qual o motivo deste tópico? 

     

    bom dia rapaze! eu tenho esse script feito pelo vodkart, funciona perfeitamente! só queria fazer uma modificação eu mudei versão do meu otserv! 

    e ai no caso ele não esta removendo o dinheiro do banco, exemplo se o player tem dinheiro na bag, ele viaja normalmente mais se ele não tiver dinheiro na bag e tiver dinheiro no banco ele não viaja

    ai queria fazer essa modificação.

     

    Está surgindo algum erro? Se sim coloque-o aqui. 

    Citar

     

     

    Você tem o código disponível? Se tiver publique-o aqui: 

    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)
        function lowerTable(tabela) -- by vodkart
            local tab = {}
            for var, ret in next, tabela do
                tab[var:lower()] = ret
            end
            return tab
        end
        if not npcHandler:isFocused(cid) then
            return false
        end
        local talkUser,msg = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid, msg:lower()
        local viagens = {
                    ['Dark City'] = {premium = false, level = 0, cost = 200, destination = {x=766, y=1090, z=6}},
    
        }
        local magician_pos = {x=1249, y=783, z=6}
        local travel = lowerTable(viagens)
        if travel[msg] then
            local var = travel[msg]
            if var.level > 0 and getPlayerLevel(cid) < var.level then
                npcHandler:say("Sorry but you must be level ".. var.level .." to travel to this place.", cid) return true
            elseif var.premium and not isPremium(cid) then
                npcHandler:say("Sorry, to go to "..msg.." it is necessary to be VIP.", cid) return true     
            elseif not doPlayerRemoveMoney(cid, var.cost) then   
                npcHandler:say("Sorry, you don't have enough GPS. Is required ".. var.cost .."gps to go to "..msg..".", cid) return true
            end
            if var.chance ~= nil and var.chance > 0 then
                if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 10219 then
                    mychance = 100
                else
                    mychance = var.chance
                end
            end
            npcHandler:say("Bon voyage!", cid)           
            npcHandler:releaseFocus(cid)
            if var.chance ~= nil and var.chance > 0 then
                if mychance > math.random(1, 100) then
                    doTeleportThing(cid, garath_pos)
                    npcHandler:say("The boat lost its way and stopped in Magician, Careful!", cid)
                else
                    doTeleportThing(cid, var.destination)
                end
            else
                doTeleportThing(cid, var.destination)
            end     
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
        else
            selfSay("I don't sail to this city...", cid)
        end
        return true
    end
    npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
    npcHandler:addModule(FocusModule:new())

     

    Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

     

  3. On 5/27/2023 at 11:20 PM, Ruyzin Pikatxufly said:
    
    local keywordHandler = KeywordHandler:new()
    local npcHandler = NpcHandler:new(keywordHandler)
    NpcSystem.parseParameters(npcHandler)
    local talkState = {}
    local itemId = 2160
    
    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 onCreatureSayCallback(cid, type, msg)
        if not npcHandler:isFocused(cid) then
            return false
        end
    
        local player = Player(cid) -- Obter o objeto Player
    
        if msgcontains(msg, "serial") then
            npcHandler:say("Eu coloco um identificador em seu item. Cobro pelo serviço um valor de 1 crystal coin. Deseja colocar em algum item?", cid)
            talkState[cid] = 0
        elseif talkState[cid] == 0 and msgcontains(msg, 'yes') then
            npcHandler:say("Qual item você está interessado em colocar o serial? Lembrando que isso não garante que o item pertence a você para sempre, se você perder o item a responsabilidade será sua e não da Equipe.", cid)
            talkState[cid] = 1
        elseif talkState[cid] == 1 then
            local item = player:getItemById(itemId, true) -- Procurar pelo item no inventário do jogador
            if item and item:isItem() then
                if player:removeItem(2160, 1) then -- Remover 1 Crystal Coin do jogador
                    local description = "Este item foi registrado pelo jogador " .. player:getName() .. " no dia " .. os.date("%d/%m/%Y - %X") .. " Serial: " .. player:getGuid() .. "."
                    local itemText = item:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
                    if itemText and itemText ~= "" then
                        itemText = itemText .. "\n" .. description
                    else
                        itemText = description
                    end
                    item:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, itemText)
                    npcHandler:say("Aqui está o seu item. Deseja registrar outro?", cid)
                else
                    npcHandler:say("Você não tem a quantidade necessária para registrar esse item.", cid)
                end
            else
                npcHandler:say("Você não possui este item.", cid)
            end
            talkState[cid] = 0
        else
            npcHandler:say("Pena que você não quer. Volte aqui quando estiver interessado.", cid)
        end
    
        return true
    end
    
    npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, onCreatureSayCallback)
    npcHandler:addModule(FocusModule:new())

    e Assim?

    Bom dia não deu certo o item continua sem o registro 

     

    09:58 You see a rainbow shield (Def:30).
    It can only be wielded properly by knights of level 100 or higher.

     

    eu uso tfs 1.4 será que precisa de algum script de look ? 

  4. 6 hours ago, Mask Ghoul said:

     

    
    local keywordHandler = KeywordHandler:new()
    local npcHandler = NpcHandler:new(keywordHandler)
    NpcSystem.parseParameters(npcHandler)
    local talkState = {}
    local itemId = 2160
    
    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 onCreatureSayCallback(cid, type, msg)
        if not npcHandler:isFocused(cid) then
            return false
        end
    
        local player = Player(cid) -- Obter o objeto Player
    
        if msgcontains(msg, "serial") then
            selfSay("Eu coloco um identificador em seu item. Cobro pelo serviço um valor de 1 crystal coin. Deseja colocar em algum item?", cid)
            talkState[cid] = 0
        elseif talkState[cid] == 0 and msgcontains(msg, 'yes') then
            selfSay("Qual item você está interessado em colocar o serial? Lembrando que isso não garante que o item pertence a você para sempre, se você perder o item a responsabilidade será sua e não da Equipe.", cid)
            talkState[cid] = 1
        elseif talkState[cid] == 1 then
            local item = player:getItemById(itemId, true) -- Procurar pelo item no inventário do jogador
            if item and item:isItem() then
                if player:removeItem(2160, 1) then -- Remover 1 Crystal Coin do jogador
                    local description = "Este item foi registrado pelo jogador " .. player:getName() .. " no dia " .. os.date("%d/%m/%Y - %X") .. " Serial: " .. player:getGuid() .. "."
                    local itemText = item:getAttribute(TEXT_DESCRIPTION)
                    if itemText and itemText ~= "" then
                        itemText = itemText .. "\n" .. description
                    else
                        itemText = description
                    end
                    item:setAttribute(TEXT_DESCRIPTION, itemText)
                    selfSay("Aqui está o seu item. Deseja registrar outro?", cid)
                else
                    selfSay("Você não tem a quantidade necessária para registrar esse item.", cid)
                end
            else
                selfSay("Você não possui este item.", cid)
            end
            talkState[cid] = 0
        else
            selfSay("Pena que você não quer. Volte aqui quando estiver interessado.", cid)
        end
    
        return true
    end
    
    npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, onCreatureSayCallback)
    npcHandler:addModule(FocusModule:new())

    pode teste dnv

    06:30 Sempre [13]: yes
    06:30 Claudio: Qual item você está interessado em colocar o serial? Lembrando que isso não garante que o item pertence a você para sempre, se você perder o item a responsabilidade será sua e não da Equipe.
    06:31 Sempre [13]: demon legs
    06:31 Claudio: Aqui está o seu item. Deseja registrar outro?
    06:31 Sempre [13]: nao
    06:31 Claudio: Pena que você não quer. Volte aqui quando estiver interessado.
    06:31 Sempre [13]: bye
    06:31 Sempre [13]: hi
    06:31 Claudio: Até mais, Sempre!
    06:31 Claudio: Olá Sempre. Eu vendo aneis mágicos e frascos. Fale oferta caso estiver interessado.
    06:31 Sempre [13]: trade
    06:31 Claudio: Aqui esta minha oferta, Sempre
    06:31 Sempre [13]: serial
    06:31 Claudio: Eu coloco um identificador em seu item. Cobro pelo serviço um valor de 1 crystal coin. Deseja colocar em algum item?
    06:31 Sempre [13]: yes
    06:31 Claudio: Qual item você está interessado em colocar o serial? Lembrando que isso não garante que o item pertence a você para sempre, se você perder o item a responsabilidade será sua e não da Equipe.
    06:31 Sempre [13]: demon helmet
    06:31 Claudio: Aqui está o seu item. Deseja registrar outro?

     

     

    Bom dia!, fiz o teste de novo com esse mudança do script e mesmo assim não aparece no item... eu fiz outra demon legs, ou demon helmet ou até mesmo os item que estão equipado não apareceu

    obs: não da erro no console ta bom

    ótimo dia

  5. 21 minutes ago, Mask Ghoul said:

     

    
    
    local keywordHandler = KeywordHandler:new()
    local npcHandler = NpcHandler:new(keywordHandler)
    NpcSystem.parseParameters(npcHandler)
    local talkState = {}
    local itemId = 2160
    
    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 onCreatureSayCallback(cid, type, msg)
        if not npcHandler:isFocused(cid) then
            return false
        end
    
        local player = Player(cid) -- Obter o objeto Player
    
        if msgcontains(msg, "serial") then
            selfSay("Eu coloco um identificador em seu item. Cobro pelo serviço um valor de 1 crystal coin. Deseja colocar em algum item?", cid)
            talkState[cid] = 0
        elseif talkState[cid] == 0 and msgcontains(msg, 'yes') then
            selfSay("Qual item você está interessado em colocar o serial? Lembrando que isso não garante que o item pertence a você para sempre, se você perder o item a responsabilidade será sua e não da Equipe.", cid)
            talkState[cid] = 1
        elseif talkState[cid] == 1 then
            local item = player:getItemById(itemId, true) -- Procurar pelo item no inventário do jogador
            if item and item:isItem() then
                if player:removeItem(2160, 1) then -- Remover 1 Crystal Coin do jogador
                    item:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Este item foi registrado pelo jogador " .. player:getName() .. " no dia " .. os.date("%d/%m/%Y - %X") .. " Serial: " .. player:getGuid() .. ".")
                    selfSay("Aqui está o seu item. Deseja registrar outro?", cid)
                else
                    selfSay("Você não tem a quantidade necessária para registrar esse item.", cid)
                end
            else
                selfSay("Você não possui este item.", cid)
            end
            talkState[cid] = 0
        else
            selfSay("Pena que você não quer. Volte aqui quando estiver interessado.", cid)
        end
    
        return true
    end
    
    npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, onCreatureSayCallback)
    npcHandler:addModule(FocusModule:new())

     

    Boa noite Amigao! acabei de testar aqui bom vamos lá ele remove a crystal coin do intem porem no item ele não aparece a descrição 

    23:32 Claudio: Olá Sempre. Eu vendo aneis mágicos e frascos. Fale oferta caso estiver interessado.
    23:32 Sempre [13]: serial
    23:32 Claudio: Eu coloco um identificador em seu item. Cobro pelo serviço um valor de 1 crystal coin. Deseja colocar em algum item?
    23:32 Sempre [13]: yes
    23:32 Claudio: Qual item você está interessado em colocar o serial? Lembrando que isso não garante que o item pertence a você para sempre, se você perder o item a responsabilidade será sua e não da Equipe.
    23:32 Sempre [13]: demon helmet
    23:32 Claudio: Aqui está o seu item. Deseja registrar outro?

     

    23:38 You see a demon helmet (Arm:10).
    Imbuements: (Empty Slot, Empty Slot).
    It weighs 29.50 oz.
    You hear an evil whispering from inside.

     

    23:39 You see demon legs (Arm:9).
    It weighs 70.00 oz.

  6. .Qual servidor ou website você utiliza como base? 

    TFS 1.4

    Qual o motivo deste tópico? 

    Bom estou tentando fazer um npc que coloca um serial no item usando essa função

     

    Este item foi registrado pelo jogador ".. player:getName() ..". no dia " .. os.date("%d/%m/%Y - %X") .." Serial: ".. player:getGuid() ..".")

     

    precisava de uma força to perdido comecei a tentar a fazer mais é dificil demais, queria que alguem pudesse me ajuda ai conseguiria fazer outros npc obrigado

     

    coloquei as falas do npc pra auxiliar 

    Está surgindo algum erro? Se sim coloque-o aqui. 

    Quote

     

     

    Você tem o código disponível? Se tiver publique-o aqui: 

    local keywordHandler = KeywordHandler:new()
    local npcHandler = NpcHandler:new(keywordHandler)
    NpcSystem.parseParameters(npcHandler)
    local talkState = {}
    local itemId = 2160


    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 onCreatureSayCallback(cid, type, msg)
        if(not npcHandler:isFocused(cid)) then
            return false
        end

        if msgcontains(msg, "serial") then
            selfSay("Eu coloco um identificador em seu item. Cobro pelo serviço um valor de 1 crystal coin. Deseja colocar em algum item?", cid)
            talkState[cid] = 0
        elseif msgcontains(msg, 'yes') then
                    selfSay("Qual item você está interessado em colocar o serial? Lembrando que isso não garante que o item pertence a você para sempre, se você perder o item a responsabilidade será sua e não da Equipe.", cid)
                    talkState[cid] = 1
                    selfSay("O item com o nome super botas não exite. Diga-me outro item que você tenha.", cid)
                end
            else
                selfSay("Você não tem a quantidade necessária para registrar este item.", cid)
            end
        end
        return true
    end


    npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, onCreatureSayCallback)
    npcHandler:addModule(FocusModule:new())


    serial
    \/
    Eu coloco um identificador em seu item. Cobro pelo serviço um valor de 1 crystal coin. Deseja colocar em algum item?
    yes ou sim 

    Qual item você está interessado em colocar o serial? Lembrando que isso não garante que o item pertence a você para sempre, se você perder o item a responsabilidade será sua e não da Equipe.
    \/
    'O item com o nome botas super não exite. Diga-me outro item que você tenha.' caso você fale o nome do equipamento certo exemplo;
    demon helmet e se o player tiver crystal coin 'Aqui está o seu item. Deseja registrar outro?' agora se ele não tiver a crystal coin ele retona a msg 'Você não tem a quantidade necessária para registrar esse item'
    agora se ele não tiver o item o npc retorna 'Você não possui este item' 
    caso ele tiver a crystal coin e o item ele retorna a msg 
    'Aqui está o seu item. Deseja registrar outro?' caso ele fale não
    Pena que você não quer. Volte aqui quando estiver interessado.
    quando ele registrar o item o look do item tem que aparecer assim 'Este item foi registrado pelo jogador ".. player:getName() ..". no dia " .. os.date("%d/%m/%Y - %X") .." Serial: ".. player:getGuid() ..".")' não sei se esta certo essa função.

     

    Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

     

  7. 15 hours ago, Underewar said:

    Bom pelo que vi na lib player.lua existe uma função

      function Player.addSkill(self, skillId, value, round)

    Eu apenas removi a linha 67 e 69 e modifiquei a linha 70.
    Ficando assim :
     

      Reveal hidden contents
    
    
    SKILL_CLUB = "skill_club"
    SKILL_DISTANCE = "skill_dist"
    SKILL_SHIELD = "skill_shielding"
    SKILL_MAGLEVEL = "maglevel"
    SKILL_SWORD = "skill_sword"
    SKILL_AXE = "skill_axe"
    local buyComprar = TalkAction("!comprar")
    local storage = 45611
    local coinID = 9971 -- moeda para comprar skills
    
    
    
    
    local skills = {
        ["magiclevel"] = {vocations = {1, 5, 2, 6, 11, 12}, voc_msg= "Somente Sorcerers, Druids e Infernalists podem comprar magic level.", lim = 200, lim_msg = "Você não pode ter magic level acima de 200.", price= 3, incre = 1, skill = 7},
        ["skillclub"] = {vocations = {9, 10}, voc_msg= "Somente Drunous podem comprar skill de club.", lim = 350, lim_msg = "Você não pode ter skill club acima de 350.", price= 1, incre = 1, skill = 1},
        ["skillsword"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de sword.", lim = 350, lim_msg = "Você não pode ter skill sword acima de 350.", price= 1, incre = 1, skill = 2},
        ["skillaxe"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de axe.", lim = 350,lim_msg = "Você não pode ter skill axe acima de 350.", price= 1, incre = 1, skill = 3},
        ["skilldistance"] = {vocations = {3, 7}, voc_msg= "Somente Paladins podem comprar skill de distance.", lim = 350,lim_msg = "Você não pode ter skill distance acima de 350.", price= 1, incre = 1, skill = 4},
        ["skillshielding"] = {vocations = {3, 7, 4, 8, 9, 10}, voc_msg= "Somente Paladins, Knights e Drunous podem comprar skill de shield.", lim = 350, lim_msg = "Você não pode ter skill shielding acima de 350.", price= 1, incre = 1, skill = 5},
        ["magiclevel5"] = {vocations = {1, 5, 2, 6, 11, 12}, voc_msg= "Somente Sorcerers, Druids e Infernalists podem comprar magic level.", lim = 200, lim_msg = "Você não pode pode ter magic level acima de 200.", price= 15, incre = 5, skill = 7},
        ["skillclub10"] = {vocations = {9, 10}, voc_msg= "Somente Drunous podem comprar skill de club.", lim = 350, lim_msg = "Você não pode ter skill club acima de 350.", price= 10, incre = 10, skill = 1},
        ["skillsword10"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de sword.", lim = 350, lim_msg = "Você não pode ter skill sword acima de 350.", price= 10, incre = 10, skill = 2},
        ["skillaxe10"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de axe.", lim = 350,lim_msg = "Você não pode ter skill axe acima de 350.", price= 10, incre = 10, skill = 3},
        ["skilldistance10"] = {vocations = {3, 7}, voc_msg= "Somente Paladins podem comprar skill de distance.", lim = 350,lim_msg = "Você não pode ter skill distance acima de 350.", price= 10, incre = 10, skill = 4},
        ["skillshielding10"] = {vocations = {3, 7, 4, 8, 9, 10}, voc_msg= "Somente Paladins, Knights e Drunous podem comprar skill de shield.", lim = 350, lim_msg = "Você não pode ter skill shielding acima de 350.", price= 10, incre = 10, skill = 5},
    }
    
    
    
    function buyComprar.onSay(player, words, param)
        local player = Player(player)
        local pid = player:getGuid()
        local tile = player:getTile()
        local param = param:lower()
        if not tile:hasFlag(TILESTATE_PROTECTIONZONE) then
            player:sendCancelMessage("Você precisa estar em área protegida para utilizar este comando.")
            return true
        end
        if player:getStorageValue(storage) >= os.time() then
            player:sendCancelMessage("Por medidas de segurança você só pode utilizar este comando em " .. player:getStorageValue(storage)-os.time() .. " segundos.")
            return true
        end
        if param == "" then
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Para comprar digite !comprar (nome do item)\nOpcoes:\nsd = 4000 em SD por 50 barras.\nuh = 6000 em UH por 40 barras.\nexplo = 6000 em explosion por 10 barras.\nvip10 = 10 dias de vip por 5 barras.\nvip30 = 30 dias de vip por 10 barras.\ndivine staff = divine staff por 30 barras.\ndivine axe = divine axe por 30 barras.\nlivro nivel 6 = livro nivel 6 por 60 barras.\ndivine club = divine club por 30 barras.\ndivine sword = divine sword por 30 barras.\ndivine crossbow = divine crossbow por 30 barras.\nlivro nivel 5 = livro nivel 5 por 30 barras.\nsuper divine axe = super divine axe por 60 barras.\nsuper divine club = super divine club por 60 barras.\nsuper divine sword = super divine sword por 60 barras.\nsuper divine staff = super divine staff por 60 barras.\nsuper divine crossbow = super divine crossbow por 60 barras.\nskillclub = adiciona 1 skill club por 1 barras.\nskillsword = adiciona 1 skill sword por 1 barras.\nskillaxe = adiciona 1 skill axe por 1 barras.\nskilldistance = adiciona 1 skill distance por 1 barras.\nskillshielding = adiciona 1 skill shielding por 1 barras.\nmagiclevel = adiciona 1 magic level por 3 barras.\nmagiclevel5 = adiciona 5 magic level por 15 barras.\nskillclub10 = adiciona 10 skills club por 10 barras.\nskillsword10 = adiciona 10 skills sword por 10 barras.\nskillaxe10 = adiciona 10 skills axe por 10 barras.\nskilldistance10 = adiciona 10 skill distance por 10 barras.\nskillshielding10 = adiciona 10 skill shielding por 10 barras.\nmontaria shadow draptor = montaria shadow draptor por 30 barras.\nmontaria golden lion = montaria golden lion por 30 barras.\nmontaria winter king = montaria winter king por 30 barras.\nmontaria flying divan = montaria flying divan por 30 barras.\nmontaria woodland prince = montaria woodland prince por 30 barras.\nmontaria black stag = montaria black stag por 30 barras.\nmontaria nether steed = montaria nether steed por 30 barras.\nmontaria snow pelt = montaria snow pelt por 30 barras.\nmontaria slagsnare = montaria slagsnare por 30 barras.\nmontaria sea devil = montaria sea devil por 55 barras.\nmontaria highland yak = montaria highland yak por 75 barras.\nmontaria copper fly = montaria copper fly por 60 barras.\nmontaria bloodcurl = montaria bloodcurl por 70 barras.\nmontaria poisonbane = montaria poisonbane por 65 barras.\nmontaria razorcreep = montaria razorcreep por 75 barras.\nmontaria noctungra = montaria noctungra por 70 barras.\nmontaria leafscuttler = montaria leafscuttler por 75 barras.\nmontaria jade pincer = montaria jade pincer por 60 barras.\nmontaria frostflare = montaria frostflare por 85 barras.\nroupa conjurer = roupa conjurer todos addons por 30 barras\nroupa ceremonial garb = roupa ceremonial garb todos addons por 30 barras.\nroupa puppeteer = roupa puppeteer todos addons por 30 barras.\nroupa death herald = roupa death herald todos addons por 30 barras.\nroupa winter warden = roupa winter warden todos addons por 30 barras.\nremoverfrag = remove todos frags por 100k.\nO Item desejado não existe em nosso stock. Veja a cima os detalhes dos items disponível.")
            return true
        end
     
        if skills[param] then
            local v = skills[param]
            if param == "magiclevel" and player:getBaseMagicLevel() >= v.lim or (player:getBaseMagicLevel() + v.incre ) >= v.lim then
                player:sendCancelMessage(v.lim_msg) return true
            elseif player:getSkillLevel(v.skill) + v.incre >= v.lim then
                player:sendCancelMessage(v.lim_msg) return true        
            end
            if not isInArray(v.vocations, player:getVocation():getId()) then
                player:sendCancelMessage(v.voc_msg)
                return true
            end
            if player:getItemCount(coinID) >= v.price then
                player:removeItem(coinID, v.price)
                player:setStorageValue(storage, os.time()+1)
                local skillId = v.skill
                local amount = v.incre
                for i = 1, amount do
                    local curSkill = player:getSkillLevel(skillId)
                    local curTries = player:getSkillTries(skillId)
                    local voc = player:getVocation()
                    local nextTries = voc:getRequiredSkillTries(skillId, curSkill + 1)
                    player:addSkill(skillId, curSkill + 1)
                end
            else
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Você não possui a quantidade necessária para comprar.")
            end
            return true
        end
        return true
    end
    buyComprar:separator(" ")
    buyComprar:register()

     

     

    Testa e me fala se funcionou!

    Bom dia Undewar, desculpa pela demora to coma esposa no hospital, bom fiz o teste ele retornou esse erro no distro.

    ele remove o item id 9971 e logo em seguida retorna essa msg no distro

     

    image.thumb.png.4892a1e906695e9d2ec34879055ff016.png

  8. 34 minutes ago, Underewar said:

    Entendi o seu pensamento mais ele está errado aquele comando do código

    
    addskill playername,quantidade

     ele usa uma tabela qual a essa para atualizar no banco de dados com os dados inseridos.

    No seu caso para limitar mude manualmente em cada scripts o limite de skill.

    lim = 350

     então mais o Otserv em si ele já como padrão definido um limite não sei se é na src aonde que é, que o limite é travado ex; 156 para magic level e para skills 202 ou 208, se você olhar os valores de limite no script esta 350... 

     

    vou dar um exemplo quando você ta jogando um otserv 9999999 chega um limite de level 717172 você não consegue mais passar esse level por que no level maximo, eu tenho esse script aqui é da versão 8.6 que a função é diferente veja

     

    if(param == "skillsword") then
    if getPlayerSkillLevel(cid, SKILL_SWORD) >= 350 then
    doPlayerSendTextMessage(cid, 6, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isKnight(cid) then
    doPlayerSendTextMessage(cid, 6, "Somente Knights podem comprar skill de sword.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 1 then
    local pid = getPlayerGUID(cid)
    local sword = getPlayerSkillLevel(cid, SKILL_SWORD) 
    doPlayerRemoveItem(cid, 9971, 1)
    doRemoveCreature(cid)
    db.query("UPDATE `player_skills` SET `value` = " .. (sword + 1) .. ", `count` = 0 WHERE `skillid` = 2 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, 6, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end

     

    a função é por db não sei é assim que fala e funciona perfeitamente db.query("UPDATE `player_skills` SET `value` = " .. (sword + 1) .. ", `count` = 0 WHERE `skillid` = 2 and `player_id` = " .. pid .. ";")

     

    agora se você olha esse script em si ele usa  

    player:addSkillTries(skillId, nextTries - curTries + curTries / nextTries * voc:getRequiredSkillTries(skillId, curSkill + 2))

    é como se você tivesse pegado o skill na raça treinando

     

     

     

    image.png

  9. .Qual servidor ou website você utiliza como base? 

     

    TFS 1.4 

     

    Qual o motivo deste tópico? 

     

    O script funciona porem precisaria fazer alguns ajustes e correção o Script foi feito pelo Vodkart, precisaria ajustar algumas coisas.

     

    Bom o script você consegue utilizar o comando adiciona skill para o Player, porem o limite de compra é 350. só que usando o comando só vai até 208 ou é 202 para skill fist, club, distance, axe, e sword.

    já o magic level, o maximo que vai é 156 mais pelo comando teria que chegar até 200. o script  talvez teria que colocar por db não sei ao certo mais o script funciona porem tem esses problema

     

    db.query("UPDATE " .. db_table .. " SET " .. db_set_column .. " = " .. (db_skill_value + db_skill_value_sum) .. " WHERE id = " .. player:getGuid() .. ";")
     

     

    Está surgindo algum erro? Se sim coloque-o aqui. 

    Quote

     

     

    Você tem o código disponível? Se tiver publique-o aqui: 

    SKILL_CLUB = "skill_club"
    SKILL_DISTANCE = "skill_dist"
    SKILL_SHIELD = "skill_shielding"
    SKILL_MAGLEVEL = "maglevel"
    SKILL_SWORD = "skill_sword"
    SKILL_AXE = "skill_axe"
    local buyComprar = TalkAction("!comprar")
    local storage = 45611
    local coinID = 9971 -- moeda para comprar skills
    
    
    
    
    local skills = {
        ["magiclevel"] = {vocations = {1, 5, 2, 6, 11, 12}, voc_msg= "Somente Sorcerers, Druids e Infernalists podem comprar magic level.", lim = 200, lim_msg = "Você não pode ter magic level acima de 200.", price= 3, incre = 1, skill = 7},
        ["skillclub"] = {vocations = {9, 10}, voc_msg= "Somente Drunous podem comprar skill de club.", lim = 350, lim_msg = "Você não pode ter skill club acima de 350.", price= 1, incre = 1, skill = 1},
        ["skillsword"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de sword.", lim = 350, lim_msg = "Você não pode ter skill sword acima de 350.", price= 1, incre = 1, skill = 2},
        ["skillaxe"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de axe.", lim = 350,lim_msg = "Você não pode ter skill axe acima de 350.", price= 1, incre = 1, skill = 3},
        ["skilldistance"] = {vocations = {3, 7}, voc_msg= "Somente Paladins podem comprar skill de distance.", lim = 350,lim_msg = "Você não pode ter skill distance acima de 350.", price= 1, incre = 1, skill = 4},
        ["skillshielding"] = {vocations = {3, 7, 4, 8, 9, 10}, voc_msg= "Somente Paladins, Knights e Drunous podem comprar skill de shield.", lim = 350, lim_msg = "Você não pode ter skill shielding acima de 350.", price= 1, incre = 1, skill = 5},
        ["magiclevel5"] = {vocations = {1, 5, 2, 6, 11, 12}, voc_msg= "Somente Sorcerers, Druids e Infernalists podem comprar magic level.", lim = 200, lim_msg = "Você não pode pode ter magic level acima de 200.", price= 15, incre = 5, skill = 7},
        ["skillclub10"] = {vocations = {9, 10}, voc_msg= "Somente Drunous podem comprar skill de club.", lim = 350, lim_msg = "Você não pode ter skill club acima de 350.", price= 10, incre = 10, skill = 1},
        ["skillsword10"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de sword.", lim = 350, lim_msg = "Você não pode ter skill sword acima de 350.", price= 10, incre = 10, skill = 2},
        ["skillaxe10"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de axe.", lim = 350,lim_msg = "Você não pode ter skill axe acima de 350.", price= 10, incre = 10, skill = 3},
        ["skilldistance10"] = {vocations = {3, 7}, voc_msg= "Somente Paladins podem comprar skill de distance.", lim = 350,lim_msg = "Você não pode ter skill distance acima de 350.", price= 10, incre = 10, skill = 4},
        ["skillshielding10"] = {vocations = {3, 7, 4, 8, 9, 10}, voc_msg= "Somente Paladins, Knights e Drunous podem comprar skill de shield.", lim = 350, lim_msg = "Você não pode ter skill shielding acima de 350.", price= 10, incre = 10, skill = 5},
    }
    
    
    
    function buyComprar.onSay(player, words, param)
        local player = Player(player)
        local pid = player:getGuid()
        local tile = player:getTile()
        local param = param:lower()
        if not tile:hasFlag(TILESTATE_PROTECTIONZONE) then
            player:sendCancelMessage("Você precisa estar em área protegida para utilizar este comando.")
            return true
        end
        if player:getStorageValue(storage) >= os.time() then
            player:sendCancelMessage("Por medidas de segurança você só pode utilizar este comando em " .. player:getStorageValue(storage)-os.time() .. " segundos.")
            return true
        end
        if param == "" then
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Para comprar digite !comprar (nome do item)\nOpcoes:\nsd = 4000 em SD por 50 barras.\nuh = 6000 em UH por 40 barras.\nexplo = 6000 em explosion por 10 barras.\nvip10 = 10 dias de vip por 5 barras.\nvip30 = 30 dias de vip por 10 barras.\ndivine staff = divine staff por 30 barras.\ndivine axe = divine axe por 30 barras.\nlivro nivel 6 = livro nivel 6 por 60 barras.\ndivine club = divine club por 30 barras.\ndivine sword = divine sword por 30 barras.\ndivine crossbow = divine crossbow por 30 barras.\nlivro nivel 5 = livro nivel 5 por 30 barras.\nsuper divine axe = super divine axe por 60 barras.\nsuper divine club = super divine club por 60 barras.\nsuper divine sword = super divine sword por 60 barras.\nsuper divine staff = super divine staff por 60 barras.\nsuper divine crossbow = super divine crossbow por 60 barras.\nskillclub = adiciona 1 skill club por 1 barras.\nskillsword = adiciona 1 skill sword por 1 barras.\nskillaxe = adiciona 1 skill axe por 1 barras.\nskilldistance = adiciona 1 skill distance por 1 barras.\nskillshielding = adiciona 1 skill shielding por 1 barras.\nmagiclevel = adiciona 1 magic level por 3 barras.\nmagiclevel5 = adiciona 5 magic level por 15 barras.\nskillclub10 = adiciona 10 skills club por 10 barras.\nskillsword10 = adiciona 10 skills sword por 10 barras.\nskillaxe10 = adiciona 10 skills axe por 10 barras.\nskilldistance10 = adiciona 10 skill distance por 10 barras.\nskillshielding10 = adiciona 10 skill shielding por 10 barras.\nmontaria shadow draptor = montaria shadow draptor por 30 barras.\nmontaria golden lion = montaria golden lion por 30 barras.\nmontaria winter king = montaria winter king por 30 barras.\nmontaria flying divan = montaria flying divan por 30 barras.\nmontaria woodland prince = montaria woodland prince por 30 barras.\nmontaria black stag = montaria black stag por 30 barras.\nmontaria nether steed = montaria nether steed por 30 barras.\nmontaria snow pelt = montaria snow pelt por 30 barras.\nmontaria slagsnare = montaria slagsnare por 30 barras.\nmontaria sea devil = montaria sea devil por 55 barras.\nmontaria highland yak = montaria highland yak por 75 barras.\nmontaria copper fly = montaria copper fly por 60 barras.\nmontaria bloodcurl = montaria bloodcurl por 70 barras.\nmontaria poisonbane = montaria poisonbane por 65 barras.\nmontaria razorcreep = montaria razorcreep por 75 barras.\nmontaria noctungra = montaria noctungra por 70 barras.\nmontaria leafscuttler = montaria leafscuttler por 75 barras.\nmontaria jade pincer = montaria jade pincer por 60 barras.\nmontaria frostflare = montaria frostflare por 85 barras.\nroupa conjurer = roupa conjurer todos addons por 30 barras\nroupa ceremonial garb = roupa ceremonial garb todos addons por 30 barras.\nroupa puppeteer = roupa puppeteer todos addons por 30 barras.\nroupa death herald = roupa death herald todos addons por 30 barras.\nroupa winter warden = roupa winter warden todos addons por 30 barras.\nremoverfrag = remove todos frags por 100k.\nO Item desejado não existe em nosso stock. Veja a cima os detalhes dos items disponível.")
            return true
        end
     
        if skills[param] then
            local v = skills[param]
            if param == "magiclevel" and player:getBaseMagicLevel() >= v.lim or (player:getBaseMagicLevel() + v.incre ) >= v.lim then
                player:sendCancelMessage(v.lim_msg) return true
            elseif player:getSkillLevel(v.skill) + v.incre >= v.lim then
                player:sendCancelMessage(v.lim_msg) return true        
            end
            if not isInArray(v.vocations, player:getVocation():getId()) then
                player:sendCancelMessage(v.voc_msg)
                return true
            end
            if player:getItemCount(coinID) >= v.price then
                player:removeItem(coinID, v.price)
                player:setStorageValue(storage, os.time()+1)
                local skillId = v.skill
                local amount = v.incre
                for i = 1, amount do
                    local curSkill = player:getSkillLevel(skillId)
                    local curTries = player:getSkillTries(skillId)
                    local voc = player:getVocation()
                    local nextTries = voc:getRequiredSkillTries(skillId, curSkill + 1)
                    player:addSkillTries(skillId, nextTries - curTries + curTries / nextTries * voc:getRequiredSkillTries(skillId, curSkill + 2))
                end
            else
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Você não possui a quantidade necessária para comprar.")
            end
            return true
        end
        return true
    end
    buyComprar:separator(" ")
    buyComprar:register()

     

    Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

     

  10. .Qual servidor ou website você utiliza como base? 

     The Forgotten Server, version 0.4_SVN

     

    Qual o motivo deste tópico? 

     

    bom acabei de compliar essa src porem ta dando esse erro no distro bem provavel que esteja faltando alguma tabela de cast

    eu não sei qual é tabela se alguém puder me ajuda por favor.

    Está surgindo algum erro? Se sim coloque-o aqui. 

    Citar

    image.thumb.png.622df5b21c83e4031cd64367840d2c33.png

     

     

     

  11. 3 horas atrás, iTzBrHue3 disse:

    .Qual servidor ou website você utiliza como base? otx 2.8

     

    Qual o motivo deste tópico? duvida

     

    Está surgindo algum erro? Se sim coloque-o aqui. 

     

    Você tem o código disponível? Se tiver publique-o aqui: 

    
    function onUse(cid, item, fromPosition, itemEx, toPosition)
        local room = {
            ['start'] = {x=2192, y=2543, z=8},
            ['end'] = {x=2213, y=2564, z=8}
        }
    
        local boss_name = 'Gravelord'
        local boss = {x=2203, y=2549, z=8}
    
        local kick_pos = {x=2195, y=2583, z=8}
     
        local players_pos = {
        {x=2194, y=2577, z=8, stackpos = 253},
        {x=2195, y=2577, z=8, stackpos = 253},
        {x=2196, y=2577, z=8, stackpos = 253},
        {x=2197, y=2577, z=8, stackpos = 253}
        }
     
        local new_player_pos = {x=2205, y=2564, z=8}
     
        local player = {0, 0, 0, 0}
        local all_ready = 0
     
        if item.itemid == 1945 then
            for i = 1, 4 do
                player[i] = getThingfromPos(players_pos[i])
                if player[i].itemid > 0 and isPlayer(player[i].uid) then
                    all_ready = 1
                end
            end
            if all_ready == 1 then
                doCreateMonster(boss_name, {x=boss.x, y=boss.y, z=boss.z})
                for i = 1, 4 do
                    if isPlayer(player[i].uid) then
                        doSendMagicEffect(players_pos[i], 2)
                        doTeleportThing(player[i].uid, new_player_pos, false)
                        doSendMagicEffect(new_player_pos, 10)
                        addEvent(kickFromArea, (10 * 60 * 1000), player[i].uid, room['start'], room['end'], kick_pos)
                        all_ready = 0
                    end
                end
                doTransformItem(item.uid, 1946)
            end
        elseif item.itemid == 1946 then
            local player_room = 0
            for x = room['start'].x, room['end'].x do
                for y = room['start'].y, room['end'].y do
                    for z = room['start'].z, room['end'].z do
                        local pos = {x=x, y=y, z=z, stackpos=253}
                        local thing = getThingfromPos(pos)
                        if thing.itemid > 0 then
                            if isPlayer(thing.uid) == true then
                                player_room = player_room + 1
                            end
                        end
                    end
                end
            end
            if player_room >= 1 then
                doPlayerSendTextMessage(cid, 19, "There is already a player in the boss room.")       
            elseif player_room == 0 then
                for x = room['start'].x, room['end'].x do
                    for y = room['start'].y, room['end'].y do
                        for z = room['start'].z, room['end'].z do
                            local pos = {x=x, y=y, z=z, stackpos=253}
                            local thing = getThingfromPos(pos)
                            if thing.itemid > 0 then
                                doRemoveCreature(thing.uid)
                            end
                        end
                    end
                end
                player_room = 0
                doTransformItem(item.uid, 1945)
            end
        end
        return true
    end
     

     

    Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

     

    Citar

    function onUse(cid, item, fromPosition, itemEx, toPosition)
        local room = {
            storage = 676631, -- storage, só mude se tiver usando pra outra coisa.
            tempo = 20, -- tempo em minutos.
            ['start'] = {x=2192, y=2543, z=8},
            ['end'] = {x=2213, y=2564, z=8}
            
        }

        local boss_name = 'Gravelord'
        local boss = {x=2203, y=2549, z=8}

        local kick_pos = {x=2195, y=2583, z=8}
     
        local players_pos = {
        {x=2194, y=2577, z=8, stackpos = 253},
        {x=2195, y=2577, z=8, stackpos = 253},
        {x=2196, y=2577, z=8, stackpos = 253},
        {x=2197, y=2577, z=8, stackpos = 253}
        }
     
        local new_player_pos = {x=2205, y=2564, z=8}
     
        local player = {0, 0, 0, 0}
        local all_ready = 0
      
        if getPlayerStorageValue(cid, room.storage) < os.time() then
        if item.itemid == 1945 then
            for i = 1, 4 do
                player[i] = getThingfromPos(players_pos[i])
                if player[i].itemid > 0 and isPlayer(player[i].uid) then
                    all_ready = 1
                end
            end
            if all_ready == 1 then
                doCreateMonster(boss_name, {x=boss.x, y=boss.y, z=boss.z})
                for i = 1, 4 do
                    if isPlayer(player[i].uid) then
                        doSendMagicEffect(players_pos[i], 2)
                        doTeleportThing(player[i].uid, new_player_pos, false)
                        doSendMagicEffect(new_player_pos, 10)
                        addEvent(kickFromArea, (10 * 60 * 1000), player[i].uid, room['start'], room['end'], kick_pos)
                        all_ready = 0
                    end
                end
                doTransformItem(item.uid, 1946)
            end
        elseif item.itemid == 1946 then
            local player_room = 0
            for x = room['start'].x, room['end'].x do
                for y = room['start'].y, room['end'].y do
                    for z = room['start'].z, room['end'].z do
                        local pos = {x=x, y=y, z=z, stackpos=253}
                        local thing = getThingfromPos(pos)
                        if thing.itemid > 0 then
                            if isPlayer(thing.uid) == true then
                                player_room = player_room + 1
                            end
                        end
                    end
                end
            end
            if player_room >= 1 then
                doPlayerSendTextMessage(cid, 19, "There is already a player in the boss room.")       
            elseif player_room == 0 then
                for x = room['start'].x, room['end'].x do
                    for y = room['start'].y, room['end'].y do
                        for z = room['start'].z, room['end'].z do
                            local pos = {x=x, y=y, z=z, stackpos=253}
                            local thing = getThingfromPos(pos)
                            if thing.itemid > 0 then
                                doRemoveCreature(thing.uid)
                            end
                        end
                    end
                end
                player_room = 0
                doTransformItem(item.uid, 1945)
                doPlayerPopupFYI(cid, "Voce precisa aguardar ".. getPlayerStorageValue(cid, room.storage) - os.time() .." segundos.")
            end
        end
        return true
    end

     

  12. 6 minutos atrás, Sun disse:

    estes icons são skulls cara!

    você precisa achar o correto.

    Ah sim agora entendi, obrigado cara vou tentar procurar saber quais são se eu souber vou postar aqui possa ser que mais pessoas esteja procurando por isso obrigado mesmo.

     

  13. 5 minutos atrás, Sun disse:
    
    <?xml version="1.0" encoding="UTF-8"?>
    <npc name="Addoner" script="Addon.lua" walkinterval="0" floorchange="0" skull="green">
       <health now="100" max="100"/>
       <look type="540"/>
    <parameters>
    	<parameter key="module_shop" value="1" />
    	</parameters>
    </npc> 

    @Vitorelias

    cara deu certo mais no caso fico uma skull no NPC e no caso não é isso o que eu quero eu quero que apareça esse icon.

    Balao_NPC_Trade.png.33641089cd7403e8a3990e670a986e54.pngBalao_NPC_Quest.png.a0be3513421ac9569d5b632750ac48b9.pngBalao_NPC_General.png.dbd7ba9dbc0893e98b7ae45e083f3440.png

  14. Agora, Sun disse:

    colocando skull no script dele

    @Vitorelias

    como assim poderia me da essa força ai? 

     

    <?xml version="1.0" encoding="UTF-8"?>
    <npc name="Addoner" script="Addon.lua" walkinterval="0" floorchange="0">
       <health now="100" max="100"/>
       <look type="540"/>
    <parameters>
    	<parameter key="module_shop" value="1" />
    	</parameters>
    
    </npc> 

     

  15. .Qual servidor ou website você utiliza como base? 

    OTX Versão 12.00

    Qual o motivo deste tópico? 

    Boa noite não sei se estou na área correta mais gostaria de saber como que faz pra colocar essa balão nos NPC

    se for possível alguém me da uma força ai agradeço.

     

     

    image.png.6e35e0b01ff6ba0056e67be7fee5bbcb.png

     

  16. 9 horas atrás, Shiuns disse:
    
    SKILL_CLUB = "skill_club"
    SKILL_DISTANCE = "skill_dist"
    SKILL_SHIELD = "skill_shielding"
    SKILL_MAGLEVEL = "maglevel"
    SKILL_SWORD = "skill_sword"
    SKILL_AXE = "skill_axe"
    local storage = 45611
    local coinID = 9971 -- moeda para comprar skills
    
    local runas = {
    	["sd"] = {bag = 5926, item= 2268, bag_quant = 2, price= 50, msg= "Parabéns você comprou 4k de SD com sucesso."},
    	["uh"] = {bag = 2002, item= 2273, bag_quant = 3, price= 30, msg= "Parabéns você comprou 6k de UH com sucesso."},
    	["explo"] = {bag = 2001, item= 2313, bag_quant = 3, price= 10, msg= "Parabéns você comprou 6k de Explosion com sucesso."}
    }
    local itens = {
    	["super divine axe"] = {item = 8926, price= 60, msg= "Você comprou um super divine axe com sucesso."},
    	["super divine staff"] = {item = 8922, price= 60, msg= "Você comprou um super divine staff com sucesso."},
    	["super divine club"] = {item = 7423, price= 60, msg= "Você comprou um super divine club com sucesso."},
    	["super divine sword"] = {item = 7403, price= 60, msg= "Você comprou um super divine sword com sucesso."},
    	["super divine crossbow"] = {item = 8851, price= 60, msg= "Você comprou um super divine crossbow com sucesso."},
    	["livro nivel 6"] = {item = 8921, price= 60, msg= "Você comprou um livro nivel 6 com sucesso."}
    }
    local vip = {
    	["vip10"] = {days= 10, price= 5},
    	["vip30"] = {ays= 30, price= 10}
    }
    local skills = {
    	["magiclevel"] = {vocations = {1, 5, 2, 6, 11, 12}, voc_msg= "Somente Sorcerers, Druids e Infernalists podem comprar magic level.", lim = 200, lim_msg = "Você não pode ter magic level acima de 200.", price= 3, incre = 1, skill = SKILL_MAGLEVEL},
    	["skillclub"] = {vocations = {9, 10}, voc_msg= "Somente Drunous podem comprar skill de club.", lim = 350, price= 1, incre = 1, skill = SKILL_CLUB},
    	["skillsword"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de sword.", lim = 350, price= 1, incre = 1, skill = SKILL_SWORD},
    	["skillaxe"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de axe.", lim = 350, price= 1, incre = 1, skill = SKILL_AXE},
    	["skilldistance"] = {vocations = {3, 7}, voc_msg= "Somente Paladins podem comprar skill de distance.", lim = 350, price= 1, incre = 1, skill = SKILL_DISTANCE},
    	["skillshielding"] = {vocations = {3, 7, 4, 8, 9, 10}, voc_msg= "Somente Paladins, Knights e Drunous podem comprar skill de shield.", lim = 350, lim_msg = "Você não pode ter skill shielding acima de 350.", price= 1, incre = 1, skill = SKILL_SHIELD},
    }
    
    local frags = {
    	["removerfrag"] = {t= 6, price= 10}
    }
    
    function onSay(player, words, param)
    	local player = Player(player)
    	local pid = player:getGuid()
    	local tile = player:getTile()
    	local param = param:lower()	
    	if not tile:hasFlag(TILESTATE_PROTECTIONZONE) then
    		player:sendCancelMessage("Você precisa está em área protegida para utilizar este comando.")
    		return true
    	end	
    	if player:getStorageValue(storage) >= os.time() then
    		player:sendCancelMessage("Por medidas de segurança você só pode utilizar este comando em " .. player:getStorageValue(storage)-os.time() .. " segundos.")
    		return true
    	end
    	if param == "" then
    		player:popupFYI("Para comprar digite !comprar (nome do item)\nOpcoes:\nsd = 4000 em SD por 50 barras.\nuh = 6000 em UH por 40 barras.\nexplo = 6000 em explosion por 10 barras.\nvip10 = 10 dias de vip por 5 barras.\nvip30 = 30 dias de vip por 10 barras.\ndivine staff = divine staff por 30 barras.\ndivine axe = divine axe por 30 barras.\nlivro nivel 6 = livro nivel 6 por 60 barras.\ndivine club = divine club por 30 barras.\ndivine sword = divine sword por 30 barras.\ndivine crossbow = divine crossbow por 30 barras.\nlivro nivel 5 = livro nivel 5 por 30 barras.\nsuper divine axe = super divine axe por 60 barras.\nsuper divine club = super divine club por 60 barras.\nsuper divine sword = super divine sword por 60 barras.\nsuper divine staff = super divine staff por 60 barras.\nsuper divine crossbow = super divine crossbow por 60 barras.\nskillclub = adiciona 1 skill club por 1 barras.\nskillsword = adiciona 1 skill sword por 1 barras.\nskillaxe = adiciona 1 skill axe por 1 barras.\nskilldistance = adiciona 1 skill distance por 1 barras.\nskillshielding = adiciona 1 skill shielding por 1 barras.\nmagiclevel = adiciona 1 magic level por 3 barras.\nmagiclevel5 = adiciona 5 magic level por 15 barras.\nskillclub10 = adiciona 10 skills club por 10 barras.\nskillsword10 = adiciona 10 skills sword por 10 barras.\nskillaxe10 = adiciona 10 skills axe por 10 barras.\nskilldistance10 = adiciona 10 skill distance por 10 barras.\nskillshielding10 = adiciona 10 skill shielding por 10 barras.\nremoverfrag = remove todos frags por 100k.\nO Item desejado não existe em nosso stock. Veja a cima os detalhes dos items disponíveis.")
    		return true
    	end
    	if runas[param] then
    		local v = runas[param]
    		if player:getItemCount(coinID) >= v.price then
    			local item_quant = (v.bag_quant * 2000)/100
    			for x = 1, v.bag_quant do
    				local bag = player:addItem(v.bag, 1)
    				for i = 1, item_quant do
    					bag:addItem(v.item, 100)
    				end
    			end
    			player:removeItem(coinID, v.price)
    			player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, v.msg)
    			player:setStorageValue(storage, os.time()+1)
    		else
    			player:sendCancelMessage("Você não possui a quantidade necessária para comprar.")
    		end
    		return true
    	end
    	if itens[param] then
    		local v = itens[param]
    		if player:getItemCount(coinID) >= v.price then
    			item = player:addItem(v.item, 1)
    			item:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Este item pode ser adquirido através do shopping. Adquirido dia " .. os.date("%d/%m/%Y - %X") .." por ".. player:getName() ..". Serial: ".. player:getGuid() ..".")
    			player:removeItem(coinID, v.price)
    			player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, v.msg)
    			player:setStorageValue(storage, os.time()+1)
    		else
    			player:sendCancelMessage("Você não possui a quantidade necessária para comprar.")
    		end
    		return true
    	end
    	if vip[param] then
    		local v = vip[param]
    		if player:getItemCount(coinID) >= v.price then
    			player:addPremiumDays(v.days)
    			player:removeItem(coinID, v.price)
    			player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou " .. v.days .. " dias de vip com sucesso.")
    			player:setStorageValue(storage, os.time()+1)
    		else
    			player:sendCancelMessage("Você não possui a quantidade necessária para comprar.")
    		end
    		return true
    	end	
    	if skills[param] then
    		local v = skills[param]
    		if param == "magiclevel" and player:getBaseMagicLevel() >= v.lim or (player:getBaseMagicLevel() + v.incre ) >= v.lim then
    			player:sendCancelMessage(v.lim_msg) return true
    		elseif player:getSkillLevel(v.skill) >= v.lim or (player:getSkillLevel(v.skill) + v.incre ) >= v.lim then
    			player:sendCancelMessage(v.lim_msg) return true			
    		end
    		if not isInArray(v.vocations, player:getVocation():getId()) then
    			player:sendCancelMessage(v.voc_msg)
    			return true
    		end
    		if player:getItemCount(coinID) >= v.price then
    			player:removeItem(coinID, v.price)
    			player:setStorageValue(storage, os.time()+1)
    			player:remove()
    			db.query("UPDATE players SET ".. v.skill .. " = " .. v.skill .. " + " .. v.incre .. " WHERE id = ".. pid)
    		else
    			player:sendCancelMessage("Você não possui a quantidade necessária para comprar.")
    		end
    		return true
    	end
    	if frags[param] then
    		local v = frags[param]
    		if player:getItemCount(2160) >= v.price then
    			player:removeItem(2160, v.price)
    			player:setSkull(SKULL_NONE)
    			player:setSkullTime(0)
    			player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
    			player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your skull and frags has been removed!")
    			player:setStorageValue(storage, os.time()+1)
    			db.query("UPDATE player_deaths SET unjustified = 0 WHERE unjustified = 1 AND killed_by = " .. db.escapeString(player:getName()))
    		else
    			player:sendCancelMessage("Você não possui a quantidade necessária para comprar.")
    		end
    		return true
    	end
    	return true
    end

     

    Obrigado em man sem palavras deu certo! 

  17. .Qual servidor ou website você utiliza como base? 

     

    OTX 3.1

     

    Qual o motivo deste tópico? 

     

    Tenho um sistema de compra de skills porem não esta limitando o comando e o player consegue comprar skills acima do permitido.

    obs  quando usa o comando !comprar magiclevel funciona perfeito e limita os skills agora quando usa !comprar skillaxe, sword , club etc não esta limitando.

     

    Está surgindo algum erro? Se sim coloque-o aqui. 

    Citar

     

     

    Você tem o código disponível? Se tiver publique-o aqui: 

    SKILL_CLUB = "skill_club"
    SKILL_DISTANCE = "skill_dist"
    SKILL_SHIELD = "skill_shielding"
    SKILL_MAGLEVEL = "maglevel"
    SKILL_SWORD = "skill_sword"
    SKILL_AXE = "skill_axe"
    local coinID = 9971 -- moeda para comprar skills
    local tb = {
    ["sd"] = {t= 1, bag = 5926, item= 2268, bag_quant = 2, price= 50, msg= "Parabéns você comprou 4k de SD com sucesso."},
    ["uh"] = {t= 1, bag = 2002, item= 2273, bag_quant = 3, price= 30, msg= "Parabéns você comprou 6k de UH com sucesso."},
    ["explo"] = {t= 1, bag = 2001, item= 2313, bag_quant = 3, price= 10, msg= "Parabéns você comprou 6k de Explosion com sucesso."},
    ["super divine axe"] = {t= 2, item = 8926, price= 60, msg= "Você comprou um super divine axe com sucesso."},
    ["super divine staff"] = {t= 2, item = 8922, price= 60, msg= "Você comprou um super divine staff com sucesso."},
    ["super divine club"] = {t= 2, item = 7423, price= 60, msg= "Você comprou um super divine club com sucesso."},
    ["super divine sword"] = {t= 2, item = 7403, price= 60, msg= "Você comprou um super divine sword com sucesso."},
    ["super divine crossbow"] = {t= 2, item = 8851, price= 60, msg= "Você comprou um super divine crossbow com sucesso."},
    ["livro nivel 6"] = {t= 2, item = 8921, price= 60, msg= "Você comprou um livro nivel 6 com sucesso."},
    ["vip10"] = {t= 3, days= 10, price= 5},
    ["vip30"] = {t= 3, days= 30, price= 10},
    ["magiclevel"] = {t= 4, vocations = {1, 5, 2, 6, 11, 12}, voc_msg= "Somente Sorcerers, Druids e Infernalists podem comprar magic level.", lim = 200, lim_msg = "Você não pode ter magic level acima de 200.", price= 3, incre = 1, skill = SKILL_MAGLEVEL},
    ["skillclub"] = {t= 5, vocations = {9, 10}, voc_msg= "Somente Drunous podem comprar skill de club.", lim = 350, price= 1, incre = 1, skill = SKILL_CLUB},
    ["skillsword"] = {t= 5, vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de sword.", lim = 350, price= 1, incre = 1, skill = SKILL_SWORD},
    ["skillaxe"] = {t=5 , vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de axe.", lim = 350, price= 1, incre = 1, skill = SKILL_AXE},
    ["skilldistance"] = {t= 5, vocations = {3, 7}, voc_msg= "Somente Paladins podem comprar skill de distance.", lim = 350, price= 1, incre = 1, skill = SKILL_DISTANCE},
    ["skillshielding"] = {t= 5, vocations = {3, 7, 4, 8, 9, 10}, voc_msg= "Somente Paladins, Knights e Drunous podem comprar skill de shield.", lim = 350, lim_msg = "Você não pode ter skill shielding acima de 350.", price= 1, incre = 1, skill = SKILL_SHIELD},
    ["magiclevel5"] = {t= 4, vocations = {1, 5, 2, 6, 11, 12}, voc_msg= "Somente Sorcerers, Druids e Infernalists podem comprar magic level.", lim = 200, lim_msg = "Você não pode ter magic level acima de 200.", price= 15, incre = 5, skill = SKILL_MAGLEVEL},
    ["skillclub10"] = {t= 5, vocations = {9, 10}, voc_msg= "Somente Drunous podem comprar skill de club.", lim = 350, price= 10, incre = 10, skill = SKILL_CLUB},
    ["skillsword10"] = {t= 5, vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de sword.", lim = 350, price= 10, incre = 10, skill = SKILL_SWORD},
    ["skillaxe10"] = {t=5 , vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de axe.", lim = 350, price= 10, incre = 10, skill = SKILL_AXE},
    ["skilldistance10"] = {t= 5, vocations = {3, 7}, voc_msg= "Somente Paladins podem comprar skill de distance.", lim = 350, price= 10, incre = 10, skill = SKILL_DISTANCE},
    ["skillshielding10"] = {t= 5, vocations = {3, 7, 4, 8, 9, 10}, voc_msg= "Somente Paladins, Knights e Drunous podem comprar skill de shield.", lim = 341, lim_msg = "Você não pode ter skill shielding acima de 350.", price= 10, incre = 10, skill = SKILL_SHIELD},
    ["removerfrag"] = {t= 6, price= 10},
    }
    local storage = 45611
    function onSay(player, words, param)
    local player = Player(player)
    local pid = player:getGuid()
    local tile = player:getTile()
    local param = param:lower()
    if not tile:hasFlag(TILESTATE_PROTECTIONZONE) then
    player:sendCancelMessage("Você precisa está em área protegida para utilizar este comando.")
    return true
    end
    if player:getStorageValue(storage) >= os.time() then
    player:sendCancelMessage("Por medidas de segurança você só pode utilizar este comando em " .. player:getStorageValue(storage)-os.time() .. " segundos.")
    return true
    end

    if param == "" then
    player:popupFYI("Para comprar digite !comprar (nome do item)\nOpcoes:\nsd = 4000 em SD por 50 barras.\nuh = 6000 em UH por 40 barras.\nexplo = 6000 em explosion por 10 barras.\nvip10 = 10 dias de vip por 5 barras.\nvip30 = 30 dias de vip por 10 barras.\ndivine staff = divine staff por 30 barras.\ndivine axe = divine axe por 30 barras.\nlivro nivel 6 = livro nivel 6 por 60 barras.\ndivine club = divine club por 30 barras.\ndivine sword = divine sword por 30 barras.\ndivine crossbow = divine crossbow por 30 barras.\nlivro nivel 5 = livro nivel 5 por 30 barras.\nsuper divine axe = super divine axe por 60 barras.\nsuper divine club = super divine club por 60 barras.\nsuper divine sword = super divine sword por 60 barras.\nsuper divine staff = super divine staff por 60 barras.\nsuper divine crossbow = super divine crossbow por 60 barras.\nskillclub = adiciona 1 skill club por 1 barras.\nskillsword = adiciona 1 skill sword por 1 barras.\nskillaxe = adiciona 1 skill axe por 1 barras.\nskilldistance = adiciona 1 skill distance por 1 barras.\nskillshielding = adiciona 1 skill shielding por 1 barras.\nmagiclevel = adiciona 1 magic level por 3 barras.\nmagiclevel5 = adiciona 5 magic level por 15 barras.\nskillclub10 = adiciona 10 skills club por 10 barras.\nskillsword10 = adiciona 10 skills sword por 10 barras.\nskillaxe10 = adiciona 10 skills axe por 10 barras.\nskilldistance10 = adiciona 10 skill distance por 10 barras.\nskillshielding10 = adiciona 10 skill shielding por 10 barras.\nremoverfrag = remove todos frags por 100k.\nO Item desejado não existe em nosso stock. Veja a cima os detalhes dos items disponíveis.")
    return true
    end

    for f, v in pairs(tb) do
    if param == f then
    if v.t == 1 then
    if player:getItemCount(coinID) >= v.price then
    local item_quant = (v.bag_quant * 2000)/100
    for x = 1, v.bag_quant do
    local bag = player:addItem(v.bag, 1)
    for i = 1, item_quant do
    bag:addItem(v.item, 100)
    end
    end
    player:removeItem(coinID, v.price)
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, v.msg)
    player:setStorageValue(storage, os.time()+1)
    break
    else
    player:sendCancelMessage("Você não possui a quantidade necessária para comprar.")
    end
    elseif v.t == 2 then
    if player:getItemCount(coinID) >= v.price then
    item = player:addItem(v.item, 1)
    item:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Este item pode ser adquirido através do shopping. Adquirido dia " .. os.date("%d/%m/%Y - %X") .." por ".. player:getName() ..". Serial: ".. player:getGuid() ..".")
    player:removeItem(coinID, v.price)
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, v.msg)
    player:setStorageValue(storage, os.time()+1)
    break
    else
    player:sendCancelMessage("Você não possui a quantidade necessária para comprar.")
    end
    elseif v.t == 3 then
    if player:getItemCount(coinID) >= v.price then
    player:addPremiumDays(v.days)
    player:removeItem(coinID, v.price)
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou " .. v.days .. " dias de vip com sucesso.")
    player:setStorageValue(storage, os.time()+1)
    break
    else
    player:sendCancelMessage("Você não possui a quantidade necessária para comprar.")
    end
    elseif v.t == 4 then
    if player:getBaseMagicLevel() >= v.lim then
    player:sendCancelMessage(v.lim_msg)
    return true
    end
    if not isInArray(v.vocations, player:getVocation():getId()) then
    player:sendCancelMessage(v.voc_msg)
    return true
    end
    if player:getItemCount(coinID) >= v.price then
    player:removeItem(coinID, v.price)
    player:setStorageValue(storage, os.time()+1)
    player:remove()
    db.query("UPDATE `players` SET `".. v.skill .. "` = `" .. v.skill .. "` + " .. v.incre .. " WHERE `id` = ".. pid)
    else
    player:sendCancelMessage("Você não possui a quantidade necessária para comprar.")
    end
    elseif v.t == 5 then
    if not isInArray(v.vocations, player:getVocation():getId()) then
    player:sendCancelMessage(v.voc_msg) return false
    end
    if player:getSkillLevel(v.skill) >= v.lim then
    player:sendCancelMessage("Você não pode comprar esse skill.") return false
    end
    if player:getItemCount(coinID) >= v.price then
    player:removeItem(coinID, v.price)
    player:setStorageValue(storage, os.time()+1)
    player:remove()
    db.query("UPDATE `players` SET `".. v.skill .. "` = `" .. v.skill .. "` + " .. v.incre .. " WHERE `id` = ".. pid)
    return true
    else
    player:sendCancelMessage("Você não possui a quantidade necessária para comprar.") return false
    end
    elseif v.t == 6 then
    if player:getItemCount(2160) >= v.price then
    player:removeItem(2160, v.price)
    player:setSkull(SKULL_NONE)
    player:setSkullTime(0)
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your skull and frags has been removed!")
    player:setStorageValue(storage, os.time()+1)
    db.query("UPDATE `player_deaths` SET `unjustified` = 0 WHERE `unjustified` = 1 AND `killed_by` = " .. db.escapeString(player:getName()))
    else
    player:sendCancelMessage("Você não possui a quantidade necessária para comprar.")
    end
    end
    end
    end

    return false
    end

     

    Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

    .

  18. .Qual servidor ou website você utiliza como base? 

    The OTX Server Global - Version: (3.10)

    Qual o motivo deste tópico? 

    No meu servidor a vida e mana esta travada no 65535 não passa disso mesmo que o player pegue mais level. Coloquei um comando de ver a vida e fiz alguns teste e mana e vida fica assim

    107005 se alguém puder me da essa força tenho as sources do servidor.

     

     

    Está surgindo algum erro? Se sim coloque-o aqui. 

    Citar

    image.png.72d5b37382e2cad38df548ecb2bff4bb.png

     

    protocolgame.cpp não consegui colocar por que é muito grande vou hospedar no mediafire se precisar de mais alguma informação eu adiciono.

    Você tem o código disponível? Se tiver publique-o aqui: 

    https://www.mediafire.com/file/qekq15qtxyphyey/protocolgame.cpp/file

     

     

    Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

     

  19. Em 26/12/2020 em 11:57, Vitorelias disse:

    .Qual servidor ou website você utiliza como base? 

     

    OTX Version 3.10

     

    Qual o motivo deste tópico? 

    Tenho um comando TFS 0.4 gostaria de passar ele para OTX  eu consegui fazer alguns ajuste quando o Player usa o comando !comprar funciona porem

    quando o player usa !comprar skillclub ou qualquer comando não acontece nada.

     

    Está surgindo algum erro? Se sim coloque-o aqui. 

     

    comprar.lua

    Você tem o código disponível? Se tiver publique-o aqui: 

    function onSay(cid, words, param, channel)

    if (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Você precisa está em área protegida para utilizar este comando.")
    return TRUE
    end

    if(param ~= "") and (param ~= "skillclub") and (param ~= "skillsword") and (param ~= "skillaxe") and (param ~= "skilldistance") and (param ~= "skillshielding") and (param ~= "magiclevel") and (param ~= "magiclevel5") and (param ~= "skillclub10") and (param ~= "skillsword10") and (param ~= "skillaxe10") and (param ~= "skilldistance10") and (param ~= "skillshielding10") then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Para comprar digite !comprar (nome do item)\nOpcoes:\nskillclub = adiciona 1 skill club por 1 barras.\nskillsword = adiciona 1 skill sword por 1 barras.\nskillaxe = adiciona 1 skill axe por 1 barras.\nskilldistance = adiciona 1 skill distance por 1 barras.")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nskillshielding = adiciona 1 skill shielding por 1 barras.\nmagiclevel = adiciona 1 magic level por 3 barras.\nmagiclevel5 = adiciona 5 magic level por 15 barras.\nskillclub10 = adiciona 10 skills club por 10 barras.\nskillsword10 = adiciona 10 skills sword por 10 barras.\nskillaxe10 = adiciona 10 skills axe por 10 barras.\nskilldistance10 = adiciona 10 skill distance por 10 barras.\nskillshielding10 = adiciona 10 skill shielding por 10 barras.")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O Item desejado não existe em nosso stock. Veja a cima os detalhes dos items disponíveis.")
    return TRUE
    end

    if(param == "") then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Para comprar digite !comprar (nome do item)\nOpcoes:\n.")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nskillclub = adiciona 1 skill club por 1 barras.\nskillsword = adiciona 1 skill sword por 1 barras.\nskillaxe = adiciona 1 skill axe por 1 barras.\nskilldistance = adiciona 1 skill distance por 1 barras.")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nskillshielding = adiciona 1 skill shielding por 1 barras.\nmagiclevel = adiciona 1 magic level por 3 barras.\nmagiclevel5 = adiciona 5 magic level por 15 barras.\nskillclub10 = adiciona 10 skills club por 10 barras.\nskillsword10 = adiciona 10 skills sword por 10 barras.\nskillaxe10 = adiciona 10 skills axe por 10 barras.\nskilldistance10 = adiciona 10 skill distance por 10 barras.\nskillshielding10 = adiciona 10 skill shielding por 10 barras.")
    return TRUE
    end


    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "magiclevel") then
    if getPlayerMagLevel(cid) >= 200 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter magic level acima de 200.")
    return TRUE
    end
    if(not isSorcerer(cid) and not isDruid(cid) and not isInfernalist(cid)) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Sorcerers, Druids e Infernalists podem comprar magic level.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 3 then
    local pid = getPlayerGUID(cid) 
    doPlayerRemoveItem(cid, 9971, 3)
    doRemoveCreature(cid, true)
    db.query("UPDATE `players` SET `maglevel` = `maglevel` + 1 WHERE `id` = "..pid)
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillclub") then
    if getPlayerSkillLevel(cid, SKILL_CLUB) >= 350 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isDrunou(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Drunous podem comprar skill de club.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 1 then
    local pid = getPlayerGUID(cid)
    local club = getPlayerSkillLevel(cid, SKILL_CLUB) 
    doPlayerRemoveItem(cid, 9971, 1)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (club + 1) .. ", `count` = 0 WHERE `skillid` = 1 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillsword") then
    if getPlayerSkillLevel(cid, SKILL_SWORD) >= 350 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isKnight(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de sword.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 1 then
    local pid = getPlayerGUID(cid)
    local sword = getPlayerSkillLevel(cid, SKILL_SWORD) 
    doPlayerRemoveItem(cid, 9971, 1)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (sword + 1) .. ", `count` = 0 WHERE `skillid` = 2 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillaxe") then
    if getPlayerSkillLevel(cid, SKILL_AXE) >= 350 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isKnight(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de axe.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 1 then
    local pid = getPlayerGUID(cid)
    local axe = getPlayerSkillLevel(cid, SKILL_AXE) 
    doPlayerRemoveItem(cid, 9971, 1)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (axe + 1) .. ", `count` = 0 WHERE `skillid` = 3 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skilldistance") then
    if getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 350 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isPaladin(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins podem comprar skill de distance.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 1 then
    local pid = getPlayerGUID(cid)
    local distance = getPlayerSkillLevel(cid, SKILL_DISTANCE) 
    doPlayerRemoveItem(cid, 9971, 1)
    setPlayerStorageValue(cid,11548,os.time()+0)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (distance + 1) .. ", `count` = 0 WHERE `skillid` = 4 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillshielding") then
    if getPlayerSkillLevel(cid, SKILL_SHIELD) >= 350 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if(not isPaladin(cid) and not isKnight(cid) and not isDrunou(cid)) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins, Knights e Drunous podem comprar skill de shield.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 1 then
    local pid = getPlayerGUID(cid)
    local shield = getPlayerSkillLevel(cid, SKILL_SHIELD) 
    doPlayerRemoveItem(cid, 9971, 1)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (shield + 1) .. ", `count` = 0 WHERE `skillid` = 5 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "magiclevel5") then
    if getPlayerMagLevel(cid) >= 196 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter magic level acima de 200.")
    return TRUE
    end
    if(not isSorcerer(cid) and not isDruid(cid) and not isInfernalist(cid)) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Sorcerers, Druids e Infernalists podem comprar magic level.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 15 then
    local pid = getPlayerGUID(cid) 
    doPlayerRemoveItem(cid, 9971, 15)
    doRemoveCreature(cid, true)
    db.query("UPDATE `players` SET `maglevel` = `maglevel` + 5 WHERE `id` = "..pid)
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillclub10") then
    if getPlayerSkillLevel(cid, SKILL_CLUB) >= 341 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isDrunou(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Drunous podem comprar skill de club.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 10 then
    local pid = getPlayerGUID(cid)
    local club = getPlayerSkillLevel(cid, SKILL_CLUB) 
    doPlayerRemoveItem(cid, 9971, 10)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (club + 10) .. ", `count` = 0 WHERE `skillid` = 1 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillsword10") then
    if getPlayerSkillLevel(cid, SKILL_SWORD) >= 341 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isKnight(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de sword.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 10 then
    local pid = getPlayerGUID(cid)
    local sword = getPlayerSkillLevel(cid, SKILL_SWORD) 
    doPlayerRemoveItem(cid, 9971, 10)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (sword + 10) .. ", `count` = 0 WHERE `skillid` = 2 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillaxe10") then
    if getPlayerSkillLevel(cid, SKILL_AXE) >= 341 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isKnight(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de axe.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 10 then
    local pid = getPlayerGUID(cid)
    local axe = getPlayerSkillLevel(cid, SKILL_AXE) 
    doPlayerRemoveItem(cid, 9971, 10)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (axe + 10) .. ", `count` = 0 WHERE `skillid` = 3 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skilldistance10") then
    if getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 341 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isPaladin(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins podem comprar skill de distance.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 10 then
    local pid = getPlayerGUID(cid)
    local distance = getPlayerSkillLevel(cid, SKILL_DISTANCE) 
    doPlayerRemoveItem(cid, 9971, 10)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (distance + 10) .. ", `count` = 0 WHERE `skillid` = 4 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillshielding10") then
    if getPlayerSkillLevel(cid, SKILL_SHIELD) >= 341 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if(not isPaladin(cid) and not isKnight(cid) and not isDrunou(cid)) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins, Knights e Drunous podem comprar skill de shield.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 10 then
    local pid = getPlayerGUID(cid)
    local shield = getPlayerSkillLevel(cid, SKILL_SHIELD) 
    doPlayerRemoveItem(cid, 9971, 10)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (shield + 10) .. ", `count` = 0 WHERE `skillid` = 5 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    end
    end
    return TRUE
    end
     

     

    Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

    image.png.7555654d116b51fe33e21997779c6741.png

     

    Quando o player usa o comando !comprar eu consegui ajustar aparece o que o player pode comprar, porem quando o player usa o !comprar e skillclub ou qualquer outro não acontece nada.

     

    Alguém consegue me passar uma lista de funções OTX pra min tentar ajustar o script pelo menos?

  20. .Qual servidor ou website você utiliza como base? 

     

    OTX Version 3.10

     

    Qual o motivo deste tópico? 

    Tenho um comando TFS 0.4 gostaria de passar ele para OTX  eu consegui fazer alguns ajuste quando o Player usa o comando !comprar funciona porem

    quando o player usa !comprar skillclub ou qualquer comando não acontece nada.

     

    Está surgindo algum erro? Se sim coloque-o aqui. 

    Citar

    Não aparece nenhum erro no distro

     

    comprar.lua

    Você tem o código disponível? Se tiver publique-o aqui: 

    function onSay(cid, words, param, channel)

    if (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Você precisa está em área protegida para utilizar este comando.")
    return TRUE
    end

    if(param ~= "") and (param ~= "skillclub") and (param ~= "skillsword") and (param ~= "skillaxe") and (param ~= "skilldistance") and (param ~= "skillshielding") and (param ~= "magiclevel") and (param ~= "magiclevel5") and (param ~= "skillclub10") and (param ~= "skillsword10") and (param ~= "skillaxe10") and (param ~= "skilldistance10") and (param ~= "skillshielding10") then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Para comprar digite !comprar (nome do item)\nOpcoes:\nskillclub = adiciona 1 skill club por 1 barras.\nskillsword = adiciona 1 skill sword por 1 barras.\nskillaxe = adiciona 1 skill axe por 1 barras.\nskilldistance = adiciona 1 skill distance por 1 barras.")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nskillshielding = adiciona 1 skill shielding por 1 barras.\nmagiclevel = adiciona 1 magic level por 3 barras.\nmagiclevel5 = adiciona 5 magic level por 15 barras.\nskillclub10 = adiciona 10 skills club por 10 barras.\nskillsword10 = adiciona 10 skills sword por 10 barras.\nskillaxe10 = adiciona 10 skills axe por 10 barras.\nskilldistance10 = adiciona 10 skill distance por 10 barras.\nskillshielding10 = adiciona 10 skill shielding por 10 barras.")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O Item desejado não existe em nosso stock. Veja a cima os detalhes dos items disponíveis.")
    return TRUE
    end

    if(param == "") then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Para comprar digite !comprar (nome do item)\nOpcoes:\n.")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nskillclub = adiciona 1 skill club por 1 barras.\nskillsword = adiciona 1 skill sword por 1 barras.\nskillaxe = adiciona 1 skill axe por 1 barras.\nskilldistance = adiciona 1 skill distance por 1 barras.")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nskillshielding = adiciona 1 skill shielding por 1 barras.\nmagiclevel = adiciona 1 magic level por 3 barras.\nmagiclevel5 = adiciona 5 magic level por 15 barras.\nskillclub10 = adiciona 10 skills club por 10 barras.\nskillsword10 = adiciona 10 skills sword por 10 barras.\nskillaxe10 = adiciona 10 skills axe por 10 barras.\nskilldistance10 = adiciona 10 skill distance por 10 barras.\nskillshielding10 = adiciona 10 skill shielding por 10 barras.")
    return TRUE
    end


    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "magiclevel") then
    if getPlayerMagLevel(cid) >= 200 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter magic level acima de 200.")
    return TRUE
    end
    if(not isSorcerer(cid) and not isDruid(cid) and not isInfernalist(cid)) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Sorcerers, Druids e Infernalists podem comprar magic level.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 3 then
    local pid = getPlayerGUID(cid) 
    doPlayerRemoveItem(cid, 9971, 3)
    doRemoveCreature(cid, true)
    db.query("UPDATE `players` SET `maglevel` = `maglevel` + 1 WHERE `id` = "..pid)
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillclub") then
    if getPlayerSkillLevel(cid, SKILL_CLUB) >= 350 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isDrunou(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Drunous podem comprar skill de club.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 1 then
    local pid = getPlayerGUID(cid)
    local club = getPlayerSkillLevel(cid, SKILL_CLUB) 
    doPlayerRemoveItem(cid, 9971, 1)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (club + 1) .. ", `count` = 0 WHERE `skillid` = 1 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillsword") then
    if getPlayerSkillLevel(cid, SKILL_SWORD) >= 350 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isKnight(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de sword.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 1 then
    local pid = getPlayerGUID(cid)
    local sword = getPlayerSkillLevel(cid, SKILL_SWORD) 
    doPlayerRemoveItem(cid, 9971, 1)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (sword + 1) .. ", `count` = 0 WHERE `skillid` = 2 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillaxe") then
    if getPlayerSkillLevel(cid, SKILL_AXE) >= 350 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isKnight(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de axe.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 1 then
    local pid = getPlayerGUID(cid)
    local axe = getPlayerSkillLevel(cid, SKILL_AXE) 
    doPlayerRemoveItem(cid, 9971, 1)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (axe + 1) .. ", `count` = 0 WHERE `skillid` = 3 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skilldistance") then
    if getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 350 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isPaladin(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins podem comprar skill de distance.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 1 then
    local pid = getPlayerGUID(cid)
    local distance = getPlayerSkillLevel(cid, SKILL_DISTANCE) 
    doPlayerRemoveItem(cid, 9971, 1)
    setPlayerStorageValue(cid,11548,os.time()+0)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (distance + 1) .. ", `count` = 0 WHERE `skillid` = 4 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillshielding") then
    if getPlayerSkillLevel(cid, SKILL_SHIELD) >= 350 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if(not isPaladin(cid) and not isKnight(cid) and not isDrunou(cid)) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins, Knights e Drunous podem comprar skill de shield.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 1 then
    local pid = getPlayerGUID(cid)
    local shield = getPlayerSkillLevel(cid, SKILL_SHIELD) 
    doPlayerRemoveItem(cid, 9971, 1)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (shield + 1) .. ", `count` = 0 WHERE `skillid` = 5 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "magiclevel5") then
    if getPlayerMagLevel(cid) >= 196 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter magic level acima de 200.")
    return TRUE
    end
    if(not isSorcerer(cid) and not isDruid(cid) and not isInfernalist(cid)) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Sorcerers, Druids e Infernalists podem comprar magic level.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 15 then
    local pid = getPlayerGUID(cid) 
    doPlayerRemoveItem(cid, 9971, 15)
    doRemoveCreature(cid, true)
    db.query("UPDATE `players` SET `maglevel` = `maglevel` + 5 WHERE `id` = "..pid)
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillclub10") then
    if getPlayerSkillLevel(cid, SKILL_CLUB) >= 341 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isDrunou(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Drunous podem comprar skill de club.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 10 then
    local pid = getPlayerGUID(cid)
    local club = getPlayerSkillLevel(cid, SKILL_CLUB) 
    doPlayerRemoveItem(cid, 9971, 10)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (club + 10) .. ", `count` = 0 WHERE `skillid` = 1 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillsword10") then
    if getPlayerSkillLevel(cid, SKILL_SWORD) >= 341 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isKnight(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de sword.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 10 then
    local pid = getPlayerGUID(cid)
    local sword = getPlayerSkillLevel(cid, SKILL_SWORD) 
    doPlayerRemoveItem(cid, 9971, 10)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (sword + 10) .. ", `count` = 0 WHERE `skillid` = 2 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillaxe10") then
    if getPlayerSkillLevel(cid, SKILL_AXE) >= 341 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isKnight(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de axe.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 10 then
    local pid = getPlayerGUID(cid)
    local axe = getPlayerSkillLevel(cid, SKILL_AXE) 
    doPlayerRemoveItem(cid, 9971, 10)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (axe + 10) .. ", `count` = 0 WHERE `skillid` = 3 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skilldistance10") then
    if getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 341 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if not isPaladin(cid) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins podem comprar skill de distance.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 10 then
    local pid = getPlayerGUID(cid)
    local distance = getPlayerSkillLevel(cid, SKILL_DISTANCE) 
    doPlayerRemoveItem(cid, 9971, 10)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (distance + 10) .. ", `count` = 0 WHERE `skillid` = 4 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    return TRUE
    end
    end

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    if(param == "skillshielding10") then
    if getPlayerSkillLevel(cid, SKILL_SHIELD) >= 341 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
    return TRUE
    end
    if(not isPaladin(cid) and not isKnight(cid) and not isDrunou(cid)) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins, Knights e Drunous podem comprar skill de shield.")
    return TRUE
    end
    if getPlayerItemCount(cid, 9971) >= 10 then
    local pid = getPlayerGUID(cid)
    local shield = getPlayerSkillLevel(cid, SKILL_SHIELD) 
    doPlayerRemoveItem(cid, 9971, 10)
    doRemoveCreature(cid, true)
    db.query("UPDATE `player_skills` SET `value` = " .. (shield + 10) .. ", `count` = 0 WHERE `skillid` = 5 and `player_id` = " .. pid .. ";")
    return TRUE
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
    end
    end
    return TRUE
    end
     

     

    Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

    image.png.7555654d116b51fe33e21997779c6741.png

     

    Quando o player usa o comando !comprar eu consegui ajustar aparece o que o player pode comprar, porem quando o player usa o !comprar e skillclub ou qualquer outro não acontece nada.

  21. .Qual servidor ou website você utiliza como base? 

    The OTX Server Global - Version: (3.10)

    Qual o motivo deste tópico? 

    Olá bom dia peguei um servidor Global e no site não tinha opção de vocação o player começava sem vocação, ai eu acabei colocando as vocação no site, porem quando 

    o player cria conta e loga, fica com speed 7 e o player fica bugado não consegue andar, se alguém conseguir me da uma luz do que eu possa fazer pra corrigir obrigado.

     

    Feliz natal!

     

    Está surgindo algum erro? Se sim coloque-o aqui. 

    Citar

    image.png.22382190ec07a7d2b8c6722aa5a97c21.png

     

     

  22. Em 07/12/2020 em 13:42, Naze disse:

    Essa é a action da wall, so configura as posições, nome, storage e tempo

    
    local cfg = {
        stor = 55555,
        pos_player = {x = 130, y = 68, z = 7},
        pos_mob = {x = 131, y = 69, z = 7},
        name_mob = "Demon",
        time = 10,
    }
    
    function teleportAndSpawn(cid)
        doTeleportThing(cid, cfg.pos_player)
        while cfg.time >= 1 do
            addEvent(doSendAnimatedText, (cfg.time*1000), cfg.pos_mob, -(cfg.time-11), math.random(1,255))
            cfg.time = cfg.time - 1
        end
        addEvent(doSummonCreature, 10000, cfg.name_mob, cfg.pos_mob)
    end
    
    function onUse(cid, item, frompos, item2, topos)
        if getPlayerStorageValue(cid, cfg.stor) < 1 then
            doPlayerSendTextMessage(cid, 22, "Você não tem permissão!")
            return false
        end
            teleportAndSpawn(cid)
            doPlayerSendTextMessage(cid, 22, "Em 10 segundos o Boss aparecera.")
        return true
    end

     

    em creaturescripts.xml adiciona esse tag

    
    <event type="death" name="DeathTaskBoss" event="script" value="nomedoscript.lua"/>

    Em creaturescripts/scripts cria esse script e configura o nomedoscritps e stor e msgs.

    
    local name_boss = "Demon"
    local stor = 55555
    function onDeath(cid, corpse, deathList)
    	if getCreatureName(cid) == name_boss then
    		if getPlayerStorageValue(deathList[1], stor) >= 1 then
    			setPlayerStorageValue(deathList[1], stor, 0)
    			doPlayerSendTextMessage(deathList[1], 22,"Você derrotou o Boss Parabéns!")
    		end
    	end
        return true
    end

     

    por ultimo para funciona vai no boss e adiciona esse tag antes do </monster>

    
    <script> <event name="DeathTaskBoss"/> </script> 

     

    Faça tudo correto que vai funcionar já testei.

    Deu certo será que se consegue fazer uns ajuste? no caso se mata o boss e você continua na sala teria como colocar uma mensagem "Você matou o getCreatureName você será removido da sala em 1 minuto" 

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo