SE FOR FAZER PEDIDO DIGITE NO TOPICO [PEDIDO] PARA NÃO COMPLICAR .POR FAVOR ALGUM MODERADOR REMOVA ESTE TOPICO
- Fórum
- xTibia - Notícias e Suporte
- Soluções
- Archived
- [NPC] Npc Diferente
info
Grupo: Artesão
Registrado: 30/06/09
Posts: 101
Reputação: 0
Char no Tibia: Sem Nenhum

info
Grupo: Barão
Registrado: 08/04/09
Posts: 234
Reputação: +11
Char no Tibia: Kino Calmera

Seção incorreta brother.
Estarei movendo para a certa.
Abraços.
info
Grupo: Campones
Registrado: 11/11/07
Posts: 61
Reputação: 0
Char no Tibia: Paladinhozinho

ta ae fera nao fui eu que fiz achei aqui no forum mesmoo espero que funcione :smile_positivo:
keywordHandler = KeywordHandler:new()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
-- Storage IDs --
citizen = 22001
-------------------
newaddon = 'Here you are, enjoy your brand new addon!'
noitems = 'You do not have all the required items.'
noitems2 = 'You do not have all the required items or you do not have the first addon, which by the way, is a requirement for this addon.'
already = 'It seems you already have this addon, don\'t you try to mock me son!'
-------------------
function CitizenFirst(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if isPremium(cid) then
addon = getPlayerStorageValue(cid,citizen)
if addon == -1 then
if getPlayerItemCount(cid,5878) >= 100 then
if doPlayerRemoveItem(cid,5878,100) then
selfSay(newaddon)
doSendMagicEffect(getCreaturePosition(cid), 13)
doPlayerAddOutfit(cid, 128, 1)
doPlayerAddOutfit(cid, 136, 1)
setPlayerStorageValue(cid,citizen,1)
end
else
selfSay(noitems)
end
else
selfSay(already)
end
end
end
function CitizenSecond(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if isPremium(cid) then
addon = getPlayerStorageValue(cid,citizen+1)
if addon == -1 then
if getPlayerItemCount(cid,5890) >= 100 and getPlayerItemCount(cid,5902) >= 50 and getPlayerItemCount(cid,2480) >= 1 then
if doPlayerRemoveItem(cid,5890,100) and doPlayerRemoveItem(cid,5902,50) and doPlayerRemoveItem(cid,2480,1) then
selfSay(newaddon)
doSendMagicEffect(getCreaturePosition(cid), 13)
doPlayerAddOutfit(cid, 128, 2)
doPlayerAddOutfit(cid, 136, 2)
setPlayerStorageValue(cid,citizen+1,1)
end
else
selfSay(noitems)
end
else
selfSay(already)
end
end
end
keywordHandler:addKeyword({'addons'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you first & second addons of the following outfits: Citizen, Hunter, Mage, Knight, Nobleman, Summoner, Warrior, Barbarian, Druid, Wizard, Oriental, Pirate, Assassin, Beggar, Shaman, Norseman, Nightmare, Jester & Brotherhood."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "What you do is that you type 'first hunter addon' or 'second hunter addon' where you replace 'hunter' with whatever outfit you'd like to achieve the addons for. Assuming that you already collected all the required pieces, say 'yes' and voíla - you got yourself an addon!"})
node1 = keywordHandler:addKeyword({'first citizen addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first citizen addon you need to give me 100 minotaur leathers. Do you have them with you?'})
node1:addChildKeyword({'yes'}, CitizenFirst, {})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})
node2 = keywordHandler:addKeyword({'second citizen addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first hunter addon you need to give me 100 chicken feathers, 50 honeycombs and a legion helmet. Do you have them with you?'})
node2:addChildKeyword({'yes'}, CitizenSecond, {})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})
npcHandler:addModule(FocusModule:new())
para mudar qual addon o npc ira adicionar eh só mudar:
doPlayerAddOutfit(cid, 128, 2)doPlayerAddOutfit(cid, 136, 2)
os numeros 128,136 eh o numero do addon(128 pra homen e 136 pra mulher PS: deixe os 2) e 2 é o numero do addon(first addon, second addon)
para ver o numero de todos os addons vai na pasta: data/XML/outfit.xml



info
Grupo: Campones
Registrado: 24/12/08
Posts: 25
Reputação: 0
Char no Tibia: Nyel of Nerana
Olá galera do :XTibia_smile: , venho pedir um NPC diferente ( eu nunca vi )... queria um NPC assim, que ele vendesce so "first citizen e Second citizen" no caso queria tbm um tutorial me ensinando como mudar as roupas ou seja ai eu dei o exemplo ai também queria saber como mudava pra HUNTER, PIRATE etc..
Nyel