aew galera eu queria um npc q tenha todos os itens para vender e comprar tipo mpa,fire sword,rh itens q n tem no global !!
muito obrigado !
aew galera eu queria um npc q tenha todos os itens para vender e comprar tipo mpa,fire sword,rh itens q n tem no global !!
muito obrigado !
MINHAS METAS: <img src="http://img136.imageshack.us/img136/7648/contagemyh7.gif" border="0" class="linked-sig-image" />
[X]1.....Post.... SERVO
[X]10...Posts...CAMPONÊS
[X]25...Posts...CAÇADOR
[X]50...Posts...CAVALEIRO
[x]100..Posts...BARONETE
[_]200..Posts...BARÃO <----- metaaaaa!!!!!
[_]300..Posts...VISCONDE
[_]400..Posts...DUQUE
[_]600..Posts...ARQUEDUQUE
[_]800..Posts...ARISTOCRATA
[_]1000.Posts...REGENTE
[_]1400.Posts...SÁBIO
[_]1800.Posts...SACERDOTE
[_]2500.Posts...PRÍNCIPE
Bom, Como ninguem te ajudou.. Vou tentar te ajudar, seu tópico ta muito mal formulado :excl:
Bom, vou te mostrar um NPC que vende vários items depois explico, ( esse NPC eu inclui alguns itens 8.54 ).
Primeiramente va em data/npc e crie um arquivo chamado Vendedor.xml e adicione esse código:
<?version="1.0" encoding="UTF-8"?> <npc name="Vendedor" script="data/npc/script/vendedornpc.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="71" head="113" body="113" legs="113" feet="115" addons="0"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|. What is your need?"/> <parameter key="message_farewell" value="Bye."/> <parameter key="module_keywords" value="1" /> <parameter key="keywords" value="job;" /> <parameter key="keyword_reply1" value="I buy all itens." /> </parameters> </npc>
Depois va em data/npc/script e crie um arquivo chamado vendedornpc.lua depois adicione esse código:
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:addSellableItem({'Zaoan Helmet'}, 11296, 45000, 'Zaoan Helmet') shopModule:addSellableItem({'Drakinata'}, 11299, 10000, 'Drakinata') shopModule:addSellableItem({'Twin Hooks'}, 11303, 2, 'Twin Hooks') shopModule:addSellableItem({'Zaoan Halberd'}, 11317, 500, 'Zaoan Halberd') shopModule:addSellableItem({'Zaoan Sword'}, 11301, 30000, 'Zaoan Sword') shopModule:addSellableItem({'Zaoan Armor'}, 11295, 14000, 'Zaoan Armor') shopModule:addSellableItem({'Zaoan Legs'}, 11298, 14000, 'Zaoan Legs') shopModule:addSellableItem({'Dragon Scale Boots'}, 11114, 40000, 'Dragon Scale Boots') shopModule:addSellableItem({'Guardian Boots'}, 11234, 35000, 'Guardian Boots') shopModule:addSellableItem({'Zaoan Shoes'}, 11297, 5000, 'Zaoan Shoes') shopModule:addSellableItem({'Drachaku'}, 11302, 10000, 'Drachaku') shopModule:addSellableItem({'Broken Halberd'}, 11329, 100, 'Broken Halberd') shopModule:addSellableItem({'Cursed Shoulder Spikes'}, 11321, 320, 'Cursed Shoulder Spikes') shopModule:addSellableItem({'Legionnaire Flags'}, 11328, 500, 'Legionnaire Flags') shopModule:addSellableItem({'Sais'}, 11300, 16500, 'Sais') shopModule:addSellableItem({'Spiked Iron Ball'}, 11319, 100, 'Spiked Iron Ball') shopModule:addBuyableItem({'two handed sword'}, 2377, 950, 'two handed sword') shopModule:addBuyableItem({'broad sword'}, 2413, 950, 'broad sword') shopModule:addBuyableItem({'sword'}, 2376, 85, 'sword') shopModule:addBuyableItem({'crimson sword'}, 7385, 610, 'crimson sword') shopModule:addBuyableItem({'dagger'}, 2379, 5, 'dagger') shopModule:addBuyableItem({'rapier'}, 2384, 15, 'rapier') shopModule:addBuyableItem({'sabre'}, 2385, 35, 'sabre') shopModule:addBuyableItem({'battle hammer'}, 2417, 350, 'battle hammer') shopModule:addBuyableItem({'clerical mace'}, 2423, 540, 'clerical mace') shopModule:addBuyableItem({'mace'}, 2398, 90, 'mace') shopModule:addBuyableItem({'morning star'}, 2394, 430, 'morning star') shopModule:addBuyableItem({'hand axe'}, 2380, 8, 'hand axe') shopModule:addBuyableItem({'axe'}, 2386, 20, 'hand axe') shopModule:addBuyableItem({'barbarian axe'}, 2429, 590, 'barbarian axe') shopModule:addBuyableItem({'battle axe'}, 2378, 235, 'battle axe') shopModule:addBuyableItem({'leather helmet'}, 2461, 12, 'leather helmet') shopModule:addBuyableItem({'chain helmet'}, 2458, 52, 'chain helmet') shopModule:addBuyableItem({'chain legs'},2648, 80, 'chain legs') shopModule:addBuyableItem({'wooden shield'}, 2512, 15, 'wooden shield') shopModule:addBuyableItem({'steel shield'}, 2509, 240, 'steel shield') shopModule:addBuyableItem({'viking shield'}, 2531, 260, 'viking shield') shopModule:addBuyableItem({'chain legs'},2648, 80, 'chain legs') shopModule:addBuyableItem({'brass armor'}, 2465, 450, 'brass armor') shopModule:addBuyableItem({'chain armor'}, 2464, 200, 'chain armor') shopModule:addBuyableItem({'leather armor'}, 2467, 35, 'leather armor') shopModule:addBuyableItem({'scale armor'}, 2483, 260, 'scale armor') npcHandler:addModule(FocusModule:new())
Agora vou explicar, cada linha que comeÇa com "shopModule:addBuyableItem({" é um item que pode ser vendido, da pra você acrescentar quantos itens quiser apenas fazendo o que esta abaixo.
Aonde tem mais ou menos isso:
shopModule:addSellableItem({'Zaoan Helmet'}, 11296, 45000, 'Zaoan Helmet')
Legenda:
Vermelho: Significa o nome do item.
Verde: ID do item.
Em azul: Preço do item.
Espero ter te ajudado, se quiser saber mais sobre NPC'S pesquise no fórum. :happy: