local catch_config = {
--[[
[catch_count] = { --[quantidade_de_catch] = {
prize_item = {
{itemid = xxx, count = xxx}, --{itemid = ID_do_item, count = quantidade}
{itemid = xxx, count = xxx}, --{itemid = ID_do_item, count = quantidade}
--etc
},
outfit = xxx --Se ganhar outfit, coloque a storage dela (de outfits.xml). Caso contrário, coloque false.
},
]]--
[30] = { --[quantidade_de_catch] = {
prize_item = {
{itemid = 11639, count = 1}, --{itemid = ID_do_item, count = quantidade}
},
outfit = false --Se ganhar outfit, coloque a storage dela (de outfits.xml). Caso contrário, coloque false.
},
[100] = { --[quantidade_de_catch] = {
prize_item = {
{itemid = 11641, count = 1}, --{itemid = ID_do_item, count = quantidade}
{itemid = 2160, count = 20}, --{itemid = ID_do_item, count = quantidade}
--etc
},
outfit = 49101 --Se ganhar outfit, coloque a storage dela (de outfits.xml). Caso contrário, coloque false.
},
}
local CATCH_STORAGE = 8382
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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 talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg:lower(), "mission") or msgcontains(msg:lower(), "help") then
local count, catch, need_catch = #getCatchList(cid)
for catch_count, info in pairs(catch_config) do
if getPlayerStorageValue(cid, CATCH_STORAGE + catch_count) < 1 then
if need_catch then
if catch_count < need_catch then
need_catch = catch_count
end
else
need_catch = catch_count
end
end
end
if not need_catch then
return selfSay("You have completed all my quests.")
elseif count < need_catch then
return selfSay("You need catch "..need_catch.." different pokemons to complete my next task. [Left: "..need_catch - count.." catches]")
end
catch = catch_config[need_catch]
selfSay("Congratulations, take your prizes!")
for i = 1, #catch.prize_item do
doPlayerAddItem(cid, catch.prize_item.itemid, catch.prize_item.count)
end
setPlayerStorageValue(cid, CATCH_STORAGE + need_catch, 1)
if catch.outfit then
setPlayerStorageValue(cid, catch.outfit, 1)
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())








info
Grupo: Campones
Registrado: 12/04/15
Posts: 26
Reputação: 0
Gostaria de saber se alguém sabe colocar pra esse sistema da as recompensas em diferentes statos de Catch
Tipo ele dar a recompensa quando o player tiver 30 catcher e depois da outra quando tiver 50 outo 100 e que eu possa configurar bem mas.
Dez de ja agradeço.
http://www.xtibia.com/forum/topic/205597-npc-catcher/
Editado Agosto 25 por Carlos Henrique PxD