Ir para conteúdo
  • 0

[Npc] Professor De Spells


rafaronqui

Pergunta

Tipo do script: NPC

Protocolo (versão do Tibia): 8.60

Servidor utilizado: Real Server 3.3 (Acredito que vale como TFS 0.3.6)

Nível de experiência: Mediano (noção boa de .lua)

 

Adicionais/Informações:

 

Então, eu procurei, procurei e procurei mais só encontrei script de NPCs que vendem spells em topicos muito antigos (2007~2008). O code de tais versões não funciona no meu server. Eu ficaria grato pra caralho, e daria rep++ todo dia até o fim do X-Tibia para a alma boa que me ajudar :D

 

A seguir o code atual:

(Esse é só do NPC de magias de druid.)

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?'})
       	travelNode:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'light healing', vocation = 2, price = 170, level = 9})
       	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node2 = keywordHandler:addKeyword({'find person'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn find person for 80 gp?'})
   node2:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'find person', vocation = 2, price = 80, level = 8})
   node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node3 = keywordHandler:addKeyword({'light magic missile'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn light magic missile for 600 gp?'})
   node3:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'light magic missile', vocation = 2, price = 600, level = 15})
   node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node4 = keywordHandler:addKeyword({'magic rope'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn magic rope for 200 gp?'})
   node4:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'magic rope', vocation = 2, price = 200, level = 9})
   node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node5 = keywordHandler:addKeyword({'antidote rune'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn antidote rune for 600 gp?'})
   node5:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'antidote rune', vocation = 2, price = 600, level = 15})
   node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node6 = keywordHandler:addKeyword({'death strike'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn death strike for 800 gp?'})
   node6:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'death strike', vocation = 2, price = 800, level = 16})
   node6:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node7 = keywordHandler:addKeyword({'intense healing'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn intense healing for 350 gp?'})
   node7:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'intense healing', vocation = 2, price = 350, level = 11})
   node7:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node8 = keywordHandler:addKeyword({'energy strike'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn energy strike for 800 gp?'})
   node8:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'energy strike', vocation = 2, price = 800, level = 12})
   node8:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node9 = keywordHandler:addKeyword({'levitate'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn levitate for 500 gp?'})
   node9:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'levitate', vocation = 2, price = 500, level = 12})
   node9:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node10 = keywordHandler:addKeyword({'flame strike'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn flame strike for 800 gp?'})
   node10:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'flame strike', vocation = 2, price = 800, level = 12})
   node10:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node11 = keywordHandler:addKeyword({'great light'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn great light for 500 gp?'})
   node11:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'great light', vocation = 2, price = 500, level = 13})
   node11:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node12 = keywordHandler:addKeyword({'food'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn food for 300 gp?'})
   node12:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'food', vocation = 2, price = 300, level = 14})
   node12:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node13 = keywordHandler:addKeyword({'poison field'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn poison field for 300 gp?'})
   node13:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'poison field', vocation = 2, price = 300, level = 14})
   node13:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node14 = keywordHandler:addKeyword({'magic shield'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn magic shield for 450 gp?'})
   node14:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'magic shield', vocation = 2, price = 450, level = 14})
   node14:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node15 = keywordHandler:addKeyword({'strong haste'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn strong haste for 1300 gp?'})
   node15:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'strong haste', vocation = 2, price = 1300, level = 20})
   node15:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node16 = keywordHandler:addKeyword({'antidote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn antidote for 150 gp?'})
   node16:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'antidote', vocation = 2, price = 150, level = 10})
   node16:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})

