Npc De Benção

FoReVeR
em NPCs, monsters e raids
  • 1
  • 2

FoReVeR

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 18/02/07Posts: 12

1°passo

 

Abra um bloco de notas e cole isso:

<?xml version="1.0"?> 

<npc name="Blasser" script="data/npc/scripts/blessings.lua" access="3" lookdir="3" > 
  <health now="100" max="100"/> 
<look type="149" head="79" body="85" legs="21" feet="114" addon="3" know="3"/> 
</npc>

 

salve(na pasta data/npc) como blesser.xml

 

2° Passo

 

abra otro bloco de notas e cole isso:

focus = 0 
talk_start = 0 
target = 0 
following = false 
attacking = false 

function onThingMove(creature, thing, oldpos, oldstackpos) 

end 


function onCreatureAppear(creature) 

end 


function onCreatureDisappear(cid, pos) 
    if focus == cid then 
         selfSay('Good bye then.') 
         focus = 0 
         talk_start = 0 
    end 
end 


function onCreatureTurn(creature) 

end 


function msgcontains(txt, str) 
    return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) 
end 


function onCreatureSay(cid, type, msg) 
    msg = string.lower(msg) 

    -- greeting phrase 
  if string.find(msg, '(%a*)hi(%a*)') and focus == 0 and string.len(msg) == 2 and getDistanceToCreature(cid) < 3 then 
     if isPremium(cid) then 
     selfSay('Hello ' .. creatureGetName(cid) .. '! You can ask me for the blessings.') 
        focus = cid 
        selfLook(cid) 
        talk_start = os.clock() 
     else 
        selfSay('Sorry, only premium players can have blessings.') 
        focus = 0 
        talk_start = 0 
     end    

          elseif focus == cid then 
     talk_start = os.clock() 

      
     if msgcontains(msg, 'blessings') then 
     selfSay('I will give first, second, third and fourth blessing, each 10k gold. After you die say unbless to buy blessings again.') 
      
      
     elseif msgcontains(msg, 'first') then 
     queststatus = getPlayerStorageValue(cid,7501) 
     if queststatus == -1 then 
     if pay(cid,10000) then 
     selfSay('/blessing ' .. creatureGetName(cid)) 
     selfSay('Great, now you are blessed with the first blessing.') 
     setPlayerStorageValue(cid,7501,1) 
     focus = 0 
     talk_start = 0 
     else 
     selfSay('Sorry, you need 10.000 gold coins.') 
      
     end 
     else 
     selfSay('Sorry, You already have this blessing') 
      
          end 

     elseif msgcontains(msg, 'second') then 
     queststatus2 = getPlayerStorageValue(cid,7502) 
     queststatus = getPlayerStorageValue(cid,7501) 
     if queststatus2 == -1 then 
     if queststatus ~= -1 then 
     if pay(cid,10000) then 
     selfSay('/blessing ' .. creatureGetName(cid)) 
     selfSay('Great, now you are blessed with the second blessing.')    
     setPlayerStorageValue(cid,7502,1) 
     focus = 0 
     talk_start = 0 
     else 
     selfSay('Sorry, you need 10.000 gold coins.') 
     end 
     else 
     selfSay('Sorry, You need first blessing') 
     end 
     else 
     selfSay('Sorry, You already have this blessing') 
     end    
   
     elseif msgcontains(msg, 'third') then 
     queststatus3 = getPlayerStorageValue(cid,7503) 
     queststatus2 = getPlayerStorageValue(cid,7502) 
     if queststatus3 == -1 then 
     if queststatus2 ~= -1 then 
     if pay(cid,10000) then 
     selfSay('/blessing ' .. creatureGetName(cid)) 
     selfSay('Great, now you are blessed with the third blessing.') 
     setPlayerStorageValue(cid,7503,1) 
     focus = 0 
     talk_start = 0 
     else 
     selfSay('Sorry, you need 10.000 gold coins.') 
     end 
     else 
     selfSay('Sorry, You need second blessing') 
     end 
     else 
     selfSay('Sorry, You already have this blessing') 
     end 

     elseif msgcontains(msg, 'fourth') then 
     queststatus4 = getPlayerStorageValue(cid,7504) 
     queststatus3 = getPlayerStorageValue(cid,7503) 
     if queststatus4 == -1 then 
     if queststatus3 ~= -1 then 
     if pay(cid,10000) then 
     selfSay('/blessing ' .. creatureGetName(cid)) 
     selfSay('Very nice, now you are blessed with all blessings, the gods will protect you when you die.') 
     setPlayerStorageValue(cid,7504,1) 
     focus = 0 
     talk_start = 0 
     else 
     selfSay('Sorry, you need 10.000 gold coins.') 
     end 
     else 
     selfSay('Sorry, You need third blessing') 
     end 
     else 
     selfSay('Sorry, You already have this blessing') 
     end 
      
     elseif msgcontains(msg, 'unbless') then 
     queststatus4 = getPlayerStorageValue(cid,7504) 
     queststatus3 = getPlayerStorageValue(cid,7503) 
     queststatus2 = getPlayerStorageValue(cid,7502) 
     queststatus1 = getPlayerStorageValue(cid,7501) 
     setPlayerStorageValue(cid,7501,-1) 
     setPlayerStorageValue(cid,7502,-1) 
     setPlayerStorageValue(cid,7503,-1) 
     setPlayerStorageValue(cid,7504,-1) 
     selfSay('Now, you are ready to buy blessings again.') 
     focus = 0 
     talk_start = 0 
      
                  
      
     elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then 
        selfSay('Good bye, ' .. creatureGetName(cid) .. '!') 
        focus = 0 
        talk_start = 0 
     end 
  end 
end 


function onCreatureChangeOutfit(creature) 

end 


function onThink() 
 
if focus == 0 then 
     selfWalk(2) 
  end    

if (os.clock() - talk_start) > 30 then 
       if focus > 0 then 
          selfSay('Farewell then.') 
       end 
          focus = 0 
    end 
   if focus ~= 0 then 
      if getDistanceToCreature(focus) > 3 then 
         selfSay('Farewell then.') 
         focus = 0 
      end 
   end 
end

 

Salve(na pasta data/npc/scripts) como blessings.lua

 

esta feito

 

Creditos: Thallys

[Assinatura irregular, consulte as regras]
Addict

xhoT-BR

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 18/02/07Posts: 115

Bem interessante.

 

Gostei, irei recomendar para meus amigos.

 

xhoT! :hi:

Olá XTibiano!

A sua assinatura estava danificando a estrutura do fórum e foi removida.

Para conferir sua assinatura antiga e restaurá-la, visite "Sobre mim" no seu perfil.

 

Grato pela atenção,

Henrique Moura.

epos

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 04/11/06Posts: 18

0.0

 

vlw

 

tava procurando isto fax mt tempo

 

vou testar depois falo alguma coisa

 

mas já agora \/

 

/blessing ' .. creatureGetName(cid))

 

isto existe mesmo ?

 

em todos os servers ?

 

:hi:

Tyler

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 03/02/07Posts: 80

Mto bom .. so q isso nao seris scripts?

Pra ser um tutorial vc teria q explicar tudo q tem dentro dos quotes ..

 

Ai sim ia ser tutorial ..

 

Mas ta bom ^^

Parabens !



é meu fan ? te ajudei ? foi totalmente com a minha cara ? ta aew a fan bar ^^!



Fan de




UhUl LePaRkOuR

Thiach

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 17/06/06Posts: 144

ashuhua

script mtu bom

continue assim

 

 

Chakau

Banido
avatar
Banidos
Banidos

INFOS

Grupo: BanidosRegistrado: 09/11/06Posts: 278

Kra

primeiro

Venho te dá as boas vindasao forum..

vejo que você é novato...

Muito bom ter novos membros com ideias para trazer ao forum

Muito bom esse npc

show de bola

[Usuário banido, Ofensas/Xingamentos a Equipe]
Addict

NetBSD

Powered By FreeBSD
avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 15/01/07Posts: 139

Ótimo tutorial,só que você precisa explicar +,nem todo mundo é intelectual xD

 

 

//Sasky

"The Power To Serve"

 

freebsd-logo1.png

Silviux

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 15/12/05Posts: 96

bem legal

mas

oq esse npc faz?

benção?

naum entendi

 

 

// Silviux


Good Vibes ॐ



GOD Zé

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 03/12/06Posts: 255

Aew Òtimo Tutorial =D~ =)~ xD~

flwss!!!!!

QUOTE
Aí GaLeRa CoM Um BrAçO Só ( _o/ _o/ _o/ ) AgOrAaa cOm O OuTrO ( \o_ \o_ \o_ ) AgOraaa COm Os DoiS ( \o/ \o/ \o/ ) VaMo Lá!! MãO Na CaBeÇa ( <o> <o> <o> ) PrA CimA (|o| |o| |o|) AGorA NenhUm DoS doiS ( _o_ _o_ _o_ ) IsSo... aGoRa QuErU VeR GeRaL PrUm LaDo ( o/ o/ o/ ) GeRaL PrO OuTrO ( \o \o \o ) BaTeNu PaLmInHa ( /o\ \o/ /o\ ) AgOrA AnImAe!¡!¡!

Universal Storm Ats União :-)

~*~~*~
Use minha fan bar
~*~~*~

Reibnitz

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 03/03/07Posts: 44

eu acho que esse sistema de blessing vem no zorzin, dai se voce tiver blessing tem menor chance de cair seus itens quando morre e perde menos exp.

Mas voce postou na área errada, a correta seria: Downloads/Scripts/NPC (se eu nao me engano).

Mas ótimo script ;D

Felipe Moraes

Java Developer
avatar
Grão-Duque
Grão-Duque

INFOS

Grupo: Grão-DuqueRegistrado: 02/10/06Posts: 3285Gênero: Masculino

parabens pelo tuto...se meu ot nao viesse com isso com certeza eu iria colocar...parabens,continue assim ajudando a comunidade xtibia

~A nossa maior glória não reside no fato de nunca cairmos, mas sim em levantarmo-nos sempre depois de cada queda.~

 

 

 

 

Clique aqui para ver meus tutoriais !

 

 

 

Gamertag: cpmoraes

 

 

Jvchequer

"Veni, vidi, vici."
avatar
Lenda
Lenda

INFOS

Grupo: LendaRegistrado: 10/10/05Posts: 2161Char no Tibia: Master Chequer

Tópico Movido.

 

Isto é em Npcs, não em tutorial.

 

Cya

1271330714-U1306.gif

 

~ Fiz parte da Equipe Xtibia em um tempo que Tibia era minha família. Saudades de todos vocês.

Thiach

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 17/06/06Posts: 144

nunca tinha visto um NPC como este,

mais ate que ficou legal!!

parabens ^^

 

 

  • 1
  • 2