Ir para conteúdo
  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo

Fóruns

  • Portal Tibiaking
    • Portal
    • Server Oficial TibiaKing
    • Sobre o Fórum
    • Projetos Open Source
    • Regras
  • OTServer Tibia & Derivados
    • Suporte & Pedidos
    • OTServer Downloads
    • OTServer Scripts
    • Ferramentas OpenTibia
    • Linguagens de Programação
    • Mapas
    • Websites
    • Show Off
    • Gráficos e Design
    • Divulgações
  • Tibia e Bots
    • Tibia
    • Bots & Macro
  • Diversos
    • Playground (Off-topic)

Calendários

  • Calendário Oficial
  • Calendário de OTServs
  • Calendários Diversos

Categorias

  • Oficial TibiaKing
    • Premium Forgottenserver
  • Conteúdo da Comunidade
    • Sprites

Categorias

  • Articles

Blogs

Não há resultados

Product Groups

  • Advertisement

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...

Encontrado 34 registros

  1. Fala galera linduxa do TK; hoje trago a vocês o tão desejado CASTLE WAR 24 HORAS, isto gera disputa intensa entre as guilds de seu servidor, atraindo assim mais jogadores que se interessam por guerras e seus demais sistemas! Modificado e com funções diferentes, no tópico ensinarei como instalar e como funciona. Como funciona? WOOOOOOOOW! Há um portal 24h aberto em algum lugar do seu mapa que ficará com o castle disponível 24h (avá). Quando uma guild qualquer acessar o portal do castelo, irá aparecer para o servidor que a X guild está tentando dominar o castelo, então o líde da guild dominante atual irá dizer !gocastle para teleportar ao castelo e defende-lo. O Objetivo para conquista do mesmo é invadi-lo derrotar os defensor da guild atual para abrir passagem, digamos assim, e subir ao trono, quando um membro da guild invadir o templo do trono e subir no mesmo a antiga guild dominadora é teleportada para o templo e o castelo fica sob domínio da nova guild. Você poderá colocar como premiação acesso a áreas exclusivas do castelo, no caso hunts e cia. (Fica a vosso critério) Evento testado nas versões 8.6; 9.6; 9.83; 9.86! Observação: Comando !gocastle faz com que o líder possa teleportar todos os membros da sua guild online para perto dele, desde que ele esteja no castle. Comando pode ser usado a cada 3 horas (exhausted). Vamos aos scripts do sistema; Em data/actions/scripts crie um arquivo com o nome de naviocastle.lua e coloque dentro: function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.actionid == 65500) then if getTopCreature({x=32464,y=32378,z=5}).uid > 0 then doTeleportThing(getTopCreature({x=32464,y=32378,z=5}).uid, {x=32526,y=32421,z=5}) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) else doPlayerSendCancel(cid, "Você precisa estar em cima do tapete.") return true end elseif (item.actionid == 65501) then if getTopCreature({x=32526,y=32421,z=5}).uid > 0 then doTeleportThing(getTopCreature({x=32526,y=32421,z=5}).uid, {x=32464,y=32378,z=5}) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) else doPlayerSendCancel(cid, "Você precisa estar em cima do tapete.") end end return true end Em actions.xml adicione a seguinte linha: <action actionid="65500-65501" event="script" value="naviocastle.lua"/> Pós feito isto, em data/lib crie um arquivo com o nome de 015-COH e adicione dentro dele: -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- // COH_PUSHTIME = 10800 -- Tempo (em segundos) de exhausted para usar o comando !gocastle - Padrão (3 horas) COH_AREA = {{x = 32458, y = 32332, z = 7}, {x = 32558, y = 32429, z = 7}} -- Canto superior esquerdo / inferior direito do Castle -- // Não mexa daqui para baixo COH_STATUS = 201320111714 COH_PREPARE1 = 201320111715 COH_PUSHSTOR = 201320111716 COH_PREPARE2 = 201320111717 function doCastleRemoveEnemies() for index, creature in ipairs(getPlayersOnline()) do if isInArea(getThingPos(creature), COH_AREA[1], COH_AREA[2]) then if getPlayerGuildName(creature) ~= getGlobalStorageValue(COH_STATUS) then doTeleportThing(creature, getTownTemplePosition(getPlayerTown(creature))) end end end return true end Proximo passo, em data/monster.xml adicione a seguinte linha: <monster name="Castle Guardian" file="Castle Guardian.xml"/> Em data/monsters crie um arquivo com o nome de Castle Guardian.xml e adicione o seguinte: <?xml version="1.0" encoding="UTF-8"?> <monster name="Castle Guardian" nameDescription="a castle guardian" race="blood" experience="0" speed="0" manacost="0"> <health now="800000" max="800000"/> <look type="131" head="57" body="19" legs="57" feet="95" addons="1" corpse="6080"/> <targetchange interval="5000" chance="30"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="0"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="0"/> <flag convinceable="0"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag canpushcreatures="1"/> <flag targetdistance="4"/> <flag staticattack="90"/> <flag runonhealth="800"/> </flags> <attacks> <attack name="melee" interval="2000" min="-60" max="-180"/> <attack name="physical" interval="1000" chance="35" range="7" min="-205" max="-385"> <attribute key="shootEffect" value="energy"/> </attack> <attack name="manadrain" interval="1000" chance="17" range="7" min="-205" max="-560"/> <attack name="speed" interval="1000" chance="12" range="7" speedchange="-600" duration="40000"> <attribute key="areaEffect" value="redshimmer"/> </attack> <attack name="fire" interval="2000" chance="45" range="7" radius="3" target="1" min="-250" max="-420"> <attribute key="shootEffect" value="burstarrow"/> <attribute key="areaEffect" value="firearea"/> </attack> <attack name="firefield" interval="1000" chance="20" range="7" radius="2" target="1"> <attribute key="shootEffect" value="fire"/> </attack> <attack name="energy" interval="2000" chance="25" length="8" spread="0" min="-265" max="-445"> <attribute key="areaEffect" value="energy"/> </attack> <attack name="speed" interval="6000" chance="10" range="5" speedchange="-600" duration="20000"> <attribute key="areaEffect" value="redshimmer"/> </attack> </attacks> <defenses armor="1" defense="1"/> <elements> <element firePercent="100"/> <element energyPercent="100"/> <element icePercent="100"/> <element earthPercent="90"/> <element holyPercent="-25"/> <element physicalPercent="-33"/> </elements> <immunities> <immunity paralyze="1"/> <immunity invisible="1"/> </immunities> <summons maxSummons="2"> <summon name="deathspawn" interval="1500" chance="0" max="0"/> </summons> <loot> <item id="2148" countmax="20" chance1="100000" chancemax="0"/> </loot> </monster> Pós isto; Em data/movements/scripts crie um arquivo com o nome de COH.lua e adicione o seguinte: -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- // function onStepIn(cid, item, pos, fromPosition) local pos = getThingPos(cid) if item.actionid == 16203 then if not isPlayer(cid) then return true end if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then doSendMagicEffect(getThingPos(cid), 14) doSendAnimatedText(pos, "CoH", math.random(1, 255)) else doSendMagicEffect(getThingPos(cid), 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[CoH] Você não pertence á guild "..getGlobalStorageValue(COH_STATUS)..".") end return true end if item.actionid == 16202 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then if (getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid)) then doPlayerSendTextMessage(cid, 20, "[Castle of Honor] Você e sua guild estão no comando, os antigos donos ["..tostring(getGlobalStorageValue(COH_STATUS)).."] podem se vingar!") setGlobalStorageValue(COH_PREPARE1, -1) setGlobalStorageValue(COH_PREPARE2, -1) setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid)) doCastleRemoveEnemies() doBroadcastMessage("[Castle of Honor] O jogador ["..getCreatureName(cid).."] e sua guild ["..getPlayerGuildName(cid).."] estão no comando do castelo, vá dominar e impedir isso!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.") end return true end if item.actionid == 16200 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then doSendAnimatedText(pos, "CoH", math.random(1, 255)) if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid))) then setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid)) doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está tentando dominar o castelo, preparem-se!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.") return true end end if item.actionid == 16201 then if not isPlayer(cid) then return true end doSendAnimatedText(pos, "CoH", math.random(1, 255)) if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid)) doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está muito próxima do domínio, ataquem!") end end return true end Em data/movements/movements.xml adicione a seguinte linha: <movevent type="StepIn" actionid="16200-16203" event="script" value="COH.lua"/> Próximo passo: Em data/talkactions/scripts crie um arquivo com o nome de COHABSOLUTE.lua e adicione o seguinte: -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- // function onSay(cid, words, param) if getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER then if getPlayerStorageValue(cid, COH_PUSHSTOR) < os.time() then if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then if isInArea(getThingPos(cid), COH_AREA[1], COH_AREA[2]) then if #getMembersOnline(getPlayerGuildId(cid)) > 0 then for index, creature in ipairs(getMembersOnline(getPlayerGuildId(cid))) do if (getTileInfo(getThingPos(creature)).protection ~= true) then return doPlayerSendCancel(cid, "[CoH] Os membros devem estar em área PZ.") end doTeleportThing(creature, getThingPos(cid)) end setPlayerStorageValue(cid, COH_PUSHSTOR, os.time() + COH_PUSHTIME) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "[Castle of Honor] Você teleportou seus membros, comando pode ser usado a cada "..tostring(COH_PUSHTIME / 60).." minuto(s).") else doPlayerSendCancel(cid, "[CoH] Para executar isso, sua guild deve ter 2 ou mais membros online.") end else doPlayerSendCancel(cid, "[CoH] Você deve estar no castelo.") end else doPlayerSendCancel(cid, "[CoH] Sua guild não é dona do castelo.") end else doPlayerSendCancel(cid, "[CoH] Você deve aguardar "..tostring(math.ceil((getPlayerStorageValue(cid, COH_PUSHSTOR) - os.time()) / 60)).." minuto(s) para usar este comando.") end else doPlayerSendCancel(cid, "[CoH] Você deve ser líder de uma guild para executar este comando.") end return true end function getMembersOnline(id) local mbr = {} for index, creature in ipairs(getPlayersOnline()) do if getPlayerGuildId(creature) == id then if getCreatureSkullType(creature) < 3 then table.insert(mbr, creature) end end end return mbr or #mbr end Em data/talkactions/talkactions.xml adicione a seguinte linha: <talkaction words="!castlepush;!pushmembers;!gocastle" event="script" value="COHABSOLUTE.lua"/> Quem disponibiliza o mapa do castelo a vocês é nosso amigo ViitinG, segue o link do tópico para download do mesmo já adaptado para este Castle: http://www.tibiaking.com/forum/topic/35730-mapa-evento-war-castle/ Explicação das actions e demais (caso não use o mapa disponibilizado pelo Viiting lembre de adicionar ao castelo); ActionID 16200 - No meio do caminho para o castelo, ActionID 16201 - Perto do castelo, ActionID 16202 - No piso, trono que faz com que domine, e ActionID 16203 - Para a passagem de acesso ás hunts / city exclusivas da guild vencedora. Importante: Para colocar uma passagem para as hunts ou o que for a premiação da guild vencedora, coloque um caminho único com os actionIDS 16203, assim só a guild dominante do castelo poderá passar neste local. É importante lembrar que este script é de autoria do Roksas Nunez, ex scripter da empresa chaitosoft, fiz simples modificações de otimização. Qualquer dúvida peço que entre em contato comigo e poste aqui no tópico. Créditos: Absolute Roksas ViitinG Espero que gostem, afinal raro alguém disponibilizar algo tão desejado e útil assim! Até o próximo sistema. Absolute on tibiaking =p
  2. xWhiteWolf postou uma resposta no tópico em Monsters, NPC, Raids & Mounts
    Fala galera, hoje vim trazer o projeto pronto do Magnus Challenger pra vocês instalarem no servidor de vocês! Pra quem não conhece é um sistema de Tasks baseado no Zezenia onde você pode escolher entre tasks de matar monstros ou de coletar certos items para o npc Magnus, um guerreiro famoso da cidade que está atolado de tarefas e precisa da sua ajuda! Peguei os aspectos que eu julguei serem os principais do modelo do Zezenia e editei com algumas coisas que eu achei que ficariam melhores. Quem quiser pode ver um vídeo comentado de como o sistema funciona: Dito isso vou ensinar vocês como instalar isso no server: Pra começar vá em data\creaturescripts\scripts e procure login.lua, agora vá até o final do arquivo e antes do último return true coloque essas linhas abaixo ainda em creaturescripts procure creaturescripts.xml e adicione essa linha junto com as outras que já estão lá (seguindo o padrão) <!-- TASK SYSTEM --> <event type="kill" name="tasksystem" script="tasksystem.lua"/> Agora crie um arquivo em creaturescripts\scripts com o nome de tasksystem.lua e adicione o seguinte à ele: Terminada a parte da contagem de kill vamos ao NPC em si. Crie um arquivo chamado Magnus.xml em data\npc e coloque isso dentro dele: Agora em data\npc\scripts crie um arquivo chamado zezeniaa.lua e adicione esse conteúdo dentro do arquivo: ~~~~~~~~~~~~~~~~ FEITO ISSO ESTÁ TERMINADO ~~~~~~~~~~~~~~~~~~ Agora aprendendo a configurar: No tasksystem vc pode editar isso daqui: Eu fiz um sistema onde se vc estiver em party com alguém e a pessoa matar os bixos conta como se você tivesse matado; Assim incentiva o pessoal a ir numa cave de Dragon e ao invés de matar quem está lá pra ficar sozinho na cave, eles vão chamar party pra fazerem a task juntos.. assim fazer amigos fica mais fácil e com maiores laços é maior a chance do povo não abandonar o seu server. Apenas digite "true" ou "false" pra ativar/desativar esse sistema e em baixo temos a distancia máxima pro monstro estar do cara que está fazendo a task pra contar o kill. Se a distancia entre o monstro e a pessoa for maior que 7 não vai contar pra ele a kill. No zezeniaa.lua as coisas que dão pra configurar são maiores mas são igualmente simples: Toda vez que vc pedir uma task short (curta) vc vai ter de 100 a 400 monstros pra matar, ele gera um número de 0 a 6 e multiplica por 5 e soma com os 100 iniciais.. o mesmo vale pra todos os outros valores. levelcollect é o level mínimo pra fazer tasks do tipo collect. time é o tempo em segundos que você vai ficar sem poder falar com o npc caso desista de alguma task, o padrão é 8 * 60 * 60 (8 horas) bonus é por quanto vai multiplicar caso vc permita que o npc escolha aleatoriamente entre todas as opções.. o padrão é 20% de bonus (1.2) multiplicador é uma coisa que eu adicionei pra ficar mais fácil mexer na fórmula sem cometer cagadas, se vc tá ganhando 10% de exp e quer ganhar 80% é só colocar 8 no multiplicador. Isso daqui é o banco de dados principal do sistema de kill, toda vez que vc escolher uma task do tipo fácil, médio, dificil ele vai acessar essas tabelas contendo o nome das criaturas.. vc pode facilmente adicionar novos nomes, o npc já está programado pra lidar com isso, apenas siga o padrão e mantenha sempre o último sem vírgula! Ex: adicionando Morgaroth na tabela de hard local hard = { [1] = "Giant Spider", [2] = "Dragon Lord", [3] = "Grim Reaper", [4] = "Demon", [5] = "Crystal Spider", [6] = "Demon Skeleton", [7] = "Juggernaut", [8] = "Destroyer", [9] = "Hand of Cursed Fate", [10] = "Morgaroth" } atente-se também pra não repetir o número no index.. se o anterior era [9] use [10]. O restante das tabelas são separadas para o banco de dados das tasks de collect: segue a mesma lógica da de kill só que aqui você tem o id dos itens que serão usados... aquela count não tem nada a ver com o item pois ele vai gerar tanto o item aleatoriamente quanto à count; Ex: [1] = {id = 5880, count = 20}, -- iron ore isso não significa que se cair iron ore (id 5880) irá cair sempre 20.. até porque eu poderia escolher uma task long e easy e pegar a task de trazer até 50 iron ores, apenas tente manter os padrões que são os intervalos definidos. No easy ele varia de 10 a 20, no medium ele varia de 20 a 35 e no hard de 40 a 50. Espero que vocês tenham curtido, é um sistema grande mas bem simples de se mexer... se tiverem quaisquer problemas podem comentar aqui. Deu trabalho fazer isso então se você gostou deixe o seu comentário aí e o seu "Gostei" que vai me incentivar a trazer mais coisas desse tipo pra cá. Abraços do lobo. PS: Pra sumonar o npc digite com o GOD: /n Magnus ou coloque ele pelo map editor.
  3. Servidor Testado: erondino,pokemon dash v6,tfs 0.3.6 Servidor Nao Testado: Pokemon Dash Advanced Precisa de: Noçoes basica de script pois so irei postar a parte principal dos script, pois eu nao sei oque voces editaram nos seus scripts ! Bom Dia Turma, Hoje Eu Vou Postar: Sistema de Gender System "Sexos nos Pokemons": O Sexo dos pokemons so vai ter em seus Pokemons capturados, Boxs,nao vai ter em pokes das hunts etc.. Sistema Completo de "PokeLevel": Level nos Seus Pokemons "Porem" a cada Level o Pokemon so Ganha HP Baseado no Servidor: http://pokemonbr.com/ . Pois dar força ao Summon Somente adicionando funçoes na Sources. o Sistema completo do Pokelevel vem: Rare candy,Evolution,Pokelevel Intao Vamos La =) Gender System: *Primeiro antes de tudo tem que ver se no seu client tem o icone dos Sexos dos Pokemons, fazendo o comando /attr skull "Numero 1 a 4" *Eu So vo postar as funçoes eu nao vou mandar o script inteiro pois eu nao sei o que voces editaram no script do catch.lua mais mesmo assim e facil de editar intao Vamos la: vai em actions/catch.lua : Vai em actions/goback.lua: Vai em actions/box.lua *XML: <action itemid="ID" event="script" value="box.lua"/> PokeLevel System: * Limite de Pokelevel : 30 * Para adicionar mais Level Segue esse Mini-Tutorial: Cria um Arquivo , creaturescripts/Pokelevel.lua: *XML: <event type="kill" name="kill" event="script" value="PokeLevel.lua"/> * registerCreatureEvent(cid, "kill") Troca seu look.lua creaturescripts/look.lua: Vai em actions/Goback.lua: *Aki quando voce dar primeiro Goback no Pokemon ele recebe o Level: 1 actions/evolution.lua: *Exemplo de Evoluçao: ["Bulbasaur"] = {level = 40, evolution = "Ivysaur", maxh = 2600, count = 1, Stoneid = 2293, Stoneid2 = 0}, ["Nome do Pokemon"] ={level = "level que precisa para Evoluir" , evolution = "Nome do Pokemon",maxh ="o Max de Hp que vai ter",count = "quantidade de stone",Stoneid = "Id da Stone", Stoneid2 = "id da stone 2"}, vai em Actions/Rarecandy.lua *XML: <action itemid="ID" allowfaruse="1" event="script" value="Rarecandy.lua"/>
  4. Bom galera a um tempo eu procuro esse evento os que eu encontrei aki não funcionou no meu ot e depois de muito procurar acabei encontrando em um outro fórum estrangeiro e resolvi trazer esse conteúdo pro tibiaking . Eu testei esse evento no tfs 0.4 rev 3777 criado por Luanluciano93 . chega de bla bla bla e vamos ao que interessa : Como funciona o evento ? O evento funciona da seguinte forma , assim que começar o evento os players devem digitar o comando " !fire join " logo apos ele é teleportado para dentro do evento onde deve aguardar o inicio da tempestade , em seguida desviar se o mais rápido da chuva de fogos se ele for atingido ele será teleportado para o templo e o ultimo player que ficar no evento se torna o vencedor . Na pasta do seu servidor tem uma pasta mods , abra essa pasta , copie e cole um arquivo com o nome w-fire.xml depois cole esse script dentro desse arquivo que tu criou . Agora vamos configurar o local que o player vai ser teleportado , a área que a tempestade de fogo vai cair , o local que o player atingido e o ganhador vai ser teleportado , os prêmios e o mais importante o horário que vai abrir o evento que é 100% automático .. Configurar prêmio: fireStormRewards = { random = false, rew = {2160,30,2494,1,2495,1} <<< aki esta configurado para dar 300k + demon armor + demon legs , configure a seu gosto Configurar posições : fireStormKickPosition = {x=160,y=51,z=7} <<< aki você coloca a posição do seu templo ou cidade que desejar , pois é o local onde o player será teleportado ao terminar o evento e os players que forem atingidos pela tempestade fireStormCenterRoomPosition = {x=767,y=959,z=7} <<< aki você vai colocar o local que o player será teleportado quando ele disser "!fire join" fireStormRangeX_RangeY = {51,50} <<< aki você vai colocar a area da tempestade quanto maior for os números , maior será a área atingida . <globalevent name="fireStormTime" time="23:25" event="script"> <<< aki você configura o horário que tu quiser . Se quiserem usar o mesmo mapa que usei é só clicar AQUI Pronto galera como eu apenas trouxe o conteúdo para o tibiaking e caso esteja contra as regras peço aos moderadores para retirar o tópico e quanto aos créditos eu realmente não sei quem criou esse sistema se alguém souber me informe que postarei os devidos créditos .
  5. Opa galera, eu vi esse script em outro fórum e trouxe aqui para compartilhar com vocês porque achei a ideia bacana. TFS 1.0 Skill Point System 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 end Em /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 end Em /talkactions/talkactions.xml, adicione <talkaction words="!points" separator=" " script="skillpoints.lua"/> Se gostou, poste, CURTA e compartilhe! <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://www.tibiaking.com/forum/forum/249-suporte-de-scripts/)> Abraços e continue sempre conferindo as novidades do TibiaKing! [m's]
  6. Fala galera do TK, trago hoje a vocês um sistema chamado Bounty Hunters, porém traduzido e pouco modificado. Como funciona? O Player irá executar !hunt, VALOR,NICK Com este comando ele estará oferecendo uma recompensa para que matar o jogador de NICK que ele colocou. Ao player que dar o golpe final no jogador huntado receberá automaticamente o prêmio em sua backpack (Oferecido pelo solicitante do hunted) Sem mimimi vamos ao que interessa: Em data/talkactions/scripts crie um arquivo com o nome de busque.lua e dentro adicione o conteúdo: function onSay(cid, words, param) if(param == "") then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BUSQUE A CABEÇA] Use: \"!busque [prize],[nick]\" Exemplo de prêmio 1(k).") return TRUE end local t = string.explode(param, ",") if(not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BUSQUE A CABEÇA] Use: \"!busque [prize],[nick]\" Exemplo de prêmio 1(k).") return TRUE end local sp_id = getPlayerGUIDByName(t[2]) if sp_id == nil then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BUSQUE A CABEÇA] Este player não existe") return TRUE end local result_plr = db.getResult("SELECT * FROM `busque_cabeca` WHERE `sp_id` = "..sp_id.." AND `killed` = 0;") if(result_plr:getID() ~= -1) then is = tonumber(result_plr:getDataInt("sp_id")) result_plr:free() else is = 0 end prize = tonumber(t[1]) if(prize == nil or prize < 1) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BUSQUE A CABEÇA] Use: \"!busque [prize],[nick]\" Exemplo de prêmio 1(k) return TRUE end if(prize >= 100000000000000000000) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BUSQUE A CABEÇA] Desculpe, você digitou um número muito grande") return TRUE end if is ~= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BUSQUE A CABEÇA] Este player já está sob mandato de morte.") return TRUE end if doPlayerRemoveMoney(cid, prize*1000) == TRUE then db.executeQuery("INSERT INTO `busque_cabeca` VALUES (NULL,"..getPlayerGUID(cid)..","..sp_id..",0," .. os.time() .. ","..prize..",0,0);") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BUSQUE A CABEÇA] O Player foi adicionado na lista de morte!") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BUSQUE A CABEÇA] Você não tem dinheiro suficiente para oferecer a recompensa nessa cabeça!") end return 1 end Em data/talkactions/talkactions.xml adicione a seguinte linha: <talkaction access="0" log="no" filter="word" words="!busque" script="busque.lua" /> Agora em data/creaturescripts/scripts crie um arquivo com o nome busque-kill.lua e adicione: function onKill(cid, target) if isPlayer(target) == TRUE then ---- BOUNTY HUNTERS START ----- pid = cid pid2 = getPlayerGUID(target) local result_plr = db.getResult("SELECT * FROM `busque_cabeca` WHERE `sp_id` = "..pid2.." AND `killed` = 0;") if(result_plr:getID() ~= -1) then prize = tonumber(result_plr:getDataInt("prize")) bid = tonumber(result_plr:getDataInt("id")) result_plr:free() else prize = 0 bid = 0 end if (bid ~= 0 and prize ~= 0 and not(getTileInfo(getCreaturePosition(cid)).pvp)) then db.executeQuery("UPDATE `busque_cabeca` SET `killed` = 1, `k_id`="..getPlayerGUID(cid)..", `kill_time` = " .. os.time() .. " WHERE `id` = "..bid..";") doPlayerAddMoney(cid,prize*1000) doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'[BUSQUE A CABEÇA] Você matou um jogador que estava em pena de morte, receba sua recompensa!') end ---- BOUNTY HUNTERS END ----- end return TRUE end Em data/creaturescripts/creaturescripts.xml adicione a seguinte linha: <event type="kill" name="Busque" script="busque-kill.lua"/> Agora ainda na pasta creaturescripts/scripts abra o seu arquivo login.lua e abaixo de registerCreatureEvent(cid, "PlayerDeath") adicione: registerCreatureEvent(cid, "Busque") Agora pra finalizar, vá no seu PHPMYADMIN/SQL e execute a seguinte query: CREATE TABLE IF NOT EXISTS `busque-cabeca` ( `id` int(11) NOT NULL auto_increment, `fp_id` int(11) NOT NULL, `sp_id` int(11) NOT NULL, `k_id` int(11) NOT NULL, `added` int(15) NOT NULL, `prize` bigint(20) NOT NULL, `killed` int(11) NOT NULL, `kill_time` int(15) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; Caso possua site e queira colocar a página, segue a página do gesior, coloque em www/ <?php @mysql_connect("localhost","user","password"); @mysql_select_db("database"); $main_content .= '<P ALIGN=CENTER> <br> <FONT SIZE=5 COLOR=#CFF00C> Como usar... </FONT> <br> <br> <FONT SIZE=2 COLOR=#CFF00C> * !hunt [prize],[nick] : <FONT SIZE=1 COLOR=#FCC33F> Exemplo de HUNT:<br> Digite: !hunt 100,Absolute </FONT><br> </FONT> </P> <br> <br> <center> <h1> Bounty Hunters </h1> </center> <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%> <TR BGCOLOR="#505050"> <TD CLASS=white width=30%> <center><B>Encomendado</B></center> </TD> <TD CLASS=white width=30%> <center><B>Valor do Prêmio</B></center> </TD> <TD CLASS=white width=30%> <center><B>Sacrificado</B></center> </TD> <TD CLASS=white width=10%> <center><B>Morto Por</B></center> </TD> </TR>'; $inv = @mysql_query("SELECT * FROM `busque_cabeca` ORDER BY `added` DESC"); $num = 0; $color=$config['site']['darkborder']; while($tab = @mysql_fetch_array($inv)){ if($num%2 == 0){$color=$config['site']['darkborder'];}else{$color=$config['site']['lightborder'];} $pid = $tab['fp_id']; $sid = $tab['sp_id']; $kid = $tab['k_id']; $killed = $tab['killed']; $prize = $tab['prize']*1000; if($killed == 0){ $kill = '<font color="red">Ninguém Ainda!</font>'; }else{ $k = @mysql_query("SELECT * FROM `players` WHERE `id` = ".$kid.""); $k1 = @mysql_fetch_array($k); $kill_name = $k1['name']; $kill = '<a href="index.php?subtopic=characters&name='.$kill_name.'">'.$kill_name.'</a>'; } $f = @mysql_query("SELECT * FROM `players` WHERE `id` = ".$pid.""); $f1 = @mysql_fetch_array($f); $s = @mysql_query("SELECT * FROM `players` WHERE `id` = ".$sid.""); $s1 = @mysql_fetch_array($s); $fn = $f1['name']; $sn = $s1['name']; $main_content .= ' <TR BGCOLOR="'.$color.'"> <TD> <center> <b> <a href="index.php?subtopic=characters&name='.$fn.'">'.$fn.'</a> </b> </center> </TD> <TD> <center> <b> '.$prize.' gp </b> </center> </TD> <TD> <center> <b> <a href="index.php?subtopic=characters&name='.$sn.'">'.$sn.'</a> </b> </center> </TD> <TD> <center> <b> '.$kill.' </b> </center> </TD> </TR>'; $num++; } if($num == 0){ $main_content.='<TR BGCOLOR="'.$color.'"> <TD colspan=4> <center> No momento não há cabeças para busca. </center> </TD> </TR>'; } $main_content .='</TABLE><div align="right">Copyright &copy; <a href="http://www.tibiaking.com/forum/user/116608-absolute/">Absolute on TibiaKing</a>.</div>'; ?> Aqui: @mysql_connect("localhost","user","password"); @mysql_select_db("database"); Em user coloque o seu usuário phpmyadmin e em password a senha. Em database o nome do seu banco de dados. Pós isso, abra seu index.php e procure por: case "guilds"; $topic = "Guilds"; $subtopic = "guilds"; include("guilds.php"); break; Após o break; Adicione: case "busque-cabeca"; $topic = "Busque a Cabeca"; $subtopic = "characters"; include("busque-cabeca.php"); break; Depois vá em layouts/tibiacom/layout.php e procure por: <a href='index.php?subtopic=guilds'> <div id='submenu_guilds' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> <div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> <div id='ActiveSubmenuItemIcon_guilds' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'>Guilds</div> <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> </div> Logo abaixo adicione: <a href='index.php?subtopic=busque-cabeca'> <div id='submenu_bounty' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> <div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> <div id='ActiveSubmenuItemIcon_biunty' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'><font color=red>Busque a Cabeca!</font></div> <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> </div> Pronto, tudo perfeito! Créditos para o autor base masteuszx. Absolute. Qualquer dúvida publique no tópico, será bem legal ver esse sistema nos vossos servidores Até o próximo sisteminha. Absolute.
  7. Ola tks hoje vou compartilhar 1 sistema de addon para pokemon Va em Actions criei 1 script renomeia para addon e cole isso dentro Em name = o nome do pokemon Nas Barras [] O id do item do addon Oufit = o id da sprite no seu client do pokemon com seu addon ID addon 1 2 3 etc.. Random Todos os numeros dos addons Numerados Depois em Actions.xml coloque a tag Creditos Meus por postar se estiver faltando alguem comente no chat Testado apenas em Pda Obs pókexcyan nao funcionou Comigo
  8. Para quem não sabe como funciona : É um sistema onde o player pode digitar um comando para adicionar ou remover um item ao auto loot,que no caso é para coletar o item automaticamente. • Adicionando o script • Em "data/mods/autoloot.xml" : • Comandos • • Configurando •
  9. Fala galera, trouxe para vocês um simples script que fiz de "Emoticons" para seus servidores em MODS, isto mesmo basta colocar na pasta MODS do servidor e pronto, simples não? Explicações; Para alterar as falas basta substiuir as palavras: talkaction words="xd, =d, xp ou acrescentar mais palavras da mesma forma, seguindo o padrão. Quando o player disser você pode optar em aparecer no log (says) e tanto em emotion aqui: hidden="yes", da forma que está ele vai ocultar no log e aparecer apenas o emoticon, caso queira que apareça ambos coloque hidden="no". exhaust = 5 -- in seconds, aqui será o tempo que o player vai ter para usar outro emoticon storage = 3000 -- storage value used to save exhaustion (Não mexa nesta linha pois este número é o que vai marcar o exhaust para o player usar de novo, digamos assim. Exemplo de emoticon simples: Simples mas legalzinho! Até mais scripts que desenvolverei =D Bom Dia.
  10. Para quem não sabe como funciona o script : O player usa um comando para salvar uma coordenada do mapa,ele poderá usar um comando para abrir uma lista onde irão ter todos os lugares salvos e o player poderá se teleportar para os lugares que foram marcados,podendo ser configurado o maximo de lugares para serem salvos,se precisa estar em protection zone para usar o comando e se precisa de premium para usar. Imagens caso não tenha entendido como funciona o script (clique em spoiler) : Caso o player tenha alcançado o número maximo de locais adicionados na lista de teleports ele poderá deletar executando o comando "!deleleTeleport nomedolocal".Exemplo : Ao digitar "!deleteTeleport shop" o local que está com o nome shop na lista será deletado : • Adicionando o script • Adicione está tabela na sua database : CREATE TABLE IF NOT EXISTS `player_teleport` ( `id` int(11) NOT NULL AUTO_INCREMENT, `player_id` int(11) NOT NULL, `slot` int(11) NOT NULL, `posx` int(11) NOT NULL DEFAULT '0', `posy` int(11) NOT NULL DEFAULT '0', `posz` int(11) NOT NULL DEFAULT '0', `name` varchar(255) NOT NULL COMMENT '', PRIMARY KEY (`id`) ) ENGINE=InnoDB; Em "data/creaturescripts/scripts/login.lua" : player:registerEvent("Teleport") Em "data/creaturescripts/creaturescripts.xml" : <event type="modalWindow" name="Teleport" script="teleport.lua"/> Em "data/creaturescripts/scripts/teleport.lua" : function onModalWindow(cid, modalWindowId, buttonId, choiceId) local player = Player(cid) local playerGuid = player:getGuid() if modalWindowId == 1 then if buttonId == 0x00 then -- Select if not teleport.canTeleportWhileInfight and getCreatureCondition(cid, CONDITION_INFIGHT) == false then local posx = db.storeQuery("SELECT `posx` FROM `player_teleport` WHERE `player_id` = " .. playerGuid .." AND slot = ".. choiceId .."") local posX = result.getDataString(posx, "posx") local posy = db.storeQuery("SELECT `posy` FROM `player_teleport` WHERE `player_id` = " .. playerGuid .." AND slot = ".. choiceId .."") local posY = result.getDataString(posy, "posy") local posz = db.storeQuery("SELECT `posz` FROM `player_teleport` WHERE `player_id` = " .. playerGuid .." AND slot = ".. choiceId .."") local posZ = result.getDataString(posz, "posz") local slot = db.storeQuery("SELECT `name` FROM `player_teleport` WHERE `player_id` = " .. playerGuid .." AND slot = ".. choiceId .."") local portName = result.getDataString(slot, "name") doTeleportThing(cid, {x = posX, y = posY, z = posZ}, true) doPlayerSendTextMessage(cid, 22, "Voce foi teleportado para ".. portName ..".") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) result.free(posx); result.free(posy); result.free(posz); result.free(slot) else doPlayerSendCancel(cid, "Voce nao pode se teleportar com battle.") end end if buttonId == 0x01 then -- Cancel return false end elseif modalWindowId == 2 then if buttonId == 0x00 then -- Delete local slot = db.storeQuery("SELECT `name` FROM `player_teleport` WHERE `player_id` = " .. playerGuid .." AND slot = ".. choiceId .."") local portName = result.getDataString(slot, "name") db.query("DELETE FROM `player_teleport` WHERE `player_id` = " .. playerGuid .. " AND slot = ".. choiceId .."") doPlayerSendTextMessage(cid, 22, "Voce removeu ".. portName .." da lista de teleportes.") result.free(slot) end if buttonId == 0x01 then -- Cancel return false end end return true end Em "data/talkactions/talkactions.xml" : <talkaction words="!teleport" separator=" " script="teleport.lua"/> <talkaction words="!saveTeleport" separator=" " script="teleport.lua"/> <talkaction words="!deleteTeleport" separator=" " script="teleport.lua"/> Em "data/talkactions/scripts/teleport.lua" : function onSay(cid, words, param) local player = Player(cid) if teleport.premiumOnly and getPlayerPremiumDays(cid) < 1 and getPlayerGroupId(cid) < 4 then return doPlayerSendCancel(cid, "Voce precisar ser premium account para usar este comando.") end if words == "!saveTeleport" then if Tile(getThingPos(cid)):getHouse() and getTilePzInfo(getThingPos(cid)) then savePortPosition(cid, string.lower(param)) else doPlayerSendCancel(cid, "Voce so pode salvar em uma house ou em protection zone") end elseif words == "!teleport" then local modal = ModalWindow(1, "Lista de Teleportes", "Escolha seu destino:") playerGuid = player:getGuid() local ret = false for var = 1, teleport.maxPortPoints do local slot = db.storeQuery("SELECT `name` FROM `player_teleport` WHERE `player_id` = " .. playerGuid .." AND slot = ".. var .."") if slot ~= false then local portName = result.getDataString(slot, "name") modal:addChoice(var, "".. portName .."") result.free(slot) ret = true end end if ret then modal:addButton(0x00, "Teleportar") modal:setDefaultEnterButton(0x00) end modal:addButton(0x01, "Cancelar") modal:setDefaultEscapeButton(0x01) modal:sendToPlayer(player) elseif words == "!deleteTeleport" then local modal = ModalWindow(2, "Lista de Teleportes", "Escolha qual voce quer deletar:") playerGuid = player:getGuid() local ret = false for var = 1, teleport.maxPortPoints do local slot = db.storeQuery("SELECT `name` FROM `player_teleport` WHERE `player_id` = " .. playerGuid .." AND slot = ".. var .."") if slot ~= false then local portName = result.getDataString(slot, "name") modal:addChoice(var, "".. portName .."") result.free(slot) ret = true end end if ret then modal:addButton(0x00, "Deletar") modal:setDefaultEnterButton(0x00) end modal:addButton(0x01, "Cancelar") modal:setDefaultEscapeButton(0x01) modal:sendToPlayer(player) end return false end Em "data/talkactions/scripts/global.lua" : teleport = { maxPortPoints = 10, canTeleportWhileInfight = false, premiumOnly = false } function savePortPosition(cid, description) local playerGuid = getPlayerGUID(cid) local pos = getCreaturePosition(cid) local port = 0 for i = 1, teleport.maxPortPoints do local slot = db.storeQuery("SELECT `name` FROM `player_teleport` WHERE `player_id` = " .. playerGuid .." AND slot = ".. i .."") if slot == false then port = i ret = true break end result.free(slot) end if ret then db.query("INSERT INTO `player_teleport` (`player_id`, `slot`, `posx`, `posy`, `posz`, `name`) VALUES (".. playerGuid ..", ".. port ..", ".. pos.x ..", ".. pos.y ..", ".. pos.z ..", '".. description .."');") doPlayerSendTextMessage(cid, 22, "Voce salvou o local de teleporte. ".. description ..".") doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE) else doPlayerSendCancel(cid, "Voce nao pode ter mais que ".. teleport.maxPortPoints .." locais salvos.") end end • Configurando • • Comandos • Creditos : Evil Hero(outro fórum). Victor.G pela tradução do script e pelo tópico/tutorial em português.
  11. Esse é um sistema de VIP por account, com comandos in game para adicionar/remover/checar dias de VIP. Para instalar crie Killua VIP System.lua em data/lib e coloque: -- Account VIP System criado por Vitor Bertolucci - Killua function installVipSystem() local func = db.query or db.executeQuery if func("CREATE TABLE `killua_vip_time` (`account_id` int(11) NOT NULL default '0', `time` varchar(255) NOT NULL default '0')") then return print(os.date("%X").." - Killua VIP System instalado com sucesso.") and true end return print(os.date("%X").." - Killua VIP System ja esta instalado.") and false end function getAccountVipTime(accid) local time_ = db.getResult("SELECT `time` FROM `killua_vip_time` WHERE `account_id` = '"..accid.."' LIMIT 1") if time_:getID() ~= -1 then return time_:getDataInt("time") end return false end function setAccountVipTime(accid, time) local func = db.query or db.executeQuery local time_ = db.getResult("SELECT `time` FROM `killua_vip_time` WHERE `account_id` = '"..accid.."' LIMIT 1") if time_:getID() ~= -1 then func("UPDATE `killua_vip_time` SET `time` = '"..time.."' WHERE `account_id` = '"..accid.."' LIMIT 1") time_:free() return true end return func("INSERT INTO `killua_vip_time` (`account_id`, `time`) VALUES ('"..accid.."', '"..time.."')") end function isVip(cid) if getAccountVipTime(getPlayerAccountId(cid)) then return getAccountVipTime(getPlayerAccountId(cid)) >= os.time() end return false end function doPlayerSetVipDays(cid, days) if days and tonumber(days) and tonumber(days) >= 0 then if tonumber(days) == 0 then return setAccountVipTime(getPlayerAccountId(cid), days) end return setAccountVipTime(getPlayerAccountId(cid), (os.time() + (days * 60 * 60 * 24))) end return print("Aviso: Nao foi possivel executar a funcao doPlayerAddVipDays. O parametro days deve ser um numero.") end function getPlayerVipDays(cid) if getAccountVipTime(getPlayerAccountId(cid)) then return getAccountVipTime(getPlayerAccountId(cid)) > 0 and math.ceil((getAccountVipTime(getPlayerAccountId(cid)) - os.time()) / 60 / 60 / 24) or 0 end return 0 end PS: Se na sua pasta lib já tiver algum arquivo com vip no nome, delete o arquivo. Em data/talkactions/scripst crie vip.lua e coloque: -- Account VIP System criado por Vitor Bertolucci - Killua function onSay(cid, words, param, channel) if param == "" then return doPlayerSendCancel(cid, "Utilize os parametros corretos.") end local t = string.explode(param, ',') if t[1] ~= "days" and getPlayerGroupId(cid) < 4 then return doPlayerSendCancel(cid, "Comandos disponiveis apenas para gods. Player podem usar /vip days") end if t[1] == "days" then if isVip(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce tem "..getPlayerVipDays(cid).." dias de VIP.") else doPlayerSendCancel(cid, "Voce nao tem VIP.") end elseif t[1] == "add" then if getPlayerByName(t[2]) and tonumber(t[3]) and tonumber(t[3]) > 0 then doPlayerSetVipDays(getPlayerByName(t[2]), getPlayerVipDays(getPlayerByName(t[2])) + tonumber(t[3])) doPlayerSendTextMessage(getPlayerByName(t[2]), 25, "Voce recebeu "..t[3].." dias de VIP.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, t[3].." dias de VIP adicionados para "..t[2]) else doPlayerSendCancel(cid, "Voce fez algo errado! Utilize /vip add, PLAYERNAME, dias.") end elseif t[1] == "remove" then if getPlayerByName(t[2]) and tonumber(t[3]) and tonumber(t[3]) > 0 then if isVip(getPlayerByName(t[2])) then if getPlayerVipDays(getPlayerByName(t[2])) > tonumber(t[3]) then doPlayerSetVipDays(getPlayerByName(t[2]), getPlayerVipDays(getPlayerByName(t[2])) - tonumber(t[3])) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, t[3].." dias de vip removidos de "..t[2]) doPlayerSendTextMessage(getPlayerByName(t[2]), MESSAGE_STATUS_WARNING, "Fora retirados "..t[3].." dias de VIP da sua account.") else doPlayerSetVipDays(getPlayerByName(t[2]), 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, t[2].." tinha menos que "..t[3].." dias de VIP. A VIP dele foi removida.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Sua VIP acabou.") end else doPlayerSendCancel(cid, t[2].." nao eh VIP.") end else doPlayerSendCancel(cid, "Voce fez algo errado! Utilize /vip remove, PLAYERNAME, dias.") end elseif t[1] == "check" then if getPlayerByName(t[2]) then if isVip(getPlayerByName(t[2])) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, t[2].." tem "..getPlayerVipDays(getPlayerByName(t[2])).." dias de VIP Account.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, t[2].." nao eh VIP.") end else doPlayerSendCancel(t[2].." Nao esta online ou nao existe!") end elseif t[1] == "install" then if installVipSystem() then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O sistema foi instalado com sucesso.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O sistema ja esta instalado.") end end return true end E em talkactions.xml coloque: <talkaction words="/vip" event="script" value="vip.lua"/> Comandos: Funções que fiz pro sistema e podem acabar sendo úteis: Pronto. Vou por aqui tbm um piso que só jogadores VIP podem passar, usem esse script como base para criarem outros. Crie piso vip.lua em data/movements/scripts e coloque: function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if not isVip(cid) then doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "Somente jogadores VIP podem passar.") doSendMagicEffect(fromPosition, CONST_ME_POFF) else doSendMagicEffect(toPosition, 12) end return true end E em movements.xml: <movevent type="StepIn" actionid="5723" event="script" value="piso vip.lua"/> Depois disso é só colocar actionID 5723 nos pisos que somente jogadores VIP podem passar.
  12. Nextbr postou uma resposta no tópico em Scripts tfs 0.4 (OLD)
    Boa Tarde Turma, Hoje vou Postar um sistema De Torneio Para Poketibia! Para que possa funcionar o sistema de Torneio verifique se na (area pvp-zone ) funciona o pvp, caso nao funciona tentem procurar um tutorial de como liberar o pvp-zone e talves tente mudar isso aki no config.lua de voces: worldType = "pvp-enforced" protectionLevel = 1 Bom Chega de Mimimi e vamos La: data/lib/Torneio.lua e add isso: Depois vai em Globaleevents/Torneio.lua <globalevent name="TournamentStart" time="11:35" event="script" value="Torneio.lua"/> Depois vai em Actions/Torneio.lua: Atençao: Voce faz uma area do Torneio no Map editor e Coloca PVP-Zone no Mapa editor e coloca uma Alavanca com a uid "18279" XML: <action uniqueid="18279" event="script" value="Torneio.lua"/> Agora o NPC TORNEIO NPCS/NPCS.XML: NPC/SCRIPTS/Torneio.lua: [*] Bom é so Isso Flw bj ;*
  13. Fala galerinha linda do TK, hoje estou trazendo um evento que andei modificando e otimizando, é o evento City WAR, este evento tem no servidor globalwar e outros. A autoria vem de um membro da otland, portante havia o mesmo aqui em um datapack e decidi otimizar este evento para vocês do TK. Observação: É um pouco parecido com o evento do meu amigo e scripter DuH, porém com mais funções e regras, mas o objetivo é praticamente o mesmo. Como funciona: Vamos lá; Primeiramente, em sua pasta data/lib crie um arquivo com o nome de city war.lua e dentro do mesmo coloque: configCW = {timetostart = 500, -- tempo para iniciar o evento em segundos by Absolute telpos = {x=32340, y=32213, z=7}, -- onde aparecerá o teleport stats = 201201201701, kill = 201201201702, death = 201201201703, ostime = 201201201704, evttime = 20, -- quanto tempo irá rolar o evento topleftPos = {x=32722, y=31336, z=6}, -- canto esquerdo superior botrightPos = {x=32791, y=31384, z=6}, -- canto direito inferior templepos = {x=32369, y=32241, z=7}, -- posição do templo principal arenapos = {{x=32722, y=31340, z=6}, {x=32786, y=31336, z=6}, {x=32722, y=31380, z=6}, {x=32783, y=31374, z=6}}, -- posição dos 4 tronos times = 8, -- não precisa mexer finaltime = 300 -- não precisa mexer } function configCW:new() local newevt = {} setmetatable(newevt, self) self.__index = self doBroadcastMessage("The City War will be open in " .. self.timetostart .. " seconds.") setGlobalStorageValue(self.stats, 0) addEvent(function () newevt:start() end, self.timetostart*1000) end function configCW:start() if getGlobalStorageValue(self.stats) == 0 then setGlobalStorageValue(self.ostime, os.time()) local teleport = doCreateItem(1387, self.telpos) doItemSetAttribute(teleport, "aid", 5540) setGlobalStorageValue(self.stats, 1) doBroadcastMessage("The City War is starting...") for _, posi in pairs(self.arenapos) do local item = getTileItemById(posi, 1387) if(item.uid ~= 0) then doRemoveItem(item.uid) end end addEvent(function () self:preclose() end, self.evttime*1000*60) addEvent(function () self:announce(0) end, (self.evttime/self.times)*1000*60) end end function configCW:announce(times) if times < self.times then if #self:getTopFrags(true) >= 1 then doBroadcastMessage("Top City War fraggers: " .. self:getTopFrags()) end addEvent(function () self:announce(times+1) end, (self.evttime/self.times)*1000*60) end end function configCW:preclose() if getGlobalStorageValue(self.stats) == 1 then setGlobalStorageValue(self.stats, 2) doBroadcastMessage("The City War will end in " .. self.finaltime .. " seconds.") addEvent(function () self:close() end, self.finaltime*1000) local item = getTileItemById(self.telpos, 1387) if(item.uid ~= 0) then doRemoveItem(item.uid) end end end function configCW:close() if getGlobalStorageValue(self.stats) == 2 then if #self:getTopFrags(true) >= 1 then doBroadcastMessage("The City War has ended. The winners are: " .. self:getTopFrags()) else doBroadcastMessage("The City War has ended. There were no winners.") end doRemovePlayersFromArea(self.topleftPos, self.botrightPos, self.templepos) for _, posi in pairs(self.arenapos) do doCreateTeleport(1387, self.templepos, posi) end for place, info in ipairs(self:getTopFrags(true)) do if place > 5 then break end local cid = getPlayerByName(info) doPlayerSendTextMessage(cid, 4, "Congratulations, you were the " .. place .. "º place in the City War.") doPlayerAddItem(cid, 6571, 1) end setGlobalStorageValue(self.stats, -1) end end function configCW:isPlayerInEvent(cid) if getPlayerStorageValue(cid, self.stats) == -1 or getPlayerStorageValue(cid, self.stats) - os.time() <= -5 or getGlobalStorageValue(self.stats) < 1 then return false end return true end function configCW:getTopFrags(tab) local frag = {} for _, pid in pairs(getPlayersOnline()) do if (getPlayerStorageValue(pid, self.kill) ~= -1 or getPlayerStorageValue(pid, self.death) ~= -1) and self:isPlayerInEvent(pid) then local kill = getPlayerStorageValue(pid, self.kill)+1 local death = getPlayerStorageValue(pid, self.death)+1 print(getCreatureName(pid), kill-death) table.insert(frag, {getCreatureName(pid), kill-death}) end end print(#frag) local frag, str, n = doOrderTab(frag, 0), nil, 5 print(#frag) if tab then return frag else if #frag < 5 then n = #frag end for i = 1, n do local cid = getPlayerByName(frag[i]) local kill = getPlayerStorageValue(cid, self.kill)+1 local death = getPlayerStorageValue(cid, self.death)+1 str = str and str .. ", " .. frag[i] .. "[" .. kill .. "/" .. death .. "]" or frag[i] .. "[" .. kill .. "/" .. death .. "]" end end return str end function doOrderTab(tabela, value) local max, index = {}, nil for i = 1, #tabela do valor = value for a, b in ipairs(tabela) do if b[2] > valor then valor = b[2] valor2 = b[1] index = a end end table.remove(tabela, index) if valor ~= value then table.insert(max, valor2) end end return max end Configuração do arquivo: telpos = {x=32340, y=32213, z=7}, -- POSIÇÃO ONDE NASCE O TP DO EVENTO! topleftPos = {x=32722, y=31336, z=6}, -- AQUI COLOQUE A POSIÇÃO DO CANTO ESQUERDO LA EM CIMA DO MAPA botrightPos = {x=32791, y=31384, z=6}, -- AQUI A POSIÇÃO DO CANTO DIREITO EM BAIXO DO MAPA templepos = {x=32369, y=32241, z=7}, -- POSIÇÃO DO TEMPLO ONDE OS JOGADORES NASCERAM PÓS A MORTE arenapos = {{x=32722, y=31340, z=6}, {x=32786, y=31336, z=6}, {x=32722, y=31380, z=6}, {x=32783, y=31374, z=6}}, -- ATENÇÃO, NO MAPA QUE ESTAREI DISPONIBILIZANDO VISIVELMENTE TERÁ 4 BASES, VOCÊ TERA QUE COLOCAR A POSIÇÃO DAS BASES AÍ NESSES 3 LUGARES. doPlayerAddItem(cid, 6571, 1) -- AQUI VOCÊ COLOCARÁ O PRÊMIO DO GANHADOR, NO CASO QUEIRA ADICIONAR POR EXEMPLO 1kk, COLOQUE 2160,1 - Primeiro ID depois quantia. Segundo passo, crie um arquivo com o nome de citywarCreature.lua e coloque dentro da pasta creaturescripts/scripts com o seguinte conteúdo: function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) if isInRange(getCreaturePosition(cid), configCW.topleftPos, configCW.botrightPos) then setPlayerStorageValue(cid, configCW.death, getPlayerStorageValue(cid, configCW.death) +1) setPlayerStorageValue(lastHitKiller[1], configCW.kill, getPlayerStorageValue(lastHitKiller[1], configCW.kill) +1) end return true end E adicione em creaturescripts.xml a seguinte tag <event type="preparedeath" name="CityWar" event="script" value="citywarCreature.lua"/> Terceiro passo, crie um arquivo em movements/scripts com o nome de citywarMovements.lua com o seguinte conteúdo: function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition) if isPlayer(cid) and getGlobalStorageValue(configCW.stats) == 1 then doTeleportThing(cid, configCW.arenapos[math.random(1, #configCW.arenapos)]) doSendMagicEffect(getPlayerPosition(cid), 28) if not(configCW:isPlayerInEvent(cid)) then setPlayerStorageValue(cid, configCW.stats, getGlobalStorageValue(configCW.ostime) + configCW.evttime*60 + configCW.finaltime) setPlayerStorageValue(cid, configCW.kill, -1) setPlayerStorageValue(cid, configCW.death, -1) end else doTeleportThing(cid, fromPosition) end return true end Em Movements.xml adicione a seguinte linha: <movevent type="StepIn" actionid="5540" event="script" value="citywarMovements.lua"/> Quarto e último passo, em talkactions/scripts crie um arquivo com o nome de citywarTalkactions.lua e coloque o seguinte conteúdo: function onSay(cid, words, param) if getGlobalStorageValue(configCW.stats) == -1 then configCW:new() else doPlayerSendCancel(cid, "The event is already running.") end return true end Em talkactions/talkactions.xml adicione a seguinte linha: <talkaction log="yes" words="/citywar" access="3" event="script" value="citywarTalkactions.lua"/> E por fim, estou disponibilizando o world do evento, vocês usam se quiser, tentei adapta-lo para 8.6 mas ficou meio slá, o Viiting estava ocupado e não pode me ajudar, enfim segue a imagem e download do world.otbm: Lembrando que ninguém além do Collocorpusek da otland tem direito de pedir remoção do script, pois a base é dele. Créditos: Absolute Collocor Gringo Lindo.
  14. Fala galerinha do TK, tudo bem? Recebi alguns pedidos para fazer um evento estilo Zombie, só que no modo de Pokemon (PÍÍÍKAAAAAAAAAAAAAAAAAAACHUUUUUU) rs. Enfim, vamos a instalação, depois ensinarei a configurar. Em data/mods crie um arquivo com o nome de pikachuevent.xml com o conteúdo: <?xml version="1.0" encoding="UTF-8"?> <mod name="PikachuEvent" version="1.0" author="Absolute" contact="tibiaking.com" enabled="yes"> <config name="config_pikachu_event"> <![CDATA[ configPikachuEvent = { storages = { main = 'PikachuEventMain', -- set free storage player = 'PikachuEventPlayer', -- set free storage joining = 'PikachuEventJoining', -- set free storage kills = 'PikachuEventKills', -- set free storage exhaust = 'PikachuEventExhaust', -- set free storage countEvent = 'PikachuEventCountEvent' -- set free storage }, position = {x=890,y=193,z=7}, -- position to which player is teleporting room = { from = {x=678,y=980,z=7}, -- left top corner of event room to = {x=678,y=1089,z=7} -- right bottom corner of event room }, rewards = {7958, 11366}, -- reward id which player can win (reward is random) players = { max = 50, -- max players in event min = 2, -- min players to event start minLevel = 50, -- min level to join to event pvpEnabled = false -- can players hit theirselfs }, days = { ['Tuesday'] = {'22:00:00'}, ['Thursday'] = {'22:00:00'}, ['Friday'] = {'22:00:00'}, ['Sunday'] = {'22:00:00'} }, spawnDelay = 2000, -- miliseconds amountCreatingMonsters = 5, monsters = {'Pikachu', 'Ash'}, -- name of monsters which is creating in event delayTime = 5.0, -- time in which players who joined to event are teleporting to teleport position [miuntes] startEvent = 1, -- time from teleport to start event [seconds] stopEvent = 19200, -- [seconds] text = '-PL-\nAby wygrac i otrzymac nagrode, zabij jak najwieksza liczbe pikachu przez 20min lub pozostan sam na arenie.\n\n-ENG-\nTo win and get a reward, kill as many pikachus for 20 minutes or stay the same in the arena.' } ]]> </config> <lib name="lib_pikachu_event"> <![CDATA[ function doStopPikachuEvent() if getStorage(configPikachuEvent.storages.main) > 0 then local playerTable, creatureTable = {}, {} for x = configPikachuEvent.room.from.x, configPikachuEvent.room.to.x do for y = configPikachuEvent.room.from.y, configPikachuEvent.room.to.y do local n, i = getTileInfo({x=x, y=y, z=configPikachuEvent.room.from.z}).creatures, 1 if n ~= 0 then local v = getThingfromPos({x=x, y=y, z=configPikachuEvent.room.from.z, stackpos=i}).uid while v ~= 0 do if isPlayer(v) then table.insert(playerTable, v) if n == #playerTable then break end elseif isMonster(v) then table.insert(creatureTable, v) if n == #creatureTable then break end end i = i + 1 v = getThingfromPos({x=x, y=y, z=configPikachuEvent.room.from.z, stackpos=i}).uid end end end end if #playerTable > 1 then table.sort(playerTable, function(a, b) return (getCreatureStorage(a, configPikachuEvent.storages.kills)) > (getCreatureStorage(b, configPikachuEvent.storages.kills)) end) local prize = math.random(#configPikachuEvent.rewards) doTeleportThing(playerTable[1], getTownTemplePosition(getPlayerTown(playerTable[1]))) doCreatureSetStorage(playerTable[1], configPikachuEvent.storages.kills, 0) doPlayerAddItem(playerTable[1], configPikachuEvent.rewards[prize], 1) doCreatureAddHealth(playerTable[1], getCreatureMaxHealth(playerTable[1]) - getCreatureHealth(playerTable[1])) doCreatureAddMana(playerTable[1], getCreatureMaxMana(playerTable[1]) - getCreatureMana(playerTable[1])) doPlayerSendTextMessage(playerTable[1], MESSAGE_EVENT_ADVANCE, 'You win! You have received '..getItemNameById(configPikachuEvent.rewards[prize])..' as reward.') doBroadcastMessage('Pikachu Plague Attack has finished. The winner is '..getCreatureName(playerTable[1])..'. Congratulations!') doSetStorage(configPikachuEvent.storages.main, -1) db.query("INSERT INTO `events` (`event_name`, `winner_name`, `won_item`, `time_win`) VALUES (\"Pikachu\", \"" .. getCreatureName(playerTable[1]) .. "\", \"" .. getItemNameById(configPikachuEvent.rewards[prize]) .. "\", " .. getStorage(configPikachuEvent.storages.countEvent) ..");") for i = 2, #playerTable do doCreatureAddHealth(playerTable[i], getCreatureMaxHealth(playerTable[i]) - getCreatureHealth(playerTable[i])) doCreatureAddMana(playerTable[i], getCreatureMaxMana(playerTable[i]) - getCreatureMana(playerTable[i])) doTeleportThing(playerTable[i], getTownTemplePosition(getPlayerTown(playerTable[i]))) doPlayerSendTextMessage(playerTable[i], MESSAGE_EVENT_ADVANCE, 'You loss.') doSendMagicEffect(getThingPos(playerTable[i]), CONST_ME_STUN) doCreatureSetStorage(playerTable[i], configPikachuEvent.storages.kills, 0) end for i = 1, #creatureTable do if isMonster(creatureTable[i]) then doRemoveCreature(creatureTable[i]) end end doSetStorage(configPikachuEvent.storages.countEvent, getStorage(configPikachuEvent.storages.countEvent) + 1) elseif #playerTable == 0 then for i = 1, #creatureTable do if isMonster(creatureTable[i]) then doRemoveCreature(creatureTable[i]) end end doBroadcastMessage('No one win in Pikachu Plague Attack.') doSetStorage(configPikachuEvent.storages.main, -1) doSetStorage(configPikachuEvent.storages.countEvent, getStorage(configPikachuEvent.storages.countEvent) + 1) end end end function doStartPikachuEvent() doSetStorage(configPikachuEvent.storages.joining, -1) if configPikachuEvent.players.min <= doCountPlayersPikachuEvent() then for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configPikachuEvent.storages.player) > 0 then doCreatureSetStorage(cid, configPikachuEvent.storages.player, -1) doTeleportThing(cid, configPikachuEvent.position) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Get ready. Pikachus Plague Attack starts in '..configPikachuEvent.startEvent..' seconds.') end end addEvent(doSetStorage, configPikachuEvent.startEvent * 1000, configPikachuEvent.storages.main, 1) addEvent(doStopPikachuEvent, configPikachuEvent.stopEvent * 1000) addEvent(doRepeatCheckPikachuEvent, configPikachuEvent.startEvent * 1000 + 2000) doBroadcastMessage('Pikachu Plague Attack has started. LET\'S GO!') else for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configPikachuEvent.storages.player) > 0 then doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) end end doBroadcastMessage('Pikachu Plague Attack hasn\'t started beacuse there were not enough players.') end end function doRepeatCheckPikachuEvent() if getStorage(configPikachuEvent.storages.main) > 0 then local playerTable, creatureTable, xTable, yTable = {}, {}, {}, {} for x = configPikachuEvent.room.from.x, configPikachuEvent.room.to.x do for y = configPikachuEvent.room.from.y, configPikachuEvent.room.to.y do local n, i = getTileInfo({x=x, y=y, z=configPikachuEvent.room.to.z}).creatures, 1 if n ~= 0 then local v = getThingfromPos({x=x, y=y, z=configPikachuEvent.room.to.z, stackpos=i}).uid while v ~= 0 do if isPlayer(v) then table.insert(playerTable, v) if n == #playerTable then break end elseif isMonster(v) then table.insert(creatureTable, v) if n == #creatureTable then break end end i = i + 1 v = getThingfromPos({x=x, y=y, z=configPikachuEvent.room.to.z, stackpos=i}).uid end end table.insert(xTable, x) table.insert(yTable, y) end end if #playerTable == 1 then local prize = math.random(#configPikachuEvent.rewards) addEvent(doTeleportThing, 200, playerTable[1], getTownTemplePosition(getPlayerTown(playerTable[1])), true) doPlayerAddItem(playerTable[1], configPikachuEvent.rewards[prize], 1) doCreatureSetStorage(playerTable[1], configPikachuEvent.storages.kills, 0) doCreatureAddHealth(playerTable[1], getCreatureMaxHealth(playerTable[1]) - getCreatureHealth(playerTable[1])) doCreatureAddMana(playerTable[1], getCreatureMaxMana(playerTable[1]) - getCreatureMana(playerTable[1])) doPlayerSendTextMessage(playerTable[1], MESSAGE_EVENT_ADVANCE, 'You win! You have received '..getItemNameById(configPikachuEvent.rewards[prize])..' as reward.') doBroadcastMessage('Pikachu Plague Attack has finished. The winner is '..getCreatureName(playerTable[1])..'. Congratulations.') db.query("INSERT INTO `events` (`event_name`, `winner_name`, `won_item`, `time_win`) VALUES (\"Pikachu\", \"" .. getCreatureName(playerTable[1]) .. "\", \""..getItemNameById(configPikachuEvent.rewards[prize]).."\", "..getStorage(configPikachuEvent.storages.countEvent)..");") for i = 1, #creatureTable do if isMonster(creatureTable[i]) then doRemoveCreature(creatureTable[i]) end end doSetStorage(configPikachuEvent.storages.main, -1) doSetStorage(configPikachuEvent.storages.countEvent, getStorage(configPikachuEvent.storages.countEvent) + 1) return elseif #playerTable == 0 then for i = 1, #creatureTable do if isMonster(creatureTable[i]) then doRemoveCreature(creatureTable[i]) end end doBroadcastMessage('No one win in Pikachu Plague Attack.') doSetStorage(configPikachuEvent.storages.main, -1) doSetStorage(configPikachuEvent.storages.countEvent, getStorage(configPikachuEvent.storages.countEvent) + 1) return end local pos = {x=xTable[math.random(#xTable)], y=yTable[math.random(#yTable)], z=7} for i = 1, configPikachuEvent.amountCreatingMonsters do doCreateMonster(configPikachuEvent.monsters[math.random(#configPikachuEvent.monsters)], pos, false, false, false) doSendMagicEffect(pos, CONST_ME_BATS) end addEvent(doRepeatCheckPikachuEvent, configPikachuEvent.spawnDelay) end end function doCountPlayersPikachuEvent() local x = 0 for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configPikachuEvent.storages.player) > 0 then x = x + 1 end end return x end function doStartCountingPikachuEvent(x) if configPikachuEvent.delayTime-x > 0 then doBroadcastMessage('Pikachu Plague Attack is going to start in '..configPikachuEvent.delayTime-x..' minutes. You can join to the event by saying "!pikachu join".') addEvent(doStartCountingPikachuEvent, 60*1000, x+1) end end ]]> </lib> <talkaction words="!pikachu" event="script"> <![CDATA[ domodlib("config_pikachu_event") function onSay(cid, words, param) if getStorage(configPikachuEvent.storages.joining) ~= 1 then return doPlayerSendCancel(cid, 'Pikachu Plague Attack hasn\'t started yet.') elseif param == '' then return doPlayerSendCancel(cid, 'Command param required (say: "!pikachu join" or "!pikachu leave.").') elseif getPlayerLevel(cid) < configPikachuEvent.players.minLevel then return doPlayerSendCancel(cid, 'You can\'t join to the event if you don\'t have a require '..configPikachuEvent.players.minLevel..' level.') elseif getTileInfo(getThingPos(cid)).protection ~= true then return doPlayerSendCancel(cid, 'You can\'t join to the event if you aren\'t in protection zone.') elseif exhaustion.check(cid, configPikachuEvent.storages.exhaust) ~= false then return doPlayerSendCancel(cid, 'You must wait '..exhaustion.get(cid, configPikachuEvent.storages.exhaust)..' seconds to use this command again.') end if param == 'join' then if getCreatureStorage(cid, configPikachuEvent.storages.player) > 0 then return doPlayerSendCancel(cid, 'You have arleady joined to event. Wait patiently for start.') elseif doCountPlayersPikachuEvent() == configPikachuEvent.players.max then return doPlayerSendCancel(cid, 'Max players in the event have been reached.') end doCreatureSetNoMove(cid, true) doPlayerPopupFYI(cid, configPikachuEvent.text) doCreatureSetStorage(cid, configPikachuEvent.storages.player, 1) doAddCondition(cid, createConditionObject(CONDITION_INFIGHT, -1)) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have joined to Pikachu Plague Attack. You can\'t move until event don\'t start. Wait patiently for the event start.') doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have joined to Pikachu Plague Attack.') elseif param == 'leave' then if getCreatureStorage(cid, configPikachuEvent.storages.player) <= 0 then return doPlayerSendCancel(cid, 'You can\'t leave from the event if you don\'t join.') end doCreatureSetNoMove(cid, false) doCreatureSetStorage(cid, configPikachuEvent.storages.player, -1) doRemoveCondition(cid, CONDITION_INFIGHT) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have left from the Pikachu Plague Attack.') end exhaustion.set(cid, configPikachuEvent.storages.exhaust, 5) return true end ]]> </talkaction> <talkaction words="!startpikachu" access="5" event="script"> <![CDATA[ domodlib("config_pikachu_event") domodlib("lib_pikachu_event") function onSay(cid, words, param) if getStorage(configPikachuEvent.storages.main) > 0 then return doPlayerSendCancel(cid, 'Pikachu Plague Attack is already running.') end doStartCountingPikachuEvent(0) for _, pid in ipairs(getPlayersOnline()) do if getCreatureStorage(pid, configPikachuEvent.storages.player) > 0 then doCreatureSetStorage(pid, configPikachuEvent.storages.player, -1) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true) doCreatureSetStorage(pid, configPikachuEvent.storages.kills, 0) end end doSetStorage(configPikachuEvent.storages.joining, 1) addEvent(doStartPikachuEvent, configPikachuEvent.delayTime * 60 * 1000) return true end ]]> </talkaction> <talkaction words="!stoppikachu" access="5" event="script"> <![CDATA[ domodlib("config_pikachu_event") domodlib("lib_pikachu_event") function onSay(cid, words, param) if getStorage(configPikachuEvent.storages.main) > 0 then doStopPikachuEvent() else doPlayerSendCancel(cid, 'You can not do it if Pikachu Plague Attack is not enabled.') end return true end ]]> </talkaction> <globalevent name="Pikachu_Event_Days" interval="1000" event="script"> <![CDATA[ domodlib("config_pikachu_event") domodlib("lib_pikachu_event") local daysOpen = {} for k, v in pairs(configPikachuEvent.days) do table.insert(daysOpen, k) end function onThink(interval) if isInArray(daysOpen, os.date('%A')) then if isInArray(configPikachuEvent.days[os.date('%A')], os.date('%X', os.time())) then if getStorage(configPikachuEvent.storages.joining) ~= 1 then doStartCountingPikachuEvent(0) for _, pid in ipairs(getPlayersOnline()) do if getCreatureStorage(pid, configPikachuEvent.storages.player) > 0 then doCreatureSetStorage(pid, configPikachuEvent.storages.player, -1) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true) doCreatureSetStorage(pid, configPikachuEvent.storages.kills, 0) end end doSetStorage(configPikachuEvent.storages.joining, 1) addEvent(doStartPikachuEvent, configPikachuEvent.delayTime * 60 * 1000) end end end return true end ]]> </globalevent> <event type="statschange" name="Pikachu_Event_Dead" event="script"> <![CDATA[ domodlib("config_pikachu_event") function onStatsChange(cid, attacker, type, combat, value) if type == 1 and getCreatureHealth(cid) <= value then if isInRange(getThingPos(cid), configPikachuEvent.room.from, configPikachuEvent.room.to) then if isPlayer(cid) then doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid)) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You loss due to attack.') doSendAnimatedText(getThingPos(cid), value, TEXTCOLOR_RED) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doCreatureSetStorage(cid, configPikachuEvent.storages.kills, 0) return false end end elseif configPikachuEvent.players.pvpEnabled ~= true and isInArray({1,3}, type) and isPlayer(attacker) and isPlayer(cid) then if isInRange(getThingPos(cid), configPikachuEvent.room.from, configPikachuEvent.room.to) then return false end end return true end ]]> </event> <event type="kill" name="Pikachu_Event_Kill" event="script"> <![CDATA[ domodlib("config_pikachu_event") function onKill(cid, target, damage, flags) if isInRange(getThingPos(cid), configPikachuEvent.room.from, configPikachuEvent.room.to) then if isInArray(configPikachuEvent.monsters, getCreatureName(target)) then doCreatureSetStorage(cid, configPikachuEvent.storages.kills, math.max(0, getCreatureStorage(cid, configPikachuEvent.storages.kills) + 1)) end end return true end ]]> </event> <event type="login" name="Pikachu_Event_Login" event="script"> <![CDATA[ domodlib("config_pikachu_event") function onLogin(cid) if getCreatureStorage(cid, configPikachuEvent.storages.player) > 0 then doCreatureSetStorage(cid, configPikachuEvent.storages.player, -1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) doCreatureSetStorage(cid, configPikachuEvent.storages.player.kills, 0) end registerCreatureEvent(cid, 'Pikachu_Event_Dead') registerCreatureEvent(cid, 'Pikachu_Event_Kill') return true end ]]> </event> <globalevent name="Pikachu_Event_Start" type="startup" event="script"> <![CDATA[ domodlib("config_pikachu_event") function onStartup() doSetStorage(configPikachuEvent.storages.main, -1) doSetStorage(configPikachuEvent.storages.joining, -1) return true end ]]> </globalevent> </mod> Salve e feche. Em data/monsters/monster.xml adicione a linha: <monster name="Pikachu" file="pikachu"/> Em data/monters/scripts crie um arquivo com o nome de pikachu.xml com o conteúdo: <?xml version="1.0" encoding="UTF-8"?> <monster name="Pikachu" nameDescription="Pikachu" race="undead" experience="10500" speed="800" manacost="0"> <health now="200000" max="200000"/> <look type="88" head="20" body="30" legs="40" feet="50" corpse="6031"/> <targetchange interval="10000" chance="10"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="1"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="1"/> <flag convinceable="1"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag canpushcreatures="1"/> <flag targetdistance="1"/> <flag staticattack="90"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="1200" range="1" min="-2000" max="-5000"/> </attacks> <defenses armor="25" defense="30"> </defenses> <voices interval="5000" chance="10"> <voice sentence="PIKAAAA PIKAAAAAA CHU DE ABSOLUTE."/> <voice sentence="PIKACHU EU ESCOLHO VC."/> </voices> <loot> <item id="2160" countmax="1" chance="50000"/> </loot> </monster> Crie a sprite a seu gosto. Explicação básica: position = {x=890,y=193,z=7}, -- Aqui a posição do centro da sua ARENA PIKACHU! from = {x=678,y=980,z=7}, -- Posição do final do canto esquerdo da sua arena to = {x=678,y=1089,z=7} -- Posição do final do canto direito da sua arena rewards = {7958, 11366}, -- Aqui a recompensa que o último player que restar na arena vai ganhar, no caso é RANDOM (ALEATÓRIA), pode ser ou um ou outro, caso queira deixar apenas uma recompensa deixe: rewards = {7958} players = { max = 50, -- Máximo de players que poderão participar min = 2, -- Mínimo de players pra começar o evento, claro 2 ou mais. minLevel = 50, -- level mínimo pra entrar no evento pvpEnabled = false -- PVP DESATIVADO DENTRO DA ARENA, para ativar deixe = true. days = { ['Tuesday'] = {'22:00:00'} -- Dias e hora que ocorrerão o evento automático. (ENGLISH) - Aí no caso está para terça-feira ás 22h (Lembrando que tem de ser o horário da máquina). Para dar inicio ao evento manualmente, basta digitar com o seu ADM: !startpikachu Então os players irão digitar !pikachu para participar. Observação: O Comando só pode ser executado sem battle e em área PZ (Pós usar o player ficará imóvel esperando o evento começar) Quando começa Absolute? - Quando atingir o número máximo de players ou 5 minutos. Observação: Crie um map do seu estilo, como quiser e comfigure com as posições. Caso tenha críticas construtivas, poste. Lembrando que fiz este evento devido a pedidos que houve nas seções destinadas de scripting. Qualquer dúvida não deixe de perguntar, ninguém nasceu sabendo Créditos: - Virrages (Event Base) - Absolute (Modificação, funções, adaptações e transformação) Espero ver este evento em vários derivados. Abraços! Absolute.
  15. Hello nação TK, de um tempo pra cá eu e o membro ViitinG resolvemos trabalhar em cima de um novo evento para vocês, é o FireStorm event! Eu vim trabalhando no script do evento em MODS e o Victor no mapa do mesmo. WTF DE FAIRIEISTORMIII IS IT? Pois é galera, o nome já diz tudo "Chuva de Fogos". Algum membro da equipe executará o comando !startfire para dar início ao evento, então irá aparecer uma mensagem para todos os jogadores do servidor que o evento Fire Storm foi aberto. Então os jogadores irão dizer: !joinfire para entrar no evento, os jogadores ficarão imóveis até que o evento comece, o jogador não poderá usar o comando quando estiver com battle fight. Pós dar o tempo para inciar o evento (configurável no script) os jogadores serão teleportados para a área específica do mesmo onde em 1 minuto começará a cair FOGOS do céu, onde os jogadores contaram com a habilidade e a sorte para fugir dos fogos. A regra é clara Casa Grande, foi atingido é teleportado para o templo com a mensagem "You loss" VOCÊ PERDEU BABY! O Último sobrevivente da arena é recompensado com X item automáticamente (configurável). Sem mimimi vamos ao que interessa: Na pasta incial do seu servidor há uma pasta com o nome de MODS, então crie um arquivo com o nome de w-fire.xml dentro dela com o conteúdo abaixo: <?xml version="1.0" encoding="UTF-8"?> <mod name="Fire_Storm_Event" version="0.1" author="Absolute Version" contact="lu.lukinha" enabled="yes"> <config name="config_fire_storm_event"> <![CDATA[ configFireStormEvent = { storages = { main = 'fireStormEventMain', -- set free storage player = 'fireStormEventPlayer', -- set free storage joining = 'fireStormEventJoining', -- set free storage exhaust = 'fireStormEventExhaust', -- set free storage countEvent = 'fireStormEventCountEvent' -- set free storage }, position = {x=890 ,y=993,z=7}, -- posiotion to which player is teleporting room = { from = {x=736,y=933,z=7}, -- left top corner of event room to = {x=781,y=955,z=7} -- right bottom corner of event room }, rewards = {8858, 2346, 2538, 2437}, -- reward id which player can win (reward is random) players = { max = 80, min = 2, minLevel = 100 }, days = { ['Tuesday'] = {'19:59:20'}, ['Thursday'] = {'19:59:20'}, ['Sunday'] = {'19:59:20'} }, fireStormDelay = 1000, -- milisecond delayTime = 5.0, -- time in which players who joined to event are teleporting to teleport position startEvent = 5 -- time from teleport to start event text = '-PL-\nAby wygrac i otrzymac nagrode, utrzymaj sie jak najdluzej na arenie.\n\n-ENG-\nTo win and get a Rewards, to stay as long as possible in the arena.' } y, x = 1, 1 -- don't change it ]]> </config> <lib name="lib_fire_storm_event"> <![CDATA[ function doStartFireStormEvent() doSetStorage(configFireStormEvent.storages.joining, -1) if configFireStormEvent.players.min <= doCountPlayersFireStormEvent() then for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configFireStormEvent.storages.player) > 0 then doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) doTeleportThing(cid, configFireStormEvent.position) doCreatureSetStorage(cid, configFireStormEvent.storages.player, -1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Get ready. Fire Storm Event start in '..configFireStormEvent.startEvent..' seconds.') end end addEvent(doSetStorage, configFireStormEvent.startEvent * 1000, configFireStormEvent.storages.main, 1) addEvent(doRepeatCheckFireStorm, configFireStormEvent.startEvent * 1000 + 2000) doBroadcastMessage('Fire Storm Event has started. LET\'S GO!') else for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configFireStormEvent.storages.player) > 0 then doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) end end doBroadcastMessage('Fire Storm hasn\'t started beacuse there were not enough players.') end end function doRepeatCheckFireStorm() if getStorage(configFireStormEvent.storages.main) > 0 then local xTable, yTable, playerTable = {}, {}, {} for x = configFireStormEvent.room.from.x, configFireStormEvent.room.to.x do for y = configFireStormEvent.room.from.y, configFireStormEvent.room.to.y do table.insert(xTable, x) table.insert(yTable, y) local n, i = getTileInfo({x=x, y=y, z=configFireStormEvent.room.to.z}).creatures, 1 if n ~= 0 then local v = getThingfromPos({x=x, y=y, z=configFireStormEvent.room.to.z, stackpos=i}).uid while v ~= 0 do if isPlayer(v) then table.insert(playerTable, v) if n == #playerTable then break end end i = i + 1 v = getThingfromPos({x=x, y=y, z=configFireStormEvent.room.to.z, stackpos=i}).uid end end end end if #playerTable == 1 then local prize = math.random(#configFireStormEvent.rewards) doCreatureAddHealth(playerTable[1], getCreatureMaxHealth(playerTable[1]) - getCreatureHealth(playerTable[1])) doCreatureAddMana(playerTable[1], getCreatureMaxMana(playerTable[1]) - getCreatureMana(playerTable[1])) doTeleportThing(playerTable[1], getTownTemplePosition(getPlayerTown(playerTable[1])), true) doPlayerAddItem(playerTable[1], configFireStormEvent.rewards[prize], 1) doPlayerSendTextMessage(playerTable[1], MESSAGE_EVENT_ADVANCE, 'You win! You have received ' .. getItemNameById(configFireStormEvent.rewards[prize]) .. ' as reward.') doBroadcastMessage('Fire Storm Event has finished. The winner is ' .. getCreatureName(playerTable[1]) .. '. Congratulations.') doSetStorage(configFireStormEvent.storages.main, -1) db.query("INSERT INTO `events` (`event_name`, `winner_name`, `won_item`, `time_win`) VALUES (\"Fire\", \"" .. getCreatureName(playerTable[1]) .. "\", \"" .. getItemNameById(configFireStormEvent.rewards[prize]) .. "\", " .. getStorage(configFireStormEvent.storages.countEvent) ..");") doSetStorage(configFireStormEvent.storages.countEvent, getStorage(configFireStormEvent.storages.countEvent) + 1) x, y = 1, 1 elseif #playerTable > 1 then for a = 1, y do addEvent( function() local pos = {x=xTable[math.random(#xTable)], y=yTable[math.random(#yTable)], z=7} for _, player in ipairs(playerTable) do local pPos = getThingPos(player) if pPos.x == pos.x and pPos.y == pos.y and pPos.z == pos.z then doCreatureAddHealth(player, - getCreatureMaxHealth(player)) end end doSendDistanceShoot({x = pos.x - math.random(4, 6), y = pos.y - 5, z = pos.z}, pos, CONST_ANI_FIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_HITBYFIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_FIREAREA) end, math.random(100,1000) ) end if x == 5 * y then y = y + 1 end x = x + 1 else doBroadcastMessage('No one have won in Fire Storm Event.') doSetStorage(configFireStormEvent.storages.main, -1) doSetStorage(configFireStormEvent.storages.countEvent, getStorage(configFireStormEvent.storages.countEvent) + 1) x, y = 1, 1 end addEvent(doRepeatCheckFireStorm, configFireStormEvent.fireStormDelay) end end function doCountPlayersFireStormEvent() local x = 0 for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configFireStormEvent.storages.player) > 0 then x = x + 1 end end return x end function doStartCountingFireStormEvent(x) if configFireStormEvent.delayTime-x > 0 then doBroadcastMessage('Fire Storm Event will start in '..configFireStormEvent.delayTime-x..' minutes. You can join to the event by say "!fire join".') addEvent(doStartCountingFireStormEvent, 60*1000, x+1) end end ]]> </lib> <talkaction words="!fire" event="script"> <![CDATA[ domodlib("config_fire_storm_event") function onSay(cid, words, param) if getStorage(configFireStormEvent.storages.joining) ~= 1 then return doPlayerSendCancel(cid, 'Fire Storm Event hasn\'t started yet.') elseif param == '' then return doPlayerSendCancel(cid, 'Command param required (say: "!fire join" or "!fire leave.").') elseif getPlayerLevel(cid) < configFireStormEvent.players.minLevel then return doPlayerSendCancel(cid, 'You can\'t join to the event if you don\'t have a require '..configFireStormEvent.players.minLevel..' level.') elseif getTileInfo(getThingPos(cid)).protection ~= true then return doPlayerSendCancel(cid, 'You can\'t join to the event if you aren\'t in protection zone.') elseif exhaustion.check(cid, configFireStormEvent.storages.exhaust) ~= false then return doPlayerSendCancel(cid, 'You must wait '..exhaustion.get(cid, configFireStormEvent.storages.exhaust)..' seconds to use this command again.') end if param == 'join' then if getCreatureStorage(cid, configFireStormEvent.storages.player) > 0 then return doPlayerSendCancel(cid, 'You have arleady joined to event. Wait patiently for start.') elseif doCountPlayersFireStormEvent() == configFireStormEvent.players.max then return doPlayerSendCancel(cid, 'Max players in the event have been reached.') end doCreatureSetNoMove(cid, true) doPlayerPopupFYI(cid, configFireStormEvent.text) doCreatureSetStorage(cid, configFireStormEvent.storages.player, 1) doAddCondition(cid, createConditionObject(CONDITION_INFIGHT, -1)) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have joined to Fire Storm Event. You can\'t move until event don\'t start. Wait patiently for the event start.') doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have joined to Fire Storm Event.') elseif param == 'leave' then if getCreatureStorage(cid, configFireStormEvent.storages.player) <= 0 then return doPlayerSendCancel(cid, 'You can\'t leave from the event if you don\'t join.') end doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) doCreatureSetStorage(cid, configFireStormEvent.storages.player, -1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have left from the Fire Storm Event.') end exhaustion.set(cid, configFireStormEvent.storages.exhaust, 5) return true end ]]> </talkaction> <talkaction words="!startfire" access="4" event="script"> <![CDATA[ domodlib("config_fire_storm_event") domodlib("lib_fire_storm_event") function onSay(cid, words, param) if getStorage(configFireStormEvent.storages.main) > 0 then return doPlayerSendCancel(cid, 'Fire Storm Event is already running.') end doStartCountingFireStormEvent(0) for _, pid in ipairs(getPlayersOnline()) do if getCreatureStorage(pid, configFireStormEvent.storages.player) > 0 then doCreatureSetStorage(pid, configFireStormEvent.storages.player, -1) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true) end end doSetStorage(configFireStormEvent.storages.joining, 1) addEvent(doStartFireStormEvent, configFireStormEvent.delayTime * 60 * 1000) return true end ]]> </talkaction> <globalevent name="Fire_Storm_Event_Days" interval="1000" event="script"> <![CDATA[ domodlib("config_fire_storm_event") domodlib("lib_fire_storm_event") local daysOpen = {} for k, v in pairs(configFireStormEvent.days) do table.insert(daysOpen, k) end function onThink(interval) if isInArray(daysOpen, os.date('%A')) then if isInArray(configFireStormEvent.days[os.date('%A')], os.date('%X', os.time())) then if getStorage(configFireStormEvent.storages.joining) ~= 1 then doStartCountingFireStormEvent(0) for _, pid in ipairs(getPlayersOnline()) do if getCreatureStorage(pid, configFireStormEvent.storages.player) > 0 then doCreatureSetStorage(pid, configFireStormEvent.storages.player, -1) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true) end end doSetStorage(configFireStormEvent.storages.joining, 1) addEvent(doStartFireStormEvent, configFireStormEvent.delayTime * 60 * 1000) end end end return true end ]]> </globalevent> <event type="statschange" name="Fire_Storm_Event_Dead" event="script"> <![CDATA[ domodlib("config_fire_storm_event") function onStatsChange(cid, attacker, type, combat, value) if type == 1 and getCreatureHealth(cid) <= value then if isInRange(getThingPos(cid), configFireStormEvent.room.from, configFireStormEvent.room.to) then doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid)) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You loss.') return false end end return true end ]]> </event> <event type="login" name="Fire_Storm_Event_Login" event="script"> <![CDATA[ domodlib("config_fire_storm_event") function onLogin(cid) if getCreatureStorage(cid, configFireStormEvent.storages.player) > 0 then doCreatureSetStorage(cid, configFireStormEvent.storages.player, -1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) end registerCreatureEvent(cid, 'Fire_Storm_Event_Dead') return true end ]]> </event> <globalevent name="Fire_Storm_Event_Start" type="startup" event="script"> <![CDATA[ domodlib("config_fire_storm_event") function onStartup() doSetStorage(configFireStormEvent.storages.main, -1) doSetStorage(configFireStormEvent.storages.joining, -1) return true end ]]> </globalevent> </mod> Como configurar: position = {x=890 ,y=993,z=7}, -- posiotion to which player is teleporting - Aqui você deve colocar o centro da posição do mapa que o linduxo do meu querido amigo e parceiro vosso disponibiliza AQUI from = {x=736,y=933,z=7}, -- left top corner of event room - Aqui você deve colocar a posição superior esquerda da área do evento, como exemplo na imagem: to = {x=781,y=955,z=7} -- right bottom corner of event room - Aqui você deve colocar a posição inferior direita da área do evento, como exemplo na imagem: Configurar prêmio: rewards = {8858, 2346, 2538, 2437}, -- reward id which player can win (reward is random) - onde está os números de exemplo 8858, 2346, 2538, 2437 são os IDS dos items que você colocará como premiação, o player ganhará apenas UM item que pode ser um dos 4 (sorteio). Caso você queira colocar apenas 1 item específico altere para: rewards = {8858}, -- reward id which player can win (reward is random) Permissão para abrir o evento: <talkaction words="!startfire" access="4" event="script"> - em acess="4" você poderá alterar o membro da staff que poderá abrir, o número 4 indica que CM e ADMS poderão abrir, caso troque para 3, GM'S, CM'S E ADM'S poderão executar o comando !startfire para abrir o evento quando quiser. Configuração automática: days = { ['Tuesday'] = {'19:59:20'}, ['Thursday'] = {'19:59:20'}, ['Sunday'] = {'19:59:20'} Simples, os dias são colocados em inglês, então basta ajustar, por exemplo, você quer que o evento ocorra na segunda-feira ás 19:00, segue um exemplo: ['Monday'] = {'19:00:00'}, Lembrando que o dia e horário deve corresponder com o horário atual da máquina onde roda o servidor. É isso meus queridos, na próxima versão do evento colocarei para entrar no mesmo por teleport. Não esqueçam de baixar e usar o mapa que recomendo do Victor aqui. É ideal para o evento =) Qualquer dúvida não deixe de me perguntar. Créditos: CollocorpuseK base do evento Absolute (adaptação, funções e abertura por comando) VitiinG (mapa) Nós vemos na próxima versão! Enjoy.
  16. Vip System by Account 1.0 By Kydrai Este é um vip system por account, ou seja, um sistema de vip válido para todos os characters de uma determinada conta. O script foi testado no TFS 0.3.6 - 8.54. E no site Gesior 0.3.4 beta4. Em caso de erros ou dúvidas é só postar. Funções do Script Função necessária para começar a usar o script: installVip() -> Cria a coluna no banco de dados para usar o sistema de vip (testei somente em sqlite, mas acredito que funcione em mysql) Funções que utilizam o account id: doTeleportPlayersByAccount(acc, topos) -> Teleporta todos os players da account getVipTimeByAccount(acc) -> Pega o tempo de vip setVipTimeByAccount(acc, time) -> Edita o tempo de vip getVipDaysByAccount(acc) -> Pega o tempo de vip em dias isVipAccount(acc) -> Verifica se é vip addVipDaysByAccount(acc, days) -> Adiciona dias de vip doRemoveVipDaysByAccount(acc, days) -> Remove dias de vip getVipDateByAccount(acc) -> Pega a data e hora que irá terminar a vip Funções que utilizam o creature id (cid): doTeleportPlayers(cid, topos) -> Teleporta todos os players da account getVipTime(cid) -> Pega o tempo de vip setVipTime(cid, time) -> Edita o tempo de vip getVipDays(cid) -> Pega o tempo de vip em dias isVip(cid) -> Verifica se é vip addVipDays(cid, days) -> Adiciona dias de vip doRemoveVipDays(cid, days) -> Remove dias de vip getVipDate(cid) -> Pega a data e hora que irá terminar a vip Inserindo as funções Abra a pasta data/lib, crie um arquivo lua e coloque: vipAccount.lua --[[ Name: Vip System by Account Version: 1.0 Author: Kydrai Forum: http://www.xtibia.com/forum/topic/136543-vip-system-by-account-v10/ [Functions] -- Install installVip() -- By Account doTeleportPlayersByAccount(acc, topos) getVipTimeByAccount(acc) setVipTimeByAccount(acc, time) getVipDaysByAccount(acc) isVipAccount(acc) addVipDaysByAccount(acc, days) doRemoveVipDaysByAccount(acc, days) getVipDateByAccount(acc) -- By Player doTeleportPlayers(cid, topos) getVipTime(cid) setVipTime(cid, time) getVipDays(cid) isVip(cid) addVipDays(cid, days) doRemoveVipDays(cid, days) getVipDate(cid) ]]-- -- Install function installVip() if db.executeQuery("ALTER TABLE `accounts` ADD viptime INT(15) NOT NULL DEFAULT 0;") then print("[Vip System] Vip System instalado com sucesso!") return TRUE end print("[Vip System] Não foi possível instalar o Vip System!") return FALSEend -- By Account function doTeleportPlayersByAccount(acc, topos) if db.executeQuery("UPDATE `players` SET `posx` = "..topos.x..", `posy` = "..topos.y..", `posz` = "..topos.z.." WHERE `account_id` = "..acc..";") then return TRUE end return FALSEend function getVipTimeByAccount(acc) local vip = db.getResult("SELECT `viptime` FROM `accounts` WHERE `id` = "..acc..";") if vip:getID() == -1 then print("[Vip System] Account not found!") return FALSE end return vip:getDataInt("viptime") end function setVipTimeByAccount(acc, time) if db.executeQuery("UPDATE `accounts` SET `viptime` = "..time.." WHERE `id` = "..acc..";") then return TRUE end return FALSEend function getVipDaysByAccount(acc) local vipTime = getVipTimeByAccount(acc) local timeNow = os.time() local days = math.ceil((vipTime - timeNow)/(24 * 60 * 60)) return days <= 0 and 0 or daysend function isVipAccount(acc) return getVipDaysByAccount(acc) > 0 and TRUE or FALSEend function addVipDaysByAccount(acc, days) if days > 0 then local daysValue = days * 24 * 60 * 60 local vipTime = getVipTimeByAccount(acc) local timeNow = os.time() local time = getVipDaysByAccount(acc) == 0 and (timeNow + daysValue) or (vipTime + daysValue) setVipTimeByAccount(acc, time) return TRUE end return FALSEend function doRemoveVipDaysByAccount(acc, days) if days > 0 then local daysValue = days * 24 * 60 * 60 local vipTime = getVipTimeByAccount(acc) local time = vipTime - daysValue setVipTimeByAccount(acc, (time <= 0 and 1 or time)) return TRUE end return FALSEend function getVipDateByAccount(acc) if isVipAccount(acc) then local vipTime = getVipTimeByAccount(acc) return os.date("%d/%m/%y %X", vipTime) end return FALSEend -- By Player function doTeleportPlayers(cid, topos) doTeleportPlayersByAccount(getPlayerAccountId(cid), topos) end function getVipTime(cid) return getVipTimeByAccount(getPlayerAccountId(cid)) end function setVipTime(cid, time) return setVipTimeByAccount(getPlayerAccountId(cid), time) end function getVipDays(cid) return getVipDaysByAccount(getPlayerAccountId(cid)) end function isVip(cid) return isVipAccount(getPlayerAccountId(cid)) end function addVipDays(cid, days) return addVipDaysByAccount(getPlayerAccountId(cid), days) end function doRemoveVipDays(cid, days) return doRemoveVipDaysByAccount(getPlayerAccountId(cid), days) end function getVipDate(cid) return getVipDateByAccount(getPlayerAccountId(cid)) end Exemplos de uso Talkaction GOD: /installvip /addvip name, days /removevip name, days /checkvip name Player: /buyvip /vipdays talkactions.xml: <talkaction log="yes" access="5" words="/installvip;/addvip;/removevip;/checkvip" event="script" value="vipaccgod.lua"/> <talkaction words="/buyvip;/vipdays" event="script" value="vipaccplayer.lua"/> vipaccgod.lua: function onSay(cid, words, param, channel) local t = param:explode(",") local name, days = t[1], tonumber(t[2]) if words == "/installvip" then if installVip() then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Vip System instalado com sucesso!") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não foi possível instalar o Vip System!") end elseif words == "/addvip" then if name then if days then local acc = getAccountIdByName(name) if acc ~= 0 then addVipDaysByAccount(acc, days) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você adicionou "..days.." dia(s) de vip ao "..name..", agora ele possui "..getVipDaysByAccount(acc).." dia(s) de vip.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este player não existe.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode adicionar essa quantidade de dia(s) de vip.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode adicionar dia(s) de vip a este player.") end elseif words == "/removevip" then if name then if days then local acc = getAccountIdByName(name) if acc ~= 0 then doRemoveVipDaysByAccount(acc, days) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você retirou "..days.." dia(s) de vip do "..name..", agora ele possui "..getVipDaysByAccount(acc).." dia(s) de vip.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este player não existe.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode retirar essa quantidade de dia(s) de vip.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode retirar dia(s) de vip a este player.") end elseif words == "/checkvip" then if name then local acc = getAccountIdByName(name) if acc ~= 0 then local duration = getVipDateByAccount(acc) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O "..name.." possui "..getVipDaysByAccount(acc).." dias de vip."..(duration and (" Ela irá durar até "..duration..".") or "")) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este player não existe.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode visualizar os dias de vip a este player.") end end return TRUEend vipaccplayer.lua: function onSay(cid, words, param, channel) if words == "/buyvip" then local price = 1000000 local days = 30 if doPlayerRemoveMoney(cid, price) then addVipDays(cid, days) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você adicionou "..days.." dia(s) de vip, agora você possui "..getVipDays(cid).." dia(s) de vip.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa de "..price.." para adicionar "..days.." dia(s) de vip.") end elseif words == "/vipdays" then local duration = getVipDate(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você possui "..getVipDays(cid).." dia(s) de vip."..(duration and (" Ela irá durar até "..duration..".") or "")) end return TRUEend Movement (Tile) Coloque actionid 15000 em um tile onde somente os vips poderão passar. movements.xml: <movevent type="StepIn" actionid="15000" event="script" value="viptile.lua"/> viptile.lua: function onStepIn(cid, item, position, fromPosition) if isVip(cid) == FALSE then doTeleportThing(cid, fromPosition, false) doSendMagicEffect(position, CONST_ME_MAGIC_BLUE) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente players vip podem passar.") end return TRUEend Creaturescript (Login) Quando player logar irá verificar se a vip do player acabou, se sim então irá teleportar todos os players da account para o templo, se não irá mostrar o tempo da vip. creaturescripts.xml: <event type="login" name="viplogin" script="viplogin.lua"/> viplogin.lua: function onLogin(cid) local vip = isVip(cid) if getVipTime(cid) > 0 and vip == FALSE then local townid = 1 doPlayerSetTown(cid, townid) local templePos = getTownTemplePosition(getPlayerTown(cid)) doTeleportThing(cid, templePos, false) setVipTime(cid, 0) doTeleportPlayers(cid, templePos) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Vip acabou!") elseif vip == TRUE then local duration = getVipDate(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você possui "..getVipDays(cid).." dia(s) de vip."..(duration and (" Ela irá durar até "..duration..".") or "")) end return TRUEend Action (Door) Coloque actionid 15001 na door onde somente os vips poderão passar. Use a porta gate of expertise (id: 1227) actions.xml: <action actionid="15001" script="vipdoor.lua"/> vipdoor.lua: function onUse(cid, item, fromPosition, itemEx, toPosition) if isVip(cid) == FALSE then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Somente players vip podem passar.") elseif item.itemid == 1227 then doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition) end return TRUEend NPC (Vendedor de VIP) vipnpc.xml: <?xml version="1.0" encoding="UTF-8"?> <npc name="Vendedor de VIP" script="vipnpc.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="128" head="17" body="54" legs="114" feet="0" addons="2"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|, I sell {vip} days."/> </parameters> </npc> vipnpc.lua: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function buyVip(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end if doPlayerRemoveMoney(cid, parameters.price) then addVipDays(cid, parameters.days) npcHandler:say('Thanks, you buy '..parameters.days..' vip days. You have '..getVipDays(cid)..' vip days.', cid) else npcHandler:say('Sorry, you don\'t have enough money.', cid) end npcHandler:resetNpc() return true end local node1 = keywordHandler:addKeyword({'vip'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want buy 30 vip days for 1000000 gp\'s?'}) node1:addChildKeyword({'yes'}, buyVip, {price = 1000000, days = 30}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) npcHandler:addModule(FocusModule:new()) Erros e Soluções Configurando o Gesior Com essa configuração irá aparecer o vip status do player no site e será possível vender vip pelo site. Se eu esqueci de alguma coisa é só avisar. accountmanagement.php Depois de: if(!$account_logged->isPremium()) $account_status = '<b><font color="red">Free Account</font></b>'; else $account_status = '<b><font color="green">Premium Account, '.$account_logged->getPremDays().' days left</font></b>'; Adicione: if(!$account_logged->isVip()) $account_vip_status = '<b><font color="red">Not Vip Account</font></b>'; else $account_vip_status = '<b><font color="green">Vip Account, '.$account_logged->getVipDays().' days left</font></b>'; Depois de: <td class="LabelV" >Account Status:</td><td>'.$account_status.'</td></tr><tr style="background-color:'.$config['site']['darkborder'].';" > Adicione: <td class="LabelV" >Account Vip Status:</td><td>'.$account_vip_status.'</td></tr><tr style="background-color:'.$config['site']['darkborder'].';" > pot/OTS_Account.php Substitua: private $data = array('email' => '', 'blocked' => false, 'rlname' => '','location' => '','page_access' => 0,'lastday' => 0,'premdays' => 0, 'created' => 0); Por: private $data = array('email' => '', 'blocked' => false, 'rlname' => '','location' => '','page_access' => 0,'lastday' => 0,'premdays' => 0, 'created' => 0, 'viptime' => 0); Substitua: $this->data = $this->db->query('SELECT ' . $this->db->fieldName('id') . ', ' . $this->db->fieldName('name') . ', ' . $this->db->fieldName('password') . ', ' . $this->db->fieldName('email') . ', ' . $this->db->fieldName('blocked') . ', ' . $this->db->fieldName('rlname') . ', ' . $this->db->fieldName('location') . ', ' . $this->db->fieldName('page_access') . ', ' . $this->db->fieldName('premdays') . ', ' . $this->db->fieldName('lastday') . ', ' . $this->db->fieldName('created') . ' FROM ' . $this->db->tableName('accounts') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . (int) $id)->fetch(); Por: $this->data = $this->db->query('SELECT ' . $this->db->fieldName('id') . ', ' . $this->db->fieldName('name') . ', ' . $this->db->fieldName('password') . ', ' . $this->db->fieldName('email') . ', ' . $this->db->fieldName('blocked') . ', ' . $this->db->fieldName('rlname') . ', ' . $this->db->fieldName('location') . ', ' . $this->db->fieldName('page_access') . ', ' . $this->db->fieldName('premdays') . ', ' . $this->db->fieldName('viptime') . ', ' . $this->db->fieldName('lastday') . ', ' . $this->db->fieldName('created') . ' FROM ' . $this->db->tableName('accounts') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . (int) $id)->fetch(); Substitua: $this->db->query('UPDATE ' . $this->db->tableName('accounts') . ' SET ' . $this->db->fieldName('password') . ' = ' . $this->db->quote($this->data['password']) . ', ' . $this->db->fieldName('email') . ' = ' . $this->db->quote($this->data['email']) . ', ' . $this->db->fieldName('blocked') . ' = ' . (int) $this->data['blocked'] . ', ' . $this->db->fieldName('rlname') . ' = ' . $this->db->quote($this->data['rlname']) . ', ' . $this->db->fieldName('location') . ' = ' . $this->db->quote($this->data['location']) . ', ' . $this->db->fieldName('page_access') . ' = ' . (int) $this->data['page_access'] . ', ' . $this->db->fieldName('premdays') . ' = ' . (int) $this->data['premdays'] . ', ' . $this->db->fieldName('lastday') . ' = ' . (int) $this->data['lastday'] . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']); Por: $this->db->query('UPDATE ' . $this->db->tableName('accounts') . ' SET ' . $this->db->fieldName('password') . ' = ' . $this->db->quote($this->data['password']) . ', ' . $this->db->fieldName('email') . ' = ' . $this->db->quote($this->data['email']) . ', ' . $this->db->fieldName('blocked') . ' = ' . (int) $this->data['blocked'] . ', ' . $this->db->fieldName('rlname') . ' = ' . $this->db->quote($this->data['rlname']) . ', ' . $this->db->fieldName('location') . ' = ' . $this->db->quote($this->data['location']) . ', ' . $this->db->fieldName('page_access') . ' = ' . (int) $this->data['page_access'] . ', ' . $this->db->fieldName('premdays') . ' = ' . (int) $this->data['premdays'] . ', ' . $this->db->fieldName('viptime') . ' = ' . (int) $this->data['viptime'] . ', ' . $this->db->fieldName('lastday') . ' = ' . (int) $this->data['lastday'] . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']); Depois de: public function getPremDays() { if( !isset($this->data['premdays']) || !isset($this->data['lastday']) ) { throw new E_OTS_NotLoaded(); } return $this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday'])); } Adicione: public function getVipDays() { if( !isset($this->data['viptime']) || !isset($this->data['lastday']) ) { throw new E_OTS_NotLoaded(); } return ceil(($this->data['viptime'] - time()) / (24*60*60)); } Depois de: public function isPremium() { return ($this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday'])) > 0); } Adicione: public function isVip() { return ceil(($this->data['viptime'] - time()) / (24*60*60)) > 0; } characters.php Substitua: if($config['site']['show_vip_status']) { $id = $player->getCustomField("id"); if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=10%>Vip Status:</TD>'; $vip = $SQL->query('SELECT * FROM player_storage WHERE player_id = '.$id.' AND `key` = '.$config['site']['show_vip_storage'].';')->fetch(); if($vip == false) { $main_content .= '<TD><span class="red"><B>NOT VIP</B></TD></TR>'; } else { $main_content .= '<TD><span class="green"><B>VIP</B></TD></TR>'; } $comment = $player->getComment(); $newlines = array("\r\n", "\n", "\r"); $comment_with_lines = str_replace($newlines, '<br />', $comment, $count); if($count < 50) $comment = $comment_with_lines; if(!empty($comment)) { if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD VALIGN=top>Comment:</TD><TD>'.$comment.'</TD></TR>'; } } Por: if($config['site']['show_vip_status']) { $id = $player->getCustomField("id"); if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=10%>Account Vip Status:</TD>'; if(!$account->isVip()) { $main_content .= '<TD><span class="red"><B>NOT VIP</B></TD></TR>'; } else { $main_content .= '<TD><span class="green"><B>VIP</B></TD></TR>'; } $comment = $player->getComment(); $newlines = array("\r\n", "\n", "\r"); $comment_with_lines = str_replace($newlines, '<br />', $comment, $count); if($count < 50) $comment = $comment_with_lines; if(!empty($comment)) { if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD VALIGN=top>Comment:</TD><TD>'.$comment.'</TD></TR>'; } } shopsystem.php (+Créditos ao Natanael Bekman) Substitua: if($buy_offer['type'] == 'pacc') { $player_premdays = $buy_player_account->getCustomField('premdays'); $player_lastlogin = $buy_player_account->getCustomField('lastday'); $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_pacc').' (id, to_name, to_account, from_nick, from_account, price, pacc_days, trans_state, trans_start, trans_real) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['days']).', \'realized\', '.$SQL->quote(time()).', '.$SQL->quote(time()).');'; $SQL->query($save_transaction); $buy_player_account->setCustomField('premdays', $player_premdays+$buy_offer['days']); $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']); $user_premium_points = $user_premium_points - $buy_offer['points']; if($player_premdays == 0) { $buy_player_account->setCustomField('lastday', time()); } $main_content .= '<h2>PACC added!</h2><b>'.$buy_offer['days'].' days</b> of Premium Account added to account of player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><a href="index.php?subtopic=shopsystem">GO TO MAIN SHOP SITE</a>'; } Por: if($buy_offer['type'] == 'pacc') { $player_viptime = $buy_player_account->getCustomField('viptime'); $player_lastlogin = $buy_player_account->getCustomField('lastday'); $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_pacc').' (id, to_name, to_account, from_nick, from_account, price, pacc_days, trans_state, trans_start, trans_real) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['days']).', \'realized\', '.$SQL->quote(time()).', '.$SQL->quote(time()).');'; $SQL->query($save_transaction); if($player_viptime > 0) $buy_player_account->setCustomField('viptime', $player_viptime + ($buy_offer['days'] * 24 * 60 * 60)); else $buy_player_account->setCustomField('viptime', time() + ($buy_offer['days'] * 24 * 60 * 60)); $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']); $user_premium_points = $user_premium_points - $buy_offer['points']; if($player_viptime == 0) { $buy_player_account->setCustomField('lastday', time()); } $main_content .= '<h2>VIP Days added!</h2><b>'.$buy_offer['days'].' days</b> of Vip Account added to account of player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><a href="index.php?subtopic=shopsystem">GO TO MAIN SHOP SITE</a>'; } Créditos: Kydrai Natanael Beckman (Pelo sistema de WEB) Eu (Por trazer o conteúdo para o TK) (Se tiver mais alguém fala que adiciona com prazer.) Scripts úteis: Double exp para vips: Vá em creaturescript/script,copie um arquivo.lua existente e renomeie para: vipexp.lua function onLogin(cid) local rate = 1.25 -- 25% local config = { welvip = "Você tem "..((rate - 1)*100).."% de exp agora!!", not_vip = "Tornesse vip e ganhe "..((rate - 1)*100).."% a mais de experiência!", vip = isVip(cid) } if (config.vip == TRUE) then doPlayerSetExperienceRate(cid, rate) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.welvip) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.not_vip) end return TRUE end Agora em creaturescript/scripts/login.lua adicione a tag: registerCreatureEvent(cid, "ExpVip") Agora vá para creaturescript.xml e adicione: <event type="login" name="ExpVip" script="vipexp.lua"/> Para mudar a porcentagem de exp: Edite essa parte para alterar a porcentargem de exp a mais para os vip: local rate = 1.25 -- 25% No caso está 25% a mais de exp. Por exemplo,se quiser colocar 50% ficaria assim: local rate = 1.50 -- 50% Créditos: Vodkart (Por fazer todo o script) Eu (Por trazer para o TK)
  17. 3 Teans and 1 Boss Informações: Abre-se um portal em uma determinada posição que levara os players para uma sala de espera lá eles aguardaram até caírem em outro mapa, separados em 3 times, objetivo, o time que matar o boss primeiro tem direito a entrar na sala de premio e pegar o premio. Descrição: Todo dia as 15:00 horas o script é ativado, aparecera um teleport na posição desejada, ao se passar um tempo pré determinado, se houverem a quantidade de players necessários na sala de espera todos os players na sala de espera serão divididos em 3 times, o time que mais tirar vida do boss terá o privilégio de passar pelo tile com aid 32114, e pegar o premio no bau com o aid 12688. OBS: IMPORTANTE! Colocar piso no-logout em todo mapa utilizado no sistema. Sigam as instruções das linhas que apresentam "-- Alterar". Instalação Vá em data/globalevents/scripts/ e cria um arquivo chamado evento times.lua, dentro dele coloque. Vá em data/globalevents.xml e adicione a tag. Vá em data/creaturescripts.xml e adicione a tag. Vá em data/creaturescripts/scripts/ crie um arquivo chamado evento times.lua e coloque isso. Vá em data/creaturescripts/scripts/ e adicione essa tag no arquivo login.lua. Vá em data/movements.xml e adicione a tag. Vá em data/movements/scripts/ e crie um arquivo chamado evento times.lua e coloque isso. Vá em data/actions.xml e adicione a tag. Vá em data/actions/scripts/ e crie um arquivo chamado evento times.lua e coloque isso. Exemplo de Boss. Vermelho - Essencial colocar no seu Boss Pronto instalado com sucesso. Créditos Pelo Script: 100% - Gabisa00 Créditos Pela Ideia: 100% - Macalo Dúvidas, bugs, sugestões, somente no tópico. Gostou do Sistema Faça Seu Pedido Aqui!
  18. Na falta de coisa melhor fiz essa gambiarra que poderá ajudar muita gente Crie em actions/script/other um arquivo vip.lua function onUse(cid, item) if getPlayerStorageValue(cid, 55489) - os.time() < 0 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Agora voce e um player VIP.") setPlayerStorageValue(cid, 55489, os.time() + (30*24*60*60)) doRemoveItem(item.uid, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Voce ja e VIP so poderá renovar daqui 30 dias.") end return TRUE end Nessa´parte 30*24*60*60 onde esta 30 coloca os dias que quer adicionar em actions.xml adicione <action itemid="16101" script="other/vip.lua"/> e pronto um sistema vip funcional, na falta de outra opção. Piso para passar somente que for VIP Crie em data/movements/scripts um arquivo entradavip.lua function onStepIn(cid, item, position, fromPosition) local config = { msgDenied = "Você não e vip ,Compre =D.", msgWelcome = "Seja Bem Vindo a Area vip." } if getPlayerStorageValue(cid, 55489) - os.time() <= 0 then doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msgDenied) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return TRUE end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msgWelcome) return TRUE end TAG 0.4 <movevent type="StepIn" uniqueid="13500" event="script" value="entradavip.lua"/> TAG 1.0 <movevent event="StepIn" uniqueid="13500" script="entradavip.lua"/>
  19. VIP System Completo Vá´ate o arquivo global.lua e adicione no fim dele as funções do vip system -- Vip system lib function getPlayerAccount(cid) return getAccountNumberByPlayerName(getPlayerName(cid)) end function setVipTable() db.query("ALTER TABLE `accounts` ADD `vip_time` INT( 15 ) NOT NULL;") end function getPlayerVip(cid) local resultId = db.storeQuery("SELECT `id`, `vip_time` FROM `accounts` WHERE `id` = '".. getPlayerAccount(cid) .."';") if resultId ~= false then return result.getDataInt(resultId, "vip_time") else error('Account not found.') end end function getVipByAcc(acc) local a = db.storeQuery("SELECT `vip_time` FROM `accounts` WHERE `id` = '"..acc.."';") if a ~= false then return result.getDataInt(a, "vip_time") else error('Account not found.') end end function setPlayerVip(cid,secs) -- seconds if isPlayer(cid) then db.query("UPDATE `accounts` SET `vip_time` = '"..(os.time()+secs).."' WHERE `id` ='".. getPlayerAccount(cid) .."' LIMIT 1 ;") else error('Player not found.') end end getVipByAccount = getVipByAcc function hasVip(cid) if isPlayer(cid) then if os.time(day) < getPlayerVip(cid) then return true else return false end else error('Player not found.') end end function accountHasVip(acc) if os.time() < getVipByAccount(acc) then return true else return false end end function setVipByAccount(acc,secs) -- seconds local a = getVipByAcc(acc) if a ~= false then if tonumber(secs) ~= nil then db.query("UPDATE `accounts` SET `vip_time` = '"..(os.time()+secs).."' WHERE `id` ='"..acc.."' LIMIT 1 ;") return true else error('Time must be defined as number.') end else error('Account not found.') end return false end function getPlayerVipTime(cid) if getPlayerVip(cid)-os.time() > 0 then return getPlayerVip(cid)-os.time() else return 0 end end function getAccountVipTime(acc) if getVipByAcc(acc)-os.time() > 0 then return getVipByAcc(acc)-os.time() else return 0 end end function addVipByAccount(acc,secs) -- seconds local a = getVipByAcc(acc) if a ~= false then if tonumber(secs) ~= nil then db.query("UPDATE `accounts` SET `vip_time` = '"..os.time()+(getAccountVipTime(acc)+secs).."' WHERE `id` ='"..acc.."' LIMIT 1 ;") return true else error('Time must be defined as number.') end else error('Account not found.') end return false end function doPlayerAddVip(cid,secs) -- seconds local a = getPlayerVip(cid) if a ~= false then if tonumber(secs) ~= nil then return setPlayerVip(cid,(getPlayerVipTime(cid) + secs)) else error('Time must be defined as number.') end else error('Player not found.') end end function returnVipString(cid) if isPlayer(cid) == true then return os.date("%d %B %Y %X", getPlayerVip(cid)) else error('Player not found.') end end function returnVipCountdown(num) local d = (tonumber(string.format("%.0f", os.date("%j",num))) - 1) local h = (tonumber(string.format("%.0f", os.date("%H",num))) - 1) local m = (tonumber(string.format("%.0f", os.date("%M",num)))) local s = (tonumber(string.format("%.0f", os.date("%S",num)))) local tvar, tnames, text = {d, h, m, s}, {"day", "hour", "minute", "second"}, "" local nvar, nnames = {}, {} for i = 1, #tvar do local s = "" table.insert(nvar, tvar) if tvar > 1 then s = "s" end table.insert(nnames, tnames..s) if i == 1 then if tvar > 0 then text = text..nvar.." "..nnames else text = text end else if tvar > 0 then if text == "" then text = nvar.." "..nnames else if tvar[i+1] ~= nil and tvar[i+1] > 0 then text = text..", "..nvar.." "..nnames else text = text.." and "..nvar.." "..nnames end end else text = text end end end if text == "" then return "no more vip time" else return text.." of vip time" end end -- end of vip system lib depois vai em talkactions/scripts e crie um arquivo vip.lua e adicionei: function onSay(cid, words, param) vipsystem_info = { name = "Vipsystem for TFS 1.0 by Zbizu(inspired by Mock's creation)", author = "Zbizu", version = "1.0", } vip_config = { log_opearations = true, -- logs date, IP integer and player name to make sure explainations of its user are truth if something go wrong, ignores players commands log_file = "vip_log.txt" } local daycounter = (math.floor((getVipByAccount(getPlayerAccount(cid))-os.time())/86400, 0) + 1) if getPlayerAccess(cid) > 0 then adm_info = "\nYou have special access which allows you to manage players viptime.\n\nAvailable params: see, add, reset\nsee - views player's viptime\nadd - adds player's viptime\nreset - makes player's viptime expired immediately\n\nUsage: "..words.." \"param, playername, time, reason" else adm_info = "" adm_info = "" end if param == "" or getPlayerAccess(cid) == 0 then if (daycounter)*(-1) == 1 then s = "" else s = "s" end local ret_ = getPlayerVip(cid) if ret_ == 0 then doPlayerPopupFYI(cid,"You don't have any vip time."..adm_info) return false else if getPlayerVipTime(cid) == 0 then if (daycounter)*(-1) == 0 then doPlayerPopupFYI(cid, "You don't have any vip time.\nYour vip expired in " .. os.date("%d %B %Y %X ",ret_) .. "(today)."..adm_info) return false else doPlayerPopupFYI(cid, "You don't have any vip time.\nYour vip expired in " .. os.date("%d %B %Y %X ",ret_) .. "(" .. (daycounter)*(-1) .. " day".. s .." ago)."..adm_info) return false end else doPlayerPopupFYI(cid, "Your vip status ends in " .. os.date("%d %B %Y %X",ret_) .. ".\nYou have: " .. (daycounter) .. " days left."..adm_info) return false end end else if vip_config.log_opearations then file = io.open(vip_config.log_file, "a+") file:write(os.date("[%x %X]", os.time()).."[IP: "..getPlayerIp(cid).."]["..getPlayerName(cid).."]: ".. words .." \"".. param .."\n") file:close() end local t = string.split(param, ", ", 4) local actions = {["see"] = 1, ["add"] = 2, ["reset"] = 3} local gen = {[0] = "She", [1] = "He", [2] = "This user"} if actions[t[1]] == nil then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Incorrect action specified.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "To see usage manual type "..words.." without params.") return false else local pid = getPlayerByName(t[2]) reason_text = t[4] if reason_text ~= nil then if(t[5] ~= nil) then for j = 5, #t do reason_text = reason_text .. ", " .. t[j] end end else reason_text = "" end if reason_text == "" then vip_comment = "" else vip_comment = "Reason: "..reason_text end if pid then if actions[t[1]] == 1 then if getPlayerVip(pid) == 0 then doPlayerPopupFYI(cid, getPlayerName(pid).."'s account never had any vip time.") else doPlayerPopupFYI(cid, getPlayerName(pid).."'s vip time expiration date:\n" .. os.date("%d %B %Y %X",getPlayerVip(pid)) .. "\n".. gen[getPlayerSex(pid)] .. " has ".. (getPlayerVipTime(pid)) .. " left.") end return false elseif actions[t[1]] == 2 then if tonumber(t[3]) ~= nil then if tonumber(t[3]) == 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPlayerName(pid).."'s vip time wasn't changed.") return false else if tonumber(t[3]) > 0 then vip_action = "added to" vip_formula = tonumber(t[3]) else vip_action = "removed from" vip_formula = tonumber(t[3]*(-1)) end if vip_config.log_opearations then file = io.open(vip_config.log_file, "a+") file:write(os.date("Player had "..(getPlayerVipTime(pid)).." left\n")) file:close() end doPlayerAddVip(pid,tonumber(t[3])) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (vip_formula).." "..vip_action.." "..getPlayerName(pid).."'s account.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, gen[getPlayerSex(pid)] .. " has ".. (getPlayerVipTime(pid)) .. " now.") if vip_comment ~= "" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, vip_comment) end doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, (vip_formula).." "..vip_action.." your account.") doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "You have ".. (getPlayerVipTime(pid)) .. " now.") if vip_comment ~= "" then doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, vip_comment) end return false end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Time must be a number.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "To see usage manual type "..words.." without params.") end return false elseif actions[t[1]] == 3 then if vip_config.log_opearations then file = io.open(vip_config.log_file, "a+") file:write(os.date("Player had "..(getPlayerVipTime(pid)).." left\n")) file:close() end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPlayerName(pid).."'s vip status removed. ".. gen[getPlayerSex(pid)] .. " had "..(getPlayerVipTime(pid)).." left.") if vip_comment ~= "" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, vip_comment) end doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vip status has been removed.") if vip_comment ~= "" then doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, vip_comment) end setPlayerVip(pid,0) return false end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "To see usage manual type "..words.." without params.") return false end end end return true end Depois em talkactions.xml adicione as 2 linhas: <talkaction words="/vip" script="vip.lua"/> <talkaction words="!vip" script="vip.lua"/> para add vip ai player e so usar o comando: /vip "add, player NOME, 86400 86400 = 1 day em segundo vamos fazer o vip scroll, vai em actions/scripts e crie um arquivo vip.lua e adicione: function onUse(cid, item) if hasVip(cid) == false then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Agora voce e um player VIP.") doPlayerAddVip(cid, 2592000) -- 30 dias tempo em segudos. doRemoveItem(item.uid, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Voce ja e VIP so poderá renovar daqui 30 dias.") end return TRUE end depois em actions.xml adicione a linha <action itemid="16101" script="vip.lua"/> vamos fazer o aviso ao logar, vai em creaturescripts/scripts e crie um arquivo vip.lua e adicione: function onLogin(cid) local player = Player(cid) if hasVip(cid) == true then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Você tem 50% de exp a mais agora!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Tornesse vip e ganhe 50% a mais de experiencia!") end return true end depois em creaturescripts.xml adicione a linha: <event type="login" name="vipstatus" script="vip.lua"/> vamos fazer o piso vip, vai em movements/scripts e crie um arquivo vip.lua e adicione: function onStepIn(cid, item, position, fromPosition) local config = { msgDenied = "Você não e vip ,Compre =D.", msgWelcome = "Seja Bem Vindo a Area vip." } if hasVip(cid) == false then doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msgDenied) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return TRUE end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msgWelcome) return TRUE end depois em movements.xml adicione a linha: <movevent event="StepIn" uniqueid="13500" script="vip.lua"/> agora vamos por extra exp vip para vip Crie um arquivo com o nome extraexp.lua em creaturescripts/scripts e coloque isso dentro: local rate = 50 --- porcentagem que irá ganhar a mais. function onKill(cid, target, lastHit) if hasVip(cid) == true then local monster = Monster(target) if not monster then return true end for id, damage in pairs(monster:getDamageMap()) do local player = Player(id) if player then local experience = damage.total / monster:getType():getHealth() * monster:getType():getExperience() local expFormula = (((experience * Game.getExperienceStage(player:getLevel())) / 100) * rate) player:addExperience(math.floor(expFormula), true) end end end return true end Em creaturescripts.xml adcione a tag: <event type="kill" name="Exp_Extra" event="script" value="extraexp.lua"/> E por fim add o evento no creaturescripts/scripts/login.lua: player:registerEvent("Exp_Extra") e não se esqueça de executa o comando no mysql pra criar a tabela vip_time: ALTER TABLE `accounts` ADD `vip_time` INT( 15 ) NOT NULL; Acho que e só isso qualquer duvidas só postar: Creditos: A min (por corrigir algumas coisas), Imkingran (pelo adptação) e luanluciano93 (pelo extra exp)
  20. Eae galera do TK, vim trazer pra vocês um script do Fox World que já me pediram no suporte um monte de vezes, é a magma boots absorvendo metade do dano e podendo ser usado a cada 2 minutos. Pra quem não entendeu tenta acompanhar aqui nas screenshots: Nesse caso o player iria tomar 1124 de dano, mas ele tomou só 562 e a bota absorveu a outra metade do dano! Bom, vamos ao script: em actions.xml adicione: <action itemid="7891" script="magmaboots.lua"/> agora em actions\scripts\magmaboots.lua adicione: local config = { storagetempo = 19500, -- storage que contará os segundos storageskill = 19501, -- storage que vai dizer se a skill está ativada ou desativada itemid = 7891, -- id da boots itemplace = 8, -- feet tempo = 2*60 -- tempo em segundo (2 minutos) } function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, config.storageskill) <= 0 and (getPlayerSlotItem(cid, config.itemplace).itemid == config.itemid) then if getPlayerStorageValue(cid, config.storagetempo) - os.time() <= 0 then timenow = os.time() + config.tempo setPlayerStorageValue(cid, config.storagetempo, timenow) setPlayerStorageValue(cid, config.storageskill, 1) doPlayerSendTextMessage(cid, 23, "You activated your "..getItemNameById(config.itemid)..", it's ready to absorb damages!") for j= 0,(config.tempo -1) do addEvent(function() if isPlayer(cid) then doPlayerSendCancel(cid, "Time until next use: ".. config.tempo - j .." second(s)") end end, (50+(j*1000))) end else doPlayerSendTextMessage(cid, 23, "You have to wait ".. getPlayerStorageValue(cid, config.storagetempo) - os.time() .." second(s) until you can use it again!") end else doPlayerSendTextMessage(cid, 23, "Your "..getItemNameById(config.itemid).." is already active or it isn't equiped.") end return true end em creaturescripts.xml adicione essa linha: <event type="statschange" name="magmaboots" event="script" value="magmaboots.lua"/> agora crie o script magmaboots.lua em creaturescripts\scripts e adicione o seguinte nele: local config = { percent = 0.5, --- porcentagem do dano que irá levar (0.5 = 50%) storageskill = 19501, -- storage da skill itemplace = 8, -- lugar q ela deve estar (8 é o feet) itemid = 7891, -- id do item damagemin = 100 --- minimo de dano que deve ser pro player absorver } function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS and isCreature(attacker) and value >= config.damagemin then if getPlayerSlotItem(cid, config.itemplace).itemid == config.itemid then if getPlayerStorageValue(cid, config.storageskill) >= 1 then value = math.ceil(value*(config.percent)) setPlayerStorageValue(cid, config.storageskill, getPlayerStorageValue(cid, config.storageskill)-1) doTargetCombatHealth(attacker, cid, combat, -value, -value, 255) doPlayerSendTextMessage(cid, 23, "Your "..getItemNameById(config.itemid).." absorved "..value.." of damage.") return false end end end return true end feito isso você só vai ter que ir no login.lua que fica em creaturescripts\scripts e adicionar essas linhas antes do ultimo return true: ----------MAGMA BOOTS DO FOX---------------- registerCreatureEvent(cid, "magmaboots") if getPlayerStorageValue(cid, 19501) ~= 0 then setPlayerStorageValue(cid, 19501, 0) end --------------------------------------- Não tem muito oque configurar, no actions você pode editar isso daqui: e em creaturescripts vc pode editar isso daqui: Se vc ativar ela e deslogar, vc vai precisar ativar de novo quando logar. Testei em 8.54 então se não funcionar no seu server 12.0 nao é problema meu, procura as funções que mudaram e faça as alterações necessárias. Não me peça pra adaptar o script pra 7.51, eu não sou programmer e não sei fazer isso. Bom é isso, qualquer coisa manda nos comentários que eu tento ajudar ou explicar melhor. Abraço pra vocês
  21. Yalahar quest modificada por mim, base muito usada em styllers, com chests, tudo, não da pra passar sem matar o azerus, dei uma dificultada nela pra só poder fazer com time, porque o legal das quests é reunir seu time/amigos pra um desafio, a que geralmente usam é muito fácil de ser solada e no final você escolhe o lado do bem ou lado do mal (first ou second addon de yalahari outifit) LINK de download (scripts/mapa): http://www.4shared.com/rar/n_fmQ3MWce/yalahar_quest__tddf1995_.html? Scan: https://www.virustotal.com/pt-br/file/51be352df28c1f97bb9631e07064cd68d2e4a3e985205f8ae0d209bbd62aa81e/analysis/1407199071/ Problemas de compatibilidade? Use o meu remeres, sem bugs, sem vírus, com scan, ajeitei umas coisas nele: http://www.tibiaking.com/forum/topic/39642-remeres-sem-erro/#entry225590 Não retirem os créditos e eu não autorizo publicação em outros fóruns! Desculpem se tiver no lugar errado por favor movam.
  22. Lérigou ... -- SYSTEM -- MySQL queries -execute em sua database : ALTER TABLE `accounts` ADD COLUMN `viplastday` int(10) NOT NULL DEFAULT 0 AFTER `lastday`, ADD COLUMN `vipdays` int(11) NOT NULL DEFAULT 0 AFTER `lastday`; login.lua - procure o arquivo em data/creaturescripts/scripts/ - adicione logo após local player = Player(cid) : player:loadVipData() player:updateVipTime() global.lua - procure o arquivo em data/ - adicione este código em baixo dofile('data/compat.lua') dofile('data/vip-system.lua') vip-system.lua - crie este arquivo em data/ - adicione esse código nele : if not VipData then VipData = { } end function Player.getVipDays(self) return VipData[self:getId()].days end function Player.getLastVipDay(self) return VipData[self:getId()].lastDay end function Player.isVip(self) return self:getVipDays() > 0 end function Player.addInfiniteVip(self) local data = VipData[self:getId()] data.days = 0xFFFF data.lastDay = 0 db.query(string.format('UPDATE `accounts` SET `vipdays` = %i, `viplastday` = %i WHERE `id` = %i;', 0xFFFF, 0, self:getAccountId())) end function Player.addVipDays(self, amount) local data = VipData[self:getId()] local amount = math.min(0xFFFE - data.days, amount) if amount > 0 then if data.days == 0 then local time = os.time() db.query(string.format('UPDATE `accounts` SET `vipdays` = `vipdays` + %i, `viplastday` = %i WHERE `id` = %i;', amount, time, self:getAccountId())) data.lastDay = time else db.query(string.format('UPDATE `accounts` SET `vipdays` = `vipdays` + %i WHERE `id` = %i;', amount, self:getAccountId())) end data.days = data.days + amount end return true end function Player.removeVipDays(self, amount) local data = VipData[self:getId()] if data.days == 0xFFFF then return false end local amount = math.min(data.days, amount) if amount > 0 then db.query(string.format('UPDATE `accounts` SET `vipdays` = `vipdays` - %i WHERE `id` = %i;', amount, self:getAccountId())) data.days = data.days - amount end return true end function Player.removeVip(self) local data = VipData[self:getId()] data.days = 0 data.lastDay = 0 db.query(string.format('UPDATE `accounts` SET `vipdays` = 0, `viplastday` = 0 WHERE `id` = %i;', self:getAccountId())) end function Player.loadVipData(self) local resultId = db.storeQuery(string.format('SELECT `vipdays`, `viplastday` FROM `accounts` WHERE `id` = %i;', self:getAccountId())) if resultId then VipData[self:getId()] = { days = result.getDataInt(resultId, 'vipdays'), lastDay = result.getDataInt(resultId, 'viplastday') } result.free(resultId) return true end VipData[self:getId()] = { days = 0, lastDay = 0 } return false end function Player.updateVipTime(self) local save = false local data = VipData[self:getId()] local days, lastDay = data.days, data.lastDay if days == 0 or days == 0xFFFF then if lastDay ~= 0 then lastDay = 0 save = true end elseif lastDay == 0 then lastDay = os.time() save = true else local time = os.time() local elapsedDays = math.floor((time - lastDay) / 86400) if elapsedDays > 0 then if elapsedDays >= days then days = 0 lastDay = 0 else days = days - elapsedDays lastDay = time - ((time - lastDay) % 86400) end save = true end end if save then db.query(string.format('UPDATE `accounts` SET `vipdays` = %i, `viplastday` = %i WHERE `id` = %i;', days, lastDay, self:getAccountId())) data.days = days data.lastDay = lastDay end end -- Talkactions (/vip command ) -- - Modos de usar : - /vip adddays, PlayerName, 5 --> Adiciona 5 dias de vip ao PlayerName. - /vip removedays, PlayerName, 5 --> Remove 5 dias de vip do PlayerName. - /vip remove, PlayerName --> Remove todos dias de vip do PlayerName. - /vip check, PlayerName --> Checa quando dias de vip tem o PlayerName . - /vip addinfinite, PlayerName --> Add infinite vip time ao PlayerName. talkactions.xml - procure em data/talkactions/ - adicione o seguinte código : <talkaction words="/vip" separator=" " script="vipcommand.lua" /> vipcommand.lua - crie o arquivo em data/talkactions/scripts - cole este código dentro : function onSay(cid, words, param)local player = Player(cid) if not player:getGroup():getAccess() then return true end local params = param:split(',') if not params[2] then player:sendTextMessage(MESSAGE_INFO_DESCR, string.format('Player is required.\nUsage:\n%s <action>, <name>, [, <value>]\n\nAvailable actions:\ncheck, adddays, addinfinite, removedays, remove', words)) return false end local targetName = params[2]:trim() local target = Player(targetName) if not target then player:sendCancelMessage(string.format('Player (%s) is not online. Usage: %s <action>, <player> [, <value>]', targetName, words)) return false end local action = params[1]:trim():lower() if action == 'adddays' then local amount = tonumber(params[3]) if not amount then player:sendCancelMessage('<value> has to be a numeric value.') return false end target:addVipDays(amount) player:sendCancelMessage(string.format('%s received %s vip day(s) and now has %s vip day(s).', target:getName(), amount, target:getVipDays())) elseif action == 'removedays' then local amount = tonumber(params[3]) if not amount then player:sendCancelMessage('<value> has to be a numeric value.') return false end target:removeVipDays(amount) player:sendCancelMessage(string.format('%s lost %s vip day(s) and now has %s vip day(s).', target:getName(), amount, target:getVipDays())) elseif action == 'addinfinite' then target:addInfiniteVip() player:sendCancelMessage(string.format('%s now has infinite vip time.', target:getName())) elseif action == 'remove' then target:removeVip() player:sendCancelMessage(string.format('You removed all vip days from %s.', target:getName())) elseif action == 'check' then local days = target:getVipDays() player:sendCancelMessage(string.format('%s has %s vip day(s).', target:getName(), (days == 0xFFFF and 'infinite' or days))) else player:sendTextMessage(MESSAGE_INFO_DESCR, string.format('Action is required.\nUsage:\n%s <action>, <name>, [, <value>]\n\nAvailable actions:\ncheck, adddays, addinfinite, removedays, remove', words)) end return false end Créditos... Printer Summ Eu
  23. Boa Tarde Turma, Hoje vou Postar um sistema de Win e Lose Score daquele teleport (TEAM-PVP). Agora vai ficar mais divertido o sistema de PVP do (Pokemon dash advanced) Premio: Ganha 5 hd + 5% exp + Score Placar: adicionei um sistema de placar tambem onde aparece: Redfrag (2) vs (4) BlueFrag Servidor Usado: Pokemon Dash Advanced (Pokemon com Level) Bom vamos La: Atençao: tome cuidado ao editar esse script e facil de buga o sistema inteiro do pvp team intao vamos la: vai no seu exp.lua creaturescripts/exp.lua: add isso no começo do script: procure por : if valor >= getCreatureHealth(cid) then Logo abaixo adiciona isso: Se quiserem por no Look tambem eu deixei mais legal ! Troca seu look.lua por esse :
  24. Boa noite Galera Passei a noite passando esse sistema de MOD para Arquivos Separados, Achei alguem erros de cid,pid, varieveis e os concertei. Vamos la: Testado 59x TFS : 0.4 rev 3777 Refazendo o Tutorial *.* Na Pasta LIB Caminha: /data/lib/ Crie um arquivo.lua chamado RushLib.lua e Adicione : Nesse Arquivo Estão as Configurações Apenas Leia os Comentarios inseridos nele. --data/lib function doPlayerRemoveLethalConditions(cid) local tmp = {1, 2, 4, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 32768, 65536} for i = 1, #tmp do if(hasCondition(cid, tmp)) then doRemoveCondition(cid, tmp) end end return true end t = { a = 32145, -- nao modifique se nao souber oq esta fazendo g = 32146, -- nao modifique se nao souber oq esta fazendo l = 32147, -- nao modifique se nao souber oq esta fazendo u = 32148, -- nao modifique se nao souber oq esta fazendo h = 32149, -- nao modifique se nao souber oq esta fazendo wv = 32150, -- nao modifique se nao souber oq esta fazendo c = 0, -- nao modifique se nao souber oq esta fazendo q = "Rush Event has been started! Enjoy and have fun!", --mensagem que vai ser exibida quando o evento começar f = 5447, -- nao modifique se nao souber oq esta fazendo f_1 = 5448, -- nao modifique se nao souber oq esta fazendo f_2 = 5449, -- nao modifique se nao souber oq esta fazendo d_1 = {x = 986, y = 1116, z = 6}, -- posição do tempo vermelho ao começar evento d_2 = {x = 986, y = 1116, z = 6}, -- posição do tempo azul ao começar evento x = "Event won't start bacause too few people were willing to participate", --mensagem que vai ser exibida quando o evento não começar w = {x = 986, y = 1114, z = 7}, --posição da sala de espera, onde os players vão ficar antes de começar lvl = 100, --level minimo para participar do evento v = 25, --a quantidade de frags que será necessária para o time ganhar mn = 4, --quantidade minima de players para começar o evento m = 40, --maximo de players dentro do evento o = "Event was completed, RED TEAM has won Rush Event!", --mensagem exibida quando o time vermelho ganhar y = "Event was completed, BLUE TEAM has won Rush Event!", --mensagem exibida quando o time azul ganhar i_1 = 2160, --id do premio (agora é crystal coin = 2160) i_2 = 10, --quantidade do premio (agora esta 10 crystal coins) t = 5, --tempo para começar o evento (agora esta is 5 minutos) r = 1 --tempo em que os resultados da batalha serão mostrados aos players (agora esta 1 minutos) } Em Creaturescripts/ No Arquivo CreatureScripts.xml Adicione as Tags <event type="combat" name="RushCombat" event="script" value="RushCreature.lua"/> <event type="attack" name="RushAttack" event="script" value="RushCreature.lua"/> <event type="preparedeath" name="RushDead" event="script" value="RushCreature.lua"/> <event type="outfit" name="RushOutfit" event="script" value="RushCreature.lua"/> Em CreatureScripts/Scripts Crie um Arquivo.lua e renomeie para RushCreature.lua e Adicione: --creature/scripts/login.lua --registerCreatureEvent(cid, "RushCombat") --registerCreatureEvent(cid, "RushAttack") --registerCreatureEvent(cid, "RushDead") --registerCreatureEvent(cid, "RushOutfit") --creaturescripts/creature.xml --<event type="combat" name="RushCombat" event="script" value="RushCreature.lua"/> --<event type="attack" name="RushAttack" event="script" value="RushCreature.lua"/> --<event type="preparedeath" name="RushDead" event="script" value="RushCreature.lua"/> --<event type="outfit" name="RushOutfit" event="script" value="RushCreature.lua"/> function onCombat(cid, target) if(getGlobalStorageValue(t.a) == 1) then if isPlayer(cid) and isPlayer(target) then if getPlayerStorageValue(cid, t.f) == 1 and getPlayerStorageValue(target, t.f) == 1 then if getPlayerStorageValue(cid, t.f_1) == getPlayerStorageValue(target, t.f_1) then return doPlayerSendCancel(cid, "Sorry, you cannot attack your own team.") and false end end end end return true end function onOutfit(cid, old, current) if(getGlobalStorageValue(t.a) == 1) then if getPlayerGroupId(cid) > 3 then return true end if getPlayerStorageValue(cid, t.h) == 0 then if getPlayerStorageValue(cid, t.f) > -1 then doPlayerSendCancel(cid, "You cannot change your outfit during the event.") return false end end end return true end function onAttack(cid, target) if(getGlobalStorageValue(t.a) == 1) then if isPlayer(cid) and isPlayer(target) then if getPlayerStorageValue(cid, t.f) == 1 and getPlayerStorageValue(target, t.f) == 1 then if getPlayerStorageValue(cid, t.f_1) == getPlayerStorageValue(target, t.f_1) then return doPlayerSendCancel(cid, "Sorry, you cannot attack your own team.") and false end end end end return true end function onPrepareDeath(cid, deathList) if(not isPlayer(cid)) then return true end if getGlobalStorageValue(t.a) == 1 then local strings = {""} local j, position, corpse = 1, 1, 0 for _, pid in ipairs(deathList) do if isCreature(pid) == true then strings[position] = j == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .. getCreatureName(pid) .. "" j = j + 1 else strings[position] = j == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .."a field item" j = j + 1 end end for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end desc = "You recognize " desc = desc .. "" .. getCreatureName(cid) .. ". He was killed by " .. str end if(getPlayerSex(cid) == 1) then corpse = doCreateItem(3058, getCreaturePosition(cid)) else corpse = doCreateItem(3065, getCreaturePosition(cid)) end doItemSetAttribute(corpse, "description", desc) if((getPlayerStorageValue(cid, t.g) % 2) == 1) then setGlobalStorageValue(t.u, getGlobalStorageValue(t.u)+1) else setGlobalStorageValue(t.l, getGlobalStorageValue(t.l)+1) end local red = getGlobalStorageValue(t.l) local blue = getGlobalStorageValue(t.u) if blue < t.v or red < t.v then if(isPlayer(cid) == false) then return true end if((getPlayerStorageValue(cid, t.g) % 2) == 1) then doTeleportThing(cid, t.d_1) doSendMagicEffect(getCreaturePosition(cid), 10) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doPlayerRemoveLethalConditions(cid) if getCreatureSkullType(cid) == SKULL_WHITE then doCreatureSetSkullType(cid, 0) end else doTeleportThing(cid, t.d_2) doSendMagicEffect(getCreaturePosition(cid), 10) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doPlayerRemoveLethalConditions(cid) if getCreatureSkullType(cid) == SKULL_WHITE then doCreatureSetSkullType(cid, 0) end end end if blue >= t.v then doBroadcastMessage(t.y, MESSAGE_STATUS_WARNING) setGlobalStorageValue(t.h, 1) for _, pid in ipairs(getPlayersOnline()) do if(getPlayerStorageValue(pid, t.f_1) == 1) then doPlayerAddItem(pid, i_1, i_2) end end elseif red >= t.v then doBroadcastMessage(t.o, MESSAGE_STATUS_WARNING) setGlobalStorageValue(t.h, 1) for _, pid in ipairs(getPlayersOnline()) do if(getPlayerStorageValue(pid, t.f_2) == 1) then doPlayerAddItem(pid, i_1, i_2) end end end if getGlobalStorageValue(t.h) == 1 then setGlobalStorageValue(t.a, 0) setGlobalStorageValue(t.h, 0) setGlobalStorageValue(t.wv, -1) setPlayerStorageValue(cid, t.f, -1) setPlayerStorageValue(cid, t.g, 0) setPlayerStorageValue(cid, t.l, 0) setPlayerStorageValue(cid, t.u, 0) setPlayerStorageValue(cid, t.f_1, -1) setPlayerStorageValue(cid, t.f_2, -1) setPlayerStorageValue(cid, t.h, -1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true) doSendMagicEffect(getCreaturePosition(cid), 10) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doPlayerRemoveLethalConditions(cid) for _, pid in ipairs(getPlayersOnline()) do if(getPlayerStorageValue(pid, t.f_1) == 1 or getPlayerStorageValue(pid, t.f_2) == 1) then setPlayerStorageValue(pid, t.f, -1) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) doSendMagicEffect(getCreaturePosition(pid), CONST_ME_TELEPORT) setPlayerStorageValue(pid, t.g, 0) setPlayerStorageValue(pid, t.l, 0) setPlayerStorageValue(pid, t.u, 0) setPlayerStorageValue(pid, t.f_1, -1) setPlayerStorageValue(pid, t.f_2, -1) setPlayerStorageValue(pid, t.h, -1) doCreatureAddHealth(pid, getCreatureMaxHealth(pid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true) doCreatureAddMana(pid, getCreatureMaxMana(pid)) doPlayerRemoveLethalConditions(pid) end end return false end return false end return true end Em CreatureScripts/Scripts/ Localize o Arquivo Chamado Login.lua abra-o e Adiciona antes do RETURN TRUE o seguinte : registerCreatureEvent(cid, "RushCombat") registerCreatureEvent(cid, "RushAttack") registerCreatureEvent(cid, "RushDead") registerCreatureEvent(cid, "RushOutfit") Em GlobalEvents/ Abra o Arquivo chamado GlobalEvents.xml e Adicione s Seguinte Tag : <globalevent name="Recognition" interval="1500" event="script" value="RushGlobalRecognition.lua"/> Em CreatureScripts/Scripts/ Crie um arquivo.lua chamado RushGlobalRecognition.lua e Adicione : --globalevents/globalevents.xml --<globalevent name="Recognition" interval="150000" event="script" value="RushGlobalRecognition.lua"/> function onThink(interval, lastExecution, thinkInterval) if(getGlobalStorageValue(t.a) == 1) then for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, t.f) == 1 then if(getPlayerStorageValue(pid, t.f_1) == 0) then doSendAnimatedText(getCreaturePosition(pid), "RED TEAM", TEXTCOLOR_RED) elseif(getPlayerStorageValue(pid, t.f_1) == 1) then doSendAnimatedText(getCreaturePosition(pid), "BLUE TEAM", TEXTCOLOR_LIGHTBLUE) end end end return true end return true end Em TalkActions/ Abra o TalkActions.xml e Adicione as Seguintes Tags: <talkaction words="!start" event="script" access="5" value="RushTalkOpen.lua"/> <talkaction words="!rush" event="script" value="RushTalkJoin.lua"/> Em TalkActions/Scripts/ Crie um arquivo.lua chamado RushTalkOpen e Adicione : --globalevents/globalevents.xml --<globalevent name="RushStart" time="15:53" event="script" value="RushGlobalOpen.lua"/> function onTime(interval, lastExecution) setGlobalStorageValue(t.g, 1) setGlobalStorageValue(t.u, 0) setGlobalStorageValue(t.l, 0) setGlobalStorageValue(t.a, 1) setGlobalStorageValue(t.c, 0) setGlobalStorageValue(t.wv, 0) doBroadcastMessage("Attention! Immediately register to Rush Event, event will start for ".. t.t .." minutes. All players can join to event typing this command: !rush", MESSAGE_STATUS_WARNING) addEvent(function() doBroadcastMessage("Rush event, started in 2 minutes. If you want to join, type this command: !rush", MESSAGE_STATUS_WARNING) end, (t.t - 2) * 1000 * 60) addEvent(function() doBroadcastMessage("Rush event, started in a minute. If you want to join, type this command: !rush", MESSAGE_STATUS_WARNING) end, (t.t - 1) * 1000 * 60) addEvent(start, t.t * 1000 * 60, cid) end function results() if(getGlobalStorageValue(t.a) == 1) then local red = getGlobalStorageValue(t.l) local blue = getGlobalStorageValue(t.u) doBroadcastMessage("Rush Events, results:\nRed Team scored: ".. red .." frags.\nBlue Team scored: ".. blue .." frags.\nMatch is under way to ".. t.v .." frags.", MESSAGE_STATUS_WARNING) addEvent(results, t.r * 1000 * 60) end end function start(cid) if(getGlobalStorageValue(t.a) == 1 and getGlobalStorageValue(t.c) >= t.mn) then doBroadcastMessage(t.q, MESSAGE_STATUS_WARNING) setGlobalStorageValue(t.wv, 1) addEvent(results, t.r * 1000 * 60) for _, pid in ipairs(getPlayersOnline()) do local myOutfit = getCreatureOutfit(pid) local red = {lookType = myOutfit.lookType, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94, lookTypeEx = 0, lookAddons = myOutfit.lookAddons} local blue = {lookType = myOutfit.lookType, lookHead = 86, lookBody = 86, lookLegs = 86, lookFeet = 86, lookTypeEx = 0, lookAddons = myOutfit.lookAddons} if getPlayerStorageValue(pid, t.f) == 1 then doCreatureAddHealth(pid, getCreatureMaxHealth(pid)) doCreatureAddMana(pid, getCreatureMaxMana(pid)) if((getPlayerStorageValue(pid, t.g) % 2) == 1) then doCreatureChangeOutfit(pid, red) setPlayerStorageValue(pid, t.h, 0) doTeleportThing(pid, t.d_1) setPlayerStorageValue(pid, t.f, 1) setPlayerStorageValue(pid, t.f_1, 0) setPlayerStorageValue(pid, t.f_2, 1) doSendMagicEffect(getCreaturePosition(pid), 10) doPlayerSendTextMessage(pid, MESSAGE_EVENT_ADVANCE, "You are in RED TEAM!\nThis battle will continue up to ".. t.v .." frags!") else doCreatureChangeOutfit(pid, blue) setPlayerStorageValue(pid, t.h, 0) doTeleportThing(pid, t.d_2) setPlayerStorageValue(pid, t.f, 1) setPlayerStorageValue(pid, t.f_1, 1) setPlayerStorageValue(pid, t.f_2, 0) doSendMagicEffect(getCreaturePosition(pid), 10) doPlayerSendTextMessage(pid, MESSAGE_EVENT_ADVANCE, "You are in BLUE TEAM!\nThis battle will continue up to ".. t.v .." frags!") end end end elseif(getGlobalStorageValue(t.c) < t.mn) then doBroadcastMessage(t.x, MESSAGE_STATUS_WARNING) setGlobalStorageValue(t.a, 0) for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, t.f) == 1 then setPlayerStorageValue(pid, t.f, -1) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) doSendMagicEffect(getCreaturePosition(pid), CONST_ME_TELEPORT) end end end end Em TalkActions/Scripts/ Crie um arquivo.lua chamado RushTalkJoin.lua e adicione : --talkactions/talkactions.xml --<talkaction words="!rush" event="script" value="RushTalkJoin.lua"/> function onSay(cid, words, param, channel) if getGlobalStorageValue(t.a) == 1 and getGlobalStorageValue(t.wv) ~= 1 then if getPlayerLevel(cid) >= t.lvl then if getPlayerStorageValue(cid, t.f) == -1 then if getTilePzInfo(getPlayerPosition(cid)) == true then if getGlobalStorageValue(t.c) < t.m then setGlobalStorageValue(t.c, getGlobalStorageValue(t.c)+1) if getGlobalStorageValue(t.c) == t.m then doPlayerSendCancel(cid, "Event is full [" .. getGlobalStorageValue(t.c) .. " players]!") else doBroadcastMessage("" .. getPlayerName(cid) .. " has joined to Rush Event! Actually we have: " .. getGlobalStorageValue(t.c) .. " players!", 19) end setPlayerStorageValue(cid, t.f, 1) setPlayerStorageValue(cid, t.h, -1) doTeleportThing(cid, t.w) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) setPlayerStorageValue(cid, t.g, getGlobalStorageValue(t.g)) setGlobalStorageValue(t.g, tonumber(getGlobalStorageValue(t.g))+1) else doPlayerSendCancel(cid, "Event is full [" .. getGlobalStorageValue(t.c) .. " players]!") return true end else doPlayerSendCancel(cid, "You must be in protection zone.") return true end else doPlayerSendCancel(cid, "You are already registered in this event.") return true end else doPlayerSendCancel(cid, "Your level is too low to participate in this event.") return true end else doPlayerSendCancel(cid, "At the moment there are no records for this event.") return true end return true end Prontinho sistema Instalado ! Apenas Configure as Variaveis no Arquivo Rushlib.lua, o primeiro do Tutorial. Comando para Abrir o Evento !start Comando para Participar do Evento !rush OBSERVAÇÃO: NUNCA FECHAR O SERVIDOR COM O EVENTO ABERTO, SEMPRE ESPERE O EVENTO FINALIZAR CASO FAZER ISSO BUGARÁ AS STORAGES. Creditos ? Eu Achei em outro Forum e o Mod estava falando que era do ChaitoSoft não tenho Certeza mais Segue. ChaitoSoft ( Provavelmente Roksas) Emerson = 40% - Pois eu Achei Alguns Bugs e Removi e Por Ter Feitos em Varios Arquivos. MAP: https://www.mediafire.com/?cxoqqth3s9heqzx SCAN: https://www.virustotal.com/en/file/279eee03261c0d329177ee5ad54e3a746da366fd5a3da491daeaf3204f6e3315/analysis/1405238306/ Map.rar
  25. gabisa00 postou uma resposta no tópico em Scripts tfs 0.4 (OLD)
    Absorb Mana Arm Informações: Arma que absorve mana do seu adversário. Descrição: A arma usada no sistema irá remover a mana do adversário e ira adicionar em si, não tirando vida do adversário. Instalação Vá em data/creaturescripts/scripts e cria um arquivo chamado manabsorve.lua, dentro dele coloque. Logo em seguida vá até data/creaturescripts abra o arquivo creaturescripts.xml e adicione essa tag. Agora vá em data/creaturescripts/scripts e abra o arquivo login.lua e adicione essa tag. Créditos Pelo Script: 100% - Gabisa00 Créditos Pela Idéia: 100% - Brunds Dúvidas, bugs, sugestões, somente no tópico. Gostou do Sistema Faça Seu Pedido Aqui!

Informação Importante

Confirmação de Termo