Ir para conteúdo
  • Cadastre-se

[Pedido] NPC Que Vende Item com Moeda Diferente!


Posts Recomendados

Opa galera blz? , Estava, preucurano muito no forum, um npc que aceita outra moeda, mais nenhum funcinou, então resolvi criar esse topico, então vamo la, Funciona Assim, o npc vai aceitar Moeda VIP, envez de goold é talz. alguem tem uma para me disponiblizar? :/


@UP

                                                        

Link para o post
Compartilhar em outros sites
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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 creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local MoedaVip = 2160 -- Id da MoedaVip
local shopWindow = {}
local t = {
		  [2457] = {price = 200}, -- [id do item] e em price qnto honor points vai custar
		  [2458] = {price = 200},
		  [2459] = {price = 200},
		  [8931] = {price = 200},
		  [2422] = {price = 200}
		  }
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
		if  t[item] and doPlayerRemoveItem(cid, MoedaVip, t[item].price) then
				doPlayerAddItem(cid, item, 1, false)            
				selfSay("Aqui esta o Item", cid)			 
				 else
			selfSay("Voce nao tem "..t[item].price.." gold vip suficiente", cid)
		   end
		return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
						for var, ret in pairs(t) do
										table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
								end
						openShopWindow(cid, shopWindow, onBuy, onSell)
				end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Editado por Emersonssss (veja o histórico de edições)

Skype : emersonaaron Se Te ajudei não me REP+ isso não muda nada! kkkkkkkkkkkk

Link para o post
Compartilhar em outros sites

Cara não funcionou o npc , ta aceitano Gold é não a moeda viP, ja configurei, tirei 0 2160, é botei 9971 mais mesmo assim não foi


@UP


@UP


@UP


@UP


@up


@UP

                                                        

Link para o post
Compartilhar em outros sites
  • 1 year later...

tenho esse aque no meu server brother. e funfa !

 

 

 

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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 creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local itemid = 2157 -- Novos points ( default é scarab coin )
local shopWindow = {}
local t = {
 [8850] = {price = 400}, -- [ID do item] e o preço que ele irá custar em points.
 [8929] = {price = 400},
 [8932] = {price = 400},
 [8926] = {price = 400},
 [2424] = {price = 400},
 [11296] = {price = 200},
 [11295] = {price = 200},
 [11298] = {price = 200},
 [11297] = {price = 200},
 [2527] = {price = 200},
 [2108] = {price = 900},
 [9019] = {price = 900},
 [3955] = {price = 900}
 }
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
if  t[item] and getPlayerItemCount(cid, itemid) < t[item].price then
selfSay("you do not have "..t[item].price.." Nugget Coins.", cid)
else
doPlayerAddItem(cid, item)
doPlayerRemoveItem(cid, itemid, (t[item].price))
selfSay("Here you item", cid)
  end
return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
for var, ret in pairs(t) do
table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
end
openShopWindow(cid, shopWindow, onBuy, onSell)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())





Npc:

<?xml version="1.0"?>
<npc name="# Seller Super Rox @" script="data/npc/scripts/newcoin.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="53" head="87" body="0" legs="87" feet="0" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I {trade} items for Nugget Coins!"/>
</parameters>
</npc>

Link para o post
Compartilhar em outros sites
  • 2 weeks later...
Em 11/02/2016 18:34:44, mkmmkm disse:

tenho esse aque no meu server brother. e funfa !

 

 

 

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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 creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local itemid = 2157 -- Novos points ( default é scarab coin )
local shopWindow = {}
local t = {
 [8850] = {price = 400}, -- [ID do item] e o preço que ele irá custar em points.
 [8929] = {price = 400},
 [8932] = {price = 400},
 [8926] = {price = 400},
 [2424] = {price = 400},
 [11296] = {price = 200},
 [11295] = {price = 200},
 [11298] = {price = 200},
 [11297] = {price = 200},
 [2527] = {price = 200},
 [2108] = {price = 900},
 [9019] = {price = 900},
 [3955] = {price = 900}
 }
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
if  t[item] and getPlayerItemCount(cid, itemid) < t[item].price then
selfSay("you do not have "..t[item].price.." Nugget Coins.", cid)
else
doPlayerAddItem(cid, item)
doPlayerRemoveItem(cid, itemid, (t[item].price))
selfSay("Here you item", cid)
  end
return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
for var, ret in pairs(t) do
table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
end
openShopWindow(cid, shopWindow, onBuy, onSell)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())





Npc:

<?xml version="1.0"?>
<npc name="# Seller Super Rox @" script="data/npc/scripts/newcoin.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="53" head="87" body="0" legs="87" feet="0" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I {trade} items for Nugget Coins!"/>
</parameters>
</npc>

Manow... será que esse ai pega no

poketibia

basecyan 8.54??

Link para o post
Compartilhar em outros sites
  • 1 year later...
Em 11/02/2016 em 18:34, Jinx disse:

tenho esse aque no meu server brother. e funfa !

 

 

 

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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 creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local itemid = 2157 -- Novos points ( default é scarab coin )
local shopWindow = {}
local t = {
 [8850] = {price = 400}, -- [ID do item] e o preço que ele irá custar em points.
 [8929] = {price = 400},
 [8932] = {price = 400},
 [8926] = {price = 400},
 [2424] = {price = 400},
 [11296] = {price = 200},
 [11295] = {price = 200},
 [11298] = {price = 200},
 [11297] = {price = 200},
 [2527] = {price = 200},
 [2108] = {price = 900},
 [9019] = {price = 900},
 [3955] = {price = 900}
 }
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
if  t[item] and getPlayerItemCount(cid, itemid) < t[item].price then
selfSay("you do not have "..t[item].price.." Nugget Coins.", cid)
else
doPlayerAddItem(cid, item)
doPlayerRemoveItem(cid, itemid, (t[item].price))
selfSay("Here you item", cid)
  end
