Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''action''.

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • xTibia - Notícias e Suporte
    • Regras
    • Noticias
    • Soluções
    • Projetos Patrocinados
    • Tutoriais para Iniciantes
    • Imprensa
  • OTServ
    • Notícias e Debates
    • OTServlist
    • Downloads
    • Recursos
    • Suporte
    • Pedidos
    • Show-Off
    • Tutoriais
  • OFF-Topic
    • Barzinho do Éks
    • Design
    • Informática

Encontrar resultados em...

Encontrar resultados que contenham...


Data de Criação

  • Início

    FIM


Data de Atualização

  • Início

    FIM


Filtrar pelo número de...

Data de Registro

  • Início

    FIM


Grupo


Sou

  1. Saudações, xTibianos! Hoje venho lhes trazer um npc desenvolvido por mim, cuja ideia foi de nosso ADM @Daniel. Antes de mais nada, gostaria de avisar: o NPC possui uma GRANDE possibilidade de customização. Você pode escolher quais sistemas você vai quer que ele tenha, pode escolher se vai usar prisão ou não, pode escolher o tempo de punição ao membro infrator, etc. Sistemas presentes Esse NPC possui os seguintes sistemas: Anti-bot system Qualquer jogador pode ir até o NPC e denunciar algum outro jogador (que provavelmente esteja usando bot). O NPC então enviará uma checagem de bot ao jogador denunciado. Caso o jogador denunciado não responda a checagem dentro do tempo hábil, ele será punido (enviado para uma prisão ou kickado). Power Abuse system Esse sistema serve para punir aqueles membros de level alto que ficam fazendo "free kill" (matando jogadores mais fracos abusivamente). Qualquer jogador (qualquer level) pode ir até o npc e denunciar algum outro jogador (level maior) alegando que ele sofreu power abuse. O npc fará uma checagem, e se o jogador denunciante tiver sido morto um minimo de X vezes (configurável) por aquele jogador denunciado, o jogador denunciado será punido (mandado pra prisão ou kickado). Aparência do NPC Esse é o NPC, visualmente falando: inspiração: Instalação Agora chega de enrolação, vamos à instalação do npc: » Vá na pasta mods, crie um arquivo chamado JusticeiroMods.xml e coloque isso dentro: *atente-se para essa parte configurável do script acima: *nessa parte, o strBot e o strPwrAbs devem ser iguais aos informados no arquivo Justiceiro.lua que será mostrado mais abaixo » Agora vá na pasta data\npc, crie um arquivo chamado Justiceiro.xml e coloque isso dentro: » Agora vá na pasta data\npc\scripts, crie um arquivo chamado Justiceiro.lua e coloque isso dentro: *atente-se para essa parte configurável do script acima: -----------------------------------------------------------------------------------------------------------------------------------------------------PARTE CONFIGURAVEL----------------------------------PARTE CONFIGURAVEL------------------------------PARTE CONFIGURAVEL------------------------------------------------------------------------------------------------------------------------------------------------------------------------local usarAntiBot = "sim" --coloque "nao" caso não queira usar o anti-bot do npclocal usarPowerAbuse= "sim" --coloque "nao" caso não queira usar o power abuse system do npclocal cadeia = "sim" --use "sim" caso vc queira mandar o infrator para a cadeia, ou "nao" caso vc nao tenha uma cadeialocal cadeiaPos = { --coordenadas das celas da cadeia, para caso vc tenha colocado o 'cadeia = "sim"' no campo acima[1] = {coord = {x = 32314, y = 32280, z = 8}, preso={}--[[DEIXE ISSO VAZIO]]}, --ponha as coordenadas da cela 1[2] = {coord = {x = 32317, y = 32280, z = 8}, preso={}--[[DEIXE ISSO VAZIO]]}, --ponha as coordenadas da cela 2[3] = {coord = {x = 32320, y = 32280, z = 8}, preso={}--[[DEIXE ISSO VAZIO]]}, --ponha as coordenadas da cela 3[4] = {coord = {x = 32322, y = 32280, z = 8}, preso={}--[[DEIXE ISSO VAZIO]]}, --ponha as coordenadas da cela 4}local tempoBot = 5 --tempo em minutos para o player reportado como botter responder a verificaçãolocal tempoPunicao = 60 --tempo em minutos que o infrator ficara presolocal maxDeath = 7 --quantidade de mortes "desbalanceadas" (player mais fraco contra palyer muito mais forte) considerada como power abuselocal cooldown = 30 --tempo em segundos para o denunciante poder fazer outra denuncialocal strBotDen = 690110local strBot = 69011local strPwrAbsDen = 690120local strPwrAbs = 69012-------------------------------------------------------------------------------------------------------------------------------------------------FIM DA PARTE CONFIGURAVEL-----------------------FIM DA PARTE CONFIGURAVEL---------------------FIM DA PARTE CONFIGURAVEL--------------------------------------------------------------------------------------------------------------------------------------------------------------------- obs: lembrando que você pode adicionar QUANTAS CELAS QUISER! Basta seguir a lógica da tabela relacionada as celas. obs²: e não esqueça de ler as instruções contidas em cada linha dessa parte do script! Como usá-lo em meu servidor? (recomendação) Eu recomendo também usar em seu servidor algum sistema automático de anti-bot, além do npc. -Por quê? Porque dessa forma dificultará a vida do botter. Digamos que o sistema automático faça mande uma checagem para todos os jogadores a cada 1 hora. Sem o meu npc, o botter pode entrar a cada hora no server e responder a checagem automática. Já tendo o meu npc, o botter pode receber uma checagem de bot a qualquer instante (pois qualquer membro pode fazer a denuncia a qualquer instante). Assim, ele não terá uma previsão de tempo para que ele volte à janela do tibia somente para responder a checagem do bot. Mapa de prisão Bom, galera, esse é o npc. Se você quiser usar o sistema de prisão mas não tiver uma prisão em seu server, aqui tem uma prisão feita pelo @Daniel para que vocês possam baixar e usar em conjunto com esse sistema: http://www.xtibia.com/forum/topico/240867-86-pris%C3%A3o-30-celas/ Eu testei todo esse sistema que nem um condenado. Não consegui achar nenhuma falha. Então se alguém encontrar alguma falha, por favor relate-a no campo de comentários abaixo. Por hoje é isso, pessoal. Até a próxima. Abraços. Não autorizo a postagem desse conteúdo sem meus devidos créditos!
  2. O sistema funciona assim, o player da use em um item, e então toda vez que ele morrer e logar de volta a bless é re-colocada automaticamente. (não precisa dar use novamente no item, ele é para sempre) Vamos ao código! Em actions/scripts coloque dentro de um arquivo.lua: local efeito = {27,28, 29,79} function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, 89210) == 1 then doPlayerSendTextMessage(cid,22,"You already used this book!") else doPlayerSendTextMessage(cid,22,"Congratulations! From now, you will be blessed automatically.") setPlayerStorageValue(cid, 89210, 1) doRemoveItem(item.uid, 1) doSendMagicEffect(getThingPos(cid), efeito[math.random(#efeito)]) end end Em actions.xml coloque: <!-- Book Of Blessing --> <action itemid="8977" event="script" value="livro_blessing.lua"/> Eu coloquei o ID de um livro que não é possivel ser pego de loot. Agora em creaturescripts/scripts coloque: local cfg = { message = "You have been blessed automatically!", bless = {1, 2, 3, 4, 5}, efeito = {27,28, 29,79} } function onLogin(cid) for i = 1, #cfg.bless do if getPlayerStorageValue(cid, 89210) == 1 and getPlayerBlessing(cid, i) then doPlayerSendTextMessage(cid,22, "You are blessed!") return true end if getPlayerStorageValue(cid, 89210) == 1 then doPlayerAddBlessing(cid, i) doPlayerSendTextMessage(cid,22,cfg.message) doSendMagicEffect(getThingPos(cid), cfg.efeito[math.random(#cfg.efeito)]) end end return true end Em creaturescripts.xml: <!-- Bless Automatica --> <event type="login" name="checkbless" script="checkbless.lua"/> E está pronto o seu sistema!!! Esse sistema era exclusivo do Global War! Créditos: Keilost 100%
  3. Bom, faz um tempo que eu mostrei um addon system para o meu servidor E Hoje eu adaptei ele para o PDE 3.0 e irei ensinar a por em seu servidor! Só testado em PDE 3.0, não sei se vai funcionar em algum PDA ou outro tipo de servidor. Vá em actions/scripts e crie um arquivo chamado addon.lua. Adicione isso lá: function onUse(cid, item, fromPosition, itemEx, toPosition) local addons = { [ID DO ITEM] = {pokemon= "NOME DO POKEMON" , looktype = LOOKTYPE NORMAL, fly = FLY, SE NÃO TIVER PONHA 0, ride = RIDE, SE NÃO TIVER PONHA 0, surf = SE NÃO TIVER SURF PONHA 0}, } if #getCreatureSummons(cid) > 0 then doPlayerSendCancel(cid, "Please back your pokemon.") return false end local addon = addons[item.itemid].looktype local fly = addons[item.itemid].fly local ride = addons[item.itemid].ride local surf = addons[item.itemid].surf local pb = getPlayerSlotItem(cid, 8).uid local pk = addons[item.itemid].pokemon if getItemAttribute(pb,"poke") ~= pk then doPlayerSendCancel(cid, "Sorry, you can't use this addon on this poke.") return false end if getItemAttribute(pb,"addon") >= 0 then doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid, 27, "Congratulations! Now your pokemon will use the addon.") doSetItemAttribute(pb,"addon",addon) doSetItemAttribute(pb,"addonfly",fly) doSetItemAttribute(pb,"addonride",ride) doSetItemAttribute(pb,"addonsurf",surf) return true end return true end Em actions.xml adicione: <action itemid="ID;ID;ID" event="script" value="addon.lua"/> Agora em actions/goback.lua antes de: else doPlayerSendCancel(cid, "This pokemon is fainted.") end return true end Adicione: local pk = getCreatureSummons(cid)[1] local pb = getPlayerSlotItem(cid, 8).uid local look = getItemAttribute(pb,"addon") if not look then doSetItemAttribute(pb,"addon",0) end if look > 0 then doSetCreatureOutfit(pk, {lookType = look}, -1) end Em lib/order.lua encontre: local pokemon = flys[getPokemonName(getCreatureSummons(cid)[1])] doPlayerSendTextMessage(cid, 27, "Type \"up\" or \"h1\" to fly higher and \"down\" or \"h2\" to fly lower.") doChangeSpeed(cid, -getCreatureSpeed(cid)) local speed = 500 + PlayerSpeed/5 + getSpeed(sid) * 6 * speedRate doChangeSpeed(cid, speed) setPlayerStorageValue(cid, 54844, speed) doSetCreatureOutfit(cid, {lookType = pokemon[1] + 351}, -1) doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "hp", getCreatureHealth(getCreatureSummons(cid)[1]) / getCreatureMaxHealth(getCreatureSummons(cid)[1])) doRemoveCreature(getCreatureSummons(cid)[1]) setPlayerStorageValue(cid, 17000, 1) Abaixo adicione: local addonfly= getPlayerSlotItem(cid, 8).uid local addofly = getItemAttribute(addonfly,"addonfly") if not addofly then doSetItemAttribute(addonfly,"addonfly",0) end if addofly > 0 then doSetCreatureOutfit(cid, {lookType = addofly}, -1) end Continuando em order.lua Encontre: local pokemon = rides[getPokemonName(getCreatureSummons(cid)[1])] doChangeSpeed(cid, -getCreatureSpeed(cid)) local speed = 150 + PlayerSpeed + getSpeed(sid) * 5 * speedRate doChangeSpeed(cid, speed) setPlayerStorageValue(cid, 54844, speed) doSetCreatureOutfit(cid, {lookType = pokemon[1] + 351}, -1) doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "hp", getCreatureHealth(getCreatureSummons(cid)[1]) / getCreatureMaxHealth(getCreatureSummons(cid)[1])) doRemoveCreature(getCreatureSummons(cid)[1]) setPlayerStorageValue(cid, 17001, 1) Em baixo adicione: local addonride = getPlayerSlotItem(cid, 8).uid local addoride = getItemAttribute(addonride,"addonride") if not addoride then doSetItemAttribute(addonride,"addonride",0) end if addoride > 0 then doSetCreatureOutfit(cid, {lookType = addoride}, -1) en Agora em movements/surf.lua encontre: doSetCreatureOutfit(cid, {lookType = surfs[getPokemonName(getCreatureSummons(cid)[1])].lookType + 351}, -1) doCreatureSay(cid, ""..getPokeName(getCreatureSummons(cid)[1])..", lets surf!", 1) doChangeSpeed(cid, -(getCreatureSpeed(cid))) E troque por: local addonsurf = getPlayerSlotItem(cid, 8).uid local addosurf = getItemAttribute(addonsurf,"addonsurf") if not addosurf then doSetItemAttribute(addonsurf,"addonsurf",0) doSetCreatureOutfit(cid, {lookType = surfs[getPokemonName(getCreatureSummons(cid)[1])].lookType + 351}, -1) end if addosurf > 0 then doSetCreatureOutfit(cid, {lookType = addosurf}, -1) end doCreatureSay(cid, ""..getPokeName(getCreatureSummons(cid)[1])..", lets surf!", 1) doChangeSpeed(cid, -(getCreatureSpeed(cid))) No mesmo arquivo ache: doSummonMonster(cid, pokemon) Logo abaixo adicione: local pk = getCreatureSummons(cid)[1] local balla = getPlayerSlotItem(cid, 8).uid local balladdon = getItemAttribute(balla,"addon") if not balladdon then doSetItemAttribute(balla,"addon",0) end if balladdon > 0 then doSetCreatureOutfit(pk, {lookType = balladdon}, -1) end Por ultimo em actions/order.lua encontre: doPlayerSay(cid, ""..getPokeName(getCreatureSummons(cid)[1])..", let me get down!", 1) doRegainSpeed(cid) --alterado v1.7 doRemoveCondition(cid, CONDITION_OUTFIT) Abaixo adicione: local pkjg = getCreatureSummons(cid)[1] local pkza = getPlayerSlotItem(cid, 8).uid local pkxd = getItemAttribute(pkjg,"addon") if not pkxd then doSetItemAttribute(pkza,"addon",0) elseif pkxd > 0 then doSetCreatureOutfit(pkjg, {lookType = pkxd}, -1) end Vá em creaturescripts/scripts/login.lua Troque tudo por: Créditos: @Ceetros
  4. Quando acaba a potion de double xp da esse erro: [Error - Action Interface] In a timer event called from: data/actions/scripts/donator/exp.lua:onUse Vou postar o meu exp. lua function onUse(cid, item, frompos, item2, topos) local pausa = 120*60*1000 -- (1000 = 1 segundos) Tempo que o script durará local texto = "You have 3 times more experience for 60 minutes, do not logout or else you will loose the bonus." textofinal = "Your bonus time is gone." -- Texto que irá receber quando o efeito da potion acabar. local exp = 2.0 -- O quanto que você quer que dobre sua experiencia, por exemplo 2 é 2x as rates do seu server. expfinal = 1 --Não mude, isso é para a experiencia voltar ao normal. if item.itemid == 7443 then doRemoveItem(item.uid,1) doPlayerSetExperienceRate(cid,exp) doSendMagicEffect(frompos,13) doPlayerSendTextMessage(cid,22,texto) addEvent(potion,pausa,cid) end end function potion(pos, cid) doPlayerSetExperienceRate(pos,expfinal) doPlayerSendTextMessage(pos,22,textofinal) end
  5. Tp com Limite de Players é um script que determina quantos players podem acessar cada area por vez. Com esse script dá para deixar as hunts mais distribuidas. Veja como funciona com Imagen. Instalando o script: Em data/movements/scripts crie um arquivo com o nome Limitetp.lua e cole este script dentro: local c = { limit = 5, -- Limite de jogadores msgCancel = 'Tp bloqueado. Maximo de jogadores atingido', -- Mensagem quando o limite de jogadores estiver atingido area = { From = {x = 1069, y = 1027, z = 6}, -- Coordenada maxima superior esquerda To = {x = 1071, y = 1030, z = 7}, -- Coordenada minima inferior direita }, pos = {x = 1070, y = 1030, z = 7}, -- Coordenada onde será teletransportado local function getPlayersInArea(fromPos, toPos) local t = {} for _, cid in ipairs(getPlayersOnline()) do if isInRange(getThingPos(cid), fromPos, toPos) then table.insert(t, cid) end end return t end function onStepIn(cid, item, fromPos, toPos) if isPlayer(cid) then if table.getn(getPlayersInArea(c.area.From, c.area.To)) < c.limit then doSendMagicEffect(fromPos, CONST_ME_TELEPORT) doTeleportThing(cid, c.pos) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) else doPlayerSendCancel(cid, c.msgCancel) doTeleportThing(cid, toPos, false) end end return true end Em movements.xml adicione a tag: <movevent type="StepIn" uniqueid="9478" event="script" value="Limitetp.lua"/> Veja a imagem da configuração: Espero que gostem e usem!! Credito: Belerofonte
  6. Eae pessoal do XTibia, hoje venho postar para vocês o sistema de Craft desse tópico: que vinha desenvolvendo, mas resolvi postar pra ver se a galera consiga crescer nos pokétibias (como eu estou tentando fazer) mas estou com pouco tempo e também as sprites deixam à desejar, já que não é todo mundo que têm as sprites da PxG ou de outro servidor. Bom, vamos ao que interessa ! Em data/actions/scripts crie um arquivo chamado stylistcraft.lua e cole isso dentro: Bom, ainda faltam algumas alterações, mas qualquer um com um mínimo de conhecimento em .lua poderá deixar 100% em data/actions.xml cole a seguinte tag: Pronto, está 100% Maaaaaaas e as sprites de troca de outfit ? Hahaha, o link de download delas estará no final do tópico OBS: Retirei NPC de dar a profissão, pois muita gente não usa. Prints do funcionamento do sistema: Download das sprites de troca de Outfit: OBS: Sprite do machado já tem no Client de Tibia ou derivado. Créditos: Eu (Bluester); GabrielTXU; Overllord; Zipter98; PxG pelas sprites. Se tiver mais alguém me avisem.
  7. FALA FAMILIA XTIBIA, QUERIA MUITO ESSE SCRIPT.. EX:. AO CLICAR NA PORTA OU PASSAR NO PISO, APARECESSE " VOCÊ SÓ PODE PASSAR COM X RESETS". E QUERIA CRIAR VÁRIOS LOCAIS COM ESSE TIPO DE SCRIPT MUDANDO SÓ OS RESETS! MEU SISTEMA DE RESET.LUA QUEM PODER AJUDAR, AGRADEÇO. ABRAÇOS!
  8. Bom dia turma, Após um pedido aqui no outro fórum sobre um sistema de Cassino, decidi então criar este e disponibilizar para vocês. Introdução: Bom, este script simula a máquina de Cassino conhecida como Cassino Slots, pra quem não conhece é a máquina que se encontra no spoiler abaixo: Como funciona? O jogador precisa escolher 1 (um) dos 10 (dez) itens disponíveis (da para configurar a quantidade de itens) como seu Item da Sorte, e após feito isso, terá que girar a alavanca e torcer para que a máquina sorteie 3 itens repetidos igual ao que o jogador em questão escolheu. Para tornar um pouco mais fácil de vencer, criei para que a máquina dê pequenos brindes à quem acertar 1 ou 2 itens dos sorteados (configurável). Como jogar? Para jogar é simples, como desenvolvi todo script em apenas um arquivo, para facilitar na criação, na instalação e até mesmo na jogabilidade, o jogo se baseia na posição em que o jogador está para identificar qual ação executar. Selecionar Item da Sorte: com seu personagem virado para baixo (sul), clique na alavanca e automaticamente o item da sorte aparecerá na mesa configurada no script, caso queira outro item, basta ir usando a alavanca até encontrar o item desejado. Como Jogar: Após ter selecionado seu item da sorte, que deve estar à mostra em cima da mesa própria, basta virar seu personagem para cima (norte) e clicar novamente na alavanca. E se virar esquerda ou direita?: Nada acontecerá, apenas uma mensagem ensinando como jogar será enviada para que o jogador se oriente. Dicas de instalação! Sugiro que quando for criar o mapa para o evento, não faça como do vídeo, pois os itens criados nas mesas não estão com atributos para que não possam ser movidos, sendo assim é provável que jogadores de má fé venham a roubar itens... Faça como a imagem abaixo: Instalando: Basta criar um arquivo na pasta “data/actions/scripts” chamado “cassino_slots.lua” e adicionar o código abaixo dentro: Agora em “actions.xml” adicione a tag abaixo: Agora basta configurar de acordo com as informações disponíveis no início do script. Vejam o vídeo demonstrativo do Sistema em funcionamento. Criado por: Adriano Swatt'
  9. Infos: Ao usar o comando !sellpoints quantidade , voce ira criar um item com a quantidade de pontos digitada assim voce podera vender pontos do site in game. Em data/libs Crie um Arquivo chamado PremiumPaper.lua function getPremiumPoints(cid) local query = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = "..getPlayerAccountId(cid)) return query:getDataInt("premium_points") <= 0 and 0 or query:getDataInt("premium_points")endfunction setPremiumPoints(cid, amount) return db.executeQuery("UPDATE `accounts` SET `premium_points` = "..amount.." WHERE `id` = "..getPlayerAccountId(cid))end Em data/talkactions/scripts Crie um arquivo chamado sell_points.lua function onSay(cid, words, param) local var,points = "[sell Point System] Este documento vale %s points para você usar no site.",getPremiumPoints(cid) local min,max = 5, 100 if param == "" or not tonumber(param) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, use somente numeros.") return true elseif tonumber(param) < min or tonumber(param) > max then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, Minimo "..min.." e Maximo "..max.." points.") return true elseif points < tonumber(param) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você só possui "..points.." Premium Points.") return true end local item = doPlayerAddItem(cid, 7702,1) doItemSetAttribute(item, "description", var:format(tonumber(param))) setPremiumPoints(cid, points-tonumber(param)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[sell Point System] Você recebeu um paper com "..param.." Premium Points.") return trueend Em talkactions.xml <talkaction words="!sellpoints;/sellpoints" event="script" value="sell_points.lua"/> Em data/actions/scripts Crie um arquivo chamado paper_points.lua function onUse(cid, item, frompos, item2, topos) local var = getItemAttribute(item.uid, "description") if var == nil then return true end local x = var:match("%b[]") if x == "[sell Point System]" then local ret = var:match("%d+") doPlayerSendTextMessage(cid, 22,"você recebeu "..ret.." Premium Points.") setPremiumPoints(cid, getPremiumPoints(cid)+ret) doRemoveItem(item.uid) end return trueend Em Actions.xml adicione: ( Lembre-se de configurar o itemid para um que voce nao tenha usado ) <action itemid="7702" script="paper_points.lua"/> Imagem(1):
  10. Olá Xtibianos! Vim trazer este script bem criativo. Ele permite você mudar o elemento da wand/rod que escolher. Siga as instruções para que funcione corretamente. Créditos: StrutZ (Otland) Jano (Otland) Non Sequitur (Otland) EXPLICAÇÃO http://imgur.com/kvBzDh5 REQUISITOS INFORMAÇÕES -- Config-- Set wand how the wand deals damageDamageTypeWand = { values = false, -- If this is set to true then it will use the min and max values. If set to false the wand will use the formula -- Damage Values min/max wandMinDam = 20, wandMaxDam = 50, -- Damage Formula formula = { wandMinDam = function(level, maglevel) return -((level / 5) + (maglevel * 1.4) + 8) end, wandMaxDam = function(level, maglevel) return -((level / 5) + (maglevel * 2.2) + 14) end, }}-- Modal window config and storage idlocal config = { storage = 10009, titleMsg = "Change Weapon Damage Type", mainMsg = "Choose a damage type from the list",-- End Config -- Damage Table [1] = {element = "Holy"}, [2] = {element = "Fire"}, [3] = {element = "Death"}, [4] = {element = "Poison"}, [5] = {element = "Energy"}, [6] = {element = "Earth"}, [7] = {element = "Ice"},} INSTALAÇÃO Instale o Modal Window Helper, citado acima Registre o script /data/actions/actions.xml adicionando esta linha (Substituindo "ITEMID" com o item que você quiser usar: <action itemid="ITEMID" script="weapon_damage"/> <action actionid="ACTIONID" script="weapon_damage"/> Crie um novo documento de texto em /data/actions/scripts e nomeie para "weapon_damage.lua" e cole o seguinte: -- Config -- Set wand how the wand deals damageDamageTypeWand = { values = false, -- If this is set to true then it will use the min and max values. If set to false the wand will use the formula -- Damage Values min/max wandMinDam = 20, wandMaxDam = 50, -- Damage Formula formula = { wandMinDam = function(level, maglevel) return -((level / 5) + (maglevel * 1.4) + 8) end, wandMaxDam = function(level, maglevel) return -((level / 5) + (maglevel * 2.2) + 14) end, }} -- Modal window config and storage idlocal config = { storage = 10009, titleMsg = "Change Weapon Damage Type", mainMsg = "Choose a damage type from the list",-- End Config -- Damage Table [1] = {element = "Holy"}, [2] = {element = "Fire"}, [3] = {element = "Death"}, [4] = {element = "Poison"}, [5] = {element = "Energy"}, [6] = {element = "Earth"}, [7] = {element = "Ice"},} function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey) player:sendDamageWindow(config) return trueend Adicione esta linha no seu global.lua: dofile('data/lib/weapon_damage.lua') Crie um novo documento de texto em /data/lib/ e renomeie para "weapon_damage.lua" e cole isto: function Player:sendDamageWindow(config) local function buttonCallback(button, choice) -- Modal window functionallity if button.text == "Confirm" then self:setStorageValue(10009, choice.id) end end -- Modal window design local window = ModalWindow { title = config.titleMsg, -- Title of the modal window message = config.mainMsg, -- The message to be displayed on the modal window } -- Add buttons to the window (Note: if you change the names of these you must change the functions in the modal window functionallity!) window:addButton("Confirm", buttonCallback) window:addButton("Cancel") -- Set what button is pressed when the player presses enter or escape window:setDefaultEnterButton("Confirm") window:setDefaultEscapeButton("Cancel") -- Add choices from the action script for i = 1, #config do local o = config[i].element window:addChoice(o) end -- Send the window to player window:sendToPlayer(self)end Registre o item em /data/weapons/weapons.xml Adicionando essa linha: Essa linha é para se você estiver usando wand <wand id="ITEM ID HERE" level="300" mana="20" script="weapon_damage.lua"><!-- Shadow's Sceptre --> <vocation name="Sorcerer" /> </wand> Crie um novo documento de texto em /data/weapons/scripts e nomeie para "weapon_damage.lua" e cole: local DamageTypes = { [1] = {DamageType = COMBAT_HOLYDAMAGE, DamageEffect = CONST_ANI_HOLY}, [2] = {DamageType = COMBAT_FIREDAMAGE, DamageEffect = CONST_ANI_FIRE}, [3] = {DamageType = COMBAT_DEATHDAMAGE, DamageEffect = CONST_ANI_DEATH}, [4] = {DamageType = COMBAT_POISONDAMAGE, DamageEffect = CONST_ANI_POISON}, [5] = {DamageType = COMBAT_ENERGYDAMAGE, DamageEffect = CONST_ANI_ENERGY}, [6] = {DamageType = COMBAT_EARTHDAMAGE, DamageEffect = CONST_ANI_EARTH}, [7] = {DamageType = COMBAT_ICEDAMAGE, DamageEffect = CONST_ANI_ICE}} function onGetFormulaValues(player, level, maglevel) if DamageTypeWand.values == true then min = -(DamageTypeWand.wandMinDam) max = -(DamageTypeWand.wandMaxDam) else min = DamageTypeWand.formula.wandMinDam(level, maglevel) max = DamageTypeWand.formula.wandMaxDam(level, maglevel) end return min, maxend local combat = {}for k, dam_Table in pairs(DamageTypes) do combat[k] = Combat() combat[k]:setParameter(COMBAT_PARAM_BLOCKARMOR, 1) combat[k]:setParameter(COMBAT_PARAM_BLOCKSHIELD, 1) combat[k]:setParameter(COMBAT_PARAM_TYPE, dam_Table.DamageType) combat[k]:setParameter(COMBAT_PARAM_DISTANCEEFFECT, dam_Table.DamageEffect) -- _G Is used to manually define 'onGetFormulaValues' in this loop in doesnt seem to be able to find the function. _G['onGetFormulaValues' .. k] = onGetFormulaValues combat[k]:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues" .. k)end function onUseWeapon(player, var) local value = player:getStorageValue(10009) local combatUse = combat[value] if not combatUse then return true end return combatUse:execute(player, var)end
  11. Entao Galera Esta dando este Erro na Distro Aqui esta o Script Queria Que Alguem podesse arrumar este erro... Valendo Sempre REP+ e Ficaria muito Grato !!
  12. Nome: Sistema de reset Versão testada: TFS 0.3.6pl1 / 0.4 / 0.3.7 Créditos: fireelement Imagem: Vá em data/talkactions/talkactions.xml e adicione essa tag: <talkaction words="!reset;/reset" event="script" value="reset.lua"/> Agora vá em data/talkactions/scripts/ e crie um arquivo com o nome reset.lua e cole isso nele: local config = { backToLevel = 8, redskull = false, -- need to be without redskull to reset? battle = true, -- need to be without battle to reset? pz = false, -- need to be in protect zone to reset? stages = { {resets = 4, level = 350, premium = 330}, {resets = 9, level = 355, premium = 340}, {resets = 14, level = 360, premium = 355}, {resets = 19, level = 365, premium = 360}, {resets = 24, level = 380, premium = 370}, {resets = 29, level = 390, premium = 380}, {resets = 34, level = 410, premium = 400}, {resets = 39, level = 430, premium = 420}, {resets = 44, level = 450, premium = 440}, {resets = 49, level = 480, premium = 470}, {resets = 54, level = 510, premium = 500}, {resets = 59, level = 550, premium = 540}, {resets = 64, level = 590, premium = 580}, {resets = 69, level = 630, premium = 620}, {resets = 74, level = 680, premium = 670}, {resets = 79, level = 730, premium = 720}, {resets = 84, level = 780, premium = 770}, {resets = 89, level = 860, premium = 840}, {resets = 94, level = 930, premium = 910}, {resets = 2^1024, level = 1010, premium = 990} } } function onSay(cid, words, param) local function getPlayerResets(cid) local resets = getPlayerStorageValue(cid, 500) return resets < 0 and 0 or resets end local function doPlayerAddResets(cid, count) setPlayerStorageValue(cid, 500, getPlayerResets(cid) + count) end if config.redskull and getCreatureSkullType(cid) == 4 then return doPlayerSendCancel(cid, "You need to be without red skull to reset.") elseif config.pz and not getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendCancel(cid, "You need to be in protection zone to reset.") elseif config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then return doPlayerSendCancel(cid, "You need to be without battle to reset.") end local resetLevel = 0 for x, y in ipairs(config.stages) do if getPlayerResets(cid) <= y.resets then resetLevel = isPremium(cid) and y.premium or y.level break end end if getPlayerLevel(cid) < resetLevel then return doPlayerSendCancel(cid, "You need level " .. resetLevel .. " or more to reset.") end doPlayerAddResets(cid, 1) local healthMax, manaMax = getCreatureMaxHealth(cid), getCreatureMaxMana(cid) doPlayerAddLevel(cid, -(getPlayerLevel(cid) - config.backToLevel)) setCreatureMaxHealth(cid, healthMax) setCreatureMaxMana(cid, manaMax) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Now you have " .. getPlayerResets(cid) .. " " .. (getPlayerResets(cid) == 1 and "reset" or "resets") .. ".") return true end
  13. Créditos à principe sharigan. Objetivo Mutar e desmutar o player usando /mute ou /desmute. Tutorial talkactions.xml: <talkaction log="yes" acess="3" words="/mute;/desmute" access="2" event="script" value="muteplayer.lua"/> talkactions/scripts, crie arquivo com nome muteplayer.lua e bote isso dentro: local v = {} for k = 1, 100 do table.insert(v, createConditionObject(CONDITION_MUTED)) setConditionParam(v[k], CONDITION_PARAM_TICKS, k*60*1000) end function onSay(cid, words, param) if (words == "/mute") then local t = string.explode(param, ",") if param == '' then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local player,time,pid = getPlayerByName(t[1]),t[2],getPlayerByNameWildcard(t[1]) if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você mutou o jogador "..t[1].." por "..time.." minutos.") doAddCondition(player, v[tonumber(time)]) setPlayerStorageValue(player, 90000, os.time()+time*60) doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você foi mutado por "..time.." minutos.") elseif (words == "/desmute") then if param == '' then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local player = getPlayerByNameWildcard(param) if(not player)then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") return true end if getCreatureCondition(player, CONDITION_MUTED) == false then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "este jogador não está mutado.") return true end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você desmutou o jogador "..param..".") doRemoveCondition(player, CONDITION_MUTED) setPlayerStorageValue(player, 90000, -1) doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você foi desmutado.") end return true end
  14. Olá, Esse script não é nada complexo, mas, como a maioria dos que vejo sobre Shiny Stone é necessário fazer tabelas para definir os pokémons que irão evoluir e talz, achei melhor fazer este aqui, que é mais simples. As configurações já estão indicadas no script. Ah, pra quem não sabe, Shiny Stone transforma o pokémon na sua versão shiny. Vá em data/actions/scripts, crie um arquivo com extensão .lua, nomeie-o shinystone, e adicione o seguinte conteúdo: Agora, em data/actions, abra actions.xml, e adicione a tag: <action itemid="id da shiny stone" event="script" value="shinystone.lua" allowfaruse="1"/> Só isso, qualquer erro, só postar. Testei aqui, e está funcionando perfeitamente. Testado em PDA by Slicer sem level, v1.9. Ah, só mais uma complementação: só está evoluindo pokémons que sua versão shiny tenha "Shiny " antes do nome. Por exemplo, "Shiny Electabuzz". Se em seu server os shinies não tiverem o prefixo "Shiny", obviamente, o pokémon não irá evoluir.
  15. Como o Nome Diz, Ele Serve Para Mudar Seu Nome Dentro Do Jogo. Vá Em data/talkactions/scripts, Copie Um Arquivo, Renomeie-o Para changename.lua, e Cole Isso Nele - local config = { item = { Id = 1111, count = 0, }, maxTextLenght = 15, blacklistParam = {"account manager", "god", "cm", "gm", "tutor", "tester"}, minWordLenght = 3, delay = 2 } function onSay(cid, words, param, channel) local textCancel, t = config.text, string.explode(param, ",") if(param == '') then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") elseif((getPlayerGUIDByName(t[1]) ~= nil) and (not getBooleanFromString(t[2]))) then textCancel = "That name is already in use." elseif(getPlayerItemCount(cid, config.item.Id) < config.item.count) then textCancel = "You do not fulfill the requirements." elseif(not getTilePzInfo(getCreaturePosition(cid))) then textCancel = "You must be inside a protection zone to use this command." elseif(string.len(tostring(t[1])) >= config.maxTextLenght) then textCancel = "You can only use a maximum of " .. config.maxTextLenght .. " characters." elseif(string.find(t[1]:lower(), "[^%l%s]") ~= nil) then textCancel = "You cannot use symbols." else for blacklist = 1, table.maxn(config.blacklistParam) do if(string.find(t[1]:lower(), config.blacklistParam[blacklist]) ~= nil) then textCancel = "Invalid name entry." break end end end if(config.text ~= textCancel) then doPlayerSendCancel(cid, textCancel) return true end local paramTemp, space, oldName = '', '', getCreatureName(cid) for word in string.gmatch(t[1], "%a+") do if(string.len(word) < config.minWordLenght) then doPlayerSendCancel(cid, "Each word must have a minimum of " .. config.minWordLenght .. " characters.") return true end paramTemp = "" .. paramTemp .. "" .. space .. "" .. word .. "" if(space == '') then space = " " end end local guid = getPlayerGUID(cid) t[1] = paramTemp doPlayerRemoveItem(cid, config.item.Id, config.item.count) if(pcall(doPlayerChangeName, guid, oldName, t[1]) == false) then db.executeQuery("INSERT INTO `player_namelocks` (`player_id`, `name`, `new_name`, `date`) VALUES (" .. guid .. ", " .. db.escapeString(oldName) .. ", " .. db.escapeString(t[1]) .. ", " .. os.time() .. ");") db.executeQuery("UPDATE `players` SET `name` = " .. db.escapeString(t[1]) .. " WHERE `id` = " .. guid .. " LIMIT 1;") end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your name has been changed successfully. You will be kicked in " .. config.delay .. " seconds.") addEvent(function(cid, forceLogout) if(isPlayer(cid)) then doRemoveCreature(cid, forceLogout) end end, config.delay * 1000, cid, false) return true end Em talkactions.xml Adicione Essa Tag - <talkaction words="!changename;/changename;!namechange;/namechange" script="changename.lua" /> Créditos - Ratser
  16. Survival of the Fittest O que é ? Como funciona ? Como configurar ? "Mensagens" Instalando : É isso
  17. Esse sistema de addonbox poder vim addons aleatorios.. function onUse(cid, item, fromPosition, itemEx, toPosition) local config = { premium = true, -- se precisa ser premium account (true or false) battle = false, -- se precisa estar sem battle (true). Se colocar false, poderá usar addons box no meio de batalhas level = 100, -- level para poder usar addons box } local items = {13064,13060} ----id do addon if getPlayerLevel(cid) < config.level then doPlayerSendCancel(cid, "precisar ser level ".. config.level ..".") return true end if config.premium and not isPremium(cid) then doPlayerSendCancel(cid, "Somente player premium.") return true end if config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendCancel(cid, "Your pokemon can't concentrate during battles.") return true end doPlayerAddItem(cid, items[math.random(#items)]) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce Abriu Addon Box") doRemoveItem(item.uid, 1) end criar 1 arquivo com nome addonbox.lua poder escolher entre as 2 script 1-- script poder escolher level para abrir addon box e addons aleatorios 2-- script e bem basica só poder ganhar 1 addon na addon box function onUse(cid, item, fromPosition, itemEx, toPosition) local config = { premium = true, -- se precisa ser premium account (true or false) battle = false -- se precisa estar sem battle (true). Se colocar false, poderá usar addons box no meio de batalhas } id = 13064 count = 1 -- id do item e quantidade if config.premium and not isPremium(cid) then doPlayerSendCancel(cid, "Somente player premium.") return true end if config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendCancel(cid, "Your pokemon can't concentrate during battles.") return true end doPlayerAddItem(cid, id, count) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce Abriu Addons Box E Ganhou Addons De "..getItemNameById(id)..".") doRemoveItem(item.uid, 1) end tag <action itemid="id_do_item" event="script" value="addonbox.lua"/>
  18. Bom, creio que o titulo já diga por si só, porém venho a explicar melhor a situação. Preciso de uma alavanca a qual quando usada aparecem magic effects em determinados SQM's. Creio que seja um script simples, desde já agradeço
  19. [spoiler*] Criar 1 arquivo com nome Porta.lua function onUse(cid, item, fromPosition, itemEx, toPosition) local itemid = 2139 ---- ITEM QUER PRECISAR PARA PASSAR PELA PORTA local pos = {x = 1107, y = 1017, z = 7} -- posição pra onde sera teleportado if #getCreatureSummons(cid) >= 1 then return doPlayerSendCancel(cid, "Return your pokemon.") end if getPlayerItemCount(cid, itemid) >= 1 then doPlayerSendCancel(cid, "MENSAGEM!.") doTeleportThing(cid, pos) else doPlayerSendCancel(cid, "MENSAGEM!") end return true end Tag <action actionid="55555" event="script" value="Porta.lua"/> [spoiler*]
  20. Eae pessoal, Fiz esse script apenas para ajudar um membro, porém nunca vi nada parecido aqui, resolvi postar. É bem simples, mas da para fazer muita coisa legal. Quem quiser qualquer alteração como condição para usar, mudar para talkactions, etc... é só pedir no tópico. Basicamente é só dá use no item, que você fica invisível para players e monsters, por determinado tempo. Vamos usar CONDITION, porém só funciona se o player que usar o item, tiver group id maior que os outros, para que fique invisível. Mas nosso amigo @caotic vai nos ensinar a mudar isso: Faça isso e independente do seu grupo você vai fica invisível para todos. agora vá em data/actions/scripts e crie uma arquivo.lua, e cole isso dentro: local tempo = 1 -- tempo que o player vai ficar invisivel em segundos. local ghost = createConditionObject(CONDITION_GAMEMASTER, 1000*tempo, false, GAMEMASTER_INVISIBLE) local outfit = createConditionObject(CONDITION_INVISIBLE, 1000*tempo, false) function onUse(cid, item) if not isPlayerGhost(cid) then doRemoveItem(item.uid, 1) doSendMagicEffect(getCreaturePosition(cid), 12) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Você está invisivel, agora ninguem pode te ver.") doAddCondition(cid, ghost) doAddCondition(cid, outfit) else doPlayerSendCancel(cid, "Você já está invisivel.") doSendMagicEffect(getCreaturePosition(cid), 2) end return true end depois vá em data/actions/actions.xml e adicione a tag: <action itemid="IDdoITEM" script="NomeDoArquivo.lua"/> pronto. Como falei é bem simples, qualquer coisa é só pedir...
  21. Não consigo aumentar o limite de efeitos do client, segui um tutorial porém, algumas funções tem pequenas diferenças, já tentei deixar exatamente como no tutorial e não consegui, tentei usar uma outra source que já contém efeitos aumentados para comparação mas na hora de compilar da erro, não entendo de source, alguém poderia fazer o imenso favor de aumentar esse limite nas sources? OBS: Compila normal se eu não fazer as alterações para aumentar esse limite Link do tutorial ensinando aumentar o limite de effects (único que achei, nele tem 1 source já com effects aumentados como base): Aumentando limite de efeitos Download da Source sem NADA alterado (0.3.6 (Crying Damson)) Source (Já contém Scan no 4shared) Essa Source é desse Post: Base Bolz 2.5 Open Source Download da Source que editei pela ultima vez tentando aumentar os effects, os erros da compilação abaixo são referentes a essa ultima tentativa Source que tentei aumentar os efeitos pela ultima vez OBS: Todas tentativas deram erros, os erros são praticamentes os mesmos, mudam poucas coisas ou ordem Aqui o Log do Compilador Completo (Todos erros): (Resumo) Os Ultimos erros que apareceram, e que falam (diretamente) sobre o que eu alterei: Explicando a situação o mais completo possível pra que possam me ajudar: Na minha source, algumas coisas são um pouco diferentes de como estão no post do tutorial, eu tentei deixar exatamente como diz lá e na hora de compilar aparecem VÁRIOS erros (se compilar sem editar nada, funciona) Exemplo, no tutorial manda procurar em 2 lugares por: void ProtocolGamesendMagicEffect(const Position& pos, uint8_t type) e trocar por: void ProtocolGame::sendMagicEffect(const Position& pos, uint16_t type) em protocolgame.cpp está exatamente igual, eu substituo como dito no post. Já no protocolgame.h está assim: void sendMagicEffect(const Position& pos, uint8_t type) Em alguns outros lugares eu encontro o "void Game::" em vez de só "void" , em outros ao contrário... Mesmo com essas diferenças, eu consegui encontrar TODOS, vi que só o que muda é o: ProtocolGame:: ou Game:: Tentei substituir pelo do post e deixar tudo EXATAMENTE como diz o post, porém da erro, creio que em alguns lugares eu devo retirar o "ProtocolGame::", em outros colocar, em alguns lugares adicionar "Game::" e em outros retirar, porém são muitas combinações possiveis, estou tentando e não estou conseguindo, cada combinação que tendo aparecem erros diferentes, @Skulls @Gabrieltxu @JairKevick
  22. Feito por Codex NG. Esse script vai criar uma ponte em direção x e, em seguida, irá destruir-se e enviar o jogador para o andar de baixo. Zelda Like Bridge --[[ Zelda like bridge by Breed ]] c = { -- config b = { -- this is your starting point, depending on the direction you choose is the direction your bridge will form x=124, y=125, z=6, -- every tile after this location will form a bridge for the value of bridgeLength }, sp = 0, -- do not edit actionid = 803, -- action id of the tile which activates the bridge -- these are the normal switch id's but you can use any tiles you like tileStepIn = 426, -- the switch or item you want to use to click on tileStepOut = 425, -- the it will be transformed to bridgeLength = 13, -- the length of the bridge in tiles bridgeItem = 406, -- 406 is black, 407 is white direction = {"north", "east", "south", "west"}, timer = 2, -- time in seconds, 1 equals 1 second itemid = {}, -- table to hold the items that are removed oldLoc = {}, tile_id = 459, -- stairs create = CONST_ME_GROUNDSHAKER, -- this is the effect when creating the bridge destroy = CONST_ME_FIREAREA, -- this is the effect when destroying the bridge exhaust = true, exhaust_time = 1, -- this is the monster = "Demon" } local choice = "east" -- Do not edit anything below function onStepIn(cid, item, pos, fromPos) if item.itemid == c.tileStepIn and item.actionid == c.actionid and isPlayer(cid) then if c.exhaust then c.exhaust = false if choice == c.direction[1] then -- north for i = 1, c.bridgeLength do c.oldLoc[i] = {x = c.b.x, y = c.b.y - i, z = c.b.z, stackpos = c.sp} end elseif choice == c.direction[2] then -- east for i = 1, c.bridgeLength do c.oldLoc[i] = {x = c.b.x + i, y = c.b.y, z = c.b.z, stackpos = c.sp} end elseif choice == c.direction[3] then -- south for i = 1, c.bridgeLength do c.oldLoc[i] = {x = c.b.x, y = c.b.y + i, z = c.b.z, stackpos = c.sp} end elseif choice == c.direction[4] then -- west for i = 1, c.bridgeLength do c.oldLoc[i] = {x = c.b.x - i, y = c.b.y, z = c.b.z, stackpos = c.sp} end end for i = 1, c.bridgeLength do local l = c.oldLoc[i] c.itemid[i] = getThingfromPos(c.oldLoc[i]).itemid local bridge = (i % 2 == 0) and c.bridgeItem or c.bridgeItem + 1 -- this will swap between 2 different tiles addEvent(makeBridge, i * 1000, c.oldLoc[i], bridge, c.create) end doTransformItem(item.uid, c.tileStepOut) addEvent(removeBridge, (c.bridgeLength + c.timer) * 1000, c) return true else doTransformItem(item.uid, c.tileStepOut) end end return true end function makeBridge(pos, item, effect) local newpos = {x = pos.x, y = pos.y, z = pos.z + 1} doSendMagicEffect(pos, effect) doTransformItem(getThingfromPos(pos).uid, item) if getTopCreature(pos).uid > 1 then local player = Tile(pos):getTopCreature() if player ~= nil or player:isPlayer() then player:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) player:teleportTo(newpos, false) end end end function resetExhaust(c, val) c.exhaust = val end function removeBridge(c) for n = 1, c.bridgeLength do addEvent(makeBridge, n * 1000, c.oldLoc[n], c.tile_id, c.destroy) if (n * 1000) == (c.bridgeLength * 1000) then addEvent(resetExhaust, (c.bridgeLength + c.exhaust_time) * 1000, c, true) doSummonCreature(c.monster, c.oldLoc[#c.oldLoc]) end end end function onStepOut(cid, item, pos) doTransformItem(item.uid, c.tileStepIn) end Fiery Death local lava = {598, 599, 600, 601, 1509, 9883} -- lava tile id, 1509 is walkable local health = 1 -- percentage of hp to take, .1 is 10%, .2 is 20%, 1 is 100% function onStepIn(cid, item, pos, fromPos) if isInArray(lava, getThingfromPos(pos).itemid) then doCreatureAddHealth(cid, -(getCreatureMaxHealth(cid) * health)) end end
  23. Ta ai um script muito bom galera, créditos e instruções no próprio script. --[[ Square Skill Trainer made by Arthur aka artofwork 12/1/14, my original account Updated 10/15/2015, to 1.2 based on tfs sources on github by Codex NG This script will train all of a players skills indefintely including magic level It has a small configuration setup where you can set the number of tries per skill The time interval in between each skill try added A storage value to help prevent abuse You can assign any tile you wish to this script that a player can walk on with action id 900 Now removes offline training time for free accounts New in this script? skill tries for both free account & premium accounts mana gain for both free & premium accounts mana multipliers to effect magic level for both free and premium accounts based on percentage experience gain for both free and prem accounts Added optional all skills for free accounts or just the weapons & shield they have equiped add this too movements <!-- Square Trainer --> <movevent event="StepIn" actionid="900" script="squaretrainer.lua"/> <movevent event="StepOut" actionid="900" script="squaretrainer.lua"/> save this file in data\movements\script\ as squaretrainer.lua ]]-- local special = false -- true for vip false for prem -- do not edit local currentTime = os.time() local day = 86400 -- 1 full day in seconds local minimumTime = 0 -- minimum time for vip local addSkillTimer = 1000 -- do not edit - time at which skill tries are added local skills = 5 -- 0 to 5 includes 0:fist, 1:club, 2:sword, 3:axe, 4:distance, 5:shield -- do not edit ------------------------------- local allskills = false -- should free accounts train all their skills local removeOfflineTime = true -- do you want to remove offline training time? -- minutes to remove per minute, should be minimum 2 since they gain a minute for every minute they are not killing something local timeOfOfflineToRemove = 2 -- minimum hours needed to train, set it to 12 if u want to test the tp to temple local minimumTimeNeedToUseTrainers = 1 local useConfigMlRate = false -- do you want to use the config settings rate of Magic in this script local useConfigExpRate = false -- do you want to use the config settings rate of Exp in this script local useConfigSkillRate = true -- do you want to use the config settings rate of Skills in this script -- do not edit local keys = { RATE_SKILL = 6, RATE_MAGIC = 8, RATE_LOOT = 7, RATE_EXPERIENCE = 5 } local tseconds = 1000 local tminute = 60 * tseconds local thour = 60 * tminute local trainingTimeMax = thour * minimumTimeNeedToUseTrainers -- 43200000 default value (12 hours) ----------------- -- used by isSpecial, this allows certain account types to skip the offline time removal local godAccount = 4 -- tile actionid local aid = 900 local p = {} local addskills = { prem = 1000, -- xp to add as vip/prem (depends if special is true) account per interval -- the rate is a percentage of their max mana, this way it scales with their level manaGainPremRate = .10, -- mana to add as vip/prem (depends if special is true) account per interval premSkillTries = 100, -- Number of tries per skill for vip/prem (depends if special is true) account per interval premManaMultiplier = 5, -- when player has full mana multiply how much more mana is used to gain magic level free = 100, manaGainFreeRate = .01, -- mana to add as free account per interval freeSkillTries = 1, -- Number of tries per skill for free account freeManaMultiplier = 1, -- when player has full mana multiply how much more mana is used to gain magic level balanceShield = 3 -- 3 is good, but if shielding goes up too quick then lower it, use only whole numbers e.g. 1, 2, 3 } -- do not edit local weaponTypes = { [0] = { 0, 0 }, -- fist { 1, 2 }, -- Sword { 2, 1 }, -- Club { 3, 3 }, -- Axe { 4, 5 }, -- Shield { 5, 4 }, -- Distance { 6, 0 } -- 6 is rod / wands, 0 is for fists.. } local shieldId = 5 function getSlottedItems(player) local left = pushThing(player:getSlotItem(CONST_SLOT_LEFT)).itemid local right = pushThing(player:getSlotItem(CONST_SLOT_RIGHT)).itemid left = ItemType( left ):getWeaponType() right = ItemType( right ):getWeaponType() return left, right end -------------------------------- -- this function is only effected by free accounts function templeTeleport(p) p.player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) p.player:setStorageValue( 18010, 0) local temple = p.player:getTown():getTemplePosition() p.player:teleportTo(temple) temple:sendMagicEffect(CONST_ME_ENERGYAREA) p.player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Sorry, "..p.name.." you don't have enough offline time to train.") end function RemoveOfflineTrainingTime(p) if trainingTimeCheck(p) then p.player:removeOfflineTrainingTime(timeOfOfflineToRemove * 60000) p.seconds = 60000 -- reset the timer end end function trainingTimeCheck(p) local time_ = p.player:getOfflineTrainingTime() if time_ <= (timeOfOfflineToRemove * tminute) then templeTeleport(p) end if time_ >= trainingTimeMax then return true else templeTeleport(p) end end function isSpecial(player) -- this is so i could test the shit right away if player:getAccountType() >= godAccount then return true end if special then return (math.floor((player:getStorageValue(13540) - currentTime) / (day)) > minimumTime) else return player:isPremium() end end function train(p) local player = p.player if player:isPlayer() and player:getStorageValue(18010) == 1 then if isSpecial(player) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Your training session will now begin.") addEvent(trainMe, 1, p) else -- if free account, they have to wait 30 seconds to begin training if p.secondsTime > 0 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Your training session will begin in "..(p.secondsTime).." seconds.") end if p.secondsTime <= 0 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Your training session will now begin.") addEvent(trainMe, 1, p) else p.secondsTime = p.secondsTime - 10 addEvent(train, 10000, p) end end end return true end function returnRate(useRate, RATE) return useRate and configManager.getNumber(RATE) - 3300 or 1 end function trainMe(p) local player = p.player local weaponLeft, weaponRight = getSlottedItems(player) if player:isPlayer() and player:getStorageValue(18010) == 1 then if isSpecial(player) then player:addExperience(addskills["prem"] * returnRate(useConfigExpRate, RATE_EXPERIENCE) ) -- add mana to player based on premium mana rate settings player:addManaSpent(addskills["manaGainPremRate"] * player:getMaxMana() ) else player:addExperience(addskills["free"] * returnRate(useConfigExpRate, RATE_EXPERIENCE) ) -- add mana to player based on free mana rate settings player:addManaSpent(addskills["manaGainFreeRate"] * player:getMaxMana() ) end for i = 0, skills do if isSpecial(player) then if i == shieldId then -- shielding, will help balance shield gain player:addSkillTries(i, (addskills["premSkillTries"] * addskills["balanceShield"]) * returnRate(useConfigSkillRate, RATE_SKILL) ) else player:addSkillTries(i, addskills["premSkillTries"] * returnRate(useConfigSkillRate, RATE_SKILL) ) -- all other skills end else if allskills then if i == shieldId then -- shielding, will help balance shield gain player:addSkillTries(i, (addskills["freeSkillTries"] * addskills["balanceShield"]) * returnRate(useConfigSkillRate, RATE_SKILL) ) else player:addSkillTries(i, addskills["freeSkillTries"] * returnRate(useConfigSkillRate, RATE_SKILL) ) -- all other skills end else -- this effects only free accounts for i = 0, #weaponTypes do if weaponTypes[i][2] == shieldId and weaponTypes[i][1] == weaponRight then player:addSkillTries(weaponTypes[i][2], (addskills["freeSkillTries"] * addskills["balanceShield"]) * returnRate(useConfigSkillRate, RATE_SKILL) ) end if weaponTypes[i][2] ~= shieldId and weaponTypes[i][1] == weaponLeft then player:addSkillTries(weaponTypes[i][2], addskills["freeSkillTries"] * returnRate(useConfigSkillRate, RATE_SKILL) ) end end end end -- will increase magic level based on max mana times multiplier local maxMana = player:getMaxMana() if player:getMana() == maxMana then if isSpecial(player) then -- premium account multiplier used to increase level player:addManaSpent(maxMana * (addskills["premManaMultiplier"] * returnRate(useConfigMlRate, RATE_MAGIC)) ) else -- free account multiplier used to increase level player:addManaSpent(maxMana * (addskills["freeManaMultiplier"] * returnRate(useConfigMlRate, RATE_MAGIC)) ) end player:addMana(-maxMana) end end if not isSpecial(player) then p.seconds = p.seconds - addSkillTimer if(p.seconds <= 1000) then -- we want to be fair so we make sure the player gets a whole minute if removeOfflineTime then addEvent(RemoveOfflineTrainingTime, 1, p) end end end addEvent(trainMe, addSkillTimer, p) end return true end function onStepIn(player, item, position, fromPosition) if not player:isPlayer() then return false end p = -- this is table is essential so we can pass it to the other functions { player = player:getPlayer(), item = item, pos = player:getPosition(), soul = player:getSoul(), seconds = 60000, secondsTime = 30, name = player:getName() } if player:isPlayer() then if player:getStorageValue(18010) < 1 then if p.item.actionid == aid then player:setStorageValue(18010, 1) -- if the player is a free acc they will lose offline training time as they train if removeOfflineTime then RemoveOfflineTrainingTime(p) end addEvent(train, 1, p) end else player:teleportTo(fromPos, true) end end return true end function onStepOut(player, item, position, fromPosition) p.secondsTime = 30 stopEvent(train) -- may not work as expected stopEvent(trainMe) -- may not work as expected player:setStorageValue(18010, 0) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Your training session has now ended.") return true end
  24. Créditos à Caronte & Adriano SwaTT. Testado em TFS 0.4. Coloquei em spoiler porque o conteúdo é grande. VERSÃO 1 VERSÃO 2
×
×
  • Criar Novo...