Ir para conteúdo

FlavioHulk

Membro
  • Registro em

  • Última visita

Tudo que FlavioHulk postou

  1. local config = { levelRequiredToAdd = 20, maxOffersPerPlayer = 5, SendOffersOnlyInPZ = true, blocked_items = {2165, 2152, 2148, 2160, 2166, 2167, 2168, 2169, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2343, 2433, 2640, 6132, 6300, 6301, 9932, 9933} } function onSay(player, words, param) if param == '' then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end local t = param:split(",") if t[1] == "add" then if not t[2] or not t[3] or not t[4] then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end if not tonumber (t[3]) or not tonumber(t[4]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't set valid price or items count.") return true end if string.len(t[3]) > 7 or string.len(t[4]) > 3 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "This price or item count is too high.") return true end local item = getItemIdByName(t[2]) if not item then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.") return true end if player:getLevel() < config.levelRequiredToAdd then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have required (" .. config.levelRequiredToAdd .. ") level.") return true end if table.contains(config.blocked_items, item) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "This item is blocked.") return true end if player:getItemCount(item) < tonumber(t[4]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you don't have this item(s).") return true end local check = db.storeQuery("SELECT `id` FROM `auction_system` WHERE `player` = " .. player:getGuid() .. ";") if check:getID() == -1 then elseif check:getRows(true) >= config.maxOffersPerPlayer then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't add more offers (max. " .. config.maxOffersPerPlayer .. ")") return true end if config.SendOffersOnlyInPZ then if not Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you add offert to database.") return true end end if tonumber(t[4]) < 1 or tonumber(t[3]) < 1 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have to type a number higher than 0.") return true end local itemcount, costgp = math.floor(t[4]), math.floor(t[3]) player:removeItem(item, itemcount) db.query("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`) VALUES (" .. player:getGuid() .. ", \"" .. t[2] .. "\", " .. getItemIdByName(t[2]) .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ")") player:sendTextMessage(MESSAGE_INFO_DESCR, "You successfully add " .. itemcount .." " .. t[2] .." for " .. costgp .. " gps to offerts database.") end if t[1] == "buy" then if not tonumber(t[2]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") return true end local buy = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = " .. tonumber(t[2]) .. ";") if buy:getID() ~= -1 then if player:getMoney() < buy:getNumber("cost") then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enoguh GP.") buy:free() return true end if player:getName() == getPlayerNameByGUID(buy:getNumber("player")) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can't buy your own items.") buy:free() return true end if player:getFreeCapacity() < getItemWeightById(buy:getNumber("item_id"), buy:getNumber("count")))then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You try to buy a " .. buy:getString("item_name") .. ". It weight " .. getItemWeightById(buy:getNumber("item_id"), buy:getNumber("count")) .. " cap oz. and you have only " .. getPlayerFreeCap(cid) .. " oz. free capacity. Put some items to depot and try again.") buy:free() return true end local itemStacks = ItemType(buy:getString("item_id")):isStackable() if itemStacks then player:addItem(buy:getString("item_id"), buy:getNumber("count")) else for i = 1, buy:getNumber("count") do player:addItem(buy:getString("item_id"), 1) end end player:removeMoney(buy:getNumber("cost")) db.query("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";") player:sendTextMessage(MESSAGE_INFO_DESCR, "You bought " .. buy:getNumber("count") .. " ".. buy:getString("item_name") .. " for " .. buy:getNumber("cost") .. " gps!") db.query("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. buy:getNumber("cost") .. " WHERE `id` = " .. buy:getNumber("player") .. ";") buy:free() else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") end end if t[1] == "remove" then if not tonumber(t[2]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") return true end if config.SendOffersOnlyInPZ then if not Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.") return true end end local delete = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = " .. tonumber(t[2]) .. ";") if delete:getID() ~= -1 then if player:getGuid() == delete:getNumber("player")) then db.query("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";") local itemStack = ItemType(delete:getString("item_id")):isStackable() if itemStack then player:addItem(delete:getString("item_id"), delete:getNumber("count")) else for i = 1, delete:getNumber("count") do player:addItem(delete:getString("item_id"), 1) end end player:sendTextMessage(MESSAGE_INFO_DESCR, "Your offert has been deleted from offerts database.") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "This is not your offert!") end delete:free() else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") end end if t[1] == "withdraw" then local balance = db.storeQuery("SELECT `auction_balance` FROM `players` WHERE `id` = " .. player:getGuid() .. ";") if balance:getNumber("auction_balance") < 1 then player:sendTextMessage(MESSAGE_INFO_DESCR, "You don't have money on your auction balance.") balance:free() return true end player:sendTextMessage(MESSAGE_INFO_DESCR, "You got " .. balance:getNumber("auction_balance") .. " gps from auction system!") player:addMoney(balance:getNumber("auction_balance")) db.query("UPDATE `players` SET `auction_balance` = '0' WHERE `id` = " .. player:getGuid() .. ";") balance:free() end if t[1] == "list" then local result = db.storeQuery("SELECT * FROM `auction_system` ORDER BY `auction_system`.`id` ASC") if result:getID() == -1 then return true end local msg = "Trade Offline:\n\n!offer buy, ID\n!offer remove, ID\n!offer add, ItemName, ItemPrice, ItemCount\n\n" while true do local id = result:getString("id") local name = getPlayerNameByGUID(result:getString("player")) local item_name = getItemNameById(result:getString("item_id")) local count = result:getString("count") local custo = result:getString("cost")/1000 local custo2 = result:getString("cost") if isPlayer() then msg = ""..msg.."ID : "..id.."\nItem Name : "..item_name.." - Item Count : "..count.." - Item Cust : "..custo.."k("..custo2.."GP) - Dono : "..name.."\n" end if not result:next() then break end end player:popupFYI(msg) return true end return true end
  2. FlavioHulk postou uma resposta no tópico em Suporte Tibia OTServer
    Posta o script do Eject, mano! Assim fica mais fácil em te ajudar !
  3. local config = { levelRequiredToAdd = 20, maxOffersPerPlayer = 5, SendOffersOnlyInPZ = true, blocked_items = {2165, 2152, 2148, 2160, 2166, 2167, 2168, 2169, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2343, 2433, 2640, 6132, 6300, 6301, 9932, 9933} } function onSay(player, words, param) if param == '' then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end local t = param:split(",") if t[1] == "add" then if not t[2] or not t[3] or not t[4] then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end if not tonumber (t[3]) or not tonumber(t[4]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't set valid price or items count.") return true end if string.len(t[3]) > 7 or string.len(t[4]) > 3 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "This price or item count is too high.") return true end local item = getItemIdByName(t[2]) if not item then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.") return true end if player:getLevel() < config.levelRequiredToAdd then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have required (" .. config.levelRequiredToAdd .. ") level.") return true end if table.contains(config.blocked_items, item) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "This item is blocked.") return true end if player:getItemCount(item) < tonumber(t[4]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you don't have this item(s).") return true end local check = db.storeQuery("SELECT `id` FROM `auction_system` WHERE `player` = " .. player:getGuid() .. ";") if check:getID() == -1 then elseif check:getRows(true) >= config.maxOffersPerPlayer then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't add more offers (max. " .. config.maxOffersPerPlayer .. ")") return true end if config.SendOffersOnlyInPZ then if not Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you add offert to database.") return true end end if tonumber(t[4]) < 1 or tonumber(t[3]) < 1 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have to type a number higher than 0.") return true end local itemcount, costgp = math.floor(t[4]), math.floor(t[3]) player:removeItem(item, itemcount) db.query("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`) VALUES (" .. player:getGuid() .. ", \"" .. t[2] .. "\", " .. getItemIdByName(t[2]) .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ")") player:sendTextMessage(MESSAGE_INFO_DESCR, "You successfully add " .. itemcount .." " .. t[2] .." for " .. costgp .. " gps to offerts database.") end if t[1] == "buy" then if not tonumber(t[2]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") return true end local buy = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = " .. tonumber(t[2]) .. ";") if buy:getID() ~= -1 then if player:getMoney() < buy:getNumber("cost") then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enoguh GP.") buy:free() return true end if player:getName() == getPlayerNameByGUID(buy:getNumber("player"))) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can't buy your own items.") buy:free() return true end if player:getFreeCapacity() < getItemWeightById(buy:getNumber("item_id"), buy:getNumber("count")))then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You try to buy a " .. buy:getString("item_name") .. ". It weight " .. getItemWeightById(buy:getNumber("item_id"), buy:getNumber("count")) .. " cap oz. and you have only " .. getPlayerFreeCap(cid) .. " oz. free capacity. Put some items to depot and try again.") buy:free() return true end local itemStacks = ItemType(buy:getString("item_id")):isStackable() if itemStacks then player:addItem(buy:getString("item_id"), buy:getNumber("count")) else for i = 1, buy:getNumber("count") do player:addItem(buy:getString("item_id"), 1) end end player:removeMoney(buy:getNumber("cost")) db.query("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";") player:sendTextMessage(MESSAGE_INFO_DESCR, "You bought " .. buy:getNumber("count") .. " ".. buy:getString("item_name") .. " for " .. buy:getNumber("cost") .. " gps!") db.query("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. buy:getNumber("cost") .. " WHERE `id` = " .. buy:getNumber("player") .. ";") buy:free() else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") end end if t[1] == "remove" then if not tonumber(t[2]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") return true end if config.SendOffersOnlyInPZ then if not Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.") return true end end local delete = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = " .. tonumber(t[2]) .. ";") if delete:getID() ~= -1 then if player:getGuid() == delete:getNumber("player")) then db.query("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";") local itemStack = ItemType(delete:getString("item_id")):isStackable() if itemStack then player:addItem(delete:getString("item_id"), delete:getNumber("count")) else for i = 1, delete:getNumber("count") do player:addItem(delete:getString("item_id"), 1) end end player:sendTextMessage(MESSAGE_INFO_DESCR, "Your offert has been deleted from offerts database.") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "This is not your offert!") end delete:free() else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") end end if t[1] == "withdraw" then local balance = db.storeQuery("SELECT `auction_balance` FROM `players` WHERE `id` = " .. player:getGuid() .. ";") if balance:getNumber("auction_balance") < 1 then player:sendTextMessage(MESSAGE_INFO_DESCR, "You don't have money on your auction balance.") balance:free() return true end player:sendTextMessage(MESSAGE_INFO_DESCR, "You got " .. balance:getNumber("auction_balance") .. " gps from auction system!") player:addMoney(balance:getNumber("auction_balance")) db.query("UPDATE `players` SET `auction_balance` = '0' WHERE `id` = " .. player:getGuid() .. ";") balance:free() end if t[1] == "list" then local result = db.storeQuery("SELECT * FROM `auction_system` ORDER BY `auction_system`.`id` ASC") if result:getID() == -1 then return true end local msg = "Trade Offline:\n\n!offer buy, ID\n!offer remove, ID\n!offer add, ItemName, ItemPrice, ItemCount\n\n" while true do local id = result:getString("id") local name = getPlayerNameByGUID(result:getString("player")) local item_name = getItemNameById(result:getString("item_id")) local count = result:getString("count") local custo = result:getString("cost")/1000 local custo2 = result:getString("cost") if isPlayer() then msg = ""..msg.."ID : "..id.."\nItem Name : "..item_name.." - Item Count : "..count.." - Item Cust : "..custo.."k("..custo2.."GP) - Dono : "..name.."\n" end if not result:next() then break end end player:popupFYI(msg) return true end return true end
  4. Cara, tentei, não manjo de funções 0.4... local config = { parede1 = {x = 32018, y = 32237, z = 9, stackpos=1}, } function onUse(cid, item) local parede = getTileItemById(config.parede1, 386) if parede then doRemoveItem(parede, 386, 1) end addEvent(doCreateItem, 120000, 386, config.parede1) return true end end
  5. Qual tua distro, mano? 1.x ou 0.4?
  6. Testa aê! local config = { requiredLevel = 8, Daily = false, BossPosition = Position(32269, 31088, 14), playerPositions = { Position(32302, 31088, 14), Position(32302, 31089, 14), Position(32302, 31090, 14), Position(32302, 31091, 14), Position(32302, 31092, 14) }, newPositions = { Position(32271, 31100, 14), Position(32270, 31100, 14), Position(32269, 31100, 14), Position(32268, 31100, 14), Position(32267, 31100, 14) } } local timerStorage = 65300 function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 9826 then local storePlayers, playerTile = {} for i = 1, #config.playerPositions do playerTile = Tile(config.playerPositions):getTopCreature() if not playerTile or not playerTile:isPlayer() then player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need 5 players.") return true end if playerTile:getLevel() < config.requiredLevel then player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.") return true end if playerTile:getStorageValue(timerStorage) > os.time() then player:sendTextMessage(MESSAGE_STATUS_SMALL, "QUALQUER DESCRIÇÂO") return true end end storePlayers[#storePlayers + 1] = playerTile end Game.createMonster("Melting Frozen Horror", config.BossPosition, true, true) local players for i = 1, #storePlayers do players = storePlayers config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF) players:teleportTo(config.newPositions[i]) config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA) players:setDirection(DIRECTION_EAST) players:setStorageValue(timerStorage, os.time() + (20 * 60 * 60)) -- 20 horas here. end elseif item.itemid == 9825 then if config.Daily then player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE)) return true end end item:transform(item.itemid == 9826 and 9825 or 9826) return true end
  7. Então cara, me explica mais fielmente como você quer esse script, que já faço pra ti
  8. Qual seu TFS?
  9. poderia me mostrar o tópico desse sistema de bless?
  10. posta o script do NPC
  11. Muito obrigado @Adriano SwaTT!! vou testar!
  12. é um monstro de evento, ao mata-lo ele se transformará no segundo monstro, e ao matar o segundo monstro, cairá o loot
  13. mas é apenas uma criatura... Ex.: Minotaur ao morrer se transformará em Minotaur Mage
  14. Tem sim essa função onMoveItem, @Adriano SwaTT Respostas: 1. Sim 2. Não, não precisa, a função será somente de causar os danos pra ele se transformar em outro criatura
  15. tem que ser colocado no chão para o monstro passar por cima Qual a estrutura da função?
  16. como funcionaria essa função? sou meio leigo @vankk
  17. Eu queria a ajuda de vocês pra desenvolver um script que funcionaria como creaturescripts do seguinte modo: - O monstro não pode ser atacado, ele só pode ser hitado por itens que os players colocarão no chão - O monstro perderá x de life cada vez que passar por cima de um item - Depois que o monstro passar por cima do item, ele some... Desde já agradeço a todos
  18. Saquei, boa explicação! Valeu mano
  19. @KotZletY, falo das linhas locais local a = { itemid = 26387, -- ID DO ITEM QUE VAI DAR A MOUNT mountID = 103, -- ID DA MOUNT storage = 64657, -- STORAGE, SÓ ALTERE SE NECESSARIO } Se você ver são três linhas, itemid, mountid e storage. Não tinha a linha itemid, e o script não funcionava, mas isso é apenas detalhe, você fez a parte mais complicada, valeu
  20. Valeu pela força, @luangop! Mas o script tinha que ser atualizado mesmo... Mas valeu pela tentativa Eu tinha tentado fazer isso, mas também dava erro :S, mas valeu pela força!!!!! @Gustavo Ntos Pô mano, valeu muito! Realmente funcionou, só ficou faltando o item id no local a nas primeiras linhas, mas corrigi isso! @KotZletY, e já te pergunto se posso postar diretamente no tópico de script?!
  21. Quando eu uso o item aparece esse erro no console: Eu uso este script local a = { itemid = 26194, -- ID DO ITEM QUE VAI DAR A MOUNT mountID = 94, -- ID DA MOUNT storage = 64656, -- STORAGE, SÓ ALTERE SE NECESSARIO } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, a.storage) == -1 then if getPlayerItemCount(cid, a.itemid) >= 1 then doPlayerAddMount(cid, a.mountID) doPlayerRemoveItem(cid, a.itemid, 1) doCreatureSay(cid, 'You receive the permission to ride a sparkion', TALKTYPE_MONSTER_SAY, 2, 2) doPlayerSetStorageValue(cid, a.storage, 1) else doPlayerSendCancel(cid, "You must have the item in the backpack in order to purchase your mount.") doSendMagicEffect(getPlayerPosition(cid), 2) end else doPlayerSendCancel(cid, "Sorry, you already have this mount.") doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end Eu queria esse script adicionasse a storage impedindo de ele usar o item de montaria novamente. TFS 1.2 Desde já agradeço
  22. FlavioHulk postou uma resposta no tópico em Suporte Tibia OTServer
    Teria como me dar uma luz, não? @login12 Agradeço a ajuda, mas não é exatamente isso que procuro!

Informação Importante

Confirmação de Termo