Ir para conteúdo

[Pedido]Npc Com Função De Rookgaard


zxsmockxz

Posts Recomendados

Ola pessoa do XTIBIA, eu to criando um map proprio, e eu queria saber como faz um npc que tipo, faz a função da statua de rookgaard, pra manda os players pra main...

Se tiver como postar ai por favor, eu to procurando um tuto sobre isso a duas semanas e nao achei :/

 

 

Obrigado desde já!

Link para o comentário
Compartilhar em outros sites

Data>Npc crie uma pasta.xml chamada The Oracle e coloca isso dentro:

 

<npc name="The Oracle" floorchange="0" walkinterval="0">
   <health now="150" max="150"/>
   <look typeex="1448"/>
   <interaction range="3" idletime="30">
       <interact keywords="hi" focus="1">
           <!--These are the keywords will trigger this interaction-->
           <keywords>hello</keywords>
           <keywords>greet</keywords>

           <response>
               <action name="script">
                   <![CDATA[
                       if(getPlayerLevel(cid)) >= 8 then
                           selfSay(getCreatureName(cid) .. ", ARE YOU PREPARED O FACE YOUR DESTINY?")
                           _state.b1 = (isPremium(cid) == TRUE)
                           _state.topic = 1
                       else
                           selfSay("CHILD! COME BACK WHEN YOU HAVE GROWN UP!")
                           _state.isidle = true
                       end
                   ]]>
               </action>
           </response>
       </interact>

       <interact keywords="yes" topic="1">
           <!--Premium account, b1 is set in above-->
           <response b1="1" text="IN WHICH TOWN DO YOU WANT TO LIVE: CARLIN, EDRON, THAIS, OR VENORE?">
               <action name="topic" value="2"/>
           </response>

           <!--Normal account-->
           <response text="IN WHICH TOWN DO YOU WANT TO LIVE: CARLIN, THAIS, OR VENORE?">
               <action name="topic" value="2"/>
           </response>
       </interact>

       <interact keywords="carlin" topic="2">
           <response text="IN CARLIN! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
               <!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
               <action name="script">
                   <![CDATA[
                       _state.n1 = 2
                       _state.topic = 3
                   ]]>
               </action>
           </response>
       </interact>

       <interact keywords="thais" topic="2">
           <response text="IN THAIS! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
               <!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
               <action name="script">
                   <![CDATA[
                       _state.n1 = 5
                       _state.topic = 3
                   ]]>
               </action>
           </response>
       </interact>

       <interact keywords="venore" topic="2">
           <response text="IN VENORE! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
               <!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
               <action name="script">
                   <![CDATA[
                       _state.n1 = 1
                       _state.topic = 3
                   ]]>
               </action>
           </response>
       </interact>

       <interact keywords="edron" topic="2">
           <response text="YOU NEED A PREMIUM ACCOUNT IN ORDER TO GO THERE!">
               <!--Set the topic back to 2, ie. choose a new town.-->
               <action name="topic" value="2"/>
           </response>
           <!--b1: premium account, see <interact keywords="hi" focus="1"> where _state.b1 is is set.-->
           <response b1="1" text="IN EDRON! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
               <!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
               <action name="script">
                   <![CDATA[
                       _state.n1 = 9
                       _state.topic = 3
                   ]]>
               </action>
           </response>
       </interact>

       <!--If the player does not say any city, repeat our question-->
       <interact keywords="|*|" topic="2">
           <response b1="1" text="CARLIN, EDRON, THAIS, OR VENORE?"/>
           <response text="CARLIN, EDRON, THAIS, OR VENORE?"/>
       </interact>

       <interact keywords="sorcerer" topic="3">
           <response text="A SORCERER! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
               <!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
               <action name="script">
                   <![CDATA[
                       _state.n2 = 1
                       _state.topic = 4
                   ]]>
               </action>
           </response>
       </interact>

       <interact keywords="druid" topic="3">
           <response text="A DRUID! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
               <!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
               <action name="script">
                   <![CDATA[
                       _state.n2 = 2
                       _state.topic = 4
                   ]]>
               </action>
           </response>
       </interact>

       <interact keywords="paladin" topic="3">
           <response text="A PALADIN! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
               <!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
               <action name="script">
                   <![CDATA[
                       _state.n2 = 3
                       _state.topic = 4
                   ]]>
               </action>
           </response>
       </interact>

       <interact keywords="knight" topic="3">
           <response text="A KNIGHT! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
               <!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
               <action name="script">
                   <![CDATA[
                       _state.n2 = 4
                       _state.topic = 4
                   ]]>
               </action>
           </response>
       </interact>

       <!--If the player does not say any profession, repeat our question-->
       <interact keywords="|*|" topic="3">
           <response text="KNIGHT, PALADIN, SORCERER, OR DRUID?"/>
       </interact>

       <interact keywords="yes" topic="4">
           <response>
               <!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
               <!--n2: 1 = knight, 2 = paladin, 3 = sorcerer, 4 = druid-->
               <action name="script">
                   <![CDATA[
                       local pos = 0
                       if(_state.n1 == 1) then
                           pos = {x=32957, y=32076, z=7}
                       elseif(_state.n1 == 2) then
                           pos = {x=32360, y=31782, z=7}
                       elseif(_state.n1 == 5) then
                           pos = {x=32369, y=32241, z=7}
                       elseif(_state.n1 == 9) then
                           pos = {x=33217, y=31814, z=8}
                       else
                           selfSay("I DO NOT KNOW WHAT PROFESSION THAT IS, ASK THE GODS FOR GUIDANCE!")
                           return
                       end

                       selfSay("SO BE IT!")
                       doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)

                       if(doTeleportThing(cid, pos) == 0) then
                           doPlayerSetTown(cid, _state.n1)
                           doPlayerSetVocation(cid, _state.n2)
                           doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
                       end
                   ]]>
               </action>
               <action name="idle" value="1"/>
           </response>
       </interact>

       <interact keywords="bye" focus="0">
           <keywords>farewell</keywords>
           <response text="Good bye. Recommend us, if you were satisfied with our service."/>
       </interact>

       <interact event="onBusy">
           <response text="WAIT UNTIL IT IS YOUR TURN!">
               <action name="addqueue" value="|PLAYER|"/>
           </response>
       </interact>

       <!--This event triggers if the player goes to far away from the npc/logout/idle timeout-->
       <interact event="onPlayerLeave" focus="0">
           <response text="COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!"/>
       </interact>
   </interaction>
