Ir para conteúdo
  • 0

[Pedido]Script Npc Que Compra Pokemons


wedevin

Pergunta

Se tiver na area errada move ae

então andei pesquisando aqui no xtibia mas nao achei nenhum script que funfa , achei um mas ele ta bugado ele nao aparece no server

quem ajudar ganha +REP :button_ok:

Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0

Antes de tudo, não fui eu quem o fez, e sim os mesmos que fizeram o que você deve ter encontrado na pesquisa, porém este está arrumado.

 

Comprador de pokes.xml

<?xml version="1.0"?> 
<npc name="Comprador de Pokemon" script="data/npc/scripts/buy.pokemons.lua" walkinterval="5000" floorchange="0"> 
<health now="100" max="100"/> 
<look type="255" head="78" body="88" legs="0" feet="88" addons="3"/> 
<parameters> 
<parameter key="message_greet" value="Ola |PLAYERNAME|. quer me vender alguns {pokemon}? " /> 
</parameters> 
</npc>

 

Buy.pokemons.lua

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

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 talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid  

function pairsByKeys (t, f) -- function for alphabetical order in list 
 	local a = {} 
 	for n in pairs(t) do table.insert(a, n) end 
 	table.sort(a, f) 
 	local i = 0 
 	local iter = function () 
   	i = i + 1 
   	if a[i] == nil then return nil 
   	else return a[i], t[a[i]] 
   	end 
 	end 
 	return iter 
end 


local Pokemons = { 

["mew"] = {price = 5000000}, 
["mewtwo"] = {price = 5000000}, 
["lugia"] = {price = 7000000}, 
["celebi"] = {price = 5000000}, 
["moltres"] = {price = 4000000}, 
["zapdos"] = {price = 4000000}, 
["articuno"] = {price = 4000000}, 
["bayleef"] = {price = 4000000}, 
["chikorital"] = {price = 2000000}, 
["meganium"] = {price = 6000000},
["cyndaquil"] = {price = 2000000},
["quilava"] = {price = 4000000},
["typhlosion"] = {price = 6000000},
["teddiursa"] = {price = 2000000},
["ursaring"] = {price = 5000000},
["wobbuffet"] = {price = 3000000},
["stantler"] = {price = 3200000},
["noctowl"] = {price = 3500000},
["houndour"] = {price = 1000000},
["houndoom"] = {price = 3000000},
["gligar"] = {price = 3500000},
["hoothoot"] = {price = 1500000},
["scizor"] = {price = 8000000},
["steelix"] = {price = 8000000},
["hitmontopl"] = {price = 8000000},
["pichu"] = {price = 5000000},
["tyrogue"] = {price = 5000000},
["swablu"] = {price = 5000000},
["suicune"] = {price = 9000000},
["entei"] = {price = 9000000},
["raikou"] = {price = 9000000},
["skarmory"] = {price = 9000000},
["electabuzz"] = {price = 500000},
["seel"] = {price = 100000},
["dewgong"] = {price = 250000},
["arcanine"] = {price = 300000},
["muk"] = {price = 200000},
["shellder"] = {price = 50000},
["cloyster"] = {price = 300000},
["onix"] = {price = 350000},
["drowzee"] = {price = 100000},
["hypno"] = {price = 250000},
["kingler"] = {price = 150000},
["corphish"] = {price = 100000},
["crawdaunt"] = {price = 200000},
["exeggutor"] = {price = 200000},
["marowak"] = {price = 250000},
["hitmonlee"] = {price = 500000},
["hitmonchan"] = {price = 500000},
["lickitung"] = {price = 400000},
["weezing"] = {price = 250000},
["rhyhorn"] = {price = 100000},
["rhydon"] = {price = 250000},
["tangela"] = {price = 200000},
["kangaskhan"] = {price = 400000},
["kingdra"] = {price = 500000},
["togepi"] = {price = 100000},
["togetic"] = {price = 200000},
["shuppet"] = {price = 100000},
["banette"] = {price = 200000},
["duskull"] = {price = 200000},
["dusclops"] = {price = 300000},
["seaking"] = {price = 150000},
["buizel"] = {price = 100000},
["starmie"] = {price = 200000},
["mime jr"] = {price = 100000},
["mr.mime"] = {price = 350000},
["scyther"] = {price = 500000},
["smoochum"] = {price = 100000},
["jynx"] = {price = 350000},
["magmar"] = {price = 500000},
["politoed"] = {price = 400000},
["poliwrath"] = {price = 300000},
["gyarados"] = {price = 300000},
["lapras"] = {price = 500000},
["eevee"] = {price = 100000},
["porygon"] = {price = 700000},
["omanyte"] = {price = 150000},
["omastar"] = {price = 500000},
["kabuto"] = {price = 150000},
["kabutops"] = {price = 500000},
["aerodactyl"] = {price = 1000000},
["snorlax"] = {price = 600000},
["dratini"] = {price = 150000},
["dragonair"] = {price = 300000},
["dragonite"] = {price = 500000},
["ivysaur"] = {price = 200000},
["venusaur"] = {price = 300000},
["charmander"] = {price = 50000},
["charmeleon"] = {price = 150000},
["charizard"] = {price = 300000},
["squirtle"] = {price = 50000},
["wartortle"] = {price = 150000},
["blastoise"] = {price = 300000},
["fearow"] = {price = 200000},
["lucario"] = {price = 350000},
["arbok"] = {price = 200000},
["pikachu"] = {price = 150000},
["sandslash"] = {price = 300000},
["nidorina"] = {price = 100000},
["nidoqueen"] = {price = 250000},
["nidorino"] = {price = 100000},
["nidoking"] = {price = 250000},
["clefairy"] = {price = 150000},
["clefable"] = {price = 250000}
}


