Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''sistema''.



Mais opções de pesquisa

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • A Cidade OTBR
    • OTServ Brasil
    • Atendimento
    • Taverna
  • Projetos Open Source
    • Canary
    • OTServBR-Global
    • Mehah OTClient
    • MyAAC
  • OpenTibia
    • Notícias e Discussões
    • Suporte - Dúvidas, Bugs, Erros
    • Downloads
    • Tutoriais
    • Show-Off
  • Outros
    • Design

Encontrado 22 registros

  1. Base: Global 12.51 tfs 1.3 Qual é a sua pergunta? Olá bom dia, se alguém puder me ajudar ficaria muito grato! Porfavor alguém consegue disponibilizar um script de npc que altere PvP do player? Vou explicar, a pessoa cria o char e já chega sendo npvp, portanto na cidade terá um npc em que ele possa se alterar pra pvp, gostaria que o player que não tivesse PvP ficasse com a caveirinha verde do lado do char e o PvP fica normal (podendo pegar caveirinha branca, red, black. Também gostaria se for possível adicionar tempo para pode trocar novamente, tipo 24 horas. Se alguém puder uma luz porfavor, desde já agradeço. Server global 12.51 tfs 1.3 Você tem o código disponível? Se tiver poste-o na caixa de código que está dentro do spoiler abaixo: Você tem alguma imagem que possa auxiliar no problema? Se sim, anexe-a dentro do spoiler abaixo:
  2. Antes de fazer a sua pergunta, tenha certeza de ter lido as regras da seção e o guia abaixo: https://forums.otserv.com.br/index.php?/forums/topic/168583-regras-da-seção/ https://forums.otserv.com.br/index.php?/forums/topic/165121-como-fazer-uma-pergunta-ou-o-grande-guia-do-usuário-com-dúvidas/ Descreva em algumas palavras a base utilizada. (Nome do servidor / Nome do cliente / Nome do website / etc.). Ex: The Forgotten Server 1.3, Versão: 10.98. Base: Uso The Forgotten Server 1.3, Versão: 10.98. Qual é a sua pergunta? Coloquei o sistema Slot em Equips do MOCK, mas deu uns erros. Primeiro deu erro quando ligo o server. E segundo deu erro quando eu tento usar o item para dar o slot (mesmo com o primeiro erro, tentei ver se funcionada) O codigo usado é o MESMO que ele colocou no post Slot em Equips, não mudei nada. Você tem o código disponível? Se tiver poste-o na caixa de código que está dentro do spoiler abaixo: Você tem alguma imagem que possa auxiliar no problema? Se sim, anexe-a dentro do spoiler abaixo:
  3. [System] Trade Points

    #Introdução Reparei que muitas pessoas estão atrás desse sistema que o DBOBR & NTOBR usa, e atualmente o VitorSubhi postou um, porém é necessário modificar as sources. Apesar de achar o dele bem melhor, estarei deixando este meu sistema(não é necessário mexer nas sources). #Funcionamente O jogador vai até um NPC e compra um papel, após ter comprado ele pode estar dando trade nesse papel e negociando com algum jogador, em troca de qualquer item. Ao finalizar a negociação, os points são transferidos/removidos(caso houver points na conta). Também é possivel comprar o papel por comando, estarei disponibilizando ambos para vocês. #Alguns prints: Estarei deixando o script para vocês em inglês, modifique como quiser ;D Então vamos lá... #Instalação Em data/lib crie um arquivo chamado tradepoints.lua cole isto dentro: Em data/creaturescript/tradepoints.lua: <event type="tradeaccept" name="Trade_Points" event="script" value="tradepoints.lua"/> <event type="traderequest" name="Trade_Points_Request" event="script" value="tradepoints.lua"/> login.lua: registerCreatureEvent(cid, "Trade_Points") registerCreatureEvent(cid, "Trade_Points_Request") NPC XML: <?xml version="1.0" encoding="UTF-8"?> <npc name="Frodo" script="data/npc/scripts/trade_points.lua" walkinterval="2000" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="275" head="114" body="113" legs="113" feet="113" corpse="2212"/> <parameters> <parameter key="module_shop" value="1" /> <parameter key="message_greet" value="Hello |PLAYERNAME|. I sell some utensils and Premium Points Transfer for you to transfer points to other players, remember to buy use '10' to 10 points." /> </parameters> </npc> Data/npc/scripts/trade_points.lua: Caso queira que a compra do papel seja feita por talkactions, aqui está: TAG: <talkaction words="!sellpoints;/sellpoints" event="script" value="trade_points.lua"/> Prontinho xD
  4. Scripting Quest

    Então, Olá. Estou com um projeto em desenvolvimento. Queria pedir uma ajuda se alguem disponibilizava. Eu tava atras, de um script que ja vi que funciona da seguinte forma. Existe um mob em tal local e apos matar ele, ele sumona um Teleport, assim levando para tal local. Queria fazer isso de exemplo para esta sala. Aonde esta o circulo estranho que tentei fazer, seria o mob, e aonde ta o cinal de V seria um local de exemplo do Teleport, e aonde ta o X seria o local de teleport.!
  5. Scripting Sistema de pet

    Olá galera, Vi uns link de Pet-sistem do Junior la no Otlan... Sabe, "NÃO SEI SE EU POSSO FALAR NOME" Mais tipo eu n entendi aonde instalar os Scrypt podia me ajudar?...
  6. Sistema Cleaner NPC

    Olá pessoas. Tenho aqui um sistema de NPC que limpa o chão. Simples. Fiz um update nele e agora o sistema automaticamente cria o arquivo do NPC para você. Scripts: data/lib/cleaner_npc_lib.lua: data/talkactions/scripts/cleaner_npc.lua: data/talkactions/talkactions.xml: <talkaction log="yes" access="5" words="/cleaner" script="cleaner_npc.lua"/> Configurações: Comandos: /cleaner create -- Cria o NPC /cleaner remove -- Remove o NPC Bom uso, até.
  7. Sistema Character's Market System

    Olá. Trouxe para vocês meu sistema de compra e venda de personagens ingame através de talkactions. Scripts: data/talkactions/talkactions.xml: <talkaction words="!character" script="char_market.lua"/> data/talkactions/scripts/char_market.lua: data/lib/characters_market_lib.lua: data/creaturescripts/creaturescripts.xml: <event type="login" name="MarketLogin" script="characters_market.lua"/> data/creaturescripts/characters_market.lua: Configure aqui: CHAR_MARKET_LEVEL = 30 -- Level mínimo que o character deve ter para ser vendido CHAR_MARKET_MIN_PRICE = 100 -- Preço mínimo de um character CHAR_MARKET_MAX_PRICE = 1000000 -- Preço máximo de um character Comandos: !character - Parâmetros: - buy nome -- Compra o personagem - sell nome -- Coloca o personagem à venda - remove nome -- Remove o personagem da lista de vendas - list -- Vê a lista de personagens disponíveis para compra Observações: - O script era um MOD, eu o alterei para sistema pouco antes de postar. Então, caso dê conflitos, seja qual for o motivo, reporte no tópico; - Algumas variáveis foram alteradas, então posso ter esquecido de mudar alguma no script; - Em algumas versões de TFS, o comando !character list dá erro. A razão é desconhecida. Caso tenha alguma solução, poste aqui no tópico para que o erro seja corrigido; - Eu sei que o script tem coisas que poderiam ser alteradas para deixá-lo mais "limpo", mas na época que escrevi o código eu ainda estava começando a fazer sistemas um pouco mais complexos. Até mais, bom uso.
  8. Email System v1.3.9

    -- Name: E-mail System -- Version: 1.3.9 -- Credits: Conde2 -- Tested: TFS 0.3.4(5) Crying Damson _________________________ Sobre: Este é um simples sistema de e-mails, que te possibilita mandar mensagens para todos os players, ate os offiline. Necessário criar uma pasta chama "email" dentro da pasta DATA OBS: NECESSITA DA LIB EXHAUSTION DO TFS !! Comandos: Código: Agora vamos ao que interessa... Abra a pasta data/talkactions/script e adicione isso em um arquivo lua chamado email.lua. Dentro desse arquivo adicione esse Script: EMAIL_BLOCK = 6364 EMAIL_ANTI_SPAWN = 15 EMAIL_MIN_MENSSAGE = 10 EMAIL_MAX_MENSSAGE = 100 EMAIL_STORAGE_ANTI_SPAWN = 6365 function onSay(cid, words, param) if words == "!sendemail" then if(param == "") then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param. Please use: !sendemail name, menssage") return TRUE end local t = string.explode(param, ",") if(not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "No menssage specified.") return TRUE end if (getPlayerGUIDByName(t[1]) == 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not exist.") return TRUE end if (string.len(t[2]) <= EMAIL_MIN_MENSSAGE) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't send this menssage, because so short.") return TRUE end if (string.len(t[2]) > EMAIL_MAX_MENSSAGE) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't send this menssage, because so long.") return TRUE end local id = getPlayerIdByName(""..t[1].."") if (getDataBaseStorage(id,EMAIL_BLOCK) == 1) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, the player: " .. t[1] .. " has been blocked yours menssages.") return TRUE end if exhaustion.check(cid, EMAIL_STORAGE_ANTI_SPAWN) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Please wait a ".. exhaustion.get(cid, EMAIL_STORAGE_ANTI_SPAWN) .." secondes to send other email.") return TRUE end local directory = "data//email//".. t[1] ..".txt" if onFile("exist", directory) == FALSE then onFile("create", directory, "BY: ".. getCreatureName(cid) .." [" .. os.date("%d/%m/%Y %H:%M:%S") .. "] ".. t[2] .."\n") doPlayerSendTextMessage(cid, 22, "You have send to ".. t[1] .." this menssage: " .. t[2] .. ".") exhaustion.make(cid, EMAIL_STORAGE_ANTI_SPAWN, EMAIL_ANTI_SPAWN) else onFile("update", directory, "BY: ".. getCreatureName(cid) .." [" .. os.date("%d/%m/%Y %H:%M:%S") .. "] ".. t[2] .."") doPlayerSendTextMessage(cid, 22, "You have send to ".. t[1] .." this menssage: " .. t[2] .. "") exhaustion.make(cid, EMAIL_STORAGE_ANTI_SPAWN, EMAIL_ANTI_SPAWN) end local target = getPlayerByNameWildcard(""..t[1].."") if(target == 0) then target = getCreatureByName(""..t[1].."") if(target == 0) then return TRUE end end local tmp = getCreaturePosition(target) if (isOnline(""..t[1].."") == TRUE) then addEvent(doSendAnimatedText, 1, tmp, "Menssage!", TEXTCOLOR_PURPLE) addEvent(doSendAnimatedText, 1000, tmp, "Menssage!", TEXTCOLOR_PURPLE) addEvent(doSendAnimatedText, 2000, tmp, "Menssage!", TEXTCOLOR_PURPLE) doPlayerSendTextMessage(target, 19, " A new menssage arrived, look your email box. (!checkemail)!!") end elseif words == "!checkemail" then local name = getCreatureName(cid) local directory = "data//email//".. name ..".txt" if onFile("exist", directory) == FALSE or onFile("load", directory) == nil then doPlayerSendTextMessage(cid, 22, "Sorry you don't have any menssage.") else for line in io.lines(directory) do doShowTextDialog(cid,7528, "You have menssages: \n \n ".. line .." \n \n \n For look the next menssage click in the button: OK") end end elseif words == "!deleteemail" then local name = getCreatureName(cid) local directory = "data//email//".. name ..".txt" if onFile("exist", directory) == TRUE and onFile("load", directory) ~= nil then onFile("delete", directory) onFile("erase", directory) doPlayerSendTextMessage(cid, 22, "Sucessful!! You have deleted all yours menssages !!") else doPlayerSendTextMessage(cid, 22, "Sorry you don't have any menssage to delete.") end elseif words == "!blockemail" then setPlayerStorageValue(cid, EMAIL_BLOCK, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You has been bloked your e-mail. Please relog to make effect.") elseif words == "!unblockemail" then setPlayerStorageValue(cid, EMAIL_BLOCK, 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You has been unbloked your e-mail. Please relog to make effect.") end end Agora vá em data/global.lua Ou em data/lib/data.lua e adicione isso na última linha: function isOnline(name) -- by mock local players = getOnlinePlayers() name = string.lower(name) for i, player in ipairs(players) do player = string.lower(player) if name == player then return TRUE end end return FALSE end function getDataBaseStorage(pid,value_id) -- by Conde2 local coisa = db.getResult("SELECT * FROM `player_storage` WHERE `player_id` = ".. pid .." AND `key` ="..value_id..";") if coisa:getID() == -1 then return -1 else return coisa:getDataInt("value") end end function onFile(type, directory, content) -- by Conde2 local master = 0 if type == "create" then local file = io.open(directory, "w") master = file:write(content) file:close() elseif type == "erase" then local file = io.open(directory, "w+") master = file:write("") file:close() elseif type == "load" then local file = io.open(directory,"r") master = file:read() file:close() elseif type == "update" then local file = io.open(directory, "a+") master = file:write(content.."\n") file:close() elseif type == "return" then local file = io.open(directory, "a+") master = file:write(" "..content) file:close() elseif type == "delete" then os.remove(directory) elseif type == "exist" then file = io.open(directory) if file == nil then master = FALSE else master = TRUE end end return master end Tags: E finalmente vá para data/talkactions/talkactions.xml Abra ele com um bloco de notas e adicione isso: <talkaction words="!sendemail" event="script" value="email.lua"/> <talkaction words="!deleteemail" event="script" value="email.lua"/> <talkaction words="!checkemail" event="script" value="email.lua"/> <talkaction words="!blockemail" event="script" value="email.lua"/> <talkaction words="!unblockemail" event="script" value="email.lua"/> Configurando: Para configurar basta ir em data/talkactions/email.lua e editar isso: EMAIL_BLOCK = 6364 EMAIL_ANTI_SPAWN = 15 EMAIL_MIN_MENSSAGE = 10 EMAIL_MAX_MENSSAGE = 100 EMAIL_STORAGE_ANTI_SPAWN = 6365 # Storage value para bloquear / desbloquear o email. # O tempo que o player terá que esperar para mandar outra mensagem (Em segundos) # Quantas letras no mínimo a mensagem tem que ter para poder ser enviada. # Quantas letras no máximo deverá ter a menssagem. # Storage para definir o exausted !! NÃO AUTORIZO A POSTAGEM DESSE SCRIPT EM QUALQUER OUTRO FÓRUM SEM MINHA AUTORIZAÇÃO
  9. Order System (Pokemon)

    Informações sobre o script: • Nome: Sistema de Order (controlar o pokemon), composto por uma biblioteca e uma action. • Autor: mastercraft • Versão do Tibia/Server: Testado em TFS 0.36pl1 (Tibia 8.54). Acredito que o melhor sistema de order que tenha aparecido na net foi o meu, enfim, eu melhorei o sistema de ordenar o pokemon andar até tal lugar. Antes era bem limitado, agora o sistema ficou bem parecido com aquele do SvkE, feito apenas em lua. Primeiramente, crie um arquivo chamado move.lua na pasta data/lib. Se você usa a mesma lib, mas a da versão do pokemon dash, substitua, pois esta é atualizada. Coloque isso dentro do arquivo: function doPushCreature(uid,direction,distance,time) if isCreature(uid) == TRUE then local rand = (2*math.random(0,1))-1 local rand2 = math.random(-1,0) if direction == 0 then signal = {0,rand,-rand,rand,-rand,0,-1,-1,-1,0,0,0} elseif direction == 1 then signal = {1,1,1,0,0,0,0,rand,-rand,rand,-rand,0} elseif direction == 2 then signal = {0,rand,-rand,rand,-rand,0,1,1,1,0,0,0} elseif direction == 3 then signal = {-1,-1,-1,0,0,0,0,rand,-rand,rand,-rand,0} elseif direction == 4 then signal = {-1,rand2,(-rand2)-1,0,1,rand2+1,rand2,0} elseif direction == 5 then signal = {1,-rand2,-((-rand2)-1),0,1,rand2+1,rand2,0} elseif direction == 6 then signal = {-1,rand2,(-rand2)-1,0,-1,(-rand2)-1,rand2,0} else signal = {1,-rand2,-((-rand2)-1),0,-1,(-rand2)-1,rand2,0} end local pos = getThingPos(uid) nsig = #signal nvar = 0 repeat nvar = nvar+1 newpos = {x=pos.x+(signal[nvar]),y=pos.y+(signal[(nsig/2)+nvar]),z=pos.z} newtile = {x=newpos.x,y=newpos.y,z=newpos.z,stackpos=0} until getTileThingByPos(newtile).uid ~= 0 and hasProperty(getTileThingByPos(newtile).uid,3) == FALSE and queryTileAddThing(uid,newpos) == 1 or nvar == (nsig/2) if distance == nil or distance == 1 then doTeleportThing(uid,newpos,TRUE) else distance = distance-1 doTeleportThing(uid,newpos,TRUE) if time ~= nil then addEvent(doPushCreature,time,uid,direction,distance,time) else addEvent(doPushCreature,500,uid,direction,distance ,500) end end end end function walkTo(cid, direction, finalpos) if not isCreature(cid) then return false end if isWalkable(getPosByDir(getThingPos(cid), direction), cid, 0, 0) and direction <= 3 then doPushCreature(cid, direction, 1, 0) return true end if direction >= 4 then if direction == 4 then if math.random(1,2) == 1 then if isWalkable(getPosByDir(getThingPos(cid), 3), cid, 0, 0) then newdir = 3 else newdir = 2 end else if isWalkable(getPosByDir(getThingPos(cid), 2), cid, 0, 0) then newdir = 2 else newdir = 3 end end elseif direction == 5 then if math.random(1,2) == 1 then if isWalkable(getPosByDir(getThingPos(cid), 2), cid, 0, 0) then newdir = 2 else newdir = 1 end else if isWalkable(getPosByDir(getThingPos(cid), 1), cid, 0, 0) then newdir = 1 else newdir = 2 end end elseif direction == 6 then if math.random(1,2) == 1 then if isWalkable(getPosByDir(getThingPos(cid), 0), cid, 0, 0) then newdir = 0 else newdir = 3 end else if isWalkable(getPosByDir(getThingPos(cid), 3), cid, 0, 0) then newdir = 3 else newdir = 0 end end elseif direction == 7 then if math.random(1,2) == 1 then if isWalkable(getPosByDir(getThingPos(cid), 1), cid, 0, 0) then newdir = 1 else newdir = 0 end else if isWalkable(getPosByDir(getThingPos(cid), 0), cid, 0, 0) then newdir = 0 else newdir = 1 end end end doPushCreature(cid, newdir, 1, 0) return true end if direction <= 3 and not isWalkable(getPosByDir(getThingPos(cid), direction), cid, 0, 0) then if direction == 0 then if getDirectionTo(getThingPos(cid), finalpos) == 6 then if isWalkable(getPosByDir(getThingPos(cid), 3), cid, 0, 0) then newdir = 3 else newdir = 6 end elseif getDirectionTo(getThingPos(cid), finalpos) == 7 then if isWalkable(getPosByDir(getThingPos(cid), 1), cid, 0, 0) then newdir = 1 else newdir = 7 end end elseif direction == 1 then if getDirectionTo(getThingPos(cid), finalpos) == 7 then if isWalkable(getPosByDir(getThingPos(cid), 0), cid, 0, 0) then newdir = 0 else newdir = 7 end elseif getDirectionTo(getThingPos(cid), finalpos) == 5 then if isWalkable(getPosByDir(getThingPos(cid), 2), cid, 0, 0) then newdir = 2 else newdir = 5 end end elseif direction == 2 then if getDirectionTo(getThingPos(cid), finalpos) == 4 then if isWalkable(getPosByDir(getThingPos(cid), 3), cid, 0, 0) then newdir = 3 else newdir = 4 end elseif getDirectionTo(getThingPos(cid), finalpos) == 5 then if isWalkable(getPosByDir(getThingPos(cid), 1), cid, 0, 0) then newdir = 1 else newdir = 5 end end elseif direction == 3 then if getDirectionTo(getThingPos(cid), finalpos) == 4 then if isWalkable(getPosByDir(getThingPos(cid), 2), cid, 0, 0) then newdir = 2 else newdir = 4 end elseif getDirectionTo(getThingPos(cid), finalpos) == 6 then if isWalkable(getPosByDir(getThingPos(cid), 0), cid, 0, 0) then newdir = 0 else newdir = 6 end end end doPushCreature(cid, newdir, 1, 0) return true end doPushCreature(cid, direction, 1, 0) end function markPos(sid, pos) if not isCreature(sid) then return end setPlayerStorageValue(sid, 145, pos.x) setPlayerStorageValue(sid, 146, pos.y) setPlayerStorageValue(sid, 147, pos.z) end function getMarkedPos(sid) if not isCreature(sid) then return end local xx = getPlayerStorageValue(sid, 145) local yy = getPlayerStorageValue(sid, 146) local zz = getPlayerStorageValue(sid, 147) return {x = xx, y = yy, z = zz} end function getOwnerPos(sid) if not isCreature(sid) then return end local xx = getPlayerStorageValue(sid, 148) local yy = getPlayerStorageValue(sid, 149) local zz = getPlayerStorageValue(sid, 150) return {x = xx, y = yy, z = zz} end function markOwnerPos(sid, pos) if not isCreature(sid) then return end setPlayerStorageValue(sid, 148, pos.x) setPlayerStorageValue(sid, 149, pos.y) setPlayerStorageValue(sid, 150, pos.z) end function recheck(sid) if not isCreature(sid) then return end if getOwnerPos(sid).x ~= getThingPos(getCreatureMaster(sid)).x or getOwnerPos(sid).y ~= getThingPos(getCreatureMaster(sid)).y then doChangeSpeed(sid, -getCreatureSpeed(sid)) doChangeSpeed(sid, getCreatureBaseSpeed(sid)) return true end addEvent(recheck, 120, sid) end function goThere(sid, thepos) if not isCreature(sid) then return true end if thepos.x ~= getMarkedPos(sid).x or thepos.y ~= getMarkedPos(sid).y then return true end if isCreature(getCreatureTarget(getCreatureMaster(sid ))) then doChangeSpeed(sid, -getCreatureSpeed(sid)) doChangeSpeed(sid, getCreatureBaseSpeed(sid)) return true end if getThingPos(sid).x == getMarkedPos(sid).x and getThingPos(sid).y == getMarkedPos(sid).y then addEvent(recheck, 350, sid) return true end if getOwnerPos(sid).x ~= getThingPos(getCreatureMaster(sid)).x or getOwnerPos(sid).y ~= getThingPos(getCreatureMaster(sid)).y then doChangeSpeed(sid, -getCreatureSpeed(sid)) doChangeSpeed(sid, getCreatureBaseSpeed(sid)) return true end doChangeSpeed(sid, - getCreatureSpeed(sid)) doChangeSpeed(sid, getCreatureBaseSpeed(sid)) walkTo(sid, getDirectionTo(getThingPos(sid), getMarkedPos(sid)), getMarkedPos(sid)) doChangeSpeed(sid, - getCreatureSpeed(sid)) addEvent(goThere, 1000 - (2.2 * (getCreatureBaseSpeed(sid))), sid, getMarkedPos(sid)) end Agora, você precisa de um item que seja Useable, ou seja, ao apertar o botão direito, você tem a opção use with... A tag você deve colocar no actions.xml (data/actions): <action itemid="[b][color=red]xxxx[/color][/b]" event="script" value="move.lua" allowfaruse="1"/> sendo xxxx o id do item que você quer ter como o "order". Agora você cria uma arquivo chamado move.lua em data/actions/scripts, e coloque isso dentro: function onUse(cid, item, frompos, item2, topos) if getPlayerItemCount(cid, item2.itemid) >= 1 then return false end if #getCreatureSummons(cid) == 0 then return true end doPlayerSay(cid, ""..getCreatureName(getCreatureSummons(cid)[1])..", go there!", 1) doChangeSpeed(getCreatureSummons(cid)[1], -getCreatureSpeed(getCreatureSummons(cid)[1])) markPos(getCreatureSummons(cid)[1], topos) markOwnerPos(getCreatureSummons(cid)[1], getThingPos(cid)) addEvent(goThere, 500, getCreatureSummons(cid)[1], topos) return true end Para quem usa o sistema de order do pokemon dash, substitua o arquivo order.lua por este: local nao = {'4820', '4821', '4822', '4823', '4824', '4825', '1395', '1389', '1391', '1393', '460'} local direction = {'4', '5', '6', '7'}[/color] [color=royalblue] -- ridefly local ridefly = {'Crystal Onix', 'Venusaur', 'Ninetales', 'Arcanine', 'Ponyta', 'Rapidash', 'Doduo', 'Dodrio', 'Onix', 'Rhyhorn', 'Tauros', 'Porygon', 'Aerodactyl', 'Dragonite', 'Charizard', 'Pidgeot', 'Fearow', 'Moltres', 'Zapdos', 'Articuno', 'Mew', 'Mewtwo'} local ride = {'Crystal Onix', 'Venusaur', 'Ninetales', 'Arcanine', 'Ponyta', 'Rapidash', 'Doduo', 'Dodrio', 'Onix', 'Rhyhorn', 'Tauros'} local fly = {'Porygon', 'Aerodactyl', 'Dragonite', 'Charizard', 'Pidgeot', 'Fearow', 'Zapdos', 'Moltres', 'Articuno', 'Mew', 'Mewtwo'} local flys = { [265] = {229, 2300, 350}, -- moltres [283] = {230, 2100, 350}, -- artic [199] = {224, 2600, 350}, -- zapdos [9] = {232, 2200, 525}, -- 1000 [34] = {233, 2200, 525},-- two [210] = {221, 1300, 410},-- nite [80] = {222, 900, 375}, -- geot [17] = {226, 800, 400}, -- fearow [10] = {227, 1100, 410}, -- aero [67] = {216, 1000, 410}, -- chari [97] = {316, 600, 440}, -- porygon } local rides = {[/color] [color=royalblue] [93] = {128, 780, 400}, -- tauros [114] = {129, 800, 375}, -- kyuubi [220] = {130, 800, 395}, -- rapid [16] = {131, 410, 500}, -- ponyta [77] = {132, 400, 510}, -- rhyhorn [88] = {12, 900, 390}, -- arcan [493] = {492, 1000, 360}, -- shiny arca [496] = {494, 420, 420}, -- shiny vneu [292] = {293, 480, 430}, -- cristal onix [248] = {126, 450, 450}, -- onix [22] = {134, 390, 450}, -- venu [120] = {133, 750, 380}, -- dodrio [26] = {135, 420, 500}, -- doduo } local bolas = {'2222', '2223', '2224'} local ultra = {'2220', '2221', '2227'} local etudao = 9506 local mind = 9507[/color] [color=royalblue] -- ROCK SMASH[/color] [color=royalblue] local rocksmash = {'Sandshrew', 'Sandslash', 'Diglett', 'Dugtrio', 'Primeape', 'Machop', 'Machoke', 'Machamp', 'Geodude', 'Graveler', 'Golem' , 'Onix', 'Cubone', 'Marowak', 'Rhyhorn', 'Rhydon', 'Kangaskhan', 'Tauros', 'Snorlax', 'Poliwrath'} local erockmash = 9502 local cdrocksmash = 5 -- ROCK SMASH -- DIG[/color] [color=royalblue] local digholes = {'468', '481', '483'} local dig = {'Raticate', 'Sandshrew', 'Sandslash', 'Diglett', 'Dugtrio', 'Primeape', 'Machop', 'Machoke', 'Machamp', 'Geodude', 'Graveler', 'Golem' , 'Onix', 'Cubone', 'Marowak', 'Rhyhorn', 'Rhydon', 'Kangaskhan', 'Tauros', 'Snorlax'} local edig = 9504 local cddig = 5 -- DIG -- CUT[/color] [color=royalblue] local cut = {'Raticate', 'Bulbasaur', 'Ivysaur', 'Venusaur', 'Charmeleon', 'Sandshrew', 'Sandslash', 'Gloom', 'Vileplume', 'Paras', 'Parasect', 'Meowth', 'Persian', 'Bellsprout', 'Weepinbell', 'Victreebel', 'Farfetchd', 'Krabby', 'Kingler', 'Exeggutor', 'Cubone', 'Marowak', 'Tangela', 'Scyther', 'Pinsir'} local ecut = 9503 local cdcut = 5 -- CUT -- BLINK[/color] [color=royalblue] local blink = {'Abra', 'Kadabra', 'Alakazam', 'Porygon'} local exhaustblink = 9501 local cdblink = 50 -- BLINK -- LIGHT[/color] [color=royalblue] local light = {'Abra', 'Kadabra', 'Alakazam', 'Magnemite', 'Magneton', 'Drowzee', 'Hypno', 'Voltorb', 'Electrode', 'Mrmime', 'Electabuzz', 'Jolteon', 'Porygon', 'Pikachu', 'Raichu'} local exhautStorage = 9500 local time = 600 local cd = 17 -- LIGHT -- CONTROL[/color] [color=royalblue] function onUse(cid, item, frompos, item2, topos) if getPlayerItemCount(cid, item2.itemid) >= 1 then return false end if exhaustion.get(cid, etudao) then doPlayerSendCancel(cid, "Please wait a few seconds before using order again!") return true end if isMonster(item2.uid) and item2.uid ~= getCreatureSummons(cid)[1] and item2.uid ~= cid then if #getCreatureSummons(cid) == 0 then doPlayerSendCancel(cid, "You need a pokemon to use order.") return true end if exhaustion.get(cid, mind) then doPlayerSendCancel(cid, "Your pokemon is too exhausted from the last control, this ability has 2 minutes cooldown.") return true end if isPlayer(getCreatureMaster(item2.uid)) then doPlayerSendCancel(cid, "You cant control the mind of someone's else pokemon.") return true end if not isInArray({"Alakazam", "Tentacruel", "Gengar"}, getCreatureName(getCreatureSummons(cid)[1])) then doPlayerSendCancel(cid, "This pokemon cant control minds.") return true end exhaustion.set(cid, mind, 240) doCreatureSay(getCreatureSummons(cid)[1], "CONTROL MIND!", TALKTYPE_MONSTER) doSendDistanceShoot(getThingPos(getCreatureSummons(cid)[1]), getThingPos(item2.uid), 39) registerCreatureEvent(item2.uid, "Controled") doSendMagicEffect(getThingPos(item2.uid), 136) doSendMagicEffect(getThingPos(item2.uid), 134) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 133) setPlayerStorageValue(cid, 61209, getCreatureMaxHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 61210, getCreatureHealth(getCreatureSummons(cid)[1])) doConvinceCreature(cid, item2.uid) if getCreatureSpeed(item2.uid) == 0 then doChangeSpeed(item2.uid, 180) end doCreatureSay(cid, ""..getCreatureName(getCreatureSummons(cid)[1])..", control "..string.lower(getCreatureName(item2.uid)).."'s mind!", 1) local cmed = item2.uid local cmname = getCreatureName(getCreatureSummons(cid)[1]) local cmpos = getThingPos(getCreatureSummons(cid)[1]) doRemoveCreature(getCreatureSummons(cid)[1]) local cmzao = doSummonCreature(""..cmname.." cm", cmpos) doConvinceCreature(cid, cmzao) setPlayerStorageValue(cid, 888, 1) local function check(params) if isCreature(params.cid) then if getPlayerStorageValue(params.cid, 888) <= 0 then return true end -- CONTROL if not isCreature(cmed) then[/color] [color=royalblue] local pkcmpos = getThingPos(getCreatureSummons(cid)[1]) doRemoveCreature(getCreatureSummons(cid)[1]) local item = getPlayerSlotItem(cid, 8) local pk = doSummonCreature(getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball."), pkcmpos) doConvinceCreature(cid, pk) doCreatureSetLookDir(getCreatureSummons(cid)[1], 2) registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(pk, "Exp") registerCreatureEvent(cid, "PlayerPokeDeath") setCreatureMaxHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61210))-(getPlayerStorageValue(cid, 61209))) setPlayerStorageValue(cid, 888, 0) end if params.rod == 20 then local lifecmed = getCreatureMaxHealth(cmed) - getCreatureHealth(cmed) local poscmed = getThingPos(cmed) local cmeddir = getCreatureLookDir(cmed) local namecmed = getCreatureName(cmed) doRemoveCreature(getCreatureSummons(cid)[1]) local back = doSummonCreature(""..namecmed.." s", poscmed) if getCreatureSpeed(back) == 0 then doChangeSpeed(back, 180) end doCreatureSetLookDir(back, cmeddir) doCreatureAddHealth(back, -lifecmed) local item = getPlayerSlotItem(cid, 8) local mynewpos = getThingPos(getCreatureSummons(cid)[1]) doRemoveCreature(getCreatureSummons(cid)[1]) pk = doSummonCreature(getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball."), mynewpos) doConvinceCreature(cid, pk) doCreatureSetLookDir(getCreatureSummons(cid)[1], 2) registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(pk, "Exp") registerCreatureEvent(cid, "PlayerPokeDeath") setCreatureMaxHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61210))-(getPlayerStorageValue(cid, 61209))) setPlayerStorageValue(cid, 888, 0) else doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 220) end end end for rod = 1, 20 do addEvent(check, rod*500, {cid = cid, rod = rod}) end return true end if item2.uid == cid then[/color] [color=royalblue] if getPlayerStorageValue(cid, 888) >= 1 then doPlayerSendCancel(cid, "You cant fly neither ride pokemons being controled.") return true end if #getCreatureSummons(cid) == 0 and getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 then doPlayerSendCancel(cid, "You need a pokemon to use order.") return true end if getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and not isInArray(ridefly, getCreatureName(getCreatureSummons(cid)[1])) then[/color] [color=royalblue] doPlayerSendCancel(cid, "You can't ride this pokemon nor fly with it.") return true end if getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getCreatureSpeed(getCreatureSummons(cid)[1]) == 0 then[/color] [color=royalblue] return true end if getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and isInArray(ride, getCreatureName(getCreatureSummons(cid)[1])) then[/color] [color=royalblue] local pokemon = rides[getCreatureOutfit(getCreatureSummons(cid)[1]).lookType] if getCreatureSpeed(getCreatureSummons(cid)[1]) >= 1 then doChangeSpeed(getCreatureSummons(cid)[1], -getCreatureSpeed(getCreatureSummons(cid)[1])) end local function ride(params) if isCreature(params.cid) then if isCreature(getCreatureSummons(params.cid)[1]) then if getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(cid)) <= params.d then doChangeSpeed(cid, -250) doChangeSpeed(cid, pokemon[2]) exhaustion.set(cid, etudao, 4) setPlayerStorageValue(cid, 17001, 1) doSetCreatureOutfit(cid, {lookType = pokemon[1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1) setPlayerStorageValue(cid, 61209, getCreatureMaxHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 61210, getCreatureHealth(getCreatureSummons(cid)[1])) doRemoveCreature(getCreatureSummons(cid)[1]) else dirh = getDirectionTo(getThingPos(getCreatureSummons(params.cid)[1]), getThingPos(params.cid)) if dirh == NORTHWEST then if math.random(1,100) >= 51 then dirh = NORTH else dirh = WEST end elseif dirh == SOUTHWEST then if math.random(1,100) >= 51 then dirh = SOUTH else dirh = WEST end elseif dirh == SOUTHEAST then if math.random(1,100) >= 51 then dirh = SOUTH else dirh = EAST end elseif dirh == NORTHEAST then if math.random(1,100) >= 51 then dirh = NORTH else dirh = EAST end end local dirh = dirh if getCreatureSpeed(getCreatureSummons(params.cid)[1]) == 0 then doChangeSpeed(getCreatureSummons(params.cid)[1], getCreatureBaseSpeed(getCreatureSummons(cid)[1])) doPushCreature(getCreatureSummons(params.cid)[1], dirh, 1, 0) doChangeSpeed(getCreatureSummons(params.cid)[1], -getCreatureSpeed(getCreatureSummons(cid)[1])) else doPushCreature(getCreatureSummons(params.cid)[1], dirh, 1, 0) doChangeSpeed(getCreatureSummons(params.cid)[1], -getCreatureSpeed(getCreatureSummons(cid)[1])) end end end end end local function speed(params)[/color] [color=royalblue] if isCreature(params.cid) then if isCreature(getCreatureSummons(params.cid)[1]) then if getCreatureSpeed(getCreatureSummons(params.cid)[1]) == 0 then doChangeSpeed(getCreatureSummons(params.cid)[1], getCreatureBaseSpeed(getCreatureSummons(cid)[1])) end end end end doCreatureSay(cid, ""..getCreatureName(getCreatureSummons(cid)[1])..", let me ride you!", 1) exhaustion.set(cid, etudao, 4) if getPlayerGroupId(cid) >= 2 and getPlayerGroupId(cid) <= 6 then distanc = 1 else distanc = 0 end local distance = distanc for i=1,12 do addEvent(ride, pokemon[3]*i, {cid = cid, d = distance}) addEvent(speed, ((pokemon[3]*12)+100), {cid = cid}) end return true end if getPlayerStorageValue(cid, 17001) >= 1 then[/color] [color=royalblue] setPlayerStorageValue(cid, 17001, 0) if getPlayerGroupId(cid) ~= 6 then setPlayerGroupId(cid, 8) end doCreatureSetLookDir(cid, 2) doChangeSpeed(cid, -(getCreatureSpeed(cid))) if getPlayerGroupId(cid) >= 2 and getPlayerGroupId(cid) <= 7 then doChangeSpeed(cid, 400*getPlayerGroupId(cid)) else doChangeSpeed(cid, 250) end doRemoveCondition(cid, CONDITION_OUTFIT) local item = getPlayerSlotItem(cid, 8) doCreatureSay(cid, "" .. getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")..", let me get down!", 1) doSummonMonster(cid, getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")) local pk = getCreatureSummons(cid)[1] registerCreatureEvent(cid, "PlayerPokeDeath") if isInArray(bolas, item.itemid) then registerCreatureEvent(pk, "DiePoke") elseif isInArray(ultra, item.itemid) then registerCreatureEvent(pk, "DiePoke2") end setCreatureMaxHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61210))-(getPlayerStorageValue(cid, 61209))) return true end if getPlayerStorageValue(cid, 17000) >= 1 then[/color] [color=royalblue] if getTileInfo(getThingPos(cid)).itemid == 460 or getTileInfo(getThingPos(cid)).itemid == 1023 or getTileInfo(getThingPos(cid)).itemid == 1022 then doPlayerSendCancel(cid, "You can\'t stop flying at this height!") return true end if getTileInfo(getThingPos(cid)).itemid >= 4820 and getTileInfo(getThingPos(cid)).itemid <= 4825 then doPlayerSendCancel(cid, "You can\'t stop flying above the water!") return true end if getPlayerGroupId(cid) ~= 6 then setPlayerGroupId(cid, 8) end doCreatureSetLookDir(cid, 2) setPlayerStorageValue(cid, 17000, 0) doChangeSpeed(cid, -(getCreatureSpeed(cid))) if getPlayerGroupId(cid) >= 2 and getPlayerGroupId(cid) <= 7 then doChangeSpeed(cid, 200*getPlayerGroupId(cid)) else doChangeSpeed(cid, 250) end doRemoveCondition(cid, CONDITION_OUTFIT) local item = getPlayerSlotItem(cid, 8) doCreatureSay(cid, "" .. getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")..", let me get down!", 1) doSummonMonster(cid, getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")) local pk = getCreatureSummons(cid)[1] registerCreatureEvent(cid, "PlayerPokeDeath") if isInArray(bolas, item.itemid) then registerCreatureEvent(pk, "DiePoke") elseif isInArray(ultra, item.itemid) then registerCreatureEvent(pk, "DiePoke2") end setCreatureMaxHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61210))-(getPlayerStorageValue(cid, 61209))) return true end if not isPremium(cid) then[/color] [color=royalblue] doPlayerSendCancel(cid, "Only premium members are allowed to fly.") return true end if getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and isInArray(fly, getCreatureName(getCreatureSummons(cid)[1])) then[/color] [color=royalblue] if getPlayerStorageValue(cid, 17000) <= 0 then local pokemon = flys[getCreatureOutfit(getCreatureSummons(cid)[1]).lookType] local function fly(params) if isCreature(params.cid) then if isCreature(getCreatureSummons(params.cid)[1]) then if getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(cid)) <= params.dd then doPlayerSendTextMessage(cid,27, "Type \"up\" or \"h1\" to fly higher and \"down\" or \"h2\" to fly lower." ) setPlayerStorageValue(cid, 61209, getCreatureMaxHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 61210, getCreatureHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 17000, 1) registerCreatureEvent(cid, "Flying") doChangeSpeed(cid, -250) doChangeSpeed(cid, pokemon[2]) exhaustion.set(cid, etudao, 4) doSetCreatureOutfit(cid, {lookType = pokemon[1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1) doRemoveCreature(getCreatureSummons(cid)[1]) else dir = getDirectionTo(getThingPos(getCreatureSummons(params.cid)[1]), getThingPos(params.cid)) if dir == NORTHWEST then if math.random(1,100) >= 51 then dir = NORTH else dir = WEST end elseif dir == SOUTHWEST then if math.random(1,100) >= 51 then dir = SOUTH else dir = WEST end elseif dir == SOUTHEAST then if math.random(1,100) >= 51 then dir = SOUTH else dir = EAST end elseif dir == NORTHEAST then if math.random(1,100) >= 51 then dir = NORTH else dir = EAST end end local dir = dir if getCreatureSpeed(getCreatureSummons(params.cid)[1]) == 0 then doChangeSpeed(getCreatureSummons(params.cid)[1], getCreatureBaseSpeed(getCreatureSummons(cid)[1])) doPushCreature(getCreatureSummons(params.cid)[1], dir, 1, 0) doChangeSpeed(getCreatureSummons(params.cid)[1], -getCreatureSpeed(getCreatureSummons(cid)[1])) else doPushCreature(getCreatureSummons(params.cid)[1], dir, 1, 0) doChangeSpeed(getCreatureSummons(params.cid)[1], -getCreatureSpeed(getCreatureSummons(cid)[1])) end end end end end local function speed(params)[/color] [color=royalblue] if isCreature(params.cid) then if isCreature(getCreatureSummons(params.cid)[1]) then if getCreatureSpeed(getCreatureSummons(params.cid)[1]) == 0 then doChangeSpeed(getCreatureSummons(params.cid)[1], getCreatureBaseSpeed(getCreatureSummons(cid)[1])) end end end end doCreatureSay(cid, ""..getCreatureName(getCreatureSummons(cid)[1])..", lets fly!", 1)[/color] [color=royalblue] exhaustion.set(cid, etudao, 4) if getPlayerGroupId(cid) >= 2 and getPlayerGroupId(cid) <= 6 then distancc = 1 else distancc = 0 end local distancee = distancc for i=1,12 do addEvent(fly, pokemon[3]*i, {cid = cid, dd = distancee}) addEvent(speed, ((pokemon[3]*12)+100), {cid = cid}) end return true end return true end end -- ROCK SMASH if item2.itemid == 1285 and getPlayerStorageValue(cid, 63215) <= 0 then if #getCreatureSummons(cid) == 0 then doPlayerSendCancel(cid, "You need a pokemon to use rock smash.") return true end if not isInArray(rocksmash, getCreatureName(getCreatureSummons(cid)[1])) then doPlayerSendCancel(cid, "This pokemon can't use rock smash.") return true end if isInArray(rocksmash, getCreatureName(getCreatureSummons(cid)[1])) then if exhaustion.get(cid, erocksmash) then doPlayerSendCancel(cid, "Please wait a few seconds before using rock smash again!") return true end if getCreatureSpeed(getCreatureSummons(cid)[1]) == 0 then[/color] [color=royalblue] return true end doChangeSpeed(getCreatureSummons(cid)[1], -getCreatureSpeed(getCreatureSummons(cid)[1])) local function tocut(params) if isCreature(params.cid) then if isCreature(getCreatureSummons(params.cid)[1]) then if getCreatureSpeed(getCreatureSummons(params.cid)[1]) >= 1 then return true end if getPlayerStorageValue(getCreatureSummons(params.cid)[1], 100) >= 1 then return true end if getDistanceBetween(getThingPos(getCreatureSummons(params.cid)[1]), topos) == 1 then doSendMagicEffect(topos, 118) doTransformItem(getTileItemById(topos, 1285).uid, 2257) exhaustion.set(cid, erocksmash, cdrocksmash) setPlayerStorageValue(getCreatureSummons(params.cid)[1], 100, 1) local function detrans(params) doTransformItem(getTileItemById(topos, 2257).uid, 1285) if isCreature(getCreatureSummons(params.ciddd)[1]) then setPlayerStorageValue(getCreatureSummons(params.ciddd)[1], 100, 0) end end addEvent(detrans, 5500, {ciddd = cid}) doCreatureSay(getCreatureSummons(cid)[1], "ROCK SMASH!", TALKTYPE_MONSTER) local function nmr(params) if isCreature(params.cid) then if isCreature(getCreatureSummons(params.cid)[1]) then if getCreatureSpeed(getCreatureSummons(params.cid)[1]) == 0 then doChangeSpeed(getCreatureSummons(params.cid)[1], getCreatureBaseSpeed(getCreatureSummons(params.cid)[1])) end end end end addEvent(nmr, 400, {cid = cid}) else local badire = getDirectionTo(getThingPos(getCreatureSummons(cid)[1]), topos) if badire == NORTHWEST then if math.random(1,100) >= 51 then badire = NORTH if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), badire), params.ccid, 0, 0) then badire = NORTH else badire = WEST end else badire = WEST if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), badire), params.ccid, 0, 0) then badire = WEST else badire = NORTH end end elseif badire == SOUTHWEST then if math.random(1,100) >= 51 then badire = SOUTH if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), badire), params.ccid, 0, 0) then badire = SOUTH else badire = WEST end else badire = WEST if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), badire), params.ccid, 0, 0) then badire = WEST else badire = SOUTH end end elseif badire == SOUTHEAST then if math.random(1,100) >= 51 then badire = SOUTH if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), badire), params.ccid, 0, 0) then badire = SOUTH else badire = EAST end else badire = EAST if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), badire), params.ccid, 0, 0) then badire = EAST else badire = SOUTH end end elseif badire == NORTHEAST then if math.random(1,100) >= 51 then badire = NORTH if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), badire), params.ccid, 0, 0) then badire = NORTH else badire = EAST end else badire = EAST if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), badire), params.ccid, 0, 0) then badire = EAST else badire = NORTH end end end local badire = badire if getCreatureSpeed(getCreatureSummons(params.cid)[1]) == 0 then doChangeSpeed(getCreatureSummons(params.cid)[1], getCreatureBaseSpeed(getCreatureSummons(params.cid)[1])) doPushCreature(getCreatureSummons(params.cid)[1], badire, 1, 0) doChangeSpeed(getCreatureSummons(params.cid)[1], -getCreatureSpeed(getCreatureSummons(params.cid)[1])) else doPushCreature(getCreatureSummons(params.cid)[1], badire, 1, 0) doChangeSpeed(getCreatureSummons(params.cid)[1], -getCreatureSpeed(getCreatureSummons(params.cid)[1])) end end end end end doPlayerSay(cid, ""..getCreatureName(getCreatureSummons(cid)[1])..", smash this rock!", 1)[/color] [color=royalblue] local speed = getCreatureBaseSpeed(getCreatureSummons(cid)[1]) local temk = 1000 -(2.3 * speed) addEvent(tocut, 0, {cid = cid, ccid = getCreatureSummons(cid)[1], topos = topos}) for i = 1, getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), topos) * 2 do addEvent(tocut, temk*i, {cid = cid, ccid = getCreatureSummons(cid)[1], topos = topos}) end return true end end -- ROCK SMASH END -- CUT[/color] [color=royalblue] if item2.itemid == 2767 and getPlayerStorageValue(cid, 63215) <= 0 then if #getCreatureSummons(cid) == 0 then doPlayerSendCancel(cid, "You need a pokemon to use cut.") return true end if not isInArray(cut, getCreatureName(getCreatureSummons(cid)[1])) then doPlayerSendCancel(cid, "This pokemon can't use cut.") return true end if isInArray(cut, getCreatureName(getCreatureSummons(cid)[1])) then if exhaustion.get(cid, ecut) then doPlayerSendCancel(cid, "Please wait a few seconds before using cut again!") return true end if getCreatureSpeed(getCreatureSummons(cid)[1]) == 0 then return true end doChangeSpeed(getCreatureSummons(cid)[1], -getCreatureSpeed(getCreatureSummons(cid)[1])) local function tocut(params) if isCreature(params.cid) then if isCreature(getCreatureSummons(params.cid)[1]) then if getCreatureSpeed(getCreatureSummons(params.cid)[1]) >= 1 then return true end if getPlayerStorageValue(getCreatureSummons(params.cid)[1], 101) >= 1 then return true end if getDistanceBetween(getThingPos(getCreatureSummons(params.cid)[1]), topos) == 1 then doSendMagicEffect(topos, 141) doTransformItem(getTileItemById(topos, 2767).uid, 6216) exhaustion.set(cid, ecut, cdcut) setPlayerStorageValue(getCreatureSummons(params.cid)[1], 101, 1) local function detrans(params) doTransformItem(getTileItemById(topos, 6216).uid, 2767) if isCreature(getCreatureSummons(params.ciddd)[1]) then setPlayerStorageValue(getCreatureSummons(params.ciddd)[1], 101, 0) end end addEvent(detrans, 5500, {ciddd = cid}) doCreatureSay(getCreatureSummons(cid)[1], "CUT!", TALKTYPE_MONSTER) local function nmr(params) if isCreature(params.cid) then if isCreature(getCreatureSummons(params.cid)[1]) then if getCreatureSpeed(getCreatureSummons(params.cid)[1]) == 0 then doChangeSpeed(getCreatureSummons(params.cid)[1], getCreatureBaseSpeed(getCreatureSummons(params.cid)[1])) end end end end addEvent(nmr, 400, {cid = cid}) else adire = getDirectionTo(getThingPos(getCreatureSummons(cid)[1]), topos) if adire == NORTHWEST then if math.random(1,100) >= 51 then adire = NORTH if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), adire), params.ccid, 0, 0) then adire = NORTH else adire = WEST end else adire = WEST if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), adire), params.ccid, 0, 0) then adire = WEST else adire = NORTH end end elseif adire == SOUTHWEST then if math.random(1,100) >= 51 then adire = SOUTH if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), adire), params.ccid, 0, 0) then adire = SOUTH else adire = WEST end else adire = WEST if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), adire), params.ccid, 0, 0) then adire = WEST else adire = SOUTH end end elseif adire == SOUTHEAST then if math.random(1,100) >= 51 then adire = SOUTH if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), adire), params.ccid, 0, 0) then adire = SOUTH else adire = EAST end else adire = EAST if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), adire), params.ccid, 0, 0) then adire = EAST else adire = SOUTH end end elseif adire == NORTHEAST then if math.random(1,100) >= 51 then adire = NORTH if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), adire), params.ccid, 0, 0) then adire = NORTH else adire = EAST end else adire = EAST if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), adire), params.ccid, 0, 0) then adire = EAST else adire = NORTH end end end local adire = adire if getCreatureSpeed(getCreatureSummons(params.cid)[1]) == 0 then doChangeSpeed(getCreatureSummons(params.cid)[1], getCreatureBaseSpeed(getCreatureSummons(params.cid)[1])) doPushCreature(getCreatureSummons(params.cid)[1], adire, 1, 0) doChangeSpeed(getCreatureSummons(params.cid)[1], -getCreatureSpeed(getCreatureSummons(params.cid)[1])) else doPushCreature(getCreatureSummons(params.cid)[1], adire, 1, 0) doChangeSpeed(getCreatureSummons(params.cid)[1], -getCreatureSpeed(getCreatureSummons(params.cid)[1])) end end end end end doPlayerSay(cid, ""..getCreatureName(getCreatureSummons(cid)[1])..", cut this bush!", 1)[/color] [color=royalblue] local speed = getCreatureBaseSpeed(getCreatureSummons(cid)[1]) temk = 1000 -(2.3 * speed) addEvent(tocut, 0, {cid = cid, ccid = getCreatureSummons(cid)[1], topos = topos}) for i = 1, getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), topos) * 2 do addEvent(tocut, temk*i, {cid = cid, ccid = getCreatureSummons(cid)[1], topos = topos}) end return true[/color] [color=royalblue] end end -- CUT END -- DIG[/color] [color=royalblue] if isInArray(digholes, item2.itemid) and getPlayerStorageValue(cid, 63215) <= 0 then if #getCreatureSummons(cid) == 0 then doPlayerSendCancel(cid, "You need a pokemon to use dig.") return true end if not isInArray(dig, getCreatureName(getCreatureSummons(cid)[1])) then doPlayerSendCancel(cid, "This pokemon can't use dig.") return true end if isInArray(dig, getCreatureName(getCreatureSummons(cid)[1])) then if exhaustion.get(cid, edig) then doPlayerSendCancel(cid, "Please wait a few seconds before using dig again!") return true end if getCreatureSpeed(getCreatureSummons(cid)[1]) == 0 then return true end doChangeSpeed(getCreatureSummons(cid)[1], -getCreatureSpeed(getCreatureSummons(cid)[1])) local function tocut(params) if isCreature(params.cid) then if isCreature(getCreatureSummons(params.cid)[1]) then if getCreatureSpeed(getCreatureSummons(params.cid)[1]) >= 1 then return true end if getPlayerStorageValue(getCreatureSummons(params.cid)[1], 99) >= 1 then return true end if getDistanceBetween(getThingPos(getCreatureSummons(params.cid)[1]), topos) == 1 then doSendMagicEffect(topos, 3) setPlayerStorageValue(getCreatureSummons(params.cid)[1], 99, 1) doTransformItem(getTileItemById(topos, item2.itemid).uid, item2.itemid+1) exhaustion.set(cid, edig, cddig) local function detrans(params) doTransformItem(getTileItemById(topos, item2.itemid+1).uid, item2.itemid) if isCreature(getCreatureSummons(params.ciddd)[1]) then setPlayerStorageValue(getCreatureSummons(params.ciddd)[1], 99, 0) end end addEvent(detrans, 5500, {ciddd = cid}) doCreatureSay(getCreatureSummons(cid)[1], "DIG!", TALKTYPE_MONSTER) local function nmr(params) if isCreature(params.cid) then if isCreature(getCreatureSummons(params.cid)[1]) then if getCreatureSpeed(getCreatureSummons(params.cid)[1]) == 0 then doChangeSpeed(getCreatureSummons(params.cid)[1], getCreatureBaseSpeed(getCreatureSummons(params.cid)[1])) end end end end addEvent(nmr, 400, {cid = cid}) else local cdire = getDirectionTo(getThingPos(getCreatureSummons(cid)[1]), topos) if cdire == NORTHWEST then if math.random(1,100) >= 51 then cdire = NORTH if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), cdire), params.ccid, 0, 0) then cdire = NORTH else cdire = WEST end else cdire = WEST if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), cdire), params.ccid, 0, 0) then cdire = WEST else cdire = NORTH end end elseif cdire == SOUTHWEST then if math.random(1,100) >= 51 then cdire = SOUTH if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), cdire), params.ccid, 0, 0) then cdire = SOUTH else cdire = WEST end else cdire = WEST if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), cdire), params.ccid, 0, 0) then cdire = WEST else cdire = SOUTH end end elseif cdire == SOUTHEAST then if math.random(1,100) >= 51 then cdire = SOUTH if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), cdire), params.ccid, 0, 0) then cdire = SOUTH else cdire = EAST end else cdire = EAST if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), cdire), params.ccid, 0, 0) then cdire = EAST else cdire = SOUTH end end elseif cdire == NORTHEAST then if math.random(1,100) >= 51 then cdire = NORTH if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), cdire), params.ccid, 0, 0) then cdire = NORTH else cdire = EAST end else cdire = EAST if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), cdire), params.ccid, 0, 0) then cdire = EAST else cdire = NORTH end end end local cdire = cdire if getCreatureSpeed(getCreatureSummons(params.cid)[1]) == 0 then doChangeSpeed(getCreatureSummons(params.cid)[1], getCreatureBaseSpeed(getCreatureSummons(params.cid)[1])) doPushCreature(getCreatureSummons(params.cid)[1], cdire, 1, 0) doChangeSpeed(getCreatureSummons(params.cid)[1], -getCreatureSpeed(getCreatureSummons(params.cid)[1])) else doPushCreature(getCreatureSummons(params.cid)[1], cdire, 1, 0) doChangeSpeed(getCreatureSummons(params.cid)[1], -getCreatureSpeed(getCreatureSummons(params.cid)[1])) end end end end end doPlayerSay(cid, ""..getCreatureName(getCreatureSummons(cid)[1])..", open this hole!", 1)[/color] [color=royalblue] local speed = getCreatureBaseSpeed(getCreatureSummons(cid)[1]) temk = 1000 -(2.3 * speed) addEvent(tocut, 0, {cid = cid, ccid = getCreatureSummons(cid)[1], topos = topos}) for i = 1, getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), topos) * 2 do addEvent(tocut, temk*i, {cid = cid, ccid = getCreatureSummons(cid)[1], topos = topos}) end return true end end -- DIG END -- BLINK[/color] [color=royalblue] if #getCreatureSummons(cid) == 0 and getPlayerStorageValue(cid, 63215) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 then doPlayerSendCancel(cid, "You need a pokemon to use order.") return true end if not isMonster(item2.uid) and getPlayerStorageValue(cid, 63215) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 then if isInArray(blink, getCreatureName(getCreatureSummons(cid)[1])) then if exhaustion.get(cid, exhaustblink) then doPlayerSay(cid, ""..getCreatureName(getCreatureSummons(cid)[1])..", move!", 1) doChangeSpeed(getCreatureSummons(cid)[1], -getCreatureSpeed(getCreatureSummons(cid)[1])) markPos(getCreatureSummons(cid)[1], topos) markOwnerPos(getCreatureSummons(cid)[1], getThingPos(cid)) addEvent(goThere, 500, getCreatureSummons(cid)[1], topos) else if not isWalkable(topos, cid, 0, 0) then doPlayerSendCancel(cid, "Your pokemon cannot teleport there.") return true end if getItemName(item2.uid) == "shallow water" then doPlayerSendCancel(cid, "Your pokemon cannot teleport there.") return true end doSendDistanceShoot(getThingPos(getCreatureSummons(cid)[1]), topos, 39) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 211) doTeleportThing(getCreatureSummons(cid)[1], topos, false) doSendMagicEffect(topos, 134) doPlayerSay(cid, ""..getCreatureName(getCreatureSummons(cid)[1])..", teleport there!", 1) doCreatureSay(getCreatureSummons(cid)[1], "BLINK!", TALKTYPE_MONSTER) exhaustion.set(cid, exhaustblink, cdblink) return true end return true end end --- BLINK END -- LIGHT --[/color] [color=royalblue] if isCreature(item2.uid) and getCreatureMaster(item2.uid) == cid and getPlayerStorageValue(cid, 63215) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and item2.uid ~= cid then if not isInArray(light, getCreatureName(getCreatureSummons(cid)[1])) then doPlayerSendCancel(cid, "This pokemon can't use flash.") return true end if isInArray(light, getCreatureName(getCreatureSummons(cid)[1])) then if not isMonster(item2.uid) and getCreatureMaster(item2.uid) ~= cid then return doPlayerSendCancel(cid,"Please use flash on your pokemon.") end if exhaustion.get(cid, exhautStorage) then doPlayerSendCancel(cid,"Please wait a few seconds before using flash again!") return true end exhaustion.set(cid, exhautStorage, cd) doPlayerSay(cid, ""..getCreatureName(getCreatureSummons(cid)[1])..", use flash!", 1) doCreatureSay(getCreatureSummons(cid)[1], "FLASH!", TALKTYPE_MONSTER) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 28) doSetCreatureLight(getCreatureSummons(cid)[1], 8, 215, time*1000) return true end end -- LIGHT END -- if #getCreatureSummons(cid) == 0 then return true end if getPlayerStorageValue(getCreatureSummons(cid)[1], 12) == 1 then doPlayerSendCancel(cid, "You can\'t order your pokemon to move now.") return true end doPlayerSay(cid, ""..getCreatureName(getCreatureSummons(cid)[1])..", move!", 1) doChangeSpeed(getCreatureSummons(cid)[1], -getCreatureSpeed(getCreatureSummons(cid)[1])) markPos(getCreatureSummons(cid)[1], topos) markOwnerPos(getCreatureSummons(cid)[1], getThingPos(cid)) addEvent(goThere, 500, getCreatureSummons(cid)[1], topos) return true end[/color] Características do novo move: • neste não há cooldown como o antigo, o jogador pode usar livremente sem dar nenhum erro no pokemon. • neste, ao usar o order e o pokemon chegar ao destino, ele permanece ali até o jogador mover-se. • neste o pokemon anda apenas em linha reta. • agora, ao selecionar um novo alvo, o pokemon volta a andar sozinho. enfim, há outros detalhes também que tratam apenas a correção de bugs, qualquer erro, avisem-me. Qualquer um tem permissão para postar em outro fórum, só peço que coloquem os créditos. A função doPushCreature não é minha. Foi feita pelo Dokmos.
  10. Servidor testado: TFS 0.3.6 (Provavelmente funciona em anteriores) Autor: Ramza (Rick / Ricardo Ianelli) Idéia de: Dartier Versão: 1.0 Olá a todos! Muitos de vocês não me conhecem, eu sou o Rick :yes: Bem, reparei que algumas pessoas estavam dando idéias sobre um sistema em que o cap (peso) influenciasse (acabei de descobrir que essa palavra é um saco pra escrever, escrevam ai e comprovem :fuu:) na velocidade do char. Pois bem, tentei fazer um sisteminha aqui, acho que ficou legal, testei e funcionou, mas... nada nunca está perfeito, vocês sabem como é :hmm: Bem, é meu primeiro post, espero que gostem, e não esqueçam que não sou que nem o Mock, o Flatronez, o Nord ou o Skyen, sou apenas um "aprendiz" :fail: Vamos lá! Primeiramente, vá até creaturescripts\scripts , faça uma cópia de qualquer arquivo contido lá, apague tudo e cole isto: --[[ FUNCTION MADE BY RICARDO IANELLI FOR THE AVATAR ONLINE ATS - For more informations, check: http://forums.otserv.com.br/f19/avatar-online-avatar-ats-134459 ]] function onThink(cid, interval) local speed, base, peso = getCreatureSpeed(cid), getCreatureBaseSpeed(cid), getPlayerFreeCap(cid) local nspeed = (math.floor([color=Red]((peso / 5 ) + (base))[/color])) if speed ~= nspeed then doChangeSpeed(cid, (nspeed - speed)) end end Repare que eu deixei em vermelho uma parte do script, que é a fórmula usada pra calcular quanto de velocidade aumenta/diminui dependendo do quanto sua capacidade está. Se for mecher, lembre-se de mecher APENAS NA PARTE VERMELHA, a menos que saiba bem o que está fazendo. Agora, vamos para a segunda parte! Abra o arquivo "login.lua" e adicione isto logo abaixo de "function onLogin(cid)" : registerCreatureEvent(cid, "getspeed") Agora, vamos para a parte final! Volte para data\creaturescripts e abra o arquivo creaturescripts.lua, e adicione esta tag ao arquivo: <event type="think" name="getspeed" event="script" value="getspeed.lua"/> E pronto, está feito! Caso esteja com dúvida se está funcionando ou não, pode adicionar a seguinte tag em baixo de if speed ~= nspeed then: doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Sua velocidade foi trocada com sucesso de "..speed.." para "..nspeed..".") Espero que tenham gostado, desculpe fiz algo "noob" ai no script, mas é que ainda to aprendendo, tá duro, mas to aprendendo (no pain, no gain :fist:) E a propósito, esse script é um dos vários que fiz pro "Avatar Legends". Para conhecerem mais sobre ele é só clicar na minha assinatura Abraços a todos, e tenham uma boa noite, e quem gostou, se quiser doar V$, eu aceito xD OBS.: O SISTEMA ATUALIZA DIRETO, SE VC JOGAR UMA TOCHA NO CHÃO, VAI MUDAR SUA SPEED, NÃO É SÓ QUANDO LOGA NO JOGO NÃO! :yes:
  11. [b]Nome:[/b] Sistema de Monster Sleep + Sistema de walk/run [b]Autor:[/b] Ramza (Ricardo Ianelli) [b]Versão Testada:[/b] TFS 0.3.6 (Crying Damson) Introdução Olá a todos! Bem, antes que venham dizer "Carai esse cara roubou a idéia do Dokmos, tnc nobbão :fail:", quem viu o script do Dokmos direitinho sabe que eu que dei a idéia, pois eu estava na época tentando fazer esse sistema que estou postando aqui hoje, para o concurso, porém não obtive a tempo, e deixei que ele usasse minha idéia pra fazer um script dele. E ele criou um bem legal Porém... Eis que finalizei o meu sistema de monstros tirarem uma "soneca" de vez enquanto, e eu digo: Tá muito maneiro! :fist: Todavia, não pense que não dará trabalho introduzir esse sistema no seu servidor, pois dará sim, não vou negar que esse sistema tá meio "POG", pois não conheço as diversas funções que os grandes scripters desse forum conhecem, devido a isso tenho de "improvisar". Funcionamento Para o sistema funcionar, você precisará mecher nos monstros que você quer que durmam, terá de criar uma magia, um creaturescript, duas talkactions, e ter a OTAL instalada para usar a função "hasSqm(pos)". Sim, eu sei que é bastante coisa, mas o sistema envolve outros sistemas que se mostrarão necessários para o bom funcionamento e diferencial do script, como as talkactions walk! e run! O sistema funciona da seguinte forma, as vezes os monstros estão tão cansados que tiram uma soneca, porém, como sabemos, soneca é apenas um breve cochilo, uma dormida "de leve". Então, caso você esteja explorando uma caverna cheia de monstros terríveis, você não irá querer acorda-los fazendo barulho, vai? Portanto, você terá de se aproximar beeeem devagar, andando bem devagarzinho para não fazer barulho, e assim, não acorda-los. Por isso incrementei o sistema de walk (andar) e run (correr) :yes: Instalando Vá até data\creaturescripts\scripts , faça uma cópia de qualquer arquivo, renomeie-o para sleeping.lua, apague tudo que estiver dentro e cole isto, depois salve: function onCombat(cid, target) if getPlayerStorageValue(cid, 9070) == 2 then doCreatureSetLookDir(cid, getPlayerStorageValue(cid, 9071)) return false else return true end end Agora vá em data\creaturescripts e abra o arquivo creaturescripts.xml . Em seguida, adicione a seguinte tag ao arquivo e salve: <event type="combat" name="sleeping" event="script" value="sleeping.lua"/> Agora o próximo passo é ir às talkactions adicionar as funções walk! e run! Vá em data\talkactions\scripts, faça DUAS cópia de qualquer arquivo, renomeie-os para walk.lua e run.lua . Em walk.lua, apague tudo que tiver dentro e cole isto: function onSay(cid, words, param, channel) if getPlayerStorageValue(cid, 9050) == 2 then doChangeSpeed(cid, getCreatureBaseSpeed(cid)-300) doPlayerSendCancel(cid, "You are now walking") setPlayerStorageValue(cid, 9050, 1) else doPlayerSendCancel(cid, "You are already walking") end end E em run.lua, apague tudo que tiver dentro e cole isto: function onSay(cid, words, param, channel) if getPlayerStorageValue(cid, 9050) ~= 2 then doChangeSpeed(cid, getCreatureBaseSpeed(cid) - getCreatureSpeed(cid)) doPlayerSendCancel(cid, "You are now running") setPlayerStorageValue(cid, 9050, 2) else doPlayerSendCancel(cid, "You are already running") end end Agora vá em data\talkactions , abra o arquivo talkactions.xml e adicione as seguintes tags: <talkaction log="yes" words="walk!" event="script" value="walk.lua"/> e <talkaction log="yes" words="run!" event="script" value="run.lua"/> Pronto, estamos quase no final! Agora vá em data\spells\scripts , crie um arquivo chamado sleep.lua e cole isto dentro, depois salve e feche. -- FUNCTION BY RAMZA (RICARDO IANELLI) - DO NOT COPY WITHOUT PERMISSION. local function onSleep(monster, pos, speed) players = getSpectators(pos, 16, 16) for i = 1,#players do if isPlayer(players[i]) then if getPlayerStorageValue(players[i], 9050) == 1 then setPlayerStorageValue(monster, 9071, getPlayerLookPos(monster)) doChangeSpeed(monster, -speed) doSendMagicEffect(getCreaturePosition(monster), 32) setPlayerStorageValue(monster, 9070, 2) addEvent(onSleep, 1000, monster, pos, speed) else doSendMagicEffect(pos, 29) doChangeSpeed(monster, getCreatureBaseSpeed(monster) - speed) doSendAnimatedText(getCreaturePosition(monster), "!", TEXTCOLOR_DARKRED) setPlayerStorageValue(monster, 9070, 1) break end end end end function onCastSpell(cid, var) registerCreatureEvent(cid, "sleeping") if getPlayerStorageValue(cid, 9070) ~= 2 then local pos, vida, speed = getCreaturePosition(cid), getCreatureHealth(cid), getCreatureSpeed(cid) onSleep(cid, pos, speed) return TRUE else return false end end Depois vá em data\spells e adicione isto ao arquivo spells.xml : <instant name="sleep" words="sleep" enabled="0" script="sleep.lua"/> Agora é só ir nos monstros que você quer que durmam, no meu exemplo, fiz no monstro "Monk" e onde estiver assim: <defenses armor="20" defense="22"> <defense name="healing" interval="1000" chance="17" min="30" max="50"> <attribute key="areaEffect" value="blueshimmer"/> </defense> <defense name="speed" interval="1000" chance="10" speedchange="300" duration="3000"> <attribute key="areaEffect" value="redshimmer"/> </defense> </defenses> Você adiciona esta tag: <defense name="sleep" interval="1000" chance="[b][color=Red]15[/color][/b]"> </defense> Ficando assim, no caso do Monk: <defenses armor="20" defense="22"> <defense name="sleep" interval="1000" chance="[b][color=Red]15[/color][/b]"> </defense> <defense name="healing" interval="1000" chance="17" min="30" max="50"> <attribute key="areaEffect" value="blueshimmer"/> </defense> <defense name="speed" interval="1000" chance="10" speedchange="300" duration="3000"> <attribute key="areaEffect" value="redshimmer"/> </defense> </defenses> Reparem que botei '15' ali no chance, pois é um número que eu achei legal, a chance dele durmir. Porém, pra testar, aconselho colocar algo em torno de 30-50. Testando Bem, assim que tiver colocado em todos os monstros que quiser, ou no monstro que quiser usar pra testar, apenas salve tudo e vamos entrar no jogo para que você teste! Faça o seguinte: Entre num char que não seja GM. Use o comando walk! para fazer seu player "andar", para que você não acorde o monstro. Vá andando em direção ao monstro, e caso ele não esteja durmindo, fique de longe esperando que em menos de 1 minuto ele deva durmir. Assim que ele durmir, pode chegar bem pertinho dele para constatar que ele não se meche, não olha pra você, e nem te atacar. Agora, experimente falar run! e saia correndo, pois ele irá acordar e virá te atacar furioso! Agradecimentos Eu gostaria de agradecer ao meu amigo Mock, que me disponibilizou sua função getPosByAreaMOCK(pos, arr). Mesmo eu não a usando mais no sistema, obrigado ursão :yes: Bem, é isso galera, espero que gostem! E POR FAVOR, sugestões, críticas, são MUITO bem vindas, pois me fazem crescer. Agradeço desde já, Ricardo Ianelli. Obs.: Editei o sistema para melhorar o sistema devido à sugestão do usuário "Conde2". Obrigado Conde!
  12. Sistema AFK

    Olá, estou criando esse tutorial mostrando como fazer o Sistema de AFK em seu OTServ, Então vamos lá ^^ Vá Na Pasta De Seu OTServ / Data / Talkactions / Scripts - Copie qualquer arquivo .lua que está lá, tire tudo que a dentro dele e renomeie como 'afk' Coloque isso : [spoiler=Coloque isso] local time = 5 -- 1 = 1 sec, 2 = 2 sec, ... local say_events = {} local function SayText(cid) if isPlayer(cid) == TRUE then if say_events[getPlayerGUID(cid)] ~= nil then if isPlayer(cid) == TRUE then doSendAnimatedText(getPlayerPosition(cid),"Ausente !", math.random(01,255)) end say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 100 / 2, cid) end end return TRUE end function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end if param == "on" then if isPlayer(cid) == TRUE then doSendAnimatedText(getPlayerPosition(cid),"Ausente !", math.random(01,255)) end say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000, cid) doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING ,"You Now Stated you are (afk).") elseif param == "off" then stopEvent(say_events[getPlayerGUID(cid)]) say_events[getPlayerGUID(cid)] = nil doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING ,"You Now stated your are not (afk).") end return TRUE end Depois vá em Pasta De Seu OTServ / Data / Talkactions / Talkactions.XML Procure A Parte dos Players Bote Isso : [spoiler=Coloque Isso] <talkaction words="!afk on" event="script" value="afk.lua"/> Obs : falando !afk off acaba com !afk on começa! Gente então é isso salve feche e use Abraços, Victor Morin
  13. Sistema de colisão por: Ramza

    E ai galera, só vim aqui mostrar pra vocês um sisteminha legalzinho, que todo mundo AMA, principalmente quem eu boto pra testar comigo, pois vicia :3 DSAHUDSAUDSAHUDSAHDS É o meu sistema de colisão *-* deu trabaaaaaaaalho, mas ficou legal deixem seus comments! Ele funciona assim: Quando uma pessoa usa um feitiço junto comigo, nossos feitiços se colidem e explodem no ar.
  14. Sistema de Trem

    Bem Vindos a todos :loool: Bom galera, eu queria discutir aqui com vocês parte dos novos "ATS" que todos querem fazer. Depois que o Kingdom Age lançou o primeiro sistema de trem,muitos que querem criar um ATS tambem querem colocar esse sistema mais você se pergunta, Na época que o jogo Tibia retrata existia Trem ? e eis a Resposta: Não. Explicação: "A composição ferroviária puxada pela máquina a vapor teve uma importância enorme nos últimos duzentos anos da história da humanidade. Ele foi sem dúvida o elemento mais importante da Revolução Industrial, permitindo a deslocação das matérias primas para as fábricas rápida e eficazmente e levando os produtos acabados a pessoas, a regiões distantes e aos países onde eram mais necessários. Foi importantíssima a sua contribuição nas Primeira e Segunda Guerras Mundiais, levando rapidamente homens e armas onde estes mais falta faziam. Foram os comboios, a quem os índios chamaram Cavalo de Ferro (Iron horse), que ajudaram os colonos ingleses a desbravar o oeste americano e a construir o que hoje é considerado como a maior potência mundial." Wikipédia Ah então significa que o Trem foi criado na Revolução Industrial. Eu quero chegar no ponto para dizer a vocês que o famoso Trem foi criada no tempo em que existia armas de fogo ja, como que você acha que uma coisa movida a vapor pode existir na mesma epóca em que pessoas lutavam com espadas e arcos a flecha e acreditavam em Dragões ? Pelo jeito isso não é meio compativel e eu acho que quando o tal "ATS" vai ser sério os criadores devem pesquisar cada momento da história para dar sentido ao server. Bom galera, essa é a Ideia que eu queria passar para vocês... Abraços :]
  15. Sistema de incêndio

    POR FAVOR, NÃO COMENTE FRASES COMO 'OBRIGADO', 'VALEU' OU ALGO DO TIPO. APENAS POSTE SUAS DÚVIDAS E SUAS MENSAGENS DE ERRO. OBRIGADO Sistema de Incêndio desenvolvido por Pivigu - Pivigu World OTServ, em breve! Nome: Sistema de Incêndio Versão: 8.4x Tipo do script: Creature script, Global Script, Monster Servidor Testado: The Forgotten Server 0.3 b3 Autor: Pivigu (Eu) Descrição Quando o incêndio é iniciado, monstros como Fire Devils e Fire Elementals são sumonados de tempos em tempos. Após a quarta invocação, um boss é sumonado. Esse boss é o The Incendier. Em seguida, a floresta toda começa a pegar fogo, ou seja, são criados itens como Fire Fields e paredes de fogo nas árvores. Durante o incêndio são mandadas mensagens como se fosse uma invasão. Quando o boss The Incendier é morto, há um random de 5 a 15 segundos para que todo o fogo da invasão se apague. Os monstros e os itens são configuráveis, assim como o tempo da invasão. Scripts [spoiler=incendio.lua] incendio.lua -- Incêndio script by Pivigu - Pivigu World OTServ, em breve! function onThink(interval, lastExecution) -- Configuração local fromArea = {x = 58, y = 56, z = 7} -- Área que o incêndio vai acontecer. local toArea = {x = 88, y = 82, z = 7} -- Área que o incêndio vai acontecer. local chanceRaid = 30 -- Chance do incêndio acontecer, em porcentagem. local intervaloExe = 60*24*7 -- Intervalo de execução, em minutos. No exemplo, ela só poderá ocorrer 7 dias após a última execucao. -- Monstros local bossName = "The Incendier" -- Nome do Boss a ser sumonado. local monsterMinions = {"Fire Elemental", "Fire Devil"} -- Monstros que também serão sumonados. local monsterAmount = 28 -- Quantidade de monstros a serem sumonados (Múltiplos de 4, de preferência). local florestaName = "Pens" -- Nome da floresta ou da cidade onde a floresta se localiza. -- M = Mensagem, T = Tempo em segundos local BroadCast1M = ("A temperatura está muito quente na floresta de " .. florestaName .. ".") local BroadCast1T = 1 local BroadCast2M = ("Um incêndio está começando em " .. florestaName .. "!") local BroadCast2T = 3 local BroadCast3M = ("Parece que um monstro muito quente está botando fogo em tudo o que vê!") local BroadCast3T = 6 local BroadCast4M = (bossName .. " foi visto em " .. florestaName .. ". Não se aproxime da floresta. Tudo está pegando fogo!") local BroadCast4T = 9 -- Incêndio local idArvoresG = {2700, 2708, 2701, 2702, 2707} -- ID de árvores grandes para FireWall. local idArvoresP = {2767, 2703, 2768} -- ID de árvores pequenas para FireField. (2703 considerada pequena) local FFID = {1487,1488,1489} -- ID dos Fire Fields. local FWID = {5063} -- ID dos FireWalls. local fogoNoChao = TRUE -- Adicionar fogo no chão? TRUE = Verdadeiro, FALSE = Falso local terraID = {103} -- ID dos chãos a pegar fogo for iid = 4526, 4541 do -- Adicionando as gramas ao terraID terraID[table.maxn(terraID) + 1] = iid end local chanceFogo = 65 -- Chance de pegar fogo. -- Fim de Configuracao -- Verificar Erros if math.random(1, 100) > chanceRaid then return TRUE end if os.time(t) - getGlobalStorageValue(5001) < intervaloExe*60 then -- debugPrint("doIncendio: Execução cancelada pelo intervalo de execuções.") return TRUE end if toArea.x <= fromArea.x or toArea.y <= fromArea.y or toArea.z < fromArea.z then debugPrint("doIncendio: Erro na Area.") return FALSE end if BroadCast4T <= BroadCast3T or BroadCast3T <= BroadCast2T or BroadCast2T <= BroadCast1T then debugPrint("doIncendio: Erro no tempo dos Broadcasts.") return FALSE end if chanceFogo < 1 then chanceFogo = 0 end local summonArea = 0 local allArea = {} local getChao = 0 local getItem = 0 for xx = fromArea.x, toArea.x do for yy = fromArea.y, toArea.y do for zz = fromArea.z, toArea.z do getChao = getThingFromPos({x = xx, y = yy, z = zz, stackpos = STACKPOS_GROUND}) getItem = getThingFromPos({x = xx, y = yy, z = zz, stackpos = 1}) for ch = 1, table.maxn(terraID) do if terraID[ch] == getChao.itemid and (getItem.itemid == 0 or getItem.itemid == 6216 or getItem.itemid == 6217 or getItem.itemid == 6218 or getItem.itemid == 6219) then allArea[table.maxn(allArea) + 1] = {x = xx, y = yy, z = zz} end end end end end -- Fim de verificar erros -- Adicionando eventos addEvent(BroadCast, BroadCast1T*1000, BroadCast1M, monsterAmount, monsterMinions, allArea) addEvent(BroadCast, BroadCast2T*1000, BroadCast2M, monsterAmount, monsterMinions, allArea) addEvent(BroadCast, BroadCast3T*1000, BroadCast3M, monsterAmount, monsterMinions, allArea) addEvent(BroadCastBoss, BroadCast4T*1000, BroadCast4M, monsterAmount, monsterMinions, bossName, allArea) addEvent(doIncendio, BroadCast4T*1002, fromArea, toArea, idArvoresG, idArvoresP, fogoNoChao, chanceFogo, FFID, FWID, terraID) -- Fim de Adicionando eventos debugPrint("doIncendio: Incendio iniciado.") setGlobalStorageValue(5001, lastExecution) return TRUE end function BroadCast(BroadCastM, Amount, Monsters, allArea) doBroadcastMessage(BroadCastM,22) local summonPos = {x = 0, y = 0, z = 0} local monsterName = 0 for i = 1, Amount / 4 do monsterName = Monsters[math.random(1, table.maxn(Monsters))] summonPos = allArea[math.random(1, table.maxn(allArea))] doSummonCreature(monsterName, summonPos) end return TRUE end function BroadCastBoss(BroadCastM, Amount, Monsters, BossName, allArea) doBroadcastMessage(BroadCastM,22) local summonPos = {x = 0, y = 0, z = 0} local monsterName = 0 for i = 1, Amount / 4 do monsterName = Monsters[math.random(1, table.maxn(Monsters))] summonPos = allArea[math.random(1, table.maxn(allArea))] doSummonCreature(monsterName, summonPos) end monsterName = Monsters[math.random(1, table.maxn(Monsters))] summonPos = allArea[math.random(1, table.maxn(allArea))] doSummonCreature(BossName, summonPos) return TRUE end -- Incendios function doIncendio(fromArea, toArea, agID, apID, FChao, Chance, FireFieldID, FireWallsID, chaoLib) local arvoreID = 0 local posNow = {x = 0, y = 0, z = 0} local randomFF = math.random(1, table.maxn(FireFieldID)) local chaoID = 0 for t = fromArea.z, toArea.z do -- Área for n = fromArea.y, toArea.y do for i = fromArea.x, toArea.x do posNow = {x = i, y = n, z = t} for ar = 1, table.maxn(apID) do -- Nas árvores pequenas FF arvoreID = getThingFromPos({x = i, y = n, z = t, stackpos = 1}) if arvoreID.itemid == apID[ar] then if Chance >= math.random(1,100) then randomFF = math.random(1, table.maxn(FireFieldID)) doCreateItem(FireFieldID[randomFF], 1, posNow) end end end for ar = 1, table.maxn(agID) do -- Nas árvores grandes FireWall arvoreID = getThingFromPos({x = i, y = n, z = t, stackpos = 1}) if arvoreID.itemid == agID[ar] then if Chance / 4 >= math.random(1,100) then randomFF = math.random(1, table.maxn(FireFieldID)) doCreateItem(FireFieldID[randomFF], 1, posNow) end if Chance >= math.random(1,100) then posNow = {x = i, y = n, z = t} randomFF = math.random(1, table.maxn(FireWallsID)) doCreateItem(FireWallsID[randomFF], 1, posNow) end end end if FChao == TRUE then -- FF no Chão arvoreID = getThingFromPos({x = i, y = n, z = t, stackpos = 1}) chaoID = getThingFromPos({x = i, y = n, z = t, stackpos = STACKPOS_GROUND}) if arvoreID.itemid == 0 then if Chance >= math.random(1,100) then for ch = 1, table.maxn(chaoLib) do if chaoID.itemid == chaoLib[ch] then posNow = {x = i, y = n, z = t} randomFF = math.random(1, table.maxn(FireFieldID)) doCreateItem(FireFieldID[randomFF], 1, posNow) end end end end end end -- Área end end return TRUE end [spoiler=incendioMonster.lua] incendioMonster.lua function onDeath(killer, monster, corpse, damage, totaldamage) -- Configuracao local fromArea = {x = 58, y = 56, z = 7} -- Area que o incendio aconteceu local toArea = {x = 88, y = 82, z = 7}-- Area que o incendio aconteceu local FFID = {1487,1488,1489} -- ID dos Fire Fields local FWID = {5063} -- ID dos FireWalls -- Fim de Configuracao addEvent(doRemoveIncendio, math.random(5,15)*1000, fromArea, toArea, FFID, FWID) return TRUE end function doRemoveIncendio(fromArea, toArea, FFID, FWID) local posNow = {x = 0, y = 0, z = 0, stackpos = 2} local itemRemover = 0 for t = fromArea.z, toArea.z do -- Area for n = fromArea.y, toArea.y do for i = fromArea.x, toArea.x do for it = 1, table.maxn(FFID) do for st = 1, 3 do posNow = {x = i, y = n, z = t, stackpos = st} itemRemover = getThingFromPos(posNow) if itemRemover.itemid == FFID[it] then doRemoveItem(itemRemover.uid) end end end for it = 1, table.maxn(FWID) do for st = 1, 3 do posNow = {x = i, y = n, z = t, stackpos = st} itemRemover = getThingFromPos(posNow) if itemRemover.itemid == FWID[it] then doRemoveItem(itemRemover.uid) end end end end end end return TRUE end [spoiler=The Incendier.xml] The Incendier.xml <?xml version="1.0" encoding="UTF-8"?> <monster name="The Incendier" nameDescription="the Incendier" race="fire" experience="2900" speed="300" manacost="0" script="incendio.lua"> <health now="2560" max="2560"/> <look type="243" corpse="6324"/> <targetchange interval="5000" chance="8"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="0"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="0"/> <flag convinceable="0"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag canpushcreatures="1"/> <flag targetdistance="4"/> <flag staticattack="90"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="2000" min="-30" max="-100"/> <attack name="firefield" interval="3000" chance="80" range="7" radius="4" target="0"> <attribute key="shootEffect" value="fire"/> </attack> <attack name="fire" interval="1000" chance="65" range="7" radius="4" target="1" min="-80" max="-885"> <attribute key="shootEffect" value="fire"/> <attribute key="areaEffect" value="firearea"/> </attack> </attacks> <defenses armor="35" defense="40"> </defenses> <elements> <element firePercent="100"/> <element energyPercent="40"/> <element physicalPercent="24"/> <element deathPercent="22"/> <element icePercent="-20"/> </elements> <immunities> <immunity paralyze="1"/> <immunity invisible="1"/> </immunities> <voices interval="5000" chance="10"> </voices> <loot> <item id="2148" countmax="100" chance1="100000" chancemax="0"/> --Gold Coin <item id="2147" countmax="4" chance1="8888" chancemax="0"/> --Small Ruby <item id="7894" chance="8000"/> --magma legs <item id="7899" chance="5000"/> --magma coat <item id="5944" chance="4222"/> --Soul Orb <item id="2239" chance="20000"/> --Burnt Scroll <item id="2136" chance="7666"/> --Demonbone Amulet <item id="2187" chance="40111"/> -- wand of Inferno <item id="2187" chance="20111"/> -- wand of Inferno <item id="1987" chance="100000"> --Bag <inside> <item id="2432" chance="9800"/> --Fire Axe <item id="2145" countmax="8" chance1="15000" chancemax="0"/> --Small Diamond <item id="2392" chance="13550"/> --Fire Sword </inside> </item> </loot> <script> <event name="incendio"/> </script> </monster> Instalando [spoiler=Instalando scripts] Configurando [spoiler=Configurando] Downloads Mapa usado para Teste Scripts Vídeo Este script foi o ganhador do Script tournament #4. Sim, havia apenas um script concorrendo, o meu. Direitos Todo o conteúdo foi desenvolvido por Pivigu (neste fórum com o nick de Pivizz) e deverá, sempre, continuar com seus respectivos créditos. Você pode editar o script do modo que desejar, desde que não remova os créditos. Gostaria que este script não fosse publicado em outro fórum. Desejo que seje exclusivo do OTNET. Obrigado Bugs Este sistema foi testado no servidor The Forgotten Server 0.3 b3 e não apresentou nenhuma mensagem de erro. Caso você receba alguma, poste neste tópico que usarei todo o meu conhecimento para lhe ajudar. Não há nenhum bug conhecido até agora. Prêmios
  16. Obs.: Não funciona nas versões novas, pois elas não tem a função getPlayerFrags(cid) :fuu: Caso alguém consiga transformar aquela query em sql que tem em talkactions\scripts\frags.lua em uma função, eu edito aqui pra funfar nas versões mais novas de TFS :fist: Abração! Olá galera! Reparei que muitos estavam tendo problemas com frags, já que agora não se configura mais o tempo delas pelo config.lua, então a pedidos, resolvi criar um global event que remova todas as frags de 5 em 5 horas. Você pode configurar o tempo que quiser, se quiser fazer isso de 1 em 1 hora, ou de 2 em 2 dias, aí é com você O script é simples, porém bem útil (Y) Vamos lá, faça uma cópia de qualquer arquivo dentro da pasta globalevents\scripts e renomeie para "removeFrags.lua" Agora abra o arquivo, apague tudo que tiver dentro e coloque isso: [b]function onThink(interval, lastExecution, thinkInterval)[/b] [b] l[color=indigo]ocal players = getPlayersOnline()[/color][/b] [b][color=indigo] for _, pid in ipairs(players) do[/color][/b] [b][color=darkslategray]doPlayerSetRedSkullTicks(pid, (getPlayerRedSkullTicks(pid) + getConfigInfo('timeToDecreaseFrags')) * (- getPlayerFrags(pid)))[/color][/b] [color=darkred][b]doCreatureSetSkullType(pid, 0)[/b][/color] [b] end[/b] [b] [color=sienna] doBroadcastMessage("All frags have been removed. Next remotion in [/color][color=red][color=sienna]5 [/color]hours[/color][color=sienna].")[/color][/b] [b] return true[/b] [b]end[/b] Para quem não conseguir, o dragonlorde deu uma ajuda! Use isso: Obs.: Andei estudando LuaSQL e mudei a funçãozinha do dragonlorde, agora deve funcionar [color=#000000][color=#007700]function [/color][color=#0000bb]onThink[/color][color=#007700]([/color][color=#0000bb]interval[/color][color=#007700])[/color] [color=#0000bb]db[/color][color=#007700].[/color][color=#0000bb]executeQuery[/color][color=#007700]([/color][color=#dd0000]"DELETE * FROM `killers`;"[/color][color=#007700])[/color] [color=#0000bb]db[/color][color=#007700].[/color][color=#0000bb]executeQuery[/color][color=#007700]([/color][color=#dd0000]"UPDATE `players` SET skull = 0, skulltime = 0;"[/color][color=#007700])[/color] [color=#0000bb]doBroadcastMessage[/color][color=#007700]([/color][color=#dd0000]"All frags have been removed. Next remotion in 5 hours."[/color][color=#007700])[/color] [color=#007700] return [/color][color=#0000bb]true[/color] [color=#0000bb]end [/color][/color] Agora vá em globalevents.xml e adicione isso: <globalevent name="removeFrags" interval="[color=red]18000[/color]" event="script" value="removeFrags.lua"/> Pronto, agora é só rodar Agora vou explicar o script: Onde está em... Vermelho: É o tempo de intervalo entre uma remoção e outra. 18000 são 5 horas pois 18000 ai está em segundos, e 18000 segundos = 5 horas (Y) Caso queira mudar, já sabe como fazer né? Mas não se esqueça de mudar a mensagem também caso vá mudar o intervalo. Roxo: É uma função pra pegar todos os players online pra mim, e fazer uma ação em cada um deles. Pra quem não entende muito bem, o "pid" ali é o ID do player na qual ela está checando. Verde: É a função que é executada em todos os players. Marrom: É a mensagem que é mandada após a remoção. Bem, é isso, espero ter ajudado, não quero que isso seja apenas um script pra colocarem no OT, quero que seja também um método de aprendizagem para futuros scripts, e quem sabe alguém não pega o meu script e faz um ainda melhor? Abraços, e um bom desenvolvimento a vocês.
  17. Sistema de Radio !!!

    Ai galera eu queria saber se alguem poderia fazer para mim e se é possivel : Eu queria um npc que quando o player disse exemplo : Player : hi NPC : Olá, o que deseja anunciar ? Player : Gostaria de comprar runas feitinhas na hora ? Vem para lojinha do (player), faço na hora, preço baratinho !!!, 5. Explicando : Frase, 5 <<< tempo que o NPC vai ficar falando... Tipo ai o NPC desse 1 preço pro player ai o player fala se aceita ou não... vamos supor cada letra 10 gps, ai o npc somava tudo e falava o preço : NPC : Isso dá o total de : .... , voce concorda em pagar ? Player : Sim. NPC : Sua mensagem será anunciada de 5 em 5 minutos. Ai ficava anunciando a mensagem de 5 em 5 minutos até o servidor fechar. Também podia ser por algum tempo estimado exemplo : Player : [color=Red]Gostaria de comprar runas feitinhas na hora ? Vem para lojinha do (player), faço na hora, preço baratinho !!![/color], [color=Lime]5[/color], [color=Navy]3 vezes[/color]. Vermelho : Mensagem que aparecerá no BroadCast. Verde : De quanto em quanto tempo vai aparecer. Azul : Quantas vezes. Ai o NPC calculava e fazia o que eu disse acima. Se der pra fazer me avise... Se alguem fizer, por favor me passe o script ? E claro disponibilize para todo munfo !!!
  18. Sistema Vip Por Sql Para Tfs 2.0

    Nome: Sistema Vip Por Sql Para Tfs . Versão: 2.0 . Tipo do script: action, talkaction . Servidor Testado: Tfs 0.3.3.147 . Autor: Luke sky walker Comentario: Sistema vip que tem por finalidade facilitar a vida dos ADMs de Otserv fácil fazer e configurar mas vamos deixar de conversinha e vamos ao script! Bom vamos começa primeiro adicionando as tabelas para indicar se o player é vip ou não, tabela que mostra a quantidade de dias e a tabela de define o tempo da vip. Va em seu MySQL e use este query. ALTER TABLE `accounts` ADD `vip` TINYINT( 1 ) NOT NULL DEFAULT '0'; ALTER TABLE `accounts` ADD `vip_days` INT( 11 ) NOT NULL DEFAULT '0'; ALTER TABLE `accounts` ADD `vip_time` INT( 11 ) NOT NULL DEFAULT '0'; Ah tinha esquecido em que parte do mysql faça como está na ss para adicionar a query! http://img2.imageshack.us/img2/7506/imagemeke.jpg Agora vamos colocar a talkaction para poder adicionar a vip e verificar quantos dia de vip dos players. Va em "Data/Talkactions/Talkactions.xml" e adicione. <talkaction log="yes" words="/addvip" access="5" event="script" value="vip.lua"/> <talkaction log="yes" words="/checkvip" access="5" event="script" value="vip.lua"/> Agora crie um script chamado vip.lua na pasta "Data/Talkactions/Scripts" e coloque este codigo abaixo. function onSay(cid, words, param) local Data = string.explode(param, ",") if Data then local Target = db.getResult("SELECT `name` FROM `players` WHERE `name` = " .. db.escapeString(Data[1]) .. ";") if Data then if (Target:getID() ~= -1) then if Data[2] then if (words:sub(2, 2) == "a") then if isNumber(Data[2]) == TRUE then if vipTimeByName(Data[1]) == 0 then db.executeQuery("UPDATE `accounts` SET `vip_time` = 86400 * ".. Data[2] .." + ".. os.time() .." WHERE `accounts`.`id` = ".. getAccountIdByName(Data[1]) ..";") else db.executeQuery("UPDATE `accounts` SET `vip_time` = `accounts`.`vip_time` + (86400 * ".. Data[2] ..") WHERE `accounts`.`id` = ".. getAccountIdByName(Data[1]) ..";") end db.executeQuery("UPDATE `accounts` SET `vip` = 1 WHERE `accounts`.`id` = ".. getAccountIdByName(Data[1]) .." LIMIT 1;") db.executeQuery("UPDATE `accounts` SET `vip_days` = `accounts`.`vip_days` + ".. Data[2] .." WHERE `accounts`.`id` = ".. getAccountIdByName(Data[1]) ..";") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foi adicionado ".. Data[2] .." dias de vip ao player ".. Data[1] ..".") else doPlayerSendCancel(cid, "Insira apenas numeros.") end else doPlayerSendCancel(cid, "Para verificar uma vip não presisa inserir os dias.") end else if (words:sub(2, 2) == "c") then if vipDaysByName(Data[1]) == 0 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "O player ".. Data[1] .." não é vip.") elseif vipDaysByName(Data[1]) == 1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "O player ".. Data[1] .." tem ".. vipDaysByName(Data[1]) .." dia de vip.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "O player ".. Data[1] .." tem ".. vipDaysByName(Data[1]) .." dias de vip.") end else doPlayerSendCancel(cid, "Insira a quantidade de dias que vai adicionar de vip ao player.") end end else doPlayerSendCancel(cid, "Este player ".. Data[1] .." não existe.") end end else doPlayerSendCancel(cid, "Insira um nome.") end return TRUE end Agora vamos em "Data/Libs" e vamos adicionar em "Data.lua" na ultima linha. dofile(getDataDir() .. "Lib/Vip_Functions.lua") Agora vamos criar um script chamado "Vip_Functions.lua" na pasta "Data/Libs" e colocar este codigo abaixo. function vipDays(cid) local Query = db.getResult("SELECT `vip_days` FROM `accounts` WHERE `accounts`.`id` = ".. getPlayerAccountId(cid) ..";") local vip_days = Query:getDataInt("vip_days") return vip_days end function vipDaysByName(cid) local Query = db.getResult("SELECT `vip_days` FROM `accounts` WHERE `accounts`.`id` = ".. getAccountIdByName(cid) ..";") local vip_days = Query:getDataInt("vip_days") return vip_days end function haveVipDays(cid) local Query = db.getResult("SELECT `vip_days` FROM `accounts` WHERE `accounts`.`id` = ".. getPlayerAccountId(cid) ..";") local vip_days = Query:getDataInt("vip_days") return (isPlayer(cid) == TRUE and (vip_days > 0)) and TRUE or FALSE end function haveVipDaysByName(cid) local Query = db.getResult("SELECT `vip_days` FROM `accounts` WHERE `accounts`.`id` = ".. getAccountIdByName(cid) ..";") local vip_days = Query:getDataInt("vip_days") return (isPlayer(cid) == TRUE and (vip_days > 0)) and TRUE or FALSE end function isVip(cid) local Query = db.getResult("SELECT `vip` FROM `accounts` WHERE `accounts`.`id` = ".. getPlayerAccountId(cid) ..";") local vip = Query:getDataInt("vip") return (isPlayer(cid) == TRUE and (vip == 1)) and TRUE or FALSE end function haveVipTime(cid) local Query = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `accounts`.`id` = ".. getPlayerAccountId(cid) ..";") local vip_time = Query:getDataInt("vip_time") return (isPlayer(cid) == TRUE and (vip_time >= 1)) and TRUE or FALSE end function vipTimeByName(cid) local Query = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `accounts`.`id` = ".. getAccountIdByName(cid) ..";") local vip_time = Query:getDataInt("vip_time") return vip_time end function vipTime(cid) local Query = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `accounts`.`id` = ".. getPlayerAccountId(cid) ..";") local vip_time = Query:getDataInt("vip_time") return vip_time end Agora iremos colocar os creture script que faz a remoção automatica dos dias da vip e teleporta os chars para o temple quando acaba a vip! Vamos em "Data\Creaturescripts" e abriremos o script "Login.lua" e adicione o codigo abaixo. if vipTime(cid) >= 1 then if vipTime(cid) >= os.time() then db.executeQuery("UPDATE `accounts` SET `vip_days` = ".. (vipTime(cid) - os.time()) / 86400 .." WHERE `accounts`.`id` = ".. getPlayerAccountId(cid) ..";") else db.executeQuery("UPDATE `accounts` SET `vip_time` = 0 WHERE `accounts`.`id` = ".. getPlayerAccountId(cid) ..";") db.executeQuery("UPDATE `accounts` SET `vip_days` = 0 WHERE `accounts`.`id` = ".. getPlayerAccountId(cid) ..";") end end if haveVipDays(cid) == FALSE then if isVip(cid) == TRUE then db.executeQuery("UPDATE `players` SET `town_id` = [color=#0000ff]1[/color], `posx` = [color=#ff0000]X[/color], `posy` = [color=#ff0000]Y[/color], `posz` = [color=#ff0000]Z[/color] WHERE `players`.`account_id` = ".. getPlayerAccountId(cid) ..";") db.executeQuery("UPDATE `accounts` SET `vip` = '0' WHERE `accounts`.`id` = ".. getPlayerAccountId(cid) ..";") local Position = getTownTemplePosition(1) doTeleportThing(cid, Position) doSendMagicEffect(Position, 10) doPlayerSetTown(cid, [color=#0000ff]1[/color]) end end OBS = Coloque as coordenadas do templo da cidade principal. OBS = Coloque ID da cidade principal. Agora iremos cria uma action que no tile que tiver o actionID 1000 tera que ser player vip para passar por ele. Va em Movements.xml e adicione. <movevent type="StepIn" actionid="1000" event="script" value="Viptile.lua"/> Agora crie um scripts chamado Viptile.lua na pasta scripts function onStepIn(cid, item, position, fromPosition) if isVip(cid) == FALSE then doTeleportThing(cid, fromPosition) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não é um player vip para poder passar por aqui.") end return TRUE end Exemplos de como adicionar vip e remover e verificar se o player é vip. Exemplo de como adicionar uma vip de 10 dias /addvip Luke sky walker, 10 Exemplo de como verificar se o player é vip e quantos dias de vip ele tem ainda. /checkvip Luke sky walker OBS: Este sistema serve tambem para players offline como online pois é direto por SQL. Detalhe eu so fiz testes basicos não usei ele em server que fica online então se acharem algum erro reporte par min. Espero que tenham gostado pois tive um bom trabalho para cria este script e decidi disponibiliza a vocês! Que usam um sistema de vip. *OBS: Créditos todos do Luke Sky Walker não fiz nada a não ser trazer este Tópico para Otserv comenten e não tirem os devidos créditos!:yes:
  19. Escalar System

    E ae Galera, Vo postar aqui um script que pode ser util pra qm gostad e rpg e usa mta criatividade! Agora o Script!Vá em actions/tolls e add um arkivo chamado Scall.lua dentro dele cole isto: local holeId = {[color=Blue]3369, 7062, 7064, 7066, 392, 408, 409, 427, 428, 430, 462, 469, 470, 482, 484, 485, 489, 924, 3135, 3136[/color]} function onUse(cid, item, fromPosition, itemEx, toPosition) local groundTile = getThingfromPos(toPosition) if groundTile.itemid == 7062 or groundTile.itemid == 7066 or groundTile.itemid == [color=Red]3362[/color] then doTeleportThing(cid, {x = toPosition.x, y = toPosition.y - 1, z = toPosition.z - 1}, FALSE) elseif isInArray(holeId, itemEx.itemid) == TRUE then local hole = getThingfromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}) if hole.itemid > 0 then doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, FALSE) else doPlayerSendCancel(cid, "Sorry, not possible.") end else return FALSE end return TRUE end Depois vá em actions.xml e coloque: ----------CONFIGURANDO--------- é o id da corda, no caso a elvenhair é os pisos aond pode ter a montanha/parede é o id da montanha/parede que vc vai escalar! pronto Configure e gogo rpg! c quiser deichar assim eh melhor... pois voce pod bugar algo...c vc souber mudar direitin, use a criatividade! Nesse script vc esacala a Stone wall com a elvehair rope! Ate a proxima! :yes:
  20. [8.0+]Mining System com skill

    Criei alguns sitemas com skill a algum tempo, não estava muito organizado então eu arrumei e descide postar aki um deles pra quem quiser. Modo de uso: Com uma pick em sua mão direita,de use nela e click no piso com id especificado no script.Desse modo,upando skill de mining,ira ficar cada ve mais facil encoontrar algo. Para mais informações dêem uma olhada no script. miningbykemix.lua Adicione isso no actions.xml Beijus i aproveitem! :style:
  21. SE TIVER NA AREA ERRADA, FOI MAL. (Y) Eu to precisando de um sistema de guerra para pvp (de up level), seria mais ou menos assim: Seria +- assim > Sao 2 ou 3 reinos que estao em guerra e ocorre guerra (com data fixa) todo sabado, quando róla a guerra se um jogador da mesma cidade mata outro ele pega frag normal, mas se ele mata um jogador de outra cidade ele não pega frag nenhuma. Tem como fazer isso? =o
×