Ir para conteúdo
  • 0

[Resolvido] Erro script Pokedex


Kirsch

Pergunta

alguém pode me ajudar a corrigir esse erro ?

 

[Error - Action Interface]
data/actions/scripts/Basic/pokedex.lua:onUse
Description:
data/actions/scripts/Basic/pokedex.lua:13: bad argument #1 to 'lower' (string expected, got nil)
stack traceback:
        [C]: in function 'lower'
        data/actions/scripts/Basic/pokedex.lua:13: in function <data/actions/scripts/Basic/pokedex.lua:4>
bad argument #1 to 'lower' (string expected, got nil)

script :

local OPCODE_POKEDEX = opcodes.OPCODE_POKEDEX
local OPCODE_CREATE_POKEMONS = opcodes.OPCODE_CREATE_POKEMONS

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not isCreature(itemEx.uid) then return true end
	if getPlayerStorageValue(cid, storages.pokedexDelay) == 1 then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não use a pokedex tão rápido.")
	end
	local name = isPlayer(itemEx.uid) and getCreatureName(itemEx.uid) or getPokeName(itemEx.uid)
	local str = {}
 
	for pokeId = 1, 42 do
		local name = string.lower(string.explode(getItemNameById(11388+pokeId), "fainted ")[2])
		table.insert(str, ((pokeId > 9 and pokeId < 100) and "#0" or (pokeId < 10) and "#00" or "#")..pokeId)
		table.insert(str, " - "..(getPlayerStorageValue(cid, getPokeUniqueStorToDex(name)) == -1 and "??????" or doCorrectString(name)))
		table.insert(str, "|"..(getPlayerStorageValue(cid, getPokeUniqueStorToCatch(name)) == -1 and "false" or "true"))
		table.insert(str, "|".. getPokemonLevel(name))
		table.insert(str, "|".. getPokemonDescription(name))
		table.insert(str, "|".. getPokemonAttack(name))
		table.insert(str, "|".. getPokemonDefense(name))
		table.insert(str, "|".. getPokemonSpAttack(name))
		table.insert(str, "|".. getPokemonVitality(name))
		table.insert(str, "|".. getPokemonType1(name) .."".. (getPokemonType2(name) and "/".. getPokemonType2(name) or "") ..";")
	end

	if isMonster(itemEx.uid) or (isPlayer(itemEx.uid) and itemEx.uid == cid) then
		doSendPlayerExtendedOpcode(cid, OPCODE_CREATE_POKEMONS, table.concat(str))
		setPlayerStorageValue(cid, storages.pokedexDelay, 1)
		addEvent(setPlayerStorageValue, 3000, cid, storages.pokedexDelay, -1)
	end

	if isMonster(itemEx.uid) then
		if getPlayerStorageValue(cid, getPokeUniqueStorToDex(name)) == -1 then
			local exp = (getPokemonLevel(name) * 10) / 2
			setPlayerStorageValue(cid, getPokeUniqueStorToDex(name), 1)
			setPlayerStorageValue(cid, storages.pokedexSys, getPlayerStorageValue(cid, storages.pokedexSys) + 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você desbloqueou o pokemon "..doCorrectString(name).." e ganhou "..exp.." de experiencia.")
			doPlayerAddExp_2(cid, exp)
			doSendMagicEffect(getThingPos(cid), 91)
		end
		local pokeId = getPokemonPortrait(name) - 11539
		doSendPlayerExtendedOpcode(cid, OPCODE_POKEDEX, pokeId.."|"..doCorrectString(name).."|"..getPokemonLevel(name).."|"..(getPlayerStorageValue(cid, getPokeUniqueStorToCatch(name)) == -1 and "false" or "true").."|"..getPokemonDescription(name).."|"..getPokemonAttack(name).."|"..getPokemonDefense(name).."|"..getPokemonSpAttack(name).."|"..getPokemonVitality(name).."|".. getPokemonType1(name) .."".. (getPokemonType2(name) and "/".. getPokemonType2(name) or ""))
	elseif isPlayer(itemEx.uid) and itemEx.uid == cid then
		doSendPlayerExtendedOpcode(cid, OPCODE_POKEDEX, name)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você tem a pokedex de "..(getPlayerStorageValue(cid, storages.pokedexSys) + 1).." pokemon"..(getPlayerStorageValue(cid, storages.pokedexSys) + 1 == 1 and "" or "s").." de kanto.")
	end

return true
end

 

Link para o comentário
Compartilhar em outros sites

10 respostass a esta questão

Posts Recomendados

  • 0
local name = string.lower(string.explode(getItemNameById(11388+pokeId), "fainted ")[2])

 

eu sei que o poblema esta relacionado com essa linha, necessariamente esse valor 11388

 

 

image.thumb.png.0d93d3d161e00ab314c9f921ae4c31ed.png

quando eu troco esse valor ela para de pegar, porem quero adaptar, para a base dxp

e na base dxp com esse mesmo valor 11388 ela nao pega.

Link para o comentário
Compartilhar em outros sites

  • 0
2 horas atrás, Kirsch disse:

local name = string.lower(string.explode(getItemNameById(11388+pokeId), "fainted ")[2])

 

eu sei que o poblema esta relacionado com essa linha, necessariamente esse valor 11388

 

 

image.thumb.png.0d93d3d161e00ab314c9f921ae4c31ed.png

quando eu troco esse valor ela para de pegar, porem quero adaptar, para a base dxp

 e na base dxp com esse mesmo valor 11388 ela nao pega.

 

simples, faça um array com as id's dos corpse dos pokémons, depois ao invés de puxar o ID DO ITEM 11388 e somar ao pokeid que daria o corpse puxe o array nessa função ^_^ 

Link para o comentário
Compartilhar em outros sites

  • 0

poderia me dar um exemplo, estou testando algo parecido agora

não deu certo o que eu estava pensando :/

poderia dar um exemplo de como montar  o  array com as id's dos corpse dos pokémons e depois de como chamar no script ?

 

 

Eu sei que ele esta buscando os ids aqui, mais mesmo assim não funciona na base dxp  já fiz varias coisas  poderia me ajudar ? @Jair Kevick ?

pokesDescription = {
["bulbasaur"] = {"A strange seed was planted on its back at birth. The plant sprouts and grows with this Pokemon.", 1},
["ivysaur"] = {"When the bud on its back starts swelling, a sweet aroma wafts to indicate the flower's coming bloom.", 2},
["venusaur"] = {"There is a large flower on Venosaur's back. The flower is said to take on vivid colors if it gets plenty of nutrition and sunlight. The flower's aroma soothes the emotions of people.", 3},
["charmander"] = {"The fire on the tip of its tail is a measure of its life. If healthy, its tail burns intensely.", 4},
["charmeleon"] = {"If it becomes agitated during battle, it spouts intense flames, incinerating its surroundings.", 5},
["charizard"] = {"It spits fire that is hot enough to melt boulders. It may cause forest fires by blowing flames.", 6},
["squirtle"] = {"It shelters itself in its shell, then strikes back with spouts of water at every opportunity.", 7},
["wartortle"] = {"It often hides in water to stalk unwary prey. For fast swimming, it moves its ears to maintain balance.", 8},
["blastoise"] = {"The jets of water it spouts from the rocket cannons on its shell can punch through thick steel.", 9},
["caterpie"] = {"It is covered with a green skin. When it grows, it sheds the skin, covers itself with silk, and becomes a cocoon.", 10},
["metapod"] = {"A steel-hard shell protects its tender body. It quietly endures hardships while awaiting evolution.", 11},
["butterfree"] = {"It loves the honey of flowers and can locate flower patches that have even tiny amounts of pollen.", 12},
["weedle"] = {"Often found in forests and grasslands. It has a sharp, toxic barb of around two inches on top of its head.", 13},
["kakuna"] = {"While awaiting evolution, it hides from predators under leaves and in nooks of branches.", 14},
["beedrill"] = {"Its best attack involves flying around at high speed, striking with poison needles, then flying off.", 15},
["pidgey"] = {"It is docile and prefers to avoid conflict. If disturbed, however, it can ferociously strike back.", 16},
["pidgeotto"] = {"It flies over its wide territory in search of prey, downing it with its highly developed claws.", 17},
["pidgeot"] = {"By flapping its wings with all its might, Pidgeot can make a gust of wind capable of bending tall trees.", 18},
["rattata"] = {"Cautious in the extreme, its hardy vitality lets it live in any kind of environment.", 19},
["raticate"] = {"It whittles its constantly growing fangs by gnawing on hard things. It can chew apart cinder walls.", 20},
["spearow"] = {"It flaps its small wings busily to fly. Using its beak, it searches in grass for prey.", 21},
["fearow"] = {"It has the stamina to keep flying all day on its broad wings. It fights by using its sharp beak.", 22},
["ekans"] = {"It sneaks through grass without making a sound and strikes unsuspecting prey from behind.", 23},
["arbok"] = {"The pattern on its belly appears to be a frightening face. Weak foes will flee just at the sight of the pattern.", 24},
["pikachu"] = {"It stores electricity in the electric sacs on its cheeks. When it releases pent-up energy in a burst, the electric power is equal to a lightning bolt.", 25},
["raichu"] = {"If it stores too much electricity, its behavior turns aggressive. To avoid this, it occasionally discharges excess energy and calms itself down.", 26},
["sandshrew"] = {"To protect itself from attackers, it curls up into a ball. It lives in arid regions with minimal rainfall.", 27},
["sandslash"] = {"It curls up in a ball to protect itself from enemy attacks. It also curls up to prevent heatstroke during the daytime when temperatures rise sharply.", 28},
["nidoran female"] = {"While it does not prefer to fight, even one drop of the poison it secretes from barbs can be fatal.", 29},
["nidorina"] = {"The female's horns develop slowly. Prefers physical attacks such as clawing and biting.", 30},
["nidoqueen"] = {"Its entire body is armored with hard scales. It will protect the young in its burrow with its life.", 31},
["nidoran male"] = {"It scans its surroundings by raising its ears out of the grass. Its toxic horn is for protection.", 32},
["nidorino"] = {"It is easily angered. By swinging its well-developed horn wildly, it can even punch through diamond.", 33},
["nidoking"] = {"It is recognized by its rock-hard hide and its extended horn. Be careful with the horn as it contains venom.", 34},
["clefairy"] = {"Its adorable appearance makes it popular as a pet. However, it is rare and difficult to find.", 35},
["clefable"] = {"Rarely seen by people, it is said to be drawn by the full moon to play at deserted lakes.", 36},
["vulpix"] = {"It controls balls of fire. As it grows, its six tails split from their tips to make more tails.", 37},
["ninetales"] = {"It has long been said that each of the nine tails embody an enchanted power. A long-lived Ninetales will have fur that shines like gold.", 38},
["jigglypuff"] = {"It captivates foes with its huge, round eyes, then lulls them to sleep by singing a soothing melody.", 39},
["wigglytuff"] = {"Its fur is the ultimate in luxuriousness. Sleeping alongside a Wigglytuff is simply divine. Its body expands seemingly without end when it inhales.", 40},
["zubat"] = {"Disliking sunlight, it sleeps deep in forests and caves until sundown.", 41},
["golbat"] = {"Once it starts sucking blood, it does not stop until it is full. It flies at night in search of prey.", 42},
["oddish"] = {"It often plants its root feet in the ground during the day and sows seeds as it walks about at night.", 43},
["gloom"] = {"The honey it drools from its mouth smells so atrocious, it can curl noses more than a mile away.", 44},
["vileplume"] = {"Its petals are the largest in the world. As it walks, it scatters extremely allergenic pollen.", 45},
["paras"] = {"Growing out of the bug's back are mushrooms called tochukaso. The mushrooms grow with the bug host.", 46},
["parasect"] = {"Parasect are known to infest the roots of large trees en masse and drain nutrients. When an infested tree dies, they move onto another tree all at once.", 47},
["venonat"] = {"Its eyes act as radar, enabling it to be active in darkness. The eyes can also shoot powerful beams.", 48},
["venomoth"] = {"The wings are covered with dustlike scales. Every time it flaps its wings, it looses highly toxic dust.", 49},
["diglett"] = {"It burrows through the ground at a shallow depth. It leaves raised earth in its wake, making it easy to spot.", 50},
["dugtrio"] = {"Its three heads move alternately, driving it through tough soil to depths of over 60 miles.", 51},
["meowth"] = {"All it does is sleep during the daytime. At night, it patrols its territory with its eyes aglow.", 52},
["persian"] = {"Although its fur has many admirers, it is tough to raise as a pet because of its fickle meanness.", 53},
["psyduck"] = {"It is constantly wracked by a headache. When the headache turns intense, it begins using mysterious powers.", 54},
["golduck"] = {"A Pokemon that lives in lakes. It swims faster than any human swimming champion.", 55},
["mankey"] = {"It lives in treetop colonies. If one becomes enraged, the whole colony rampages for no reason.", 56},
["primeape"] = {"It grows angry if you see its eyes and gets angrier if you run. If you beat it, it gets even madder.", 57},
["growlithe"] = {"Its superb sense of smell ensures that this Pokemon won't forget any scent, no matter what. It uses its sense of smell to detect the emotions of others.", 58},
["arcanine"] = {"A Pokemon that is described in Chinese legends. It is said to race at an unbelievable speed.", 59},
["poliwag"] = {"Its slick black skin is thin and damp. A part of its internal organs can be seen through the skin as a spiral pattern.", 60},
["poliwhirl"] = {"Its body surface is always wet and slick with an oily fluid. Because of this greasy covering, it can easily slip and slide out of the clutches of any enemy in battle.", 61},
["poliwrath"] = {"Its highly developed muscles never grow fatigued, however much it exercises. This Pokemon can swim back and forth across the Pacific Ocean without effort.", 62},
["abra"] = {"A Pokemon that sleeps 18 hours a day. Observation revealed that it uses teleport to change its location.", 63},
["kadabra"] = {"It is rumored that a boy with psychic abilities suddenly transformed into KADABRA while he was assisting research into extrasensory powers.", 64},
["alakazam"] = {"While it has strong psychic abilities and high intelligence, an Alakazam muscles are very weak. It uses psychic power to move its body.", 65},
["machop"] = {"It continually undertakes strenuous training to master all forms of martial arts. Its strength lets it easily hoist a sumo wrestler onto its shoulders.", 66},
["machoke"] = {"Its muscular body is so powerful, it must wear a power-save belt to be able to regulate its motions.", 67},
["machamp"] = {"It is impossible to defend against punches and chops doled out by its four arms. Its fighting spirit flares up when it faces a tough opponent.", 68},
["bellsprout"] = {"Its bud looks like a human face. Because of the bud, it is rumored to be a type of legendary mandrake plant.", 69},
["weepinbell"] = {"A Pokemon that appears to be a plant. It captures unwary prey by dousing them with a toxic powder.", 70},
["victreebel"] = {"It pools in its mouth a fluid with a honeylike scent, which is really an acid that dissolves anything.", 71},
["tentacool"] = {"Its body is almost entirely composed of water. It ensnares its foe with its two long tentacles, then stabs with the poison stingers at their tips.", 72},
["tentacruel"] = {"It lives in complex rock formations on the ocean floor and traps prey using its 80 tentacles. Its red orbs glow when it grows excited or agitated.", 73},
["geodude"] = {"It climbs mountain paths using only the power of its arms. Because they look just like boulders lining paths, hikers may step on them without noticing.", 74},
["graveler"] = {"They descend from mountains by tumbling down steep slopes. They are so brutal, they smash aside obstructing trees and massive boulders with thunderous tackles.", 75},
["golem"] = {"It is said to live in volcanic craters on mountain peaks. Once a year, it sheds its hide and grows larger. The shed hide crumbles and returns to the soil.", 76},
["ponyta"] = {"About an hour after birth, its fiery mane and tail grow out, giving it an impressive appearance.", 77},
["rapidash"] = {"It usually canters casually in the fields and plains. But once a Rapidash turns serious, its fiery manes flare and blaze as it gallops its way up to 150 mph.", 78},
["slowpoke"] = {"It is always vacantly lost in thought, but no one knows what it is thinking about. It is good at fishing with its tail.", 79},
["slowbro"] = {"Lives lazily by the sea.", 80},
["magnemite"] = {"The units at its sides generate electromagnetic waves that keep it airborne. It feeds on electricity.", 81},
["magneton"] = {"Magneton emits a powerful magnetic force that is fatal to electronics and precision instruments. Because of this, it is said that some towns warn people to keep this Pokemon inside a pokeball.", 82},
["farfetch'd"] = {"It is always seen with a stick from a plant. Apparently, there are good sticks and bad sticks. This Pokemon occasionally fights with others over choice sticks.", 83},
["doduo"] = {"Even while eating or sleeping, one of the heads remains always vigilant for any sign of danger. When threatened, it flees at over 60 miles per hour.", 84},
["dodrio"] = {"Apparently, the heads aren't the only parts of the body that Dodrio has three of. It has three sets of hearts and lungs as well, so it is capable of running long distances without rest.", 85},
["seel"] = {"A Pokemon that lives on icebergs. It swims in the sea using the point on its head to break up ice.", 86},
["dewgong"] = {"In snow, the pure white coat covering its body obscures it from predators.", 87},
["grimer"] = {"It was born when sludge in a dirty stream was exposed to the moon's X-rays. It appears among filth.", 88},
["muk"] = {"It is usually undetectable because it blends in with the ground. Touching it can cause terrible poisoning.", 89},
["shellder"] = {"It swims backward by opening and closing its two shells. Its large tongue is always kept hanging out.", 90},
["cloyster"] = {"It fights by keeping its shell tightly shut for protection and by shooting spikes to repel foes.", 91},
["gastly"] = {"When exposed to a strong wind, a Gastly's gaseous body quickly dwindles away. They cluster under the eaves of houses to escape the ravages of wind.", 92},
["haunter"] = {"Because of its ability to slip through block walls, it is said to be from another dimension.", 93},
["gengar"] = {"Deep in the night, your shadow cast by a streetlight may suddenly overtake you. It is actually a Gengar running past you, pretending to be your shadow.", 94},
["onix"] = {"There is a magnet in its brain that prevents an Onix from losing direction while tunneling. As it grows older, its body becomes steadily rounder and smoother.", 95},
["drowzee"] = {"A descendent of the legendary animal baku, which is said to eat dreams. It is skilled at hypnotism.", 96},
["hypno"] = {"Seeing its swinging pendulum can induce sleep in three seconds, even in someone who just woke up.", 97},
["krabby"] = {"It lives in burrows dug on sandy beaches. Its pincers fully grow back if they are broken in battle.", 98},
["kingler"] = {"It waves its huge, oversized claw in the air to communicate with others. But since the claw is so heavy, this Pokemon quickly tires.", 99},
["voltorb"] = {"It looks just like a Poke Ball. It is dangerous because it may electrocute or explode on touch.", 100},
["electrode"] = {"It is known to drift on winds if it is bloated to bursting with stored electricity.", 101},
["exeggcute"] = {"Its six eggs converse using telepathy. They can quickly gather if they become separated.", 102},
["exeggutor"] = {"It is called The Walking Tropical Rainforest. Each of the nuts has a face and a will of its own.", 103},
["cubone"] = {"It pines for the mother it will never see again. Seeing a likeness of its mother in the full moon, it cries. The stains on the skull it wears are from its tears.", 104},
["marowak"] = {"MarowaK is the evolved form of a Cubone that has overcome its sadness at the loss of its mother and grown tough. This Pokemon's tempered and hardened spirit is not easily broken.", 105},
["hitmonlee"] = {"Its legs freely stretch and contract. Using these springlike limbs, it bowls over foes with devastating kicks. After battle, it rubs down its tired legs. Hitmonlee have a special passive skill.", 106},
["hitmonchan"] = {"A Hitmonchan is said to possess the spirit of a boxer who aimed to become the world champion. Having an indomitable spirit means that it will never give up.", 107},
["lickitung"] = {"Whenever it sees something unfamiliar, it always licks the object because it memorizes things by texture and taste. It is somewhat put off by sour things.", 108},
["koffing"] = {"Because it stores several kinds of toxic gases in its body, it is prone to exploding without warning.", 109},
["weezing"] = {"It grows by feeding on gases released by garbage. Though very rare, triplets have been found.", 110},
["rhyhorn"] = {"Once it starts running, it doesn't stop. Its tiny brain makes it so stupid that it can't remember why it started running in the first place.", 111},
["rhydon"] = {"Its horn, which rotates like a drill, destroys tall buildings with one strike. It stands on its hind legs, and its brain is well developed.", 112},
["chansey"] = {"Chansey lay nutritionally excellent eggs every day. The eggs are so delicious, they are eagerly devoured by even those people who have lost their appetite.", 113},
["tangela"] = {"Its vines snap off easily and painlessly if they are grabbed, allowing it to make a quick getaway. The lost vines are replaced by new growth the very next day.", 114},
["kangaskhan"] = {"It raises its offspring in its belly pouch. It lets the baby out to play only when it feels safe.", 115},
["horsea"] = {"By cleverly flicking the fins on its back side to side, it moves in any direction while facing forward. It spits ink to escape if it senses danger.", 116},
["seadra"] = {"The poisonous barbs all over its body are highly valued as ingredients for making traditional herbal medicine. It shows no mercy to anything approaching its nest.", 117},
["goldeen"] = {"Its dorsal and pectoral fins are strongly developed like muscles. It can swim at a speed of five knots.", 118},
["seaking"] = {"Punches holes in boulders on stream-beds. This is a clever innovation that prevents its eggs from being attacked or washed away by the current.", 119},
["staryu"] = {"It gathers with others in the night and makes its red core glow on and off with the twinkling stars. It can regenerate limbs if they are severed from its body.", 120},
["starmie"] = {"At the center of its body is a red core, which sends mysterious radio signals into the night sky.", 121},
["mr. mime"] = {"It is a pantomime expert that can create invisible but solid walls using miming gestures.", 122},
["scyther"] = {"Its blindingly fast speed adds to the sharpness of its twin forearm scythes. The scythes can slice through thick logs in one wicked stroke.", 123},
["jynx"] = {"Its cries sound like human speech. However, it is impossible to tell what it is trying to say.", 124},
["electabuzz"] = {"Half of all blackouts occur when this Pokemon appears at power plants and eats electricity.", 125},
["magmar"] = {"Born in the spout of a volcano, its body is covered by flames that shimmer like the sun.", 126},
["pinsir"] = {"It grips prey with its pincers until the prey is torn in half. What it can't tear, it tosses far.", 127},
["tauros"] = {"Once it takes aim at its foe, it makes a headlong charge. It is famous for its violent nature.", 128},
["magikarp"] = {"It is said to be the world's weakest Pokemon. No one knows why it has managed to survive.", 129},
["gyarados"] = {"Rarely seen in the wild. Huge and vicious, it is capable of destroying entire cities in a rage.", 130},
["lapras"] = {"It loves crossing the sea with people and Pokemon on its back. It understands human speech.", 131},
["ditto"] = {"It has the ability to reconstitute its entire cellular structure to transform into whatever it sees.", 132},
["eevee"] = {"A rare Pokemon that adapts to harsh environments by taking on different evolutionary forms.", 133},
["vaporeon"] = {"It has evolved to be suitable for an aquatic life. It can invisibly melt away into water.", 134},
["jolteon"] = {"It controls 10,000-volt power and can raise all the fur on its body as if it were sharp needles.", 135},
["flareon"] = {"It has a flame sac in its body. Its body temperature tops 1,650 degrees Fahrenheit before battle.", 136},
["porygon"] = {"The world's first artificially created Pokemon. It can travel through electronic space.", 137},
["omanyte"] = {"A Pokemon that was resurrected from a fossil using modern science. It swam in ancient seas.", 138},
["omastar"] = {"It is thought that this Pokemon became extinct because its spiral shell grew too large.", 139},
["kabuto"] = {"It is thought to have inhabited beaches 300 million years ago. It is protected by a stiff shell.", 140},
["kabutops"] = {"It is thought that this Pokemon came onto land because its prey adapted to life on land.", 141},
["aerodactyl"] = {"A Pokemon that roamed the skies in the dinosaur era. Its teeth are like saw blades.", 142},
["snorlax"] = {"Snorlax's typical day consists of nothing more than eating and sleeping. It is such a docile Pokemon that there are children who use its big belly as a place to play.", 143},
["articuno"] = {"Articuno is a legendary bird Pokemon that can control ice. The flapping of its wings chills the air. As a result, it is said that when this POKeMON flies, snow will fall.", 144},
["zapdos"] = {"Zapdos is a legendary bird POKeMON that has the ability to control electricity. It usually lives in thunderclouds. The Pokemon gains power if it is stricken by lightning bolts.", 145},
["moltres"] = {"Moltres is a legendary bird Pokemon that has the ability to control fire. If this Pokemon is injured, it is said to dip its body in the molten magma of a volcano to burn and heal itself.", 146},
["dratini"] = {"It is called the Mirage Pokemon because so few have seen it. Its shed skin has been found.", 147},
["dragonair"] = {"If its body takes on an aura, the weather changes instantly. It is said to live in seas and lakes.", 148},
["dragonite"] = {"It is said to make its home somewhere in the sea. It guides crews of shipwrecks to shore.", 149},
["mewtwo"] = {"No description.", 150},
["mew"] = {"No description.", 151},
}

function getPokemonDescription(name)                
	if not pokesDescription[string.lower(name)] then return false end
	return pokesDescription[string.lower(name)][1]
end

function getPokedexNameByID(id)
local name = ""
	for a, b in pairs(pokesDescription) do
		if b[2] == id then 
		   name = a
		   break
		end
	end
	return name
end 

function getPokedexIDByName(name)
local id = 0
	for a, b in pairs(pokesDescription) do
		if a == name then 
		   id = b[2]
		   break
		end
	end
	return id
end 

 

esse é o id do  corpse do bulbasaur :

   <item id="11847" article="a" name="fainted bulbasaur">
        <attribute key="containerSize" value="10" />
        <attribute key="decayTo" value="0" />
        <attribute key="duration" value="55" />
    </item>

e esse é o portrait do bulbasaur :

 

<item fromid="11989" toid="12139" article="a" name="portrait"/>

id : 11989

Link para o comentário
Compartilhar em outros sites

  • 0
46 minutos atrás, Kirsch disse:

consegui fazer pegar agora é trabalhar em cima pois ainda tem bugs, Obrigado a todos que decidiram não ajudar, conhecimento é poder é isso ninguém copia.

image.png

 

Fico feliz que conseguiu ?
Movido.

Link para o comentário
Compartilhar em outros sites

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