Ir para conteúdo
  • Cadastre-se

Posts Recomendados

t49.gif.6ad6c55834282c064f7041c4bc7e1f26.gif

 

Descrição: NPC Simples do Tibia Global que vende alimentos e negocia Pirate Outfit.

Nome do Npc: Ariella

Função: Comerciante de Alimentos

 

Vende:

  • Cheese
  • Ham
  • Meat
  • Valentine's Cake
  • Apple
  • Banana
  • Blueberry
  • Mango
  • Melon
  • Orange
  • Pear
  • Pumpkin
  • Strawberry
  • Juice Squeezer

 

Troca:

  • t57.gif.72391965675416fabec98abaec3b61b5.gif Brutus Bloodbeard's Hat, t56.gif.7fd15dc9d703ceb76928a25c61751361.gif Lethal Lissy's Shirt, t54.gif.2527baf528dc13eaf164980ecd423241.gif Ron the Ripper's Sabre, t55.gif.dafe58414b7f1d94ecf9a6e03ca63bbd.gif Deadeye Devious Eye Patch X t52.gif.2078c44e5776f85450875df75506dcaf.gift53.gif.7ccd2563c621fb4372cbee7ffb27f3c9.gif Addon Pirata Chapéu.

 

Ariella.lua

local keywordHandler = KeywordHandler:new()
local 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 --

sopirate       = 22031
opirate        = 22032
fpirate        = 22033
spirate        = 22034

newaddon    = 'Ah, right! The pirate hat! Here you go.'
noitems        = 'You do not have all the required items.'
noitems2    = 'You do not have all the required items or you do not have the outfit, 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 PirateSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    if getPlayerStorageValue(cid,spirate) == -1 then
        if getPlayerItemCount(cid,6101) >= 1 and getPlayerItemCount(cid,6102) >= 1 and getPlayerItemCount(cid,6100) >= 1 and getPlayerItemCount(cid,6099) >= 1 then
        if doPlayerRemoveItem(cid,6101,1) and doPlayerRemoveItem(cid,6102,1) and doPlayerRemoveItem(cid,6100,1) and doPlayerRemoveItem(cid,6099,1) then
            npcHandler:say('Ah, right! The pirate hat! Here you go.')             
            doSendMagicEffect(getCreaturePosition(cid), 13)
			setPlayerStorageValue(cid,spirate,1)
			if getPlayerSex(cid) == 1 then
            doPlayerAddOutfit(cid, 151, 2)
			elseif getPlayerSex(cid) == 0 then
            doPlayerAddOutfit(cid, 155, 2)
        end    
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end



node1 = keywordHandler:addKeyword({'hat'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To get pirate hat you need give me brutus bloodbeard\'s hat, lethal lissy\'s shirt, ron the ripper\'s sabre and deadeye devious\' eye patch. Do you have them with you?'})
node1:addChildKeyword({'yes'}, PirateSecond, {})
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({'addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To get pirate hat you need give me brutus bloodbeard\'s hat, lethal lissy\'s shirt, ron the ripper\'s sabre and deadeye devious\' eye patch. Do you have them with you?'})
node2:addChildKeyword({'yes'}, PirateSecond, {})
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())

 

Ariella.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Ariella" script="data/npc/scripts/Ariella.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="155" head="115" body="3" legs="1" feet="76" addons="2"/>
<voices>
<voice text="Have a drink in Meriana's only tavern!" interval2="120" margin="1" yell="no"/>
</voices>
<parameters>
<parameter key="module_shop" value="1" />
		<parameter key="shop_buyable" value="cheese,2696,6;ham,2671,8;meat,2666,5;valentine's Cake,6393,100;apple,2674,5;banana,2676,5;blueberry,2677,1;mango,5097,10;melon,2682,10;orange,2675,10;pear,2673,5;pumpkin,2683,10;strawberry,2680,2;juice squeezer,5865,100;" />
        <parameter key="message_greet" value="Hi there |PLAYERNAME|, and welcome to my tavern."/>
        <parameter key="message_farewell" value="Good bye."/>
		<parameter key="message_walkaway" value="Good bye." />
		<parameter key="message_sendtrade" value="Of course, take a look at my tasty offers." />
</parameters>
</npc>

 

Link para o post
Compartilhar em outros sites

Parabéns, seu tópico de conteúdo foi aprovado!
Muito obrigado pela sua contribuição, nós do Tibia King agradecemos.
Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.

Spoiler

