Ir para conteúdo

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


lucashgas

Posts Recomendados

@all

Npc de Food

 

 

 

 

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

<npc name="Noya" script="default.lua" walkinterval="350000" floorchange="0" speed="0">

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

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

<parameters>

<parameter key="message_greet" value="Ola amigo, eu vendo todo o tipo de Junk food, tambem compro carne de dragao e pago bem!"/>

<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="hotdog,2683,300;limonade,2684,100;hamburguer,2686,400;chocolat churros,2688,200;vanilla churros,2689,200;"/>

<parameter key="shop_sellable" value="Carne de dragao,2672,3500;"/>

</parameters>

</npc>

 

 

Link para o comentário
Compartilhar em outros sites

é que tem o Mark que compra loot e o Hugh que compra loot que o Mark n compra, se tu n jogo svke ou pxg n vai saber .

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

@Kois

eu já tinha postado o Npc de food... ¬¬ ( mas oque vale é a intenção de ajudar :D )

@MatheeussYuurii

Eu fiz igual ao PxG dois Npc, Mark e Hugh com os mesmos preços dos PxG vou postar logo os dois.

Npc Mark:

 

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

<npc name="Mark" script="default.lua" walkinterval="350000" floorchange="0" speed="0">

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

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

<parameters>

<parameter key="message_greet" value="Hello dear customer! Are you here to see my offers? Come on, lets {trade}!"/>

<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="poke ball,2394,400;great ball,2391,1000;super ball,2393,1500;ultra ball,2392,2000;small potion,12347,500;super potion,12345,2000;great potion,12348,1500;ultra potion,12346,2200;full heal,12344,20000;revive,12343,30000;medicine,12349,300;recording camera,12330,100000;"/>

<parameter key="shop_sellable" value="essence of fire,12162,200;small stone,12337,90;pot of moss bug,12171,250;screw,12164,85;straw,2694,65;water gems,12161,20;remains of magikarp,12334,100;teeth,12175,100;bottle of poison,12165,100;water pendant,12170,800;feather,12200,500;seed,12163,25;pair of leaves,12155,500;apple bite,12173,450;bat wing,12182,550;"/>

</parameters>

</npc>

 

 

Npc Hugh:

 

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

<npc name="Hugh" script="default.lua" walkinterval="350000" floorchange="0" speed="0">

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

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

<parameters>

<parameter key="message_greet" value="Hello dear customer! I buy rare items from Pokemon, Want to see my offers? Come on, let {} trade!"/>

<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_sellable" value="bag of pollem,12153,8000;Belt of Champion,12195,100000;Bird Beak,12172,10000;Blue Vines,12341,40000;Bone,12208,4000;Bug Antenna,12184,3500;Bulv,12154,3250;Chansey egg,12211,100000;Comb,5946,10000;Crab Claw,12207,2200;Dragon Tooth,12159,61000;Electric Box,12176,2000;Electric Tail,12169,100000;Farfetch'd Stick,12199,61000;Fox Tail,12180,65000;Fur,12181,1300;Future Orb,12194,1550;Gosme,12202,2250;Gyarados Tail,12148,80000;Horn,12178,2500;Ice Orb,12201,3250;Imam,12198,6000;Iron Bracelet,12192,25000;Locksmith of Shell,12203,8000;Luck Medalion,12186,100000;Mimic Clothes,12166,100000;Mushroom,12183,8000;Nail,12157,1000;Onix Tail,12205,100000;Pot Of Lava,12152,1800;Psychic Spoon,12193,4000;Punch Machine,12191,4000;Ruby,12188,2000;Sandbag,12177,1500;Scythe,12167,100000;Slow Tail,12197,8000;Squirtle Hull,12158,3250;Stone Orb,12196,1650;Traces of ghost,12204,2650;Venom Flute,12210,30000;Wool Ball,12187,8000;Thunder Feather,12150,500000;Ice Feather,12149,500000;Fire Feather,12151,500000;Psyduck Mug,12189,61000;Tongue,12209,100000;"/>

</parameters>

</npc>

 

