Ir para conteúdo
  • 0

Duvida Sobre Egg


webmasterxd

Pergunta

Galera eu tenho um npc que vende egg mais nao sei como chocar os egg nao sei se e por dias nao sei se tem que ter chocadeira as script dele ai

 

 

 

local a = {

[12304] = {level = {10,25}, balltype = "normal",

pokemons = {"Bulbasaur"}},

[12305] = {level = {10,25}, balltype = "normal",

pokemons = {"Caterpie"}},

[12306] = {level = {10,25}, balltype = "normal",

pokemons = {"Clefairy"}},

[12307] = {level = {10,25}, balltype = "normal",

pokemons = {"Charmander"}},

[12308] = {level = {10,25}, balltype = "normal",

pokemons = {"Eevee"}},

[12309] = {level = {10,25}, balltype = "normal",

pokemons = {"Ekans"}},

[12310] = {level = {10,25}, balltype = "normal",

pokemons = {"Exeggcute"}},

[12311] = {level = {10,25}, balltype = "normal",

pokemons = {"Goldeen"}},

[12312] = {level = {10,25}, balltype = "normal",

pokemons = {"Horsea"}},

[12313] = {level = {10,25}, balltype = "normal",

pokemons = {"Kabuto"}},

[12314] = {level = {10,25}, balltype = "normal",

pokemons = {"Krabby"}},

[12315] = {level = {10,25}, balltype = "normal",

pokemons = {"Magikarp"}},

[12316] = {level = {10,25}, balltype = "normal",

pokemons = {"Oddish"}},

[12317] = {level = {10,25}, balltype = "normal",

pokemons = {"Pidgey"}},

[12318] = {level = {10,25}, balltype = "normal",

pokemons = {"Poliwag"}},

[12319] = {level = {10,25}, balltype = "normal",

pokemons = {"Psyduck"}},

[12320] = {level = {10,25}, balltype = "normal",

pokemons = {"Shellder"}},

[12321] = {level = {10,25}, balltype = "normal",

pokemons = {"remoraid"}},

[12322] = {level = {10,25}, balltype = "normal",

pokemons = {"Squirtle"}},

[12323] = {level = {10,25}, balltype = "normal",

pokemons = {"Vulpix"}},

[12324] = {level = {10,25}, balltype = "normal",

pokemons = {"azumarill"}}

}

 

local extrastrength = 1.1

 

function onUse(cid, item, frompos, item2, topos)

local b = a[item.itemid]

if not b then return true end

local pokemon = b.pokemons[math.random(#b.pokemons)]

local pokeinfo = getPokemonStatus(pokemon)

if not pokeinfo then return true end

local btype = b.balltype

if not pokeballs[btype] then return true end

local gender = getRandomGenderByName(pokemon)

local level = math.random(b.level[1], b.level[2])

local offense = pokeinfo.off * level * extrastrength

local defense = pokeinfo.def * level * extrastrength

local agility = pokeinfo.agi * level * extrastrength

local spatk = pokeinfo.spatk * level * extrastrength

local vit = pokeinfo.vit * level * extrastrength

local happy = 180

local leveltable = getPokemonExperienceTable(pokemon)

 

local ball = 0

local sendToDepot = false

if getCreatureMana(cid) >= 6 then

sendToDepot = true

ball = doCreateItemEx(2219)

else

ball = item.uid

end

 

doItemSetAttribute(ball, "poke", pokemon)

doItemSetAttribute(ball, "hp", 1)

doItemSetAttribute(ball, "level", level)

doItemSetAttribute(ball, "exp", leveltable[level])

doItemSetAttribute(ball, "nextlevelexp", leveltable[level+1] - leveltable[level])

doItemSetAttribute(ball, "offense", offense)

doItemSetAttribute(ball, "defense", defense)

doItemSetAttribute(ball, "speed", agility)

doItemSetAttribute(ball, "vitality", vit)

doItemSetAttribute(ball, "specialattack", spatk)

doItemSetAttribute(ball, "happy", happy)

doItemSetAttribute(ball, "gender", gender)

doItemSetAttribute(ball, "description", "Contains a "..pokemon..".")

doItemSetAttribute(ball, "fakedesc", "Contains a "..pokemon..".")

 

doPlayerSendTextMessage(cid, 27, "Voce Chockou Seu OVO"..item.itemid - (12304).."!")

doPlayerSendTextMessage(cid, 27, "The prize pokemon was a "..pokemon.." (level "..level.."), congratulations!")

 

if sendToDepot then

doPlayerSendMailByName(getCreatureName(cid), ball, 1)

doTransformItem(ball, pokeballs[btype].on)

doPlayerSendTextMessage(cid, 27, "You are already holding

six pokemons, so your new pokemon was sent to your depot.")

doRemoveItem(item.uid)

else

doTransformItem(ball, pokeballs[btype].on)

end

 

doSendMagicEffect(getThingPos(cid), 29)

return true

end ---------------------------------------------------

 

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

2 respostass a esta questão

Posts Recomendados

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