Ir para conteúdo

[ PokeTibia ] Sistema de Acasalamento


XReMiX

Posts Recomendados

Eai galerinha estava vendo que varias pessoas estavam querendo um NPC de acasalar pokemons (para server com level system PDA) então achei esse Script para server com level.

(OBS: É igual o Egg System)

 

Instalando:

 

1) Vai para onde o seu servidor esta e de lá para \ data \ npc

crie um arquivo XML com o nome de "Vendedor de Ovo"

Coloque isso dentro da XML do NPC

 

 

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Vendedor de Ovos" script="vendedorovos.lua" walkinterval="350000" floorchange="0" speed="0">

<health now="150" max="150"/>

<look type="522" head="91" body="114" legs="86" feet="0"/>

<parameters>

<parameter key="message_greet" value="vendo ovos pokemon diga {trade} para saber mais!"/>

<parameter key="message_farewell" value="Good bye!"/>

<parameter key="message_idletimeout" value="Good bye!"/>

<parameter key="message_walkaway" value="Good bye!"/>

<parameter key="module_shop" value="1"/>

<parameter key="shop_buyable" value="pokemon

egg,12304,100000;pokemon egg,12305,100000;pokemon

egg,12306,100000;pokemon egg,12307,100000;pokemon

egg,12308,100000;pokemon egg,12309,100000;pokemon

egg,12310,100000;pokemon egg,12311,100000;pokemon

egg,12312,100000;pokemon egg,12313,100000;pokemon

egg,12314,100000;pokemon egg,12315,100000;pokemon

egg,12316,100000;pokemon egg,12317,100000;pokemon

egg,12318,100000;pokemon egg,12319,100000;pokemon

egg,12320,100000;pokemon egg,12321,100000;pokemon

egg,12322,100000;pokemon egg,12323,100000;pokemon egg,12324,100000;"/>

</parameters>

</npc>

 

 

depois vai em data/npc/scripts e cria um arquivo .lua chamado "vendedorovos"

e coloque isso dentro do script dele.

 

 

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 Chocou Seu OVO"..item.itemid - (12304).."!")

doPlayerSendTextMessage(cid, 27, "e Nasceu o Pokemon "..pokemon.." (level "..level.."), Parabens!")

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

 

 

Pronto é isso....Créditos : Gabrieltxu

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

×
×
  • Criar Novo...