Na sua pasta de npcs copie qualquer aqruivo e renomei para Steve e cole isso dentro.
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Steve" script="data/npc/scripts/Steve.lua" floorchange="0" access="5" level="1" maglevel="1"><health now="150" max="150"/><look type="128" head="79" body="118" legs="115" feet="114" corpse="2212"/><parameters><parameter key="module_shop" value="3" /><parameter key="shop_sellable" value="crossbow,2455,150;bow,2456,130" /><parameter key="shop_buyable" value="crossbow,2455,360;bow,2456,200;spear,2389,20;power bolt,2547,200;burst arrow,2546,56;poison arrow,2545,18;bolt,2543,3;arrow,2544,2;Assassin Star,7368,100" /></parameters></npc>
Em scripts a mesma coisa copie e renomeie para Steve e cole isso dentro.
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endfunction thinkCallback(cid)local rand = math.random(1,300)if rand == 1 thenselfSay('Vendo munição e utilitários para paladinos em um ótimo preço, aproveite que está em promoção.')endreturn trueendfunction greetCallback(cid)return trueendfunction playerBuyAddonNPC(cid, message, keywords, parameters, node)if(not npcHandler:isFocused(cid)) thenreturn falseendif (parameters.confirm ~= true) and (parameters.decline ~= true) thenif(getPlayerPremiumDays(cid) == 1) and (parameters.premium == true) thennpcHandler:say('Sorry, but this addon is only for vip players!', cid)npcHandler:resetNpc()return trueendif (getPlayerStorageValue(cid, parameters.storageID) ~= -1) thennpcHandler:say('You already have this addon!', cid)npcHandler:resetNpc()return trueendlocal itemsTable = parameters.itemslocal items_list = ''if table.maxn(itemsTable) > 0 thenfor i = 1, table.maxn(itemsTable) dolocal item = itemsTableitems_list = items_list .. item[2] .. ' ' .. getItemNameById(item[1])if i ~= table.maxn(itemsTable) thenitems_list = items_list .. ', 'endendendlocal text = ''if (parameters.cost > 0) and table.maxn(parameters.items) thentext = items_list .. ' and ' .. parameters.cost .. ' gp'elseif (parameters.cost > 0) thentext = parameters.cost .. ' gp'elseif table.maxn(parameters.items) thentext = items_listendnpcHandler:say('Did you bring me ' .. text .. ' for ' .. keywords[1] .. '?', cid)return trueelseif (parameters.confirm == true) thenlocal addonNode = node:getParent()local addoninfo = addonNode:getParameters()local items_number = 0if table.maxn(addoninfo.items) > 0 thenfor i = 1, table.maxn(addoninfo.items) dolocal item = addoninfo.itemsif (getPlayerItemCount(cid,item[1]) >= item[2]) thenitems_number = items_number + 1endendendif(getPlayerMoney(cid) >= addoninfo.cost) and (items_number == table.maxn(addoninfo.items)) thendoPlayerRemoveMoney(cid, addoninfo.cost)if table.maxn(addoninfo.items) > 0 thenfor i = 1, table.maxn(addoninfo.items) dolocal item = addoninfo.itemsdoPlayerRemoveItem(cid,item[1],item[2])endenddoPlayerAddOutfit(cid, addoninfo.outfit_male, addoninfo.addon)doPlayerAddOutfit(cid, addoninfo.outfit_female, addoninfo.addon)setPlayerStorageValue(cid,addoninfo.storageID,1)npcHandler:say('Here you are.', cid)elsenpcHandler:say('You do not have needed items or cash!', cid)endnpcHandler:resetNpc()return trueelseif (parameters.decline == true) thennpcHandler:say('Not interested? Maybe other addon?', cid)npcHandler:resetNpc()return trueendreturn falseendlocal noNode = KeywordNode:new({'no'}, playerBuyAddonNPC, {decline = true})local yesNode = KeywordNode:new({'yes'}, playerBuyAddonNPC, {confirm = true})local outfit_node = keywordHandler:addKeyword({'first'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5880,100}, {5892,1}}, outfit_female = 137, outfit_male = 129, addon = 1, storageID = 10011})outfit_node:addChildKeywordNode(yesNode)outfit_node:addChildKeywordNode(noNode)local outfit_node = keywordHandler:addKeyword({'second'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5893,100}}, outfit_female = 137, outfit_male = 129, addon = 2, storageID = 10012})outfit_node:addChildKeywordNode(yesNode)outfit_node:addChildKeywordNode(noNode)keywordHandler:addKeyword({'addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can give you {first} and {second} Hunter addon.'})npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback)npcHandler:setCallback(CALLBACK_GREET, greetCallback)npcHandler:addModule(FocusModule:new())
Ajudei REP+





info
Grupo: Campones
Registrado: 06/08/13
Posts: 60
Reputação: +14
Char no Tibia: ADMIN
preciso de um npc que venda muniçao para paladin