Ir para conteúdo

Alex45

Membro
  • Registro em

  • Última visita

Solutions

  1. Alex45's post in (Resolvido)Antigo Utamo Vita was marked as the answer   
    O script é o mesmo que você tem, basta remover esta linha que está marcado em preto
     
    local combat = Combat()
    combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
    combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
    function onCastSpell(creature, var)
        local condition = Condition(CONDITION_MANASHIELD)
        condition:setParameter(CONDITION_PARAM_TICKS, 180000)
        local player = creature:getPlayer()
        if player then
            condition:setParameter(CONDITION_PARAM_MANASHIELD, math.min(player:getMaxMana(), 300 + 7.6 * player:getLevel() + 7 * player:getMagicLevel()))
        end
        creature:addCondition(condition)
        return combat:execute(creature, var)
    end
     
    queda assim
     
    local combat = Combat() combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0) function onCastSpell(creature, var) local condition = Condition(CONDITION_MANASHIELD) condition:setParameter(CONDITION_PARAM_TICKS, 180000) creature:addCondition(condition) return combat:execute(creature, var) end  
  2. Alex45's post in (Resolvido)(Revscript) !Shop Error Consola was marked as the answer   
    .Qual servidor ou website você utiliza como base? 
    Znote última versão do github , otservbr 12
    Qual o motivo deste tópico? 
    Não consigo perceber o erro que tenho no comando! Na loja no jogo tudo funciona bem mas o script lua dá este erro
     
     
    Você tem o código disponível? Se tiver publique-o aqui:  ( !shop ) znoteshop.lua 
    -- <talkaction words="!shop" script="znoteshop.lua"/> -- Znote Shop v1.1 for Znote AAC on TFS 1.2+ local znoteShop = TalkAction ("!Shop") function znoteShop.onSay(cid, words, param) local storage = 54073 -- Make sure to select non-used storage. This is used to prevent SQL load attacks. local cooldown = 15 -- in seconds. local player = Player(cid) if player:getStorageValue(storage) <= os.time() then player:setStorageValue(storage, os.time() + cooldown) local type_desc = { "itemids", "pending premium (skip)", "pending gender change (skip)", "pending character name change (skip)", "Outfit and addons", "Mounts", "Instant house purchase" } print("Player: " .. player:getName() .. " triggered !shop talkaction.") -- Create the query local orderQuery = db.storeQuery("SELECT `id`, `type`, `itemid`, `count` FROM `znote_shop_orders` WHERE `account_id` = " .. player:getAccountId() .. ";") local served = false -- Detect if we got any results if orderQuery ~= false then repeat -- Fetch order values local q_id = result.getNumber(orderQuery, "id") local q_type = result.getNumber(orderQuery, "type") local q_itemid = result.getNumber(orderQuery, "itemid") local q_count = result.getNumber(orderQuery, "count") local description = "Unknown or custom type" if type_desc[q_type] ~= nil then description = type_desc[q_type] end print("Processing type "..q_type..": ".. description) -- ORDER TYPE 1 (Regular item shop products) if q_type == 1 then served = true -- Get weight if player:getFreeCapacity() >= ItemType(q_itemid):getWeight(q_count) then db.query("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";") player:addItem(q_itemid, q_count) player:sendTextMessage(MESSAGE_INFO_DESCR, "Congratulations! You have received " .. q_count .. " x " .. ItemType(q_itemid):getName() .. "!") else player:sendTextMessage(MESSAGE_STATUS_WARNING, "Need more CAP!") end end -- ORDER TYPE 5 (Outfit and addon) if q_type == 5 then served = true local itemid = q_itemid local outfits = {} if itemid > 1000 then local first = math.floor(itemid/1000) table.insert(outfits, first) itemid = itemid - (first * 1000) end table.insert(outfits, itemid) for _, outfitId in pairs(outfits) do -- Make sure player don't already have this outfit and addon if not player:hasOutfit(outfitId, q_count) then db.query("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";") player:addOutfit(outfitId) player:addOutfitAddon(outfitId, q_count) player:sendTextMessage(MESSAGE_INFO_DESCR, "Congratulations! You have received a new outfit!") else player:sendTextMessage(MESSAGE_STATUS_WARNING, "You already have this outfit and addon!") end end end if Game.getClientVersion().min >= 1260 then -- ORDER TYPE 6 (Mounts) if q_type == 6 then served = true -- Make sure player don't already have this outfit and addon if not player:hasMount(q_itemid) then db.query("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";") player:addMount(q_itemid) player:sendTextMessage(MESSAGE_INFO_DESCR, "Congratulations! You have received a new mount!") else player:sendTextMessage(MESSAGE_STATUS_WARNING, "You already have this mount!") end end end -- ORDER TYPE 7 (Direct house purchase) if orderType == 7 then served = true local house = House(orderItemId) -- Logged in player is not necessarily the player that bough the house. So we need to load player from db. local buyerQuery = db.storeQuery("SELECT `name` FROM `players` WHERE `id` = "..orderCount.." LIMIT 1") if buyerQuery ~= false then local buyerName = result.getString(buyerQuery, "name") result.free(buyerQuery) if house then db.query("DELETE FROM `znote_shop_orders` WHERE `id` = " .. orderId .. ";") house:setOwnerGuid(orderCount) player:sendTextMessage(MESSAGE_INFO_DESCR, "You have successfully bought the house "..house:getName().." on "..buyerName..", be sure to have the money for the rent in the bank.") print("Process complete. [".. buyerName .."] has received house: ["..house:getName().."]") end end end -- Add custom order types here -- Type 1 is for itemids (Already coded here) -- Type 2 is for premium (Coded on web) -- Type 3 is for gender change (Coded on web) -- Type 4 is for character name change (Coded on web) -- Type 5 is for character outfit and addon (Already coded here) -- Type 6 is for mounts (Already coded here) -- Type 7 is for Instant house purchase (Already coded here) -- So use type 8+ for custom stuff, like etc packages. -- if q_type == 8 then -- end until not result.next(orderQuery) result.free(orderQuery) if not served then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have no orders to process in-game.") end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have no orders.") end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Can only be executed once every " .. cooldown .. " seconds. Remaining cooldown: " .. player:getStorageValue(storage) - os.time()) end return false end znoteShop:separator(" ") znoteShop:register()  
    ERROR:
     
    Lua script Error: [Scripts Interface] C:\uses\desktop\custom\data\scripts\talkatcions\player\znoteshop.lua:callback ...p\custom\data\scripts\talkatcions\player\znoteshop.lua:81: attempt to compare number with nil stack taceback: [C]: in function '__le' ...p\custom\data\scripts\talkatcions\player\znoteshop.lua:81 in function <...p\custom\data\scripts\talkatcions\player\znoteshop.lua:5>

    lineas:

    5: local cooldown = function znoteShop.onSay(player, words, param)
    81: if Game.getClientVersion().min >= 1260 then
     
    borrar ifgame.getClinetVersion 
     
  3. Alex45's post in (Resolvido)Otserv 12X Tibia Coin ( Actions ) was marked as the answer   
    .Qual servidor ou website você utiliza como base? 
    Znote Account
    Qual o motivo deste tópico? 
    Olá Peguei um código antigo do Tibia Coin (11.50) para passar no meu 12X, o que não entendo é que no 11.50 existe o arquivo actions.xml, mas lá no 12x existe não tem nenhum existe apenas a pasta 'script' e cheia de lua, alguém sabe como faço para adicionar meu script tibiacoin.lua? Coloquei na pasta outros, mas não funciona, acho que precisa ser adicionado em algum lugar, se alguém já testou a versão 12 e pudesse me dizer como adicionar uma ação ficaria grato
     
     
    Você tem o código disponível? Se tiver publique-o aqui: 
     
    local config = {
       idcoin = 24774
    }
    function onUse(cid, item, fromPosition, itemEx, toPosition)
       local player = Player(cid)
       local item = Item(item.uid)
       if player:getItemCount(config.idcoin) > 0 then
           local coinplayer = player:getCoinsBalance()+item:getCount()
           player:getPosition():sendMagicEffect(15)
           item:remove()
           player:setCoinsBalance(coinplayer)
           player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have recived Store Coins.")
       else
           player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to carry Store coins in your backpack.")
       end
       return true
    end
     
     
     
     
     
    Consigio montar,
     
    local tibiaCoin = Action() function tibiaCoin.onUse(player, item, fromPosition, target, toPosition, isHotkey) local coins = 1 db.query("UPDATE `accounts` SET `coins` = `coins` + '" .. coins .. "' WHERE `id` = '" .. player:getAccountId() .. "';") player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "RECEBEU "..coins.." COINS") item:remove(1) return true end tibiaCoin:id(24774) tibiaCoin:register()  
    Gracias pel ajuda! 

Informação Importante

Confirmação de Termo