Congratulations, your content has been approved!
Thank you for your contribution, we of Tibia King we are grateful.
Your content will help many other users, you received +1 REP.

 

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por RankerS
      Hoje estarei disponibilizando um outfit criado por mim para vocês do TK .
      sakuraskin_1915.obd
    • Por Sphynx1
      Olá comunidade.
      Eu criei um script a madrugada passada para tentar ajudar um amigo que usa 'OTX' porém dá um erro bizarro no 'lib/compat.lua' e a função 'doAddPlayerOutfit' retorna valor 'NIL'. Eu não sei como resolver, mas está funcionando perfeitamente no 'TFS 0.4'. Espero que alguém em algum lugar do tempoespaço possa se beneficiar desse script já que os que encontrei estão todos muito feios e confusos.

      1. Acesse a pasta 'data/talkactions/scripts' e crie um novo 'arquivo.lua' chamado 'addonpresent.lua', dentro adicione o conteúdo abaixo.
      function onSay(cid, words, param, channel) local maleOutfits = {["citizen"] = {128}, ["mage"] = {130}, ["knight"] = {131}, ["nobleman"] = {132}, ["summoner"] = {133}, ["warrior"] = {134} } local femaleOutfits = {["citizen"] = {136}, ["mage"] = {138}, ["knight"] = {139}, ["nobleman"] = {140}, ["summoner"] = {141}, ["warrior"] = {142} } local mensagens = {"Você recebeu o seu addon e consumiu o item bônus para isto.", "Verifique o que você digitou e tente novamente, parametros inválidos.", "Você não possui o item necessário para receber um addon.", "Certifique-se que você digitou o nome do addon corretamente e tente mais uma vez."} local efeitinga = {[1] = {name = CONST_ME_POFF}, [2] = {name = CONST_ME_CAKE}, [3] = {name = CONST_ME_HEARTS}, [4] = {name = CONST_ME_GIFT_WRAPS} -- efeitos que seram exibidos } local param = string.lower(param) if not isPremium(cid) then doCreatureSay(cid, "Você não possui Premium Account, portanto não poderá utilizar o item de addon.", TALKTYPE_ORANGE_1) -- MSG que será exibida p/ o nao premium return true end if getPlayerItemCount(cid, 6497) > 0 then -- 6497 é o ID do item que será usado por você, se for maior que 0 a quanidade na sua bag então if param ~= "" and maleOutfits[param] and femaleOutfits[param] then doPlayerRemoveItem(cid, 6497, 1) -- o item 6497 será consumido doCreatureSay(cid, mensagens[1], TALKTYPE_ORANGE_1) for k, v in pairs(efeitinga) do doSendMagicEffect(getCreaturePosition(cid), v.name) end if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, femaleOutfits[param][1], 3) elseif getPlayerSex(cid) == 1 then doPlayerAddOutfit(cid, maleOutfits[param][1], 3) end else doCreatureSay(cid, mensagens[2], TALKTYPE_ORANGE_1) end else doCreatureSay(cid, mensagens[3], TALKTYPE_ORANGE_1) end return true end  
      2. Regresse até 'data/talkactions' e abra o arquivo 'talkactions.xml', dentro adicione o conteúdo abaixo.
      <talkaction words="!addon" event="script" value="addonpresent.lua"/>  
       
    • Por Bruxo Ots
      Fala queridos, estarei compartilhando o npc de addon que ja é bem antigo, porém não achei em local nenhum atualizado, esse esta lindo de bonito, acredito que seja destinado a servidores baiak ou qualquer outro tipo de server.
      Ambos os NPC'S estão por gold, e as storages são em sequencia pra facilitar a vida.
       
      Os codigos estão em spoiler pra não pesar, mas caso queiram se adiantar no fim do post tem o link do github.
      Imagem meramente Ilustrativa:
       
      Script Do addon:
       
      Montarias
       
       
       
      Sempre que atualizar os addons e mounts no global estarei adicionando aos NPC'S.
       
       
      GITHUB
       
       
           Creditos
      Comedinha (scripts das montarias) Zbizu (acredito que tenha atualizado para 1.1) E ao criador do npc Varkhal, realmente não faço ideia de quem seja.  
       
       
       
       
    • Por Digoshow
      Como eu faco o addon doll adicionar addons em free account, o meu addon doll ao ser usado por um free account diz, que so premium account pode usar, quero que fique free, para todos poderem usar addons.
      Obrigado, REP+ .
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo