Postado Setembro 16, 2014 10 anos com o o titulo ja diz queria um npc que venda vários items para quem tiver completado a quest. Djins do global pra tfs 0.4/0.3 Editado Setembro 18, 2014 10 anos por AnaPaula (veja o histórico de edições)
Postado Setembro 16, 2014 10 anos Vamos lá :3 1- Vá em Data/Npc.. Crie um arquivo.xml e Nomeio de brutal.xml, Abra-o e coloque isso.. \/ <npc name="{Quest} Seller" script="data/npc/scripts/brutalitens.lua" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="302" head="114" body="12" legs="90" feet="115" addons="1" corpse="2212"/> </npc> Em vermelho o nome do npc que você quer... Em azul a aparência dele... 2- Vá em Data/Npc/Scripts.. E crie um arquivo lua com o nome de brutalitens.lua, Abra-o e adicione 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 SellItem(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end if doPlayerRemoveItem(cid,6527,parameters.price) == TRUE then doPlayerAddItem(cid,parameters.item,parameters.count) else npcHandler:say('Desculpe, Você não tem ' .. parameters.price .. ' vip coins!', cid) end npcHandler:resetNpc() return true end keywordHandler:addKeyword({'trade'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Item ViP a venda : {nimby boots} , {nimby shield} , {nimby helmet} , {nimby cape} , {nimby spellbook} , {nimby shorts} , {nimby armor} , {nimby hat} , {nimby legs} ,.'}) local node1 = keywordHandler:addKeyword({'nimby boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja comprar uma nimby boots por 1000 vip coins? '}) node1:addChildKeyword({'yes'}, SellItem, {price = 1000,item = 2644,count = 1000}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node2 = keywordHandler:addKeyword({'nimby shield'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja comprar um nimby shield por 1000 vip Coin? '}) node2:addChildKeyword({'yes'}, SellItem, {price = 1000,item = 2537,count = 1}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node3 = keywordHandler:addKeyword({'nimby helmet'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja comprar um nimby helmet por 1000 vip Coin? '}) node3:addChildKeyword({'yes'}, SellItem, {price = 1000,item = 12617,count = 1}) node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node4 = keywordHandler:addKeyword({'nimby cape'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja comprar uma nimby cape por 1000 vip Coin? '}) node4:addChildKeyword({'yes'}, SellItem, {price = 1000,item = 12392,count = 1}) node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node4 = keywordHandler:addKeyword({'nimby spellbook'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja comprar um nimby spellbook por 1000 vip Coin? '}) node4:addChildKeyword({'yes'}, SellItem, {price = 1000,item = 8983,count = 1}) node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node4 = keywordHandler:addKeyword({'nimby shorts'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja comprar um nimby shorts por 1000 vip Coin? '}) node4:addChildKeyword({'yes'}, SellItem, {price = 1000,item = 11349,count = 1}) node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node4 = keywordHandler:addKeyword({'nimby armor'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja comprar uma nimby armor por 1000 vip Coin? '}) node4:addChildKeyword({'yes'}, SellItem, {price = 1000,item = 11350,count = 1}) node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node4 = keywordHandler:addKeyword({'nimby hat'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja comprar um nimby hat por 1000 vip Coin? '}) node4:addChildKeyword({'yes'}, SellItem, {price = 1000,item = 10569,count = 1}) node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node4 = keywordHandler:addKeyword({'nimby legs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja comprar uma nimby legs por 1000 vip Coin? '}) node4:addChildKeyword({'yes'}, SellItem, {price = 1000,item = 11298,count = 1}) node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) npcHandler:addModule(FocusModule:new()) Em Verde o nome do item que ele irá pegar de você Em Azul o id do item que o npc irá pegar = como é em quest recomendo você botar gold coins mesmo ai você bota esse npc no final da quest !! Em Vermelho o nome do item que ele irá vender Em Marrom a quantidade do item que ele irá pegar Em Roxo o id do item que ele irá vender para você Em verde escuro a quantidade do item que ele irá vender para você Se ajudei +REP Conseguiu ? ;-;
Postado Setembro 17, 2014 10 anos Autor vou testar mais esta bem confuso se aparecer um mais organizado agradeço e de fácil configuração; alguma outra opção de script? gente mais ninguém? ajudo todo mundo quando eu preciso ninguém aparece?
Postado Setembro 17, 2014 10 anos Autor ainda não to desde ontem tentando fazer um mais não ta dando certo você fala ele vende o item 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 function creatureSayCallback(cid, type, msg) if getPlayerStorageValue(cid, 1038) == 1 then local shopModule = ShopModule:new() npcHandler:addModule(shopModule) shopModule:addSellableItem({'might ring'}, 2164, 250, 'might ring') shopModule:addSellableItem({'energy ring'}, 2167, 100, 'energy ring') shopModule:addSellableItem({'life ring'}, 2168, 50, 'life ring') shopModule:addSellableItem({'time ring'}, 2169, 100, 'time ring') shopModule:addSellableItem({'dwarven ring'}, 2213, 100, 'dwarven ring') shopModule:addSellableItem({'ring of healing'}, 2214, 100, 'ring of healing') shopModule:addSellableItem({'strange talisman'}, 2161, 30, 'strange talisman') shopModule:addSellableItem({'silver amulet'}, 2170, 50, 'silver amulet') shopModule:addSellableItem({'protection amulet'}, 2200, 100, 'protection amulet') shopModule:addSellableItem({'dragon necklace'}, 2201, 100, 'dragon necklace') shopModule:addSellableItem({'snakebite rod'}, 2182, 100, 'snakebite rod') shopModule:addSellableItem({'moonlight rod'}, 2186, 200, 'moonlight rod') shopModule:addSellableItem({'volcanic rod'}, 2185, 1000, 'volcanic rod') shopModule:addSellableItem({'quagmire rod'}, 2181, 2000, 'quagmire rod') shopModule:addSellableItem({'tempest rod'}, 2183, 3000, 'tempest rod') shopModule:addSellableItem({'ankh'}, 2193, 100, 'ankh') shopModule:addSellableItem({'mysterious fetish'}, 2194, 50, 'mysterious fetish') shopModule:addBuyableItem({'might ring'}, 2164, 5000, 'might ring') shopModule:addBuyableItem({'energy ring'}, 2167, 2000, 'energy ring') shopModule:addBuyableItem({'life ring'}, 2168, 900, 'life ring') shopModule:addBuyableItem({'time ring'}, 2169, 2000, 'time ring') shopModule:addBuyableItem({'dwarven ring'}, 2213, 2000, 'dwarven ring') shopModule:addBuyableItem({'ring of healing'}, 2214, 2000, 'ring of healing') shopModule:addBuyableItem({'strange talisman'}, 2161, 100, 'strange talisman') shopModule:addBuyableItem({'silver amulet'}, 2170, 100, 'silver amulet') shopModule:addBuyableItem({'protection amulet'}, 2200, 700, 'protection amulet') shopModule:addBuyableItem({'dragon necklace'}, 2201, 1000, 'dragon necklace') else npcHandler:say("Voce nao tem permissao.") return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) assim nao funciona nen a pal
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.