Jorsad 0 Postado Maio 19, 2011 Share Postado Maio 19, 2011 Bom vamos la etaum criar um npc que vende montaria para seu server!!! Primeiro va até a pasta data/npc e crie arquivo Helmount.xml apague o que tem dentro e coloque isso: <?xml version="1.0"?> <npc name="Helmount" script="data/npc/scripts/mount.lua" walkinterval="50000" floorchange="0"> <health now="100" max="100"/> <look type="129" head="95" body="116" legs="121" feet="115" addons="3"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|.I have many {mounts} to sell for you!" /> </parameters> </npc> Vermelho : nome do npc caso vc queira mudar. Renomei o arquivo xml tbm. Agora va até a pasta data/npc/scripts crie o seguinte arquivo mount.lua apague o que tem dentro e coloque isso: 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 function AddMount(cid, message, keywords, parameters, node) --by vodka if(not npcHandler:isFocused(cid)) then return false end if parameters.premium == true and not isPremium(cid) then return true,npcHandler:say('Sorry,Only premium members buy this mount!', cid) elseif not doPlayerRemoveMoney(cid, parameters.price) then return true,npcHandler:say('Sorry You need '..parameters.price..' gps to buy this mount!', cid) end doPlayerAddMount(cid, parameters.mount) npcHandler:say('Here is your mount!', cid) npcHandler:resetNpc() return true end keywordHandler:addKeyword({'mounts'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell these mounts: {widow queen},{racing bird},{war Bear},{black sheep},{midnight panther},{draptor},{titanica},{tin lizzard}.{blazebringer},{rapid boar},{stampor} or {undead cavebear}!'}) local node1 = keywordHandler:addKeyword({'widow queen'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount widow queen?'}) node1:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 1,premium = false}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node2 = keywordHandler:addKeyword({'racing bird'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount racing bird'}) node2:addChildKeyword({'yes'}, AddMount, {price = 20000,mount = 2,premium = true}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node3 = keywordHandler:addKeyword({'war bear'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount war Bear'}) node3:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 3,premium = false}) node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node4 = keywordHandler:addKeyword({'black sheep'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount black sheep?'}) node4:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 4,premium = false}) node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node5 = keywordHandler:addKeyword({'midnight panther'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount midnight panther?'}) node5:addChildKeyword({'yes'}, AddMount, {price = 20000,mount = 5,premium = true}) node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node6 = keywordHandler:addKeyword({'draptor'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount draptor?'}) node6:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 6,premium = true}) node6:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node7 = keywordHandler:addKeyword({'titanica'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount titanica?'}) node7:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 7,premium = true}) node7:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node8 = keywordHandler:addKeyword({'tin lizzard'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount tin lizzard?'}) node8:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 8,premium = true}) node8:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node9 = keywordHandler:addKeyword({'blazebringer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount blazebringer?'}) node9:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 9,premium = true}) node9:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node10 = keywordHandler:addKeyword({'rapid boar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount rapid boar?'}) node10:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 10,premium = false}) node10:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node11 = keywordHandler:addKeyword({'stampor'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount stampor?'}) node11:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 11,premium = true}) node11:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node12 = keywordHandler:addKeyword({'undead cavebear'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount undead cavebear?'}) node12:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 12,premium = true}) node12:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) npcHandler:addModule(FocusModule:new()) A onde esta de vemelho escrti price= 10000 é o preço da mount vc pode modificar se vc quizer É isso pessoal espero ter ajudado abraços. By> JDTutor Link para o comentário https://xtibia.com/forum/topic/156916-npc-que-vende-montaria/ Compartilhar em outros sites More sharing options...
guixap 60 Postado Junho 4, 2011 Share Postado Junho 4, 2011 (editado) dá pra por pra comprar por item ? E esse NPC não foi você quem fez, o Vodkart postou em uma área de dúvidas si não me engano Editado Junho 4, 2011 por XaPiNhAl Link para o comentário https://xtibia.com/forum/topic/156916-npc-que-vende-montaria/#findComment-1040994 Compartilhar em outros sites More sharing options...
cyriloo 2 Postado Julho 4, 2011 Share Postado Julho 4, 2011 Funfa , no 8.50 , ou 8.60? :button_cancel: Link para o comentário https://xtibia.com/forum/topic/156916-npc-que-vende-montaria/#findComment-1057367 Compartilhar em outros sites More sharing options...
inox98 3 Postado Julho 28, 2011 Share Postado Julho 28, 2011 Funfa 8.60 ? Link para o comentário https://xtibia.com/forum/topic/156916-npc-que-vende-montaria/#findComment-1075570 Compartilhar em outros sites More sharing options...
ADMJuan 7 Postado Outubro 12, 2011 Share Postado Outubro 12, 2011 no Link para o comentário https://xtibia.com/forum/topic/156916-npc-que-vende-montaria/#findComment-1115105 Compartilhar em outros sites More sharing options...
williancold 0 Postado Fevereiro 25, 2012 Share Postado Fevereiro 25, 2012 claro q não as montarias só foram adicionadas no tibia 9.0 Link para o comentário https://xtibia.com/forum/topic/156916-npc-que-vende-montaria/#findComment-1206132 Compartilhar em outros sites More sharing options...
Posts Recomendados