Ir para conteúdo

Como Altera a Fala do NPC ?


Pesilk

Posts Recomendados

Como altera uma frase que o npc diz quando o player fala HI ?

Tipo essa:

 

16:44 Dark Rodo: Welcome, GoD Baiak! I have been expecting you.

Boa tarde,

Posta o script do seu NPC aqui que eu lhe ajudarei.

Aguardando, abraço ;]

Link para o comentário
Compartilhar em outros sites


local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

 

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

 

local shopModule = ShopModule:new()

npcHandler:addModule(shopModule)

 

shopModule:addBuyableItem({'wand of voodoo', 'voodoo'}, 8922, 22000, 'wand of voodoo')

shopModule:addBuyableItem({'wand of inferno', 'inferno'}, 2187, 15000, 'wand of inferno')

shopModule:addBuyableItem({'wand of decay', 'decay'}, 2188, 5000, 'wand of decay')

shopModule:addBuyableItem({'wand of draconia', 'plague'}, 8921, 7500, 'wand of draconia')

shopModule:addBuyableItem({'wand of starstorm', 'starstorm'}, 8920, 18000, 'wand of starstorm')

shopModule:addBuyableItem({'wand of cosmic energy', 'cosmic'}, 2189, 10000, 'wand of cosmic energy')

shopModule:addBuyableItem({'wand of vortex', 'vortex'}, 2190, 500, 'wand of vortex')

shopModule:addBuyableItem({'wand of dragonbreath', 'dragon'}, 2191, 1000, 'wand of dragonbreath')

shopModule:addBuyableItem({'northwind rod', 'northwind'}, 8911, 7500, 'northwind rod')

shopModule:addBuyableItem({'underworld rod', 'underworld'}, 8910, 22000, 'underworld rod')

shopModule:addBuyableItem({'hailstorm rod', 'hailstorm rod'}, 2183, 15000, 'hailstorm rod')

shopModule:addBuyableItem({'terra rod', 'terra'}, 2181, 10000, 'terra rod')

shopModule:addBuyableItem({'snakebite rod', 'snakebite'}, 2182, 500, 'snakebite rod')

shopModule:addBuyableItem({'necrotic rod', 'necrotic'}, 2185, 5000, 'necrotic rod')

shopModule:addBuyableItem({'moonlight rod', 'moonlight'}, 2186, 1000, 'moonlight rod')

shopModule:addBuyableItem({'springsprout rod', 'springsprout'}, 8912, 18000, 'springsprout rod')

shopModule:addBuyableItem({'ultimate health potion', 'uhp'}, 8473, 310, 'ultimate health potion')

shopModule:addBuyableItem({'great health potion', 'ghp'}, 7591, 190, 'great health potion')

shopModule:addBuyableItem({'strong health potion', 'shp'}, 7588, 100, 'strong health potion')

shopModule:addBuyableItem({'health potion', 'hp'}, 7618, 45, 'health potion')

shopModule:addBuyableItem({'great spirit potion', 'gsp'}, 8472, 190, 'great spirit potion')

shopModule:addBuyableItem({'great mana potion', 'gmp'}, 7590, 120, 'great mana potion')

shopModule:addBuyableItem({'strong mana potion', 'smp'}, 7589, 80, 'strong mana potion')

shopModule:addBuyableItem({'mana potion', 'mp'}, 7620, 50, 'mana potion')

shopModule:addBuyableItem({'light wand', 'lightwand'}, 2163, 500, 'magic light wand')

shopModule:addBuyableItem({'heavy magic missile', 'hmm'}, 2311, 300, 20, 'heavy magic missile rune')

shopModule:addBuyableItem({'great fireball', 'gfb'}, 2304, 500, 20, 'great fireball rune')

shopModule:addBuyableItem({'explo', 'xpl'}, 2313, 800, 20, 'explosion rune')

shopModule:addBuyableItem({'ultimate healing', 'uh'}, 2273, 700, 20, 'ultimate healing rune')

shopModule:addBuyableItem({'sudden death', 'sd'}, 2268, 1000, 20, 'sudden death rune')

shopModule:addBuyableItem({'blank', 'rune'}, 2260, 10, 'blank rune')

shopModule:addBuyableItem({'spellbook'}, 2175, 150, 'spellbook')

 

npcHandler:addModule(FocusModule:new())

 

Link para o comentário
Compartilhar em outros sites

Olá,
Posta o arquivo .xml dele, que está na pasta NPC.

~Edit:
O Demon hoje está adiantando segundos na frente de todo mundo, o mesmo que aconteceu com o Duuh aconteceu comigo agora, assim que eu postei a mensagem do Demon apareceu na minha frente! kkkkk

@topic
Como o Demon explicou, você pode adicionar:

<interact keywords="hi" focus="1">
      <!--Aqui você coloca palavras alternativas alem do "HI"-->
      <keywords>hello</keywords>
      <response text="Hello. How may I help you |NAME|?"/>
</interact>

Ai se você falar "HI" ou "HELLO" ele vai responder "Hello. How May i Help you |NAME|" para você, edite a vontade.
Abraços.

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

Ta assim

<npc name="Dark Rodo" script="data/npc/scripts/runes.lua" access="5" lookdir="1">
    <health now="1000" max="1000"/>
<look type="133" head="0" body="86" legs="0" feet="38" addons="1"/>
</npc>  

Fica Assim ??

 <npc name="Dark Rodo" script="data/npc/scripts/runes.lua" access="5" lookdir="1"><interact keywords="hi" focus="1">
      <keywords>hello</keywords>
      <response text="Olá |NAME|, eu vendo Wans, Rods e Runas. O Que Deseja ?"/>
</interact>
    <health now="1000" max="1000"/>
<look type="133" head="0" body="86" legs="0" feet="38" addons="1"/>
</npc>  
Link para o comentário
Compartilhar em outros sites

Experimente:

<?xml version="1.0"?>
<npc name="Dark Rodo" script="data/npc/scripts/runes.lua" access="5" lookdir="1">
    <health now="1000" max="1000"/>
<look type="133" head="0" body="86" legs="0" feet="38" addons="1"/>

<interaction range="3" idletime="30" idleinterval="300" defaultpublic="0">
<include file="Dark Rodo.xml"/>

 <interact keywords="hi" focus="1">
      <keywords>hello</keywords>
      <response text="Hello. How may I help you |NAME|?"/>
</interact>
</interaction>
</npc>   

Importante lembrar que você deve alterar o:

<include file="runes.xml"/>

Para o nome do script do seu NPC. Pois poderá dar erro se você incluir algumas funções.
Testa ai.
Abraço e aguardo respostas.

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

Experimente:

 

<npc name="Dark Rodo" script="data/npc/scripts/runes.lua" access="5" lookdir="1">
    <health now="1000" max="1000"/>
<look type="133" head="0" body="86" legs="0" feet="38" addons="1"/>

<interaction range="3" idletime="30" idleinterval="300" defaultpublic="0">
<include file="runes.xml"/>

 <interact keywords="hi" focus="1">
      <keywords>hello</keywords>
      <response text="Hello. How may I help you |NAME|?"/>
</interact>
</interaction>
</npc>   

Importante lembrar que você deve alterar o:

<include file="runes.xml"/>

Para o nome do script do seu NPC. Pois poderá dar erro se você incluir algumas funções.

Testa ai.

Abraço e aguardo respostas.

 

Nem Foi '-' Dá Esse Erro::

[20/04/2014 17:11:57] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Dark Rodo.xml).
[20/04/2014 17:11:57] Line: 10, Info: Input is not proper UTF-8, indicate encoding !
[20/04/2014 17:11:57] Bytes: 0xE1 0x20 0x7C 0x4E


[20/04/2014 17:11:58] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Dark Rodo.xml).
[20/04/2014 17:11:58] Line: 10, Info: Input is not proper UTF-8, indicate encoding !
[20/04/2014 17:11:58] Bytes: 0xE1 0x20 0x7C 0x4E


[20/04/2014 17:11:58] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Dark Rodo.xml).
[20/04/2014 17:11:58] Line: 10, Info: Input is not proper UTF-8, indicate encoding !
[20/04/2014 17:11:58] Bytes: 0xE1 0x20 0x7C 0x4E


[20/04/2014 17:11:58] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Dark Rodo.xml).
[20/04/2014 17:11:58] Line: 10, Info: Input is not proper UTF-8, indicate encoding !
[20/04/2014 17:11:58] Bytes: 0xE1 0x20 0x7C 0x4E

Link para o comentário
Compartilhar em outros sites

 

 

Nem Foi '-' Dá Esse Erro::

[20/04/2014 17:11:57] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Dark Rodo.xml).
[20/04/2014 17:11:57] Line: 10, Info: Input is not proper UTF-8, indicate encoding !
[20/04/2014 17:11:57] Bytes: 0xE1 0x20 0x7C 0x4E


[20/04/2014 17:11:58] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Dark Rodo.xml).
[20/04/2014 17:11:58] Line: 10, Info: Input is not proper UTF-8, indicate encoding !
[20/04/2014 17:11:58] Bytes: 0xE1 0x20 0x7C 0x4E


[20/04/2014 17:11:58] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Dark Rodo.xml).
[20/04/2014 17:11:58] Line: 10, Info: Input is not proper UTF-8, indicate encoding !
[20/04/2014 17:11:58] Bytes: 0xE1 0x20 0x7C 0x4E


[20/04/2014 17:11:58] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Dark Rodo.xml).
[20/04/2014 17:11:58] Line: 10, Info: Input is not proper UTF-8, indicate encoding !
[20/04/2014 17:11:58] Bytes: 0xE1 0x20 0x7C 0x4E

Eu editei o script, use ele EXATAMENTE como está lá, apague tudo do seu e use o que eu lhe passei agora.

Aguardando.

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...