Ir para conteúdo
  • Cadastre-se

Posts Recomendados

MARAVILHOOOOOOSOS, como vocês estão? Espero que estejam bem. ?

Esses dias fuçando as profundezas sombrias do meu computador encontrei essa quest, a Barbarian Test Quest, do tibia global e agora compartilho-a com vocês. Para quem não conhece, é aquela quest que dá alguns acessos na cidade de Svargrond do tibia global.

Mais informações, visite o link: https://www.tibiawiki.com.br/wiki/Barbarian_Test_Quest

As falas do NPC estão 99% iguais ao do tibia global, salvo algumas pequenas modificações/adaptações feitas por mim dando o meu toque, é claro ?. (todos gostam do meu toque) Obviamente, a quest se aplica melhor para servidores de tibia clássico, mas deixei os id's dos itens facilmente editáveis para você adaptar para o seu servidor, seja ele de qual tipo for, para TFS 0.4 ou OTX 2.x.

 

Configuração:

 

1) Em data/lib, crie um arquivo chamado Barbarian Test Quest.lua e cole isto dentro:

 

Spoiler

-- Barbarian Test Quest by Dwarfer

BARBARIAN_TEST = {
    
    first_test = {
        honeycomb_id = 5902, -- id da honeycomb que o NPC pede
        sips = 20, -- goles que o NPC dará ao jogador
        sip_chance = 80, -- chance para ter sucesso no teste
        sips_to_complete = 10, -- quantos goles sucessivos o jogador deve completar
        corpse_id = 2317, -- id do corpo para o qual o jogador se transforma ao cair de bêbado 
        drunk_duration = 30, -- duração da "bebedeira"
        
        storages = { -- só modifique se necessário
            sips = 87340,
            succeed = 87341
        }
    },
    
    second_test = {
        filled_meadhorn_id = 7140, -- id do chifre cheio de rum
        empty_meadhorn_id = 7141, -- id do chifre vazio
        filled_bucket_id = 7142, -- id do balde de rum
        lying_bear_id = 7174, -- id do urso "fingindo"
        sleeping_bear_id = 7175 -- id do urso "dormindo"
    },
    
    third_test = {
        standing_mammoth_id = 7176, -- id do mammoth parado
        sleeping_mammoth_id = 7177 -- id do mammoth "dormindo"
    },
        
    storages = { -- só modifique se necessário
        first_test = 87342,
        second_test = 87343,
        third_test = 87344,
        finished = 87345
    }
}

 

 

2) Em data/npc/scripts, crie um arquivo chamado Sven.lua e cole isto dentro:

 

Spoiler

-- Barbarian Test Quest by Dwarfer
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local npcTopic = {}
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
 
local function doNpcTellStory(cid, story_tab)
    for i = 1, #story_tab do
        npcHandler:say(story_tab[i], cid)
    end
end

