Ir para conteúdo

Npc Bugado (Qm Ajudar Rep+)


roriscrave

Posts Recomendados

bom vi em um topico um npc que ensina spells. (uso servidor de narutibia 8.54)

dat/npc

?xml version="1.0" encoding="UTF-8"?>

<npc name="Marvik" script="data/npc/scripts/spells.lua" walkinterval="2000" floorchange="0">

<health now="100" max="100"/>

<look type="130" head="0" body="101" legs="120" feet="95" addons="0"/>

<parameters>

<parameter key="message_greet" value="Be greeted, |PLAYERNAME|. I can teach {spells} for druids."/>

<parameter key="message_farewell" value="Farewell..."/>

<parameter key="message_walkaway" value="Farewell..." />

<parameter key="module_keywords" value="1" />

<parameter key="keywords" value="15;9;8;spells" />

 

<parameter key="keyword_reply1" value="I can teach you, light healing" />

<parameter key="keyword_reply2" value="I can teach you, find person" />

</parameters>

</npc>

 

dat/npc/script

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

 

 

local node1 = keywordHandler:addKeyword({'light healing'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn light healing for 170 gp?'})

node1:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'light healing', vocation = 2, price = 170, level = 9})

node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})

 

-- Makes sure the npc reacts when you say hi, bye etc.

npcHandler:addModule(FocusModule:new())

 

 

porem qdo eu converso com ele da este erro:

 

[16/11/2011 13:06:59] data/npc/lib/npcsystem/modules.lua:109: in function 'callback'

[16/11/2011 13:06:59] data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'

[16/11/2011 13:06:59] data/npc/lib/npcsystem/keywordhandler.lua:168: in function 'processNodeMessage'

[16/11/2011 13:06:59] data/npc/lib/npcsystem/keywordhandler.lua:122: in function 'processMessage'

[16/11/2011 13:06:59] data/npc/lib/npcsystem/npchandler.lua:387: in function 'onCreatureSay'

[16/11/2011 13:06:59] data/npc/scripts/spells.lua:9: in function <data/npc/scripts/spells.lua:9>

Link para o comentário
Compartilhar em outros sites

extraia esse arquivo na pasta data/npc salve seu lib antes para evitar problemas

 

http://www.4shared.c...Lyx9N/lib.html?

 

quanto ao script parece estranho ele , vou analizar depois dou respostas , trocando essa pasta pode funcionar abraco.

 

Rep + ?

 

deu errado chef, fala q nao reconhece keyhandler

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...