@Pra galera que não sabe fazer npc de Duel

Eu vou postar um npc de Duel que fiz com base doque já tinha no server... vou postar porque tem gente que não sabe fazer :)

1º - Crie um arquivo.xml e coloquei isso dentro do arquivo:

 

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

 

<npc name="Jack Black" script="duel jack black.lua" walkinterval="350000" floorchange="0" speed="0" lookdir="2">

 

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

 

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

 

<parameters>

 

 

</parameters>

 

</npc>

 

2º va na pasta scripts crie um arquivo .LUA com o nome de duel jack black.lua e coloque isso dentro do arquivo:

 

local focus = 0

local max_distance = 8

local talk_start = 0

local conv = 0

local fighting = false

local challenger = 0

local afk_limit_time = 30 -- seconds

local afk_time = 0 -- don't change

local battle_turn = 1 -- don't change

local challenger_turn = 0 -- don't change

local masterpos = {}

local time_to_fight_again = 15 -- seconds, not ms (so 30 * 60 means 30 minutes)

 

local can_walk = true -- true to make this npc walks randomly

local max_distance = 5 -- maximum distance this npc can get far (sqms)

local walk_delay = 7 -- every seconds make this npc walk

 

local cooldown_table = {}

 

local min_pokemons_to_battle = 1-- change to whatever you want

local number_of_pokemons = 0 -- don't change

 

local prizes = {

[1] = {{itemid = 2152, count = 1}},

[2] = {{itemid = 2152, count = 1}, {itemid = 2148, count = 50}},

[3] = {{itemid = 2152, count = 2}, {itemid = 2148, count = 60}},

[4] = {{itemid = 2152, count = 3}, {itemid = 2148, count = 70}},

[5] = {{itemid = 2152, count = 4}, {itemid = 2148, count = 80}},

[6] = {{itemid = 2152, count = 5}, {itemid = 2148, count = 90}}}

 

local pokemons = {

{name = "Rapidash", level = 55, extralevel = 55, sex = SEX_MALE, nick = "Rapidash", ball = "super"},

{name = "Wartortle", level = 45, extralevel = 60, sex = SEX_FEMALE, nick = "Wartortle", ball = "great"},

{name = "Dugtrio", level = 40, extralevel = 60, sex = SEX_MALE, nick = "Dugtrio", ball = "great"},

{name = "Graveler", level = 45, extralevel = 45, sex = SEX_MALE, nick = "Graveler", ball = "super"},

{name = "Tangela", level = 55, extralevel = 54, sex = SEX_FEMALE, nick = "Tangela", ball = "super"},

{name = "Raichu", level = 50, extralevel = 48, sex = SEX_MALE, nick = "Raichu", ball = "ultra"},

}

 

 

local function doSummonGymPokemon(npc)

local this = npc

if not isCreature(this) then return true end

if #getCreatureSummons(this) >= 1 or focus == 0 then return true end

local it = pokemons[battle_turn]

doSummonMonster(this, it.name)

local summon = getCreatureSummons(this)[1]

local balleffect = pokeballs["normal"].effect

if it.ball and pokeballs[it.ball] then

balleffect = pokeballs[it.ball].effect

end

doSendMagicEffect(getThingPos(summon), balleffect)

setPlayerStorageValue(summon, 10000, balleffect)

