Heeyisis 14 Postado Agosto 8, 2013 Share Postado Agosto 8, 2013 preciso de um npc que venda muniçao para paladin Link para o comentário Compartilhar em outros sites More sharing options...
0 dyego2008 149 Postado Agosto 8, 2013 Share Postado Agosto 8, 2013 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) 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 thinkCallback(cid) local rand = math.random(1,300) if rand == 1 then selfSay('Vendo munição e utilitários para paladinos em um ótimo preço, aproveite que está em promoção.') end return true end function greetCallback(cid) return true end function playerBuyAddonNPC(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end if (parameters.confirm ~= true) and (parameters.decline ~= true) then if(getPlayerPremiumDays(cid) == 1) and (parameters.premium == true) then npcHandler:say('Sorry, but this addon is only for vip players!', cid) npcHandler:resetNpc() return true end if (getPlayerStorageValue(cid, parameters.storageID) ~= -1) then npcHandler:say('You already have this addon!', cid) npcHandler:resetNpc() return true end local itemsTable = parameters.items local items_list = '' if table.maxn(itemsTable) > 0 then for i = 1, table.maxn(itemsTable) do local item = itemsTable items_list = items_list .. item[2] .. ' ' .. getItemNameById(item[1]) if i ~= table.maxn(itemsTable) then items_list = items_list .. ', ' end end end local text = '' if (parameters.cost > 0) and table.maxn(parameters.items) then text = items_list .. ' and ' .. parameters.cost .. ' gp' elseif (parameters.cost > 0) then text = parameters.cost .. ' gp' elseif table.maxn(parameters.items) then text = items_list end npcHandler:say('Did you bring me ' .. text .. ' for ' .. keywords[1] .. '?', cid) return true elseif (parameters.confirm == true) then local addonNode = node:getParent() local addoninfo = addonNode:getParameters() local items_number = 0 if table.maxn(addoninfo.items) > 0 then for i = 1, table.maxn(addoninfo.items) do local item = addoninfo.items if (getPlayerItemCount(cid,item[1]) >= item[2]) then items_number = items_number + 1 end end end if(getPlayerMoney(cid) >= addoninfo.cost) and (items_number == table.maxn(addoninfo.items)) then doPlayerRemoveMoney(cid, addoninfo.cost) if table.maxn(addoninfo.items) > 0 then for i = 1, table.maxn(addoninfo.items) do local item = addoninfo.items doPlayerRemoveItem(cid,item[1],item[2]) end end doPlayerAddOutfit(cid, addoninfo.outfit_male, addoninfo.addon) doPlayerAddOutfit(cid, addoninfo.outfit_female, addoninfo.addon) setPlayerStorageValue(cid,addoninfo.storageID,1) npcHandler:say('Here you are.', cid) else npcHandler:say('You do not have needed items or cash!', cid) end npcHandler:resetNpc() return true elseif (parameters.decline == true) then npcHandler:say('Not interested? Maybe other addon?', cid) npcHandler:resetNpc() return true end return false end local 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+ Link para o comentário Compartilhar em outros sites More sharing options...
0 Heeyisis 14 Postado Agosto 11, 2013 Autor Share Postado Agosto 11, 2013 (editado) vlw ajudou bastante Editado Agosto 11, 2013 por blokeper Link para o comentário Compartilhar em outros sites More sharing options...
0 dyego2008 149 Postado Agosto 11, 2013 Share Postado Agosto 11, 2013 Dúvidas Sanadas/ Link para o comentário Compartilhar em outros sites More sharing options...
0 Gabrieltxu 737 Postado Agosto 11, 2013 Share Postado Agosto 11, 2013 Duvida senada, Movido Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
Heeyisis 14
preciso de um npc que venda muniçao para paladin
Link para o comentário
Compartilhar em outros sites
4 respostass a esta questão
Posts Recomendados