Ir para conteúdo

[Action] Age System + Look Personalizado (Stats) - Pokemon Dash Advanced


Spiga

Posts Recomendados

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!

talkactions.rar

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

@Spiga ta dando esse erro no seu system de age quando eu do look no corpo do pokemon morto da esse erro no console

 

[31/12/2011 16:26:09] [Error - CreatureScript Interface]

[31/12/2011 16:26:09] data/creaturescripts/scripts/look.lua:onLook

[31/12/2011 16:26:09] Description:

[31/12/2011 16:26:09] data/lib/011-string.lua:16: bad argument #1 to 'find' (string expected, got nil)

[31/12/2011 16:26:09] stack traceback:

[31/12/2011 16:26:09] [C]: in function 'find'

[31/12/2011 16:26:09] data/lib/011-string.lua:16: in function '(for generator)'

[31/12/2011 16:26:09] data/lib/011-string.lua:16: in function 'explode'

[31/12/2011 16:26:09] data/lib/age system.lua:2: in function 'getPokemonYears'

[31/12/2011 16:26:09] data/lib/age system.lua:38: in function 'getPokemonAge'

[31/12/2011 16:26:09] data/creaturescripts/scripts/look.lua:65: in function

 

@Spiga ta dando esse erro no seu system de age quando eu do look no corpo do pokemon morto da esse erro no console

 

[31/12/2011 16:26:09] [Error - CreatureScript Interface]

[31/12/2011 16:26:09] data/creaturescripts/scripts/look.lua:onLook

[31/12/2011 16:26:09] Description:

[31/12/2011 16:26:09] data/lib/011-string.lua:16: bad argument #1 to 'find' (string expected, got nil)

[31/12/2011 16:26:09] stack traceback:

[31/12/2011 16:26:09] [C]: in function 'find'

[31/12/2011 16:26:09] data/lib/011-string.lua:16: in function '(for generator)'

[31/12/2011 16:26:09] data/lib/011-string.lua:16: in function 'explode'

[31/12/2011 16:26:09] data/lib/age system.lua:2: in function 'getPokemonYears'

[31/12/2011 16:26:09] data/lib/age system.lua:38: in function 'getPokemonAge'

[31/12/2011 16:26:09] data/creaturescripts/scripts/look.lua:65: in function

 

@Spiga ta dando esse erro no seu system de age quando eu do look no corpo do pokemon morto da esse erro no console

e nao aparece nada quando dalook so da esse erro mesmo no console

 

[31/12/2011 16:26:09] [Error - CreatureScript Interface]

[31/12/2011 16:26:09] data/creaturescripts/scripts/look.lua:onLook

[31/12/2011 16:26:09] Description:

[31/12/2011 16:26:09] data/lib/011-string.lua:16: bad argument #1 to 'find' (string expected, got nil)

[31/12/2011 16:26:09] stack traceback:

[31/12/2011 16:26:09] [C]: in function 'find'

[31/12/2011 16:26:09] data/lib/011-string.lua:16: in function '(for generator)'

[31/12/2011 16:26:09] data/lib/011-string.lua:16: in function 'explode'

[31/12/2011 16:26:09] data/lib/age system.lua:2: in function 'getPokemonYears'

[31/12/2011 16:26:09] data/lib/age system.lua:38: in function 'getPokemonAge'

[31/12/2011 16:26:09] data/creaturescripts/scripts/look.lua:65: in function

Link para o comentário
Compartilhar em outros sites

@Spiga ta dando esse erro no seu system de age quando eu do look no corpo do pokemon morto da esse erro no console

 

[31/12/2011 16:26:09] [Error - CreatureScript Interface]

[31/12/2011 16:26:09] data/creaturescripts/scripts/look.lua:onLook

[31/12/2011 16:26:09] Description:

[31/12/2011 16:26:09] data/lib/011-string.lua:16: bad argument #1 to 'find' (string expected, got nil)

[31/12/2011 16:26:09] stack traceback:

[31/12/2011 16:26:09] [C]: in function 'find'

[31/12/2011 16:26:09] data/lib/011-string.lua:16: in function '(for generator)'

[31/12/2011 16:26:09] data/lib/011-string.lua:16: in function 'explode'

[31/12/2011 16:26:09] data/lib/age system.lua:2: in function 'getPokemonYears'

[31/12/2011 16:26:09] data/lib/age system.lua:38: in function 'getPokemonAge'

[31/12/2011 16:26:09] data/creaturescripts/scripts/look.lua:65: in function

 

@Spiga ta dando esse erro no seu system de age quando eu do look no corpo do pokemon morto da esse erro no console

 

[31/12/2011 16:26:09] [Error - CreatureScript Interface]

