Local incorreto champz, correto seria: Aqui.
info
Grupo: Visconde
Registrado: 27/01/13
Posts: 443
Reputação: +83
Gênero: Masculino

Área incorreta. A área que você postou é para códigos prontos. Para pedidos/dúvidas, opte por fazer na devida área - Pedidos e dúvidas - Scripting. Já quando for relacionado à servidores derivados (Pokémon, Naruto, etc), Pedidos e dúvidas - Servidores derivados. Mais cuidado da próxima vez.
Tópico movido.
Editado Dezembro 14 por zipter98
info
Grupo: Banidos
Registrado: 21/01/12
Posts: 842
Reputação: +234
Char no Tibia: Stephan

Eu tinha respondido esse tópico em outro fórum, duvida sanada.
nightbrother.xml
<?xml version="1.0"?>
<npc name="Addons NPC" script="data/npc/scripts/nightbrother.lua" walkinterval="1000" floorchange="0">
<health now="100" max="100"/>
<look type="155" head="115" body="76" legs="76" feet="83" addons="3"/>
<parameters>
<parameter key="message_greet" value="Ola |PLAYERNAME|. Podemos trocar alguns itens pelos addons {first nightmare addon}, {second nightmare addon}, {first brotherhood addon} e {second brotherhood addon}" />
</parameters>
</npc>
nightbrother.lua
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 a = {
nightoutfitfemale = 269, -- id do nightmare addon female
nightoutfitemale = 268, -- id do nightmare addon male
brotheroutfitfemale = 279, -- id do brotherhood addon female
brotheroutfitmale = 278, -- id do brotherhood addon male
quant1 = 500, -- quantidade de demonic que precisa para os first addons
quant2 = 1000, -- quantidade de demonic que precisa para os second addons
demonic = 6500, -- Não troque
item1 = 6391, -- id do nightmare shield
item2 = 6433, -- id do necromancer shield
}
-- Nightmare Addon --
if msgcontains(msg, 'first nightmare addon') then
if getPlayerSex(cid) == 0 then
if getPlayerItemCount(cid, a.demonic) >= a.quant1 then
doPlayerAddOutfit(cid,a.nightoutfitfemale, 1)
doPlayerRemoveItem(cid, a.demonic, a.quant1)
selfSay('Você ganhou o {first nightmare addon}!', cid)
else
selfSay('Você precisa de {'..a.quant1..' '..getItemNameById(a.demonic)..'} para fazer o {first nightmare addon}.', cid)
end
end
end
if msgcontains(msg, 'second nightmare addon') then
if getPlayerStorageValue(cid,76435) == -1 then
if getPlayerSex(cid) == 0 then
if getPlayerItemCount(cid, a.demonic) >= a.quant2 then
doPlayerAddOutfit(cid,a.nightoutfitfemale, 2)
doPlayerRemoveItem(cid, a.demonic, a.quant2)
doPlayerAddItem(cid, a.item1, 1)
setPlayerStorageValue(cid,76435,1)
selfSay('Você ganhou o {second nightmare addon} e um {'..getItemNameById(a.item1)..'}!', cid)
else
selfSay('Você precisa de {'..a.quant2..' '..getItemNameById(a.demonic)..'} para fazer o {second nightmare addon}.', cid)
end
end
else
selfSay('Você já fez o {second nightmare addon}.', cid)
end
end
if msgcontains(msg, 'first nightmare addon') then
if getPlayerSex(cid) == 1 then
if getPlayerItemCount(cid, a.demonic) >= a.quant1 then
doPlayerAddOutfit(cid,a.nightoutfitmale, 1)
doPlayerRemoveItem(cid, a.demonic, a.quant1)
selfSay('Você ganhou o {first nightmare addon}!', cid)
else
selfSay('Você precisa de {'..a.quant1..' '..getItemNameById(a.demonic)..'} para fazer o {first nightmare addon}.', cid)
end
end
end
if msgcontains(msg, 'second nightmare addon') then
if getPlayerSex(cid) == 1 then
if getPlayerItemCount(cid, a.demonic) >= a.quant2 then
doPlayerAddOutfit(cid,a.nightoutfitmale, 2)
doPlayerRemoveItem(cid, a.demonic, a.quant2)
doPlayerAddItem(cid, a.item1, 1)
selfSay('Você ganhou o {second nightmare addon} e um {'..getItemNameById(a.item1)..'}!', cid)
else
selfSay('Você precisa de {'..a.quant2..' '..getItemNameById(a.demonic)..'} para fazer o {second nightmare addon}.', cid)
end
end
end
-- Nightmare Addon --
-- Brotherhood Addon --
if msgcontains(msg, 'first brotherhood addon') then
if getPlayerSex(cid) == 0 then
if getPlayerItemCount(cid, a.demonic) >= a.quant1 then
doPlayerAddOutfit(cid,a.brotheroutfitfemale, 1)
doPlayerRemoveItem(cid, a.demonic, a.quant1)
selfSay('Você ganhou o {first brotherhood addon}!', cid)
else
selfSay('Você precisa de {'..a.quant1..' '..getItemNameById(a.demonic)..'} para fazer o {first brotherhood addon}.', cid)
end
end
end
if msgcontains(msg, 'second brotherhood addon') then
if getPlayerSex(cid) == 0 then
if getPlayerItemCount(cid, a.demonic) >= a.quant2 then
doPlayerAddOutfit(cid,a.brotheroutfitmale, 2)
doPlayerRemoveItem(cid, a.demonic, a.quant2)
doPlayerAddItem(cid, a.item2, 1)
selfSay('Você ganhou o {second brotherhood addon} e um {'..getItemNameById(a.item2)..'}!', cid)
else
selfSay('Você precisa de {'..a.quant2..' '..getItemNameById(a.demonic)..'} para fazer o {second brotherhood addon}.', cid)
end
end
end
if msgcontains(msg, 'first brotherhood addon') then
if getPlayerSex(cid) == 1 then
if getPlayerItemCount(cid, a.demonic) >= a.quant1 then
doPlayerAddOutfit(cid,a.brotheroutfitfemale, 1)
doPlayerRemoveItem(cid, a.demonic, a.quant1)
selfSay('Você ganhou o {first brotherhood addon}!', cid)
else
selfSay('Você precisa de {'..a.quant1..' '..getItemNameById(a.demonic)..'} para fazer o {first brotherhood addon}.', cid)
end
end
end
if msgcontains(msg, 'second brotherhood addon') then
if getPlayerSex(cid) == 1 then
if getPlayerItemCount(cid, a.demonic) >= a.quant2 then
doPlayerAddOutfit(cid,a.brotheroutfitmale, 2)
doPlayerRemoveItem(cid, a.demonic, a.quant2)
doPlayerAddItem(cid, a.item2, 1)
selfSay('Você ganhou o {second brotherhood addon} e um {'..getItemNameById(a.item2)..'}!', cid)
else
selfSay('Você precisa de {'..a.quant2..' '..getItemNameById(a.demonic)..'} para fazer o {second brotherhood addon}.', cid)
end
end
end
-- Brotherhood Addon --
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Edite como quiser nesta parte:
local a = {
nightoutfitfemale = 269, -- id do nightmare addon female
nightoutfitemale = 268, -- id do nightmare addon male
brotheroutfitfemale = 279, -- id do brotherhood addon female
brotheroutfitmale = 278, -- id do brotherhood addon male
quant1 = 500, -- quantidade de demonic que precisa para os first addons
quant2 = 1000, -- quantidade de demonic que precisa para os second addons
demonic = 6500, -- Não troque
item1 = 6391, -- id do nightmare shield
item2 = 6433, -- id do necromancer shield
}
- Verifica se o player é female ou male
- Da o outfit(addon) conforme o sexo
- Não adicionei storage por preguiça, então se quiser adicione você, a função é igual de quests normais
- O player pode falar com o npc quantas vezes quiser
Editado Janeiro 4 por AnneMotta






info
Grupo: Campones
Registrado: 08/03/13
Posts: 74
Reputação: +14
Então, eu quero um script pra adicionar na quest do nightmare/brotherhood outfit/addon. Seguinte, os addons já são free pra qualquer player, então o que eu realmente quero é um NPC onde se eu entregasse 500 demonic essences receberia o addon 1, e depois entregasse 1000 demonic essences receberia o segundo addon junto com um nightmare shield.
Pode deixar os addons e itens de entregar/outfit a receber configurável que eu me viro.