Ir para conteúdo

[Encerrado] [Pokemon] Dúvidas? - Pda


lucashgas

Posts Recomendados

acredito q alguns pokes n estejam configurados no configuration.lua...

if not pokes[getCreatureName(cid)].offense then

na parte dos status...

 

e se tu deixar essa parte... tu n vai conseguir invocar nenhum poke johto...

if not pokes[getCreatureName(cid)].offense then
doRemoveCreature(cid)
return true
end

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

alguem pf pode mi pasa um cliente que pego no mapa kpdo o dahs normal com master ball ele da debug quando troca de oufts ou algumas hunts eo de pikechu pega normal mais ele ta proprio queria deixa ele normal com ip cahanger ou um outro qe pege pf pf ajuda

Link para o comentário
Compartilhar em outros sites

@Dudu08267 veja sem tem 2 id igual no itens.xml

@topico deu um erro aqui quando coloquei move johto!

 

[29/02/2012 10:26:24] [Error - CreatureScript Interface]

[29/02/2012 10:26:24] In a timer event called from:

[29/02/2012 10:26:24] data/creaturescripts/scripts/spawn.lua:onSpawn

[29/02/2012 10:26:24] Description:

[29/02/2012 10:26:24] data/lib/level system123.lua:590: attempt to index field '?' (a nil value)

[29/02/2012 10:26:24] stack traceback:

[29/02/2012 10:26:24] data/lib/level system123.lua:590: in function 'setWildPokemonLevel'

[29/02/2012 10:26:24] data/creaturescripts/scripts/spawn.lua:8: in function <data/creaturescripts/scripts/spawn.lua:1>

[29/02/2012 10:26:24] [Error - CreatureScript Interface]

[29/02/2012 10:26:24] In a timer event called from:

[29/02/2012 10:26:24] data/creaturescripts/scripts/spawn.lua:onSpawn

[29/02/2012 10:26:24] Description:

[29/02/2012 10:26:24] data/lib/level system123.lua:590: attempt to index field '?' (a nil value)

[29/02/2012 10:26:24] stack traceback:

[29/02/2012 10:26:24] data/lib/level system123.lua:590: in function 'setWildPokemonLevel'

[29/02/2012 10:26:24] data/creaturescripts/scripts/spawn.lua:8: in function <data/creaturescripts/scripts/spawn.lua:1>

[29/02/2012 10:26:24] [Error - CreatureScript Interface]

[29/02/2012 10:26:24] In a timer event called from:

[29/02/2012 10:26:24] data/creaturescripts/scripts/spawn.lua:onSpawn

[29/02/2012 10:26:24] Description:

[29/02/2012 10:26:24] data/lib/level system123.lua:590: attempt to index field '?' (a nil value)

[29/02/2012 10:26:24] stack traceback:

[29/02/2012 10:26:24] data/lib/level system123.lua:590: in function 'setWildPokemonLevel'

[29/02/2012 10:26:24] data/creaturescripts/scripts/spawn.lua:8: in function <data/creaturescripts/scripts/spawn.lua:1>

 

 

 

Aqui meu Level system

function getPokemonStatus(name, multiplier)

local a = pokes[name]

local m = 1

if not a then return false end

if not a.offense then return false end

if multiplier then m = multiplier end

local ret = {}

ret.off = a.offense * m

ret.offense = ret.off

ret.def = a.defense * m

ret.defense = ret.def

ret.agi = a.agility * m

ret.agility = ret.agi

ret.spatk = a.specialattack * m

ret.specialattack = ret.spatk

ret.vit = a.vitality * m

ret.vitality = ret.vit

return ret

end

function getPokemonXMLOutfit(name)

local a = "data/monster/pokes/"..name..".xml"

local b = io.open(a, "a+")

local c = b:read("*all")

b:close()

local d, e = c:find('look type="(.-)"')

c = string.sub(c, d + 11, e - 1)

return tonumber©

end

function doEvolutionOutfit(cid, oldout, outfit)

if not isCreature(cid) then return true end

if getCreatureOutfit(cid).lookType == oldout then

doSetCreatureOutfit(cid, {lookType = outfit}, -1)

else

doSetCreatureOutfit(cid, {lookType = oldout}, -1)

end

end

function doStartEvolution(cid, evolution, seconds)

if not isCreature(cid) then return true end

local a = getPlayerStorageValue(cid, 1007)

local b = getCreatureHealth(cid) / getCreatureMaxHealth(cid)

local d = getThingPos(cid)

local e = getCreatureMaster(cid)

if getHappinessRate(cid) < 1 then return true end

local f = getCreatureOutfit(cid).lookType

local g = getItemAttribute(getPlayerSlotItem(e, 8).uid, "nick") or getCreatureName(cid)

local h = getPokemonXMLOutfit(evolution)

doItemSetAttribute(getPlayerSlotItem(e, 8).uid, "hp", b)

doCreatureSay(e, "What? My "..g.." is evolving!", TALKTYPE_SAY)

doSummonMonster(e, "Evolution")

doReturnPokemon(e, cid, getPlayerSlotItem(e, 8), 0, true)

local evo = getCreatureSummons(e)[1]

doEvolutionOutfit(evo, h, f)

doCreatureSetHideHealth(evo, true)

doCreatureSetLookDir(evo, 2)

setPlayerStorageValue(evo, 1007, g)

doTeleportThing(evo, d, false)

addEvent(sendSSJEffect, 250, evo)

doSendAnimatedText(getThingPos(evo), "EVOLUTION", COLOR_GRASS)

doSendEvolutionEffect(evo, getThingPos(evo), evolution, 20, false, false, f, h)

end

function doSendEvolutionEffect(cid, pos, evolution, turn, ssj, evolve, f, h)

if not isCreature(cid) then

doSendAnimatedText(pos, "CANCEL", 215)

return true end

if evolve then

doEvolvePokemon(getCreatureMaster(cid), {uid = cid}, evolution, 0, 0)

return true

end

doSendMagicEffect(pos, 18)

if ssj then

sendSSJEffect(evo)

end

doEvolutionOutfit(cid, f, h)

addEvent(doSendEvolutionEffect, math.pow(1900, turn/20), cid, getThingPos(cid), evolution, turn - 1, turn == 19, turn == 2, f, h)

end

function sendSSJEffect(cid)

if not isCreature(cid) then return true end

local pos1 = getThingPos(cid)

local pos2 = getThingPos(cid)

pos2.x = pos2.x + math.random(-1, 1)

pos2.y = pos2.y - math.random(1, 2)

doSendDistanceShoot(pos1, pos2, 37)

addEvent(sendSSJEffect, 45, cid)

end

function sendFinishEvolutionEffect(cid, alternate)

if not isCreature(cid) then return true end

local pos1 = getThingPos(cid)

if alternate then

local pos = {

[1] = {-2, 0},

[2] = {-1, -1},

[3] = {0, -2},

[4] = {1, -1},

[5] = {2, 0},

[6] = {1, 1},

[7] = {0, 2},

[8] = {-1, 1}}

for a = 1, 8 do

local pos2 = getThingPos(cid)

pos2.x = pos2.x + pos[a][1]

pos2.y = pos2.y + pos[a][2]

local pos = getThingPos(cid)

doSendDistanceShoot(pos2, pos, 37)

addEvent(doSendDistanceShoot, 300, pos, pos2, 37)

end

else

for a = 0, 3 do

