Ve se esse daqui vai funcionar certinho:
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 buyAddons(cid, message, keywords, parameters, node)
--TODO: buyAddons function in modules.lua
if(not npcHandler:isFocused(cid)) then
return false
end
local addon = parameters.addon
local cost = parameters.cost
local premium = (parameters.premium ~= nil and parameters.premium)
if isPlayerPremiumCallback == nil or (isPlayerPremiumCallback(cid) and premium) then
if doPlayerRemoveMoney(cid, cost) then
doPlayerAddAddons(cid, addon)
npcHandler:say('There, you are now able to use all addons!', cid)
else
npcHandler:say('Sorry, you do not have enough money.', cid)
end
else
npcHandler:say('I only serve customers with premium accounts.', cid)
end
keywordHandler:moveUp(1)
return true
end
local node1 = keywordHandler:addKeyword({'first addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the first addons set for 1000000 gold coins?'})
node1:addChildKeyword({'yes'}, buyAddons, {addon = 1, cost = 1000000, premium = true})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Too expensive, eh?'})
local node2 = keywordHandler:addKeyword({'second addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to buy the second addons set for 200000 gold coins?'})
node2:addChildKeyword({'yes'}, buyAddons, {addon = 2, cost = 2000000, premium = true})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Too expensive, eh?'})
keywordHandler:addKeyword({'addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell the first addons set for 100000 gold coins and the second addons set for 200000 gold coins.'})
npcHandler:addModule(FocusModule:new())
Valores a serem pago pelo first addon.
Valores a serem pago pelo second addon.
Até!


info
Grupo: Campones
Registrado: 18/02/10
Posts: 2
Reputação: 0
Galera estou fazendo um servidor mas preciso de um NPC de addon, o problema é que ele troca um Iten X,Y e Z pelo Addons X. Eu gostaria se possivel um NPC de Addon que trocasse 1KK pelo addons 1 e 2kk pelo addon 2 independete da outfit ou seja:
Player:
First druid addon
NPC:
Você precisará de 1000000 gold para fazer first druid addon. Tem certeza que deseja troca-lo?
Player:
Yes
Bom vou postar aqui o meu NPC atual que troca ADDON por Item e gostaria que voces transformassem ele em ADDON por GOLD. A versão do meu OT é 8.54 e tem aquela nova outfit. Aqui vai:
NPC
SCRIPT
Agredeço muito por quem puder me ajudar. Valeu !