Ir para conteúdo

Featured Replies

Postado

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>

 

Postado

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.

 

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 520.3k

Informação Importante

Confirmação de Termo