function creatureSayCallback(cid, type, msg)
    local talkUser, msg = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid, string.lower(msg)
    if (not npcHandler:isFocused(cid)) then
        if isInArray({"hi", "hello"}, msg) then
            npcHandler:addFocus(cid)
            npcHandler:say("Be greeted, "..getPlayerName(cid).."! What brings you here?", cid)
            npcTopic[talkUser] = 1
        else
            return false
        end
    elseif (msgcontains(msg, "mission") or msgcontains(msg, "test")) and (npcTopic[talkUser] == 2 or npcTopic[talkUser] == 1) then 
        if getPlayerStorageValue(cid, BARBARIAN_TEST.storages.finished) == 1 then
            npcHandler:say("You have braved all three tests and are now an honorary barbarian.", cid)
        else
            if getPlayerStorageValue(cid, BARBARIAN_TEST.storages.first_test) == -1 then
                doNpcTellStory(cid, {"All of our juveniles have to take the barbarian test to become a true member of our community. Foreigners who manage to master the test are granted the title of an honorary barbarian and the respect of our people ...",
                                    "Are you willing to take the barbarian test?"})
                npcTopic[talkUser] = 3
            elseif getPlayerStorageValue(cid, BARBARIAN_TEST.storages.first_test) == 2 then
                if getPlayerStorageValue(cid, BARBARIAN_TEST.storages.second_test) == 1 then
                    npcHandler:say("You have not finished your test yet. Remember, you need to prove you can hug a bear.", cid)
                elseif getPlayerStorageValue(cid, BARBARIAN_TEST.storages.second_test) == 2 then
                    if getPlayerStorageValue(cid, BARBARIAN_TEST.storages.third_test) == -1 then
                        npcHandler:say("Talk to me about {bear hug} if you have finished the test.", cid)
                    elseif getPlayerStorageValue(cid, BARBARIAN_TEST.storages.third_test) == 1 then
                        npcHandler:say("You have not finished your test yet. Remember, you need to prove you can knock over a mammoth.", cid)
                    else
                        npcHandler:say("Talk to me about {mammoth} if you have finished the test.", cid)
                    end
                end
            end
        end
    elseif msgcontains(msg, "yes") then
        if npcTopic[talkUser] == 3 then
            doNpcTellStory(cid, {"That's the spirit! The barbarian test consists of a few tasks you will have to fulfil. All are rather simple - for a barbarian that is...",
                                "Your first task is to drink some barbarian mead. But be warned, it's a strong brew that could even knock out a bear. You need tomake at least ten sips of mead in a row without passing out to pass the test ...",
                                "Do you think you can do this?"})
            npcTopic[talkUser] = 4
        elseif npcTopic[talkUser] == 4 then
            local itemName = getItemNameById(BARBARIAN_TEST.first_test.honeycomb_id)
            setPlayerStorageValue(cid, BARBARIAN_TEST.storages.first_test, 1)
            doNpcTellStory(cid, {"Good, but to make barbarian mead we need some "..itemName.." which is rare here. I'd hate to waste mead just to learn you're not worth it ...",
                                "Therefore, you have to get your own "..itemName..". You'll probably need more than one try so better get some extra "..itemName.."s. Then talk to me again about {barbarian mead}."})
        elseif npcTopic[talkUser] == 5 then
            local mission = BARBARIAN_TEST.first_test
            local itemId = mission.honeycomb_id
            if getPlayerItemCount(cid, itemId) >= 1 then
                doPlayerRemoveItem(cid, itemId, 1)
                setPlayerStorageValue(cid, mission.storages.sips, mission.sips)
                npcHandler:say("Good, for this ".. getItemNameById(itemId) .. " I allow you ".. mission.sips .. " sips from the mead bucket over there. Talk to me again about barbarian mead if you have passed the test.", cid)
            else
                npcHandler:say("You don\'t have some "..getItemNameById(itemId).. " with you.", cid) 
            end
        end
    elseif msgcontains(msg, "no") and isInArray({3,4,5}, npcTopic[talkUser]) then
        npcHandler:say("I see. Maybe later.", cid) 
    elseif msgcontains(msg, "barbarian") then
        if getPlayerStorageValue(cid, BARBARIAN_TEST.storages.first_test) == -1 then
            npcHandler:say("A true barbarian is something special among our people. Everyone who wants to become a barbarian will have to pass the {barbarian test}.", cid)
            npcTopic[talkUser] = 2
        elseif getPlayerStorageValue(cid, BARBARIAN_TEST.storages.first_test) == 1 then
            if getPlayerStorageValue(cid, BARBARIAN_TEST.first_test.storages.succeed) < BARBARIAN_TEST.first_test.sips_to_complete then
                npcHandler:say("Do you have some "..getItemNameById(BARBARIAN_TEST.first_test.honeycomb_id).." with you?", cid)
                npcTopic[talkUser] = 5
            else
                doNpcTellStory(cid, {"An impressive start. Here, take your own mead horn to fill it at the mead bucket as often as you like ...",
                                "But there is much left to be done. Your next test will be to hug a bear ...",
                                "You will find one in a cave north of the town. If you are lucky, it's still sleeping. If not ... well that might hurt ...",
                                "Unless you feel that you hugged the bear, the test is not passed. Once you are done, talk to me about the bear hugging."})
                setPlayerStorageValue(cid, BARBARIAN_TEST.storages.first_test, 2)
                setPlayerStorageValue(cid, BARBARIAN_TEST.storages.second_test, 1)
                doPlayerAddItem(cid, BARBARIAN_TEST.second_test.empty_meadhorn_id, 1)
            end
        else
            npcHandler:say("You have already braved the first barbarian test.", cid)
        end
    elseif msgcontains(msg, "hug") then
        if getPlayerStorageValue(cid, BARBARIAN_TEST.storages.third_test) == -1 then
            if getPlayerStorageValue(cid, BARBARIAN_TEST.storages.second_test) == 2 then
                doNpcTellStory(cid, {"Amazing. That was a clever and brave as a barbarian is supposed to be. But a barbarian also has to be strong and fearless. To prove that you will have to knock over a mammoth ...",
                                "Did your face just turn into the color of fresh snow? However, you will find a lonely mammoth north west of the town in the wilderness. Knock it over to prove to be a true barbarian ...",
                                "Return to me and talk about the mammoth pushing when you are done."})
                setPlayerStorageValue(cid, BARBARIAN_TEST.storages.third_test, 1)
            else
                npcHandler:say("Prove you can hug a bear.", cid)
            end
        else
            npcHandler:say("You have already proved you can hug a bear.".. (getPlayerStorageValue(cid, BARBARIAN_TEST.storages.finished) == 1 and "" or " Keep on doing your missions."), cid)
        end
    elseif msgcontains(msg, "mammoth") then
        if getPlayerStorageValue(cid, BARBARIAN_TEST.storages.finished) == -1 then
            if getPlayerStorageValue(cid, BARBARIAN_TEST.storages.third_test) == 2 then
                doNpcTellStory(cid, {"As you have passed all three test, I welcome you in our town as an honorary barbarian. You can now become a citizen. Don't forget to talk to the people here. Some of them might need some help ...",
                                "We usually solve our problems on our own but some of the people might have a mission for you. Old Iskan, on the ice in the northern part of the town had some trouble with his dogs lately."})
                setPlayerStorageValue(cid, BARBARIAN_TEST.storages.finished, 1)
            else
                npcHandler:say("Prove you can knock over a mammoth.", cid)
            end
        else
            npcHandler:say("You are already an honorary barbarian. Nothing more to talk about.", cid) 
        end
    elseif msgcontains(msg, "bye") then
        npcHandler:say("May wind and weather be with you, "..getPlayerName(cid)..".", cid)
        npcTopic[talkUser] = 0
        npcHandler:releaseFocus(cid)
    elseif msgcontains(msg, "name") then
        doNpcTellStory(cid, {"I am Sven the Younger. My father, Sven the Elder has been missing in the ice waste since I was young. But unless one of our people is buried properly, we assume that he is still in the realm of the living...",
                            "Therefore, I am still known as 'the Younger', even though I have grown old."})
    elseif (msgcontains(msg, "here") or msgcontains(msg, "job")) then
        npcHandler:say("I am the jarl of my people. It's an honour and I am very proud of it", cid)
    elseif msgcontains(msg, "people") then
        npcHandler:say("Our people are simple and honest. We don\'t like the scheming ways of the {city} dwellers that live on the main continent.", cid)
    elseif (msgcontains(msg, "jarl") or msgcontains(msg, "leader")) then
        npcHandler:say("I am more than just the spokesman and highest judge amount my {people}. I don\'t raise taxes, and when the clans feel that it is necessary, I will be replaced by another jarl.", cid)
    elseif (msgcontains(msg, "king") or msgcontains(msg, "queen")) then
        npcHandler:say("We don\'t need any kings and queens here. Being the jarl of my people, I see that the laws are followed.", cid)
    elseif msgcontains(msg, "ferumbras") then
        npcHandler:say("Even here we heard about this powerful man. Travellers from the south only fare to whisper his name.", cid)
    elseif msgcontains(msg, "excalibug") then
        doNpcTellStory(cid, {"On the campfire, there are numerous tales about this weapon. It's told that it has been missing since ages ...",
                            "In my opinion, the power and fame of a weapon shouldn\'t exceed the power and fame of it's wielder. And I have not heard of any hero whose fame would surpass that of excalibug."})
    elseif msgcontains(msg, "join") then
        npcHandler:say("You might become an honorary barbarian if you manage to pass the barbarian test.", cid)
    elseif msgcontains(msg, "honourary barbarian") then
        npcHandler:say("An honourary barbarian earns the right to become a citizen here. But to prove yourself worthy, you have to pass the barbarian test.", cid)
    elseif msgcontains(msg, "news") then
        npcHandler:say("There is something evil going on. I have it in my bones.", cid)
    elseif (msgcontains(msg, "how are you?") or msgcontains(msg, "bones"))  then
        doNpcTellStory(cid, {"There is something in the air that worries me. A great evil is threatening all of us ...", 
                            "I might not have the gift of dreams that foresee the future like my {mother} did, but I seem to have inherited some of her gift nonetheless. Sometimes I just feel that something is about to happen ...",
                            "And this time it's something sinister and evil that threatens us all."})
    elseif msgcontains(msg, "mother") then
        doNpcTellStory(cid, {"My mother was that what my people call a witch. This is someone who has special magical abilities without any training on Nibelor ...",
                            "She used her powers more instinctively to amplify her healing skills when herbs would not suffice. She also had the gift to foretell the future ...",
                            "At first, the druids of Nibelor scorned her, but later they accepted her for her abilities and good intentions."})
    elseif msgcontains(msg, "rumours") then
        doNpcTellStory(cid, {"It's an old tale but it persists in the minds of the Svargrondar. It is about my father. There are rumours that he is still alive. ...",
                            "People regularly report about seeing him on top of the cliff right next to Svargrond. I myself would be glad if finally his corpse were found. Then I would be jarl 'Sven the Elder' ..... sounds much better."})
    elseif (msgcontains(msg, "guards") or msgcontains(msg, "army")) then
        doNpcTellStory(cid, {"We don't have an army and we don't need one. Even if the raiders call us weak, everyone of us knows how to fight ...",
                            "All adults serve as guards for some days each month as a service for the community."})
    elseif msgcontains(msg, "monsters") then
        npcHandler:say("There are many dangerous creatures that roam our isles. But having seen what men can do to each other, I wouldn't call any of them a monster.", cid)
    elseif msgcontains(msg, "santa claus") then
        npcHandler:say("We heard that this mythical dwarf lives somewhere on the southern Ice Islands.", cid)
    elseif msgcontains(msg, "city") then
        doNpcTellStory(cid, {"Our people lived as nomads some generations ago. The contact with Carlin taught us another way of living ...",
                            "We did not like everything about it but we are not stupid. We have seen the many advantages ...",
                            "If you cannot adapt to this land, you are dead and so we adapted to it and built this city. When the contact to Carlin got lost during the years of the serpents, we kept this city alive ...",
                            " And we survived, even though the {raiders} did their best to make us fail."})
    elseif msgcontains(msg, "years of serpents") then
        doNpcTellStory(cid, {"For more than two generations no ship had reached our shores because the giant sea serpents attacked and sank most ships that tried to travel here ...",
                            "Not long ago the sea serpents disappeared as suddenly as they had come. Now ships visit us again on a regular base."})
    elseif msgcontains(msg, "raiders") then
        doNpcTellStory(cid, {"In the past, all barbarian tribes roamed the lands of Chyll as nomads. When the Carliners came here and the trade flourished, we used the resources to build this permanent settlement ...",
                            "Some of our people claimed that it was wrong to settle down and to abandon the ancient ways. A female {shaman} rose in the ranks of those who opposed the erection of a settlement ...",
                            "She gathered all those who were not content, who did not want any foreign influence and who refused to learn ...",
                            "They tried to destroy everything our ancestors had built, but with the help of the Carliners they were stopped and driven away. Now they still roam the land and attack everyone they see ...",
                            "They became the raiders, our worst enemy. Nowadays, there are three larger tribes that often build camps in the South of our land ...",
                            "And after all those years, surviving several generations, this female shaman is still their leader."})
    elseif msgcontains(msg, "camp") then
        npcHandler:say("The raiders' camps are mainly located in the south-western part of the isle. The camps are named after the major clans of the raiders: Ragnir, Bittermor and Grimhorn.", cid)
    elseif msgcontains(msg, "mines") then
        doNpcTellStory(cid, {"A long time ago when the trade with Carlin was flourishing, people actually worked in the mines. ...",
                            "During the years of the serpents, the mines had been abandoned. Later, the raiders took shelter there, although they blame us for living in a fortified city ...",
                            "Now, the traders of Carlin are back but some other foreigners seem to have claimed the mines from the raiders ...",
                            "It's neither our business nor would we have the manpower to help them to recapture the mines. Also, if they do not have the strength to get the mines back on their own, they don't deserve them anyway."})
    elseif msgcontains(msg, "god") then
        doNpcTellStory(cid, {"We know of father Chyll and his freezing breath. We care little for other gods. It is foolish to meddle with beings that are so powerful ...",
                            "We leave it to the druids and shamans to handle such affairs."})
    elseif msgcontains(msg, "chyll") then
        doNpcTellStory(cid, {"Father north wind is called Chyll by our people. He is an unforgiving hunter. He knows no mercy with the weak ...",
                            "Chyll is a harsh god and the best you can do is to avoid his attention. Only the shamans and druids deal with him."})
    elseif (msgcontains(msg, "druid") or msgcontains(msg, "shaman")) then
        npcHandler:say("Most shaman and druids of our people live on the sacred isle {Nibelor}. There, they divine the future, calm the wrath of father Chyll and prepare the dead for their last travel to the lands of {Everspring}.", cid)
    elseif msgcontains(msg, "nibelor") then
        npcHandler:say("Nibelor has always been a sacred place for our people. The druids and shamans live there.", cid)
    elseif msgcontains(msg, "everspring") then
        doNpcTellStory(cid, {"Everspring is the realm of the dead. It is a place of peace and harmony where those who boldly braved the challenges of life dwell for eternity and share stories at the campfires after a hunt ...",
                            "Every true {barbarian} that is properly brought into afterlife will join the great hunt in Everspring where the animals are fat and have the thickest furs."})
    elseif msgcontains(msg, "cult") then
        npcHandler:say("I don\'t care what people who come here believe in. If they provoke father Chyll, he will take care of them on his own. If their gods prove to be more powerful than Chyll, they might deserve to live.", cid)
    elseif msgcontains(msg, "carlin") then
        npcHandler:say("We are friend of the Carliners. Still we don't allow their politics to influence our way to handle things here.", cid)
    elseif msgcontains(msg, "edron") then
        npcHandler:say("We have heard only little about this far away place.", cid)
    elseif msgcontains(msg, "thais") then
        npcHandler:say("We understand that our friends from Carlin are wary with the realm ruled by Thais but this is not of our concern.", cid)
    elseif msgcontains(msg, "venore") then
        npcHandler:say("We did not allow them to stay here. This had nothing to do with our friendship with Carlin but for the way they handled things and their harmful approach to go hunting.", cid)
    elseif msgcontains(msg, "port hope") then
        npcHandler:say("We have heard only little about this far away place.", cid)
    elseif msgcontains(msg, "enemies") then
        doNpcTellStory(cid, {"Our enemies are numerous. Those of our people that we call the raiders are full of hate towards us. Then there are the voracious chakoyas that leave their icy homes to kill and slaughter from time to time ...",
                            "Sometimes, the great ice dragons find their way here to wreak havoc, and there are many more hungry beasts of all kinds."})
    elseif msgcontains(msg, "chakoya") then
        doNpcTellStory(cid, {"The chakoyas are neither beast nor man. Yet, they share the worst and more dangerous traits of both of them. Their small and furry appearance can be very misleading at first glance ...",
                            "But as soon as you've seen a pack of chakoyas literally shredding a mammoth into pieces with their claws and teeth, all misconceptions will be gone."})
    elseif msgcontains(msg, "ice dragons") then
        doNpcTellStory(cid, {"The dragons on our isles have adapted to the climate as every creature here. Instead of being aligned to fire, they became creatures of the cold ...",
                            "They are fierce and dangerous but, luckily, they only prey on beasts of the sea or those that wander the ice near their lairs."})
    elseif msgcontains(msg, "yeti") then
        npcHandler:say("The yetis are mythical beasts. Only few that encountered those creatures lived to tell the tale. The chakoyas worship them as divine beings, although they have no real relations to them as far as we can tell.", cid)
    elseif msgcontains(msg, "dwarf") then
        npcHandler:say("I met some of those little people in the past. Considering our experience with the chakoyas, we don't underestimate someone just for its look. And those dwarfs proved indeed to be powerful, courageous and enduring.", cid) -- we, dwarfs s2 xD
    elseif msgcontains(msg, "elf") then
        npcHandler:say("Some time ago, a few elves came here but they could not stand the cold and so they left pretty soon. Most likely it was Nibelor in which they have been interested.", cid)
    end    
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setMessage(MESSAGE_WALKAWAY, "May wind and weather be with you.")
npcHandler:setMessage(MESSAGE_FAREWELL, "May wind and weather be with you.")

 

 

O arquivo.xml do NPC Sven, em data/npc é o seguinte:

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Sven" script="Sven.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="143" head="76" body="100" legs="132" feet="97" addons="3" mount="0"/>
</npc>

3) Em data/actions/scripts, aconselho criar uma pasta chamada barbarian_test para colocar os arquivos referentes à quest. Dentro dessa pasta, um por um, coloque os arquivos com os nomes abaixo:

 

bucketmead.lua

Spoiler

local condition = createConditionObject(CONDITION_DRUNK)
setConditionParam(condition, CONDITION_PARAM_TICKS, BARBARIAN_TEST.first_test.drunk_duration * 1000)

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.actionid == 8952 then
        local mission = BARBARIAN_TEST.first_test
        if getPlayerStorageValue(cid, BARBARIAN_TEST.storages.first_test) == 1 then
            local sips_left = getPlayerStorageValue(cid, mission.storages.sips) > 0 and getPlayerStorageValue(cid, mission.storages.sips) or 0
            local rand = math.random(0, 100)
            local succeed = getPlayerStorageValue(cid, mission.storages.succeed) > 0 and getPlayerStorageValue(cid, mission.storages.succeed) or 0
            if sips_left > 0 then
                if succeed < mission.sips_to_complete then
                    if rand <= mission.sip_chance then
                        doCreatureSay(cid, "The world seems to spin but you manage to stay on your feet.", TALKTYPE_ORANGE_1)
                        setPlayerStorageValue(cid, mission.storages.succeed, succeed + 1)
                    else
                        local outfit = {lookTypeEx = mission.corpse_id}
                        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HITBYPOISON)
                        doSetCreatureOutfit(cid, outfit, 5 * 1000)
                        doCreatureSay(cid, "The mead was too strong. You passed out for a moment.", TALKTYPE_ORANGE_1)
                        setPlayerStorageValue(cid, mission.storages.succeed, 0)
                        doAddCondition(cid, condition)
                    end
                else
                    doCreatureSay(cid, "You already passed the test, no need to torture yourself anymore.", TALKTYPE_ORANGE_1)
                end
                setPlayerStorageValue(cid, mission.storages.sips, sips_left - 1)
            else
                if succeed >= mission.sips_to_complete then
                    doCreatureSay(cid, "You already passed the test, no need to torture yourself anymore.", TALKTYPE_ORANGE_1)
                else
                    doCreatureSay(cid, "You don\'t have enough tries to prove be a strong barbarian.", TALKTYPE_ORANGE_1)
                end
            end
        elseif getPlayerStorageValue(cid, BARBARIAN_TEST.storages.first_test) == 2 then
            doCreatureSay(cid, "You have already passed on this test.", TALKTYPE_ORANGE_1)
        end
    end
    return true
