seria por gps ou por items?
info
Grupo: Campones
Registrado: 14/12/07
Posts: 32
Reputação: 0
Char no Tibia: Ederim Denic

por gps
info
Grupo: Marquês
Registrado: 18/05/11
Posts: 1.1k
Reputação: +150
Gênero: Masculino

Acho que este é a mesma coisa:
http://www.xtibia.com/forum/topic/170068-npc-professor-de-spells/
info
Grupo: Campones
Registrado: 14/12/07
Posts: 32
Reputação: 0
Char no Tibia: Ederim Denic

ja tentei esse e nao deu ![]()
info
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char no Tibia: No Have

vo fazer so que por dinheiro.
flw
info
Grupo: Conde
Registrado: 30/06/11
Posts: 631
Reputação: +371
Char no Tibia: Warrior of Mort

essa do @VodKart, funciona perfeitamente, basta configurar corretamente:
http://www.xtibia.co...pells-por-item/
e se você quiser para remover money ao invez do item, basta trocar essa linha no script:
doPlayerRemoveItem(cid,moeda,t[msg].price)
por essa:
doPlayerRemoveMoney(cid, t[msg].price)
Editado Abril 24 por Jhon992
info
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char no Tibia: No Have

eu so tava organizando as funçoes para fazer ai eu achei o do Vorkat como jhon disse ele funciona
fiz uma por trade
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 shopWindow = {}
local spells = {
{id=1950, buy = 10000, name = "find person", vocations = {1,2,3,4,5,6,7,8}, level = 15},
{id=1950, buy = 15000, name = "flame strike", vocations = {1,2,5,6}, level = 20}
}
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
if not getPlayerLearnedInstantSpell(cid, shopWindow[item].SpellName) then
if getPlayerLevel(cid) >= shopWindow[item].Level then
if isInArray(shopWindow[item].Vocs, getPlayerVocation(cid)) then
doPlayerRemoveMoney(cid, shopWindow[item].Price)
doPlayerLearnInstantSpell(cid, shopWindow[item].SpellName)
npcHandler:say("você aprendeu uma nova magia chamada "..shopWindow[item].SpellName, cid)
else
npcHandler:say("você não tem a vocação para comprar está spell.", cid)
end
else
npcHandler:say("você precisa ter level "..shopWindow[item].Level.." ou mais para comprar essa magia.", cid)
end
else
npcHandler:say("você já aprendeu essa magia.", cid)
end
return true
end
if msgcontains(msg, 'trade') or msgcontains(msg, 'spell') then
for var, item in pairs(spells) do
shopWindow[item.id] = {Level = item.level, Vocs = item.vocations, item_id = item.id, Price = item.buy, subType = 0, SpellName = item.name}
end
openShopWindow(cid, spells, onBuy, onSell)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Editado Abril 24 por SrNight




info
Grupo: Campones
Registrado: 14/12/07
Posts: 32
Reputação: 0
Char no Tibia: Ederim Denic
galera todos os npcs q eu tentei fazer nenhum da certo, eu precisava de um q desse certo, as minhas magias sao de narutibia e meu servidor eh 8.54, precisava q fosse facil de adicionar as magias no npc dps, quem fizer isso por mim dou rep+.