Real Addons Trader 8.1

speedyks
em NPCs, monsters e raids

speedyks

=]
avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 11/07/07Posts: 177Char 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:

 

<?xml version="1.0"?>

<npc name="[color="#FF0000"]Nomedonpc[/color]" script="data/npc/scripts/exchange.lua" access="3" lookdir="2" autowalk="0">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="251" head="114" body="119" legs="132" feet="114" addons="3"/>
</npc>

 

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

Gift By: Slip



akamajpg.jpg

GuTOcS

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/02/08Posts: 22

BOua Cara

mas Faz UMF aVoR??

Poem no quote Tira do Box

Please

Vlkw VOT esTa DpoiS x)!

↔ ¦.::§oU::.¦ ↔

♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥

♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥♂♥♀♥


↔ ¦.::Sou MtU FaN::.¦ ↔


↔ ¦.::Nao Aceito Que nguem Use Minhas Sings ObrigadO::.¦ ↔

tavax

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 24/06/07Posts: 104Char no Tibia: Tavas

AEW estava mesmo procurando isto porque tenho perguisa de fazer UHSuhsauhas

 

Manow mas ele é 8.1 ? com os addons do palhaço e isso?

Nome

kruxdudu

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 26/07/07Posts: 284

Boa.

Parabéns.

Sou fan de:



speedyks

=]
avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 11/07/07Posts: 177Char no Tibia: Eorah Khaderu

sim 8.1 com addons de jester , brotherwood entre outros...

 

:)

Gift By: Slip



akamajpg.jpg

dragun7

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 21/01/08Posts: 4Char no Tibia: Omaigode

Mal ae perguntar, mas onde ele fica.. novato =/



Minha Sign..

Como tem um darkz aqui nesse forum... meu nick tb eh darkz... dae colokei o meu nick NESTE forum la em cima,
para ficar claro que eh minha !

Mr Style

Valeus !

dinomt

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 13/02/08Posts: 6

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:

lpdc11k.jpg

 

 

easy4fun.servegame.com 24/7

Dakos

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/07/07Posts: 29Char no Tibia: Raizen Nog

Bom NPC, aprovado.

Inédito, new server previsto pra duas semanas
Mais informações clique aqui.


-------------------------------------------------------

Valeu muleke!

Loyal Friend of XChronoX

tadzio

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/09/07Posts: 85Char no Tibia: Revaux

Desculpa mas esse NPC, n dah addon , mas sim troca itens por outros que podem ser usados em addon, é um npc trader

PS:Olhem sempre oque voce posta

&Tádzio&