GA
pedido

Critical skill system..

Por Gadreel, 20 de abr. de 2015 em Archived

script
6
1.5k
GadreelG
20 de abril de 2015 às 16:04
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.

GadreelG
25 de abril de 2015 às 17:49

@UP

zipter98Z
25 de abril de 2015 às 18:55

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 Abril 25 por zipter98

XtudomuitoX
26 de abril de 2015 às 09:44

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 Abril 26 por Xtudomuito

GadreelG
26 de abril de 2015 às 14:11

 

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 Abril 27 por Gadreel

3 meses depois...
BrunoB
14 de julho de 2015 às 17:38

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.