local idballs = { 
[2532] = {2531}, 
[2653] = {2557},
[2654] = {2525}, 
[2652] = {2524}, 
[2195] = {2523}, 
[2531] = {2532}, 
[2557] = {2653}, 
[2525] = {2654}, 
[2524] = {2652}, 
[2523] = {2195},
} 
local balls = idballs[getPlayerSlotItem(cid,8).itemid] 



if(msgcontains(msg, "pokemon") or msgcontains(msg, "pokemon")) then 
selfSay("Qual o pokemon que você quer me vender? quer olhar a {list} ?", cid)  
talkState[talkUser] = 1 
elseif (msgcontains(msg, "list") or msgcontains(msg, "LIST")) and talkState[talkUser] == 1 then 
local str = "" 
str = str .. "Pokemon Prices :\n\n" 
for name, pos in pairsByKeys(Pokemons) do 
str = str..name.." = "..pos.price.."\n" 
end 
str = str .. ""  
doShowTextDialog(cid, 6579, str)  
elseif Pokemons[msg]  and talkState[talkUser] == 1 then 
if getPlayerStorageValue(cid, 25000) == 5 then    	
return selfSay('Você está montando.',cid) 
elseif getPlayerStorageValue(cid, 23000) == 5 then 
return selfSay('Você está voando.',cid) 
elseif #getCreatureSummons(cid) >= 1 then 
return selfSay('Voce precisa botar seus pokemons dentro da pokebola.',cid) 
elseif balls == nil then 
return selfSay('Coloque seu pokemon slot da Pokeball para que eu possar examinar!!',cid) 
end 
local a = getItemAttribute(getPlayerSlotItem(cid,8).uid,"name") 
if string.find(tostring(a),msg) then 
doRemoveItem(getPlayerSlotItem(cid,8).uid, 1) 
doPlayerAddMoney(cid, Pokemons[msg].price)  
selfSay('Obrigado por vender o pokemon '..msg..' por '..Pokemons[msg].price..' meu amigo!', cid) 
else 
selfSay('vc n tem o pokemon '..msg..' para vender!', cid) 
end 
elseif msg == "no" and talkState[talkUser] >= 1 then  
selfSay("Then not", cid)  
talkState[talkUser] = 0  
npcHandler:releaseFocus(cid)  
end  
return TRUE  
end

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

 

Se quiser ajuda para instalá-lo avise.

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

×
×
  • Criar Novo...