doSendDistanceShoot(pos1, getPosByDir(pos1, a), 37)

end

for a = 4, 7 do

addEvent(doSendDistanceShoot, 600, pos1, getPosByDir(pos1, a), 37)

end

end

end

function doEvolvePokemon(cid, item2, theevo, stone1, stone2)

if not isCreature(cid) then return true end

if not pokes[theevo] or not pokes[theevo].offense then

doReturnPokemon(cid, item2.uid, getPlayerSlotItem(cid, 8), pokeballs[getPokeballType(getPlayerSlotItem(cid, 8).itemid)].effect, false, true)

return true

end

local owner = getCreatureMaster(item2.uid)

local pokeball = getPlayerSlotItem(cid, 8)

local description = "Contains a "..theevo.."."

local pct = getCreatureHealth(item2.uid) / getCreatureMaxHealth(item2.uid)

doItemSetAttribute(pokeball.uid, "hp", pct)

doItemSetAttribute(pokeball.uid, "poke", theevo)

doItemSetAttribute(pokeball.uid, "description", "Contains a "..theevo..".")

doPlayerSendTextMessage(cid, 27, "Congratulations! Your "..getPokeName(item2.uid).." evolved into a "..theevo.."!")

doSendMagicEffect(getThingPos(item2.uid), 18)

doTransformItem(getPlayerSlotItem(cid, 7).uid, fotos[theevo])

doSendMagicEffect(getThingPos(cid), 173)

local oldpos = getThingPos(item2.uid)

local oldlod = getCreatureLookDir(item2.uid)

local oldlvl = getPokemonLevel(item2.uid)

doRemoveCreature(item2.uid)

doSummonMonster(cid, theevo)

local pk = getCreatureSummons(cid)[1]

doTeleportThing(pk, oldpos, false)

doCreatureSetLookDir(pk, oldlod)

sendFinishEvolutionEffect(pk, true)

addEvent(sendFinishEvolutionEffect, 550, pk, true)

addEvent(sendFinishEvolutionEffect, 1050, pk)

 

doPlayerRemoveItem(cid, stone1, 1)

doPlayerRemoveItem(cid, stone2, 1)

doAddPokemonInOwnList(cid, theevo)

local status = getPokemonStatus(getCreatureName(pk))

local off = status.off * 7.5

local def = status.def * 7.5

local agi = status.agi * 7.5

local spatk = status.spatk * 7.5

local vit = status.vit * 7

doItemSetAttribute(pokeball.uid, "offense", getItemAttribute(pokeball.uid, "offense") + off)

doItemSetAttribute(pokeball.uid, "defense", getItemAttribute(pokeball.uid, "defense") + def)

doItemSetAttribute(pokeball.uid, "speed", getItemAttribute(pokeball.uid, "speed") + agi)

doItemSetAttribute(pokeball.uid, "specialattack", getItemAttribute(pokeball.uid, "specialattack") + spatk)

doItemSetAttribute(pokeball.uid, "vitality", getItemAttribute(pokeball.uid, "vitality") + vit)

doPlayerSendTextMessage(cid, 27, "Evolution bonus: • Offense: +"..doMathDecimal(off).." • Defense: +"..doMathDecimal(def).." • Spc. Atk: +"..doMathDecimal(spatk).." • Agility: +"..doMathDecimal(agi).." • Vitality: +"..doMathDecimal(vit).."")

local happy = getItemAttribute(pokeball.uid, "happy")

doItemSetAttribute(pokeball.uid, "happy", happy + happyGainedOnEvolution)

if happy + happyGainedOnEvolution > 255 then

doItemSetAttribute(pokeball.uid, "happy", 255)

end

adjustStatus(pk, pokeball.uid, true, false)

if useKpdoDlls then

doUpdateMoves(cid)

end

end

 

function givePokemonExp(cid, item, expe, pct, rarecandy)

if expe <= 0 or not isCreature(cid) then return true end

local leveltable = getPokemonExperienceTable(getPokeballName(item.uid, true))

if getItemAttribute(item.uid, "exp") + expe > leveltable[100] then

givePokemonExp(cid, item, leveltable[100] - getItemAttribute(item.uid, "exp"))

return true

end

doItemSetAttribute(item.uid, "exp", getItemAttribute(item.uid, "exp") + expe)

doItemSetAttribute(item.uid, "happy", getItemAttribute(item.uid, "happy") + 1)

doItemSetAttribute(item.uid, "nextlevelexp", getItemAttribute(item.uid, "nextlevelexp") - expe)

 

if pct then

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item.uid).." has received "..expe.." experience points ("..pct.."%).")

else

if getItemAttribute(item.uid, "nextlevelexp") > 0 then

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item.uid).." ["..getItemAttribute(item.uid, "level").."] has received "..expe.." experience points ("..getItemAttribute(item.uid, "nextlevelexp").." to next level).")

else

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item.uid).." ["..getItemAttribute(item.uid, "level").."] has received "..expe.." experience points and has leveled up!")

end

end

if isBeingUsed(item.itemid) then

doSendAnimatedText(getThingPos(getCreatureSummons(cid)[1]), expe, 215)

end

if getItemAttribute(item.uid, "nextlevelexp") <= 0 then

local summon = getCreatureSummons(cid)[1]

 

if not isCreature(summon) then return true end

doSendFlareEffect(getThingPos(summon))

doSendAnimatedText(getThingPos(summon), "Level up!", 215)

adjustPokemonLevel(item.uid, cid, item.itemid)

end

end

 

function givePokemonExpInBp(cid, item, expe, ballid, pct, hidemessage)

if expe <= 0 or not isCreature(cid) then return true end

local leveltable = getPokemonExperienceTable(getPokeballName(item, true))

if getItemAttribute(item, "exp") + expe > leveltable[100] then

givePokemonExpInBp(cid, item, leveltable[100] - getItemAttribute(item, "exp"), ballid)

return true

end

doItemSetAttribute(item, "exp", getItemAttribute(item, "exp") + expe)

doItemSetAttribute(item, "happy", getItemAttribute(item, "happy") + 1)

doItemSetAttribute(item, "nextlevelexp", getItemAttribute(item, "nextlevelexp") - expe)

if not hidemessage then

if pct then

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item).." has received "..expe.." experience points ("..pct.."%).")

else

if getItemAttribute(item, "nextlevelexp") > 0 then

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item).." ["..getItemAttribute(item, "level").."] has received "..expe.." experience points inside his pokeball ("..getItemAttribute(item, "nextlevelexp").." to next level).")

else

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item).." ["..getItemAttribute(item, "level").."] has received "..expe.." experience points and has leveled up inside his pokeball.")

adjustPokemonLevel(item, cid, ballid)

end

end

end

end

function doMathDecimal(number, casas)

if math.floor(number) == number then return number end

local c = casas and casas + 1 or 3

for a = 0, 10 do

if math.floor(number) < math.pow(10, a) then

local str = string.sub(""..number.."", 1, a + c)

return tonumber(str)

end

end

return number

end

function adjustPokemonLevel(item, cid, id, rarecandy)

if not isCreature(cid) then return true end

local exp = getItemAttribute(item, "exp")

local level = getItemAttribute(item, "level")

local leveltable = getPokemonExperienceTable(getPokeballName(item, true))

local newlevel = 1

for x = 1, 100 do

if exp >= leveltable[x] and exp < leveltable[x+1] then

