BOua Cara
mas Faz UMF aVoR??
Poem no quote Tira do Box
Please
Vlkw VOT esTa DpoiS x)!
BOua Cara
mas Faz UMF aVoR??
Poem no quote Tira do Box
Please
Vlkw VOT esTa DpoiS x)!
AEW estava mesmo procurando isto porque tenho perguisa de fazer UHSuhsauhas
Manow mas ele é 8.1 ? com os addons do palhaço e isso?
Boa.
Parabéns.
info
Grupo: Cavaleiro
Registrado: 11/07/07
Posts: 177
Reputação: +3
Char no Tibia: Eorah Khaderu

sim 8.1 com addons de jester , brotherwood entre outros...
![]()
Mal ae perguntar, mas onde ele fica.. novato =/
MrStyle
Mal ae perguntar, mas onde ele fica.. novato =/
Tpo c vc tiver o seu map editor eu nao sei c vai ter lah o npc q vc criou , mais para um test crie com o seu GOD /s (nomedonpc)
vlw aew pelo tuto ^^ :smile_positivo:
Editado Março 4 por Raulzito
Bom NPC, aprovado.
info
Grupo: Cavaleiro
Registrado: 11/07/07
Posts: 177
Reputação: +3
Char no Tibia: Eorah Khaderu
Olá, venho postar um NPC feito por Evil Hero, e modificado por mim...
Vá em data/npc/ crie um novo arquivo xml com o nome que desejar exemplo: AddonTrader.xml
Abra-o e coloque isso:
Caso queira seguir o nome do NPC de AddonTrader mude onde está escrito "Nomedonpc" para "AddonTrader"
Após renomear o NPC poderá salvar o arquivo e feichar.
___________________________________________________
Em data/npc/scripts crie um novo arquivo LUA com o nome de Exchange.lua
E cole isso:
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) -- OTServ event handling functions start 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 -- OTServ event handling functions end function creatureSayCallback(cid, type, msg) -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself. if(npcHandler.focus ~= cid) then return false end if msgcontains(msg, 'offer') then selfSay('I can Trade Fighting Spirit, Warriors Sweat, Spool of Yarn, Enchanted Chicken Wings and a Blessed Wooden Stake for some special Items') elseif msgcontains(msg, 'fighting spirit') then selfSay('Do you like to trade 2 Royal Helmet for a Fighting Spirit?') talk_state = 1 elseif msgcontains(msg, 'yes') and talk_state == 1 then if getPlayerItemCount(cid,2498) >= 2 then if doPlayerTakeItem(cid,2498,2) == 0 then selfSay('Here you are.') doPlayerAddItem(cid,5884,1) end else selfSay('Sorry, you don\'t have the item.') end elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then selfSay('Ok thanks.') talk_state = 0 end if msgcontains(msg, 'warriors sweat') then selfSay('Do you like to trade 4 Warrior Helmet Helmet for a Warriors Sweat?') talk_state = 2 elseif msgcontains(msg, 'yes') and talk_state == 2 then if getPlayerItemCount(cid,2475) >= 4 then if doPlayerTakeItem(cid,2475,4) == 0 then selfSay('Here you are.') doPlayerAddItem(cid,5885,1) end else selfSay('Sorry, you don\'t have the item.') end elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then selfSay('Ok thanks.') talk_state = 0 end if msgcontains(msg, 'spool of yarn') then selfSay('Do you like to trade 10 Giant Spider Silk for a Spool of Yarn?') talk_state = 3 elseif msgcontains(msg, 'yes') and talk_state == 3 then if getPlayerItemCount(cid,5879) >= 10 then if doPlayerTakeItem(cid,5879,10) == 0 then selfSay('Here you are.') doPlayerAddItem(cid,5886,1) end else selfSay('Sorry, you don\'t have the item.') end elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then selfSay('Ok thanks.') talk_state = 0 end if msgcontains(msg, 'enchanted chicken wings') then selfSay('Do you like to trade Boots of Haste for some Enchanted Chicken Wings?') talk_state = 4 elseif msgcontains(msg, 'yes') and talk_state == 4 then if getPlayerItemCount(cid,2195) >= 1 then if doPlayerTakeItem(cid,2195,1) == 0 then selfSay('Here you are.') doPlayerAddItem(cid,5891,1) end else selfSay('Sorry, you don\'t have the item.') end elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then selfSay('Ok thanks.') talk_state = 0 end if msgcontains(msg, 'blessed wooden stake') then selfSay('Do you like to trade 100k for a Blessed Wooden Stake?') talk_state = 5 elseif msgcontains(msg, 'yes') and talk_state == 5 then if getPlayerItemCount(cid,2160) >= 10 then if doPlayerTakeItem(cid,2160,10) == 0 then selfSay('Here you are.') doPlayerAddItem(cid,5942,1) end else selfSay('Sorry, you don\'t have the item.') end elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 6) then selfSay('Ok thanks.') talk_state = 0 end -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself. return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())Salve o arquivo, e feiche-o.
Pronto seu NPC está configurado
Agora é so dizer HI o nome do addon e procurar o item que ele pedir
Atenção: Partes do texto em vermelho são coisas que você precisa fazer para que de certo
__________________________________________________________
Créditos totalmente a Evil Hero