Ir para conteúdo

Featured Replies

Postado
local porcentagem = 40 -- Porcentagem de dano que será BLO-QUE-A-DO
local pt_br = true

function onStatsChange(cid, attacker, type, combat, value)
    local lang = {"You lose %d hitpoints (damage protected by amulet: %d).", "Você perdeu %d pontos de vida (proteção do amuleto: %d)."}
    local reset = 9235
    if getPlayerSlotItem(cid, 2).itemid == 2218 and isPlayer(attacker) then
        if type == 1 or type == 3 then
            if getPlayerStorageValue(cid,reset) == 2 then
                setPlayerStorageValue(cid,reset,1)
                return true
            else
                local new_dmg = math.ceil((porcentagem/100)*value)
                setPlayerStorageValue(cid,reset,2)
                doTargetCombatHealth(attacker, cid, combat, -new_dmg, -new_dmg, 255)
                doPlayerSendCancel(cid,(pt_br and lang[2]:format(new_dmg, value-new_dmg) or lang[1]:format(new_dmg, value-new_dmg)))
                return false
            end
        end
    end
    return true
end
                              _
                          .-'` `}
                  _./)   /       }
                .'o   \ |       }
                '.___.'`.\    {`
                /`\_/  , `.    }                                      ME DA UMA NOZ!
                \=' .-'   _`\  {
                 `'`;/      `,  }
                    _\   @   ;  }
                   /__`;-...'--'

Cluck!

  • Respostas 10
  • Visualizações 595
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor

local porcentagem = 40 -- Porcentagem de dano que será BLO-QUE-A-DOlocal pt_br = truefunction onStatsChange(cid, attacker, type, combat, value)    local lang = {"You lose %d hitpoints (damage protected by amulet: %d).", "Você perdeu %d pontos de vida (proteção do amuleto: %d)."}    local reset = 9235    if getPlayerSlotItem(cid, 2).itemid == 2218 and isPlayer(attacker) then        if type == 1 or type == 3 then            if getPlayerStorageValue(cid,reset) == 2 then                setPlayerStorageValue(cid,reset,1)                return true            else                local new_dmg = math.ceil((porcentagem/100)*value)                setPlayerStorageValue(cid,reset,2)                doTargetCombatHealth(attacker, cid, combat, -new_dmg, -new_dmg, 255)                doPlayerSendCancel(cid,(pt_br and lang[2]:format(new_dmg, value-new_dmg) or lang[1]:format(new_dmg, value-new_dmg)))                return false            end        end    end    return trueend

Ainda não, agora o player hitou 66, daí disse que perdi 156 e protegeu 249, meio que bugou tudo agora, rs.

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

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