Ir para conteúdo
  • Cadastre-se

TFS 0.3.6 {Ajuda} Adicionar atributos ao script


Posts Recomendados

Olá!

 

Tenho um script de gemas do foxwolrd em mãos, mas quero acrescentar dois atributos... Queria que quando o player tivesse a storage da gema, ele ganhasse o atributo de regeneração de mana e life. Tipo, dar use na gema e ganhar o atributo de regeneração de 500 de mana e 1000 de sangue por segundo! Eu tentei fazer mas não consegui...

 

Script:

actions:

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerGroupId(cid) > 2 and getPlayerGroupId(cid) < 5 then return true end

  local voc = getPlayerVocation(cid)
  if getPlayerPromotionLevel(cid) > 0 then
     voc = voc - (getPlayerPromotionLevel(cid) * 4)
  end
  gem = gems.id[voc]

  if item.itemid == gem then

          if getPlayerLevel(cid) < 200 then
          doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"É necessário level 200 ou maior para absorver uma gema espiritual!")
          else

                if getPlayerPromotionLevel(cid) > 0 then

                      if getPlayerStorageValue(cid,21203) == -1 then
                      setPlayerStorageValue(cid,21203,1)
                      doUseGem(cid, item)
                      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Você absorveu uma gema espiritual!")
                      doSendMagicEffect(getPlayerPosition(cid),65)
                      else
                      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Você ainda possui uma gema espiritual absorvida.")
                      end

                else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Você precisa estar promovido para usar a gema.")
                end
 
          end

  else
  return false
  end
  return true
  end 

actions.xml:

    <action itemid="2154" script="other/gemas.lua" />
    <action itemid="2155" script="other/gemas.lua" />
    <action itemid="2156" script="other/gemas.lua" />
    <action itemid="2158" script="other/gemas.lua" /> 

 

lib/047-gems.lua (criar)

 

gems = {
id = {2156, 2154, 2158, 2155, 2156, 2154, 2158, 2155},
storage = {5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012},
interval = {600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600}
}

gemMsg = {
rnd = {"'´ .    ,", ".    '´ ,", "`  .  ,", ",    '´ ."},
colorSorcerer = {180,180},
colorDruid = {30,30},
colorPaladin = {251,10},
colorKnight = {204,212},
colorMasterSorcerer = {180,180},
colorElderDruid  = {30,30},
colorRoyalPaladin = {251,10},
colorEliteKnight = {204,212}
}

function doUseGem(cid, item)

  local level = getPlayerLevel(cid)
  local voc = getPlayerVocation(cid)
  local interval = gems.interval[voc]

  if getPlayerPromotionLevel(cid) > 0 then
    voc = voc - (getPlayerPromotionLevel(cid) * 4)
  end

  if item.itemid ~= gems.id[voc] or getPlayerStorageValue(cid, gems.storage[voc]) > 0 then
    return false
  end

  setPlayerStorageValue(cid, gems.storage[voc], 1)
  sendGemEffect(cid, gems.storage[voc], gems.interval[voc])
  doRemoveItem(item.uid, 1)

  return true 
end

function sendGemEffect(cid, storage, interval)