local node17 = keywordHandler:addKeyword({'intense healing rune'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn intense healing rune for 600 gp?'})
   node17:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'intense healing rune', vocation = 2, price = 600, level = 15})
   node17:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node18 = keywordHandler:addKeyword({'ultimate light'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn ultimate light for 1600 gp?'})
   node18:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'ultimate light', vocation = 2, price = 1600, level = 26})
   node18:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node19 = keywordHandler:addKeyword({'fire field'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn fire field for 500 gp?'})
   node19:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'fire field', vocation = 2, price = 500, level = 15})
   node19:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node20 = keywordHandler:addKeyword({'convince creature'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn convince creature for 800 gp?'})
   node20:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'convince creature', vocation = 2, price = 800, level = 16})
   node20:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node21 = keywordHandler:addKeyword({'fireball'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn fireball for 800?'})
   node21:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'fireball', vocation = 2, price = 800, level = 17})
   node21:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node22 = keywordHandler:addKeyword({'destroy field'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn destroy field for 700 gp?'})
   node22:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'destroy Field', vocation = 2, price = 700, level = 17})
   node22:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node23 = keywordHandler:addKeyword({'energy field'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn energy field for 700 gp?'})
   node23:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'energy field', vocation = 2, price = 700, level = 18})
   node23:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node24 = keywordHandler:addKeyword({'heal friend'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn heal friend for 800?'})
   node24:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'heal friend', vocation = 2, price = 800, level = 18})
   node24:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node25 = keywordHandler:addKeyword({'ultimate healing rune'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn ultimate healing rune for 1500 gp?'})
   node25:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'ultimate healing rune', vocation = 2, price = 1500, level = 24})
   node25:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node26 = keywordHandler:addKeyword({'haste'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn haste for 600 gp?'})
   node26:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'haste', vocation = 2, price = 600, level = 14})
   node26:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node27 = keywordHandler:addKeyword({'envenom'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn envenom for 1000 gp?'})
   node27:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'envenom', vocation = 2, price = 1000, level = 21})
   node27:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node28 = keywordHandler:addKeyword({'desintegrate'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn desintegrate for 900 gp?'})
   node28:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'desintegrate', vocation = 2, price = 900, level = 21})
   node28:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node29 = keywordHandler:addKeyword({'great fireball'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn great fireball for 1200?'})
   node29:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'great fireball', vocation = 2, price = 1200, level = 23})
   node29:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node30 = keywordHandler:addKeyword({'creature illusion'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn Creature illusion for 1000 gp?'})
   node30:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'creature illusion', vocation = 2, price = 1000, level = 23})
   node30:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node31 = keywordHandler:addKeyword({'ultimate healing'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn ultimate healing for 1000 gp?'})
   node31:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'ultimate healing', vocation = 2, price = 1000, level = 20})
   node31:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node32 = keywordHandler:addKeyword({'heavy magic missile'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn heavy magic missile for 1500 gp?'})
   node32:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'heavy magic missile', vocation = 2, price = 1500, level = 25})
   node32:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node33 = keywordHandler:addKeyword({'poison bomb'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn poison bomb for 1000 gp?'})
   node33:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'poison bomb', vocation = 2, price = 1000, level = 25})
   node33:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node34 = keywordHandler:addKeyword({'summon creature'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn summon creature for 2000 gp?'})
   node34:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'summon creature', vocation = 2, price = 2000, level = 25})
   node34:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node35 = keywordHandler:addKeyword({'wild growth'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn wild growth for 2000 gp?'})
   node35:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'wild growth', vocation = 2, price = 2000, level = 27})
   node35:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node36 = keywordHandler:addKeyword({'soulfire'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn soulfire for 1800 gp?'})
   node36:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'soulfire', vocation = 2, price = 1800, level = 27})
   node36:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node37 = keywordHandler:addKeyword({'animate dead'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn animate dead for 1200 gp?'})
   node37:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'animate dead', vocation = 2, price = 1200, level = 27})
   node37:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node38 = keywordHandler:addKeyword({'Chameleon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn cameleon for 1300 gp?'})
   node38:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'chameleon', vocation = 2, price = 1300, level = 27})
   node38:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node39 = keywordHandler:addKeyword({'firebomb'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn firebomb for 1500 gp?'})
   node39:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'firebomb', vocation = 2, price = 1500, level = 27})
   node39:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node40 = keywordHandler:addKeyword({'poison wall'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn poison wall for 1600 gp?'})
   node40:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'poison wall', vocation = 2, price = 1600, level = 29})
   node40:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node41 = keywordHandler:addKeyword({'undead legion'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn undead legion for 2000 gp?'})
   node41:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'undead legion', vocation = 2, price = 2000, level = 30})
   node41:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node42 = keywordHandler:addKeyword({'explosion'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn explosion for 1800 gp?'})
   node42:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'explosion', vocation = 2, price = 1800, level = 31})
   node42:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node43 = keywordHandler:addKeyword({'fire wall'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn fire wall for 2000 gp?'})
   node43:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'fire wall', vocation = 2, price = 2000, level = 33})
   node43:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node44 = keywordHandler:addKeyword({'invisibility'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn invisibility for 2000 gp?'})
   node44:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'invisibility', vocation = 2, price = 2000, level = 35})
   node44:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node45 = keywordHandler:addKeyword({'mass healing'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn mass healing for 2200 gp?'})
   node45:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'mass healing', vocation = 2, price = 2200, level = 36})
   node45:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node46 = keywordHandler:addKeyword({'energy wall'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn energy wall for 2500 gp?'})
   node46:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'energy wall', vocation = 2, price = 2500, level = 41})
   node46:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node47 = keywordHandler:addKeyword({'paralyze'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn paralyze for 1900 gp?'})
   node47:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'paralyze', vocation = 2, price = 1900, level = 54})
   node47:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node48 = keywordHandler:addKeyword({'light'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn light for 100 gp?'})
   node48:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'light', vocation = 2, price = 100, level = 8})
   node48:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node49 = keywordHandler:addKeyword({'ice strike'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn ice strike?'})
   node49:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'ice strike', vocation = 2, price = 800, level = 15})
   node49:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node50 = keywordHandler:addKeyword({'ice wave'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn ice wave?'})
   node50:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'ice wave', vocation = 2, price = 850, level = 18})
   node50:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node51 = keywordHandler:addKeyword({'terra strike'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn terra strike?'})
   node51:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'terra strike', vocation = 2, price = 800, level = 13})
   node51:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node52 = keywordHandler:addKeyword({'stone shower'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn stone shower?'})
   node52:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'stone shower', vocation = 2, price = 1100, level = 28})
   node52:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node53 = keywordHandler:addKeyword({'icicle'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn icicle?'})
   node53:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'icicle', vocation = 2, price = 1700, level = 28})
   node53:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node54 = keywordHandler:addKeyword({'avalanche'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn avalanche?'})
   node54:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'avalanche', vocation = 2, price = 1200, level = 30})
   node54:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})


