Ir para conteúdo

Vodkart

Héroi
  • Registro em

Tudo que Vodkart postou

  1. fiz rapidinho, vê se é isso que vc quer: MODS: Saffari.xml <?xml version="1.0" encoding="UTF-8"?> <mod name="Saffari" version="1.0" author="Vodkart" contact="tibiaking.com" enabled="yes"> <config name="saffari_func"><![CDATA[ config = { Price = 2000, Premium = false, Level = 50, Saffari_Pos = {Enter = {x=189,y=53,z=7}, Exit = {x=195,y=53,z=7}}, Time = 30, AddPokeballs = {11445,30}, Blocked_pokeballs = {2146, 2147, 11437, 11441}, Storages = {874547,874548}, levelandskills = false, loot = false } ]]></config> <event type="login" name="SaffariRegister" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "SaffariDeath") return true end]]></event> <talkaction words="/saffari;!saffari" event="buffer"><![CDATA[ domodlib('saffari_func') param = string.lower(param) if (param == "") then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"invalid command, for more information enter !saffari info") elseif(param == "info") then doShowTextDialog(cid,2160,"Saffari Info:\n\nLevel Minimum: "..config.Level.."\nSaffari Cost: "..config.Price.."\nTime Limit: "..config.Time.." minutes\n\nThe safari is home to rare creatures, some are dangerous and others not\n[*Warning*]\nis only allowed to enter with saffari balls.\n\nTo leave enter command:\n!saffari leave") elseif(param == "leave") then if getPlayerStorageValue(cid, config.Storages[1]) >= 1 then doTeleportThing(cid, config.Saffari_Pos.Exit) setPlayerStorageValue(cid, config.Storages[1], -1) setPlayerStorageValue(cid, config.Storages[2], -1) doPlayerSendTextMessage(cid,22,'you left the saffari zone.') else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"you are not in Saffari") end end return true ]]></talkaction> <globalevent name="SaffariCheck" interval="60" event="script"><![CDATA[ domodlib('saffari_func') function onThink(interval, lastExecution) local on = getPlayersOnline() if #on > 0 then for i = 1, #on do if getPlayerStorageValue(on[i], config.Storages[2]) <= os.time() and getPlayerStorageValue(on[i], config.Storages[1]) >= 1 then doTeleportThing(on[i], config.Saffari_Pos.Exit) setPlayerStorageValue(on[i], config.Storages[1], -1) setPlayerStorageValue(on[i], config.Storages[2], -1) doPlayerSendTextMessage(on[i],22,'you left the saffari zone.') end end end return true end ]]></globalevent> <event type="death" name="SaffariDeath" event="script"><![CDATA[ domodlib('saffari_func') function onDeath(cid, corpse, deathList) if isPlayer(cid) and getPlayerStorageValue(cid, config.Storages[1]) >= 1 then setPlayerStorageValue(cid, config.Storages[1], -1) setPlayerStorageValue(cid, config.Storages[2], -1) if config.loot == false then doCreatureSetDropLoot(cid, false) end if config.levelandskills == false then doPlayerSetLossSkill(cid, 0) end end return true end ]]></event> </mod> NPC/script SaffariNpc.lua domodlib('saffari_func') local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local msg = string.lower(msg) if isInArray({"saffari","enter","entrar"}, msg) then npcHandler:say('you can stay in the Saffari zone by '..config.Time..' minutes, the price is '..config.Price..' gp(s), You want enter? {yes}', cid) talkState[talkUser] = 1 elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then for i = 1, #config.Blocked_pokeballs do if getPlayerItemCount(cid, config.Blocked_pokeballs[i]) >= 1 then npcHandler:say('Keep your PokeBalls!', cid) return true end end if config.Premium == true and not isPremium(cid) then npcHandler:say('Sorry, you need to be premium!', cid) return true elseif getPlayerLevel(cid) < config.Level then npcHandler:say('Sorry, you must be at least level '..config.Level..' to enter the Saffari zone!', cid) return true elseif not doPlayerRemoveMoney(cid, config.Price) then npcHandler:say('Sorry, you do not have enough money!', cid) return true end doPlayerAddItem(cid, config.AddPokeballs[1], config.AddPokeballs[2]) selfSay("Thanks, you've been teleported to the Saffari zone and has "..config.Time.." minutes, if you want to leave enter {!saffari leave}.", cid) doTeleportThing(cid, config.Saffari_Pos.Enter) setPlayerStorageValue(cid, config.Storages[1], 1) setPlayerStorageValue(cid, config.Storages[2], os.time()+config.Time*60) elseif msg == "no" and talkState[talkUser] >= 1 then selfSay("tudo bem então.", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Saffari Hunter.xml <?xml version="1.0"?> <npc name="Saffari Hunter" script="data/npc/scripts/SaffariNpc.lua" walkinterval="50000" floorchange="0"> <health now="1000" max="1000"/> <look type="130" head="0" body="114" legs="114" feet="0" addons="0"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|. I can take you to {saffari} zone. {enter}"/> </parameters> </npc> ----------------------------- configurações config = { Price = 2000, -- qnto vai custar Premium = false, -- se precisa ser premium Level = 50, -- level minimo para entrar Saffari_Pos = {Enter = {x=189,y=53,z=7}, Exit = {x=195,y=53,z=7}}, -- pos da safari, e pos pra onde ele vai dps que acaba o tempo Time = 30, -- tempo maximo q ele pode ficar no saffari in minutes AddPokeballs = {11445,30}, -- id da saffari ball e quantidade Blocked_pokeballs = {2146, 2147, 11437, 11441}, -- pokeballs q ele n pode estar na bag Storages = {874547,874548}, -- n mexa levelandskills = false, -- se vai perder skills e exp ao morrer loot = false -- se vai perder loot ao morrer } comandos extra: !saffari info -- mostra em uma janela sobre o preço, lvl e o tempo que pode ficar lá !saffari leave -- faz com que o player saia da saffari zone
  2. yes, mas estou mto preguiçoso pra adicionar tds rsrsrs vou ver se faço, obrigado pela informação jhow
  3. é porque ele usou '' de vez de "" doItemSetAttribute(doPlayerAddItem(cid, 7369), "name", "trophy "..getCreatureName(cid).." completed all the task.")
  4. Ali na lib troca: function finisheAllTask(cid) local x = true for k, v in pairs(tasktabble) do if tonumber(getPlayerStorageValue(cid,v.storage)) then x = false end end if x == true then local b = getGlobalStorageValue(63004) if b == -1 then b = 1 end if b < 11 then setGlobalStorageValue(63004,b+1) doBroadcastMessage('[Task Mission Complete] '..getCreatureName(cid)..' was the '..b..'° to finish the task!.') doPlayerAddPremiumDays(cid, 10) doItemSetAttribute(doPlayerAddItem(cid, 7369), "name", "trophy of the 10 firsts finish all task") end end end por function finisheAllTask(cid) local reward = {{XXXX,YY},{XXXX,YY}} local x = true for k, v in pairs(tasktabble) do if tonumber(getPlayerStorageValue(cid,v.storage)) then x = false end end if x == true then doBroadcastMessage('[Task Mission Complete] '..getCreatureName(cid)..' finished the all task!.') doAddItemsFromList(cid,reward) doItemSetAttribute(doPlayerAddItem(cid, 7369), "name", "trophy of who completed all the task") end end XXXX -- É O ID DO ITEM YY -- É A QUANTIDADE DO ITEM QUE VAI RECEBER
  5. 2 - usando globalevents + storage ou colocas tiles espalhado pelo mapa para checar se já acabou as pokeball e teleportar 3 - usando onDeath + storage '-'
  6. Helton, evite double post, pois pode ser considerado flood. Use a ferramenta editar para editar suas mensagens! Obrigado
  7. Olá amigo, antes de postar algum script é necessário que teste, porque pode vir a não funcionar, e caso tenha alguma dúvida de como desenvolver seu script vá na área dúvidas de scripting para que possamos ajuda-lo.
  8. Obrigado por trazer o conteúdo, porém o código precisa ser aperfeiçoado, como por exemplo colocar um exausted e o principal, que é para teleportar só em zonas PZ.
  9. Vodkart postou uma resposta no tópico em Playground (Off-topic)
    Fala que aluno excelente n eh aquele que tira notas boas
  10. oloco ficaram fodas pra kct vo baixar pra da uma olhada aqui curti mtas ai '0' as potion msm mto perfeita
  11. Não, não tem problema nenhum xD
  12. ah não sabia que vc estava querendo tirar o sistema todo rsrs Que eu saiba esse sistema é feito por creaturescript (onLogin/onLogout) e é globalevents. Abre os arquivo creaturescript.xml e globalevents.xml e remova as linha que tem algo com "points" o sistema é esse se vc quiser dar uma olhada:
  13. 1° Abra o programa Sqlite 2° Selecione a database do seu server, o arquivo é esse ".s3db", por exemplo o "forgottenserver.s3db" 3° na parte superior do programa tem a aba "Tools",clica nela e seleciona "Open SQL query editor" ou (ALT + E) se preferir 4° Vai abrir uma janela branca,nela você coloca isso: ALTER TABLE `accounts` ADD `p_points` INTEGER NOT NULL DEFAULT 0 5° Depois clica no ícone do raio ali na parte de cima ou aperta o botão F9 que vai fazer com que a query seja executada.
  14. é da pra usar isInRange function onDeath(cid, corpse, deathList) from,to = {x=185, y=55, z=7}, {x=188, y=58, z=7} -- começo e final da arena if isPlayer(cid) and isInRange(getCreaturePosition(cid), from, to) then doCreatureSetDropLoot(cid, true) end return true end
  15. executa essa query na sua db: ALTER TABLE `accounts` ADD `p_points` INTEGER NOT NULL DEFAULT 0
  16. Vodkart postou uma resposta no tópico em Sistemas, Mods & Funções .lua
    a primeira é só para ficar salvo no banco de dados desse jeito: a segunda fica no arquivo.txt assim
  17. elseif msgcontains(msg, 'trade') >= 1 then lol? elseif msgcontains(msg, 'trade') then também não entendi muito bem a função '-', ela já não existia? esse tipo de script eu costumava fazer tal...
  18. Vodkart postou uma resposta no tópico em Sistemas, Mods & Funções .lua
    Obrigado por testar a 2° versão vlw
  19. Vodkart postou uma resposta no tópico em Sistemas, Mods & Funções .lua
    1° Versão é feita pelo Banco de dados: 2° Versão é salvo em um arquivo.txt em data/logs <?xml version="1.0" encoding="UTF-8"?> <mod name="Trade Log" version="1.0" author="Vodkart" contact="none.com" enabled="yes"> <config name="TradeLog_func"><![CDATA[ function natural(number) local n = number - math.floor(number) return n >= 0.5 and math.ceil(number) or math.floor(number) end function containerItemsToString(cont) local s = "" for _ = 0, getContainerSize(cont) - 1 do local item = getContainerItem(cont, _) s = s..",".. item.itemid if isContainer(item.uid) and getContainerSize(item.uid) > 0 then s = s..":1"..containerItemsToString(item.uid) else s = s..":".. natural(getItemWeight(item.uid)/getItemWeightById(item.itemid)) end end return s end ]]></config> <event type="login" name="TradeRegister" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "TradeLog") return true end]]></event> <event type="tradeaccept" name="TradeLog" event="script"><![CDATA[ domodlib('TradeLog_func') function onTradeAccept(cid, target, item, targetItem) if (not isPlayer(cid)) or (not isPlayer(target)) then return false end local items1,items2 = ""..item.itemid,""..targetItem.itemid items1 = isContainer(item.uid) and getContainerSize(item.uid) > 0 and items1..":1"..containerItemsToString(item.uid) or items1 ..":".. natural(getItemWeight(item.uid)/getItemWeightById(item.itemid)) items2 = isContainer(targetItem.uid) and getContainerSize(targetItem.uid) > 0 and items2 ..":1"..containerItemsToString(targetItem.uid) or items2 ..":".. natural(getItemWeight(targetItem.uid)/getItemWeightById(targetItem.itemid)) f = io.open("data/logs/Trades.txt", "a+") f:write("World: ".. getConfigValue("worldId") .." - "..getPlayerName(cid).." Traded: [".. items1 .."] for [".. items2 .."] With Player "..getPlayerName(target)..". At " .. os.date("%d %B %Y - %X.", os.time()) .."\n\n----------------------------------------------------------\n") f:close() return true end ]]></event> </mod>
  20. vou fazer um loop na área, manda posição x,y e z do começo e final da arena
  21. ai galera tinha um bug, já foi removido. vlw
  22. Automatic Raids.xml <?xml version="1.0" encoding="UTF-8"?> <mod name="Automatic Raids" version="1.0" author="Vodkart And xotservx" contact="tibiaking.com" enabled="yes"> <config name="raids_func"><![CDATA[ days = { ["Monday"] = { ["21:30"] = {nome = "Orshabaal", pos = {fromPosition = {x=184, y=55, z=7},toPosition = {x=188, y=58, z=7}},m = {"5 Fire Devil", "2 Orshabaal"}, Time = 15}, ["21:33"] = {nome = "Dragon", pos = {fromPosition = {x=197, y=57, z=7},toPosition = {x=203, y=60, z=7}},m = {"100 Dragon"}, Time = 20} }, ["Sunday"] = { ["10:08"] = {nome = "Demon", pos = {fromPosition = {x=202, y=11, z=7},toPosition = {x=204, y=12, z=7}}, m = {"1 Demon"}, Time = 15}, ["10:46"] = {nome = "Hydra", pos = {fromPosition = {x=197, y=57, z=7},toPosition = {x=203, y=60, z=7}}, m = {"7 Hydra", "4 Cyclops"}, Time = 20} } } ]]></config> <globalevent name="AutomaticRaids" interval="60" event="script"><![CDATA[ domodlib('raids_func') function onThink(interval, lastExecution) if days[os.date("%A")] then hours = tostring(os.date("%X")):sub(1, 5) tb = days[os.date("%A")][hours] if tb then function removeCreature(tb) for x = ((tb.pos.fromPosition.x)-10), ((tb.pos.toPosition.x)+10) do for y = ((tb.pos.fromPosition.y)-10), ((tb.pos.toPosition.y)+10) do local m = getTopCreature({x=x, y=y, z= tb.pos.fromPosition.z}).uid if m ~= 0 and isMonster(m) then doRemoveCreature(m) end end end end doBroadcastMessage("The invasion of " .. tb.nome .. " started") for _,x in pairs(tb.m) do for s = 1, tonumber(x:match("%d+")) do pos = {x = math.random(tb.pos.fromPosition.x, tb.pos.toPosition.x), y = math.random(tb.pos.fromPosition.y, tb.pos.toPosition.y), z = tb.pos.fromPosition.z} doSummonCreature(x:match("%s(.+)"), pos) end end addEvent(removeCreature, tb.Time*60*1000, tb) end end return true end ]]></globalevent> </mod> Configuração: days = { ["Monday"] = { ["21:30"] = {nome = "Orshabaal", pos = {fromPosition = {x=184, y=55, z=7},toPosition = {x=188, y=58, z=7}},m = {"5 Fire Devil", "2 Orshabaal"}, Time = 1}, ["21:33"] = {nome = "Dragon", pos = {fromPosition = {x=197, y=57, z=7},toPosition = {x=203, y=60, z=7}},m = {"100 Dragon"}, Time = 2} }, ["Tuesday"] = { ["10:44"] = {nome = "Demon", pos = {fromPosition = {x=184, y=55, z=7},toPosition = {x=188, y=58, z=7}}, m = {"5 Demon", "8 Fire Devil"}, Time = 1}, ["10:46"] = {nome = "Hydra", pos = {fromPosition = {x=197, y=57, z=7},toPosition = {x=203, y=60, z=7}}, m = {"7 Hydra", "4 Cyclops"}, Time = 2} } } ["DIA"] = { ["HORA DA INVASÃO"] = {nome = "NOME DA INVASÃO", pos = {começo e final da área}, monster = {"MONSTROS"}, Time = para remover os monstro} } O dia da invasão é colocada entre " " e somente dia em inglês e a primeira letra maiúscula, exemplo: "Saturday" Depois são as hora da invasão, que é colocada entre " " e somente a hora e minuto, segundos não precisa exemplo: "15:00" As Posições estão entre { } adicionando as posições x, y e z, é o começo e final da área exemplo: pos = {fromPosition = {x=197, y=57, z=7},toPosition = {x=203, y=60, z=7}} fromPosition -- começo da área onde vai acontecer a raid toPosition -- final da área onde vai acontecer a raid Os monters tem um modo especial de configurar, vc coloca entre { }, e cada monstro entre " ", e entre as " " vc adiciona "QUANTIDADE MONSTRO", e para adicionar mais tipos de monstro se separa por virgulas, exemplo: {"40 Water Elemental", "5 Cyclops"} Time é uma função extra, é para caso ninguém participe do evento os monstros não fiquem pelo mapa, e é em minutos, exemplo: Time = 15
  23. coloca na tag access="5" e pronto
  24. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    eu testei aqui e não ocorreu esse erro comigo
  25. no seu tem um bug, se o jogador deslogar durante a ação irá dar erros no distro function onUse(cid, item, frompos, item2, topos) function doPlayerEffect(cid, delay) if not isCreature(cid) then return LUA_ERROR end doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA) if delay ~= 1 then addEvent(doPlayerEffect, 1000, cid, delay -1) end return nil end doPlayerEffect(cid, 60) doRemoveItem(item.uid, 1) return true end doPlayerEffect(cid, 60) por quantos segundos irá ficar soltando o efeito, deixei 60

Informação Importante

Confirmação de Termo