end

 

 

meadhorn.lua

Spoiler

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, BARBARIAN_TEST.storages.second_test) == 1 then
        if item.itemid == BARBARIAN_TEST.second_test.filled_meadhorn_id then
            if itemEx.itemid == BARBARIAN_TEST.second_test.lying_bear_id then
                doTransformItem(itemEx.uid, BARBARIAN_TEST.second_test.sleeping_bear_id)
                doTransformItem(item.uid, BARBARIAN_TEST.second_test.empty_meadhorn_id)
                setPlayerStorageValue(cid, BARBARIAN_TEST.storages.second_test, 2)
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Bearhugger!")
                addEvent(function()
                    local check_bear = getTileItemById(toPosition, BARBARIAN_TEST.second_test.sleeping_bear_id)
                    if check_bear.uid > 0 then
                        doTransformItem(check_bear.uid, BARBARIAN_TEST.second_test.lying_bear_id)
                    end
                end, 10 * 1000)
            end
        elseif item.itemid == BARBARIAN_TEST.second_test.empty_meadhorn_id then
            if itemEx.itemid == BARBARIAN_TEST.second_test.filled_bucket_id then
                doTransformItem(item.uid, BARBARIAN_TEST.second_test.filled_meadhorn_id)
                doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
            end
        end
    end
    return true