local node55 = keywordHandler:addKeyword({'terra wave'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn terra wave?'})
   node55:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'terra wave', vocation = 2, price = 2500, level = 38})
   node55:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})    


local node56 = keywordHandler:addKeyword({'wrath of nature'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn wrath of nature?'})
   node56:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'wrath of nature', vocation = 2, price = 6000, level = 55})
   node56:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})    


local node57 = keywordHandler:addKeyword({'eternal winter'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn eternal winter?'})
   node57:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = true, spellName = 'eternal winter', vocation = 2, price = 8000, level = 60})
   node57:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true})   

local node58 = keywordHandler:addKeyword({'intense healing'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn intense healing for 800 gp?'})
   node58:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'intense healing', vocation = 2, price = 350, level = 11})
   node58: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())

 

e o .xml desse npc:

 

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Marvik" script="data/npc/scripts/Spells/druid_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="60;55;54;41;38;36;35;33;31;30;29;28;27;26;25;24;23;21;20;18;17;16;15;14;13;12;11;10;9;8;spells" />

<parameter key="keyword_reply1" value="I can teach you, eternal winter" />
<parameter key="keyword_reply2" value="I can teach you, wrath of nature" />
<parameter key="keyword_reply3" value="I can teach you, paralyze" />
<parameter key="keyword_reply4" value="I can teach you, energy wall" />
<parameter key="keyword_reply5" value="I can teach you, mass healing" />
<parameter key="keyword_reply6" value="I can teach you, terra wave" />
<parameter key="keyword_reply7" value="I can teach you, invisibility" />
<parameter key="keyword_reply8" value="I can teach you, Fire wall" />
<parameter key="keyword_reply9" value="I can teach you, explosion" />
<parameter key="keyword_reply10" value="I can teach you, undead legion" />
<parameter key="keyword_reply11" value="I can teach you, poison wall and avalanche" />
<parameter key="keyword_reply12" value="I can teach you, soulfire, animate dead, chameleon, firebomb and wild growth" />
<parameter key="keyword_reply13" value="I can teach you, stone shower and icicle" />
<parameter key="keyword_reply14" value="I can teach you, ultimate light" />
<parameter key="keyword_reply15" value="I can teach you, heavy magic missile, poison bomb and summon creature" />
<parameter key="keyword_reply16" value="I can teach you, Ultimate healing rune" />
<parameter key="keyword_reply17" value="I can teach you, great fireball and creature illusion" />
<parameter key="keyword_reply18" value="I can teach you, envenom and desintegrate" />
<parameter key="keyword_reply19" value="I can teach you, ultimate healing and strong haste" />
<parameter key="keyword_reply20" value="I can teach you, energy field, ice wave and heal friend" />
<parameter key="keyword_reply21" value="I can teach you, fireball and destroy field" />
<parameter key="keyword_reply22" value="I can teach you, convince creature and death strike" />
<parameter key="keyword_reply23" value="I can teach you, antidote rune, intense healing rune, fire field, ice strike and light magic missile" />
<parameter key="keyword_reply24" value="I can teach you, Haste, food, magic shield and poison field" />
<parameter key="keyword_reply25" value="I can teach you, great light" />
<parameter key="keyword_reply26" value="I can teach you, energy strike, terra strike, levitate and flame strike" />
<parameter key="keyword_reply27" value="I can teach you, intense healing" />
<parameter key="keyword_reply28" value="I can teach you, Antidote" />
<parameter key="keyword_reply29" value="I can teach you, light healing and magic rope." />
<parameter key="keyword_reply30" value="I can teach you, light and find person" />
<parameter key="keyword_reply31" value="I can teach spells for level 60, 55, 54, 41, 38, 36, 35, 33, 31, 30, 29, 28, 27, 26, 25, 24, 23, 21, 20, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9 and 8." />
   </parameters>
</npc>

 

Os keyword funcionam perfeitamente quando eu coloco no script dele "default.lua", porém quando uso o caminho do script "druid_spells.lua" ele não responde mais, apenas ignora. Acredito que seja pelo script ter sido feito em 2007~.

 

Se já houver um tópico igual a este no Xtibia, peço desculpas antecipadamente, pois procurei por cerca de duas horas, aqui, no OTFans e no OTland, mais nunca se sabe.

Link para o comentário
Compartilhar em outros sites

8 respostass a esta questão

Posts Recomendados

  • 0

troque:

 

    local node1 = keywordHandler:addKeyword({'light healing'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to learn light healing for 170 gp?'}) 
               travelNode:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, premium = false, spellName = 'light healing', vocation = 2, price = 170, level = 9}) 
               travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Cant you handle the power of the spell?', reset = true}) 

 

 

por

 

 

       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}) 

 

flw

Link para o comentário
Compartilhar em outros sites

  • 0

Cara você reviveu um tópico de quase um ano atrás! Mas respondendo a dúvida, é só no arquivo spells.xml ir até sua magia e editar onde tem: needlearn="0"

Se você quiser que o player precise aprender a magia coloque 1.

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...