Vamos adicionar dano de ataque critico nos pokemons, esse system era baseado no meu Age System, assim quanto mais velho o pokemon maior era sua chance de critical, mas vou deixá-lo por padrão utilizando os systems do dash advance, então não é necessário instalar mais nada.
------------------------------------------------------------------------------------------------------------------------------------------
LIB:
------------------------------------------------------------------------------------------------------------------------------------------
. Abra
data\lib\level system.lua
. Adicine no inicio
function getPokemonCritical(cid)
return (getSpecialAttack(cid)+getOffense(cid)+(getSpeed(cid)*10))/100
end
. Abra
data\lib\pokemon moves.lua.lua
. Procure por
function docastspell(cid, spell, mina, maxa)
. Adicione abaixo
local highcritical = { -- Moves que tem mais chance de dar critical
"crabhammer",
"horn drill",
"guillotine",
"skill2",
}
. ficando assim
function docastspell(cid, spell, mina, maxa)
local highcritical = { -- Aqui voce deve adicionar os ataques que tem mais chance de dar CRITICAL
"crabhammer",
"horn drill",
"guillotine",
"skill2",
}
. Procure por
movetype = movetype * 0.6 + getOffense(cid) * 0.6
. Adicione abaixo
-- ADDED
local bonus = 1
local crt = getPokemonCritical(cid) * 10
if isInArray(highcritical, string.lower(spell)) then crt = crt*3 end
if crt >= math.random(1,1000) then
addEvent(doSendAnimatedText, 200, getThingPos(cid), "CRITICAL", 180)
bonus = 2
end -- ADDED
. ficando assim
if mina and maxa then
min = math.abs(mina)
max = math.abs(maxa)
elseif not isPlayer(cid) then
if movesinfo[spell] then
if movesinfo[spell].t == "fighting" then
movetype = getOffense(cid) * 1.4 + getSpecialAttack(cid) * 0.45
elseif movesinfo[spell].t == "normal" then
movetype = movetype * 0.6 + getOffense(cid) * 0.6
end
-- ADDED
local bonus = 1
local crt = getPokemonCritical(cid) * 10
if isInArray(highcritical, string.lower(spell)) then crt = crt*3 end
if crt >= math.random(1,1000) then
addEvent(doSendAnimatedText, 200, getThingPos(cid), "CRITICAL", 180)
bonus = 2
end -- ADDED
min = (5 + getPokemonLevel(cid) + (movesinfo[spell].f / 100 * movetype * specialoffenseRate))*bonus
max = (min + getPokemonLevel(cid) * levelFactor)*bonus
[...]
. Pra ver seu critical na dex, Vá em
data\lib\pokedex system.lua
. Procure por
if isSummon(item2.uid) then
local boff = getItemAttribute(myball.uid, "boffense") and " + "..math.floor(getItemAttribute(myball.uid, "boffense")).." trans. bonus" or ""
local bdef = getItemAttribute(myball.uid, "bdefense") and " + "..math.floor(getItemAttribute(myball.uid, "bdefense")).." trans. bonus" or ""
local bagi = getItemAttribute(myball.uid, "bagility") and " + "..math.floor(getItemAttribute(myball.uid, "bagility")).." trans. bonus" or ""
local bspa = getItemAttribute(myball.uid, "bsattack") and " + "..math.floor(getItemAttribute(myball.uid, "bsattack")).." trans. bonus" or ""
local bspd = getItemAttribute(myball.uid, "bsdefense") and " + "..math.floor(getItemAttribute(myball.uid, "bsdefense")).." trans. bonus" or ""
stt = stt.." • Vitality: "..doMathDecimal(getItemAttribute(myball.uid, "vitality")).."\n"
stt = stt.." • Strength: "..doMathDecimal(getItemAttribute(myball.uid, "offense"))..""..boff.."\n"
stt = stt.." • Defense: "..doMathDecimal(getItemAttribute(myball.uid, "defense"))..""..bdef.."\n"
stt = stt.." • Spc. Atk.: "..doMathDecimal(getItemAttribute(myball.uid, "specialattack"))..""..bspa.."\n"
stt = stt.." • Spc. Def.: "..doMathDecimal(getItemAttribute(myball.uid, "specialdefense"))..""..bspd.."\n"
stt = stt.." • Agility: "..doMathDecimal(getItemAttribute(myball.uid, "speed"))*10 ..""..bagi.."\n"
. Adicione embaixo
stt = stt.." • Critical: "..doMathDecimal(getPokemonCritical(item2.uid)).."%\n"
------------------------------------------------------------------------------------------------------------------------------------------
Tá Pronto! Prevejo muitas Dúvidas
------------------------------------------------------------------------------------------------------------------------------------------
Pra mais actions e scripts de pokemon dash veja minha assinatura!