Ir para conteúdo

Critical skill system..


Gadreel

Posts Recomendados

CRITICAL SYSTEM

Critical System: O sistema consiste em

Hitar 50% a mais em seus ataques.


Por Exemplo:

Com 10 de critical, voce vai hitar 50% de dano de 3 entre 100 ataques desferidos ao seu oponente

Com 100 de critical (o maximo) voce vai hitar 50% de dano de 30 entre 100 ataques desferidos ao oponente

Cada pedra que voce usar, sua skill de critical aumenta em 1 ponto

Podendo no maximo ter 100 pontos

---------------------------------------------------------------------------------------------------

Só pra consta já vi um script desse mesmo system em um outro fórum só que não me agradou muito é também o "critical" não funciona em "monster" só em players por isso vim aqui fazer um pedido vai que algum "script" com mais experiencia consiga me ajuda com esse pedido.

Link para o comentário
Compartilhar em outros sites

Action:

local config = {
    maxSkill = 100,         --Nível máximo de critical.
    pointPerItem = 1,       --Quantos pontos em critical irá ganhar por item.
    storage = 9571,
}
function onUse(cid, item)
    if getPlayerStorageValue(cid, config.storage) >= config.maxSkill then
        return doPlayerSendCancel(cid, "You already reached the maximum critical level. ["..config.maxSkill.."]")
    end
    setPlayerStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage) > -1 and getPlayerStorageValue(cid, config.storage) + 1 or 1)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You received: "..config.pointPerItem.." point(s) on critical skill.\nPoints: ["..getPlayerStorageValue(cid, config.storage).."/"..config.maxSkill.."]")
    doRemoveItem(item.uid, 1)
    return true
end
Creaturescript:
local config = {
    chancePerLevel = 3,         --Chance, por nível, de acerto crítico.
    extraDamage = 50,           --Bônus extra, em porcentagem, de dano.
    storage = 9571,
}
function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(attacker) and getPlayerStorageValue(attacker, config.storage) > -1 and type == STATSCHANGE_HEALTHLOSS then
        if math.random(config.chancePerLevel, config.chancePerLevel * 100) <= config.chancePerLevel * getPlayerStorageValue(attacker, config.storage) then
            value = math.floor(value * config.extraDamage / 100)
            doSendAnimatedText(getThingPos(cid), "CRITICAL!", 255)
        end
    end
    return true
end
Não se esqueça de registrar o evento em login.lua.
Editado por zipter98
Link para o comentário
Compartilhar em outros sites

Como add no action.xml? Server pra todas as armas do jogo. Pq eu só queria pra armar de físico que só ataca de perto e distance menos wand.

Editado por Xtudomuito
Link para o comentário
Compartilhar em outros sites

 

Action:

local config = {
    maxSkill = 100,         --Nível máximo de critical.
    pointPerItem = 1,       --Quantos pontos em critical irá ganhar por item.
    storage = 9571,
}
function onUse(cid, item)
    if getPlayerStorageValue(cid, config.storage) >= config.maxSkill then
        return doPlayerSendCancel(cid, "You already reached the maximum critical level. ["..config.maxSkill.."]")
    end
    setPlayerStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage) > -1 and getPlayerStorageValue(cid, config.storage) + 1 or 1)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You received: "..config.pointPerItem.." point(s) on critical skill.\nPoints: ["..getPlayerStorageValue(cid, config.storage).."/"..config.maxSkill.."]")
    doRemoveItem(item.uid, 1)
    return true
end
Creaturescript:
local config = {
    chancePerLevel = 3,         --Chance, por nível, de acerto crítico.
    extraDamage = 50,           --Bônus extra, em porcentagem, de dano.
    storage = 9571,
}
function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(attacker) and getPlayerStorageValue(attacker, config.storage) > -1 and type == STATSCHANGE_HEALTHLOSS then
        if math.random(config.chancePerLevel, config.chancePerLevel * 100) <= config.chancePerLevel * getPlayerStorageValue(attacker, config.storage) then
            value = math.floor(value * config.extraDamage / 100)
            doSendAnimatedText(getThingPos(cid), "CRITICAL!", 255)
        end
    end
    return true
end
Não se esqueça de registrar o evento em login.lua.

 

 

zipter eu testei seu script aqui ele n deu nenhum erro no meu console as função funciona tudo certinho só que ele não tá hitando 50% a mais quando uso as critical parece não surtir efeito algum...

Editado por Gadreel
Link para o comentário
Compartilhar em outros sites

  • 2 months later...

O tópico foi fechado e movido para lixeira por estar inativo a mais de 10 dias. Caso seja preciso reabrir o mesmo, favor entrar em contato com a equipe.

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...