return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
for var, ret in pairs(t) do
table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
end
openShopWindow(cid, shopWindow, onBuy, onSell)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())





Npc:

<?xml version="1.0"?>
<npc name="# Seller Super Rox @" script="data/npc/scripts/newcoin.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="53" head="87" body="0" legs="87" feet="0" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I {trade} items for Nugget Coins!"/>
</parameters>
</npc>

Muito Bom O Npc ,Funcionando Perfeitamente :)

Agora, Hokograma disse:

Muito Bom O Npc ,Funcionando Perfeitamente :)

 

 

                     Projeto    Nto Myth

 

" Eu to disposto a lutar e que se foda todo mundo que duvida que eu vou tocar o terror na porra toda! "

 

 

                                                                                                    bang.gif.bfc77cb73cf3065add6e416ceba6dc90.gif

 

 

Link para o post
Compartilhar em outros sites
  • 1 year later...

ok

Em 11/02/2016 em 17:34, Jinx disse:

tenho esse aque no meu server brother. e funfa !

 

 

 

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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 creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local itemid = 2157 -- Novos points ( default é scarab coin )
local shopWindow = {}
local t = {
 [8850] = {price = 400}, -- [ID do item] e o preço que ele irá custar em points.
 [8929] = {price = 400},
 [8932] = {price = 400},
 [8926] = {price = 400},
 [2424] = {price = 400},
 [11296] = {price = 200},
 [11295] = {price = 200},
 [11298] = {price = 200},
 [11297] = {price = 200},
 [2527] = {price = 200},
 [2108] = {price = 900},
 [9019] = {price = 900},
 [3955] = {price = 900}
 }
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
if  t[item] and getPlayerItemCount(cid, itemid) < t[item].price then
selfSay("you do not have "..t[item].price.." Nugget Coins.", cid)
else
doPlayerAddItem(cid, item)
doPlayerRemoveItem(cid, itemid, (t[item].price))
selfSay("Here you item", cid)
  end
return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
for var, ret in pairs(t) do
table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
end
openShopWindow(cid, shopWindow, onBuy, onSell)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())





Npc:

<?xml version="1.0"?>
<npc name="# Seller Super Rox @" script="data/npc/scripts/newcoin.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="53" head="87" body="0" legs="87" feet="0" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I {trade} items for Nugget Coins!"/>
</parameters>
</npc>

 

 

Em 11/02/2016 em 17:34, Jinx disse:

tenho esse aque no meu server brother. e funfa !

 

 

 

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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 creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local itemid = 2157 -- Novos points ( default é scarab coin )
local shopWindow = {}
local t = {
 [8850] = {price = 400}, -- [ID do item] e o preço que ele irá custar em points.
 [8929] = {price = 400},
 [8932] = {price = 400},
 [8926] = {price = 400},
 [2424] = {price = 400},
 [11296] = {price = 200},
 [11295] = {price = 200},
 [11298] = {price = 200},
 [11297] = {price = 200},
 [2527] = {price = 200},
 [2108] = {price = 900},
 [9019] = {price = 900},
 [3955] = {price = 900}
 }
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
if  t[item] and getPlayerItemCount(cid, itemid) < t[item].price then
selfSay("you do not have "..t[item].price.." Nugget Coins.", cid)
else
doPlayerAddItem(cid, item)
doPlayerRemoveItem(cid, itemid, (t[item].price))
selfSay("Here you item", cid)
  end
return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
for var, ret in pairs(t) do
table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
end
openShopWindow(cid, shopWindow, onBuy, onSell)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())





Npc:

<?xml version="1.0"?>
<npc name="# Seller Super Rox @" script="data/npc/scripts/newcoin.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="53" head="87" body="0" legs="87" feet="0" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I {trade} items for Nugget Coins!"/>
</parameters>
</npc>

 

ok tem a script agora e como adiciono ele no mapa com nome e srprit? porque eu estou com dificuldades para add npc n sei como por spawn dele no server e nem como add ele no mapa no remes 

Em 11/02/2016 em 17:34, Jinx disse:

tenho esse aque no meu server brother. e funfa !

 

 

 

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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 creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local itemid = 2157 -- Novos points ( default é scarab coin )
local shopWindow = {}
local t = {
 [8850] = {price = 400}, -- [ID do item] e o preço que ele irá custar em points.
 [8929] = {price = 400},
 [8932] = {price = 400},
 [8926] = {price = 400},
 [2424] = {price = 400},
 [11296] = {price = 200},
 [11295] = {price = 200},
 [11298] = {price = 200},
 [11297] = {price = 200},
 [2527] = {price = 200},
 [2108] = {price = 900},
 [9019] = {price = 900},
 [3955] = {price = 900}
 }
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
if  t[item] and getPlayerItemCount(cid, itemid) < t[item].price then
selfSay("you do not have "..t[item].price.." Nugget Coins.", cid)
else
doPlayerAddItem(cid, item)
doPlayerRemoveItem(cid, itemid, (t[item].price))
selfSay("Here you item", cid)
  end
return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
for var, ret in pairs(t) do
table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
end
openShopWindow(cid, shopWindow, onBuy, onSell)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())





Npc:

<?xml version="1.0"?>
<npc name="# Seller Super Rox @" script="data/npc/scripts/newcoin.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="53" head="87" body="0" legs="87" feet="0" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I {trade} items for Nugget Coins!"/>
</parameters>
</npc>

 

e mais uma duvida como eu coloco o tipo do dinheiro nele igual vc fez com a scareb

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo