Ir para conteúdo

(Resolvido)-=[TFS]=- 0.4 8.60 Quando player usa magia em area ou mata um player com sword wand rod etc servidor trava volta trava e volta trava no jogo depois volta eu não sei o que é isso

Featured Replies

Postado
  • Diretor
  • Solução
local LVL_CRIT_STORAGE = 48904
local MULTIPLIER = 1.001

function onStatsChange(cid, attacker, type, combat, value)
    if type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS then
        if isPlayer(attacker) and isCreature(cid) then
            local playerLvlCrit = getPlayerStorageValue(attacker, LVL_CRIT_STORAGE)
            local critThreshold = playerLvlCrit * 3
            local randomValue = math.random(0, 1000)

            if critThreshold >= randomValue then
                local boostedDamage = math.ceil(value * (MULTIPLIER - 1)) -- Subtrair 1 para obter o valor percentual
                doTargetCombatHealth(attacker, cid, combat, -boostedDamage, -boostedDamage, boostedDamage)
                
                -- Verifique se o atacante é uma criatura antes de obter sua posição
                if isCreature(attacker) then
                    doSendAnimatedText(getCreaturePos(attacker), "+BOOSTER", 1000)
                end
                
                return false
            end
        end
    end
    return true
end

 

  • Respostas 11
  • Visualizações 305
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local LVL_CRIT_STORAGE = 48904 local MULTIPLIER = 1.001 function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS then i

  • ok vo testa pra encerra essa conversa vo te da rep + obrigado

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

Informação Importante

Confirmação de Termo