Jump to content
Sign in to follow this  
541320

[8.1]Npc que enxe seu pote de health

Recommended Posts

541320    0
541320

Você fala com o npc:

-hi

->Voce quer que eu encha seu pote de health por 50 gps?

-encher

->Ai está seu pote cheio =]

 

Aqui vai um tutorial esplicando como fazê-lo ok?

 

 

PRIMEIRO

 

crie um documento de texto na área de trabalho, renomeando-o para Enche Health.xml e coloque isto dentro dele:

 

 

<?xml version="1.0"?>

<npc name="Enche Health" script="data/npc/scripts/encheh.lua" access="1" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="133" head="78" body="88" legs="0" feet="88"/>
</npc>

pronto, primeiro passo cumprido! ;)

 

SEGUNDO

 

Agora abra outro documento de texto renomeando para encheh.lua

e coloque isto dentro dele:

 

 

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

-- OTServ event handling functions start
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
-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)
   -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
   if(npcHandler.focus ~= cid) then
       return false
   end

if  msgcontains(msg, 'health potion') or msgcontains(msg, 'encher') then
           selfSay('Voce quer que eu encha seu pote de health por 50 gps?')
           talk_state = 1


       elseif msgcontains(msg, 'yes') and talk_state == 1 then
           if getPlayerItemCount(cid,7636,1) >= 1 and getPlayerItemCount(cid,2148,50) >= 1 then
               if doPlayerTakeItem(cid,7636,1) and doPlayerTakeItem(cid,2148,50) == 0 then
               selfSay('Ai Esta Seu pote cheio =]')
                   doPlayerAddItem(cid,7618,1)
               end
           else
               selfSay('Desculpe Voce Nao Tem os itens precisos.')
           end


       elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
           selfSay('Ok Ate Mais.')
           talk_state = 0
       end
   -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
   return true
end

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

 

 

Pronto! agora é só adicionar ele no seu map editor assim:

vá na pasta do map editor e abra o creatures.xml e adicione isto na lista!

 

 

<creature looktype="133" name="Enche Health" head="78" body="88" legs="0" feet="88" type="npc"/>

 

aew! agora é só colocar ele no seu mapa pelo map editor

 

Obs: esse npc substitui o pote vazio pelo pote cheio, pegando a sua grana, intão voce pode usar isso pra fazer outros itens serem substituidos!!

 

Creditos:Apenas Eu =]

Edited by 541320
esqueci de botar créditos

Share this post


Link to post
Dark    3
Dark

Isto é um download e não um tutorial

 

Aprovado

 

Movido

(Scripting Downloads NPCs)

Share this post


Link to post
Addicted    1
Addicted

Eu só num gostei do Nome do NPC, mas ficou legal ;)

Obrigado por postar.

Share this post


Link to post
Velho Doidao    2
Velho Doidao

Haha cara é bem criativo mas ao mesmo tempo meio inutil porque seria mais facil comprar potion novas.

 

Outra pergunta esse npc tem a opcao de encher um exemplo 20 potes de uma vez?Porque encher de 1 em 1 é um saco.

Share this post


Link to post
Mago Branco    0
Mago Branco

Parece interessante, até para evitar lag causado por players que espalham os vials por aew

 

Thanks :)

Share this post


Link to post
♀LэoйªM♀    0
♀LэoйªM♀

eu tbm nao gostei do nome do Npc heeh

mais ta rox

Parabêns ^^

vou add no meu OT hehe

Share this post


Link to post
541320    0
541320
eu tbm nao gostei do nome do Npc heeh

mais ta rox

Parabêns ^^

vou add no meu OT hehe

 

Qualquer coisa voces podem mudar o nome do npc pow!

Share this post


Link to post
541320    0
541320
Haha cara é bem criativo mas ao mesmo tempo meio inutil porque seria mais facil comprar potion novas.

 

Outra pergunta esse npc tem a opcao de encher um exemplo 20 potes de uma vez?Porque encher de 1 em 1 é um saco.

 

 

 

A resposta seria:

 

Ainda não desculpa =/

 

mas vo verificar isso

Share this post


Link to post
BlueAvenger    0
BlueAvenger

Gostei, do npc em sí eu gostei, ficou bem inovador, bastante criativo quando ao nome eu mudei isso é rpido e facil :D, está de parabens.

Gostei~

Share this post


Link to post
541320    0
541320

valeuuuuuu =)

Share this post


Link to post
541320    0
541320

Doa ot$ aeeeee XD

 

to precisando!!

xP

Edited by 541320

Share this post


Link to post
zunec    0
zunec

sera q algm podia me dizer como faço pa da great mana potion inves de health pot?

Share this post


Link to post
aspkot85    0
aspkot85

Lol e entranho

Share this post


Link to post
aspkot85    0
aspkot85

Xdddddddddddddddd

Share this post


Link to post
KwiiBy~    0
KwiiBy~

Bem legal assim não da muito trabalho ;)

Share this post


Link to post
Sign in to follow this  
  • Recently Browsing   0 members

    No registered users viewing this page.

×