newlevel = x

end

end

if newlevel <= 1 then return true end

local levelsup = (newlevel - level)

local pokemon = getItemAttribute(item, "poke")

local happy = getItemAttribute(item, "happy")

local rate = happy / 100

local newhappiness = happy

if happy >= 250 then

newhappiness = 255

elseif happy >= 230 then

newhappiness = happy + 4

elseif happy >= 210 then

newhappiness = happy + 6

elseif happy >= 180 then

newhappiness = happy + 8

elseif happy >= 140 then

newhappiness = happy + 10

elseif happy >= 110 then

newhappiness = happy + 12

else

newhappiness = happy + 15

end

local status = getPokemonStatus(pokemon)

local off = status.off * rate * levelsup

local def = status.def * rate * levelsup

local agi = status.agi * rate * levelsup

local spatk = status.spatk * rate * levelsup

local vit = status.vit * rate * levelsup

doItemSetAttribute(item, "level", newlevel)

if not rarecandy then

doItemSetAttribute(item, "happy", newhappiness)

end

local nextexp = leveltable[newlevel + 1] - exp

doItemSetAttribute(item, "nextlevelexp", nextexp)

doItemSetAttribute(item, "offense", getItemAttribute(item, "offense") + off)

doItemSetAttribute(item, "defense", getItemAttribute(item, "defense") + def)

doItemSetAttribute(item, "speed", getItemAttribute(item, "speed") + agi)

doItemSetAttribute(item, "specialattack", getItemAttribute(item, "specialattack") + spatk)

doItemSetAttribute(item, "vitality", getItemAttribute(item, "vitality") + vit)

if newlevel > getPlayerLevel(cid) + pokemonMaxLevelAbovePlayer then

addEvent(doPlayerSendTextMessage, 30, cid, 18, "Warning: Your "..getPokeballName(item).."'s ["..newlevel.."] level is much higher than yours, so you will not be able to call him to battles.")

end

if isCreature(cid) and id >= 1 and isBeingUsed(id) then

adjustStatus(getCreatureSummons(cid)[1], item, false, true)

doPlayerSendTextMessage(cid, 27, "• Level: "..newlevel.." (+"..levelsup..") • Offense: +"..doMathDecimal(off).." • Defense: +"..doMathDecimal(def).." • Spc. Atk: +"..doMathDecimal(spatk).." • Agility: +"..doMathDecimal(agi).." • Vitality: +"..doMathDecimal(vit).."")

if happy < minHappyToEvolve then return true end

if pokemonsCanEvolveByLevel then

local summon = getCreatureSummons(cid)[1]

local reqlevel = poevo[getCreatureName(summon)] and poevo[getCreatureName(summon)].level or -1

local level = getItemAttribute(item, "level")

local evolution = "none"

local name = getCreatureName(summon)

if name == "Tyrogue" and level >= 20 then

if getOffense(summon) == getDefense(summon) then

evolution = "Hitmontop"

elseif getOffense(summon) > getDefense(summon) then

evolution = "Hitmonlee"

else

evolution = "Hitmonchan"

end

elseif name == "Eevee" then

if happy >= maxHappyToEvolve then

if isDay() then

evolution = "Espeon"

else

evolution = "Umbreon"

end

end

elseif name == "Slowpoke" and level >= 28 then

evolution = "Slowbro"

elseif name == "Poliwhirl" and level >= 36 then

evolution = "Poliwrath"

elseif reqlevel > 4 and level >= reqlevel then

evolution = poevo[getCreatureName(summon)].evolution

elseif reqlevel == 2 and happy >= maxHappyToEvolve then

evolution = poevo[getCreatureName(summon)] and poevo[getCreatureName(summon)].evolution or "none"

end

if evolution ~= "none" then

doStartEvolution(summon, evolution, 4)

end

end

end

end

function adjustStatus(pk, item, health, vite, conditions)

if not isCreature(pk) then return true end

local bonusoffense = getItemAttribute(item, boffense) or 0

local bonusdefense = getItemAttribute(item, bdefense) or 0

local bonusagility = getItemAttribute(item, bagility) or 0

local bonussattack = getItemAttribute(item, bsattack) or 0

setPlayerStorageValue(pk, 1000, getItemAttribute(item, "level"))

setPlayerStorageValue(pk, 1001, getItemAttribute(item, "offense") + bonusoffense)

setPlayerStorageValue(pk, 1002, getItemAttribute(item, "defense") + bonusdefense)

setPlayerStorageValue(pk, 1003, getItemAttribute(item, "speed") + bonusagility)

setPlayerStorageValue(pk, 1005, getItemAttribute(item, "specialattack") + bonussattack)

local gender = getItemAttribute(item, "gender") and getItemAttribute(item, "gender") or 0

doCreatureSetSkullType(pk, gender)

if vite == true then

local pct = getCreatureHealth(pk) / getCreatureMaxHealth(pk)

local vit = getItemAttribute(item, "vitality") - getPlayerStorageValue(pk, 1004)

setCreatureMaxHealth(pk, getCreatureMaxHealth(pk) + ( vit * HPperVIT ))

doCreatureAddHealth(pk, pct * vit * HPperVIT)

end

setPlayerStorageValue(pk, 1004, getItemAttribute(item, "vitality"))

doRegainSpeed(pk)

local nick = getItemAttribute(item, "poke")

if getItemAttribute(item, "nick") then

nick = getItemAttribute(item, "nick")

end

setPlayerStorageValue(pk, 1007, nick)

local boostlevel = getItemAttribute(item, "boost") or 0

local boostshow = hideBoost and "]" or " + "..boostlevel.."]"

local lvlstr = ""

if showBoostSeparated then

boostshow = hideBoost and "]" or "] [+"..boostlevel.."]"

end

if hideSummonsLevel then

if not hideBoost then

nick = nick.." [+"..boostlevel.."]"

end

else

nick = nick.." ["..getItemAttribute(item, "level")..""..boostshow..""

end

doCreatureSetNick(pk, nick)

if not getItemAttribute(item, "happy") then

doItemSetAttribute(item, "happy", 120)

end

if not getItemAttribute(item, "hunger") then

doItemSetAttribute(item, "hunger", 5)

end

local happy = getItemAttribute(item, "happy")

if happy < 0 then

happy = 0

end

setPlayerStorageValue(pk, 1008, happy)

local hunger = getItemAttribute(item, "hunger")

setPlayerStorageValue(pk, 1009, hunger)

if health == true then

local mh = getCreatureMaxHealth(pk) + HPperVIT * getVitality(pk)

local rd = 1 - (tonumber(getItemAttribute(item, "hp")))

setCreatureMaxHealth(pk, mh)

doCreatureAddHealth(pk, getCreatureMaxHealth(pk))

doCreatureAddHealth(pk, -(getCreatureMaxHealth(pk) * rd))

end

if isSummon(pk) and conditions then

local burn = getItemAttribute(item, "burn")

if burn and burn >= 0 then

addEvent(doAdvancedBurn, 5000, pk, pk, getItemAttribute(item, "burndmg"), burn - 1)

end

local poison = getItemAttribute(item, "poison")

if poison and poison >= 0 then

addEvent(doAdvancedPoison, 2500, pk, pk, getItemAttribute(item, "poisondmg"), poison - 1)

end

if getItemAttribute(item, "confuse") and getItemAttribute(item, "confuse") >= 1 then

addEvent(doAdvancedConfuse, 1200, pk, getItemAttribute(item, "confuse"), getPlayerStorageValue(pk, 3891))

end

if getItemAttribute(item, "blind") and getItemAttribute(item, "blind") >= 1 then

addEvent(doBlind, 300, pk, getItemAttribute(item, "blind"), getItemAttribute(item, "blindef"))

end

if getItemAttribute(item, "sleep") and getItemAttribute(item, "sleep") >= 1 then

doSleep(pk, getItemAttribute(item, "sleep"))

end

end

return true

end

function setWildPokemonLevel(cid, optionalLevel, optionalStatus, optionalNick, optionalExtraExp)

if not isCreature(cid) then return true end

local levelRange = 0

local off = 0

local def = 0

local agi = 0

local spatk = 0

local vit = 0

local this = getCreatureName(cid)

local ee = 1

if optionalExtraExp then

ee = optionalExtraExp

end

 

if optionalLevel and tonumber(optionalLevel) >= 1 then

if optionalLevel <= 100 then

levelRange = optionalLevel

else

levelRange = 100

end

elseif getCreatureOutfit(cid).lookHead and getCreatureOutfit(cid).lookBody and getCreatureOutfit(cid).lookHead <= getCreatureOutfit(cid).lookBody then

levelRange = math.random(getCreatureOutfit(cid).lookHead, getCreatureOutfit(cid).lookBody)

else

levelRange = math.random(20, 30)

end

local status = getPokemonStatus(this)

if status then

off = status.off

def = status.def

agi = status.agi

vit = status.vit

spatk = status.spatk

end

setPlayerStorageValue(cid, 1000, levelRange)

if optionalStatus and optionalStatus.off then

setPlayerStorageValue(cid, 1001, optionalStatus.offense)

setPlayerStorageValue(cid, 1002, optionalStatus.defense)

setPlayerStorageValue(cid, 1003, optionalStatus.agility)

setPlayerStorageValue(cid, 1004, optionalStatus.vitality)

setPlayerStorageValue(cid, 1005, optionalStatus.specialattack)

setPlayerStorageValue(cid, 1011, optionalStatus.offense)

setPlayerStorageValue(cid, 1012, optionalStatus.defense)

setPlayerStorageValue(cid, 1013, optionalStatus.agility)

setPlayerStorageValue(cid, 1014, optionalStatus.vitality)

setPlayerStorageValue(cid, 1015, optionalStatus.specialattack)

else

setPlayerStorageValue(cid, 1001, 5 + math.random(off * levelRange * 0.9, off * levelRange * 1.8))

setPlayerStorageValue(cid, 1002, 5 + math.random(def * levelRange * 0.9, def * levelRange * 1.8))

setPlayerStorageValue(cid, 1003, math.random(agi * levelRange * 0.9, agi * levelRange * 1.8))

setPlayerStorageValue(cid, 1004, math.random(vit * levelRange * 0.9, vit * levelRange * 1.8))

setPlayerStorageValue(cid, 1005, 5 + math.random(spatk * levelRange * 0.9, spatk * levelRange * 1.8))

setPlayerStorageValue(cid, 1011, getPlayerStorageValue(cid, 1001))

setPlayerStorageValue(cid, 1012, getPlayerStorageValue(cid, 1002))

setPlayerStorageValue(cid, 1013, getPlayerStorageValue(cid, 1003))

setPlayerStorageValue(cid, 1014, getPlayerStorageValue(cid, 1004))

setPlayerStorageValue(cid, 1015, getPlayerStorageValue(cid, 1005))

end

doRegainSpeed(cid)

setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + getPlayerStorageValue(cid, 1004) * HPperVIT * vitReductionForWild)

doCreatureAddHealth(cid, getCreatureMaxHealth(cid))

if pokes[getCreatureName(cid)].exp then

--getMonsterInfo(getCreatureName(cid)).experience

local exp = (50 + pokes[getCreatureName(cid)].exp) * baseExpRate + pokes[getCreatureName(cid)].vitality * levelRange * pokemonExpPerLevelRate

setPlayerStorageValue(cid, 1006, exp * generalExpRate * ee)

end

local wildshow = wildBeforeNames and "Wild " or ""

if optionalNick then

if hideWildsLevel then

doCreatureSetNick(cid, optionalNick)

else

doCreatureSetNick(cid, optionalNick.." ["..getWildPokemonLevel(cid).."]")

end

else

if hideWildsLevel then

doCreatureSetNick(cid, ""..wildshow..""..getCreatureName(cid).."")

else

doCreatureSetNick(cid, ""..wildshow..""..getCreatureName(cid).." ["..getWildPokemonLevel(cid).."]")

end

end

end

function getOffense(cid)

if not isCreature(cid) then return 0 end

if getPlayerStorageValue(cid, 3894) >= 1 then

return tonumber(getPlayerStorageValue(cid, 1001)) / 2

end

return tonumber(getPlayerStorageValue(cid, 1001))

end

function getDefense(cid)

if not isCreature(cid) then return 0 end

if getPlayerStorageValue(cid, 3894) >= 1 then

return tonumber(getPlayerStorageValue(cid, 1002)) / 2

end

return tonumber(getPlayerStorageValue(cid, 1002))

end

function getSpeed(cid)

if not isCreature(cid) then return 0 end

return tonumber(getPlayerStorageValue(cid, 1003))

end

function getVitality(cid)

if not isCreature(cid) then return 0 end

return tonumber(getPlayerStorageValue(cid, 1004))

end

function getSpecialAttack(cid)

if not isCreature(cid) then return 0 end

return tonumber(getPlayerStorageValue(cid, 1005))

end

function getHappiness(cid)

if not isCreature(cid) then return 0 end

return tonumber(getPlayerStorageValue(cid, 1008))

end

function getSpecialDefense(cid)

if not isCreature(cid) then return 0 end

return getSpecialAttack(cid) * 0.85 + getDefense(cid) * 0.2

end

function getWildPokemonExp(cid)

return getPlayerStorageValue(cid, 1006)

end

function getWildPokemonLevel(cid)

return getPlayerStorageValue(cid, 1000)

end

function getLevel(cid)

if isSummon(cid) then

return getItemAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "level")

end

return getPlayerStorageValue(cid, 1000)

end

function getPokeName(cid)

if not isSummon(cid) then return getCreatureName(cid) end

if getCreatureName(cid) == "Evolution" then return getPlayerStorageValue(cid, 1007) end

local item = getPlayerSlotItem(getCreatureMaster(cid), 8)

if getItemAttribute(item.uid, "nick") then

return getItemAttribute(item.uid, "nick")

end

return getCreatureName(cid)

end

function getPokeballName(item, truename)

if not truename and getItemAttribute(item, "nick") then

return getItemAttribute(item, "nick")

end

return getItemAttribute(item, "poke")

end

function getPokemonName(cid)

return getCreatureName(cid)

end

function getPokemonLevel(cid)

if not isCreature(cid) then return 0 end

return getPlayerStorageValue(cid, 1000)

end

function getPokemonGender(cid)

return getCreatureSkullType(cid)

end

Link para o comentário
Compartilhar em outros sites

@Dudu08267 veja sem tem 2 id igual no itens.xml

@topico deu um erro aqui quando coloquei move johto!

 

[29/02/2012 10:26:24] [Error - CreatureScript Interface]

[29/02/2012 10:26:24] In a timer event called from:

[29/02/2012 10:26:24] data/creaturescripts/scripts/spawn.lua:onSpawn

[29/02/2012 10:26:24] Description:

[29/02/2012 10:26:24] data/lib/level system123.lua:590: attempt to index field '?' (a nil value)

[29/02/2012 10:26:24] stack traceback:

[29/02/2012 10:26:24] data/lib/level system123.lua:590: in function 'setWildPokemonLevel'

[29/02/2012 10:26:24] data/creaturescripts/scripts/spawn.lua:8: in function <data/creaturescripts/scripts/spawn.lua:1>

[29/02/2012 10:26:24] [Error - CreatureScript Interface]

[29/02/2012 10:26:24] In a timer event called from:

[29/02/2012 10:26:24] data/creaturescripts/scripts/spawn.lua:onSpawn

[29/02/2012 10:26:24] Description:

[29/02/2012 10:26:24] data/lib/level system123.lua:590: attempt to index field '?' (a nil value)

[29/02/2012 10:26:24] stack traceback:

[29/02/2012 10:26:24] data/lib/level system123.lua:590: in function 'setWildPokemonLevel'

[29/02/2012 10:26:24] data/creaturescripts/scripts/spawn.lua:8: in function <data/creaturescripts/scripts/spawn.lua:1>

[29/02/2012 10:26:24] [Error - CreatureScript Interface]

[29/02/2012 10:26:24] In a timer event called from:

[29/02/2012 10:26:24] data/creaturescripts/scripts/spawn.lua:onSpawn

[29/02/2012 10:26:24] Description:

[29/02/2012 10:26:24] data/lib/level system123.lua:590: attempt to index field '?' (a nil value)

[29/02/2012 10:26:24] stack traceback:

[29/02/2012 10:26:24] data/lib/level system123.lua:590: in function 'setWildPokemonLevel'

[29/02/2012 10:26:24] data/creaturescripts/scripts/spawn.lua:8: in function <data/creaturescripts/scripts/spawn.lua:1>

 

 

 

Aqui meu Level system

function getPokemonStatus(name, multiplier)

local a = pokes[name]

local m = 1

if not a then return false end

if not a.offense then return false end

if multiplier then m = multiplier end

local ret = {}

ret.off = a.offense * m

ret.offense = ret.off

ret.def = a.defense * m

ret.defense = ret.def

ret.agi = a.agility * m

ret.agility = ret.agi

ret.spatk = a.specialattack * m

ret.specialattack = ret.spatk

ret.vit = a.vitality * m

ret.vitality = ret.vit

return ret

end

function getPokemonXMLOutfit(name)

local a = "data/monster/pokes/"..name..".xml"

local b = io.open(a, "a+")

local c = b:read("*all")

b:close()

local d, e = c:find('look type="(.-)"')

c = string.sub(c, d + 11, e - 1)

return tonumber©

end

function doEvolutionOutfit(cid, oldout, outfit)

if not isCreature(cid) then return true end

if getCreatureOutfit(cid).lookType == oldout then

doSetCreatureOutfit(cid, {lookType = outfit}, -1)

else

doSetCreatureOutfit(cid, {lookType = oldout}, -1)

end

end

function doStartEvolution(cid, evolution, seconds)

if not isCreature(cid) then return true end

local a = getPlayerStorageValue(cid, 1007)

local b = getCreatureHealth(cid) / getCreatureMaxHealth(cid)

local d = getThingPos(cid)

local e = getCreatureMaster(cid)

if getHappinessRate(cid) < 1 then return true end

local f = getCreatureOutfit(cid).lookType

local g = getItemAttribute(getPlayerSlotItem(e, 8).uid, "nick") or getCreatureName(cid)

local h = getPokemonXMLOutfit(evolution)

doItemSetAttribute(getPlayerSlotItem(e, 8).uid, "hp", b)

doCreatureSay(e, "What? My "..g.." is evolving!", TALKTYPE_SAY)

doSummonMonster(e, "Evolution")

doReturnPokemon(e, cid, getPlayerSlotItem(e, 8), 0, true)

local evo = getCreatureSummons(e)[1]

doEvolutionOutfit(evo, h, f)

doCreatureSetHideHealth(evo, true)

doCreatureSetLookDir(evo, 2)

setPlayerStorageValue(evo, 1007, g)

doTeleportThing(evo, d, false)

addEvent(sendSSJEffect, 250, evo)

doSendAnimatedText(getThingPos(evo), "EVOLUTION", COLOR_GRASS)

doSendEvolutionEffect(evo, getThingPos(evo), evolution, 20, false, false, f, h)

end

function doSendEvolutionEffect(cid, pos, evolution, turn, ssj, evolve, f, h)

if not isCreature(cid) then

doSendAnimatedText(pos, "CANCEL", 215)

return true end

if evolve then

doEvolvePokemon(getCreatureMaster(cid), {uid = cid}, evolution, 0, 0)

return true

end

doSendMagicEffect(pos, 18)

if ssj then

sendSSJEffect(evo)

end

doEvolutionOutfit(cid, f, h)

addEvent(doSendEvolutionEffect, math.pow(1900, turn/20), cid, getThingPos(cid), evolution, turn - 1, turn == 19, turn == 2, f, h)

end

function sendSSJEffect(cid)

if not isCreature(cid) then return true end

local pos1 = getThingPos(cid)

local pos2 = getThingPos(cid)

pos2.x = pos2.x + math.random(-1, 1)

pos2.y = pos2.y - math.random(1, 2)

doSendDistanceShoot(pos1, pos2, 37)

addEvent(sendSSJEffect, 45, cid)

end

function sendFinishEvolutionEffect(cid, alternate)

if not isCreature(cid) then return true end

local pos1 = getThingPos(cid)

if alternate then

local pos = {

[1] = {-2, 0},

[2] = {-1, -1},

[3] = {0, -2},

[4] = {1, -1},

[5] = {2, 0},

[6] = {1, 1},

[7] = {0, 2},

[8] = {-1, 1}}

for a = 1, 8 do

local pos2 = getThingPos(cid)

pos2.x = pos2.x + pos[a][1]

pos2.y = pos2.y + pos[a][2]

local pos = getThingPos(cid)

doSendDistanceShoot(pos2, pos, 37)

addEvent(doSendDistanceShoot, 300, pos, pos2, 37)

end

else

for a = 0, 3 do

doSendDistanceShoot(pos1, getPosByDir(pos1, a), 37)

end

for a = 4, 7 do

addEvent(doSendDistanceShoot, 600, pos1, getPosByDir(pos1, a), 37)

end

end

end

function doEvolvePokemon(cid, item2, theevo, stone1, stone2)

if not isCreature(cid) then return true end

if not pokes[theevo] or not pokes[theevo].offense then

doReturnPokemon(cid, item2.uid, getPlayerSlotItem(cid, 8), pokeballs[getPokeballType(getPlayerSlotItem(cid, 8).itemid)].effect, false, true)

return true

end

local owner = getCreatureMaster(item2.uid)

local pokeball = getPlayerSlotItem(cid, 8)

local description = "Contains a "..theevo.."."

local pct = getCreatureHealth(item2.uid) / getCreatureMaxHealth(item2.uid)

doItemSetAttribute(pokeball.uid, "hp", pct)

doItemSetAttribute(pokeball.uid, "poke", theevo)