[31/12/2011 16:26:09] data/creaturescripts/scripts/look.lua:onLook

[31/12/2011 16:26:09] Description:

[31/12/2011 16:26:09] data/lib/011-string.lua:16: bad argument #1 to 'find' (string expected, got nil)

[31/12/2011 16:26:09] stack traceback:

[31/12/2011 16:26:09] [C]: in function 'find'

[31/12/2011 16:26:09] data/lib/011-string.lua:16: in function '(for generator)'

[31/12/2011 16:26:09] data/lib/011-string.lua:16: in function 'explode'

[31/12/2011 16:26:09] data/lib/age system.lua:2: in function 'getPokemonYears'

[31/12/2011 16:26:09] data/lib/age system.lua:38: in function 'getPokemonAge'

[31/12/2011 16:26:09] data/creaturescripts/scripts/look.lua:65: in function

 

@Spiga ta dando esse erro no seu system de age quando eu do look no corpo do pokemon morto da esse erro no console

e nao aparece nada quando dalook so da esse erro mesmo no console

 

[31/12/2011 16:26:09] [Error - CreatureScript Interface]

[31/12/2011 16:26:09] data/creaturescripts/scripts/look.lua:onLook

[31/12/2011 16:26:09] Description:

[31/12/2011 16:26:09] data/lib/011-string.lua:16: bad argument #1 to 'find' (string expected, got nil)

[31/12/2011 16:26:09] stack traceback:

[31/12/2011 16:26:09] [C]: in function 'find'

[31/12/2011 16:26:09] data/lib/011-string.lua:16: in function '(for generator)'

[31/12/2011 16:26:09] data/lib/011-string.lua:16: in function 'explode'

[31/12/2011 16:26:09] data/lib/age system.lua:2: in function 'getPokemonYears'

[31/12/2011 16:26:09] data/lib/age system.lua:38: in function 'getPokemonAge'

[31/12/2011 16:26:09] data/creaturescripts/scripts/look.lua:65: in function

 

Tá fazendo algo errado, aqui funciona perfeitamente (Olha minha assinatura)

Link para o comentário
Compartilhar em outros sites

@Spiga tem como me ajudar a colocar o age system na box de pokemon inicial e no comando "/cb alakazam" de criar pokemon tbm e se possivel em quests tbm obrigado =)

 

otimos sistemas ta ganhando rep++

 

voce pode me ajudar a como colocar sp def no ot com um tutorial =]

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

  • 2 months later...

ta dando o msm erro ake

 

 

[13/03/2012 23:22:28] [Error - CreatureScript Interface]

[13/03/2012 23:22:28] data/creaturescripts/scripts/look.lua:onLook

[13/03/2012 23:22:28] Description:

[13/03/2012 23:22:28] data/lib/011-string.lua:16: bad argument #1 to 'find' (string expected, got nil)

[13/03/2012 23:22:28] stack traceback:

[13/03/2012 23:22:28] [C]: in function 'find'

[13/03/2012 23:22:28] data/lib/011-string.lua:16: in function '(for generator)'

[13/03/2012 23:22:28] data/lib/011-string.lua:16: in function 'explode'

[13/03/2012 23:22:28] data/lib/age system.lua:2: in function 'getPokemonYears'

[13/03/2012 23:22:28] data/lib/age system.lua:38: in function 'getPokemonAge'

[13/03/2012 23:22:28] data/creaturescripts/scripts/look.lua:63: in function <data/creaturescripts/scripts/look.lua:1>

 

 

poe o seu look.lua ae

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

ta dando o msm erro ake

 

 

[13/03/2012 23:22:28] [Error - CreatureScript Interface]

[13/03/2012 23:22:28] data/creaturescripts/scripts/look.lua:onLook

[13/03/2012 23:22:28] Description:

[13/03/2012 23:22:28] data/lib/011-string.lua:16: bad argument #1 to 'find' (string expected, got nil)

[13/03/2012 23:22:28] stack traceback:

[13/03/2012 23:22:28] [C]: in function 'find'

[13/03/2012 23:22:28] data/lib/011-string.lua:16: in function '(for generator)'

[13/03/2012 23:22:28] data/lib/011-string.lua:16: in function 'explode'

[13/03/2012 23:22:28] data/lib/age system.lua:2: in function 'getPokemonYears'

[13/03/2012 23:22:28] data/lib/age system.lua:38: in function 'getPokemonAge'

[13/03/2012 23:22:28] data/creaturescripts/scripts/look.lua:63: in function <data/creaturescripts/scripts/look.lua:1>

 

 

poe o seu look.lua ae

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

×
×
  • Criar Novo...