</npc>  

 

Abraços..

Editado por DevilMoon
Link para o comentário
Compartilhar em outros sites

Cara eu fiz tudo certinho, vai pra city escolhida, normal, mais tipo a vocação nao ta funcionando, tipo eu falo sorcerer, ai vai pra city eu do look em mim msm e ta no vocation ainda :/

 

Meu OT é 8.6 me ajuda ai please :S

Link para o comentário
Compartilhar em outros sites

Cara, Vamos ver vou te Fazer 2 Perguntinhas.. Tem que Responder!!

 

1. Voce Editou as Ids da Vocations? Seu ot tem novas vocations Etc? ou Algo do Script? Poste - As..

 

2. Deu Algum Erro no Distro? Poste - Los

 

 

Meus Comentarios:

 

Eu Acho que Seu ot tem as Ids das Voc Sorc, Kina e etc.. Diferente que ta no script... pq essa versao de Npc esta na 8.40 ou 8.5..

ou

Voce mecheu em algo errado do script...

Link para o comentário
Compartilhar em outros sites

Intao nao sei porque meu ot é 8.6

 

Minhas vocacions tem id comum: Sorc = 1 Druid = 2 Pally = 3 e Kina = 4

 

No script eu só modifiquei as falas, eu traduzi olha vou postar como ficou o meu:

 

<npc name="The Oracle" floorchange="0" walkinterval="0"> 
   <health now="150" max="150"/> 
   <look typeex="1448"/> 
   <interaction range="3" idletime="30"> 
       <interact keywords="hi" focus="1"> 
           <!--These are the keywords will trigger this interaction--> 
           <keywords>hello</keywords> 
           <keywords>greet</keywords> 

           <response> 
               <action name="script"> 
                   <![CDATA[ 
                       if(getPlayerLevel(cid)) >= 8 then 
                           selfSay(getCreatureName(cid) .. ", voce esta preparado para o seu destino?") 
                           _state.b1 = (isPremium(cid) == TRUE) 
                           _state.topic = 1 
                       else 
                           selfSay("Pequeno bebe, volte quando estiver level 8!") 
                           _state.isidle = true 
                       end 
                   ]]> 
               </action> 
           </response> 
       </interact> 

       <interact keywords="yes" topic="1"> 
           <!--Premium account, b1 is set in above--> 
           <response b1="1" text="Em que cidade voce quer viver, no Saara ou na Amazonia?"> 
               <action name="topic" value="2"/> 
           </response> 

           <!--Normal account--> 
           <response text="Em que cidade voce quer viver, no Saara ou na Amazonia?"> 
               <action name="topic" value="2"/> 
           </response> 
       </interact> 

       <interact keywords="Saara" topic="2"> 
           <response text="E que oque voce quer ser, Knight, Paladin, Sorcerer ou Druid?"> 
               <!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore--> 
               <action name="script"> 
                   <![CDATA[ 
                       _state.n1 = 1 
                       _state.topic = 3 
                   ]]> 
               </action> 
           </response> 
       </interact> 

       <interact keywords="Amazonia" topic="2"> 
           <response text="E que oque voce quer ser, Knight, Paladin, Sorcerer ou Druid?"> 
               <!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore--> 
               <action name="script"> 
                   <![CDATA[ 
                       _state.n1 = 2 
                       _state.topic = 3 
                   ]]> 
               </action> 
           </response> 
       </interact> 

       <interact keywords="venore" topic="2"> 
           <response text="IN VENORE! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?"> 
               <!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore--> 
               <action name="script"> 
                   <![CDATA[ 
                       _state.n1 = 1 
                       _state.topic = 3 
                   ]]> 
               </action> 
           </response> 
       </interact> 

       <interact keywords="edron" topic="2"> 
           <response text="YOU NEED A PREMIUM ACCOUNT IN ORDER TO GO THERE!"> 
               <!--Set the topic back to 2, ie. choose a new town.--> 
               <action name="topic" value="2"/> 
           </response> 
           <!--b1: premium account, see <interact keywords="hi" focus="1"> where _state.b1 is is set.--> 
           <response b1="1" text="IN EDRON! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?"> 
               <!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore--> 
               <action name="script"> 
                   <![CDATA[ 
                       _state.n1 = 9 
                       _state.topic = 3 
                   ]]> 
               </action> 
           </response> 
       </interact> 

       <!--If the player does not say any city, repeat our question--> 
       <interact keywords="|*|" topic="2"> 
           <response b1="1" text="Em que cidade voce quer viver, no Saara ou na Amazonia?"/> 
           <response text="Em que cidade voce quer viver, no Saara ou na Amazonia?"/> 
       </interact> 

       <interact keywords="sorcerer" topic="3"> 
           <response text="Um Sorcerer voce tem certeza? Voce nao podera voltar atras!"> 
               <!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight--> 
               <action name="script"> 
                   <![CDATA[ 
                       _state.n2 = 1
                       _state.topic = 4 
                   ]]> 
               </action> 
           </response> 
       </interact> 

       <interact keywords="druid" topic="3"> 
           <response text="Um Druid voce tem certeza? Voce nao podera voltar atras!"> 
               <!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight--> 
               <action name="script"> 
                   <![CDATA[ 
                       _state.n2 = 2
                       _state.topic = 4 
                   ]]> 
               </action> 
           </response> 
       </interact> 

       <interact keywords="paladin" topic="3"> 
           <response text="Um Paladin voce tem certeza? Voce nao podera voltar atras!"> 
               <!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight--> 
               <action name="script"> 
                   <![CDATA[ 
                       _state.n2 = 3
                       _state.topic = 4 
                   ]]> 
               </action> 
           </response> 
       </interact> 

       <interact keywords="knight" topic="3"> 
           <response text="Um Knight voce tem certeza? Voce nao podera voltar atras!"> 
               <!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight--> 
               <action name="script"> 
                   <![CDATA[ 
                       _state.n2 = 4
                       _state.topic = 4 
                   ]]> 
               </action> 
           </response> 
       </interact> 

       <!--If the player does not say any profession, repeat our question--> 
       <interact keywords="|*|" topic="3"> 
           <response text="E que oque voce quer ser, Knight, Paladin, Sorcerer ou Druid?"/> 
       </interact> 

       <interact keywords="yes" topic="4"> 
           <response> 
               <!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore--> 
               <!--n2: 1 = knight, 2 = paladin, 3 = sorcerer, 4 = druid--> 
               <action name="script"> 
                   <![CDATA[ 
                       local pos = 0 
                       if(_state.n1 == 1) then 
                           pos = {x=1062, y=1104, z=7} 
                       elseif(_state.n1 == 2) then 
                           pos = {x=507, y=933, z=6} 
                       elseif(_state.n1 == 5) then 
                           pos = {x=32369, y=32241, z=7} 
                       elseif(_state.n1 == 9) then 
                           pos = {x=33217, y=31814, z=8} 
                       else 
                           selfSay("Eu nao entendi que profissao voce disse, repita por favor.") 
                           return 
                       end 

                       selfSay("SO BE IT!") 
                       doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) 

                       if(doTeleportThing(cid, pos) == 0) then 
                           doPlayerSetTown(cid, _state.n1) 
                           doPlayerSetVocation(cid, _state.n2) 
                           doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) 
                       end 
                   ]]> 
               </action> 
               <action name="idle" value="1"/> 
           </response> 
       </interact> 

       <interact keywords="bye" focus="0"> 
           <keywords>farewell</keywords> 
           <response text="Falow, espero ve-lo quando estiver pronto!"/> 
       </interact> 

       <interact event="onBusy"> 
           <response text="Espera, que eu to falando com ele!"> 
               <action name="addqueue" value="|PLAYER|"/> 
           </response> 
       </interact> 

       <!--This event triggers if the player goes to far away from the npc/logout/idle timeout--> 
       <interact event="onPlayerLeave" focus="0"> 
           <response text="Volte quando estiver preparado!"/> 
       </interact> 
   </interaction> 
</npc>

Editado por zxsmockxz
Link para o comentário
Compartilhar em outros sites

  • 1 year later...

Npc oracle é otimo, vou por em meu server ja to fazendo um aqui legal vai ter de tudo até esportes brincadeiras e diversão,vai ser um global mais divertido estou comprando scripts

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...