Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''script''.



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 67 registros

  1. TFS 1.0 Skill Point System

    Opa galera, eu vi esse script em outro fórum e trouxe aqui para compartilhar com vocês porque achei a ideia bacana. O script é uma forma de customizar seu personagem à medida que ele vai avançando de level. O avanço de level dá ao jogador "pontos", os quais podem ser utilizados para comprar HP, MP e niveis de skills. O grande benefício desse sistema é que jogadores de um mesmo level podem ser radicalmente diferentes e podem se especializar, como no caso de uma equipe/time (um druida com pontos pode se especializar em HP e MP e virar o healer do time, enquanto um knight pode se especializar somente skills para ser o atacante e outro em HP para ser o tank e bloquer) Algumas imagens do funcionamento (retiradas do outro tópico original): Agora que já se interessou pelo sistema, vamos aplicá-lo em nosso servidor! Em /creaturescripts/scripts/skillpoints.lua local SkillPoints = { [1] = 1, [2] = 1, [3] = 1, [4] = 1, [5] = 1, [6] = 1, [7] = 1, [8] = 1, } function onAdvance(cid, skill, oldlevel, newlevel) if not (SkillPoints[getPlayerVocation(cid)]) then return true end if (skill == 8) then if (getPlayerStorageValue(cid, 14573) < newlevel) then if (getPlayerStorageValue(cid, 14574) < 0) then setPlayerStorageValue(cid, 14574, 0) setPlayerStorageValue(cid, 14573, 0) end setPlayerStorageValue(cid, 14573, newlevel) setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) + (newlevel - oldlevel) * (SkillPoints[getPlayerVocation(cid)])) doCreatureSay(cid, '+1 Skill Point!', TALKTYPE_ORANGE_1) end end return true endEm /creaturescripts/scripts/login.lua, adicione player:registerEvent("SkillPointSystem")Em /creaturescripts/creaturescripts.xml, adicione <event type="advance" name="SkillPointSystem" script="skillpoints.lua"/>Em /talkactions/scripts/skillpoints.lua local SkillPoints = { [1] = 1, [2] = 1, [3] = 1, [4] = 1, [5] = 1, [6] = 1, [7] = 1, [8] = 1, } function onSay(cid, words, param) local player = Player(cid) local vocation = Player(cid) if not (SkillPoints[getPlayerVocation(cid)]) then return false end local param = param:lower() local p2 = param:split(",") if (getPlayerStorageValue(cid, 14574) < 0) then setPlayerStorageValue(cid, 14574, 0) end local skillids = { ["shielding"] = 5, ["sword"] = 2, ["axe"] = 3, ["club"] = 1, ["fist"] = 0, ["distance"] = 4 } local attributes = { ["health"] = {np = 1, vl = 2, skn = "Hit Points"}, ["energy"] = {np = 1, vl = 2, skn = "Mana Points"}, ["magic"] = {np = 15, vl = 1, skn = "Magic Level"}, ["shielding"] = {np = 15, vl = 1, skn = "Shielding Skill"}, ["sword"] = {np = 15, vl = 1, skn = "Sword Skill"}, ["axe"] = {np = 15, vl = 1, skn = "Axe Skill"}, ["club"] = {np = 15, vl = 1, skn = "Club Skill"}, ["fist"] = {np = 15, vl = 1, skn = "Fist Skill"}, ["distance"] = {np = 15, vl = 1, skn = "Distance Skill"}, } if (param == "check") then doPlayerPopupFYI(cid, "<<<<< Skill Points >>>>> \n\nPoints Available: ".. getPlayerStorageValue(cid, 14574) .."\nPoints Per Level: ".. SkillPoints[getPlayerVocation(cid)]) elseif (p2[1] and p2[1] == "add") and (attributes[p2[2]]) and (tonumber(p2[3])) then local creature = Creature(cid) local cpos = creature:getPosition() if (getPlayerStorageValue(cid, 14574) < tonumber(p2[3]) * attributes[p2[2]].np) then doPlayerSendCancel(cid, "you need more skill points go hunt!") return cpos:sendMagicEffect(CONST_ME_POFF) end if (p2[2] == "health") then player:setMaxHealth(player:getMaxHealth() + attributes[p2[2]].vl * tonumber(p2[3])) player:addHealth(attributes[p2[2]].vl * tonumber(p2[3])) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been rewarded with ".. tonumber(p2[3]) * attributes[p2[2]].vl .. "Hit Points") elseif (p2[2] == "energy") then player:setMaxMana(player:getMaxMana() + attributes[p2[2]].vl * tonumber(p2[3])) player:addMana(attributes[p2[2]].vl * tonumber(p2[3])) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been rewarded with ".. tonumber(p2[3]) * attributes[p2[2]].vl .. "Mana Points") elseif (p2[2] == "magic") then player:addManaSpent(math.ceil((Vocation(getPlayerVocation(cid)):getRequiredManaSpent(player:getBaseMagicLevel() + 1) - player:getManaSpent()) / configManager.getNumber(configKeys.RATE_MAGIC))) ---Player receives message on Skill Advance elseif(skillids[p2[2]]) then for a = 1, tonumber(p2[3]) do player:addSkillTries(skillids[p2[2]], player:getVocation():getRequiredSkillTries(skillids[p2[2]], player:getSkillLevel(skillids[p2[2]]) + 1) - player:getSkillTries(skillids[p2[2]])) --Player receives message on Level Advance end end setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) - tonumber(p2[3]) * attributes[p2[2]].np) else local msgx = "" for i, v in pairs(attributes) do local add = (v.np > 1) and "s" or "" msgx = msgx .. string.upper(i:sub(1,1)) .. i:sub(2, #i) .. " - ".. v.np .. " points".. add .. " = " .. v.vl .. " ".. v.skn .. "\n" end doPlayerPopupFYI(cid, " <<<<<<<< Add Skill Points >>>>>>>> \n\n Skill Points are used to customize your character\n\n".. msgx .. "\nExample of Use: ".. words .." add,health, 1\n\nPoints available: ".. getPlayerStorageValue(cid, 14574)) end return true endEm /talkactions/talkactions.xml, adicione <talkaction words="!points" separator=" " script="skillpoints.lua"/>Se gostou, poste!<Não testei o script, embora tenham garantido no outro fórum que está funcionando... se não funcionar, poste no próprio tópico os erros relacionados a esse script ou então em nossa seção de dúvidas de scripting (http://forums.otserv.com.br/index.php/forum/170-dúvidas/)>
  2. Funções iteradoras em Lua

    Iteradores são funções especiais criadas para iterar, ou seja, percorrer, listas, vetores (arrays), matrizes, tabelas ou o que quisermos. Nós criamos iteradores para usar na função for. Um exemplo de iterador que você já deve conhecer é o pairs. Vamos supor que eu tenha a seguinte tabela: k = {1, 2, 3, 4, 5} E eu queira iterar por todos eles imprimindo o seu quadrado. Como faríamos isso? Casualmente, o código seria este: for i = 1, 5 do print(i ^ 2) end Mas e se eu quiser fazer isso várias vezes? Com uma lista que não segue um padrão? Então criamos um iterador, mas primeiro, vamos entender a estrutura de um em pseudocódigo Lua: function iterator(values) local pos = 0 --posição do iterador na lista return function() pos = pos + 1 if values[pos] ~= nil then return values[pos] end return nil end end Perceba que eu não retorno um valor especifico ao chamar a função iterator(), eu retorno uma nova função. Essa função será chamada pelo for até que seu retorno seja nil, onde Lua assume que o iterador acabou. E como eu sei quando acaba? Simples, há uma variável (chamei, neste caso, de pos) que armazena a posição dentro do array values do próximo valor a ser retornado. A cada iteração, o valor aumenta em 1 dentro da função. Quando eu acessar um índice dentro do array que não existe, seu valor (values[pos]) será nil, portanto eu testo essa condição. Parece bastante complexo, mas vamos voltar ao exemplo do quadrado. Chamarei minha função iteradora de square: function square(numbers) local pos = 0 return function() pos = pos + 1 if values[pos] ~= nil then return values[pos] ^ 2 end return nil end end A cada chamada da função de retorno, eu aumento a posição e retorno este elemento elevado ao quadrado. Então, usarei a função assim: for i in square(k) do print(i) end Que funciona como o esperado: O que mais podemos fazer com iteradores? Podemos, por exemplo, bloquear uma palavra usando a função onTalk do xotservx (pesquise no Google): local palavra = "jujuba" function splitWords(phrase) local pos = 0, words = phrase:gmatch("%w+") return function() pos = pos + 1 if words[pos] ~= nil then return words[pos] end return nil end end function onTalk(cid, type, text, position) for w in splitWords(text) do if w = palavra then return false end end return true end Claro que esse exemplo é bastante simplório, mas demonstra a utilidade dos iteradores. Neste caso, eu testo todas as palavras que o player falou para encontrar uma palavra especifica que eu defini. Podemos transformar isso tudo em um loop while, para você entender um pouco melhor: local words = splitWords(text) while w = words() do if w == nil then break end if w = palavra then return false end end end return true Usando o iterador, ganhamos organização no código e o controle do for. Espero que façam bom uso de iteradores para organizar seus códigos
  3. Upgrade System (DIFERENTE)

    Olá pessoal da Otserv, Tudo beleza ? Como vocês já perceberam eu vou postar um Script de Upgrade (Avá?) Segue os dados do script: Vamos começar, 1º vá na pasta de seu servidor e entre data/actions/scripts e crie um novo arquivo chamado Upgrade.lua Dentro deste arquivo coloque o seguinte código: (EXPLICAÇÕES NO SCRIPT) após isso volte em data/actions e abra actions.xml e adicione a seguinte linha: NESTA COR - Coloque o ID de sua pedra de Upgrade (EXTRA) Como adicionar mais itens ? Simples basta pegar o script e Copiar as seguintes linhas: e coloca-las novamente (lembrando de editar) Ficando de assim: Para Assim: [spoiler=Imagens de como funciona] [ATTACH]5375[/ATTACH] Obrigado, Espero que tenham gostado.
  4. Limitar Guild

    Bem, gostaria de um script, ou config lua, que limitasse o tamanho da guild para no maximo 15 pessoas. Grato quem puder me ajudar.
  5. [Ultilitário] Controle de Script v1

    [C]ontrole de cript Olá, estava sem nada pra fazer, e um belo tempo sem programar, então procurei por um ultilitário para gerenciar scripts .lua, e não achei. Então resolvi criar um. Descrição: O programa gerencia scripts .lua, no caso: actions, creaturescripts, globalevents, movements, npcs, lib, talkactions, e weapons. Fotos do programa: [spoiler=Visualizar] Download: Controle de Script: Link 1: Clique Aqui. / Link 2: Clique Aqui. Scan: Clique Aqui. Créditos: Ronaldo Dias ( Eu, BlueeYakuzy). Gostou ? Comente, e doe V$ ! Caso gostarem, irei fazer um update pra versão 2.
  6. Delay em Escadas.

    [spoiler=Padrão] Nome: Delay em Escadas; Autor: MiltonHit, Mirto; Testada: Sim, TFS 0.3.6 (8.54). Olá, hoje vou postar um script muito simples, porém bastante legal e útil. Ele é o seguinte, quando o player sobe ou desce uma escada, o script faz o player esperar um tempo configurável não repetir a mesma ação, ou seja, ele terá de esperar o tempo que você determinar para subir ou descer alguma escada novamente, ideal para servidores que tem muito PvP de escadas. Em data/movements/scripts copie um arquivo qualquer .lua e renomeie para stairs.lua, apague tudo que estiver la dentro e coloque o seguinte code: function onStepIn(cid, item, position, fromPosition) local storage = 89301 --storage gravada local delay = 1 --tempo configuravel do delay if (getPlayerStorageValue(cid, storage) <= os.time()) then setPlayerStorageValue(cid, storage, os.time()+delay) return true else doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "Wait one moment for use this stair.") end return true end Bom, agora vem a parte mais "chata", você precisa setar o id de todas escadas do servidor, tanto as que descem quanto as que sobem, eu vou postar a lista que eu fiz para o meu servidor (8.54) mais se o seu servidor for outra versão com certeza você terá de alterar os IDS, vá em data/movements/movements.xml e adicione a seguinte linha: <movevent type="StepIn" itemid="459;8564;8565;8566;8560;8561;8562;8563;8559;6924;6923;6922;6918;6919;6920;6917;9574;480;5259;5260;3687;3688;9573;1388;1390;1392;1394;5258;6921;6130;6129;6128;411;423;4836;9846;432;433;4837;475;429;3138;8282;476;3219;3220;8283;479;4834;4835;7925;7924;1396;1385;8372;6915;6913;6911;6909;3685;3683;3681;8374;8376;8378" event="script" value="stairs.lua"/> Pronto, está tudo instalado! Só não se esqueça que se você não configurar essa linha acima de acordo com o seu servidor, você poderá ter problemas. Abraços, qualquer coisa dá um grito.
  7. Nãot em área de Show-off vejam!

    Bom, como dito no titulo, não há áreas de show-off para scripts, por tanto, estou postando aqui. Eu fiz este "Script" super pequeno, que da tantos % de exp para quem for da guild dona do WoE, más eu não estou conseguindo ligar meu servidor, para testar, então pesso que testem e depois avaliem ou deem dicas, estou começando agora, e espero que este script seja funcional. Outra coisa, eu não consigo postarna área de scripts, fala que eu não tenho autorização.. se não, este script já estaria lá Bom vamos ao que intereça. Creaturescripts/scripts copie e renomeie qlqer 1 para woexp.lua, apague tudo que tiver dentro e ponha isso dentro. function onLogin(cid) local rate = 1.2 local config = { leader = "Voce é lider do castelo então guanha "..((rate - 1)*100).." % de exp a mais agora!", notleader = "Tornesse Lider do castelo e guanhe "..((rate - 1)*100).." % de exp a mais!", } if Woe.guildName(cid) == FALSE then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.notleader) else doPlayerSetExperienceRate(cid, rate) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.leader) end return TRUE end Na creaturescrips.xml adicione: <event type="login" name="WoExp" script="woexp.lua"/> E em login.lua em creaturescripts/scripts adicione: registerCreatureEvent(cid, "WoExp") Por favor, críticas,sugestões,correções, e se tiver faltando alguma coisa, e so falar! Por favor testem, ou se ver algum erro avisem antes, para eu arrumar. Obrigado, espero respostas!!
  8. The Zodiac ~

    ┌──────────────────────────────────────────────────┐ │Nome: Sign of Zodiac │Versão do script: 1.0.0 │Tipo do script: Sistema (Creature Script, Talkaction e Lib) │Servidor Testado: The Forgotten Server 0.4.0 Doomed Elderberry │Autor: Lwkass └──────────────────────────────────────────────────┘ Por mais que o feedback do meu ultimo post (Lib para criar Spell) tenha sido pouco, vou postar mais um script... É um sistema de Signo do Zodíaco, onde cada signo da um bônus (por enquanto apenas 2), a ideia está bem inicial, mas pretende continua-lo. - Características: - Explicando: Para escolher o signo o player deve colocar o dia e o mês do aniversário e o sistema automaticamente coloca o signo, comando: Só para deixar claro como o sistema funciona, usando de exemplo o signo de Leão (Leo) que é do elemento Fire: * Se receber um dano do elemento Fire, absorve 5% (modificável) do dano total, ou seja, o dano seria igual a 95% do que seria (dano absorvido indicado por animatedText). * Se matar um monstro que tenha uma defesa contra Fire maior que 0% ganha bônus de 10% (modificável) da exp total, ou seja, ganha-se 110% (exp extra indicada por animatedText). Se o signo fosse do elemento Earth, então seria a mesma coisa só que com o elemento Earth, se fosse Ice ou Lighting a mesma coisa. Pode-se usar o comando !zodiac info para informações. - Script: Primeiro, na pasta data/lib (caso a pasta não exista, crie) do seu servidor crie um arquivo Lua com o nome zodiac-Lib.lua (Lib com maiúscula) e salve com isso dentro: --[[ Sign of Zodiac System v1.0.0 by: Lwkass ([email protected]) ]] Zodiac = { constant = { OPTION_PERCENT_BLOCK = 5, -- In Percent OPTION_EXTRA_EXP_RATE = 10, -- In Percent STORAGE_SIGN = 16161, elements = { ["Fire"] = { combat = COMBAT_FIREDAMAGE, color = COLOR_ORANGE }, ["Earth"] = { combat = COMBAT_EARTHDAMAGE, color = COLOR_LIGHTGREEN }, ["Lighting"] = { combat = COMBAT_ENERGYDAMAGE, color = COLOR_TEAL }, ["Ice"] = { combat = COMBAT_ICEDAMAGE, color = COLOR_LIGHTBLUE } } }, signs = { ["Aries"] = { date = {"21/03", "20/04"}, element = "Fire" }, ["Taurus"] = { date = {"21/04", "20/05"}, element = "Earth" }, ["Gemini"] = { date = {"21/05", "20/06"}, element = "Lighting" }, ["Cancer"] = { date = {"21/06", "21/07"}, element = "Ice" }, ["Leo"] = { date = {"22/07", "22/08"}, element = "Fire" }, ["Virgo"] = { date = {"23/08", "22/09"}, element = "Earth" }, ["Libra"] = { date = {"23/09", "22/10"}, element = "Lighting" }, ["Scorpio"] = { date = {"23/10", "21/11"}, element = "Ice" }, ["Sagittarius"] = { date = {"22/11", "21/12"}, element = "Fire" }, ["Capricorn"] = { date = {"22/12", "20/01"}, element = "Earth" }, ["Aquarius"] = { date = {"21/01", "19/02"}, element = "Lighting" }, ["Pisces"] = { date = {"20/02", "20/03"}, element = "Ice" } }, getSignInfo = function (signName) return Zodiac.signs[signName] end, set = function (cid, signName) setPlayerStorageValue(cid, Zodiac.constant.STORAGE_SIGN, signName) end, get = function (cid) return getPlayerStorageValue(cid, Zodiac.constant.STORAGE_SIGN), Zodiac.getSignInfo(getPlayerStorageValue(cid, Zodiac.constant.STORAGE_SIGN)) or 0 end, getElement = function (cid) return Zodiac.getSignInfo(getPlayerStorageValue(cid, Zodiac.constant.STORAGE_SIGN)).element end, getSign = function (cid, day, month) for sign, info in pairs(Zodiac.signs) do _, _, beginDay, beginMonth = info.date[1]:find("(%d+)/(%d+)") _, _, endDay, endMonth = info.date[2]:find("(%d+)/(%d+)") beginDay, beginMonth, endDay, endMonth = tonumber(beginDay), tonumber(beginMonth), tonumber(endDay), tonumber(endMonth) if ((month == beginMonth and day >= beginDay) or (month == endMonth and day <= endDay)) then return sign, info end end end } Agora na pasta data/creaturescripts/scripts: No arquivo login.lua adicione isso antes do return: -- Zodiac registerCreatureEvent(cid, "zodiacKill") registerCreatureEvent(cid, "zodiacStats") if (getPlayerLastLogin(cid) <= 0 or getPlayerStorageValue(cid, 16160) == 1) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Please, when is your birthday date ? (Example: !zodiac day/month = !zodiac 1/2, !zodiac 23/7,...)") setPlayerStorageValue(cid, 16160, 1) -- Talk state else doPlayerSetSpecialDescription(cid, ", sign of " .. getPlayerStorageValue(cid, 16161)) end E crie esses arquivos: zodiacKill.lua dofile('data/lib/zodiac-Lib.lua') function getMonsterPath(monstername) f = io.open ("data/monster/monsters.xml", 'r') for line in f:lines() do _, _, name, path, file_name = string.find(line, '<monster name="(.+)" file="(.+)/(.+).xml"/>') if (name and path and file_name and name:lower() == monstername:lower()) then f:close() return path .. "/" .. file_name .. ".xml" end end end function getMonsterElementDefense(monstername, element) f = io.open ("data/monster/" .. getMonsterPath(monstername), 'r') for line in f:lines() do if (string.find(line, '</elements>')) then break end _, _, n = string.find(line, '<element '.. element:lower() ..'Percent="([-%d]+)"/>') if (n) then f:close() return tonumber(n) end end f:close() return 0 end ------- function onKill(cid, target, lastHit) if (isMonster(target) and getMonsterElementDefense(getCreatureName(target), (Zodiac.getElement(cid) == "Lighting" and "Energy" or Zodiac.getElement(cid))) > 0) then local exp_bonus = math.ceil(getMonsterInfo(getCreatureName(target)).experience * (Zodiac.constant.OPTION_EXTRA_EXP_RATE/100)) doSendAnimatedText(getThingPos(cid), exp_bonus, COLOR_GREY) doPlayerAddExperience(cid, exp_bonus) end return true end zodiacStats.lua dofile('data/lib/zodiac-Lib.lua') function onStatsChange(cid, attacker, type, combat, value) playerSign = Zodiac.get(cid) if (combat == Zodiac.constant.elements[Zodiac.getElement(cid)].combat) then valuem = math.ceil(value*(Zodiac.constant.OPTION_PERCENT_BLOCK/100)) doCreatureAddHealth(cid, valuem) doSendAnimatedText(getThingPos(cid), "+"..valuem, Zodiac.constant.elements[Zodiac.getElement(cid)].color) end return true end Certo, agora no arquivo data/creaturescripts/creaturescripts.xml, adicione isso: <event type="statschange" name="zodiacStats" event="script" value="zodiacStats.lua"/> <event type="kill" name="zodiacKill" event="script" value="zodiacKill.lua"/> Na pasta data/talkactions/scripts, adicione um arquivo Lua com o nome de zodiacTalk.lua: dofile('data/lib/zodiac-Lib.lua') function onSay(cid, words, param, channel) if (param:len() == 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can use '!zodiac day/month' or '!zodiac info'") return true end playerSign, Info = Zodiac.get(cid) if (type(playerSign) == "string" and param:lower() == "info") then doPlayerPopupFYI(cid, [[ Zodiac Informations ~ ------------------------------- * Sign: ]] .. playerSign .. [[ * Element: ]] .. Info.element .. [[ * Bonus: +]] .. Zodiac.constant.OPTION_EXTRA_EXP_RATE .. [[% experience of ]] .. Zodiac.getElement(cid) .. [[ monsters +]] .. Zodiac.constant.OPTION_PERCENT_BLOCK .. [[% of defense in attacks with ]] .. Zodiac.getElement(cid) .. [[ element ]]) elseif (getPlayerStorageValue(cid, 16160) == 1) then _, _, day, month = string.find(param, "(%d+)/(%d+)") day, month = tonumber(day), tonumber(month) if (day and month and day > 0 and day <= 31 and month > 0 and month <= 12) then Zodiac.set(cid, Zodiac.getSign(cid, day, month)) playerSign = Zodiac.get(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param) doSendMagicEffect(getThingPos(cid), math.random(28, 30)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You sign of zodiac is " .. playerSign .. " which is of element " .. Zodiac.getElement(cid) .. " !") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can see more information saying '!zodiac info', remember this...") setPlayerStorageValue(cid, 16160, -1) else doPlayerSendCancel(cid, "You put a invalid date.") end end return true end Coloque essa tag no arquivo data/talkactions/talkactions.xml <talkaction words="!zodiac" event="script" value="zodiacTalk.lua"/> ChangeLog: E é isso ! Qualquer dúvida, sugestão, critica só dizer ^^
  9. Lib Spell (POO) !

    ┌───────────────────────────────────────────────┐ │Nome: Spell System │Versão do script: 1.0.0 │Tipo do script: System/Lib │Servidor Testado: The Forgotten Server 0.4.0 Crying Damson │Autor: Lwkass └───────────────────────────────────────────────┘ Bem, é uma lib que criei para criação de spells, também para mostrar um sistema com "POO" em lua, já vou dizendo que não é super super útil (talvez seja para alguns), mas como eu estava com vontade de fazer pode acabar ajudando a diminuir codes também. Caracteristicas: Script: Apenas um script, crie um arquivo Lua com o nome de Spell-class.lua na pasta data/lib: --[[ @ Spell System By Lwkass form OTServerBrasil ! @ Version: 1.0.0 - Any questions (msn): [email protected] ]] ----------===================------------- ---- CONFIGURATIONS ----------===================------------- SpellOptions = { sendCastSay = true, -- true = Vai mandar uma mensagem sempre que usar uma spell showAnimatedValues = true, -- true = Ativa efeito animado onlySpellOwnerSeeAnimation = true -- true = Apenas o usuario da spell ve a animacao } ---- Constantes SPELL_TYPE_DIRECTION = 0 SPELL_TYPE_AREA = 1 ----------===================------------- ---- GENERAL FUNCTIONS ----------===================------------- function getPosByArea(area, topleftpos) arr = {} for y, a in pairs(area) do arr[y] = {} for x, tile in pairs(a) do arr[y][x] = {x=(x-1)+topleftpos.x, y=(y-1)+topleftpos.y, z=topleftpos.z} end end return arr end function rotateArea(area, angle) final = {} angle = math.rad(angle) for y, a in pairs(area) do for x, tile in pairs(a) do temp = {x = (x * math.cos(angle) + y * math.sin(angle)), y = (x * (-math.sin(angle)) + y * math.cos(angle))} e_x, e_y = (temp.x < 0 and #a + (temp.x) + 1 or temp.x), ((temp.y < 0 and #area + (temp.y) + 1 or temp.y)) final[e_y] = final[e_y] or {} table.insert(final[e_y], e_x, tile or 0) end end return final end ----------===================------------- SpellTile = {} function SpellTile:create(combat, effect, damage) --[[ - Cria uma SpellTile Param: #1 (combat) = combat para o tile, válido todos os combats do tibia (exemplo: COMBAT_PHYSICALDAMAGE, COMBAT_ENERGYDAMAGE, COMBAT_MANADRAIN, etc...) #2 (effect) = efeito para o tile, válido todos os efeitos do tibia (exemplo: CONST_ME_DRAWBLOOD, CONST_ME_LOSEENERGY, CONST_ME_POOF, etc...) #3 (damage) = tabela de dano, que deve seguir esse modelo: {min = -dano_minimo, max = -dano_maximo} ]] return setmetatable({ combat = combat, effect = effect, damage = damage }, { __index = self }) end function SpellTile:setCondition(condition) --[[ - Define uma condição para o SpellTile e retorna uma cópia do próprio SpellTile Param: #1 (condition) = Precisa ser uma condition válida do tibia, exemplo: condition = createConditionObject(CONDITION_POISON) setConditionParam(condition, CONDITION_PARAM_DELAYED, 1) addDamageCondition(condition, 10, 2000, -10) ]] copy = SpellTile:create(self.combat, self.effect, self.damage) copy.delay = self.delay copy.center = self.center copy.condition = condition return copy end function SpellTile:setSpellCenter() --[[ - Define que esse SpellTile é o centro da magia e retorna uma cópia do próprio SpellTile ]] copy = SpellTile:create(self.combat, self.effect, self.damage) copy.delay = self.delay copy.center = true return copy end function SpellTile:delay(mili) --[[ - Define um delay para lançar o spelltile e retorna uma cópia do próprio SpellTile Param: #1 (mili) = Tempo em milisegundos até lançar o spelltile ]] copy = SpellTile:create(self.combat, self.effect, self.damage) copy.delay = mili return copy end ----------===================------------- --[[ @ Spell System By Lwkass form OTServerBrasil ! @ Version: 1.0.0 - Any questions (msn): [email protected] ]] ----------===================------------- Spell = {} -- Construtor function Spell:create(spellwords, spelltype, options) --[[ - Cria uma nova spell Param: #1 (spellwords) = Palavras mágicas da spell #2 (spelltype) = Tipo da spell, é necessário utilizar os valores que estão no Spell-class.lua, por exemplo: SPELL_TYPE_DIRECTION (para spell com direção) ou SPELL_TYPE_AREA (para spell com area) #3 (options) = uma tabela com opções da spell, pode possuir esses valores (não é necessário colocar todos !): options = { level = 1, -- Level necessario maglevel = 1, -- Magic Level necessario mana = 100, -- Mana necessaria maxDistance = 3, -- Distancia máxima needWeapon = true, -- Se precisa estar usando alguma arma vocation = {1,2,3,4,5}, -- Vocações que podem usar a magia sex = 0, -- Sexo que pode usar a magia group = 2 -- Group minimo para usar a magia } ]] return setmetatable({ spellwords = spellwords, spelltype = spelltype, level = options and options.level or 0, maglevel = options and options.maglevel or 0, mana = options and options.mana or 0, options = options or {} }, { __index = self }) end -- Setters & Getters function Spell:setArea(area) --[[ - Define a area da spell Param: #1 (area) = Uma tabela que segue o modelo padrão de magias (exemplo: {{1,1,1},{1,1,1},{0,3,1}}) ]] self.area = area end function Spell:setOption(option, value) --[[ - Define as opções Param: #1 (option) = opção (exemplo: mana, level...) #2 (value) = valor ou novo valor ]] self.options = self.options or {} self.options[option] = value end function Spell:setMaxDistance(n) --[[ - Define a distancia máxima para usar a spell, pode-se definir direto através da tabela options também (maxDistance = distancia) Param: #1 (n) = Distancia máxima ]] self:setOption("maxDistance", n) end function Spell:setDefaultTile(tile) --[[ - Define a spellTile padrão para a spell (usa-se a marcação 1 na area) Param: #1 (tile) = precisa ser um spellTile ]] self.dftTile = tile end -- Others function Spell:getCreatureMark() --[[ - Procura e retorna a posição do tile que seja igual a 3 ou que esteja com a marcação tile.center = true ]] for y, b in pairs(self.area) do for x, d in pairs( do if ((type(d) == "table" and d.center) or d == 3) then return {x = x,y = y} end end end end -- Main Function function Spell:cast(cid, target) --[[ - Lança a magia Param: #1 (cid) = usuario da magia #2 (target) = alvo da magia (se necessário) ]] if (not isCreature(cid)) then return print('[spellClass - Warning / "'.. self.spellwords ..'"]: The cid must be a creature !') end -- Target checks if (target) then if (not isCreature(target)) then -- Target is not selected return doPlayerSendCancel(cid, "You need a target.") end if (self.spelltype == SPELL_TYPE_DIRECTION) then return print('[spellClass - Warning / "'.. self.spellwords ..'"]: Set the spelltype to SPELL_TYPE_AREA or remove the param target from the method \'cast\' !') end end -- Options for option, value in pairs(self.options) do if (target and option == "maxDistance" and type(value) == "number") then if (getDistanceBetween(getThingPos(cid), getThingPos(target)) > value) then return doPlayerSendCancel(cid, "Target too far.") end elseif (option == "needWeapon" and value) then if (getPlayerWeapon(cid).uid == 0) then return doPlayerSendCancel(cid, "You need be using a weapon.") end elseif (option == "vocation" and type(value) == "table") then if (not isInArray(value, getPlayerVocation(cid))) then return doPlayerSendCancel(cid, "Your vocation can't use this spell.") end elseif (option == "sex" and type(value) == "number") then if (not getPlayerSex(cid) == value) then return doPlayerSendCancel(cid, "Your sex can't use this spell.") end elseif (option == "group" and type(value) == "number") then if (not getPlayerGroupId(cid) >= value) then return doPlayerSendCancel(cid, "You can't use this spell.") end end end -- Cid checks if (isPlayer(cid)) then if (getPlayerLevel(cid) >= self.level) then if (getPlayerMagLevel(cid) >= self.maglevel) then if (getCreatureMana(cid) >= self.mana) then doCreatureAddMana(cid, -(self.mana)) if (SpellOptions.showAnimatedValues) then doSendAnimatedText(getThingPos(cid), self.mana, COLOR_PURPLE, (SpellOptions.onlySpellOwnerSeeAnimation and cid or false)) end else return doPlayerSendCancel(cid, "You need " .. self.mana .. " of mana to use this spell.") end else return doPlayerSendCancel(cid, "You need magic level " .. self.maglevel .. " or greater to use this spell.") end else return doPlayerSendCancel(cid, "You need level " .. self.level .. " or greater to use this spell.") end end -- Direction change if (self.spelltype == SPELL_TYPE_DIRECTION) then local dir = {[0] = 0, [1] = 270, [2] = 180, [3] = 90} self:setArea(rotateArea(self.area, dir[getCreatureLookDirection(cid)])) end -- Main local playerPos, player = getThingPos((target or cid)), self:getCreatureMark() local theArea = getPosByArea(self.area, {x=playerPos.x - player.x + 1, y=playerPos.y - player.y + 1, z=playerPos.z}) if (SpellOptions.sendCastSay) then doCreatureSay(cid, getCreatureName(cid) .. " casts " .. self.spellwords .. " !", TALKTYPE_MONSTER) end for y, b in pairs(self.area) do for x, _tile in pairs( do local tilePos = theArea[y][x] local tile = ((_tile == 1) and self.dftTile or _tile) if (tile ~= 0 and tile ~= 3) then if (tile.condition) then doAreaCombatCondition(cid, tilePos, {1}, tile.condition, tile.conditionEffect or CONST_ME_NONE) end addEvent(doAreaCombatHealth, tile.delay or -1, cid, tile.combat, tilePos, {1}, tile.damage.min, tile.damage.max, tile.effect) end end end return true end --[[ @ Spell System By Lwkass form OTServerBrasil ! @ Version: 1.0.0 - Any questions (msn): [email protected] ]] Caso seu server não carregue automaticamente o script, tente adicionar essa linha a qualquer outro arquivo lua da pasta lib: dofile('data/lib/Spell-class.lua') Pronto ! Aqui um exemplo de spell com esse sistema: function onCastSpell(cid, var) spell = Spell:create("spell", SPELL_TYPE_DIRECTION, {mana = 100, level = 10, maglevel = 5}) tile = SpellTile:create(COMBAT_PHYSICALDAMAGE, 15, {min = -1, max = -2}):delay(500) spell:setArea({ {tile, tile, tile}, {0, tile, 0}, {0, tile, 0}, {0, 3, 0} }) spell:cast(cid) end Usos: Você pode usar assim também a area se quiser: spell:setArea({ {tile:delay(10), tile, tile:delay(620)}, {0, tile:delay(100), 0}, {0, tile, 0}, {0, 3, 0} }) Cada spelltile vai aparecer no delay que estiver ali marcado e os que não estiverem aparecerão no delay = 500 (que está definido em 'tile'). ---- Para adicionar conditions pode ser feito assim: local condition = createConditionObject(CONDITION_FIRE) setConditionParam(condition, CONDITION_PARAM_DELAYED, 1) addDamageCondition(condition, 10, 2000, -10) spell:setArea({ {tile:delay(10), tile, tile:delay(620)}, {0, tile:delay(100):setCondition(condition), 0}, {0, tile, 0}, {0, 3, 0} }) Apenas o tile que está com o setCondition vai receber a condition ! ---- Para uma spell de area que é lançada em um alvo é necessário deixar a spell dessa maneira: function onCastSpell(cid, var) spell = Spell:create("spell", SPELL_TYPE_AREA, {mana = 100, level = 10, maglevel = 5}) tile = SpellTile:create(COMBAT_PHYSICALDAMAGE, 15, {min = -1, max = -2}):delay(500) spell:setArea({ {tile, tile, tile}, {0, tile, 0}, {0, tile:setSpellCenter(), 0} }) spell:cast(cid, getCreatureTarget(cid)) end ---- Mas caso você queira definir um spelltile como padrão para a spell (Sempre que usar o 1 na area esse spelltile será chamado), você pode fazer assim: function onCastSpell(cid, var) spell = Spell:create("spell", SPELL_TYPE_DIRECTION, {mana = 100, level = 10, maglevel = 5}) spell:setDefaultTile(SpellTile:create(COMBAT_ENERGYDAMAGE, 30, {min = -1, max = -2})) -- Define o tile padrão tile = SpellTile:create(COMBAT_PHYSICALDAMAGE, 15, {min = -1, max = -2}):delay(500) spell:setArea({ {tile, tile, tile}, {1, 1, 1}, {1, tile, 1}, {0, 3, 0} }) spell:cast(cid) end Então sempre que usar o numero 1 na area ele será substituido pelo spelltile padrão ! Todas as funções estão comentadas, em caso de dúvida sobre como usar uma função, leia o código-fonte ou pergunte aqui mesmo
  10. Moeda da Sorte

    Bom galera, o iuniX me deu uma pequena aula de script e decidi me virar. O Script a seguir faz o seguinte: Você dá use na scarab coin (ou se você modificar no item que você escolher) e tem 10% para ganhar 1kk. (Pode usar a scarab coin em eventos ou monstros dificeis como bosses) Abra data/actions/scripts e lá dentro crie uma pasta chamada moedasorte.lua e ponha isso lá dentro: function onUse(cid, item, pos) if math.random(100) <= 10 then doSendMagicEffect(pos, 30) doPlayerAddItem(cid, 2160, 100) end doRemoveItem(item.uid) return true end E adicione isso no actions.xml: <action itemid="2159" event="script" value="moedasorte.lua"/> o 2159 é o ID do scarab coin, se você quizer mudar o item é ali. Pronto, agora sua moeda da sorte está pronta. Obrigado. ps: Agradeço ao Catios por ter visto o pequeno erro que cometi.
  11. OTServ Live Action! Recrutando!

    OTServ Live Action! Ola, Galerinha da OTNET!!! Quanto tempo ein?(Faz tanto tempo que dei até sorte de acertar a Acc deste perfil kkk...) Bom, voltando a ativa, com uma incrível proposta para vocês... Sim realmente isto é uma proposta séria, não é para criação de servidores, formação de qualquer tipo de equipe, ou algo do gênero, eu estou realmente buscando bons programadores e scripters conhecimento nas seguintes áreas, para que eu concretize uma idéia para auxiliar o mundo do Tibia! ..:: Vagas ::.. Administrador Geral, Idealista e Fundador do projeto - Eu(Pedro Michel) Coordenadores: [Vago!], [Vago!] (Estás vagas só serão preenchidas por pessoas realmente de minha confiança dentro do projeto, então por favor não insista em pedi-la!) Analistas(Idealistas) [Vago!], [Vago!] (Estás vagas só serão preenchidas por pessoas realmente por dentro do projeto, que façam boas analises e tirem conclusões exatas de cada fato ocorrido dentro do projeto!) Designer Gráfico [bioquímico], [Vago!] (Procuro bons designers com grande facilidade em criação de interface de programas etc... Isso será discutido via MSN!) Programadores [Vago!], [Vago!], [Vago!] (Será um trabalho mega importante dentro do projeto, só se inscreva se você realmente tem um bom conhecimento na área da criação de softwares!) Scripters de Tibia(.lua) [Vago!], [Vago!], [Vago!], [Vago!] (Será necessário bons scripters na área do Tibia, para ajudar na configuração e na projeção dos códigos de forma que fique "legível"(Isso será discutido via MSN), estou recrutando scripters que tenho conhecimento dês das versões do Tibia 7.6 até as versões atuais(Creio que seja 8.70) ..:: A idéia ::.. Bom como toda boa idéia, ela veio de erros e principalmente do nada! Enquanto eu estudava um pouco de scripts, notei que algumas pessoas tinham mais facilidade em aprender os scripts em forma de códigos(.lua), e outras por formas mais distintas onde elas compreendiam o que tem que é preciso fazer más não sabiam passar para o papel, por isso veio a idéia do OTServ Live Action!(Nome a ser refeito futuramente)! ..:: O Projeto ::.. Bom o projeto em si está na mesa de planejamento (Quase pronto para fluir), por isso preciso de pelo menos 40% das vagas preenchidas para começar os debates, apresentações mais detalhadas e mais a fundo do projeto, tempo para bolar como ira funcionar, demonstrar o que eu quero proporcionar, qual a finalidade, e por fim ir fazendo testes e criações “BETA” a serem divulgadas(OBS: Esse projeto não tem nenhum intuito de fazer propagandas de nenhum local, a não ser que realmente sejamos motivados a isso) Progresso Geral → ░░░░░░░░░░ 0% Progresso para a primeira BETA → ░░░░░░░░░░ 0% ..:: Proposta Inicial ::.. A proposta é de desenvolver um software cuja função seja de auxiliar os players, na hora de desenvolver scripts e seus derivados (OBS: Não estou aqui visando criar um OTScript Live nem nada do gênero, o OTServ Live Action! é outra coisa....), o software em questão tem uma função única, de auxiliar o player que tem mais dificuldade na hora de "botar no papel" o seu script(idéias). Então com tudo eu posso dizer, se o projeto realmente fluir eu digo, adeus códigos complicados e sérias dificuldades, e bem vindo aos anos 2000 onde o processo é mais rápido, pratico e detalhado! (OBS: Não, eu não sou nenhum deus, nem santo milagreiro, só vejo e falo a verdade, e pretendo concretizá-la!). Neste projeto vamos precisar de pessoas realmente qualificadas, que tenham um bom conhecimento tanto na área de scripts(.lua tibia) quanto na área da programação avançada(Vale qualquer programador(Delphi, C, C++, Visual Basic etc...), dês de que atenta todos os pedidos e não tenha muita dificuldade com o planejado pelo projeto, e nem com o pedido de nossos membros. ..:: Forma de Inscrição ::.. (OBS: Todos os membros serão ouvidos, testados, e avaliados!) Bom galerinha conto com a colaboração de vocês! Qualquer e toda duvida que vocês tenham não deixe de postar aqui mesmo no fórum ou no MSN, breve será criado uma comunidade para o mesmo! Até galerinha e muito obrigado! \\Att \\Pedro Michel!
  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. Flexas saindo da Parede.

    Nome: Flexas. Autor: Neon. Versão Testada: Cliente 8.54 - Servidor TFS 0.3.6 Bom vim aqui no Otnet postar um script que tenho em meu Servidor e acho legal para mapas que têem um grande numero de RPG. O que vou mostrar hoje se resume na imagem abaixo. Primeiro passo: -Vá na pasta Movements de seu servidor e crie um arquivo lua com o seguinte código, e salve com o seguinte nome: arrow.lua function onStepIn(cid, item, topos) frompos = {x=52, y=177, z=9} topos = getPlayerPosition(cid) rand = math.random(10,18) rand2 = math.random(1,7) if (isPlayer(cid)) == 1 and rand2 > 2 then doSendDistanceShoot(frompos, topos, CONST_ANI_ARROW) doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -70, -10, CONST_ME_HITAREA) doSendMagicEffect(topos,0) doSendAnimatedText(topos,rand,180) doCreateItem(2019,2,topos) elseif (isPlayer(cid)) == 1 and rand2 == 1 then doSendDistanceShoot(frompos, topos, CONST_ANI_ARROW) doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -70, -10, CONST_ME_HITAREA) doSendMagicEffect(topos,2) else doSendDistanceShoot(frompos, topos, CONST_ANI_ARROW) doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -70, -10, CONST_ME_HITAREA) doSendMagicEffect(topos,3) end return 1 end Segundo passo: - Agora va em Movements.xml e adicione a seguinte tag. <movevent type="StepIn" uniqueid="24241" event="script" value="arrow.lua" /> Terceiro passo: -Adicionar o UniqueId no piso onde voce quer que quando o player passe leve uma flexada. ..:: Configurando ::.. Na seguinte linha, voce coloca o local de onde saira a flexa. X - Y - Z. frompos = {x=[b][i][color=Blue]52[/color][/i][/b], y=[b][i][color=Green]177[/color][/i][/b], z=[b][i][color=Red]9[/color][/i][/b]} Ja nessa linha, voce configura o tanto de Damage que voce quer que o player leve ao pisar no tile. Voce pode variar, como mostra o script. Ali esta para variar os danos entre '70' e '10'. Configure do seu jeito. doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -[b][i][color=Red]70[/color][/i][/b], -[b][i][color=Red]10[/color][/i][/b], CONST_ME_HITAREA) E no Movements.xml voce Coloca o Id que ira no UniqueId em seu MapEditor. <movevent type="StepIn" uniqueid="[b][i][color=Red]24241[/color][/i][/b]" event="script" value="arrow.lua" />
  14. Scripts De Quests Global

    Protocolo (versão do Tibia): 8.57 Servidor utilizado: forgothen Nível de experiência: amador (aprendo fuçando) Adicionais/Informações: Abaixo \/ Olá, estou montando um ot mapa proprio, e para aperfeiçoar ainda mais preciso dos scripts das quests iguais o global, como por exemplo os da Banshee Quest na parte da white e black perl q vc poe uma em cada lado e é teleportado, outro exemplo é a parte da paradox onde o Ghoul arrasta uma caixa pro SQM "x" e uma escada aparece na localização "y". Preciso de TODOS os scripts IGUAIS ao global, por favor se alguem poder me ajudar, qualquer ajuda será bem vinda. Aqui está a lista das quests que preciso de script: Banshee Quest, Black Knight Quest, Bright Sword Quest, Demon Oak, Inquisition, Orc Fortress, Paradox Tower Quest, Pits of Inferno Quest PS: Estou montando uma equipe para o meu ATS, alguem que manje de script/site, fazer 2 servidores na mesma acc (como o global loga em Mythera e Pythera na mesma acc) pode postar aqui qm sabe vc entra pra a equipe. Obrigado.
  15. ## Grupo de MSN para SCRIPTERS da OTNET

    favor apagar
  16. local infos = { autor = "Roku", testada= false, versao = nil } SCRIPT O script, em termos de idéia é fascinante. E tambem, simples =] Ele consiste em um script que vocÊ defini os nomes dos seus jogadores e IP's, se um jogador com qualquer um dos nomes definidos por você entrar em com um IP que nao esteja definido, você pode optar por: • mandar msg em Popup pra esse player, dizendo que ele ta entrando com um IP nao definido. • nao deixar ele entrar, isto é, interromper o login. • avisar a um ou mais players que isso ocorreu. vc tbm pode optar por fazer um log, que quem, quando, e com que ip entro. ai vai ter que criar na pasta do aplicativo do server o arquivo com o seguinte nome: é claro, é um arquivo de texto :palm:O script, em termos de idéia, como dito, é fascinante. Porem aqui os 4 pcs usam a mesma rede portanto tem o mesmo IP. ai nao pude testar nadinha. Peço a alguem que teste pra mim e poste os erros, para que eu corrija. O SCRIPT, PORTANTO, NÃO TEM NENHUMA GARANTIA DE FUNCIONAMENTO POR ENQUANTO. olha, rimo :laugh: ↑: mas tambem nao disse que nao funciona. Eu iria (IRIA, ARG!) explicar tudinho, mas to com sono, preciso tomar banho e to com pressa, por tanto toma ai: local main = { ips = {myHost = 1111111111, myNotebook = 2222222222, myFriendPc = 3333333333}, cNames = {"Roku","GM Roku","CM Roku","GOD Roku"}, whatDo = "noLogin", --[[ If the creature IP isn't found in table, what should be done? Options: "noLogin" or "kick"/"message" or "alert"/"alertSomeone"]] whoAlert = {"Amigo do Roku", "Assistente do Roku", "Pessoa responsavel"}, alertMessage = "Roku IPS System\n::Error\n Your IP Adress are not acepted.", logs = true } function onLogin(cid) if (table.find(main.cNames,getCreatureName(cid)) and not table.find(main.ips, getPlayerIp(cid))) then if (main.whatDo == "noLogin" or main.whatDo == "kick") then return FALSE elseif (main.whatDo == "alert" or main.whatDo == "message") then doShowTextDialog(cid, 2638, main.alertMessage) elseif (main.whatDo == "alertSomeone") then for player = 1, #main.whoAlert do doPlayerPopupFYI(getCreatureByName(main.whoAlert[player]), "Roku IPS System\nDear".. getCreatureName(getCreatureByName(main.whoAlert)) ..",\n::Warring\n Someone has logged in character ".. getCreatureName(cid) .."with a non-acepted IP. The server owner has choosed you to recive this message.") elseif (main.logs == true) then file = io.open("iplog.txt", "a+") file:write(os.date() .." - The character [".. getCreatureName(cid) .."] has logged, with the IP addres [".. getPlayerIp(cid) .."]. The system did the option ".. main.whatDo) file:close() end end return TRUE end return TRUE end salva essa bosta como iplog.lua configura assim: ips = {myHost = 1111111111, myNotebook = 2222222222, myFriendPc = 3333333333}, -> os ips. podem ser varios. coloquei com varias variaveis pra se organizar cNames = {"Roku","GM Roku","CM Roku","GOD Roku"}, -> os chars que voce quer que sejam verificados com o ip whatDo = "noLogin", --[[ If the creature IP isn't found in table, what should be done? Options: "noLogin" or "kick"/"message" or "alert"/"alertSomeone"]] -> nem preciso explica whoAlert = {"Amigo do Roku", "Assistente do Roku", "Pessoa responsavel"}, -> se a opção for alertar alguem, vao ser os sortudos ai alertMessage = "Roku IPS System\n::Error\n Your IP Adress are not acepted.", -> a msg de alerta, é claro se a bosta da opção for essa log = true -> eu ja disse. se tiver [b][color=Blue]true[/color][/b]zado, nao eskece de criar o arkivo } se tiver erro, me avisa por favor. e a tag: <event type="login" name="IPS" event="script" value="iplog.lua"/> nem precisa falar que é globalevent :palm: cara, tinha explicadinho por que é por nome, nao por id, por que é por char, nao por acc. mas agora n vo explica. quando tiver calmo mexo nessa BOSTA pronto. aproveite. nao reclamem da formatção, PORQUE DEPOIS DA MERDA QUE ME ACONTECEU VCS AINDA TEM SORTE DEU ESTAR POSTANTO E SO VO MELHORAR AS COISAS QUANDO EU TIVER CALMO. E O TOPICO ESTA NOS PADROES. falou :fuu::fuu::fuu::fuu::fuu::fuu::fuu::fuu::fuu::fuu::fuu::fuu::fuu::fuu::fuu::fuu::fuu::fuu::fuu::fuu::fuu::fuu:
  17. Criando lista das quests do seu servidor

    Bom... primeiramente vou falar, sou bem iniciante nessa area de script, e como eu nunca vi nada parecido por aqui eu vou compartilhar com vocês. [b]Nome do Script:[/b] Quest Log [b]Função:[/b] Exibe para o jogador todas as quests do servidor, e tambem mostra as completas e incompletas. [b]Autor:[/b] Paulix [b]Servidor Testado:[/b] Aries 0.4.0 XML Bom... vou explicar como o script funciona. Sabe aquelas quests que quando voce clica no baú ganha algum item?, a action daquele baú muda o valor do seu storage value de -1 para 1. Este meu script verifica se a quest ja foi feita ou nao e exibe para o jogador. Iniciando: 1- Copie um arquivo da pasta data>talkactions>scripts mude o nome para quests.lua e cole isto: function onSay(cid, words, param) if getPlayerStorageValue(cid,[color=DarkOrange][b]1111[/b][/color]) == 1 then [color=Lime][b]first[/b][/color] = '[color=Red][b]Complete[/b][/color]' else [color=Lime][b]first[/b][/color] = '[color=Red][b]Incomplete[/b][/color]' end if getPlayerStorageValue(cid,[color=DarkOrange][b]2222[/b][/color]) == 1 then [color=DeepSkyBlue][b]second[/b][/color] = '[color=Red][b]Complete[/b][/color]' else [color=DeepSkyBlue][b]second[/b][/color] = '[color=Red][b]Incomplete[/b][/color]' end if getPlayerStorageValue(cid,[color=DarkOrange][b]3333[/b][/color]) == 1 then [color=Navy][b]third[/b][/color] = '[color=Red][b]Complete[/b][/color]' else [color=Navy][b]third[/b][/color] = '[color=Red][b]Incomplete[/b][/color]' end if getPlayerStorageValue(cid,[color=DarkOrange][b]4444[/b][/color]) == 1 then [color=Purple][b]fourth[/b][/color] = '[color=Red][b]Complete[/b][/color]' else [color=Purple][b]fourth[/b][/color] = '[color=Red][b]Incomplete[/b][/color]' end doPlayerSendTextMessage(cid,16, '[color=DarkGreen][b]Quest 1 = [/b][/color]'..[color=Lime][b]first[/b][/color]..'.') doPlayerSendTextMessage(cid,16, '[color=DarkGreen][b]Quest 2 = [/b][/color]'..[color=DeepSkyBlue][b]second[/b][/color]..'.') doPlayerSendTextMessage(cid,16, '[color=DarkGreen][b]Quest 3 = [/b][/color]'..[color=Navy][b]third[/b][/color]..'.') doPlayerSendTextMessage(cid,16, '[color=DarkGreen][b]Quest 4 = [/b][/color]'..[color=Purple][b]fourth[/b][/color]..'.') end 2-Agora vá em data>talkactions>talkactions.xml e adicione isto: <talkaction words="[color=Silver][b]!quests[/b][/color]" script="quests.lua"/> 3- Agora pegue os storages values das quests do seu servidor, para encontrar o storage value basta ir no cript do baú e procurar pela linha: setPlayerStorageValue(cid, [color=DarkOrange][b]XXXX[/b][/color], 1) 4- Pegue o id dos storages e coloque no lugar de cada id escrito em Laranja e pronto, seu script esta quase pronto. Explicando: Em Verde, Azul Claro, Azul Escuro e Roxo é o nome das variaveis, você pode colocar nas variaveis, qualquer nome a sua escolha. Em Vermelho são as mensagens que o jogador receberá quando a quest estiver completa ou incompleta. Em Verde Escuro é a mensagem que aparecerá em cada quest, de preferencia coloque o nome da quest para facilitar o entendimento dos jogadores. Em Cinza é o que o jogador vai precisar digitar (no jogo) para executar o script. Finalizando: --> Nunca se esqueça, as variaves de cada quest tem q ser diferente das outras, pois se for a mesma o script nao vai funcionar. --> Os id's em Laranja tem um grande relacionamento com os storages do baú, se você errar o valor o script não vai funcionar. --> Nunca apague os pontos( . ) nem as apostrofes ( ' ) perto das variaveis, pois eles sao essenciais para o funcionamento do script. --> Para adicionar outra quest é nescessario adicionar otra parte como esta: if getPlayerStorageValue(cid,[color=DarkOrange][b]XXXX[/b][/color]) == 1 then [color=Purple][b]variavel[/b][/color] = '[color=Red][b]Complete[/b][/color]' else [color=Purple][b]variavel[/b][/color] = '[color=Red][b]Incomplete[/b][/color]' end e outra como esta: doPlayerSendTextMessage(cid,16, '[color=DarkGreen][b]Nome da quest = [/b][/color]'..[color=Purple][b]variavel[/b][/color]..'.') ao script. --> Você pode adicionar ao script quantas quests quiser, basta adicionar o conteudo acima e edita-lo corretamente. Este script é exclusivo aki na Ot Net, favor nao postar em outro forum. Peço aos mods que se eu estiver esquecendo de alguma coisa, ou tiver algum erro que me avisem por pm que eu arrumo Espero que gostem do meu script OiaeuMae Obrigado a todos e até a proxima:coolface: Comentem plxxx
  18. Trade List System

    Informações = { Nome = Trade List System Autor = Mock, Dean(reformulação do script) Versão testada = TFS 0.3.5 } Informações A algum tempo atrás(1 ano +/-) o Mock havia postado um script assim, porém ele já é antigo e não sei se functiona nos servers novos. O script permite que você compre ou venda itens, sem estar perto do player ou até mesmo offline! Comandos /sell item name,price = Adiciona o item à lista com o preço escolhido. /buy trade id = Compra o item, trade id é o número da venda, que está na lista. /offers = Mostar uma lista com todos os itens à venda. /search item name = Semelhante ao /offers, porém mostra a lista apenas com o item escolhido. /stop trade id = Para a venda, o item é devolvido automaticamente ao player. Script Crie um arquivo chamado trade.lua na pasta talkactions/scripts e adicione isso dentro: function onSay(cid,words,param) list = "Id Player Item Money" if param == "info" then return doPlayerPopupFYI(cid,"Comandos:\n/sell itemname,price\n/offers\n/search\n/buy tradeid\n/stop tradeid") end if words == "/sell" then local t = db.getResult("SELECT `tradeid`,`player`,`itemid`,`money` FROM `trade` ORDER BY `tradeid` DESC LIMIT 100;") local itemname,price = param:match('(.-),%s*(.+)') local item = getItemIdByName(itemname) if t:getID() ~= -1 then v = t:getDataInt("tradeid") else v = 0 end if doPlayerRemoveItem(cid,item,1) then return db.executeQuery("INSERT INTO `trade` (`tradeid`, `player`, `itemid`, `money`) VALUES ("..v.."+1,"..getPlayerGUID(cid)..","..item..","..price..");") end return doPlayerSendTextMessage(cid,22,"Você não tem essa quantidade do item") end if words == "/buy" then local j = db.getResult("SELECT `tradeid`,`player`,`itemid`,`money` FROM `trade` WHERE `tradeid` = "..param.." LIMIT 100;") if doPlayerRemoveMoney(cid,j:getDataInt("money")) then doPlayerAddItem(cid,j:getDataInt("itemid")) if isOnline(getPlayerNameByGUID(j:getDataInt("player"))) then doPlayerAddMoney(getPlayerByName(getPlayerNameByGUID(j:getDataInt("player"))),j:getDataInt("money")) else db.executeQuery("UPDATE `players` SET `moneytoreceive` = "..j:getDataInt("money").." WHERE `players`.`id` ="..j:getDataInt("player").." LIMIT 1 ;") end return db.executeQuery("DELETE FROM `trade` WHERE `trade`.`tradeid` = "..param.." LIMIT 1;") end return doPlayerSendTextMessage(cid,22,"Você não possui essa quantia") end if words == "/offers" then local t = db.getResult("SELECT `tradeid`,`player`,`itemid`,`money` FROM `trade` ORDER BY `tradeid` DESC LIMIT 100;") if t:getID() ~= -1 then repeat list = list.."\n"..t:getDataInt("tradeid").." "..getPlayerNameByGUID(t:getDataString("player")).." "..getItemNameById(t:getDataInt("itemid")).." "..t:getDataInt("money").." gps" until not t:next() end return doPlayerPopupFYI(cid,list) end if words == "/search" then id = getItemIdByName(param, false) if (not id) then return doPlayerSendTextMessage(cid,22,"Esse item não existe.") end local t = db.getResult("SELECT `tradeid`,`player`,`itemid`,`money` FROM `trade` WHERE `itemid` = "..id..";") if t:getID() == -1 then return doPlayerSendTextMessage(cid,22,"O item procurado não está à venda") end repeat list = list.."\n"..t:getDataInt("tradeid").." "..getPlayerNameByGUID(t:getDataString("player")).." "..getItemNameById(t:getDataInt("itemid")).." "..t:getDataInt("money").." gps" until not t:next() return doPlayerPopupFYI(cid,list) end if words == "/stop" then local t = db.getResult("SELECT `tradeid`,`player`,`itemid`,`money` FROM `trade` ORDER BY `tradeid` DESC LIMIT 100;") repeat if tonumber(t:getDataInt("tradeid")) == tonumber(param) and tonumber(t:getDataInt("player")) == tonumber(getPlayerGUID(cid)) then doPlayerAddItem(cid,t:getDataInt("itemid")) return db.executeQuery("DELETE FROM `trade` WHERE `trade`.`tradeid` = "..t:getDataInt("tradeid").." LIMIT 1;") end until not t:next() end t:close() return TRUE end Adicione as seguintes tags em talkaction.xml: <talkaction words="/sell" event="script" value="trade.lua"/> <talkaction words="/offers" event="script" value="trade.lua"/> <talkaction words="/buy" event="script" value="trade.lua"/> <talkaction words="/search" event="script" value="trade.lua"/> <talkaction words="/stop" event="script" value="trade.lua"/> Crie um arquivo chamado trade.lua na pasta creaturescripts/scripts e adicione isso dentro: function onLogin(cid) local t = db.getResult("SELECT `moneytoreceive` FROM `players` WHERE `id` = "..getPlayerGUID(cid).." LIMIT 1;") if t:getDataInt("moneytoreceive") > 0 then return doPlayerAddMoney(cid,tonumber(t:getDataInt("moneytoreceive"))),doPlayerSendTextMessage(cid,22,"Um item seu foi comprado da trade list.Receba seu dinheiro"),db.executeQuery("UPDATE `players` SET `moneytoreceive` = 0 WHERE `players`.`id` ="..getPlayerGUID(cid).." LIMIT 1 ;") end t:close() return TRUE end Adicione a seguinte tag em creaturescripts.xml: <event type="login" name="Trade" script="trade.lua"/> Agora abra o arquivo creaturescripts/scripts/login.lua e adicione entes do último return TRUE: registerCreatureEvent(cid, "Trade") Você precisará da OTAL ou simplesmente coloque isso em lib/functions.lua ou arquivo semelhante: 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 Para finalizar, execute a seguinte query no seu banco de dados mysql: CREATE TABLE `trade` ( `tradeid` INT NOT NULL , `player` INT NOT NULL , `itemid` INT NOT NULL , `money` INT NOT NULL ) ENGINE = MYISAM ;[font=Comic Sans MS][size=4][size=2][size=4][size=2][size=4][size=2] [/size][/size][/size][/size][/size][/size][/font]ALTER TABLE `players` ADD `moneytoreceive` INT NOT NULL Bom, é isso, espero que façam bom uso do script, se achar algum bug por favor avise. Esse script é exclusivo da OTnet, se encontrar em outro fórum por favor avise
  19. Exori Elemental!

    Instalando o Script: Vá na pasta de magias de ataque do seu servidor. (Server Folder> Data> Spells> Scripts> attack) Copie um arquivo qualquer, abra-o, aperte CTRL+A e depois DELETE. Insira o seguinte código: [spoiler=Script] --[[ Exori Elemental Developed by Roku Please preserv the credits ]] local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_ICEAREA) setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -2.8, -2, -3.5, -1) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA) setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -2.8, -2, -3.5, -1) local combat3 = createCombatObject() setCombatParam(combat3, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA) setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE) setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -2.8, -2, -3.5, -1) local combat4 = createCombatObject() setCombatParam(combat4, COMBAT_PARAM_EFFECT, CONST_ME_SMALLPLANTS) setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) setCombatParam(combat4, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH) setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -2.8, -2, -3.5, -1) function onCastSpell(cid, var) local lpos = getPlayerLookDir(cid) local pos = getCreaturePosition(cid) if (lpos == 1) then doCreatureSay(cid, "Ice!", 19) return doCombat(cid, combat1, var) elseif (lpos == 2) then doCreatureSay(cid, "Energy!", 19) return doCombat(cid, combat2, var) elseif (lpos == 3) then doCreatureSay(cid, "Fire!", 19) return doCombat(cid, combat3, var) else doCreatureSay(cid, "Earth!", 19) return doCombat(cid, combat4, var) end end Feche-o, renomeie para exorielement.lua Em seguida, vá em spells.xml. (Server Folder > data > spells > spells.xml) E insira o seguinte trecho: <instant name="Elemental Strike" words="exori element" lvl="16" mana="40" prem="1" range="3" casterTargetOrDirection="1" blockwalls="1" exhaustion="2000" needlearn="0" event="script" value="attack/exorielement.lua"> <vocation id="1"/> <vocation id="2"/> <vocation id="5"/> <vocation id="6"/> </instant> Feito isso salve-o, e pronto, agora é so usar! Veja imagens: Ice Earth Fire Energy Créditos: Roku → Algoritimo, Script, Teste, Imagens e certa adaptação das ideias, de PoPoRaI. SE GOSTOU POR FAVOR CLIQUE NO BOTÃO THANKS NO FINAL DO POST. Até!
  20. Valentine's Card System!

    Informações = { Nome = Valentine's Card System Autor = Iuri Mandello, ideia nesse tópico : http://forums.otserv.com.br/f330/cartao-de-amor-139041/ Versão testada = TFS 0.3.5 } Boa tarde,ainda não tenho quase nenhum script postado no fórum, mas prometo a partir de agora me dedicar mais ao fórum (Y) Informações Bom vamos ao que interessa, esse script da uma ultilidade a mais ao Valentine's Card, com ele você pode enviar e receber cartões de amor. Comandos /love Fulano,mensagem -- Envia um cartão para a pessoa, se ele estiver online receberá na hora senão receberá no login. /love info -- Informações sobre o script Script Crie um arquivo chamado love.lua na pasta Talkactions/scripts e coloque isso dentro: function onSay(cid,words,param,channel) if param == 'info' then return doPlayerPopupFYI(cid, 'Valentine s Card System v 1.0 by Iuri Mandello\a Comandos: /love Player,Mensagem = Envia o cartão para o player.') end local t1,t2 = param:match('(.-),%s*(.+)')-- Valeu Mock if t1 == nil then return doPlayerSendTextMessage(cid,22,"Select a player to send the message") end if (getPlayerGUIDByName(t1) == nil) then return doPlayerSendTextMessage(cid,22,"Player does not exist") end if t2 == nil then return doPlayerSendTextMessage(cid,22,"No message specified") end if string.len(tostring(t2)) > 100 then return doPlayerSendTextMessage(cid,22,"The message is long") end if string.len(tostring(t2)) < 0 then return doPlayerSendTextMessage(cid,22,"The message is short") end if isOnline(t1) then local item = doPlayerAddItem(getPlayerByName(t1),6538) doSetItemText(item, tostring(t2)) doPlayerSendTextMessage(cid,22,"Card send successfully") return TRUE end if io.open("data//love//".. tostring(t1) ..".txt") == nil then local file = io.open("data//love//".. tostring(t1) ..".txt","w") file:write("by ".. getPlayerName(cid) ..":".. tostring(t2) .."\n") file:close() doPlayerSendTextMessage(cid,22,"Card send successfully") else local file = io.open("data//love//".. tostring(t1) ..".txt","a+") file:write("by ".. getPlayerName(cid) ..":".. tostring(t2)) file:close() doPlayerSendTextMessage(cid,22,"Card send successfully") end return TRUE end Tag xml para ser colocada em talkactions.xml: <talkaction words="/love" event="script" value="love.lua"/> Crie um arquivo chamado lovelogin.lua na pasta creaturescripts/scripts e coloque isso dentro: function onLogin(cid) local file = io.open("data//love//".. getCreatureName(cid) ..".txt") if file ~= nil then doPlayerSendTextMessage(cid,22,"You received one love card!") for msg in io.lines("data//love//".. getCreatureName(cid) ..".txt") do item = doPlayerAddItem(cid,6538) doSetItemText(item,msg) end file:close() os.remove("data//love//".. getCreatureName(cid) ..".txt") end return TRUE end Tag para ser colocada em creaturescripts.xml: <event type="login" name="Love" script="lovelogin.lua"/> Agora abra o arquivo creaturescripts/scripts/login.lua e adicione entes do último return TRUE: registerCreatureEvent(cid, "Love") <font face="Comic Sans MS"><font size="4"><font size="2"><font size="4"><font size="2"><font size="4"><font size="2"> Você precisará da OTAL ou simplesmente coloque isso em lib/functions.lua ou arquivo semelhante: 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 Por último, crie uma pasta chamada love na pasta data do seu servidor e está pronto Espero que tenham gostado, e por favor não faça comentários como "Legal","Vou usar no meu server", se quiser agradecer use o botão Thanks,use o tópico somente para dúvidas e bugs. Esse script é exclusivo da OTnet, se encontrar em outro fórum por favor avise
  21. [bonus systen] ideia veio do nada =)

    nome da ideia = bonus systen objetivo = dar bonus a itens criador da ideia = luiz honorio (SEU ANALFABETO) dia que tive a ideia = 17/02/2010 13:35 hrs por que tive essa ideia = porque nao tenhu mas nada pra faser BEM SEM INRROLASSÃO A minha idéia é o seguinte a pessoa usa pedras em um itens e ele ganha um bonus, cada pedra tem seu bonus por exenplo vc cata um stone de um monstro e nessa usa essa stone num iten e entao esse iten ganha + skill ou ml ou defesa contra elementos ou até se for possivel dano mas isso é sonhar de +, bem se eu for colocando bonus nos itens assim da pra dar vantagen aos mage paly e kina, por exenplo no upgrate systen do mock, eu achei uma ótima idéia aquilo mas se parar pra penssar num tem nada pra aumenta a forssa das wand essa é uma idéia pro mock tbm, mock vc podia por no upgrate system um bonus pra wand :style: o mundo esta cheio de pessoas que num tem nada pra faser como eu entao fassa algo que preste poste uma ideia na otnet :loool: gosto da ideia ??? due v$
  22. [Reputation Points²]

    Bom esses dias estava jogando um server chamado Elfenwar Feito pelo god_dreamer Aqui Do Forum... E Vi o "Rep" System Eu Vi Que um Cara Queria Um Script Desse Também, Mais Eu estava Precisando Muito , Se Alguem Fizesse Eu Agradeçeria De Mais >.< [idéia] A Ideia Era A Seguinte : Toda Vez Que Voce Matasse um Player Inocente [sem pk] Ganhasse Rep Points Negativos [-rep] e quando matasse um pk ganhasse Rep Positivo [+rep] E Criar Rank De Rep Por Exemplo : [Exemplo Do Elfenwar] E Em Vez De Ganhar um Item ou Medalha Ganhasse um Outfit [ExemploElfenwar] Os Ranks Poderiam Ser : Negativo ~ Noob Quando Começa - 0 Points Pk ~ -300 rep points ~ Nao Ganha Outfit Thief ~ 1000 Rep Points ~ Nao Ganha Outfit Hunter of noobs ~ 1500 Rep Points ~ Ganha roupa de Necromancer Evil ~ 2500 Rep Points ~ Ganha Roupa De Grim Reaper Serial Killer ~ 3500 Rep Points ~ Ganha Roupa De Ferumbras Power Abuser ~ 5000 ~ Ganha Roupa Do Vampire Overlord -- Para Mulher Vampire Bride Positivo ~ Noob Quando Começa Pk Killer ~ 300 Rep Points ~ Nao Ganha Outfit Pk Hunter ~ 1000 Rep Points ~ Nao Ganha Outfit Hero ~ 2500 Rep Points ~ Ganha Roupa De Hero WorldSafer ~ 3500 Rep Points ~ Ganha Roupa de Undead Gladiator Super-hero ~ 5000 ~ Ganha Roupa De Barbarian Skullhunter -- Pra Mulher Barbarian Brutetamer E Se Possivel Um Comando Como !reputation Mostra Quantos Rep Points Voce Tem E Seu Nick De Reputação Exemplo You Have -5000 Rep Points. You Are Power Abuser E Que Quando Falasse o Comando !reputation Mudasse a ropa que voce tem , exemplo eu tenho +2500 rep points , eu falo !reputation eu mudo a ropa automaticamente para Hero e a cada player killado pra +rep ou -rep ganhasse 30 rep points E Se nao fosse pedir de mais , quando mudasse a ropa , subisse o nome do rank do player em cor aleatoria !! como no elfenwar O= Se Alguem Souber Fazer Isso éee Muitoo Ninja :fist: Desde Ja Agradeço ! (Obs¹ Retirei a maioria das ideas do elfenwar) (Obs ² God dreamer voce me baniu no elfenwar por sv adversment era meu primo =/) (Obs ³ Se Eu Errei Em Alguma Coisa ou Voces Tem Alguma Sugestao Podem Falar)
  23. Invasao de TODOS os Bosses

    [spoiler=VERSÃO ANTIGA] Primeiro lugar, lembrando que é desnecessário qualquer post com agradecimento. Existe script de invasao por talkaction, mas esse é diferente. Se tiver algum erro (Provavelmente terá) por favor avise. Sim, o script é grande, mas te poupa de fazer VARIOS arquivos .xml de raid, e isso poupa espaço e tempo. Vamos ao script: Vá na pasta TalkActions e crie um arquivo com extensão .lua e o de um nome de bossraid.lua Agora abra ele e cole o seguinte script: local pos = { ['OrshabaalPOS'] = {x=X, y=Y, z=Z}, ['ZuguroshPOS'] = {x=X, y=Y, z=Z}, ['MorgarothPOS'] = {x=X, y=Y, z=Z}, ['GolgordanPOS'] = {x=X, y=Y, z=Z}, ['ApocalypsePOS'] = {x=X, y=Y, z=Z}, ['GhazbaranPOS'] = {x=X, y=Y, z=Z}, ['HellgorakPOS'] = {x=X, y=Y, z=Z}, ['LatrivanPOS'] = {x=X, y=Y, z=Z}, ['BazirPOS'] = {x=X, y=Y, z=Z}, ['MadarethPOS'] = {x=X, y=Y, z=Z}, ['UshurielPOS'] = {x=X, y=Y, z=Z}, ['AnnihilonPOS'] = {x=X, y=Y, z=Z}, ['InfernatilPOS'] = {x=X, y=Y, z=Z}, } function onSay(cid, words, param) if getPlayerAccess(cid) >= 3 and words == '/invasion' and param == '' then doPlayerSendTextMessage(cid, 22, 'You must choose a monster.') return TRUE end if getPlayerAccess(cid) >= 3 and words == '/invasion' and param == 'Orshabaal' then doSummonCreature('Orshabaal', OrshabaalPOS) doPlayerSendTextMessage(cid, 22, 'You sumon Orshabaal.') doBroadcastMessage(cid, 12, 'Be careful! Orshabaal invaded the city!') elseif getPlayerAccess(cid) >= 3 and words == '/invasion' and param == 'Zugurosh' then doSummonCreature('Zugurosh', ZuguroshPOS) doPlayerSendTextMessage(cid, 22, 'You sumon Zugurosh.') doBroadcastMessage(cid, 12, 'Be careful! Zugurosh invaded the city!') elseif getPlayerAccess(cid) >= 3 and words == '/invasion' and param == 'Morgaroth' then doSummonCreature('Morgaroth', MorgarothPOS) doPlayerSendTextMessage(cid, 22, 'You sumon Morgaroth.') doBroadcastMessage(cid, 12, 'Be careful! Morgaroth invaded the city!') elseif getPlayerAccess(cid) >= 3 and words == '/invasion' and param == 'Golgordan' then doSummonCreature('Golgordan', GolgordanPOS) doPlayerSendTextMessage(cid, 22, 'You sumon Golgordan.') doBroadcastMessage(cid, 12, 'Be careful! Golgordan invaded the city!') elseif getPlayerAccess(cid) >= 3 and words == '/invasion' and param == 'Apocalypse' then doSummonCreature('Apocalypse', ApocalypsePOS) doPlayerSendTextMessage(cid, 22, 'You sumon Apocalypse.') doBroadcastMessage(cid, 12, 'Be careful! Apocalypse invaded the city!') elseif getPlayerAccess(cid) >= 3 and words == '/invasion' and param == 'Ghazbaran' then doSummonCreature('Ghazbaran', GhazbaranPOS) doPlayerSendTextMessage(cid, 22, 'You sumon Ghazbaran.') doBroadcastMessage(cid, 12, 'Be careful! Ghazbaran invaded the city!') elseif getPlayerAccess(cid) >= 3 and words == '/invasion' and param == 'Hellgorak' then doSummonCreature('Hellgorak', HellgorakPOS) doPlayerSendTextMessage(cid, 22, 'You sumon Hellgorak.') doBroadcastMessage(cid, 12, 'Be careful! Hellgorak invaded the city!') elseif getPlayerAccess(cid) >= 3 and words == '/invasion' and param == 'Latrivan' then doSummonCreature('Latrivan', LatrivanPOS) doPlayerSendTextMessage(cid, 22, 'You sumon Latrivan.') doBroadcastMessage(cid, 12, 'Be careful! Latrivan invaded the city!') elseif getPlayerAccess(cid) >= 3 and words == '/invasion' and param == 'Bazir' then doSummonCreature('Bazir', BazirPOS) doPlayerSendTextMessage(cid, 22, 'You sumon Bazir.') doBroadcastMessage(cid, 12, 'Be careful! Bazir invaded the city!') elseif getPlayerAccess(cid) >= 3 and words == '/invasion' and param == 'Madareth' then doSummonCreature('Madareth', MadarethPOS) doPlayerSendTextMessage(cid, 22, 'You sumon Madareth.') doBroadcastMessage(cid, 12, 'Be careful! Madareth invaded the city!') elseif getPlayerAccess(cid) >= 3 and words == '/invasion' and param == 'Ushuriel' then doSummonCreature('Ushuriel', UshurielPOS) doPlayerSendTextMessage(cid, 22, 'You sumon Ushuriel.') doBroadcastMessage(cid, 12, 'Be careful! Ushuriel invaded the city!') elseif getPlayerAccess(cid) >= 3 and words == '/invasion' and param == 'Annihilon' then doSummonCreature('Annihilon', AnnihilonPOS) doPlayerSendTextMessage(cid, 22, 'You sumon Annihilon.') doBroadcastMessage(cid, 12, 'Be careful! Annihilon invaded the city!') elseif getPlayerAccess(cid) >= 3 and words == '/invasion' and param == 'Infernatil' then doSummonCreature('Infernatil', InfernatilPOS) doPlayerSendTextMessage(cid, 22, 'You sumon Infernatil.') doBroadcastMessage(cid, 12, 'Be careful! Infernatil invaded the city!') return TRUE end end No começo do script onde tem o seguinte trecho: As posições onde tem X, Y e Z devem ser configuradas a seu gosto, cada montro sera sumonado nela.Ex: ['BazirPOS'] = {x=20, y=57, z=7} Isso quer dizer que se usar o comando para sumonar Bazir, ele apareçera na posição 20, 57, 7. Depois disso vá em talkactions.xml e adione esta tag: Agora é so entrar no seu servidor e se divertir! Versão 2.0.0 Depois de muita preguiça e aprendizado, resolvi refazer o script. As principais mudanças são: • O Script, que antes tinha 88 linhas, não funcionava e poderia causar brechas, agora foi reduzido para 14 linhas com total garantia de funcionabilidade e segurança. • Não é mais invasão de boss, é de qualquer bixo. Então agora é uma espécie de invasão específica. • Posições na fala, decididas na hora, para nao ter que mudar, salvar, reloadar, etc. • MODO DE USAR: Script: --[[ Summon boss V 2.0.0 Developed by Roku]] function onSay(cid, words, param) if getPlayerAccess(cid) < 4 then return FALSE end if (param == "") then return doPlayerSendCancel("Sorry, not possible.") and FALSE end local param = string.explode(param, ",") if (not isMonster(getCreatureByName(param[1]))) then return doPlayerSendCancel(cid, "Not monster.") end if (param[1] and param[2] and param[3] and param[4] and param[5]) then pos = {x=tonumber(param[2]), y=tonumber(param[3]),z=tonumber(param[4])} doCreateMonster(tostring(param[1]), pos) doBroadcastMessage(tostring(param[5]), 22) return doShowTextDialog(cid, 2355, "Hello, "..getCreatureName(cid).."!\nYou have summoned the monster "..param[1].." at the position "..pos.x.." | "..pos.y.." | "..pos.z..", at "..os.date()..".\nAnd broadcasted message: "..param[5].."\nGraciously, Roku.") and TRUE end return FALSE end É so adicionar nas talks: <talkaction words="/invasion" value="[b]bossraid[/b].lua"/> O script deverá estar salvo com este nome. Exemplo de uso: Na posição aparecerá o boss: (A mensagem será branca) E para você aparecerá isto: Aproveitem SE GOSTOU POR FAVOR CLIQUE NO BOTÃO THANKS NO FINAL DO POST.
  24. Nord War V2.5 (Times, Frags+Level...)

    Nome Nord War V2.5 Após muita inatividade, preguiça, calotagem e tudo mais vim dar um presentinho de Natal para todos. O que é um war system? Lembrando que o meu war system não é o mesmo que o do X-Dream War, eu refiz ele pra ficar mais leve e menor. ----Instalando---- Em data\lib crie um arquivo war.lua com o seguinte código: --//Nord's War System V2.5 LEVEL = {START = 150, GAIN = 2} TEAMS = { [1] = { COUNT = function() return getGlobalStorageValue(101021) end, COLOR = {0, 88, 95, 0}, EFFECT = 47}, [2] = { COUNT = function() return getGlobalStorageValue(101022) end, COLOR = {0, 94, 132, 114}, EFFECT = 48} } TOWNS = { {"Thais", {1, 2}}, {"Edron", {3, 4}}, {"Venore", {5, 6}}, {"Carlin", {7, 8}}, {"Darashia", {9, 10}} } maleOutfits = {128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151, 152, 153, 154, 251, 268, 273, 278, 289, 325, 253, 254, 255} femaleOutfits = {136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156, 157, 158, 252, 269, 270, 279, 288, 324, 264} setGlobalStorageValue(101010, 1) function doPlayerSetLevel(cid, level) doPlayerAddExperience(cid, getExperienceForLevel(level) - getPlayerExperience(cid)) end function doPlayerAddLevel(cid, amount) local level = getPlayerLevel(cid) if level < 250 then doPlayerAddExperience(cid, getExperienceForLevel(level + amount) - getPlayerExperience(cid)) end end team = { get = function(id) if id == 0 then return (TEAMS[1].COUNT() < TEAMS[2].COUNT()+math.random(0, 1) and 1 or 2) else return (TEAMS[1].COLOR[4] == getCreatureOutfit(id).lookFeet and 1 or 2) end end, add = function(id, n) if n == 0 then setGlobalStorageValue(101021, 0) setGlobalStorageValue(101022, 0) else setGlobalStorageValue(101020+id, TEAMS[id].COUNT() + n) end return TRUE end } team.add(0, 0) event = { login = function(cid) if getPlayerGroupId(cid) <= 1 then local teamid = team.get(0) if teamid > 0 then team.add(teamid, 1) local NOW = getGlobalStorageValue(101010) local color = TEAMS[teamid].COLOR doCreatureChangeOutfit(cid, {lookType = getPlayerSex(cid) == 1 and maleOutfits[math.random(#maleOutfits)] or femaleOutfits[math.random(#femaleOutfits)], lookHead = color[1], lookBody = color[2], lookLegs = color[3], lookFeet = color[4], lookAddons = math.random(3)}) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), TRUE) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doPlayerSetTown(cid, TOWNS[NOW][2][teamid]) doTeleportThing(cid, getTownTemplePosition(TOWNS[NOW][2][teamid]), FALSE) doPlayerAddSoul(cid, -getPlayerSoul(cid)) doSendMagicEffect(getCreaturePosition(cid), TEAMS[teamid].EFFECT) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Map: ".. TOWNS[NOW][1] .."\nTeam: ".. tostring(teamid) .." (".. TEAMS[1].COUNT() ..",".. TEAMS[2].COUNT() ..")\n \nChecking...\nIP: ".. doConvertIntegerToIp(getPlayerIp(cid)) .."\nMC Safe: ON\nMC Status: Clean") doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[X-Dream]+[Nord War]: Para mais informações /info") if getPlayerStorageValue(cid, 20000) == -1 then setPlayerStorageValue(cid, 20000, os.time(t)) end end end return TRUE end, logout = function(cid) if getPlayerGroupId(cid) <= 1 then team.add(team.get(cid), -1) end return TRUE end, look = function(cid, thing) if not isPlayer(thing.uid) or getPlayerGroupId(thing.uid) > 1 then return TRUE end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, ""..getPlayerName(thing.uid).." ("..getPlayerVocationName(thing.uid)..")\n[Lv: "..getPlayerLevel(thing.uid).."][Frags: "..getPlayerSoul(thing.uid).."]") end, combat = function(cid, target) if cid == target or getCreatureOutfit(cid).lookFeet == getCreatureOutfit(target).lookFeet then return FALSE end return TRUE end, kill = function(cid, lastHitKiller, mostDamageKiller) if isPlayer(cid) then if isPlayer(lastHitKiller) then doPlayerAddSoul(lastHitKiller, 1) doPlayerAddLevel(lastHitKiller, LEVEL.GAIN) doPlayerSendTextMessage(lastHitKiller, MESSAGE_INFO_DESCR, 'Kill [+'..LEVEL.GAIN..' levels]') if isPlayer(mostDamageKiller) and mostDamageKiller ~= lastHitKiller then doPlayerAddSoul(lastHitKiller, 1) doPlayerSendTextMessage(mostDamageKiller, MESSAGE_INFO_DESCR, 'Kill [+'..LEVEL.GAIN..' levels]') doPlayerAddLevel(mostDamageKiller, LEVEL.GAIN) end end if LEVEL.START ~= nil then doPlayerSetLevel(cid, LEVEL.START) end local oldPosition = getCreaturePosition(cid) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), TRUE) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doSendMagicEffect(getCreaturePosition(cid), TEAMS[team.get(cid)].EFFECT) doSendMagicEffect(oldPosition, 65) doRemoveConditions(cid, FALSE) doPlayerAddSoul(cid, -getPlayerSoul(cid)) return FALSE end return TRUE end, map = function(clean, save) NOW = getGlobalStorageValue(101010) >= #TOWNS and 1 or getGlobalStorageValue(101010) + 1 setGlobalStorageValue(101010, NOW) doBroadcastMessage("Map changed\n[".. TOWNS[NOW][1] .."]\nNext map in 30 minutes.", MESSAGE_INFO_DESCR) team.add(0, 0) for _, cid in ipairs(getPlayersOnline()) do if getPlayerGroupId(cid) <= 1 then local teamid = team.get(cid) team.add(teamid, 1) doPlayerSetTown(cid, TOWNS[NOW][2][teamid]) doTeleportThing(cid, getTownTemplePosition(TOWNS[NOW][2][teamid]), FALSE) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), TRUE) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doRemoveConditions(cid, FALSE) doPlayerAddSoul(cid, -getPlayerSoul(cid)) end end if clean == TRUE then doCleanMap() end if save == TRUE then doSaveServer() end end } Procure em data\lib o arquivo data.lua e no final do arquivo pule uma linha e adicione isto: dofile(getDataDir() .. "lib/war.lua") Agora em data\creaturescripts\scripts crie de novo um arquivo war.lua, mas desta vez com este código: function onLogin(cid) registerCreatureEvent(cid, "WarLook") registerCreatureEvent(cid, "WarKill") registerCreatureEvent(cid, "WarLogout") registerCreatureEvent(cid, "WarCombat") return event.login(cid) end function onLogout(cid) return event.logout(cid) end function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) return event.kill(cid, lastHitKiller, mostDamageKiller) end function onLook(cid, thing, position, lookDistance) return event.look(cid, thing) end function onCombat(cid, target) return event.combat(cid, target) end Em data\creaturescripts abra o arquivo creaturescripts.xml e adicione isto: <event type="preparedeath" name="WarKill" event="script" value="war.lua"/> <event type="login" name="WarLogin" event="script" value="war.lua"/> <event type="logout" name="WarLogout" event="script" value="war.lua"/> <event type="look" name="WarLook" event="script" value="war.lua"/> <event type="combat" name="WarCombat" event="script" value="war.lua"/> Em data\globalevents\scripts crie um arquivo map.lua com este código: function onThink1() broadcastMessage("Map change in 1 second.", MESSAGE_STATUS_CONSOLE_BLUE) addEvent(event.map, 1000, TRUE, TRUE) return TRUE end function onThink2() broadcastMessage("Map change in 2 seconds.", MESSAGE_STATUS_CONSOLE_BLUE) addEvent(onThink1, 1000) return TRUE end function onThink3() broadcastMessage("Map change in 3 seconds.", MESSAGE_STATUS_CONSOLE_BLUE) addEvent(onThink2, 1000) return TRUE end function onThink4() broadcastMessage("Map change in 4 seconds.", MESSAGE_STATUS_CONSOLE_BLUE) addEvent(onThink3, 1000) return TRUE end function onThink5() broadcastMessage("Map change in 5 seconds.", MESSAGE_STATUS_CONSOLE_BLUE) addEvent(onThink4, 1000) return TRUE end function onThink6() broadcastMessage("Map change in 6 seconds.", MESSAGE_STATUS_CONSOLE_BLUE) addEvent(onThink5, 1000) return TRUE end function onThink7() broadcastMessage("Map change in 7 seconds.", MESSAGE_STATUS_CONSOLE_BLUE) addEvent(onThink6, 1000) return TRUE end function onThink8() broadcastMessage("Map change in 8 seconds.", MESSAGE_STATUS_CONSOLE_BLUE) addEvent(onThink7, 1000) return TRUE end function onThink9() broadcastMessage("Map change in 9 seconds.", MESSAGE_STATUS_CONSOLE_BLUE) addEvent(onThink8, 1000) return TRUE end function onThink10() broadcastMessage("Map change in 10 seconds.", MESSAGE_STATUS_CONSOLE_BLUE) addEvent(onThink9, 1000) return TRUE end function onThink11() broadcastMessage("Map will change in 1 minute.", MESSAGE_STATUS_CONSOLE_BLUE) addEvent(onThink10, 50000) return TRUE end function onThink(interval, lastExecution) broadcastMessage("Map will change in 5 minutes.", MESSAGE_STATUS_CONSOLE_BLUE) addEvent(onThink11, 240000) end Em data\globalevents abra o arquivo globalevents.xml e coloque isto: <globalevent name="map" interval="1500" event="script" value="map.lua"/> Tudo pronto, só configurar ----Configurando---- No arquivo data\lib\war.lua que há as configurações, vejamos então: START é o level em que qualquer jogador irá começar, neste caso 150. GAIN é quantos levels o player ganha por matar um adversário. Apenas o que está em vermelho é importante COLOR defini as cores de cada time conforme este esquema: {CorDaCabeça, CorDoCorpo, CorDaPerna, CorDoPé}, no caso o corpo do time 1 vai ser azul porque 88 corresponde ao azul. EFFECT defini o Nº do efeito quando o player loga (aquela bolinha azul estilo teleport), se eu quiser que o time 2 faça um efeito de chamas em vés de 48 eu colocaria 36. Esta é a configuração da troca dos mapas. Entre "aspas" é o nome da cidade. Dentro das chaves os números 1 e 2 corresponde ao TownId dos times, explicando melhor... Quando você configura o mapa existe a ferramenta Edit Towns, nela você configura a posição dos templos, se por exemplo o templo/town de Nº 7 é em Port Hope e eu quero que lá comece o time 1 e no templo/town de Nº 9 é próximo de Port Hope e eu quero que lá comece o time 2 na configuração ficaria assim: {"Port Hope", {7, 9}} No config.lua certifique-se de que essas duas opções estejam como as abaixo: allowChangeColors = "no" noDamageToSameLookfeet = "yes" Ow, TIO! Eu quero usar só uma cidade, tem algum problema? Mas TIO! Eu não quero nem que volte pro templo, como faço? TIUUÔ! Eu to dando look e fica aquela coisa estranha: Nord (Sorcerer) [Lv:150][Frags:0], da pra deixa como tava antes? As outfits (lookType), são escolhidas automaticamente, incluindo as outfits de barbarian (male/female). Qualquer dúvida postem no tópico (talvez eu responda, tenho muita ausência), mas por PM nem pensar. Bom divertimento e FELIZ NATAL, O NATAL É DE JESUUUS! :yes: OBS: Natal já passou /\, FELIZ ANO NOVO!
  25. Lord Of The Elements

    Monstro: Lord Of The Elements - Um grande e poderoso mago negro que se transforma nos 4 massives elementais abusando de seus poderes. Monstro bem feito e Muuuito bom para servers por ser um tipo de monstro totalmente criativo e inovador. :w00t: Versão: 8.5x Tipo do script: Monstro Servidor Testado: The Forgotten Server 0.3.5.2576,Alissow Ots 3.6 Autor: LordBelkil (Eu) ------------------------------- Bom galera, esse é meu terceiro monstro e estou como sempre aberto a críticas e sugestões. Lembrando, esses monstros são editavéis, ou seja, edite eles a seu gosto e necessidades do seu server. E agora vamos tão esperado monstro! (OBS: Caso ele não comece a se transformar nos massives elementais basta apenas da um reload nos monsters quando seu server estiver online) Lord Of The Elements 1º Passo: Abra a pasta monster aque se encontra na pasta data do seu server. Copie e cole qualquer arquivo e renomeie para Lord Of The Elements. Abra o arquivo, delete tudo e cole isso: [spoiler=Lord Of The Elements] 2º Passo: Salve em .xml e fexe. 3º Passo: Abra o arquivo monsters.xml que se encontra na pasta monster e adicione: Pronto! Agora você tem mais um monstro de primeira qualidade criado por mim, LordBelkil! :w00t:
×