Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Bom meu servidor tem esse script de critical

Eu queria que poder fazer algo parecido nesse estilo que vi e deixarei link abaixo.

Quero um critical por armas e vocações diferente.

Exmplo.

Axe que da mais dano,

club que da dano em area,

sword que da emorragia,

crossbow que da 3 hit seguindos

fist que da um slow

e uma magia que só usa se tiver certa arma se tiver na mao

local tabelachance={    -- Aqui e a chance que cada voc tem, por exemplo a voc numero 4 tem 6% de chance de dar critical.
[4]=5,
[8]=5,
[12]=10,
[16]=15,
}

function onAttack(cid,target)
    local weapon = getPlayerWeapon(cid)
    if weapon.uid == 0 then
        return true
    end
    local atk = getItemInfo(weapon.itemid).attack + getItemInfo(weapon.itemid).extraAttack
    if atk < 45 then
        return true
    end
    if getDistanceBetween(getCreaturePos(cid), getCreaturePos(target)) > 1 then
        return TRUE
    end
    
    if getPlayerStorageValue(cid, 3033) > os.time() then
       return true
    end
    setPlayerStorageValue(cid, 3033, os.time())
    setPlayerStorageValue(cid, 2829, getPlayerStorageValue(cid, 2829)+1)
    if getPlayerStorageValue(cid, 2829) == 25 then
       setPlayerStorageValue(cid, 3030, os.time())
    elseif getPlayerStorageValue(cid, 2829) == 50 then
       setPlayerStorageValue(cid, 3031, os.time())
    elseif getPlayerStorageValue(cid, 2829) >= 55 then
       setPlayerStorageValue(cid, 2829, 1)
    end
    local array = {
    "Primeira","Segunda","Terçeira"
    }
if getPlayerStorageValue(cid, 3030)+5 >= getPlayerStorageValue(cid, 3031) and getPlayerStorageValue(cid, 2829) > 50 then
   if getPlayerStorageValue(cid, 2829) == 54 then
      if getPlayerStorageValue(cid, 3032) < 1 then
         setPlayerStorageValue(cid, 3032, 1)
      else
         setPlayerStorageValue(cid, 3032, getPlayerStorageValue(cid, 3032)+1) 
      end
      doPlayerSendTextMessage(cid,22,"Programa ilegal detectado... "..array[getPlayerStorageValue(cid, 3032)].." penalidade registrada.")
      print("Programa ilegal detectado... "..array[getPlayerStorageValue(cid, 3032)].." penalidade registrada.("..getCreatureName(cid)..")")
      if getPlayerStorageValue(cid, 3032) == 3 then
         if getPlayerStorageValue(cid, 3033) < 1 then
            setPlayerStorageValue(cid, 3033, 1)
            doPlayerSendTextMessage(cid,22,"Você está impossibilitado de dar Critical por 6 horas.")
            setPlayerStorageValue(cid, 3033, os.time()+6*60*60)
         elseif getPlayerStorageValue(cid, 3033) == 1 then
            setPlayerStorageValue(cid, 3033, 2)
            doPlayerSendTextMessage(cid,22,"Você está impossibilitado de dar Critical por 24 horas.")
            setPlayerStorageValue(cid, 3033, os.time()+24*60*60) 
         elseif getPlayerStorageValue(cid, 3033) == 2 then
            setPlayerStorageValue(cid, 3033, 3)
            doPlayerSendTextMessage(cid,22,"Você está impossibilitado de dar Critical por 24 horas.")
            setPlayerStorageValue(cid, 3033, os.time()+24*60*60)
         else
             setPlayerStorageValue(cid, 3033, 3)
             doPlayerSendTextMessage(cid,22,"Você está impossibilitado de dar Critical por 24 horas.")
             setPlayerStorageValue(cid, 3033, os.time()+24*60*60)     
         end
         setPlayerStorageValue(cid, 3032, 0)   
      end      
   end 
return true
end

local textos = {         -- Textos que aparecerao para quando for executado o critical.
[1] = 'Feel My Power!',
[2] = 'For Honor!',
[3] = 'This Safe, Dammit!',
[4] = 'Fell my fury',
}
local healing = {   --o healing que o critical pode dar, 10%..10% etc.
[1] = 0.10,
[2] = 0.15,
[3] = 0.20,
}
    local skill = getPlayerSkillLevel(cid, getPlayerWeaponSkill(cid))
    local level = getPlayerLevel(cid)
    
    --Formula para se basear no dano--
    local formula1 = level*atk*skill   --formula 1
    local formula2 = formula1/150      --formula 2
    local formula = math.floor(formula2/6+math.random(10, 50)) --formula final, o player hitará isso
    local text = "Critical!"    --texto animado
    local text_color = math.random(1, 255)
    local effect = 31   --efeito que vai dar no alvo.
    local rand1 = math.random(1,100)
    local vid = getPlayerVocation(cid)
    
    if tabelachance[vid] and rand1 <= tabelachance[vid] then
        doSendAnimatedText(getCreaturePosition(cid), text, text_color)
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid)*healing[math.random(1,#healing)])
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "você curou "..getCreatureMaxHealth(cid)*healing[math.random(1,#healing)].." de vida com esse critical.")
        doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, (-formula), (-formula), effect)
        doPlayerSay(cid, textos[math.random(1,#textos)], TALKTYPE_ORANGE_1)
		doSendMagicEffect(getCreaturePosition(cid), 73)
    end
    return true
end
Postado

Este tópico foi movido para a área correta. Esta é uma mensagem automática!
Pedimos que leia as regras do fórum!

Spoiler

This topic has been moved to the correct area. This is an automated message!
Please read the forum rules.

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo