Ir para conteúdo

Líderes

Conteúdo Popular

Exibindo conteúdo com a maior reputação em 04/23/17 em todas áreas

  1. Crypter

    [0.3.6-0.4] Passive System

    Infos: Quando player perde vida a uma chance de ativar a passiva e encher entre 20 e 25% da vida maxima dele. Em data/creaturescripts/scripts Crie um arquivo chamado Passiva.lua function onStatsChange(cid, attacker, type, combat, value)local t = {storage = 189678, -- storage, so mude se tiver usando pra outra coisa.tempo = 120 --tempo em segundos }local hp = math.random(1,99) -- em porcentagemlocal lvl = 200 -- level para usar a passivalocal percent = math.floor((getCreatureHealth(cid)*100)/getCreatureMaxHealth(cid)) -- nao mechalocal enche = math.random(20,25)-- Enche entre 20 e 25 % de vidaif getPlayerStorageValue(cid, 498567) >= 1 then -- Storage para ativarif getPlayerStorageValue(cid, t.storage) < os.time() thenif type == STATSCHANGE_HEALTHLOSS and percent <= hp and getPlayerLevel(cid) >= lvl thendoCreatureAddHealth(cid, (enche*getCreatureMaxHealth(cid))/100)doSendAnimatedText(getCreaturePosition(cid), "+ "..enche.."% ", TEXTCOLOR_GREEN)setPlayerStorageValue(cid, t.storage, os.time() + t.tempo)doCreatureSay(cid, "PASSIVA!", 19)doPlayerSendTextMessage(cid, 25, "Passiva Ativada. \n Recarga: 2 minutos.")return trueendreturn trueendreturn trueendreturn trueend Em creaturescripts.xml adicione essa linha: event type="statschange" name="passiva" event="script" value="passiva.lua"/> Em data/creaturescripts/scripts: Abra o arquivo login.lua e adicione isso antes do ultimo : Return true registerCreatureEvent(cid, "passiva") ------------------------------------------------------------------------------------------------------------------------------------- Em data/talkactions/scripts Crie um arquivo chamado passiva.lua function onSay(cid, words, param) if(param == "") then doPlayerSendCancel(cid, 'Opcoes: On / Off') return trueend if(param == "on") thensetPlayerStorageValue(cid, 498567, 1)doPlayerSendTextMessage(cid, 25, "Voce ativou o modo passiva") endif(param == "off") thensetPlayerStorageValue(cid, 498567, 0)doPlayerSendTextMessage(cid, 25, "Voce desativou o modo passiva") end return trueend Em talkactions.xml <talkaction words="!passiva" hide="yes" event="script" value="passiva.lua"/> Se você gostou da Script da um REP+ e me segui! ( Sou Novo Aqui no xTibia )
    1 ponto
  2. maxPacketsPerSecond = 25 altere para 900
    1 ponto
  3. Baixe a tfs 1.2 , é 10.98 por padrão. https://github.com/otland/forgottenserver
    1 ponto
Líderes está configurado para São Paulo/GMT-03:00
×
×
  • Criar Novo...