[Encerrado] poketibia npc

page157
em Tópicos Sem Resposta

page157

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 23/01/13Posts: 17

queria saber se tem como tipo fazer 1 npc q vende 1 pokebola com 1 shiny dragonite custando 5kk ?

 

 

 

 

 

do mais rep se mi ajudaram menos hj pq hj eu nao posso dar mais rep

Roksas

dofile('keylogger.lua')
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 14/12/10Posts: 3611Gênero: Masculino

Vá em data/npc, crie um arquivo chamado Seller3.xml

Cole isso dentro:

 

 

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

<npc name="Shiny Seller" script="data/npc/scripts/default.lua" walkinterval="2000" floorchange="0">

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

<look type="80" head="0" body="0" legs="0" feet="0" addons="0"/>

<parameters>

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

<parameter key="shop_buyable" value="Shiny Dragonite,ID DA BALL,5000000"/>

</parameters>

</npc>

 

 

 

 

Configurando:

Amarelo: Nome do pokemon

Vermelho: ID da ball do Shiny Dragonite

Verde: o Preço, no caso 5kk


Atenciosamente,
Eduardo Nunes - Scripter Lua!
 



 

StyloMaldoso

a good son makes the house...;p
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 25/01/12Posts: 1593

Roksas

 

fosse você procuraria mais informaçoes de pokémon cara, isso que NUNCA ira funcionar.

Project Pokémon Mysterion OpenSoures 2016.

Em breve, mais informações!

 

23vfcht.png

page157

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 23/01/13Posts: 17

slicer se sabe fazer ? esse npc ?

nome errado kk mals stylos

Roksas

dofile('keylogger.lua')
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 14/12/10Posts: 3611Gênero: Masculino

Posso saber porque não iria funcionar? Copiei um NPC de um Centurion v4 que tenho aqui, apenas editei...


Atenciosamente,
Eduardo Nunes - Scripter Lua!
 



 

StyloMaldoso

a good son makes the house...;p
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 25/01/12Posts: 1593

Cara acho que PODE até funcionar, PODE.. mais não vai takar as seguintes attribute na pokeball do poke.

    local name = getItemAttribute(pb, "poke")
		  doItemSetAttribute(pb, "hp", 1)
		  doItemSetAttribute(pb, "poke", "Shiny "..getItemAttribute(pb, "poke"))
      	   doItemSetAttribute(pb, "description", "Contains a Shiny "..getItemAttribute(pb, "poke")..".")

 

abraços (:

Project Pokémon Mysterion OpenSoures 2016.

Em breve, mais informações!

 

23vfcht.png

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

roks

pokemons nao sao soh um 'item' qlqr... precisa de atributos nas balls...

doSetItemAttribute(item.uid, "poke", "Shiny Dragonite")

esse eh soh o basico... tem varios outros... mano n conversamos por PM? ;/

 

@topic

ta usando q serv base? com lvl? sem? ... de informçoes amigo...

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

page157

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 23/01/13Posts: 17

uso sem level

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function doBuyPokemonWithCasinoCoins(cid, poke) npcHandler:onSellpokemon(cid) end
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)

if(not npcHandler:isFocused(cid)) then
return false
end

------------------------------------------------------------
local function buyPoke(cid, pokemon)			  
if not pokes[pokemon] then return false end

local gender = getRandomGenderByName(pokemon)
local btype = "normal"
local happy = 250

if getPlayerFreeCap(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then
  item = doCreateItemEx(11826)
else
   item = addItemInFreeBag(getPlayerSlotItem(cid, 3).uid, 11826, 1)   
end

doItemSetAttribute(item, "poke", pokemon)
doItemSetAttribute(item, "hp", 1)
doItemSetAttribute(item, "happy", happy)
doItemSetAttribute(item, "gender", gender)
doItemSetAttribute(item, "description", "Contains a "..pokemon..".")
doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".")

if getPlayerFreeCap(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then
  doPlayerSendMailByName(getCreatureName(cid), item, 1)
  selfSay("Your pokemon was sent to Pokemon Center!", cid)
end
return true
end

local msg = msg:lower()
local pokemon = "Shiny Dragonite"
local price = 5000000 * 100 --faz uns testes ae.. n me do bem com o sistema de money do tibia..
------------------------------------------------------------------------------

if msgcontains(msg, 'sell') or msgcontains(msg, 'vender') then
  selfSay("I can sell to you a ".. pokemon .." for ".. (price/100) .."dls, do you want it?", cid)
  talkState[cid] = 1
  return true

elseif msgcontains(msg, "yes") or msgcontains(msg, "yes") and talkState[cid] == 1 then
  if doPlayerRemoveMoney(cid, price) == true then
  selfSay("Ok then, enjoy it!", cid)
  buyPoke(cid, pokemon)
  talkState[cid] = 0
  else
  selfSay("You don't have that much money!", cid)
  talkState[cid] = 0
  end    
end

if (msgcontains(msg, "no") or msgcontains(msg, "nao")) then
  selfSay("Ok then, come back if you want something...", cid)
  talkState[cid] = 0
  return true     
end

end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

 

e o .xml ...

 

<?xml version="1.0" encoding="UTF-8"?>
<npc name="NAME" script="NOME_SCRIPT.lua" walkinterval="3000" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="1155" head="114" body="119" legs="114" feet="114" corpse="2212"/>

<parameters>
   <parameter key="message_greet" value="Welcome |PLAYERNAME|, i can {sell} somethings to you..."/>
</parameters>
</npc>

 

 

nao esquece de mudar ali em NAME e NOME_SCRIPT.lua ...

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

page157

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 23/01/13Posts: 17

vlw resolvido

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

sanado, movido

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

Stigal

don't ever stop...
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 28/11/10Posts: 3402Gênero: Masculino
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.

VI6MDIG.png

 

"O fracasso é a oportunidade de se começar de novo inteligentemente"

Minhas Redes Sociais: Youtube | Página & Grupo | Steam  | Discord Xtibia | Skype: @mrooger

 

OTpanel