end

 

 

mammothpushing.lua

Spoiler

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, BARBARIAN_TEST.storages.third_test) == 1 then
        if getCreatureCondition(cid, CONDITION_DRUNK) then
            doCreatureSay(cid, "You hustle the mammoth. What a fun\n*hicks*", TALKTYPE_ORANGE_1)
            doTransformItem(item.uid, BARBARIAN_TEST.third_test.sleeping_mammoth_id)
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Honorary Barbarian")
            setPlayerStorageValue(cid, BARBARIAN_TEST.storages.third_test, 2)
            addEvent(function()
                local mammoth = getTileItemById(toPosition, BARBARIAN_TEST.third_test.sleeping_mammoth_id)
                if mammoth.uid > 0 then
                    doTransformItem(mammoth.uid, BARBARIAN_TEST.third_test.standing_mammoth_id)
                end
            end, 10 * 1000)
        else
            doCreatureSay(cid, "You are too sober to do this madness.", TALKTYPE_ORANGE_1)
        end
    end
    return true
end

 

 

Em data/actions.xml adicione as tags abaixo: (caso altere os ids dos itens para adaptar ao seu servidor, lembre de alterá-los nas tags também)

<action actionid="8952" script="barbarian_test/bucketmead.lua" />
<action itemid="7140;7141" script="barbarian_test/meadhorn.lua" />
<action itemid="7176" script="barbarian_test/mammothpushing.lua" />

Coloque o actionid 8952 (ou o valor que desejar, lembrando de modificar na tag no actions.xml) no balde de rum localizado próximo ao NPC.

 

G0wrddX.png

 

Lembre de colocar um NPC adicional ao lado do NPC Sven que venda "rum" para que o jogador possa ficar bêbado e realizar a última missão (missão do mammoth).

lnNeJcC.png   wx7GPLK.png  tblHYOV.png

 

OBS: Ao finalizar a quest, o jogador receberá a storage 87345 igual a 1. Essa informação pode ser útil para dar acesso a determinadas áreas somente após terminar a quest, por exemplo.

 

É isso. Espero que seja útil ao servidores que desejam ter um pouquinho mais de RPG. GRANDE ABRAÇO! ?

 

Esse script faz parte de um conjunto de quests do tibia global que pretendo ir fazendo aos poucos a depender do feedback do pessoal.

Veja também:

 

Contato:

 

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 Johncore
      Otg Server é um projeto fork do The Forgotten Server 1.3, feito por brasileiros que visam sempre por estabilidade, um código mais clean, temos no projeto várias Datapacks como
      Global 11.0, Global 8.6, Global 8.0, RadBR 11.0, Evolutions 11.0, Yurots Classic 11.0, nossa base também é excelente para rodar projetos que são mapa Baiak ou ATS Custom pelo baixissimo uso de cpu e fix do Decay de itens.

      Todos são bem vindos para colaborar com o projeto... que não visa nenhum lucro financeiro, queremos apenas colaborar com a comunidade OTSERV,
      temos ouvido de muitas pessoas que procuram uma base estável, limpa, esse é o nosso objetivo nesse projeto.
       
      Estamos a procura de programadores/dev/webmaster que queiram ajudar / que tenham tempo e serão recompensados por isso.
       
      Nossa Datapack principal Global 11.00 contem as seguintes features:
      CAST SYSTEM ✅
      AUTOLOOT ✅
      WINTER UPDATE 2023 ✅
      SUMMER UPDATE 2023 ✅
      ADDONS 13.22 UPDATE ✅
      MONTARIAS 13.22 UPDATE ✅
      ITEMS 13.22 UPDATE ✅
      DAILY REWARD ✅
      IMBUEMENTS ✅
      PREY ✅
      EXERCISE WEAPONS ✅
      HIRELINGS NPCS ✅
      ANTI ROLLBACK ✅
       
       
      Github Global 11x:  💾
      https://github.com/otg-br/global-11x
      Clients e outras ferramentas:  💾
      https://github.com/otg-br/tools
      Github Otg Gesior:  💾
      https://github.com/otg-br/gesior
      Github Otg Otclientv8:  💾
      https://github.com/otg-br/otclientv8
      Wiki Otg:  💾
      https://github.com/otg-br/global-11x/wiki
       
       
      Creditos:
      TFS Team Erick Nunes Gui Bruxo Worthdavi LuSKT Leo Pereira Luan Luciano Cjaker Comedinhas Nekiro OTG Colaborators
    • Por Kralifezik1
      sfddfg
    • Por Adriano SwaTT
      Procurei aqui pelo forum, e não achei um NPC de Bank que fosse tão perfeito como este que estou postando...
      Eu mesmo havia postado há alguns dias atrás um NPC de Bank, mas não é tão bom quanto este...

      Detalhes do NPC:
      Executa as funções como do Tibia Global.
      Deposit, Transfer, Withdraw, Change Gold, Change Platinum, Change Crystal...

      Funcionando perfeitamente...
      #Testado'

      Vamos ao que interessa.

      Crie um arquivo chamado "bank.xml" na pasta "data / npc"... Cole o código abaixo dentro do arquivo:
      <?xml version="1.0" encoding="UTF-8"?> <npc name="BankMan" script="data/npc/scripts/bank.lua" walkinterval="25" floorchange="0" access="5" > <health now="150" max="150"/> <look type="132" head="115" body="0" legs="114" feet="0" addons="3" corpse="2212"/> <parameters> <parameter key="message_greet" value="Welcome |PLAYERNAME|! Here, you can {deposit}, {withdraw} or {transfer} your money from your bank account. I can change your coins too."/> <parameter key="message_alreadyfocused" value="You are drunked ? I talk with you."/> <parameter key="message_farewell" value="Goodbye. I wanna see your money... oh you again."/> </parameters> </npc> Salve e feche o arquivo.

      Agora vá na pasta Scripts e crie um arquivo chamado "bank.lua" e cole o código abaixo dentro do mesmo:
       
      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 --------------------MESSAGES------------------------------------------------------------------------------ if msgcontains(msg, 'deposit') then selfSay('Please tell me how much gold it is you would like to deposit.', cid) talkState[talkUser] = 1 elseif msgcontains(msg, 'withdraw') then selfSay('Please tell me how much gold you would like to withdraw.', cid) talkState[talkUser] = 3 elseif msgcontains(msg, 'transfer') then selfSay('Please tell me the amount of gold coins you would like to transfer.', cid) talkState[talkUser] = 5 elseif msgcontains(msg, 'change gold') then selfSay('How many platinum coins do you want to get?', cid) talkState[talkUser] = 8 elseif msgcontains(msg, 'change platinum') then selfSay('Do you want to change your platinum coins to gold or crystal?', cid) talkState[talkUser] = 10 elseif msgcontains(msg, 'change crystal') then selfSay('How many crystal coins do you want to change to platinum?', cid) talkState[talkUser] = 15 elseif msgcontains(msg, 'balance') then n = getPlayerBalance(cid) selfSay('Your balance are '..n..' golds.', cid) talkState[talkUser] = 0 ----------------------DEPOSIT------------------------------------------------------- elseif talkState[talkUser] == 1 then if msgcontains(msg, 'all') then n = getPlayerMoney(cid) selfSay('Do you want deposit '..n..' golds ?', cid) talkState[talkUser] = 2 else n = getNumber(msg) selfSay('Do you want deposit '..n..' golds ?', cid) talkState[talkUser] = 2 end elseif talkState[talkUser] == 2 then if msgcontains(msg, 'yes') then if getPlayerMoney(cid) >= n then doPlayerDepositMoney(cid,n) selfSay('Sucessfull. Now your balance account is ' ..getPlayerBalance(cid)..' golds.', cid) talkState[talkUser] = 0 else selfSay('You don\'t have money.', cid) end else selfSay('Ok then', cid) end ----------------------WITHDRAW------------------------------------------------------------------------------------- elseif talkState[talkUser] == 3 then if msgcontains(msg, 'all') then n = getPlayerBalance(cid) selfSay('Do you want withdraw '..n..' golds ?', cid) talkState[talkUser] = 4 else n = getNumber(msg) selfSay('Do you want withdraw '..n..' golds ?', cid) talkState[talkUser] = 4 end elseif talkState[talkUser] == 4 then if msgcontains(msg, 'yes') then if getPlayerBalance(cid) >= n then doPlayerWithdrawMoney(cid, n) selfSay('Here you are, '..n..' gold. Now your balance account is ' ..getPlayerBalance(cid)..' golds.', cid) talkState[talkUser] = 0 else selfSay('There is not enough gold on your account', cid) end else selfSay('Ok then', cid) end ----------------------TRANSFER---------------------------------------------------------------------------------------- elseif talkState[talkUser] == 5 then if msgcontains(msg, 'all') then n = getPlayerBalance(cid) selfSay('Who would you like transfer '..n..' gold to?', cid) talkState[talkUser] = 6 else n = getNumber(msg) selfSay('Who would you like transfer '..n..' gold to?', cid) talkState[talkUser] = 6 end elseif talkState[talkUser] == 6 then p = msg selfSay('So you would like to transfer '..n..' gold to '..p..'?', cid) talkState[talkUser] = 7 elseif talkState[talkUser] == 7 then if msgcontains(msg, 'yes') then if getPlayerBalance(cid) >= n then if doPlayerTransferMoneyTo(cid, p, n) == TRUE then selfSay('You have transferred '..n..' gold to '..p..' and your account balance is '..getPlayerBalance(cid)..' golds.', cid) talkState[talkUser] = 0 else selfSay('This player does not exist. Please tell me a valid name!', cid) talkState[talkUser] = 0 end else selfSay('There is not enough gold on your account', cid) talkState[talkUser] = 0 end else selfSay('Ok then', cid) talkState[talkUser] = 0 end ----------------------CHANGE GOLD--------------------------------------------------------------------------------- elseif talkState[talkUser] == 8 then n = getNumber(msg) b = n * 100 selfSay('So I should change '..b..' of your gold coins to '..n..' platinum coins for you?', cid) talkState[talkUser] = 9 elseif talkState[talkUser] == 9 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2148, b) == TRUE then doPlayerAddItem(cid, 2152, n) talkState[talkUser] = 0 else selfSay('You don\'t have money.', cid) talkState[talkUser] = 0 end else selfSay('Ok. We cancel.', cid) talkState[talkUser] = 0 end ---------------------CHANGE PLATINUM------------------------------------------------------------------------- elseif talkState[talkUser] == 10 then if msgcontains(msg, 'gold') then selfSay('How many platinum coins do you want to change to gold?', cid) talkState[talkUser] = 11 elseif msgcontains(msg, 'crystal') then selfSay('How many crystal coins do you want to get?', cid) talkState[talkUser] = 13 end elseif talkState[talkUser] == 11 then n = getNumber(msg) b = n * 100 selfSay('So I should change '..n..' of your platinum coins to '..b..' gold coins for you?', cid) talkState[talkUser] = 12 elseif talkState[talkUser] == 12 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2152, n) == TRUE then doPlayerAddItem(cid, 2148, b) talkState[talkUser] = 0 else selfSay('You don\'t have money.', cid) talkState[talkUser] = 0 end else selfSay('Ok. We cancel.', cid) talkState[talkUser] = 0 end elseif talkState[talkUser] == 13 then n = getNumber(msg) b = n * 100 selfSay('So I should change '..b..' of your platinum coins to '..n..' crystal coins for you?', cid) talkState[talkUser] = 14 elseif talkState[talkUser] == 14 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2152, b) == TRUE then doPlayerAddItem(cid, 2160, n) talkState[talkUser] = 0 else selfSay('You don\'t have money.', cid) talkState[talkUser] = 0 end else selfSay('Ok. We cancel.', cid) talkState[talkUser] = 0 end ---------------------CHANGE CRYSTAL------------------------------------------------------------------------------- elseif talkState[talkUser] == 15 then n = getNumber(msg) b = n * 100 selfSay('So I should change '..n..' of your crystal coins to '..b..' platinum coins for you?', cid) talkState[talkUser] = 16 elseif talkState[talkUser] == 16 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2160, n) == TRUE then doPlayerAddItem(cid, 2152, b) talkState[talkUser] = 0 else selfSay('You don\'t have money.', cid) talkState[talkUser] = 0 end else selfSay('Ok. We cancel.', cid) talkState[talkUser] = 0 end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) -- function maded by Gesior-- function getNumber(txt) --return number if its number and is > 0, else return 0 x = string.gsub(txt,"%a","") x = tonumber(x) if x ~= nill and x > 0 then return x else return 0 end end  
       
       

      Salve o arquivo e feche-o.

      Agora seu NPC está pronto, basta adicioná-lo ao seu mapa usando o Map Editor.
      Espero que seja de utilidade de alguém...

      Créditos: Tibiaa4e (outro forum)
      Pequeno Tuto: Adriano Swatt
       
      Testado em:
      Versões do Client: 8.54 e 8.60.
      Versões da Distro: TFS 3.4.5, TFS 0.4 e Alissow 0.4.1.

      Espero que seja útil.


      Abraços'
    • Por Cat
      Pack disponibilizado por:

      Clique Aqui para entrar!
       
      Object Builder (Editor de dat e Sprites) para 10x.
      ObjectBuilder.rar
       
       
      Object Builder para 8.X (0.4.8) com Adobe AIR (13 MB).
      https://www.mediafire.com/file/dq994i3fia7fckk/ObjectBuilder_0_4_8.rar/file
      scan
       
       
      Tibia 12 SPR funciona com Object Builder 10.X (0.3.3)
      https://www.mediafire.com/file/fvuf28xh0zej859/Tibia_12_SPR.rar/file
       
       
      Assets Editor (12+ para pasta assets)
      https://github.com/Arch-Mina/Assets-Editor
       
      Como usar:
       
       
      Remere's Map Editor 3.7 + fixed brushes:
      https://github.com/hampusborgos/rme/releases
      RME_3.7_fixed_brushes.rar
       
      10.98 com sprites 12.70, OTB:
      https://github.com/EPuncker/1098extended
      10.98_12.70_sprites_OTB.rar
       
      10.98 com sprites 12.70 TIBIA KING OTBR
      10.98_12.70_sprites_OTBR.rar
       
      12.70 mounts and outfits
      12.70_mounts_and_outfits.rar
       
      Paleta com itens mágicos (v 12) 
      Disponibilizado por: Zbizu (Zbizu#7420)
      trickery_zbizu.xml
          
       
      Este pack utiliza recursos do projeto oficial TFS (The Forgotten Server), projetos paralelos como OtservBR, Object Builder, outros, e demais colaboradores.    
       
       
       
       
       
    • Por Cat
      Informações:
      Autor: Ralke (felipe23#1113)
      Créditos pela liberação do mapa: Mapping & Spriting Community. Clique Aqui para entrar!

       

      Essa cidade é pra quem gosta de acessos secretos, muitos andares com armadilhas e passagens que levam até vários locais de caça, é uma boa cidade pra usar como a principal em um servidor de Tibia, juntamente com salas de teleports e outros continentes complementando.
       
      Download: macalania.rar
       
      IMAGENS:

       

       

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo