Ir para conteúdo

Sekk

Membro
  • Registro em

  • Última visita

Tudo que Sekk postou

  1. Tenta assim: <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Loot System" version="1.0" author="Vodkart And Mkalo" contact="none.com" enabled="yes"> <config name="Loot_func"><![CDATA[ info = { AutomaticDeposit = true, BlockMonsters = {}, BlockItemsList = {2123,2515}, Max_Slots = {free = 2, premium = 5}, Storages = {27000,28001,28002} } function setPlayerStorageTable(cid, storage, tab) local tabstr = "&" for i,x in pairs(tab) do tabstr = tabstr .. i .. "," .. x .. ";" end setPlayerStorageValue(cid, storage, tabstr:sub(1, #tabstr-1)) end function getPlayerStorageTable(cid, storage) local tabstr = getPlayerStorageValue(cid, storage) local tab = {} if type(tabstr) ~= "string" then return {} end if tabstr:sub(1,1) ~= "&" then return {} end local tabstr = tabstr:sub(2, #tabstr) local a = string.explode(tabstr, ";") for i,x in pairs(a) do local b = string.explode(x, ",") tab[tonumber(b[1]) or b[1]] = tonumber(b[2]) or b[2] end return tab end function isInTable(cid, item) for _,i in pairs(getPlayerStorageTable(cid, info.Storages[1]))do if tonumber(i) == tonumber(item) then return true end end return false end function addItemTable(cid, item) local x = {} for i = 1,#getPlayerStorageTable(cid, info.Storages[1]) do table.insert(x,getPlayerStorageTable(cid, info.Storages[1])[i]) end if x ~= 0 then table.insert(x,tonumber(item)) setPlayerStorageTable(cid, info.Storages[1], x) else setPlayerStorageTable(cid, info.Storages[1], {item}) end end function removeItemTable(cid, item) local x = {} for i = 1,#getPlayerStorageTable(cid, info.Storages[1]) do table.insert(x,getPlayerStorageTable(cid, info.Storages[1])[i]) end for i,v in ipairs(x) do if tonumber(v) == tonumber(item) then table.remove(x,i) end end return setPlayerStorageTable(cid, info.Storages[1], x) end function ShowItemsTabble(cid) local n,str = 0,"[+] Auto Loot Commands [+]\n\n!autoloot item name --> To add ou Remove item from list.\n!autoloot money --> To collect gold automatically.\n!autoloot clear --> To clear the list.\n!autoloot on/off --> To enable or disable the collecting of items in the system.\n\n[+] Auto Loot Info [+]\n\nSystem: "..(getPlayerStorageValue(cid, info.Storages[3]) <= 0 and "Activated" or "Disabled")..".\nGold Collecting: "..(getPlayerStorageValue(cid, info.Storages[2]) > 0 and "Activated" or "Disabled")..".\nBalance Total: ["..getPlayerBalance(cid).."] gp's.\nMaximum Slots: ["..#getPlayerStorageTable(cid, info.Storages[1]).."/"..(isPremium(cid) and info.Max_Slots.premium or info.Max_Slots.free).."]\n\n[+] Auto Loot Slots [+]\n\n" for i = 1,#getPlayerStorageTable(cid, info.Storages[1]) do n = n + 1 str = str.."Slot "..n.." - "..getItemNameById(getPlayerStorageTable(cid, info.Storages[1])[i]).."\n" end return doPlayerPopupFYI(cid, str) end function getContainerItems(containeruid) local items = {} local containers = {} if type(getContainerSize(containeruid)) ~= "number" then return false end for slot = 0, getContainerSize(containeruid)-1 do local item = getContainerItem(containeruid, slot) if item.itemid == 0 then break end if isContainer(item.uid) then table.insert(containers, item.uid) end table.insert(items, item) end if #containers > 0 then for i,x in ipairs(getContainerItems(containers[1])) do table.insert(items, x) end table.remove(containers, 1) end return items end function getItemsInContainerById(container, itemid) -- Function By Kydrai local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot=0, (getContainerSize(container)-1) do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getItemsInContainerById(item.uid, itemid) for i=0, #itemsbag do table.insert(items, itemsbag[i]) end else if itemid == item.itemid then table.insert(items, item.uid) end end end end return items end function doPlayerAddItemStacking(cid, itemid, amount) -- revisado local item, _G = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, itemid), 0 if #item > 0 then for _ ,x in pairs(item) do local ret = getThing(x) if ret.type < 100 then doTransformItem(ret.uid, itemid, ret.type+amount) if ret.type+amount > 100 then doPlayerAddItem(cid, itemid, ret.type+amount-100) end break else _G = _G+1 end end if _G == #item then doPlayerAddItem(cid, itemid, amount) end else return doPlayerAddItem(cid, itemid, amount) end end function AutomaticDeposit(cid,item,n) local deposit = item == tonumber(2160) and (n*10000) or tonumber(item) == 2152 and (n*100) or (n*1) return doPlayerDepositMoney(cid, deposit) end function corpseRetireItems(cid, pos) local check = false for i = 0, 255 do pos.stackpos = i tile = getTileThingByPos(pos) if tile.uid > 0 and isCorpse(tile.uid) then check = true break end end if check == true then local items = getContainerItems(tile.uid) for i,x in pairs(items) do if isInArray(getPlayerStorageTable(cid, info.Storages[1]), tonumber(x.itemid)) or getPlayerStorageValue(cid, info.Storages[2]) > 0 and isInArray({2148,2152,2160},tonumber(x.itemid)) then if isItemStackable(x.itemid) then doPlayerAddItemStacking(cid, x.itemid, x.type) if info.AutomaticDeposit == true and isInArray({2148,2152,2160}, tonumber(x.itemid)) then AutomaticDeposit(cid,x.itemid,x.type) end else doPlayerAddItem(cid, x.itemid) end doRemoveItem(x.uid) end end end end ]]></config> <event type="login" name="LootLogin" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "LootEventKIll") if isPremium(cid) and getPlayerStorageValue(cid, 27001) <= 0 then setPlayerStorageValue(cid, 27001, 1) elseif getPlayerStorageValue(cid, 27001) > 0 and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Auto Loot] You premium is Over, Start a new list!") setPlayerStorageValue(cid, 27001, -1) setPlayerStorageValue(cid, info.Storages[1], -1) end return true end]]></event> <event type="kill" name="LootEventKIll" event="script"><![CDATA[ domodlib('Loot_func') function onKill(cid, target, lastHit) if isPlayer(cid) and getPlayerStorageValue(cid, info.Storages[3]) <= 0 and isMonster(target) and not isInArray(info.BlockMonsters, getCreatureName(target):lower()) then addEvent(corpseRetireItems, 0, cid ,getThingPos(target)) end return true end]]></event> <talkaction words="!autoloot;/autoloot" event="buffer"><![CDATA[ domodlib('Loot_func') local param, slots = param:lower(), isPremium(cid) and info.Max_Slots.premium or info.Max_Slots.free if not param or param == "" then ShowItemsTabble(cid) return true elseif tonumber(param) then doPlayerSendCancel(cid, "enter commands: !autoloot item name [+] !autoloot clean [+] !autoloot money [+] !autoloot on/off") return true elseif isInArray({"clean","limpar", "clear"}, param) then setPlayerStorageValue(cid, info.Storages[1], -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] Your list has been cleaned.") return true elseif isInArray({"start","stop","on","off"}, param) then setPlayerStorageValue(cid, info.Storages[3], getPlayerStorageValue(cid, info.Storages[3]) <= 0 and 1 or 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] "..(getPlayerStorageValue(cid, info.Storages[3]) > 0 and "Stopped" or "Started")..".") return true elseif isInArray({"money","gold","gps","dinheiro"}, param) then setPlayerStorageValue(cid, info.Storages[2], getPlayerStorageValue(cid, info.Storages[2]) <= 0 and 1 or 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] Gold Colleting "..(getPlayerStorageValue(cid, info.Storages[2]) > 0 and "Activated" or "disabled")..".") return true end local item = getItemIdByName(param, false) if not item then doPlayerSendTextMessage(cid, MESSAGE_FIRST, "This item does not exist.") return true end local var = isInTable(cid, item) if isInArray({2148,2152,2160},item) then doPlayerSendTextMessage(cid, MESSAGE_FIRST, "Enter !autoloot money to add money in your list!") return true elseif isInArray(info.BlockItemsList, item) then doPlayerSendTextMessage(cid, MESSAGE_FIRST, "You can not add this item in the list!") return true elseif not var and #getPlayerStorageTable(cid, info.Storages[1]) >= slots then doPlayerSendTextMessage(cid, MESSAGE_FIRST, "max "..slots.." from auto loot") return true end if not var then addItemTable(cid, item) else removeItemTable(cid, item) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,not var and "you added the item "..param.." in the list" or "you removed the item "..param.." from the list") return true]]></talkaction> </mod> Lebrando, n testei haha
  2. @Zzyzx tenta assim o talk function onSay(cid, words, param) local var = "[Sell Point System] Este documento vale %s points para você usar no site." p = getPremiumPoints(cid) local min,max = 5, 100 if param == "" or not tonumber(param) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, use somente numeros.") return true elseif tonumber(param) < min or tonumber(param) > max then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, Minimo "..min.." e Maximo "..max.." points.") return true elseif p < tonumber(param) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você só possui "..p.." Premium Points.") return true end local item = doPlayerAddItem(cid, 7702,1) doItemSetAttribute(item, "description", var:format(tonumber(param))) setPremiumPoints(cid, p-tonumber(param)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Sell Point System] Você recebeu um paper com "..param.." Premium Points.") return true end
  3. Sem item ou pode ser com item?
  4. Eu particularmente não sei absolutamente nada sobre derivados kkk nem suas funções... Já o Vodka.. quem sabe, da a ideia que veremos
  5. Boa noite galera Bom, eu e o vodka estamos precisando de ideias para podermos fazer alguns sistemas e eventos para tibia(nao derivado), mas nós estamos sem nenhuma ideia, então venho aqui pedir a vocês do TK que nos ajudem HAHAHA Obrigado, e não esqueçam de dar ideias e.e
  6. Ta pedindo a mesma coisa q o seu script, só que agora vc configura pelo local player. E o que o login12 disse é verdade, se você colocar por exemplo, minimo 2 e maximo 10.. Entra 7 pessoas, o evento não vai balancear os times. O evento battlefield é um evento YxY, ou seja, os dois times possuem a mesma quantidade de players.
  7. @kiinho Desculpa, não sei se funciona, estou meio perdido com a função getCreatureOutfit(cid), mas tenta ai:
  8. Você pode alterar a quantidade maxima no config: max = X.. Mas também pode deixar assim: local z = { storage1 = 9091, -- storage axe axe = 1, -- quantidade de axe que vai aumentar idAxe = 21530, -- Id do Item que ao usar vai ganhar o mana } function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == z.idAxe then setCreatureMaxAxe(cid, getCreatureMaxAxe(cid)+z.axe) doCreatureAddAxe(cid, getCreatureMaxAxe(cid)) doRemoveItem(item.uid, 1) doPlayerSay(cid, "Parabens", TALKTYPE_ORANGE_1 end return true end
  9. Qual o item? Amuleto? Shield? Armor? Legs? Boots? Hat? Arrow? Bow? Wand? Weapon? Testa assim: movements/scripts/ new.lua local config = { itemid = 2660 -- id do item place = 4 -- local de onEquip, armor no caso outfit = {lookType = 30 , lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0} } function onEquip(cid, item, slot) if (getPlayerSlotItem(cid, config.place).itemid == config.itemid) then doSetCreatureOutfit(cid, config.outfit, -1) else doPlayerSendCancel(cid, "You cannot equip this item here.") return false end function onDeEquip(cid, item, slot) doRemoveCondition(cid, CONDITION_OUTFIT) return true end movements.xml <movevent type="Equip" itemid="2660" slot="armor" event="script" value="new.lua"/> <movevent type="DeEquip" itemid="2660" slot="armor" event="script" value="new.lua"/>
  10. Tenta mudando o max players pra 3
  11. Quanto voce colocou nessas duas linhas? timeToStartEvent = 30, -- segundos para começar o evento CheckTime = 5, -- tempo que o TP fica aberto para os jogadores adrentarem o evento
  12. @tirso Deixe essa linha <globalevent name="Zombie_Start" interval="60" event="script"> assim <globalevent name="Zombie_Start" interval="60000" event="script">
  13. Caso vc use sqlite, execute isso no SQLite Studio: CREATE TABLE z_ots_comunication ( id INTEGER( 11 ) PRIMARY KEY NOT NULL, name VARCHAR( 255 ) NOT NULL, type VARCHAR( 255 ) NOT NULL, [action] VARCHAR( 255 ) NOT NULL, param1 VARCHAR( 255 ) NOT NULL, param2 VARCHAR( 255 ) NOT NULL, param3 VARCHAR( 255 ) NOT NULL, param4 VARCHAR( 255 ) NOT NULL, param5 VARCHAR( 255 ) NOT NULL, param6 VARCHAR( 255 ) NOT NULL, param7 VARCHAR( 255 ) NOT NULL, delete_it INTEGER( 2 ) NOT NULL DEFAULT ( 1 ) ); Caso seja mysql, execute isso na db do phpmyadmin CREATE TABLE `z_ots_comunication` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `type` varchar(255) NOT NULL, `action` varchar(255) NOT NULL, `param1` varchar(255) NOT NULL, `param2` varchar(255) NOT NULL, `param3` varchar(255) NOT NULL, `param4` varchar(255) NOT NULL, `param5` varchar(255) NOT NULL, `param6` varchar(255) NOT NULL, `param7` varchar(255) NOT NULL, `delete_it` int(2) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  14. Tenta o que o cara disse, mas se quiser deixa a gente analisar também o script
  15. Vc precisa dar permissões pra sua pasta do gesior Executa no terminal ai: chmod -R 777 pasta do site
  16. manda a magia inteira, n é esse parte q faz a verificação
  17. function onSay(cid, words, param) local param = param.explode(param, ',') local item = param[2] if isPlayer(getPlayerByName(param[1])) and tonumber(param[2]) and tonumber(param[3]) then doPlayerSendTextMessage(getCreatureByName(param[1]), 22, "Você acabou de receber "..param[3].." "..getItemNameById(item).." do ADM!") doPlayerAddItem(getCreatureByName(param[1]), param[2], param[3]) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to use /giveitem Name,Itemid,Count.") end return TRUE end
  18. Não aparece nenhum erro?
  19. talkactions/scripts/giveitem.lua function onSay(cid, words, param) local param = param.explode(param, ',') if param then if isPlayer(getCreatureByName(param[1])) == TRUE then doPlayerSendTextMessage(getCreatureByName(param[1]), 22, "Você acabou de receber um item!") doPlayerAddItem(getCreatureByName(param[1]), param[2], param[3]) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") end return TRUE end talkaction.xml <talkaction log="yes" access="5" words="/giveitem" event="script" value="giveitem.lua"/> /giveitem PLAYER, ID ITEM, QUANTIA
  20. Sekk postou uma resposta no tópico em Suporte Tibia OTServer
    Isso não é um mod para clients é para o server. Abre a pasta do server, abre a pasta mods, crie um arquivo com qlqr nome.xml e cole o codigo dentro dele, pronto
  21. Sekk postou uma resposta no tópico em Suporte Tibia OTServer
    function onThink(interval, lastExecution, thinkInterval) doSaveServer() return true end acho q é isso
  22. Nao '-' se é na source só..
  23. Sekk postou uma resposta no tópico em Suporte Tibia OTServer
    Eu tentei transformar o zombie desse tópico q pedi ajuda em mod, mas deu um problema, o player tentava logar mas nao conseguia, e no tfs falava q ele logava e deslogava na msm hora... Q tipo de conflito pode dar? Pq dependendo, eu faço o mod
  24. Sekk postou uma resposta no tópico em Suporte Tibia OTServer
    O nome do monstro ta certo, tanto que spawna eles mas da o erro mesmo assim Cara, vc é foda '-' pqp eu ia pedir pra colocar tbm a configuração para quais dias e em quais horarios ligar o evento e vc ja colocou hauhauah timeToStartEvent = 30, -- segundos para começar o evento também é o tempo que demora pro spawn dos zombies? Tem como deixar os rewards com isso também: local goblet = doPlayerAddItem(cid, config.goblet, 1) doItemSetAttribute(goblet, "description", "Awarded to " .. getPlayerName(cid) .. " for winning the Zombie event.") ? Uma observação: Eu to usando um zombie event por talkaction /zombiestart X -- X é a quantidade de players pro evento /zombiestart force -- forçar o inicio msm q n tenha X players Eu tava querendo corrigir os erros desse zombie do tópico pra poder iniciar o evento tanto manualmente quanto automaticamente... Vc consegue fazer isso?
  25. Sekk postou uma resposta no tópico em Suporte Tibia OTServer
    @Vodkart up

Informação Importante

Confirmação de Termo