Usa esse:
http://www.xtibia.com/forum/topic/177761-um-pet-system-diferente/page__fromsearch__1
Adiciona os storages e nomes como vc quiser e apenas troca o arquivo petsystem.lua por esse, o resto faz conforme esta la:
local petNames = {"RAT","DRAGON","DEMON"}
local petStorage = {
["RAT"] = 203105, -- storage do pet 1
["DRAGON"] = 203106, -- storage do pet 2
["DEMON"] = 203107 -- storage do pet 3
}
local textSay = {"Sim", "Nao", "Talves", "Nao intendi vc poderia repetir?"}
function onSay(cid, words, param, channel)
local summons = getCreatureSummons(cid)
if param == "" then
local text = "Você não possui pets!"
local o = 0
for i=1, #petNames do
if getPlayerStorageValue(cid, petStorage[petNames[i]]) > 0 then
o = o + 1
if o == 1 then
text = o.." - ".. string.lower(petNames[i]) .."\n"
else
text = text.. o .." - ".. string.lower(petNames[i]) .."\n"
end
end
end
doShowTextDialog(cid,8977,text)
return true
end
if param == "back" then
for k = 1, #summons do
pet = getCreatureName(summons[k])
doCreatureSay(cid, string.lower(pet) ..", back!", 1)
doRemoveCreature(summons[k])
setPlayerStorageValue(cid, petStorage[pet], 1)
end
return true
end
local t = string.explode(param, ",")
if t[1] == "say" then
if #summons > 0 then
doCreatureSay(summons[1], t[2], 1)
else
doPlayerSendCancel(cid,"Você possui Pet sumonado.")
end
return true
end
if t[1] == "conversa" then
if #summons > 0 then
doCreatureSay(summons[1], textSay[math.random(1,#textSay)], 1)
else
doPlayerSendCancel(cid,"Você possui Pet sumonado.")
return true
end
end
param = string.upper(param)
if isInArray(petNames, param) then
if getPlayerStorageValue(cid, petStorage[param]) == -1 then
doPlayerSendCancel(cid,"Você não possui esse Pet.")
return true
elseif getPlayerStorageValue(cid, petStorage[param]) == 1 then
if getTilePzInfo(getCreaturePosition(cid)) == false then
x = doSummonCreature(param, getCreaturePosition(cid))
doConvinceCreature(cid, x)
doCreatureSay(cid, string.lower(param) ..", go!", 1)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2)
setPlayerStorageValue(cid, petStorage[param], 2)
else
doPlayerSendTextMessage(cid, 22, "Você não pode sumonar seu Pet em Pz.")
return true
end
elseif getPlayerStorageValue(cid, petStorage[param]) == 2 and #summons > 0 then
doPlayerSendTextMessage(cid, 22, "Seu Pet esta sumonado, fale !pet back.")
return true
else
doPlayerSendTextMessage(cid, 22, "Seu Pet esta morto, fale !petrevive nomedopet para revivelo.")
return true
end
else
doPlayerSendCancel(cid,"Esse Pet não existe.")
end
return true
end




info
Grupo: Campones
Registrado: 11/03/12
Posts: 37
Reputação: +1
Char no Tibia: Doldorn
Ola. queria um sistema de pet por talkaction que presisase de x storage para usar x pet
Exenplo:
Nome - Storage
Pet 1 - 78551
Pet 2 - 78552
Pet 3 - 78553
Pet 4 - 78554
Pet 5 - 78555
Pet 6 - 78556
Pet 7 - 78557
Pet 8 - 78558
- Comandos
- !pet fale "algum texto que o player queira que o pet fale
- !pet conversa "vc fala algo e o pet responde aleatoriamente entre respostas basicas, ex. sim, nao, talves, nao intendi vc poderia repetir?
- !pet <NOME>, ele sumona o pet, caso use o mesmo comando novamente ele remove o pet
Nota: da pra usar apenas 1 pet ao mesmo tempo, nao pode ser usado em protection zone.
caso tenham duvidas sobre algo que nao consegui explicar add msn ou mande uma msg
vlw galera
davibrunelli@hotmail.com