if isPlayer(cid) then

  local pos = getThingPos(cid)
  local voc = getPlayerVocation(cid)
  local level = getPlayerLevel(cid)
  local color = 1

  if level > 199 then

  if getPlayerPromotionLevel(cid) > 0 then
    voc = voc - (getPlayerPromotionLevel(cid) * 4)
  end
          if voc == 1 then
            color = gemMsg.colorDruid[math.random(1,#gemMsg.colorElderDruid)]
          elseif voc == 2 then
            color = gemMsg.colorSorcerer[math.random(1,#gemMsg.colorMasterSorcerer)]
          elseif voc == 3 then
            color = gemMsg.colorPaladin[math.random(1,#gemMsg.colorRoyalPaladin)]
          elseif voc == 4 then
            color = gemMsg.colorKnight[math.random(1,#gemMsg.colorEliteKnight)]
          end

  doSendAnimatedText(pos, gemMsg.rnd[math.random(1,#gemMsg.rnd)], color)
    if getPlayerStorageValue(cid, gems.storage[voc]) >= 1 then 
      addEvent(sendGemEffect, interval, cid, storage, interval)
    end

else
stopEvent(sendGemEffect(cid, storage, interval))
end

end

function doRemoveAllGemEffect(cid)
  for i = 1, table.maxn(gms.storage) do
    setPlayerStorageValue(cid, gems.storage[i], 0)
  end
  return true
end

function isGemActivated(cid)

  local voc = getPlayerVocation(cid)

  if getPlayerPromotionLevel(cid) > 0 then
    voc = voc - (getPlayerPromotionLevel(cid) * 4)
  end

  if getPlayerStorageValue(cid, gems.storage[voc]) > 0 then
    return true
  end
  return false
end

  return true
end 

 

login.lua

 

   if getPlayerStorageValue(cid, 21203) > 0 then
            local voc = getPlayerVocation(cid)
            if getPlayerPromotionLevel(cid) > 0 then
              voc = voc - (getPlayerPromotionLevel(cid) * 4)
            end
            if getPlayerStorageValue(cid, gems.storage[voc]) > 0 then
                  sendGemEffect(cid, gems.storage[voc], gems.interval[voc])
            end   
      end

 

Se alguém puder ajudar!


@up

Editado por NathanAmaro (veja o histórico de edições)

Oi

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por hekan19
      Olá pessoal,
       
      Estou com um problema no sistema de autoloot.
      Ao abrir um Pokémon, itens aparecem no chão. Recebo "0" no console do TFS.
       
      Obrigado pela ajuda
    • Por wallaceg15
      Sempre que mato o poke, cai um corpinho e o pokemon continua vivo, e aparece esse erro na distro... Alguém poderia me ajudar? 
       
      [Error - CreatureScript Interface]
      data/creaturescripts/scripts/player/statsChange.lua:onStatsChange
      Description:
      data/lib/towerSystem.lua:931: attempt to index global 'magmaTP2' (a nil value)
      stack traceback:
              data/lib/towerSystem.lua:931: in function 'doKillBossTower'
              data/lib/Death System.lua:599: in function 'doKillWildPoke'
              data/creaturescripts/scripts/player/statsChange.lua:1461: in function <data/creaturescripts/scripts/player/statsChange.lua:6>
      statsChange.lua towerSystem.lua Death System.lua
    • Por NathanAmaro
      Olá!
       
      Estou precisando de algum script, ou algum jeito de quando o player comprar premium account (isPremium) ele receber a promotion junto.
      A premium é fornecida por um npc, então eu quero que quando o jogador compre a premium account a promotion venha junto. Sendo assim:
       
      Um knight vire um Elite knight 
      Um druid vire um Elder druid
      Um sorcerer vire um Master sorcerer
      um paladin vire um Royal paladin
       
      Script do npc:
       



       
      Agradeço a atenção!   
    • Por GamerGoiano
      Me mandaram esse servidor e eu decidi deixar ele jogável porque muita gente tinha dificuldade em deixar online.
      Como deixar online:
      Basta criar um banco de dados com o xampp (use o xampp mais recente), com o nome poketibia e do lado onde está utf, escolhe Agrupamento (Colation) após isso é só importar o banco de dados que ta junto com o servidor.
      Ai é só abrir o servidor, esperar carregar e depois abrir o cliente e logar 
      Conta god: GOD / 123456
      Download: https://www.mediafire.com/file/3atv44omlf3f036/PokeAimar.rar/file
      Vem com Sources e SPR+Dat Editável
      Scan: https://www.virustotal.com/gui/file/828a6e443c29221b9cd46f3fffe5f65c63bbb8e8ffc109a4fc91554d9c10e752/detection
      Créditos: Kaboflow, PDA, Psoul, Pstorm, Gengo, TFS Team, Cipsoft, DxP, PokemasterX.
      É um mistão de scripts do fórum + scripts próprios, acima listados os responsáveis pela criação do datapack e servidor.
      Descrição:
      Level System 100%
      1ª e 2ª geração completos
      Kanto e Ilhas Laranjas 100%
      Tv System 100%
      (Techinical Machine) Ensinar Moves pros Pokes 100%
      Daycare e Egg System 100%
      Duel System (PVP) 100%
      Gym System 100%
      Berries (Plantar, Colher e Usar) 100%
      Fly, Surf, Ride, Dive e Headbutt 100%
      Mastery System (Especializar em Elemento) 100%
      Tournament System 100%
      Saffari Zone 100%
      Poke Balls Effects 100%
      Pokemons na Character List 100%
      Poke Bar 100%
      Atravessar seu pokemon 100%
      Relógio In-Game 100%
      New Pokedex 100%
       



       
    • Por L3K0T
      L3K0TTFS 04 e TFS 0.3.6
      Olá galera, hoje vim trazer um sistema chamado "First to Speak Summon" mais pera ai L3K0T, como funciona? Bom ele sumonar um monstro numa posição setada por sua preferencia, também verifica uma posxyz que você pode setar também e assim falar o comando "!fss"... mais pera ai L3K0T oque tem de diferente??? ... calma ... esse comando só pode ser pronunciado por 1 player somente, no caso se alguém falar o comando depois de você... não irá sumonar até que o tempo pra falar novamente acabe "configurado" e BORA PRO TUTORIAL???
       
       
      TUTORIAL;;
       
      1° vai na pasta Servidor\data\talkactions\scripts copia um arquivo.lua e renomeia para fss e dentro coloque;;
       
      local t = { sto = 565674, --Storage global; temp = 300, --Tempo para falar em milesimo 300 = 5 minutos // segundos o comando; monstro = "Demon", --Nome monstrinho que vá nascer; localmapa = {x=1569, y=214, z=7}, --Posição aonde o monstrinho vai nascer; pisomapa = {x=1565, y=215, z=7}, --Posição aonde o player precisa estar para falar o comando de sua preferencia; msgsucesso = "monstro foi criado!!!", --Mensagem que manda ao player ao criar o monstrinho; msgsono = "Demon Está dormindo zzzZZZ", --Mensagem ao tentar usar o comando com intervalo de espera do comando; msgnull = "Está acordado corra lá", --Mensagem quando o monstro acordar } function onSay(cid, words, param, channel) local tp = getThingPos(cid) --verficação --inicio if tp.x == t.pisomapa.x and tp.y == t.pisomapa.y and tp.z == t.pisomapa.z then --verificação if getPlayerStorageValue(cid, t.sto) > os.time() then --verificação tempo doPlayerSendTextMessage(cid, 27, t.msgsono) return true end for _, cid in ipairs(getPlayersOnline()) do --verificação players global setPlayerStorageValue(cid, t.sto, os.time() + t.temp) --seta storage end doCreateMonster(t.monstro, t.localmapa) doPlayerSendTextMessage(cid, 27, t.msgsucesso) else --fora do tile if getPlayerStorageValue(cid, t.sto) > os.time() then --verificação tempo doPlayerSendTextMessage(cid, 27, t.msgsono) return true end if getPlayerStorageValue(cid, t.sto) < os.time() then --verificação tempo doPlayerSendTextMessage(cid, 27, t.msgnull) return true end end --fim script BY L3K0T return true end tag xml;;
       
      <talkaction words="!fss" event="script" value="fss.lua"/> feito isso salva tudinho e use da melhor forma que achar.
       
      Video;;
       
       
      Créditos: @L3K0T
       
       
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo