Demonstração de como eu quero Mightyena (1) um nível de 100 o
to querendo colocar um nível a 1 a 100 para saber que criar o pokemon esta pois eu upo meu pokemon e aparecer no chat e muito chato alguém o script ai ?, meu script do sistema de nível deixa aqui e faz mesas de nível sendo que o poketibia com uma 2 geração na 3 geração esta imcompleta ainda
servidor / data / lib / level system
function getPokemonBaseStatus(name, multiplier)local a = pokes[name]local m =1ifnot a thenreturnfalseendifnot a.offense thenreturnfalseendif multiplier then m = multiplier endlocal 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
endfunction getPokemonStatus(name, multiplier)local a = pokes[name]local m =1ifnot a thenreturnfalseendifnot a.offense thenreturnfalseendif multiplier then m = multiplier endlocal 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
endfunction getPokeballStatus(owner,pokeball)local a = getItemAttribute(owner,pokeball.uid,"poke")ifnot a thenreturnfalseendlocal ret ={}
ret.off = getItemAttribute(owner,pokeball.uid,"offense")
ret.offense = getItemAttribute(owner,pokeball.uid,"offense")
ret.def= getItemAttribute(owner,pokeball.uid,"defense")
ret.defense = getItemAttribute(owner,pokeball.uid,"defense")
ret.agi = getItemAttribute(owner,pokeball.uid,"speed")
ret.agility = getItemAttribute(owner,pokeball.uid,"speed")
ret.spatk = getItemAttribute(owner,pokeball.uid,"specialattack")
ret.specialattack = getItemAttribute(owner,pokeball.uid,"specialattack")
ret.vit = getItemAttribute(owner,pokeball.uid,"vitality")
ret.vitality = getItemAttribute(owner,pokeball.uid,"vitality")return ret
endfunction getPokemonXMLOutfit(name)local johto =falsefor i =209,308do--alterado v2.6if oldpokedex[i][1]and oldpokedex[i][1]== name then
johto =trueendendif isShinyName(name)then
a ="data/monster/pokes/Shiny/"..name..".xml"
elseif johto then
a ="data/monster/pokes/geracao 2/"..name..".xml"--edited pra melhorar a pasta monster
else
a ="data/monster/pokes/geracao 1/"..name..".xml"endlocal 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(c)endfunction doEvolutionOutfit(cid, oldout, outfit)ifnot isCreature(cid)thenreturntrueendif getCreatureOutfit(cid).lookType == oldout then
doSetCreatureOutfit(cid,{lookType = outfit},-1)else
doSetCreatureOutfit(cid,{lookType = oldout},-1)endendfunction doStartEvolution(cid, evolution, seconds)ifnot isCreature(cid)thenreturntrueendlocal a = getPlayerStorageValue(cid,1007)local b = getCreatureHealth(cid)/ getCreatureMaxHealth(cid)local d = getThingPos(cid)local e = getCreatureMaster(cid)if getHappinessRate(cid)<1thenreturntrueendlocal 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)endfunction doSendEvolutionEffect(cid, pos, evolution, turn, ssj, evolve, f, h)ifnot isCreature(cid)then
doSendAnimatedText(pos,"CANCEL",215)returntrueendif evolve then
doEvolvePokemon(getCreatureMaster(cid),{uid = cid}, evolution,0,0)returntrueend
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)endfunction sendSSJEffect(cid)ifnot isCreature(cid)thenreturntrueendlocal 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)endfunction sendFinishEvolutionEffect(cid, alternate)ifnot isCreature(cid)thenreturntrueendlocal pos1 = getThingPos(cid)if alternate thenlocal 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,8dolocal 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)endelsefor a =0,3do
doSendDistanceShoot(pos1, getPosByDir(pos1, a),37)endfor a =4,7do
addEvent(doSendDistanceShoot,600, pos1, getPosByDir(pos1, a),37)endendendfunction doEvolvePokemon(cid, item2, theevo, stone1, stone2)ifnot isCreature(cid)thenreturntrueendifnot pokes[theevo]ornot pokes[theevo].offense then
doReturnPokemon(cid, item2.uid, getPlayerSlotItem(cid,8), pokeballs[getPokeballType(getPlayerSlotItem(cid,8).itemid)].effect,false,true)returntrueendlocal 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 happy = getItemAttribute(pokeball.uid,"happy")
doItemSetAttribute(pokeball.uid,"happy", happy + happyGainedOnEvolution)if happy + happyGainedOnEvolution >255then
doItemSetAttribute(pokeball.uid,"happy",255)end
adjustStatus(pk, pokeball.uid,true,false)if useKpdoDlls then
doUpdateMoves(cid)endendfunction givePokemonExp(cid, item, expe, pct, rarecandy)if expe <=0ornot isCreature(cid)thenreturntrueendlocal leveltable = getPokemonExperienceTable(getPokeballName(item.uid,true))if getItemAttribute(item.uid,"exp")+ expe > leveltable[100]then
givePokemonExp(cid, item, leveltable[100]- getItemAttribute(item.uid,"exp"))returntrueend
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,19,"Seu "..getPokeballName(item.uid).." recebeu ("..expe..") pontos de experiencia ("..pct.."%).")elseif getItemAttribute(item.uid,"nextlevelexp")>0then
doPlayerSendTextMessage(cid,19,"Seu Pokemon "..getPokeballName(item.uid).." ["..getItemAttribute(item.uid,"level").."] recebeu ("..expe..") de experiencia. Faltam ("..getItemAttribute(item.uid,"nextlevelexp")..") de experiencia para o próximo level.")else
doPlayerSendTextMessage(cid,19,"[LEVEL UP] Parabens, seu Pokemon "..getPokeballName(item.uid).." ["..getItemAttribute(item.uid,"level").."] recebeu ("..expe..") de experiencia e avançou de level!")endendif isBeingUsed(item.itemid)then
doSendAnimatedText(getThingPos(getCreatureSummons(cid)[1]), expe,215)endif getItemAttribute(item.uid,"nextlevelexp")<=0thenlocal summon = getCreatureSummons(cid)[1]ifnot isCreature(summon)thenreturntrueend
doSendFlareEffect(getThingPos(summon))
setPlayerStorageValue(summon,5050,getPlayerStorageValue(summon,5050)+1)------ STORAGE QUE GANHA AO UPAR DE LVL POKE
doSendAnimatedText(getThingPos(summon),"Level UP!",215)
adjustPokemonLevel(item.uid, cid, item.itemid)
doCreatureAddHealth(summon, getCreatureMaxHealth(summon))endendfunction givePokemonExpInBp(cid, item, expe, ballid, pct, hidemessage)if expe <=0ornot isCreature(cid)thenreturntrueendlocal leveltable = getPokemonExperienceTable(getPokeballName(item,true))if getItemAttribute(item,"exp")+ expe > leveltable[100]then
givePokemonExpInBp(cid, item, leveltable[100]- getItemAttribute(item,"exp"), ballid)returntrueend
doItemSetAttribute(item,"exp", getItemAttribute(item,"exp")+ expe)
doItemSetAttribute(item,"happy", getItemAttribute(item,"happy")+1)
doItemSetAttribute(item,"nextlevelexp", getItemAttribute(item,"nextlevelexp")- expe)ifnot hidemessage thenif pct then
doPlayerSendTextMessage(cid,19,"Seu "..getPokeballName(item).." Recebeu ("..expe..") experience points ("..pct.."%).")elseif getItemAttribute(item,"nextlevelexp")>0then
doPlayerSendTextMessage(cid,19,"Seu "..getPokeballName(item).." ["..getItemAttribute(item,"level").."] recebeu ("..expe..") de experiencia dentro de sua pokeball. Faltam ("..getItemAttribute(item,"nextlevelexp")..") de experiencia para o próximo level.")else
doPlayerSendTextMessage(cid,19,"Seu "..getPokeballName(item).." ["..getItemAttribute(item,"level").."] recebeu ("..expe..") de experiencia, e avançou de level dentro de sua Pokeball!.")
adjustPokemonLevel(item, cid, ballid)endendendendfunction doMathDecimal(number, casas)if math.floor(number)== number thenreturn number endlocal c = casas and casas +1or3for a =0,10doif math.floor(number)< math.pow(10, a)thenlocal str =string.sub(""..number.."",1, a + c)return tonumber(str)endendreturn number
endfunction adjustPokemonLevel(item, cid, id, rarecandy)ifnot isCreature(cid)thenreturntrueendlocal exp = getItemAttribute(item,"exp")local level = getItemAttribute(item,"level")local bonus_level = getItemAttribute(item,"b_level")or0local leveltable = getPokemonExperienceTable(getPokeballName(item,true))local newlevel =1for x =1,100doif exp >= leveltable[x]and exp < leveltable[x+1]then
newlevel = x
endendif newlevel <=1thenreturntrueendlocal levelsup =(newlevel - level)local pokemon = getItemAttribute(item,"poke")local happy = getItemAttribute(item,"happy")local rate = happy / happy
local newhappiness = happy
if happy >=250then
newhappiness =255
elseif happy >=230then
newhappiness = happy +4
elseif happy >=210then
newhappiness = happy +6
elseif happy >=180then
newhappiness = happy +8
elseif happy >=140then
newhappiness = happy +10
elseif happy >=110then
newhappiness = happy +12else
newhappiness = happy +15endlocal status = getPokemonStatus(pokemon)local off = status.off * rate * levelsup
localdef= 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)
doItemSetAttribute(item,"b_level", bonus_level +1)ifnot rarecandy then
doItemSetAttribute(item,"happy", newhappiness)endlocal 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.")endif isCreature(cid)and id >=1and 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 thenreturntrueendif pokemonsCanEvolveByLevel thenlocal summon = getCreatureSummons(cid)[1]local reqlevel = poevo[getCreatureName(summon)]and poevo[getCreatureName(summon)].level or-1local level = getItemAttribute(item,"level")local evolution ="none"local name = getCreatureName(summon)if name =="Tyrogue"and level >=20thenif getOffense(summon)== getDefense(summon)then
evolution ="Hitmontop"
elseif getOffense(summon)> getDefense(summon)then
evolution ="Hitmonlee"else
evolution ="Hitmonchan"end
elseif name =="Eevee"thenif happy >= maxHappyToEvolve thenif isDay()then
evolution ="Espeon"else
evolution ="Umbreon"endend
elseif name =="Slowpoke"and level >=28then
evolution ="Slowbro"
elseif name =="Poliwhirl"and level >=36then
evolution ="Poliwrath"
elseif reqlevel >4and level >= reqlevel then
evolution = poevo[getCreatureName(summon)].evolution
elseif reqlevel ==2and happy >= maxHappyToEvolve then
evolution = poevo[getCreatureName(summon)]and poevo[getCreatureName(summon)].evolution or"none"endif evolution ~="none"then
doStartEvolution(summon, evolution,4)endendendendfunction doAdjustWithDelay(cid, pk, health, vit, status)if isCreature(cid)then--alterado v2.5ifnot isCreature(cid)thenreturntrueend
adjustStatus(pk, getPlayerSlotItem(cid,8).uid, health, vir, status)endendfunction adjustStatus(pk, item, health, vite, conditions)ifnot isCreature(pk)thenreturntrueendlocal bonusoffense = getItemAttribute(item, boffense)or0local bonusdefense = getItemAttribute(item, bdefense)or0local bonusagility = getItemAttribute(item, bagility)or0local bonussattack = getItemAttribute(item, bsattack)or0if(getItemAttribute(item,"ehditto")==1)then
setPlayerStorageValue(pk,1000, getItemAttribute(item,"level"))
setPlayerStorageValue(pk,1001, getItemAttribute(item,"offense")+ bonusoffense *0.75)
setPlayerStorageValue(pk,1002, getItemAttribute(item,"defense")+ bonusdefense *0.75)
setPlayerStorageValue(pk,1003, getItemAttribute(item,"speed")+ bonusagility *0.75)
setPlayerStorageValue(pk,1005, getItemAttribute(item,"specialattack")+ bonussattack *0.75)
elseif (getItemAttribute(item,"ehshinyditto")==1)then
setPlayerStorageValue(pk,1000, getItemAttribute(item,"level"))
setPlayerStorageValue(pk,1001, getItemAttribute(item,"offense")+ bonusoffense *0.50)
setPlayerStorageValue(pk,1002, getItemAttribute(item,"defense")+ bonusdefense *0.50)
setPlayerStorageValue(pk,1003, getItemAttribute(item,"speed")+ bonusagility *0.50)
setPlayerStorageValue(pk,1005, getItemAttribute(item,"specialattack")+ bonussattack *0.50)else
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)end-- setPlayerStorageValue(pk,1000, pokes[getCreatureName(pk)].level)-- setPlayerStorageValue(pk,1001, pokes[getCreatureName(pk)].offense *(getMasterLevel(pk)+ getPokemonBoost(pk)))-- setPlayerStorageValue(pk,1002, pokes[getCreatureName(pk)].defense)-- setPlayerStorageValue(pk,1003, pokes[getCreatureName(pk)].agility)-- setPlayerStorageValue(pk,1004, pokes[getCreatureName(pk)].vitality *(getMasterLevel(pk)+ getPokemonBoost(pk)))-- setPlayerStorageValue(pk,1005, pokes[getCreatureName(pk)].specialattack *(getMasterLevel(pk)+ getPokemonBoost(pk)))--endlocal gender = getItemAttribute(item,"gender")and getItemAttribute(item,"gender")or0
doCreatureSetSkullType(pk, gender)if vite ==truethenlocal 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"))-- retirar caso n funfar
doRegainSpeed(pk)local nick = getItemAttribute(item,"poke")ifstring.find(tostring(nick),"Shiny")then
nick = tostring(nick):match("Shiny (.*)")endifstring.find(tostring(nick),"Mega ")then
nick = tostring(nick):match("Mega (.*)")endif getItemAttribute(item,"nick")then
nick = getItemAttribute(item,"nick")endif isGhostPokemon(pk)then
setPlayerStorageValue(pk,8981,1)
updateGhostWalk(pk)end
setPlayerStorageValue(pk,1007, nick)local boostlevel = getItemAttribute(item,"boost")or0local boostshow = hideBoost and"]"or" + "..boostlevel.."]"local lvlstr =""if showBoostSeparated then
boostshow = hideBoost and"]"or"] [+"..boostlevel.."]"endif hideSummonsLevel thenifnot hideBoost then
nick = nick.." [+"..boostlevel.."]"else
nick = nick.." ["..getItemAttribute(item,"level")..""..boostshow..""endend
doCreatureSetNick(pk, nick)ifnot getItemAttribute(item,"happy")then
doItemSetAttribute(item,"happy",120)endifnot getItemAttribute(item,"hunger")then
doItemSetAttribute(item,"hunger",5)endlocal happy = getItemAttribute(item,"happy")if happy <0then
happy =1end
setPlayerStorageValue(pk,1008, happy)local hunger = getItemAttribute(item,"hunger")
setPlayerStorageValue(pk,1009, hunger)if health ==truethenlocal 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))endif isSummon(pk)and conditions then--alterado v2.5 daki pra baixo!!local burn = getItemAttribute(item,"burn")if burn and burn >=0thenlocal ret ={id = pk, cd = burn, check =false, damage = getItemAttribute(item,"burndmg"), cond ="Burn"}
addEvent(doCondition2,3500, ret)endlocal poison = getItemAttribute(item,"poison")if poison and poison >=0thenlocal ret ={id = pk, cd = poison, check =false, damage = getItemAttribute(item,"poisondmg"), cond ="Poison"}
addEvent(doCondition2,1500, ret)endlocal confuse = getItemAttribute(item,"confuse")if confuse and confuse >=0thenlocal ret ={id = pk, cd = confuse, check =false, cond ="Confusion"}
addEvent(doCondition2,1200, ret)--alterado v2.5endlocal sleep = getItemAttribute(item,"sleep")if sleep and sleep >=0thenlocal ret ={id = pk, cd = sleep, check =false, first =true, cond ="Sleep"}
doCondition2(ret)endlocal miss = getItemAttribute(item,"miss")if miss and miss >=0thenlocal ret ={id = pk, cd = miss, eff = getItemAttribute(item,"missEff"), check =false, spell = getItemAttribute(item,"missSpell"), cond ="Miss"}
doCondition2(ret)endlocal fear = getItemAttribute(item,"fear")if fear and fear >=0thenlocal ret ={id = pk, cd = fear, check =false, skill = getItemAttribute(item,"fearSkill"), cond ="Fear"}
doCondition2(ret)endlocal silence = getItemAttribute(item,"silence")if silence and silence >=0thenlocal ret ={id = pk, cd = silence, eff = getItemAttribute(item,"silenceEff"), check =false, cond ="Silence"}
doCondition2(ret)endlocal stun = getItemAttribute(item,"stun")if stun and stun >=0thenlocal ret ={id = pk, cd = stun, eff = getItemAttribute(item,"stunEff"), check =false, spell = getItemAttribute(item,"stunSpell"), cond ="Stun"}
doCondition2(ret)endlocal paralyze = getItemAttribute(item,"paralyze")if paralyze and paralyze >=0thenlocal ret ={id = pk, cd = paralyze, eff = getItemAttribute(item,"paralyzeEff"), check =false, first =true, cond ="Paralyze"}
doCondition2(ret)endlocal slow = getItemAttribute(item,"slow")if slow and slow >=0thenlocal ret ={id = pk, cd = slow, eff = getItemAttribute(item,"slowEff"), check =false, first =true, cond ="Slow"}
doCondition2(ret)endlocal leech = getItemAttribute(item,"leech")if leech and leech >=0thenlocal ret ={id = pk, cd = leech, attacker =0, check =false, damage = getItemAttribute(item,"leechdmg"), cond ="Leech"}
doCondition2(ret)endfor i =1,3dolocal buff = getItemAttribute(item,"Buff"..i)if buff and buff >=0thenlocal ret ={id = pk, cd = buff, eff = getItemAttribute(item,"Buff"..i.."eff"), check =false,
buff = getItemAttribute(item,"Buff"..i.."skill"), first =true, attr ="Buff"..i}
doCondition2(ret)endendendif getItemAttribute(item,"boost")and getItemAttribute(item,"boost")==50and getItemAttribute(item,"aura")then
sendAuraEffect(pk, auraSyst[getItemAttribute(item,"aura")])--edited aura system
endif getPlayerStorageValue(getCreatureMaster(pk),6598754)>=1then
setPlayerStorageValue(pk,6598754,1)--edited pvp system
elseif getPlayerStorageValue(getCreatureMaster(pk),6598755)>=1then
setPlayerStorageValue(pk,6598755,1)endreturntrueendfunction setWildPokemonLevel(cid, optionalLevel, optionalStatus, optionalNick, optionalExtraExp)ifnot isCreature(cid)thenreturntrueendifnot pokes[getCreatureName(cid)]thenreturntrueend--alterado v2.6local levelRange =0local off =0localdef=0local agi =0local spatk =0local vit =0localthis= getCreatureName(cid)local ee =1if optionalExtraExp then
ee = optionalExtraExp
endif optionalLevel and tonumber(optionalLevel)>=1then--alterado v2.8\/
levelRange = optionalLevel
else
levelRange = math.random(pokes[this].wildLvlMin, pokes[this].wildLvlMax)endlocal status = getPokemonBaseStatus(this)if status then
off = status.off
def= status.def
agi = status.agi
vit = status.vit
spatk = status.spatk
end
setPlayerStorageValue(cid,1000,(levelRange >100and100or levelRange))--alterado v2.8if 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)if getPlayerStorageValue(cid,22546)==1then
setPlayerStorageValue(cid,1006,750)
doSetCreatureDropLoot(cid,false)--edited golden arena
endendlocal wildshow = wildBeforeNames and"Wild "or""if optionalNick thenif hideWildsLevel then
doCreatureSetNick(cid, optionalNick)else
doCreatureSetNick(cid, optionalNick.." ["..getWildPokemonLevel(cid).."]")endelseif hideWildsLevel then
doCreatureSetNick(cid,""..wildshow..""..getCreatureName(cid).."")endendendfunction getOffense(cid)ifnot isCreature(cid)thenreturn0end--[[if getPlayerStorageValue(cid,3894)>=1thenreturn tonumber(getPlayerStorageValue(cid,1001))/2end]]return tonumber(getPlayerStorageValue(cid,1001))endfunction getDefense(cid)ifnot isCreature(cid)thenreturn0end--[[if getPlayerStorageValue(cid,3894)>=1thenreturn tonumber(getPlayerStorageValue(cid,1002))/2end]]return tonumber(getPlayerStorageValue(cid,1002))endfunction getSpeed(cid)ifnot isCreature(cid)thenreturn0endreturn tonumber(getPlayerStorageValue(cid,1003))endfunction getVitality(cid)ifnot isCreature(cid)thenreturn0endreturn tonumber(getPlayerStorageValue(cid,1004))endfunction getSpecialAttack(cid)ifnot isCreature(cid)thenreturn0endreturn tonumber(getPlayerStorageValue(cid,1005))endfunction getHappiness(cid)ifnot isCreature(cid)thenreturn0endreturn tonumber(getPlayerStorageValue(cid,1008))endfunction getSpecialDefense(cid)ifnot isCreature(cid)thenreturn0endreturn getSpecialAttack(cid)*0.85+ getDefense(cid)*0.2endfunction getWildPokemonExp(cid)return getPlayerStorageValue(cid,1006)endfunction getWildPokemonLevel(cid)return getPlayerStorageValue(cid,1000)endfunction getLevel(cid)if isSummon(cid)thenreturn getItemAttribute(getPlayerSlotItem(getCreatureMaster(cid),8).uid,"level")endreturn getPlayerStorageValue(cid,1000)endfunction getPokeName(cid)ifnot isSummon(cid)thenreturn getCreatureName(cid)endif getCreatureName(cid)=="Evolution"thenreturn getPlayerStorageValue(cid,1007)endlocal item = getPlayerSlotItem(getCreatureMaster(cid),8)if getItemAttribute(item.uid,"nick")thenreturn getItemAttribute(item.uid,"nick")endifstring.find(tostring(getCreatureName(cid)),"Shiny")thenlocal newName = tostring(getCreatureName(cid)):match("Shiny (.*)")return newName
endreturn getCreatureName(cid)endfunction getPokeballName(item, truename)ifnot truename and getItemAttribute(item,"nick")thenreturn getItemAttribute(item,"nick")endreturn getItemAttribute(item,"poke")endfunction getPokemonName(cid)return getCreatureName(cid)endfunction getMasterLevel(poke)ifnot isSummon(poke)thenreturn0endreturn getPlayerLevel(getCreatureMaster(poke))--alterado v2.5endfunction getPokemonBoost(poke)ifnot isSummon(poke)thenreturn0end--alterado v2.5return getItemAttribute(getPlayerSlotItem(getCreatureMaster(poke),8).uid,"boost")or0endfunction getPokemonLevelByName(name)if tostring(name)then--alterado v2.5return pokes[name].level
endreturn0endfunction getPokemonLevel(cid)ifnot isCreature(cid)thenreturn0endreturn getPlayerStorageValue(cid,1000)endfunction getPokemonGender(cid)return getCreatureSkullType(cid)end
Pergunta
ldsajkdadaf 1
Base: pda com fonte tfs 0.3.6
Demonstração de como eu quero Mightyena (1) um nível de 100 o
to querendo colocar um nível a 1 a 100 para saber que criar o pokemon esta pois eu upo meu pokemon e aparecer no chat e muito chato alguém o script ai ?, meu script do sistema de nível deixa aqui e faz mesas de nível sendo que o poketibia com uma 2 geração na 3 geração esta imcompleta ainda
servidor / data / lib / level system
servidor/data/lib/level table
tava invisivel o texto antes
Link para o comentário
Compartilhar em outros sites
7 respostass a esta questão
Posts Recomendados