setPlayerStorageValue(summon, 10001, gobackmsgs[math.random(#gobackmsgs)].back:gsub("doka", it.nick ~= "" and it.nick or it.name))

setPlayerStorageValue(summon, 1007, it.nick ~= "" and it.nick or it.name)

doSetMonsterGym(summon, focus)

local name = it.nick ~= "" and it.nick or getCreatureName(this).."s "..it.name

setWildPokemonLevel(summon, it.level, getPokemonStatus(it.name, (it.extralevel + it.level)), name, 1.5)

doCreatureSay(this, gobackmsgs[math.random(#gobackmsgs)].go:gsub("doka", getPlayerStorageValue(summon, 1007)), 1)

fighting = true

battle_turn = battle_turn + 1

end

 

local function doWinDuel(cid, npc)

if not isCreature(cid) then return true end

local this = npc

local x = prizes[number_of_pokemons]

for n = 1, #x do

doPlayerAddItem(cid, x[n].itemid, x[n].count)

end

doCreatureSay(npc, "Congratulations! You won, here is your prize.", 1)

cooldown_table[getCreatureName(cid)] = os.clock() + time_to_fight_again

return true

end

 

function onCreatureSay(cid, type, msg)

 

local msg = string.lower(msg)

 

if focus == cid then

talk_start = os.clock()

end

 

if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) <= 4 then

 

if cooldown_table[getCreatureName(cid)] and cooldown_table[getCreatureName(cid)] - os.clock() > 0 then

selfSay("Hello "..getCreatureName(cid)..", I really enjoyed our last battle!")

conv = 10

else

selfSay("Hello "..getCreatureName(cid)..", are you up to a duel? I can give prizes if you win!")

conv = 1

end

 

focus = cid

talk_start = os.clock()

return true

end

 

if (isDuelMsg(msg) or isConfirmMsg(msg)) and (conv == 1 or conv == 10) and focus == cid then

 

if conv == 10 then

selfSay("We have just battled! Please wait for me to recover from out last battle!")

focus = 0

return true

end

 

if not hasPokemon(cid) then

selfSay("You need pokemons to battle!")

return true

end

 

selfSay("Ok, tell me how many pokemons will fight.")

conv = 2

 

return true

end

 

if conv == 2 and focus == cid then

 

if not tonumber(msg) then

selfSay("Tell me the number of pokemons that will battle.")

return true

elseif tonumber(msg) > #pokemons then

selfSay("I have only "..#pokemons..", so the maximum is "..#pokemons.."!")

return true

elseif tonumber(msg) < min_pokemons_to_battle or tonumber(msg) < 1 then

selfSay("It has to be more than "..min_pokemons_to_battle..".")

return true

else

number_of_pokemons = tonumber(msg)

selfSay("Ok, the first that defeats "..number_of_pokemons.." wins, let's start!")

challenger = focus

setPlayerStorageValue(cid, 990, 1)

addEvent(doSummonGymPokemon, 850, getThis())

conv = 3

return true

end

 

 

return true

end

 

if isNegMsg(msg) and conv == 1 and focus == cid then

 

focus = 0

selfSay("It is better for you to refuse a battle against me!")

 

return true

end

 

if msgcontains(msg, 'bye') and focus == cid then

selfSay('Bye and do your best trainer!')

setPlayerStorageValue(focus, 990, -1)

focus = 0

return true

end

end

 

local afk_warning = false

local change = false

local walkdelay = 0

 

function onThink()

 

if not masterpos.x then

masterpos = getThingPos(getThis())

end

 

if focus == 0 then

selfTurn(2)

fighting = false

challenger = 0

change = false

challenger_turn = 0

battle_turn = 1

afk_time = 0

afk_warning = false

 

if #getCreatureSummons(getThis()) >= 1 then

setPlayerStorageValue(getCreatureSummons(getThis())[1], 1006, 0)

doCreatureAddHealth(getCreatureSummons(getThis())[1], -getCreatureMaxHealth(getCreatureSummons(getThis())[1]))

end

 

walkdelay = walkdelay - 0.5

 

if walkdelay <= 0 then

walkdelay = walk_delay

local pos = getThingPos(getThis())

local npos = {}

for a = 0, 3 do

if getDistanceBetween(getPosByDir(pos, a), masterpos) <= max_distance and canWalkOnPos(getPosByDir(pos, a), true, false, true, true, false) then

table.insert(npos, getPosByDir(pos, a))

end

end

 

if npos and #npos > 0 then

doTeleportThing(getThis(), npos[math.random(#npos)])

end

end

 

return true

else

 

if not isCreature(focus) then

focus = 0

return true

end

 

if fighting then

 

talk_start = os.clock()

 

if not isCreature(getCreatureTarget(getThis())) then

if #getCreatureSummons(challenger) >= 1 then

selfAttackCreature(getCreatureSummons(challenger)[1])

change = true

afk_time = 0

else

afk_time = afk_time + 0.5

if change then

change = false

challenger_turn = challenger_turn + 1

end

end

end

 

if afk_time > afk_limit_time then

setPlayerStorageValue(focus, 990, -1)

focus = 0

selfSay("I have waited too long, come back when you are ready!")

return true

end

 

if not afk_warning and afk_time > afk_limit_time / 2 then

selfSay("Where's your pokemon? Let's fight!")

afk_warning = true

end

 

 

if #getCreatureSummons(getThis()) == 0 then

if battle_turn > number_of_pokemons then

addEvent(doWinDuel, 1000, focus, getThis())

setPlayerStorageValue(focus, 990, -1)

focus = 0

return true

end

addEvent(doSummonGymPokemon, 1000, getThis())

end

 

if not hasPokemon(challenger) or challenger_turn > 6 or challenger_turn >= number_of_pokemons then

selfSay("You lost our duel! Maybe some other time you'll defeat me.")

setPlayerStorageValue(focus, 990, -1)

focus = 0

return true

end

 

end

 

local npcpos = getThingPos(getThis())

local focpos = getThingPos(focus)

 

if npcpos.z ~= focpos.z then

setPlayerStorageValue(focus, 990, -1)

focus = 0

selfSay("Bye then.")

return true

end

 

if (os.clock() - talk_start) > 30 then

selfSay("Good bye and keep training!")

setPlayerStorageValue(focus, 990, -1)

focus = 0

end

 

if getDistanceToCreature(focus) > max_distance then

setPlayerStorageValue(focus, 990, -1)

focus = 0

return true

end

 

local dir = doRedirectDirection(getDirectionTo(npcpos, focpos))

selfTurn(dir)

end

return true

end

pronto agora é só testar :)

comando para criar npc com o GOD /n nome do npc

Ajudei? REP+

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

@All , queria pedi um favor pra qm sabe mexe com quest's de script , tpw na quest starter.lua , pra quem sabe não sabe é a quest que voce escolhe bulba , squirtle ou charmander .. queria sabe se alguem sabe uma maneira de fazer essa quest so uma vez , pq no meu ot . ela faz varias vezes :o , se alguem soube darei rep + obg

Link para o comentário
Compartilhar em outros sites

@maxximuss

 

Obrigado!(: .Quando liberar o REP aqui te do, vlw :D

 

 

@kledstonsk8

 

se n me engano, n tem como pegar 2 vezes pois ao pegar ele é teleportado e n tem como ir lá dnv.

a n ser que ele crie outro char e pegue dnv ..

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

@Kledstonk8

coloca esse isso dentro do seu starter.lua

 

local starterpokes = {

["Weedle"] = {x = 959, y = 1002, z = 5},

["Rattata"] = {x = 957, y = 1002, z = 5},

["Caterpie"] = {x = 955, y = 1002, z = 5},

}

 

local level = 5

local extrastr = 1.5

local btype = "normal"

 

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

 

if getPlayerLevel(cid) > 1 then

return true

end

 

local pokemon = ""

 

for a, b in pairs (starterpokes) do

if isPosEqualPos(topos, b) then

pokemon = a

end

end

 

if pokemon == "" then return true end

 

local gender = getRandomGenderByName(pokemon)

 

local mypoke = getPokemonStatus(pokemon)

 

if not mypoke then return true end

 

local offense = mypoke.off * level * extrastr

local defense = mypoke.def * level * extrastr

local speed = mypoke.agi * level * extrastr

local vit = mypoke.vit * level * extrastr

local spatk = mypoke.spatk * level * extrastr

local happy = 180

local leveltable = getPokemonExperienceTable(pokemon)

 

doPlayerAddItem(cid, 2394, 10)

doPlayerAddItem(cid, 2152, 10)

doPlayerAddItem(cid, 12222, 20)

doPlayerAddItem(cid, 12346, 15)

 

local item = doCreateItemEx(2219)

doItemSetAttribute(item, "poke", pokemon)

doItemSetAttribute(item, "hp", 1)

doItemSetAttribute(item, "level", level)

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

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

doItemSetAttribute(item, "offense", offense)

doItemSetAttribute(item, "defense", defense)

doItemSetAttribute(item, "speed", speed)

doItemSetAttribute(item, "vitality", vit)

doItemSetAttribute(item, "specialattack", spatk)

doItemSetAttribute(item, "happy", happy)

doItemSetAttribute(item, "gender", gender)

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

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

doItemSetAttribute(item, "firstpoke", getCreatureName(cid))

doPlayerAddItemEx(cid, item, true)

 

doTransformItem(item, pokeballs[btype].on)

 

doPlayerSendTextMessage(cid, 27, "You got your first pokemon! You also received some pokeballs to help you in your way.")

doPlayerSendTextMessage(cid, 27, "Don\'t forget to use your pokedex on every undiscovered pokemon!")

 

doSendMagicEffect(getThingPos(cid), 29)

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

doSendMagicEffect(getThingPos(cid), 27)

doSendMagicEffect(getThingPos(cid), 29)

 

 

return TRUE

end

 

OBS: nessa parte vermelha você muda pra qual pokemon vai ganhar e coloca a posição do seu baú. na parte verde é onde você vai escolher o level que o pokemon vai vir.

 

local starterpokes = {

["Weedle"] = {x = 959, y = 1002, z = 5},

["Rattata"] = {x = 957, y = 1002, z = 5},

["Caterpie"] = {x = 955, y = 1002, z = 5},

}

 

 

local level = 5 <--- Level do pokemon

local extrastr = 1.5

local btype = "normal"

Link para o comentário
Compartilhar em outros sites

Nenhum dos dois estão certos , voces tão botando pra qnd eu clika no bau eu ganhe os items i vo automaticamente para o templo , n é isso q eu quero , eu retirei isso aqui , [ doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) ] , eu quero que ele va pra outro lugar , não para o templo entendeu!!??

 

pelo templo ja vem no serv ¬¬'

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

@MaatheeuusYuurii

 

é lek , tanto faz , ou voce clika no bau i faz a quest i teleporta pra outro lugar , ou voce clika no bau , ganha os items i n vai para lugar nenhum , sendo q vc n possa mais clika nos outros bau's , ( por exemplo eu pego bulba i n posso pega mais nem squirtle nem charmander ) obg , se alguem me ajuda darei 2 rep + ,

Link para o comentário
Compartilhar em outros sites

@Maxximuss , manin nem deu certo aqui , é desse jeito mesmo que q eu quero ..

 

mais quando eu clico no bau tá apareçendo isso (You have picked up your pokemon) , i n tá pegando o pokemon :o

 

( sendo q eu n fiz a quest ) criei o char do 1 i tals , mais n deu :/ , ajuda ae manin.. obg!

 

 

 

 

-- EDIT

 

 

vlw zeref , rep + :D

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

local pos = {x = XXX, y = YYY, z = Z}

 

doTeleportThing(cid, pos).

 

só colocar a posição e.e

 

-- EDIT

 

Cheguei a 60 rep e.e vamo comemorar!!

 

ZEREF: BAGULHO INUTIL DA PORRA ME DA DINHEIRO É MELHOR

 

Pare de ser mercenario zeref... Mas que é inutil é.

 

ZEREF: TO FALANDO NEM EU ME ESCUTO U.U

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

Oi gente eu tenho uma duvida, baixei um client que tem muitos pokemons, (infernape e talz), e queria saber como eu faço para criar o monstro, tipo eu sei criar, mas eu queria saber como faço para colocar a sprite dele a dele mesmo, qual o looktype dele, como faço para saber o looktype, por qual programa?

Link para o comentário
Compartilhar em outros sites

@all queria sabe como tiro esse negocio , de usa moves com o level do pokemon , tpw no meu serv , se eu tive um hitmonchan lvl 10 , n uso as moves que são 30 , 40 .. queria sabe como retira isso , i deixa sem esses negocio de level pra solta tal spell , ( Level do pokemon não o meu )

Link para o comentário
Compartilhar em outros sites

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