doItemSetAttribute(pokeball.uid, "description", "Contains a "..theevo..".")

doPlayerSendTextMessage(cid, 27, "Congratulations! Your "..getPokeName(item2.uid).." evolved into a "..theevo.."!")

doSendMagicEffect(getThingPos(item2.uid), 18)

doTransformItem(getPlayerSlotItem(cid, 7).uid, fotos[theevo])

doSendMagicEffect(getThingPos(cid), 173)

local oldpos = getThingPos(item2.uid)

local oldlod = getCreatureLookDir(item2.uid)

local oldlvl = getPokemonLevel(item2.uid)

doRemoveCreature(item2.uid)

doSummonMonster(cid, theevo)

local pk = getCreatureSummons(cid)[1]

doTeleportThing(pk, oldpos, false)

doCreatureSetLookDir(pk, oldlod)

sendFinishEvolutionEffect(pk, true)

addEvent(sendFinishEvolutionEffect, 550, pk, true)

addEvent(sendFinishEvolutionEffect, 1050, pk)

 

doPlayerRemoveItem(cid, stone1, 1)

doPlayerRemoveItem(cid, stone2, 1)

doAddPokemonInOwnList(cid, theevo)

local status = getPokemonStatus(getCreatureName(pk))

local off = status.off * 7.5

local def = status.def * 7.5

local agi = status.agi * 7.5

local spatk = status.spatk * 7.5

local vit = status.vit * 7

doItemSetAttribute(pokeball.uid, "offense", getItemAttribute(pokeball.uid, "offense") + off)

doItemSetAttribute(pokeball.uid, "defense", getItemAttribute(pokeball.uid, "defense") + def)

doItemSetAttribute(pokeball.uid, "speed", getItemAttribute(pokeball.uid, "speed") + agi)

doItemSetAttribute(pokeball.uid, "specialattack", getItemAttribute(pokeball.uid, "specialattack") + spatk)

doItemSetAttribute(pokeball.uid, "vitality", getItemAttribute(pokeball.uid, "vitality") + vit)

doPlayerSendTextMessage(cid, 27, "Evolution bonus: • Offense: +"..doMathDecimal(off).." • Defense: +"..doMathDecimal(def).." • Spc. Atk: +"..doMathDecimal(spatk).." • Agility: +"..doMathDecimal(agi).." • Vitality: +"..doMathDecimal(vit).."")

local happy = getItemAttribute(pokeball.uid, "happy")

doItemSetAttribute(pokeball.uid, "happy", happy + happyGainedOnEvolution)

if happy + happyGainedOnEvolution > 255 then

doItemSetAttribute(pokeball.uid, "happy", 255)

end

adjustStatus(pk, pokeball.uid, true, false)

if useKpdoDlls then

doUpdateMoves(cid)

end

end

 

function givePokemonExp(cid, item, expe, pct, rarecandy)

if expe <= 0 or not isCreature(cid) then return true end

local leveltable = getPokemonExperienceTable(getPokeballName(item.uid, true))

if getItemAttribute(item.uid, "exp") + expe > leveltable[100] then

givePokemonExp(cid, item, leveltable[100] - getItemAttribute(item.uid, "exp"))

return true

end

doItemSetAttribute(item.uid, "exp", getItemAttribute(item.uid, "exp") + expe)

doItemSetAttribute(item.uid, "happy", getItemAttribute(item.uid, "happy") + 1)

doItemSetAttribute(item.uid, "nextlevelexp", getItemAttribute(item.uid, "nextlevelexp") - expe)

 

if pct then

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item.uid).." has received "..expe.." experience points ("..pct.."%).")

else

if getItemAttribute(item.uid, "nextlevelexp") > 0 then

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item.uid).." ["..getItemAttribute(item.uid, "level").."] has received "..expe.." experience points ("..getItemAttribute(item.uid, "nextlevelexp").." to next level).")

else

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item.uid).." ["..getItemAttribute(item.uid, "level").."] has received "..expe.." experience points and has leveled up!")

end

end

if isBeingUsed(item.itemid) then

doSendAnimatedText(getThingPos(getCreatureSummons(cid)[1]), expe, 215)

end

if getItemAttribute(item.uid, "nextlevelexp") <= 0 then

local summon = getCreatureSummons(cid)[1]

 

if not isCreature(summon) then return true end

doSendFlareEffect(getThingPos(summon))

doSendAnimatedText(getThingPos(summon), "Level up!", 215)

adjustPokemonLevel(item.uid, cid, item.itemid)

end

end

 

function givePokemonExpInBp(cid, item, expe, ballid, pct, hidemessage)

if expe <= 0 or not isCreature(cid) then return true end

local leveltable = getPokemonExperienceTable(getPokeballName(item, true))

if getItemAttribute(item, "exp") + expe > leveltable[100] then

givePokemonExpInBp(cid, item, leveltable[100] - getItemAttribute(item, "exp"), ballid)

return true

end

doItemSetAttribute(item, "exp", getItemAttribute(item, "exp") + expe)

doItemSetAttribute(item, "happy", getItemAttribute(item, "happy") + 1)

doItemSetAttribute(item, "nextlevelexp", getItemAttribute(item, "nextlevelexp") - expe)

if not hidemessage then

if pct then

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item).." has received "..expe.." experience points ("..pct.."%).")

else

if getItemAttribute(item, "nextlevelexp") > 0 then

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item).." ["..getItemAttribute(item, "level").."] has received "..expe.." experience points inside his pokeball ("..getItemAttribute(item, "nextlevelexp").." to next level).")

else

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item).." ["..getItemAttribute(item, "level").."] has received "..expe.." experience points and has leveled up inside his pokeball.")

adjustPokemonLevel(item, cid, ballid)

end

end

end

end

function doMathDecimal(number, casas)

if math.floor(number) == number then return number end

local c = casas and casas + 1 or 3

for a = 0, 10 do

if math.floor(number) < math.pow(10, a) then

local str = string.sub(""..number.."", 1, a + c)

return tonumber(str)

end

end

return number

end

function adjustPokemonLevel(item, cid, id, rarecandy)

if not isCreature(cid) then return true end

local exp = getItemAttribute(item, "exp")

local level = getItemAttribute(item, "level")

local leveltable = getPokemonExperienceTable(getPokeballName(item, true))

local newlevel = 1

for x = 1, 100 do

if exp >= leveltable[x] and exp < leveltable[x+1] then

newlevel = x

end

end

if newlevel <= 1 then return true end

local levelsup = (newlevel - level)

local pokemon = getItemAttribute(item, "poke")

local happy = getItemAttribute(item, "happy")

local rate = happy / 100

local newhappiness = happy

if happy >= 250 then

newhappiness = 255

elseif happy >= 230 then

newhappiness = happy + 4

elseif happy >= 210 then

newhappiness = happy + 6

elseif happy >= 180 then

newhappiness = happy + 8

elseif happy >= 140 then

newhappiness = happy + 10

elseif happy >= 110 then

newhappiness = happy + 12

else

newhappiness = happy + 15

end

local status = getPokemonStatus(pokemon)

local off = status.off * rate * levelsup

local def = status.def * rate * levelsup

local agi = status.agi * rate * levelsup

local spatk = status.spatk * rate * levelsup

local vit = status.vit * rate * levelsup

doItemSetAttribute(item, "level", newlevel)

if not rarecandy then

