Recomendado pra scripters com um pouco de experiência.
Essa é uma Função que adiciona Age (idade) em seus pokemons, ela faz com que seu pokemon comece com 0 anos e 0 meses e 'cresca' de acordo com o tempo, quanto mais velho ele aumenta seu dano critico. A função é minha, do Pokemon Fight V3, adptei-la para o Dash Advance, para adicioná-la corretamente é preciso alterar o catch, por isso pode ser bem chato pra quem não entende. Vamos lá.
------------------------------------------------------------------------------------------------------------------------------------------------
LIB:
------------------------------------------------------------------------------------------------------------------------------------------------
. Abra
data\lib\catch system.lua
. Procure por
local happy = 140
.adicione em baixo:
local day = os.date("%d") local year = os.date("%Y") local month = os.date("%m")
.ficando assim
local happy = 140
local day = os.date("%d")
local year = os.date("%Y")
local month = os.date("%m")
. Procure por
doItemSetAttribute(item, "description", description)
.adicione em baixo:
doItemSetAttribute(item, "pokeballinfo", "".. day .."/".. month .."/".. year .."/"..getCreatureName(cid).."") -- CATCH INFORMATION: dia/mes/ano/player
.ficando assim
doItemSetAttribute(item, "description", description)
doItemSetAttribute(item, "pokeballinfo", "".. day .."/".. month .."/".. year .."/"..getCreatureName(cid).."") -- CATCH INFORMATION: dia/mes/ano/player --ADDED
. Crie
data\lib\age system.lua
function getPokemonYears(pokeball)
local data = string.explode(getItemAttribute(pokeball, "pokeballinfo"), "/")
-- data[1] = dia, data[2] = mes, data[3] = ano
local yearnow = math.floor(tonumber(os.date("%Y")))
local monthnow = math.floor(tonumber(os.date("%m")))
local daynow = math.floor(tonumber(os.date("%d")))
local ano = math.floor(tonumber(data[3]))
local mes = math.floor(tonumber(data[2]))
local dia = math.floor(tonumber(data[1]))
local years = 0
if yearnow == ano then years = monthnow-mes end
if yearnow > ano then years = (12-mes) + monthnow end
return years
end
function getPokemonMonths(pokeball)
local data = string.explode(getItemAttribute(pokeball, "pokeballinfo"), "/")
local yearnow = math.floor(tonumber(os.date("%Y")))
local monthnow = math.floor(tonumber(os.date("%m")))
local daynow = math.floor(tonumber(os.date("%d")))
local ano = math.floor(tonumber(data[3]))
local mes = math.floor(tonumber(data[2]))
local dia = math.floor(tonumber(data[1]))
if (yearnow == ano) and (monthnow==mes) and (daynow<dia+2.5) then months = 0 end
if (yearnow == ano) and (monthnow==mes) and (daynow>dia+2.5) then months = (daynow-dia)/2.5 end
if (yearnow == ano) and (monthnow>mes) then months = math.floor((30-dia)/2.5) + daynow/2.5 end
if (yearnow > ano) then
days = math.floor(monthnow*30+daynow)
months = math.floor(days/2.5)
end
if tostring(months):len() > 3 then months2 = tonumber(string.sub(tostring(months), 1, 3))
else months2 = months end
return months2
end
function getPokemonAge(pokeball)
return ""..getPokemonYears(pokeball).." year, "..getPokemonMonths(pokeball).." months"
end
------------------------------------------------------------------------------------------------------------------------------------------------
CREATURESCRIPTS:
------------------------------------------------------------------------------------------------------------------------------------------------
. Abra
\data\creaturescripts\scripts\look.lua
. Em "if isPokeball(thing.itemid) then" Procure por
if getItemAttribute(thing.uid, "gender") == SEX_MALE then str = str.."It is male." elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then str = str.."It is female." else str = str.."It is genderless." end
.adicione em baixo
str = str.."\nIt's "..getPokemonAge(thing.uid).." old." --remover esta linha se nao quiser o age system
str = str.."\n-----STATS-------\n"
str = str.."Strength: "..math.floor(getItemAttribute(thing.uid, "offense"))..
" Defense: "..math.floor(getItemAttribute(thing.uid, "defense")) .."\n"
str = str.."Vitality: "..math.floor(getItemAttribute(thing.uid, "vitality"))..
" Agility: "..math.floor(getItemAttribute(thing.uid, "speed"))*10 .."\n"
str = str.."Sp. Att: "..math.floor(getItemAttribute(thing.uid, "specialattack"))..""..
" Sp. Def: "..math.floor(getItemAttribute(thing.uid, "specialdefense")).."" --remover esta linha se nao tiver o sp.def added em seu server
str = str.."\n-----------------\n"
. Ficando assim
if isPokeball(thing.itemid) then
local pokename = getItemAttribute(thing.uid, "poke")
local item = getItemInfo(thing.itemid)
str = "You see "..item.article.." "..item.name..".\n"
str = str.."It contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n"
if getItemAttribute(thing.uid, "nick") then
str = str.."It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n"
end
if getItemAttribute(thing.uid, "gender") == SEX_MALE then
str = str.."It is male."
elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
str = str.."It is female."
else
str = str.."It is genderless."
end
str = str.."\nIt's "..getPokemonAge(thing.uid).." old."
str = str.."\n-----STATS-------\n"
str = str.."Strength: "..math.floor(getItemAttribute(thing.uid, "offense")).." Defense: "..math.floor(getItemAttribute(thing.uid, "defense")) .."\n"
str = str.."Vitality: "..math.floor(getItemAttribute(thing.uid, "vitality")).." Agility: "..math.floor(getItemAttribute(thing.uid, "speed"))*10 .."\n"
str = str.."Sp. Att: "..math.floor(getItemAttribute(thing.uid, "specialattack")).." Sp. Def: "..math.floor(getItemAttribute(thing.uid, "specialdefense"))..""
str = str.."\n-----------------\n"
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
------------------------------------------------------------------------------------------------------------------------------------------------
OBS: Apenas os pokemons de catch vao ter idade, outros pokémons como os de quests e box devem ser alterados em seus respectivos scripts, se tiver tendo problemas remova a linha indicada acima p/ desativar o sistema.
OBS2: O Look está configurado pra mostrar quando se olha na pokeball, quem quiser que mostre idade no poke, podendo assim ver de outros players me mande PM e REP+ ^^.
------------------------------------------------------------------------------------------------------------------------------------------------
Pra mais actions e scripts de pokemon dash veja minha assinatura!