Darkanso 1 Postado Maio 3, 2009 Share Postado Maio 3, 2009 (editado) Npc Pet Bom, conforme o tibia foi se atualizando o Npc de reviver o pet foi sendo ultrapassado e acabou não funcionando mais e por causa de muitos pedidos resolvi arrumar ele e colocar aqui (Atenção o sistema Pet só funciona em The Forgotten Server ou qualquer outro Ot que tenha a pasta creaturescripts ) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- >> Bom aqui está o sistem Pet trazido ao xtibia pelo Messenga : Clique aqui! --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1º Passo: Npc Pet Abra seu ot e vá na pasta data/npc e copie qualquer arquivo xml e renomeio para "Pet" e abrá ele em forma de bloco de notas e apague tudo que esta nele e em seu conteúdo adicione isso : <?xml version="1.0" encoding="UTF-8"?><npc name="Pet" script="data/npc/scripts/pet.lua" walkinterval="2000" floorchange="0"> <health now="20" max="20"/> <look type="21" head="20" body="30" legs="40" feet="50" corpse="5964"/> </npc> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2º Passo: script do Npc Pet Abra seu ot e vá na pasta data/npc/script e e copie qualquer arquivo LUA e renomeio para "pet" e em seguida abra ele e apague todo o conteúdo de dentro e adicione isso : -- by Darkanso local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} dofile("./petConfig.lua") 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 local costPerLevel = 300 if msgcontains(msg, 'revive') then if isCreature(getPlayerStorageValue(cid, storages.petUid)) == 0 then if getPlayerStorageValue(cid, storages.petIsOnline) == 2 then selfSay('YOUR PET DIED?!, YOU\'R A BAD OWNER, THIS WILL COST YOU ' .. getPlayerLevel(cid)*costPerLevel .. ' GOLD COINS!, AGREE?!', cid) talkState[talkUser] = 1 else selfSay('Your pet is alive.', cid) end else selfSay('Your pet is standing next to you.', cid) end elseif talkState[talkUser] == 1 then if msgcontains(msg, 'yes') then if doPlayerRemoveMoney(cid, getPlayerLevel(cid)*costPerLevel) == 1 then setPlayerStorageValue(cid, storages.petIsOnline, 1) selfSay('You can now summon again your pet.', cid) talkState[talkUser] = 0 else selfSay('You don\'t have enought money.', cid) end else selfSay('Então porque veio aqui encher meu saco?', cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- >> Adicionando o Npc ao Ot: Bom depois de ter feito tudo isso abra seu mapa editor e adicione seu Npc a ele ou de /s pet dentro no Otserver. >> Fazendo o Pet: Para fazer o Pet fale !pet. >> Como reviver o Pet: Bom, chegue no Npc Pet e pronuncie a mensagem "hi" e abrira o chat de Npc's, então pronuncie a mensagem "revive", (se seu pet não estiver morto o Npc fala-ra para voce "Your pet is alive." ) se ele tiver morto mesmo fale "yes" e ele lhe pegara uma quantia de dinheiro de acordo com seu level e ressucitara seu Pet novamente. Então para poder fazer o pet de novo pronuncie a mensagem !pet. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- >> SS do Npc Pet: SS aqui! --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Testei o npc nas versões 8.40, 8.41 e 8.42 e funcionou normalmente. Qualquer dúvida só perguntar. Não se esqueçam que o sistema pet só funciona em The Forgotten Server ou qualquer Ot que tenha a pasta creaturescripts. Bom os créditos do Npc são para mim e os créditos do sistema é para o Mesenga ao trazer o conteúdo ao xtibia. Bom esse é meu primeiro Npc e primeiro tópico. Vlw por lerem meu tópico. Comentem pessoal. Abraços. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Editado Maio 4, 2009 por Darkanso Link para o comentário https://xtibia.com/forum/topic/112453-npc-new-npc-pet-840-842/ Compartilhar em outros sites More sharing options...
cagaio 0 Postado Maio 5, 2009 Share Postado Maio 5, 2009 (editado) Muiitooooooooo OBRIGADO ! Vou Ver se Funciona e Edito mas Realmente éra oq eu KERIA vlww TE AMO *---* Edit : FUNFO *______* Editado Maio 5, 2009 por cagaio Link para o comentário https://xtibia.com/forum/topic/112453-npc-new-npc-pet-840-842/#findComment-734547 Compartilhar em outros sites More sharing options...
Darkanso 1 Postado Maio 5, 2009 Autor Share Postado Maio 5, 2009 (editado) Vlw pelo coments, (finalmente um , hehe ) mas qualquer dúvide só perguntar. Atensiosamente, Darkanso. Editado Maio 5, 2009 por Darkanso Link para o comentário https://xtibia.com/forum/topic/112453-npc-new-npc-pet-840-842/#findComment-734752 Compartilhar em outros sites More sharing options...
kleeston 0 Postado Maio 7, 2009 Share Postado Maio 7, 2009 vlw te amo uahehdaeiuhha na boa fikei horas tentando arruma essa .... agora pego vlw \o Link para o comentário https://xtibia.com/forum/topic/112453-npc-new-npc-pet-840-842/#findComment-735355 Compartilhar em outros sites More sharing options...
ThiagoGimenes 1 Postado Maio 7, 2009 Share Postado Maio 7, 2009 Muito bom, valeu pelo conteudo. Parabens! Abraços... ThiagoGimenes Link para o comentário https://xtibia.com/forum/topic/112453-npc-new-npc-pet-840-842/#findComment-735464 Compartilhar em outros sites More sharing options...
Darkanso 1 Postado Maio 8, 2009 Autor Share Postado Maio 8, 2009 Eu que agradeço, fico muito grato em poder ajudar muita gente. Atensiosamnete, Darkanso. Link para o comentário https://xtibia.com/forum/topic/112453-npc-new-npc-pet-840-842/#findComment-736028 Compartilhar em outros sites More sharing options...
Onizord 1 Postado Maio 9, 2009 Share Postado Maio 9, 2009 Ae cara ajudou muito to usando no meu ot! =P Mas uma coisa, pra mudar os preços, no meu ot por exemplo, acharam muito caro o preço.. é só mudar o que tá em azul! -- by Darkanso local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} dofile("./petConfig.lua") 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 local costPerLevel = 300 if msgcontains(msg, 'revive') then if isCreature(getPlayerStorageValue(cid, storages.petUid)) == 0 then if getPlayerStorageValue(cid, storages.petIsOnline) == 2 then selfSay('YOUR PET DIED?!, YOU\'R A BAD OWNER, THIS WILL COST YOU ' .. getPlayerLevel(cid)*costPerLevel .. ' GOLD COINS!, AGREE?!', cid) talkState[talkUser] = 1 else selfSay('Your pet is alive.', cid) end else selfSay('Your pet is standing next to you.', cid) end elseif talkState[talkUser] == 1 then if msgcontains(msg, 'yes') then if doPlayerRemoveMoney(cid, getPlayerLevel(cid)*costPerLevel) == 1 then setPlayerStorageValue(cid, storages.petIsOnline, 1) selfSay('You can now summon again your pet.', cid) talkState[talkUser] = 0 else selfSay('You don\'t have enought money.', cid) end else selfSay('Então porque veio aqui encher meu saco?', cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) e também outra coisa que nem tem no tópico do messenga é o !petsay que tá no code abaixo! dofile("./petConfig.lua") function onSay(cid, words, param) if isExhausted(cid) == 1 then return 0 end local daPet = getPlayerStorageValue(cid, storages.petUid) if isCreature(daPet) == 1 then if param ~= nil then if string.len(param) < lenght then doCreatureSay(daPet, '' .. param .. '', TALKTYPE_ORANGE_1) else doPlayerSendCancel(cid, 'No more than ' .. lenght .. ' character. ') end else doPlayerSendCancel(cid, 'You must enter a text') end else doPlayerSendCancel(cid, 'You haven\'t call your pet!') end return setExhausted(cid) end Link para o comentário https://xtibia.com/forum/topic/112453-npc-new-npc-pet-840-842/#findComment-736393 Compartilhar em outros sites More sharing options...
Darkanso 1 Postado Maio 9, 2009 Autor Share Postado Maio 9, 2009 @Oniz0r Sim, sim. Grato. :positive: Link para o comentário https://xtibia.com/forum/topic/112453-npc-new-npc-pet-840-842/#findComment-736685 Compartilhar em outros sites More sharing options...
LorD Sybian 1 Postado Maio 17, 2009 Share Postado Maio 17, 2009 Aprovado # :button_ok: esK~ Link para o comentário https://xtibia.com/forum/topic/112453-npc-new-npc-pet-840-842/#findComment-740193 Compartilhar em outros sites More sharing options...
thixz 0 Postado Junho 7, 2009 Share Postado Junho 7, 2009 AFF MANO AKI DA UM ERRO ASSIM CAN NOT SUCH OR FILE DIRECTORY ./PETCONFIG.LUA E AKI NO MEU OT TWEM A PASTA CREATURA ESCRIPT AFF ja tentei apaga essa linha mas se apaga o npc nao responde nada Link para o comentário https://xtibia.com/forum/topic/112453-npc-new-npc-pet-840-842/#findComment-746426 Compartilhar em outros sites More sharing options...
charizardgigant 0 Postado Junho 28, 2009 Share Postado Junho 28, 2009 (editado) ERRO O MEU NAO FOI NA HORA DE ABRIR O OT FALA QUE OS ARQUIVOS !PET !PETINFO DENTRO DA PASTA TALKTATIONS/SPRIPTS NAO TEM LOCAL DE DIRETORIO TENHO UMAS DUVIDAS TB 1- OQ O CREATURESCRIPT TEM A HAVER? 2- ELE NAO LOCALIZA O PETCONFIG.LUA EU CRIEI ESSE ARQUIVO NA PASTA DO JUNTO E COLEI OQ PEDIRAM PRA COLAR MAS MSM ASSIM NAO FOI TEM QUE COLOCAR DENTRO DO CONFIG.LUA OW DENTRO DO CREATURESCRIPT OW ALGUMA COISA ASSIM? CONCERTESA ELE NAO ESTA LOCALIZANDO OS : dofile(".data/petConfig.lua") OW ALGUMA COISA PARECE ALGUEM ME AJUDA POR FAVOR... Editado Junho 28, 2009 por charizardgigant Link para o comentário https://xtibia.com/forum/topic/112453-npc-new-npc-pet-840-842/#findComment-754182 Compartilhar em outros sites More sharing options...
juanbrando 3 Postado Junho 29, 2009 Share Postado Junho 29, 2009 ERRO O MEU NAO FOI NA HORA DE ABRIR O OT FALA QUE OS ARQUIVOS !PET !PETINFO DENTRO DA PASTA TALKTATIONS/SPRIPTS NAO TEM LOCAL DE DIRETORIO TENHO UMAS DUVIDAS TB 1- OQ O CREATURESCRIPT TEM A HAVER? 2- ELE NAO LOCALIZA O PETCONFIG.LUA EU CRIEI ESSE ARQUIVO NA PASTA DO JUNTO E COLEI OQ PEDIRAM PRA COLAR MAS MSM ASSIM NAO FOI TEM QUE COLOCAR DENTRO DO CONFIG.LUA OW DENTRO DO CREATURESCRIPT OW ALGUMA COISA ASSIM? CONCERTESA ELE NAO ESTA LOCALIZANDO OS : dofile(".data/petConfig.lua") OW ALGUMA COISA PARECE ALGUEM ME AJUDA POR FAVOR... NO MEU TB :icon_idea: Link para o comentário https://xtibia.com/forum/topic/112453-npc-new-npc-pet-840-842/#findComment-754293 Compartilhar em outros sites More sharing options...
LorD Sybian 1 Postado Junho 30, 2009 Share Postado Junho 30, 2009 @Topic@ Organizado Aprovado # :button_ok: @npc@ Muito bom Aprovado # :button_ok: Media 10 Aprovado # :button_ok: esK~ Link para o comentário https://xtibia.com/forum/topic/112453-npc-new-npc-pet-840-842/#findComment-754944 Compartilhar em outros sites More sharing options...
Posts Recomendados