doItemSetAttribute(item, "happy", newhappiness)

end

local nextexp = leveltable[newlevel + 1] - exp

doItemSetAttribute(item, "nextlevelexp", nextexp)

doItemSetAttribute(item, "offense", getItemAttribute(item, "offense") + off)

doItemSetAttribute(item, "defense", getItemAttribute(item, "defense") + def)

doItemSetAttribute(item, "speed", getItemAttribute(item, "speed") + agi)

doItemSetAttribute(item, "specialattack", getItemAttribute(item, "specialattack") + spatk)

doItemSetAttribute(item, "vitality", getItemAttribute(item, "vitality") + vit)

if newlevel > getPlayerLevel(cid) + pokemonMaxLevelAbovePlayer then

addEvent(doPlayerSendTextMessage, 30, cid, 18, "Warning: Your "..getPokeballName(item).."'s ["..newlevel.."] level is much higher than yours, so you will not be able to call him to battles.")

end

if isCreature(cid) and id >= 1 and isBeingUsed(id) then

adjustStatus(getCreatureSummons(cid)[1], item, false, true)

doPlayerSendTextMessage(cid, 27, "• Level: "..newlevel.." (+"..levelsup..") • Offense: +"..doMathDecimal(off).." • Defense: +"..doMathDecimal(def).." • Spc. Atk: +"..doMathDecimal(spatk).." • Agility: +"..doMathDecimal(agi).." • Vitality: +"..doMathDecimal(vit).."")

if happy < minHappyToEvolve then return true end

if pokemonsCanEvolveByLevel then

local summon = getCreatureSummons(cid)[1]

local reqlevel = poevo[getCreatureName(summon)] and poevo[getCreatureName(summon)].level or -1

local level = getItemAttribute(item, "level")

local evolution = "none"

local name = getCreatureName(summon)

if name == "Tyrogue" and level >= 20 then

if getOffense(summon) == getDefense(summon) then

evolution = "Hitmontop"

elseif getOffense(summon) > getDefense(summon) then

evolution = "Hitmonlee"

else

evolution = "Hitmonchan"

end

elseif name == "Eevee" then

if happy >= maxHappyToEvolve then

if isDay() then

evolution = "Espeon"

else

evolution = "Umbreon"

end

end

elseif name == "Slowpoke" and level >= 28 then

evolution = "Slowbro"

elseif name == "Poliwhirl" and level >= 36 then

evolution = "Poliwrath"

elseif reqlevel > 4 and level >= reqlevel then

evolution = poevo[getCreatureName(summon)].evolution

elseif reqlevel == 2 and happy >= maxHappyToEvolve then

evolution = poevo[getCreatureName(summon)] and poevo[getCreatureName(summon)].evolution or "none"

end

if evolution ~= "none" then

doStartEvolution(summon, evolution, 4)

end

end

end

end

function adjustStatus(pk, item, health, vite, conditions)

if not isCreature(pk) then return true end

local bonusoffense = getItemAttribute(item, boffense) or 0

local bonusdefense = getItemAttribute(item, bdefense) or 0

local bonusagility = getItemAttribute(item, bagility) or 0

local bonussattack = getItemAttribute(item, bsattack) or 0

setPlayerStorageValue(pk, 1000, getItemAttribute(item, "level"))

setPlayerStorageValue(pk, 1001, getItemAttribute(item, "offense") + bonusoffense)

setPlayerStorageValue(pk, 1002, getItemAttribute(item, "defense") + bonusdefense)

setPlayerStorageValue(pk, 1003, getItemAttribute(item, "speed") + bonusagility)

setPlayerStorageValue(pk, 1005, getItemAttribute(item, "specialattack") + bonussattack)

local gender = getItemAttribute(item, "gender") and getItemAttribute(item, "gender") or 0

doCreatureSetSkullType(pk, gender)

if vite == true then

local pct = getCreatureHealth(pk) / getCreatureMaxHealth(pk)

local vit = getItemAttribute(item, "vitality") - getPlayerStorageValue(pk, 1004)

setCreatureMaxHealth(pk, getCreatureMaxHealth(pk) + ( vit * HPperVIT ))

doCreatureAddHealth(pk, pct * vit * HPperVIT)

end

setPlayerStorageValue(pk, 1004, getItemAttribute(item, "vitality"))

doRegainSpeed(pk)

local nick = getItemAttribute(item, "poke")

if getItemAttribute(item, "nick") then

nick = getItemAttribute(item, "nick")

end

setPlayerStorageValue(pk, 1007, nick)

local boostlevel = getItemAttribute(item, "boost") or 0

local boostshow = hideBoost and "]" or " + "..boostlevel.."]"

local lvlstr = ""

if showBoostSeparated then

boostshow = hideBoost and "]" or "] [+"..boostlevel.."]"

end

if hideSummonsLevel then

if not hideBoost then

nick = nick.." [+"..boostlevel.."]"

end

else

nick = nick.." ["..getItemAttribute(item, "level")..""..boostshow..""

end

doCreatureSetNick(pk, nick)

if not getItemAttribute(item, "happy") then

doItemSetAttribute(item, "happy", 120)

end

if not getItemAttribute(item, "hunger") then

doItemSetAttribute(item, "hunger", 5)

end

local happy = getItemAttribute(item, "happy")

if happy < 0 then

happy = 0

end

setPlayerStorageValue(pk, 1008, happy)

local hunger = getItemAttribute(item, "hunger")

setPlayerStorageValue(pk, 1009, hunger)

if health == true then

local mh = getCreatureMaxHealth(pk) + HPperVIT * getVitality(pk)

local rd = 1 - (tonumber(getItemAttribute(item, "hp")))

setCreatureMaxHealth(pk, mh)

doCreatureAddHealth(pk, getCreatureMaxHealth(pk))

doCreatureAddHealth(pk, -(getCreatureMaxHealth(pk) * rd))

end

if isSummon(pk) and conditions then

local burn = getItemAttribute(item, "burn")

if burn and burn >= 0 then

addEvent(doAdvancedBurn, 5000, pk, pk, getItemAttribute(item, "burndmg"), burn - 1)

end

local poison = getItemAttribute(item, "poison")

if poison and poison >= 0 then

addEvent(doAdvancedPoison, 2500, pk, pk, getItemAttribute(item, "poisondmg"), poison - 1)

end

if getItemAttribute(item, "confuse") and getItemAttribute(item, "confuse") >= 1 then

addEvent(doAdvancedConfuse, 1200, pk, getItemAttribute(item, "confuse"), getPlayerStorageValue(pk, 3891))

end

if getItemAttribute(item, "blind") and getItemAttribute(item, "blind") >= 1 then

addEvent(doBlind, 300, pk, getItemAttribute(item, "blind"), getItemAttribute(item, "blindef"))

end

if getItemAttribute(item, "sleep") and getItemAttribute(item, "sleep") >= 1 then

doSleep(pk, getItemAttribute(item, "sleep"))

end

end

return true

end

function setWildPokemonLevel(cid, optionalLevel, optionalStatus, optionalNick, optionalExtraExp)

if not isCreature(cid) then return true end

local levelRange = 0

local off = 0

local def = 0

local agi = 0

local spatk = 0

local vit = 0

local this = getCreatureName(cid)

local ee = 1

if optionalExtraExp then

ee = optionalExtraExp

end

 

if optionalLevel and tonumber(optionalLevel) >= 1 then

if optionalLevel <= 100 then

levelRange = optionalLevel

else

levelRange = 100

end

elseif getCreatureOutfit(cid).lookHead and getCreatureOutfit(cid).lookBody and getCreatureOutfit(cid).lookHead <= getCreatureOutfit(cid).lookBody then

levelRange = math.random(getCreatureOutfit(cid).lookHead, getCreatureOutfit(cid).lookBody)

else

levelRange = math.random(20, 30)

end

local status = getPokemonStatus(this)

if status then

off = status.off

def = status.def

agi = status.agi

vit = status.vit

spatk = status.spatk

end

setPlayerStorageValue(cid, 1000, levelRange)

if optionalStatus and optionalStatus.off then

setPlayerStorageValue(cid, 1001, optionalStatus.offense)

setPlayerStorageValue(cid, 1002, optionalStatus.defense)

setPlayerStorageValue(cid, 1003, optionalStatus.agility)

setPlayerStorageValue(cid, 1004, optionalStatus.vitality)

setPlayerStorageValue(cid, 1005, optionalStatus.specialattack)

setPlayerStorageValue(cid, 1011, optionalStatus.offense)

setPlayerStorageValue(cid, 1012, optionalStatus.defense)

setPlayerStorageValue(cid, 1013, optionalStatus.agility)

setPlayerStorageValue(cid, 1014, optionalStatus.vitality)

setPlayerStorageValue(cid, 1015, optionalStatus.specialattack)

else

setPlayerStorageValue(cid, 1001, 5 + math.random(off * levelRange * 0.9, off * levelRange * 1.8))

setPlayerStorageValue(cid, 1002, 5 + math.random(def * levelRange * 0.9, def * levelRange * 1.8))

setPlayerStorageValue(cid, 1003, math.random(agi * levelRange * 0.9, agi * levelRange * 1.8))

setPlayerStorageValue(cid, 1004, math.random(vit * levelRange * 0.9, vit * levelRange * 1.8))

setPlayerStorageValue(cid, 1005, 5 + math.random(spatk * levelRange * 0.9, spatk * levelRange * 1.8))

setPlayerStorageValue(cid, 1011, getPlayerStorageValue(cid, 1001))

setPlayerStorageValue(cid, 1012, getPlayerStorageValue(cid, 1002))

setPlayerStorageValue(cid, 1013, getPlayerStorageValue(cid, 1003))

setPlayerStorageValue(cid, 1014, getPlayerStorageValue(cid, 1004))

setPlayerStorageValue(cid, 1015, getPlayerStorageValue(cid, 1005))

end

doRegainSpeed(cid)

setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + getPlayerStorageValue(cid, 1004) * HPperVIT * vitReductionForWild)

doCreatureAddHealth(cid, getCreatureMaxHealth(cid))

if pokes[getCreatureName(cid)].exp then

--getMonsterInfo(getCreatureName(cid)).experience

local exp = (50 + pokes[getCreatureName(cid)].exp) * baseExpRate + pokes[getCreatureName(cid)].vitality * levelRange * pokemonExpPerLevelRate

setPlayerStorageValue(cid, 1006, exp * generalExpRate * ee)

end

local wildshow = wildBeforeNames and "Wild " or ""

if optionalNick then

if hideWildsLevel then

doCreatureSetNick(cid, optionalNick)

else

doCreatureSetNick(cid, optionalNick.." ["..getWildPokemonLevel(cid).."]")

end

else

if hideWildsLevel then

doCreatureSetNick(cid, ""..wildshow..""..getCreatureName(cid).."")

else

doCreatureSetNick(cid, ""..wildshow..""..getCreatureName(cid).." ["..getWildPokemonLevel(cid).."]")

end

end

end

function getOffense(cid)

if not isCreature(cid) then return 0 end

if getPlayerStorageValue(cid, 3894) >= 1 then

return tonumber(getPlayerStorageValue(cid, 1001)) / 2

end

return tonumber(getPlayerStorageValue(cid, 1001))

end

function getDefense(cid)

if not isCreature(cid) then return 0 end

if getPlayerStorageValue(cid, 3894) >= 1 then

return tonumber(getPlayerStorageValue(cid, 1002)) / 2

end

return tonumber(getPlayerStorageValue(cid, 1002))

end

function getSpeed(cid)

if not isCreature(cid) then return 0 end

return tonumber(getPlayerStorageValue(cid, 1003))

end

function getVitality(cid)

if not isCreature(cid) then return 0 end

return tonumber(getPlayerStorageValue(cid, 1004))

end

function getSpecialAttack(cid)

if not isCreature(cid) then return 0 end

return tonumber(getPlayerStorageValue(cid, 1005))

end

function getHappiness(cid)

if not isCreature(cid) then return 0 end

return tonumber(getPlayerStorageValue(cid, 1008))

end

function getSpecialDefense(cid)

if not isCreature(cid) then return 0 end

return getSpecialAttack(cid) * 0.85 + getDefense(cid) * 0.2

end

function getWildPokemonExp(cid)

return getPlayerStorageValue(cid, 1006)

end

function getWildPokemonLevel(cid)

return getPlayerStorageValue(cid, 1000)

end

function getLevel(cid)

if isSummon(cid) then

return getItemAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "level")

end

return getPlayerStorageValue(cid, 1000)

end

function getPokeName(cid)

if not isSummon(cid) then return getCreatureName(cid) end

if getCreatureName(cid) == "Evolution" then return getPlayerStorageValue(cid, 1007) end

local item = getPlayerSlotItem(getCreatureMaster(cid), 8)

if getItemAttribute(item.uid, "nick") then

return getItemAttribute(item.uid, "nick")

end

return getCreatureName(cid)

end

function getPokeballName(item, truename)

if not truename and getItemAttribute(item, "nick") then

return getItemAttribute(item, "nick")

end

return getItemAttribute(item, "poke")

end

function getPokemonName(cid)

return getCreatureName(cid)

end

function getPokemonLevel(cid)

if not isCreature(cid) then return 0 end

return getPlayerStorageValue(cid, 1000)

end

function getPokemonGender(cid)

return getCreatureSkullType(cid)

end

Verifique se todos os pokes estão configurados no configuration.lua

seu lvl system de principio nao ha erros.

Link para o comentário
Compartilhar em outros sites

@Tópico tem um erro grave no servido!! quando um player esta em batalha com um pokemon (exemplo Onix), quando o player mata Onix, poke do player sobe de level.. E o corpo do Onix Desaparece!!

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

@Tyruz

 

Porfavor, coloque os créditos dos ataques do Johtos para min, eu que fiz esses ataques o Fuzion estava na minha Equipe , e ele postou =/

Pelo jeito não da pra confiar em ninguém hoje em dia.

ele não pediu a sua permissão para posta??... Um cara desse deveria esta na cadeia! resp+ pra vocÊ!

 

cheguei no nível CAVALEIRO 100 posts ! mdr.gif

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

@Thedjhabbo

 

Obrigado, cara eles já pegaram quase tudo do meu Servidor cara, não da mais pra confiar em ninguém, já me pegaram Mapa, Site e agora os Moves do Johtos, não querem meu Servidor inteiro pra vocês não ?

 

 

Edit -

 

E oque eu mais acho legal, é que eles colocam os Créditos para quem pegou, e postou , e não para quem fez =/ e não pedem minha autorização para postar.

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

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