• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

How to cancel Rashid missions?

d0gw4r

New Member
Joined
Jun 6, 2019
Messages
55
Solutions
1
Reaction score
4
Location
Brazil
Hello everyone,

I just want to know how I can make Rashid buy loots from everyone, without requiring to complete mission.

Now to my Rashid.lua:

My /data/npc/scripts/Rashid.lua directory:

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

local function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    local player = Player(cid)
    if(msgcontains(msg, "mission")) then
        if(os.date("%A") == "Monday") then
            if(player:getStorageValue(Storage.TravellingTrader.Mission01) < 1) then
                npcHandler:say("Well, you could attempt the mission to become a recognised trader, but it requires a lot of travelling. Are you willing to try?", cid)
                npcHandler.topic[cid] = 1
            elseif(player:getStorageValue(Storage.TravellingTrader.Mission01) == 1) then
                npcHandler:say("Have you managed to obtain a rare deer trophy for my customer?", cid)
                npcHandler.topic[cid] = 3
            end
        elseif(os.date("%A") == "Tuesday") then
            if(player:getStorageValue(Storage.TravellingTrader.Mission01) == 2 and player:getStorageValue(Storage.TravellingTrader.Mission02) < 1 ) then
                npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
                npcHandler.topic[cid] = 4
            elseif(player:getStorageValue(Storage.TravellingTrader.Mission02) == 4) then
                npcHandler:say("Did you bring me the package?", cid)
                npcHandler.topic[cid] = 6
            end
        elseif(os.date("%A") == "Wednesday") then
            if(player:getStorageValue(Storage.TravellingTrader.Mission02) == 5 and player:getStorageValue(Storage.TravellingTrader.Mission03) < 1 ) then
                npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
                npcHandler.topic[cid] = 7
            elseif(player:getStorageValue(Storage.TravellingTrader.Mission03) == 2) then
                npcHandler:say("Have you brought the cheese?", cid)
                npcHandler.topic[cid] = 9
            end
        elseif(os.date("%A") == "Thursday") then
            if(player:getStorageValue(Storage.TravellingTrader.Mission03) == 3 and player:getStorageValue(Storage.TravellingTrader.Mission04) < 1) then
                npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
                npcHandler.topic[cid] = 10
            elseif(player:getStorageValue(Storage.TravellingTrader.Mission04) == 2) then
                npcHandler:say("Have you brought the vase?", cid)
                npcHandler.topic[cid] = 12
            end
        elseif(os.date("%A") == "Friday") then
            if(player:getStorageValue(Storage.TravellingTrader.Mission04) == 3 and player:getStorageValue(Storage.TravellingTrader.Mission05) < 1) then
                npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
                npcHandler.topic[cid] = 13
            elseif(player:getStorageValue(Storage.TravellingTrader.Mission05) == 2) then
                npcHandler:say("Have you brought a cheap but good crimson sword?", cid)
                npcHandler.topic[cid] = 15
            end
        elseif(os.date("%A") == "Saturday") then
            if(player:getStorageValue(Storage.TravellingTrader.Mission05) == 3 and player:getStorageValue(Storage.TravellingTrader.Mission06) < 1) then
                npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
                npcHandler.topic[cid] = 16
            elseif(player:getStorageValue(Storage.TravellingTrader.Mission06) == 1) then
                npcHandler:say("Have you brought me a gold fish??", cid)
                npcHandler.topic[cid] = 18
            end
        elseif(os.date("%A") == "Sunday") then
            if(player:getStorageValue(Storage.TravellingTrader.Mission06) == 2 and player:getStorageValue(Storage.TravellingTrader.Mission07) ~= 1) then
                npcHandler:say("Ah, right. <ahem> I hereby declare you - one of my recognised traders! Feel free to offer me your wares!", cid)
                player:setStorageValue(Storage.TravellingTrader.Mission07, 1)
                player:addAchievement('Recognised Trader')
                npcHandler.topic[cid] = 0
            end
        end
    elseif(msgcontains(msg, "yes")) then
        if(npcHandler.topic[cid] == 1) then
            npcHandler:say({
                "Very good! I need talented people who are able to handle my wares with care, find good offers and the like, so I'm going to test you. ...",
                "First, I'd like to see if you can dig up rare wares. Something like a ... mastermind shield! ...",
                "Haha, just kidding, fooled you there, didn't I? Always control your nerves, that's quite important during bargaining. ...",
                "Okay, all I want from you is one of these rare deer trophies. I have a customer here in Svargrond who ordered one, so I'd like you to deliver it tome while I'm in Svargrond. ...",
                "Everything clear and understood?"
            }, cid)

            npcHandler.topic[cid] = 2
        elseif(npcHandler.topic[cid] == 2) then
            npcHandler:say("Fine. Then get a hold of that deer trophy and bring it to me while I'm in Svargrond. Just ask me about your mission.", cid)
            player:setStorageValue(Storage.TravellingTrader.Mission01, 1)
            npcHandler.topic[cid] = 0
        elseif(npcHandler.topic[cid] == 3) then
            if player:removeItem(7397, 1) then
                npcHandler:say("Well done! I'll take that from you. <snags it> Come see me another day, I'll be busy for a while now. ", cid)
                player:setStorageValue(Storage.TravellingTrader.Mission01, 2)
                npcHandler.topic[cid] = 0
            end
        elseif(npcHandler.topic[cid] == 4) then
            npcHandler:say({
                "Alright, that's good to hear. From you as my trader and deliveryman, I expect more than finding rare items. ...",
                "You also need to be able to transport heavy wares, weaklings won't get far here. I have ordered a special package from Edron. ...",
                "Pick it up from Willard and bring it back to me while I'm in Liberty Bay. Everything clear and understood?"
            }, cid)
            npcHandler.topic[cid] = 5
        elseif(npcHandler.topic[cid] == 5) then
            npcHandler:say("Fine. Then off you go, just ask Willard about the 'package for Rashid'.", cid)
            player:setStorageValue(Storage.TravellingTrader.Mission02, 1)
            npcHandler.topic[cid] = 0
        elseif(npcHandler.topic[cid] == 6) then
            if player:removeItem(7503, 1) then
                npcHandler:say("Great. Just place it over there - yes, thanks, that's it. Come see me another day, I'll be busy for a while now. ", cid)
                player:setStorageValue(Storage.TravellingTrader.Mission02, 5)
                npcHandler.topic[cid] = 0
            end
        elseif(npcHandler.topic[cid] == 7) then
            npcHandler:say({
                "Well, that's good to hear. From you as my trader and deliveryman, I expect more than carrying heavy packages. ...",
                "You also need to be fast and deliver wares in time. I have ordered a very special cheese wheel made from Darashian milk. ...",
                "Unfortunately, the high temperature in the desert makes it rot really fast, so it must not stay in the sun for too long. ...",
                "I'm also afraid that you might not be able to use ships because of the smell of the cheese. ...",
                "Please get the cheese from Miraia and bring it to me while I'm in Port Hope. Everything clear and understood?"
            }, cid)
            npcHandler.topic[cid] = 8
        elseif(npcHandler.topic[cid] == 8) then
            npcHandler:say("Okay, then please find Miraia in Darashia and ask her about the {'scarab cheese'}.", cid)
            player:setStorageValue(Storage.TravellingTrader.Mission03, 1)
            npcHandler.topic[cid] = 0
        elseif(npcHandler.topic[cid] == 9) then
            if player:removeItem(8112, 1) then
                npcHandler:say("Mmmhh, the lovely odeur of scarab cheese! I really can't understand why most people can't stand it. Thanks, well done! ", cid)
                player:setStorageValue(Storage.TravellingTrader.Mission03, 3)
                npcHandler.topic[cid] = 0
            end
        elseif(npcHandler.topic[cid] == 10) then
            npcHandler:say({
                "Well, that's good to hear. From you as my trader and deliveryman, I expect more than bringing stinky cheese. ...",
                "I wonder if you are able to deliver goods so fragile they almost break when looked at. ...",
                "I have ordered a special elven vase from Briasol in Ab'Dendriel. Get it from him and don't even touch it, just bring it to me while I'm in Ankrahmun. Everything clear and understood?"
            }, cid)
            npcHandler.topic[cid] = 11
        elseif(npcHandler.topic[cid] == 11) then
            npcHandler:say("Okay, then please find {Briasol} in {Ab'Dendriel} and ask for a {'fine vase'}.", cid)
            player:setStorageValue(Storage.TravellingTrader.Mission04, 1)
            player:addMoney(1000)
            npcHandler.topic[cid] = 0
        elseif(npcHandler.topic[cid] == 12) then
            if player:removeItem(7582, 1) then
                npcHandler:say("I'm surprised that you managed to bring this vase without a single crack. That was what I needed to know, thank you. ", cid)
                player:setStorageValue(Storage.TravellingTrader.Mission04, 3)
                npcHandler.topic[cid] = 0
            end
        elseif(npcHandler.topic[cid] == 13) then
            npcHandler:say({
                "Fine! There's one more skill that I need to test and which is cruicial for a successful trader. ...",
                "Of course you must be able to haggle, else you won't survive long in this business. To make things as hard as possible for you, I have the perfect trade partner for you. ...",
                "Dwarves are said to be the most stubborn of all traders. Travel to {Kazordoon} and try to get the smith {Uzgod} to sell a {crimson sword} to you. ...",
                "Of course, it has to be cheap. Don't come back with anything more expensive than 400 gold. ...",
                "And the quality must not suffer, of course! Everything clear and understood?",
                "Dwarves are said to be the most stubborn of all traders. Travel to Kazordoon and try to get the smith Uzgod to sell a crimson sword to you. ..."
            }, cid)
            npcHandler.topic[cid] = 14
        elseif(npcHandler.topic[cid] == 14) then
            npcHandler:say("Okay, I'm curious how you will do with {Uzgod}. Good luck!", cid)
            player:setStorageValue(Storage.TravellingTrader.Mission05, 1)
            npcHandler.topic[cid] = 0
        elseif(npcHandler.topic[cid] == 15) then
            if player:removeItem(7385, 1) then
                npcHandler:say("Ha! You are clever indeed, well done! I'll take this from you. Come see me tomorrow, I think we two might get into business after all.", cid)
                player:setStorageValue(Storage.TravellingTrader.Mission05, 3)
                npcHandler.topic[cid] = 0
            end
        elseif(npcHandler.topic[cid] == 16) then
            npcHandler:say({
                "My friend, it seems you have already learnt a lot about the art of trading. I think you are more than worthy to become a recognised trader. ...",
                "There is just one little favour that I would ask from you... something personal, actually, forgive my boldness. ...",
                "I have always dreamed to have a small pet, one that I could take with me and which wouldn't cause problems. ...",
                "Could you - just maybe - bring me a small goldfish in a bowl? I know that you would be able to get one, wouldn't you?"
            }, cid)
            npcHandler.topic[cid] = 17
        elseif(npcHandler.topic[cid] == 17) then
            npcHandler:say("Thanks so much! I'll be waiting eagerly for your return then.", cid)
            player:setStorageValue(Storage.TravellingTrader.Mission06, 1)
            npcHandler.topic[cid] = 0
        elseif(npcHandler.topic[cid] == 18) then
            if player:removeItem(5929, 1) then
                npcHandler:say("Thank you!! Ah, this makes my day! I'll take the rest of the day off to get to know this little guy. Come see me tomorrow, if you like.", cid)
                player:setStorageValue(Storage.TravellingTrader.Mission06, 2)
                npcHandler.topic[cid] = 0
            end
        end
    end
    return true
end

keywordHandler:addKeyword({"job"}, StdModule.say, {npcHandler = npcHandler, text = "I am a travelling trader. I don't buy everything, though. And not from everyone, for that matter."})
keywordHandler:addKeyword({"name"}, StdModule.say, {npcHandler = npcHandler, text = "I am Rashid, son of the desert."})
keywordHandler:addKeyword({"offers"}, StdModule.say, {npcHandler = npcHandler, text = "Of course, old friend. You can also browse only armor, legs, shields, helmets, boots, weapons, enchanted weapons, jewelry or miscellaneous stuff."})
keywordHandler:addKeyword({"ab'dendriel"}, StdModule.say, {npcHandler = npcHandler, text = "Elves... I don't really trust them. All this talk about nature and flowers and treehugging... I'm sure there's some wicked scheme behind all this."})
keywordHandler:addKeyword({"desert"}, StdModule.say, {npcHandler = npcHandler, text = "My beloved hometown! Ah, the sweet scent of the desert sands, the perfect shape of the pyramids... stunningly beautiful."})
keywordHandler:addKeyword({"carlin"}, StdModule.say, {npcHandler = npcHandler, text = "I have to go to Carlin once in a while, since the queen wishes to see my exclusive wares in regular intervals."})
keywordHandler:addKeyword({"cormaya"}, StdModule.say, {npcHandler = npcHandler, text = "Cormaya? Not a good place to make business, it's way too far and small."})
keywordHandler:addKeyword({"darashia"}, StdModule.say, {npcHandler = npcHandler, text = "It's not the real thing, but almost as good. The merchants there claim ridiculous prices, which is fine for my own business."})
keywordHandler:addKeyword({"edron"}, StdModule.say, {npcHandler = npcHandler, text = "Ah yes, Edron! Such a lovely and quiet island! I usually make some nice business there."})
keywordHandler:addKeyword({"fibula"}, StdModule.say, {npcHandler = npcHandler, text = "Too few customers there, it's not worth the trip."})
keywordHandler:addKeyword({"greenshore"}, StdModule.say, {npcHandler = npcHandler, text = "Um... I don't think so."})
keywordHandler:addKeyword({"kazordoon"}, StdModule.say, {npcHandler = npcHandler, text = "I don't like being underground much. I also tend to get lost in these labyrinthine dwarven tunnels, so I rather avoid them."})
keywordHandler:addKeyword({"liberty bay"}, StdModule.say, {npcHandler = npcHandler, text = "When you avoid the slums, it's a really pretty city. Almost as pretty as the governor's daughter."})
keywordHandler:addKeyword({"northport"}, StdModule.say, {npcHandler = npcHandler, text = "Um... I don't think so."})
keywordHandler:addKeyword({"port hope"}, StdModule.say, {npcHandler = npcHandler, text = "I like the settlement itself, but I don't set my foot into the jungle. Have you seen the size of these centipedes??"})
keywordHandler:addKeyword({"senja"}, StdModule.say, {npcHandler = npcHandler, text = "Um... I don't think so."})
keywordHandler:addKeyword({"svargrond"}, StdModule.say, {npcHandler = npcHandler, text = "I wish it was a little bit warmer there, but with a good mug of barbarian mead in your tummy everything gets a lot cosier."})
keywordHandler:addKeyword({"thais"}, StdModule.say, {npcHandler = npcHandler, text = "I feel uncomfortable and rather unsafe in Thais, so I don't really travel there."})
keywordHandler:addKeyword({"vega"}, StdModule.say, {npcHandler = npcHandler, text = "Um... I don't think so."})
keywordHandler:addKeyword({"venore"}, StdModule.say, {npcHandler = npcHandler, text = "Although it's the flourishing trade centre of Tibia, I don't like going there. Too much competition for my taste."})
keywordHandler:addKeyword({"time"}, StdModule.say, {npcHandler = npcHandler, text = "It's almost time to journey on."})
keywordHandler:addKeyword({"king"}, StdModule.say, {npcHandler = npcHandler, text = "Kings, queens, emperors and kaliphs... everyone claims to be different and unique, but actually it's the same thing everywhere."})

npcHandler:setMessage(MESSAGE_GREET, "Ah, a customer! Be greeted, |PLAYERNAME|!")
npcHandler:setMessage(MESSAGE_FAREWELL, "Farewell, |PLAYERNAME|, may the winds guide your way.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Come back soon!")
npcHandler:setMessage(MESSAGE_SENDTRADE, "Take all the time you need to decide what you want!")

local function onTradeRequest(cid)
    if Player(cid):getStorageValue(Storage.TravellingTrader.Mission07) ~= 1 then
        npcHandler:say('Sorry, but you do not belong to my exclusive customers. I have to make sure that I can trust in the quality of your wares.', cid)
        return false
    end

    return true
end

npcHandler:setCallback(CALLBACK_ONTRADEREQUEST, onTradeRequest)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())


Thank you!
 
Sorry, but i couldn't write it on the previous post...
Now my /data/npc/Rashid.lua

Lua:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Rashid" script="Rashid.lua" walkinterval="2000" floorchange="0" walkradius="3">
    <health now="100" max="100" />
    <look type="146" head="100" body="100" legs="119" feet="115" addons="2" />
    <parameters>
        <parameter key="module_shop" value="1" />
        <parameter key="shop_sellable" value="
            abyss hammer, 7414, 20000;
            albino plate, 21692, 1500;
            amber staff, 7426, 8000;
            ancient amulet, 2142, 200;
            assassin dagger, 7404, 20000;
            bandana, 5917, 150;
            beastslayer axe, 3962, 1500;
            beetle necklace, 11374, 1500;
            berserker, 7403, 40000;
            blacksteel sword, 7406, 6000;
            blessed sceptre, 7429, 40000;
            bone shield, 2541, 80;
            bonelord helmet, 3972, 7500;
            brutetamer's staff, 7379, 1500;
            buckle, 20109, 7000;
            castle shield, 2535, 5000;
            chain bolter, 8850, 40000;
            chaos mace, 7427, 9000;
            cobra crown, 12630, 50000;
            coconut shoes, 9931, 500;
            composite hornbow, 8855, 25000;
            cranial basher, 7415, 30000;
            crocodile boots, 3982, 1000;
            crystal crossbow, 18453, 35000;
            crystal mace, 2445, 12000;
            crystal necklace, 2125, 400;
            crystal ring, 6093, 250;
            crystal sword, 7449, 600;
            crystalline armor, 8878, 16000;
            daramian mace, 2439, 110;
            daramian waraxe, 2440, 1000;
            dark shield, 2521, 400;
            death ring, 6300, 1000;
            demon shield, 2520, 30000;
            demonbone amulet, 14333, 32000;
            demonrage sword, 7382, 36000;
            devil helmet, 2462, 1000;
            diamond sceptre, 7387, 3000;
            divine plate, 8885, 55000;
            djinn blade, 2451, 15000;
            doll, 2110, 200;
            dragon scale mail, 2492, 40000;
            dragon slayer, 7402, 15000;
            dragonbone staff, 7430, 3000;
            dreaded cleaver, 7419, 10000;
            dwarven armor, 2503, 30000;
            earth blacksteel sword, 7857, 6000;
            earth cranial basher, 7866, 30000;
            earth crystal mace, 7865, 12000;
            earth dragon slayer, 7858, 15000;
            earth headchopper, 7862, 6000;
            earth heroic axe, 7861, 30000;
            earth mystic blade, 7856, 30000;
            earth orcish maul, 7867, 6000;
            earth relic sword, 7855, 25000;
            earth war axe, 7863, 12000;
            elvish bow, 7438, 2000;
            emerald bangle, 2127, 800;
            energy blacksteel sword, 7872, 6000;
            energy cranial basher, 7881, 30000;
            energy crystal mace, 7880, 12000;
            energy dragon slayer, 7873, 15000;
            energy headchopper, 7877, 6000;
            energy heroic axe, 7876, 30000;
            energy mystic blade, 7871, 30000;
            energy orcish maul, 7882, 6000;
            energy relic sword, 7870, 25000;
            energy war axe, 7878, 12000;
            epee, 2438, 8000;
            fiery blacksteel sword, 7747, 6000;
            fiery cranial basher, 7756, 30000;
            fiery crystal mace, 7755, 12000;
            fiery dragon slayer, 7748, 15000;
            fiery headchopper, 7752, 6000;
            fiery heroic axe, 7751, 30000;
            fiery mystic blade, 7746, 30000;
            fiery orcish maul, 7757, 6000;
            fiery relic sword, 7745, 25000;
            fiery war axe, 7753, 12000;
            flower dress, 9929, 1000;
            flower wreath, 9927, 500;
            fur boots, 7457, 2000;
            furry club, 7432, 1000;
            glacier amulet, 7888, 1500;
            glacier kilt, 7896, 11000;
            glacier mask, 7902, 2500;
            glacier robe, 7897, 11000;
            glacier shoes, 7892, 2500;
            gold ring, 2179, 8000;
            golden armor, 2466, 20000;
            golden legs, 2470, 30000;
            goo shell, 21706, 4000;
            griffin shield, 2533, 3000;
            guardian halberd, 2427, 11000;
            hammer of wrath, 2444, 30000;
            headchopper, 7380, 6000;
            heavy mace, 2452, 50000;
            heavy machete, 2442, 90;
            heavy trident, 13838, 2000;
            helmet of the lost, 20132, 2000;
            heroic axe, 7389, 30000;
            hibiscus dress, 8873, 3000;
            hieroglyph banner, 13739, 500;
            horn (ring), 21693, 300;
            icy blacksteel sword, 7766, 6000;
            icy cranial basher, 7775, 30000;
            icy crystal mace, 7774, 12000;
            icy dragon slayer, 7767, 15000;
            icy headchopper, 7771, 6000;
            icy heroic axe, 7770, 30000;
            icy mystic blade, 7765, 30000;
            icy orcish maul, 7776, 6000;
            icy relic sword, 7764, 25000;
            icy war axe, 7772, 12000;
            jade hammer, 7422, 25000;
            krimhorn helmet, 7461, 200;
            lavos armor, 8877, 16000;
            leaf legs, 9928, 500;
            leopard armor, 3968, 1000;
            leviathan's amulet, 10220, 3000;
            light shovel, 5710, 300;
            lightning boots, 7893, 2500;
            lightning headband, 7901, 2500;
            lightning legs, 7895, 11000;
            lightning pendant, 7889, 1500;
            lightning robe, 7898, 11000;
            lunar staff, 7424, 5000;
            magic plate armor, 2472, 90000;
            magma amulet, 7890, 1500;
            magma boots, 7891, 2500;
            magma coat, 7899, 11000;
            magma legs, 7894, 11000;
            magma monocle, 7900, 2500;
            mammoth fur cape, 7463, 6000;
            mammoth fur shorts, 7464, 850;
            mammoth whopper, 7381, 300;
            mastermind shield, 2514, 50000;
            medusa shield, 2536, 9000;
            mercenary sword, 7386, 12000;
            model ship, 2113, 1000;
            mycological bow, 18454, 35000;
            mystic blade, 7384, 30000;
            naginata, 2426, 2000;
            nightmare blade, 7418, 35000;
            noble axe, 7456, 10000;
            norse shield, 7460, 1500;
            onyx pendant, 24851, 3500;
            orcish maul, 7392, 6000;
            oriental shoes, 24637, 15000;
            pair of iron fists, 20108, 4000;
            paladin armor, 8891, 15000;
            patched boots, 2641, 2000;
            pharaoh banner, 13472, 1000;
            pharaoh sword, 2446, 23000;
            pirate boots, 5462, 3000;
            pirate hat, 6096, 1000;
            pirate knee breeches, 5918, 200;
            pirate shirt, 6095, 500;
            pirate voodoo doll, 5810, 500;
            platinum amulet, 2171, 2500;
            ragnir helmet, 7462, 400;
            relic sword, 7745, 25000;
            rift bow, 25522, 45000;
            rift crossbow, 25523, 45000;
            rift lance, 25383, 30000;
            rift shield, 25382, 50000;
            ring of the sky, 2123, 30000;
            royal axe, 7434, 40000;
            ruby necklace, 2133, 2000;
            ruthless axe, 6553, 45000;
            sacred tree amulet, 10219, 3000;
            sapphire hammer, 7437, 7000;
            scarab amulet, 2135, 200;
            scarab shield, 2540, 2000;
            shockwave amulet, 10221, 3000;
            silver brooch, 2134, 150;
            silver dagger, 2402, 500;
            skull helmet, 5741, 40000;
            skullcracker armor, 8889, 18000;
            spiked squelcher, 7452, 5000;
            steel boots, 2645, 30000;
            swamplair armor, 8880, 16000;
            taurus mace, 7425, 500;
            tempest shield, 2542, 35000;
            terra amulet, 7887, 1500;
            terra boots, 7886, 2500;
            terra hood, 7903, 2500;
            terra legs, 7885, 11000;
            terra mantle, 7884, 11000;
            the justice seeker, 7390, 40000;
            tortoise shield, 6131, 150;
            vile axe, 7388, 30000;
            voodoo doll, 3955, 400;
            war axe, 2454, 12000 " />
    </parameters>
</npc>
 
Hello,
In you login.lua, in first login part add this:
Lua:
player:setStorageValue(Storage.TravellingTrader.Mission07, 1)
And change you rashid.lua to:

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

local function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    local player = Player(cid)
    if(msgcontains(msg, "mission")) and player:getStorageValue(Storage.TravellingTrader.Mission07) ~= 1 then
        if(os.date("%A") == "Monday") then
            if(player:getStorageValue(Storage.TravellingTrader.Mission01) < 1) then
                npcHandler:say("Well, you could attempt the mission to become a recognised trader, but it requires a lot of travelling. Are you willing to try?", cid)
                npcHandler.topic[cid] = 1
            elseif(player:getStorageValue(Storage.TravellingTrader.Mission01) == 1) then
                npcHandler:say("Have you managed to obtain a rare deer trophy for my customer?", cid)
                npcHandler.topic[cid] = 3
            end
        elseif(os.date("%A") == "Tuesday") then
            if(player:getStorageValue(Storage.TravellingTrader.Mission01) == 2 and player:getStorageValue(Storage.TravellingTrader.Mission02) < 1 ) then
                npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
                npcHandler.topic[cid] = 4
            elseif(player:getStorageValue(Storage.TravellingTrader.Mission02) == 4) then
                npcHandler:say("Did you bring me the package?", cid)
                npcHandler.topic[cid] = 6
            end
        elseif(os.date("%A") == "Wednesday") then
            if(player:getStorageValue(Storage.TravellingTrader.Mission02) == 5 and player:getStorageValue(Storage.TravellingTrader.Mission03) < 1 ) then
                npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
                npcHandler.topic[cid] = 7
            elseif(player:getStorageValue(Storage.TravellingTrader.Mission03) == 2) then
                npcHandler:say("Have you brought the cheese?", cid)
                npcHandler.topic[cid] = 9
            end
        elseif(os.date("%A") == "Thursday") then
            if(player:getStorageValue(Storage.TravellingTrader.Mission03) == 3 and player:getStorageValue(Storage.TravellingTrader.Mission04) < 1) then
                npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
                npcHandler.topic[cid] = 10
            elseif(player:getStorageValue(Storage.TravellingTrader.Mission04) == 2) then
                npcHandler:say("Have you brought the vase?", cid)
                npcHandler.topic[cid] = 12
            end
        elseif(os.date("%A") == "Friday") then
            if(player:getStorageValue(Storage.TravellingTrader.Mission04) == 3 and player:getStorageValue(Storage.TravellingTrader.Mission05) < 1) then
                npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
                npcHandler.topic[cid] = 13
            elseif(player:getStorageValue(Storage.TravellingTrader.Mission05) == 2) then
                npcHandler:say("Have you brought a cheap but good crimson sword?", cid)
                npcHandler.topic[cid] = 15
            end
        elseif(os.date("%A") == "Saturday") then
            if(player:getStorageValue(Storage.TravellingTrader.Mission05) == 3 and player:getStorageValue(Storage.TravellingTrader.Mission06) < 1) then
                npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
                npcHandler.topic[cid] = 16
            elseif(player:getStorageValue(Storage.TravellingTrader.Mission06) == 1) then
                npcHandler:say("Have you brought me a gold fish??", cid)
                npcHandler.topic[cid] = 18
            end
        elseif(os.date("%A") == "Sunday") then
            if(player:getStorageValue(Storage.TravellingTrader.Mission06) == 2 and player:getStorageValue(Storage.TravellingTrader.Mission07) ~= 1) then
                npcHandler:say("Ah, right. <ahem> I hereby declare you - one of my recognised traders! Feel free to offer me your wares!", cid)
                player:setStorageValue(Storage.TravellingTrader.Mission07, 1)
                player:addAchievement('Recognised Trader')
                npcHandler.topic[cid] = 0
            end
        end
    elseif(msgcontains(msg, "yes")) then
        if(npcHandler.topic[cid] == 1) then
            npcHandler:say({
                "Very good! I need talented people who are able to handle my wares with care, find good offers and the like, so I'm going to test you. ...",
                "First, I'd like to see if you can dig up rare wares. Something like a ... mastermind shield! ...",
                "Haha, just kidding, fooled you there, didn't I? Always control your nerves, that's quite important during bargaining. ...",
                "Okay, all I want from you is one of these rare deer trophies. I have a customer here in Svargrond who ordered one, so I'd like you to deliver it tome while I'm in Svargrond. ...",
                "Everything clear and understood?"
            }, cid)

            npcHandler.topic[cid] = 2
        elseif(npcHandler.topic[cid] == 2) then
            npcHandler:say("Fine. Then get a hold of that deer trophy and bring it to me while I'm in Svargrond. Just ask me about your mission.", cid)
            player:setStorageValue(Storage.TravellingTrader.Mission01, 1)
            npcHandler.topic[cid] = 0
        elseif(npcHandler.topic[cid] == 3) then
            if player:removeItem(7397, 1) then
                npcHandler:say("Well done! I'll take that from you. <snags it> Come see me another day, I'll be busy for a while now. ", cid)
                player:setStorageValue(Storage.TravellingTrader.Mission01, 2)
                npcHandler.topic[cid] = 0
            end
        elseif(npcHandler.topic[cid] == 4) then
            npcHandler:say({
                "Alright, that's good to hear. From you as my trader and deliveryman, I expect more than finding rare items. ...",
                "You also need to be able to transport heavy wares, weaklings won't get far here. I have ordered a special package from Edron. ...",
                "Pick it up from Willard and bring it back to me while I'm in Liberty Bay. Everything clear and understood?"
            }, cid)
            npcHandler.topic[cid] = 5
        elseif(npcHandler.topic[cid] == 5) then
            npcHandler:say("Fine. Then off you go, just ask Willard about the 'package for Rashid'.", cid)
            player:setStorageValue(Storage.TravellingTrader.Mission02, 1)
            npcHandler.topic[cid] = 0
        elseif(npcHandler.topic[cid] == 6) then
            if player:removeItem(7503, 1) then
                npcHandler:say("Great. Just place it over there - yes, thanks, that's it. Come see me another day, I'll be busy for a while now. ", cid)
                player:setStorageValue(Storage.TravellingTrader.Mission02, 5)
                npcHandler.topic[cid] = 0
            end
        elseif(npcHandler.topic[cid] == 7) then
            npcHandler:say({
                "Well, that's good to hear. From you as my trader and deliveryman, I expect more than carrying heavy packages. ...",
                "You also need to be fast and deliver wares in time. I have ordered a very special cheese wheel made from Darashian milk. ...",
                "Unfortunately, the high temperature in the desert makes it rot really fast, so it must not stay in the sun for too long. ...",
                "I'm also afraid that you might not be able to use ships because of the smell of the cheese. ...",
                "Please get the cheese from Miraia and bring it to me while I'm in Port Hope. Everything clear and understood?"
            }, cid)
            npcHandler.topic[cid] = 8
        elseif(npcHandler.topic[cid] == 8) then
            npcHandler:say("Okay, then please find Miraia in Darashia and ask her about the {'scarab cheese'}.", cid)
            player:setStorageValue(Storage.TravellingTrader.Mission03, 1)
            npcHandler.topic[cid] = 0
        elseif(npcHandler.topic[cid] == 9) then
            if player:removeItem(8112, 1) then
                npcHandler:say("Mmmhh, the lovely odeur of scarab cheese! I really can't understand why most people can't stand it. Thanks, well done! ", cid)
                player:setStorageValue(Storage.TravellingTrader.Mission03, 3)
                npcHandler.topic[cid] = 0
            end
        elseif(npcHandler.topic[cid] == 10) then
            npcHandler:say({
                "Well, that's good to hear. From you as my trader and deliveryman, I expect more than bringing stinky cheese. ...",
                "I wonder if you are able to deliver goods so fragile they almost break when looked at. ...",
                "I have ordered a special elven vase from Briasol in Ab'Dendriel. Get it from him and don't even touch it, just bring it to me while I'm in Ankrahmun. Everything clear and understood?"
            }, cid)
            npcHandler.topic[cid] = 11
        elseif(npcHandler.topic[cid] == 11) then
            npcHandler:say("Okay, then please find {Briasol} in {Ab'Dendriel} and ask for a {'fine vase'}.", cid)
            player:setStorageValue(Storage.TravellingTrader.Mission04, 1)
            player:addMoney(1000)
            npcHandler.topic[cid] = 0
        elseif(npcHandler.topic[cid] == 12) then
            if player:removeItem(7582, 1) then
                npcHandler:say("I'm surprised that you managed to bring this vase without a single crack. That was what I needed to know, thank you. ", cid)
                player:setStorageValue(Storage.TravellingTrader.Mission04, 3)
                npcHandler.topic[cid] = 0
            end
        elseif(npcHandler.topic[cid] == 13) then
            npcHandler:say({
                "Fine! There's one more skill that I need to test and which is cruicial for a successful trader. ...",
                "Of course you must be able to haggle, else you won't survive long in this business. To make things as hard as possible for you, I have the perfect trade partner for you. ...",
                "Dwarves are said to be the most stubborn of all traders. Travel to {Kazordoon} and try to get the smith {Uzgod} to sell a {crimson sword} to you. ...",
                "Of course, it has to be cheap. Don't come back with anything more expensive than 400 gold. ...",
                "And the quality must not suffer, of course! Everything clear and understood?",
                "Dwarves are said to be the most stubborn of all traders. Travel to Kazordoon and try to get the smith Uzgod to sell a crimson sword to you. ..."
            }, cid)
            npcHandler.topic[cid] = 14
        elseif(npcHandler.topic[cid] == 14) then
            npcHandler:say("Okay, I'm curious how you will do with {Uzgod}. Good luck!", cid)
            player:setStorageValue(Storage.TravellingTrader.Mission05, 1)
            npcHandler.topic[cid] = 0
        elseif(npcHandler.topic[cid] == 15) then
            if player:removeItem(7385, 1) then
                npcHandler:say("Ha! You are clever indeed, well done! I'll take this from you. Come see me tomorrow, I think we two might get into business after all.", cid)
                player:setStorageValue(Storage.TravellingTrader.Mission05, 3)
                npcHandler.topic[cid] = 0
            end
        elseif(npcHandler.topic[cid] == 16) then
            npcHandler:say({
                "My friend, it seems you have already learnt a lot about the art of trading. I think you are more than worthy to become a recognised trader. ...",
                "There is just one little favour that I would ask from you... something personal, actually, forgive my boldness. ...",
                "I have always dreamed to have a small pet, one that I could take with me and which wouldn't cause problems. ...",
                "Could you - just maybe - bring me a small goldfish in a bowl? I know that you would be able to get one, wouldn't you?"
            }, cid)
            npcHandler.topic[cid] = 17
        elseif(npcHandler.topic[cid] == 17) then
            npcHandler:say("Thanks so much! I'll be waiting eagerly for your return then.", cid)
            player:setStorageValue(Storage.TravellingTrader.Mission06, 1)
            npcHandler.topic[cid] = 0
        elseif(npcHandler.topic[cid] == 18) then
            if player:removeItem(5929, 1) then
                npcHandler:say("Thank you!! Ah, this makes my day! I'll take the rest of the day off to get to know this little guy. Come see me tomorrow, if you like.", cid)
                player:setStorageValue(Storage.TravellingTrader.Mission06, 2)
                npcHandler.topic[cid] = 0
            end
        end
    end
    return true
end

keywordHandler:addKeyword({"job"}, StdModule.say, {npcHandler = npcHandler, text = "I am a travelling trader. I don't buy everything, though. And not from everyone, for that matter."})
keywordHandler:addKeyword({"name"}, StdModule.say, {npcHandler = npcHandler, text = "I am Rashid, son of the desert."})
keywordHandler:addKeyword({"offers"}, StdModule.say, {npcHandler = npcHandler, text = "Of course, old friend. You can also browse only armor, legs, shields, helmets, boots, weapons, enchanted weapons, jewelry or miscellaneous stuff."})
keywordHandler:addKeyword({"ab'dendriel"}, StdModule.say, {npcHandler = npcHandler, text = "Elves... I don't really trust them. All this talk about nature and flowers and treehugging... I'm sure there's some wicked scheme behind all this."})
keywordHandler:addKeyword({"desert"}, StdModule.say, {npcHandler = npcHandler, text = "My beloved hometown! Ah, the sweet scent of the desert sands, the perfect shape of the pyramids... stunningly beautiful."})
keywordHandler:addKeyword({"carlin"}, StdModule.say, {npcHandler = npcHandler, text = "I have to go to Carlin once in a while, since the queen wishes to see my exclusive wares in regular intervals."})
keywordHandler:addKeyword({"cormaya"}, StdModule.say, {npcHandler = npcHandler, text = "Cormaya? Not a good place to make business, it's way too far and small."})
keywordHandler:addKeyword({"darashia"}, StdModule.say, {npcHandler = npcHandler, text = "It's not the real thing, but almost as good. The merchants there claim ridiculous prices, which is fine for my own business."})
keywordHandler:addKeyword({"edron"}, StdModule.say, {npcHandler = npcHandler, text = "Ah yes, Edron! Such a lovely and quiet island! I usually make some nice business there."})
keywordHandler:addKeyword({"fibula"}, StdModule.say, {npcHandler = npcHandler, text = "Too few customers there, it's not worth the trip."})
keywordHandler:addKeyword({"greenshore"}, StdModule.say, {npcHandler = npcHandler, text = "Um... I don't think so."})
keywordHandler:addKeyword({"kazordoon"}, StdModule.say, {npcHandler = npcHandler, text = "I don't like being underground much. I also tend to get lost in these labyrinthine dwarven tunnels, so I rather avoid them."})
keywordHandler:addKeyword({"liberty bay"}, StdModule.say, {npcHandler = npcHandler, text = "When you avoid the slums, it's a really pretty city. Almost as pretty as the governor's daughter."})
keywordHandler:addKeyword({"northport"}, StdModule.say, {npcHandler = npcHandler, text = "Um... I don't think so."})
keywordHandler:addKeyword({"port hope"}, StdModule.say, {npcHandler = npcHandler, text = "I like the settlement itself, but I don't set my foot into the jungle. Have you seen the size of these centipedes??"})
keywordHandler:addKeyword({"senja"}, StdModule.say, {npcHandler = npcHandler, text = "Um... I don't think so."})
keywordHandler:addKeyword({"svargrond"}, StdModule.say, {npcHandler = npcHandler, text = "I wish it was a little bit warmer there, but with a good mug of barbarian mead in your tummy everything gets a lot cosier."})
keywordHandler:addKeyword({"thais"}, StdModule.say, {npcHandler = npcHandler, text = "I feel uncomfortable and rather unsafe in Thais, so I don't really travel there."})
keywordHandler:addKeyword({"vega"}, StdModule.say, {npcHandler = npcHandler, text = "Um... I don't think so."})
keywordHandler:addKeyword({"venore"}, StdModule.say, {npcHandler = npcHandler, text = "Although it's the flourishing trade centre of Tibia, I don't like going there. Too much competition for my taste."})
keywordHandler:addKeyword({"time"}, StdModule.say, {npcHandler = npcHandler, text = "It's almost time to journey on."})
keywordHandler:addKeyword({"king"}, StdModule.say, {npcHandler = npcHandler, text = "Kings, queens, emperors and kaliphs... everyone claims to be different and unique, but actually it's the same thing everywhere."})

npcHandler:setMessage(MESSAGE_GREET, "Ah, a customer! Be greeted, |PLAYERNAME|!")
npcHandler:setMessage(MESSAGE_FAREWELL, "Farewell, |PLAYERNAME|, may the winds guide your way.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Come back soon!")
npcHandler:setMessage(MESSAGE_SENDTRADE, "Take all the time you need to decide what you want!")

local function onTradeRequest(cid)
    if Player(cid):getStorageValue(Storage.TravellingTrader.Mission07) ~= 1 then
        npcHandler:say('Sorry, but you do not belong to my exclusive customers. I have to make sure that I can trust in the quality of your wares.', cid)
        return false
    end

    return true
end

npcHandler:setCallback(CALLBACK_ONTRADEREQUEST, onTradeRequest)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
I think will work...
@d0gw4r look again, i changed the code.
 
Last edited:
Okay, sorry keep you wating...

It is at /data/creaturescripts/scripts/others directory:

Lua:
function Player.sendTibiaTime(self, hours, minutes)
    local msg = NetworkMessage()
    msg:addByte(0xEF)
    msg:addByte(hours)
    msg:addByte(minutes)
    msg:sendToPlayer(self)
    msg:delete()
    return true
end

local events = {
    'ParasiteWarzone',
    'ElementalSpheresOverlords',
    'BigfootBurdenVersperoth',
    'BigfootBurdenWiggler',
    'SvargrondArenaKill',
    'NewFrontierShardOfCorruption',
    'NewFrontierTirecz',
    'ServiceOfYalaharDiseasedTrio',
    'ServiceOfYalaharAzerus',
    'ServiceOfYalaharQuaraLeaders',
    'InquisitionBosses',
    'InquisitionUngreez',
    'KillingInTheNameOfKills',
    'KillingInTheNameOfKillss',
    'KillingInTheNameOfKillsss',
    'MastersVoiceServants',
    'SecretServiceBlackKnight',
    'ThievesGuildNomad',
    'WotELizardMagistratus',
    'WotELizardNoble',
    'WotEKeeper',
    'WotEBosses',
    'WotEZalamon',
    'WarzoneThree',
    'PlayerDeath',
    'AdvanceSave',
    'bossesWarzone',
    'AdvanceRookgaard',
    'PythiusTheRotten',
    'DropLoot',
    'Yielothax',
    'BossParticipation',
    'Energized Raging Mage',
    'Raging Mage',
    'DeathCounter',
    'KillCounter',
    'bless1',
    'lowerRoshamuul',
    'SpikeTaskQuestCrystal',
    'SpikeTaskQuestDrillworm',
    'petlogin',
    'petthink',
    'UpperSpikeKill',
    'MiddleSpikeKill',
    'LowerSpikeKill',
    'BossesForgotten',
    'ReplicaServants',
    'EnergyPrismDeath',
    'AstralPower',
    'BossesKill',
    'TheShattererKill',
    'BossesHero',
    'DragonsKill',
    'deeplingBosses',
    'imbueDamage'
}

local function onMovementRemoveProtection(cid, oldPosition, time)
    local player = Player(cid)
    if not player then
        return true
    end

    local playerPosition = player:getPosition()
    if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then
        player:setStorageValue(Storage.combatProtectionStorage, 0)
        return true
    end

    addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)
end

function onLogin(player)
    local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
    if player:getLastLoginSaved() <= 0 then
        loginStr = loginStr .. ' Please choose your outfit.'      
        player:setBankBalance(0)

        if player:getSex() == 1 then
            player:setOutfit({lookType = 128, lookHead = 78, lookBody = 106, lookLegs = 58, lookFeet = 76})      
        else
            player:setOutfit({lookType = 136, lookHead = 78, lookBody = 106, lookLegs = 58, lookFeet = 76})  
        end

        player:sendTutorial(1)
    else
        if loginStr ~= "" then
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
        end

        loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
    end

    player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
    player:openChannel(10) -- LOOT CHANNEL
 
    local playerId = player:getId()

    DailyReward.init(playerId)  

    player:loadSpecialStorage()

    --[[-- Maintenance mode
    if (player:getGroup():getId() < 2) then
        return false
    else
       
    end--]]

    if (player:getGroup():getId() >= 4) then
        player:setGhostMode(true)
    end

    -- Stamina
    nextUseStaminaTime[playerId] = 1

    -- EXP Stamina
    nextUseXpStamina[playerId] = 1

    -- Prey Stamina
    nextUseStaminaPrey[playerId+1] = {Time = 1}
    nextUseStaminaPrey[playerId+2] = {Time = 1}
    nextUseStaminaPrey[playerId+3] = {Time = 1}

    -- Prey Data
    if (player:getVocation():getId() ~= 0) then
        local columnUnlocked = getUnlockedColumn(player)
        if (not columnUnlocked) then
            columnUnlocked = 0
        end

        for i = 0, columnUnlocked do
            sendPreyData(player, i)
        end
    end

    if (player:getAccountType() == ACCOUNT_TYPE_TUTOR) then
        local msg = [[:: Regras Tutor ::
            1*>3 Advertências você perde o cargo.
            2*>Sem conversas paralelas com jogadores no Help, se o player começar a ofender, você simplesmente o mute.
            3*>Seja educado com os player no Help e principalmente no Privado, tenta ajudar o máximo possível.
            4*>Sempre logue no seu horário, caso não tiver uma justificativa você será removido da staff.
            5*>Help é somente permitido realizar dúvidas relacionadas ao tibia.
            6*>Não é Permitido divulgar time pra upar ou para ajudar em quest.
            7*>Não é permitido venda de itens no Help.
            8*>Caso o player encontre um bug, peça para ir ao site mandar um ticket e explicar em detalhes.
            9*>Mantenha sempre o Chat dos Tutores aberto. (obrigatório).
            10*>Você terminou de cumprir seu horário, viu que não tem nenhum tutor Online, você comunica com algum CM in-game ou ts e fica no help até alguém logar, se der.
            11*>Mantenha sempre um ótimo português no Help, queremos tutores que dêem suporte, não que fiquem falando um ritual satânico.
            12*>Se ver um tutor fazendo algo que infrinja as regras, tire uma print e envie aos superiores."
            -- Comandos --
            Mutar Player: /mute nick,90. (90 segundos)
            Desmutar Player: /unmute nick.
            -- Comandos --]]
        player:popupFYI(msg)
    end
 
     -- OPEN CHANNERLS (ABRIR CHANNELS)
    if table.contains({"Rookgaard", "Dawnport"}, player:getTown():getName())then
        --player:openChannel(7) -- help channel
        player:openChannel(3) -- world chat
        player:openChannel(6) -- advertsing rook main
    else
        --player:openChannel(7) -- help channel
        player:openChannel(3) -- world chat
        player:openChannel(5) -- advertsing main
    end

      --
    -- Rewards
    local rewards = #player:getRewardList()
    if(rewards > 0) then
        player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
    end

    -- Update player id
    local stats = player:inBossFight()
    if stats then
        stats.playerId = player:getId()
    end


    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Bem vindo(a) ao Eduvio, aproveite a qualidade premium em nosso servidor!')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Relate erros e seja recompensado, assim manteremos sempre a melhor experiencia in game!')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Duvidas e sugestoes? acesse: http://eduvio.com')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, '[BUGS?] Reporte usando Ctrl+Z')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Fique por dentro de tudo que ocorre em nosso servidor utilize nosso forum!')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, '[DUVIDAS?]: Utilize o comando !tutor nele tera resposta para varias perguntas')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, '[!teleport]: Pode ser utilizado este comando para ir ate os Treiners Rooms, Event Room, e etc. No templo das cidades')
   
 
    -- Events
    for i = 1, #events do
        player:registerEvent(events[i])
    end


     if player:getStorageValue(Storage.combatProtectionStorage) < 1 then
        player:setStorageValue(Storage.combatProtectionStorage, 1)
        onMovementRemoveProtection(playerId, player:getPosition(), 10)
    end

    -- Exp stats
    local staminaMinutes = player:getStamina()
    local Boost = player:getExpBoostStamina()
    if staminaMinutes > 2400 and player:isPremium() and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*2) -- 200 = 1.0x, 200 = 2.0x, ... premium account
    elseif staminaMinutes > 2400 and player:isPremium() and Boost <= 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1.5) -- 150 = 1.0x, 150 = 1.5x, ... premium account
    elseif staminaMinutes <= 2400 and staminaMinutes > 840 and player:isPremium() and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1.5) -- 150 = 1.5x        premium account
    elseif staminaMinutes > 840 and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1.5) -- 150 = 1.5x        free account
    elseif staminaMinutes <= 840 and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1) -- 50 = 0.5x    all players
    elseif staminaMinutes <= 840 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*0.5) -- 50 = 0.5x    all players
    end

    if player:getClient().version > 1110 then
        local worldTime = getWorldTime()
        local hours = math.floor(worldTime / 60)
        local minutes = worldTime % 60
        player:sendTibiaTime(hours, minutes)
    end
player:registerEvent("fly")
    return true
end
 
Sorry but, just to not create another topic, there's a monster, Pixie, that isn't taking people drunk with her AoE spell, and it's 2 sqm more distant than the normal... how can I fix it too?

/data/monster/Feyrist
Lua:
<?xml version="1.0" encoding="ISO-8859-1"?>
<monster name="Pixie" nameDescription="a pixie" race="blood" experience="700" speed="190" manacost="450">
    <look type="982" corpse="29098" />
    <health now="770" max="770" />
    <targetchange interval="4000" chance="10" />
    <flags>
        <flag summonable="0" />
        <flag attackable="1" />
        <flag hostile="1" />
        <flag illusionable="1" />
        <flag convinceable="0" />
        <flag pushable="0" />
        <flag canpushitems="1" />
        <flag canpushcreatures="0" />
        <flag targetdistance="4" />
        <flag staticattack="90" />
        <flag runonhealth="20" />
        <flag canwalkonenergy="0" />
        <flag canwalkonfire="0" />
        <flag canwalkonpoison="0" />
    </flags>
    <immunities>
        <immunity invisible="1" />
    </immunities>
    <attacks>
        <attack name="melee" interval="2000" min="0" max="-250" />
        <attack name="energy" interval="2000" chance="15" range="7" target="1" min="-85" max="-135">
            <attribute key="shootEffect" value="energy" />
            <attribute key="areaEffect" value="energy" />
        </attack>
        <attack name="speed" interval="2000" chance="11" length="4" spread="2" target="0" speedchange="-440" duration="7000">
            <attribute key="areaEffect" value="greenshimmer" />
        </attack>
        <attack name="energy" interval="2000" chance="30" range="4" min="0" max="-100">
            <attribute key="shootEffect" value="leafstar" />
        </attack>
        <attack name="pixie skill reducer" interval="2000" chance="20" />
    </attacks>
    <defenses armor="50" defense="45">
        <defense name="healing" interval="2000" chance="25" min="40" max="75">
            <attribute key="areaEffect" value="greenshimmer" />
        </defense>
    </defenses>
    <elements>
        <element deathPercent="30" />
        <element earthPercent="60" />
        <element holyPercent="60" />
        <element firePercent="-10" />
        <element icePercent="-5" />
        <element physicalPercent="-5" />
    </elements>
    <voices interval="5000" chance="10">
        <voice sentence="Glamour, glitter, glistening things! Do you have any of those?" />
        <voice sentence="Sweet Dreams!" />
        <voice sentence="You might be a threat! I'm sorry but I can allow you to linger here." />
        <voice sentence="Let's try a step or two!" />
    </voices>
    <loot>
        <item name="gold coin" countmax="90" chance="30000" />
        <item name="rainbow quartz" countmax="5" chance="1086" />
        <item name="butterfly ring" chance="492" />
        <item name="wooden spellbook" chance="92" />
        <item name="dream blossom staff" chance="92" />
        <item id="2162" chance="492" />
        <item name="green mushroom" chance="492" />
        <item name="small enchanted amethyst" countmax="2" chance="492" />
        <item name="small topaz" countmax="2" chance="592" />
        <item name="rainbow quartz" countmax="3" chance="719" />
        <item name="colourful snail shell" chance="719" />
        <item name="star herb" chance="719" />
        <item name="leaf star" countmax="5" chance="10000" />
        <item name="red rose" chance="30100" />
        <item name="strong mana potion" chance="6800" />
        <item name="wild flowers" chance="5155" />
        <item name="great mana potion" chance="591" />
        <item name="dandelion seeds" chance="5800" />
        <item name="fresh fruit" countmax="2" chance="3400" />
    </loot>
</monster>

@@@Edit

She doesn't get people drunk, just paralizes, my mistake...
Already fixed the target distance!!

Thank you guys for support!
 
Last edited:
Okay, sorry keep you wating...

It is at /data/creaturescripts/scripts/others directory:

Lua:
function Player.sendTibiaTime(self, hours, minutes)
    local msg = NetworkMessage()
    msg:addByte(0xEF)
    msg:addByte(hours)
    msg:addByte(minutes)
    msg:sendToPlayer(self)
    msg:delete()
    return true
end

local events = {
    'ParasiteWarzone',
    'ElementalSpheresOverlords',
    'BigfootBurdenVersperoth',
    'BigfootBurdenWiggler',
    'SvargrondArenaKill',
    'NewFrontierShardOfCorruption',
    'NewFrontierTirecz',
    'ServiceOfYalaharDiseasedTrio',
    'ServiceOfYalaharAzerus',
    'ServiceOfYalaharQuaraLeaders',
    'InquisitionBosses',
    'InquisitionUngreez',
    'KillingInTheNameOfKills',
    'KillingInTheNameOfKillss',
    'KillingInTheNameOfKillsss',
    'MastersVoiceServants',
    'SecretServiceBlackKnight',
    'ThievesGuildNomad',
    'WotELizardMagistratus',
    'WotELizardNoble',
    'WotEKeeper',
    'WotEBosses',
    'WotEZalamon',
    'WarzoneThree',
    'PlayerDeath',
    'AdvanceSave',
    'bossesWarzone',
    'AdvanceRookgaard',
    'PythiusTheRotten',
    'DropLoot',
    'Yielothax',
    'BossParticipation',
    'Energized Raging Mage',
    'Raging Mage',
    'DeathCounter',
    'KillCounter',
    'bless1',
    'lowerRoshamuul',
    'SpikeTaskQuestCrystal',
    'SpikeTaskQuestDrillworm',
    'petlogin',
    'petthink',
    'UpperSpikeKill',
    'MiddleSpikeKill',
    'LowerSpikeKill',
    'BossesForgotten',
    'ReplicaServants',
    'EnergyPrismDeath',
    'AstralPower',
    'BossesKill',
    'TheShattererKill',
    'BossesHero',
    'DragonsKill',
    'deeplingBosses',
    'imbueDamage'
}

local function onMovementRemoveProtection(cid, oldPosition, time)
    local player = Player(cid)
    if not player then
        return true
    end

    local playerPosition = player:getPosition()
    if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then
        player:setStorageValue(Storage.combatProtectionStorage, 0)
        return true
    end

    addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)
end

function onLogin(player)
    local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
    if player:getLastLoginSaved() <= 0 then
        loginStr = loginStr .. ' Please choose your outfit.'     
        player:setBankBalance(0)

        if player:getSex() == 1 then
            player:setOutfit({lookType = 128, lookHead = 78, lookBody = 106, lookLegs = 58, lookFeet = 76})     
        else
            player:setOutfit({lookType = 136, lookHead = 78, lookBody = 106, lookLegs = 58, lookFeet = 76}) 
        end

        player:sendTutorial(1)
    else
        if loginStr ~= "" then
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
        end

        loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
    end

    player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
    player:openChannel(10) -- LOOT CHANNEL

    local playerId = player:getId()

    DailyReward.init(playerId) 

    player:loadSpecialStorage()

    --[[-- Maintenance mode
    if (player:getGroup():getId() < 2) then
        return false
    else
      
    end--]]

    if (player:getGroup():getId() >= 4) then
        player:setGhostMode(true)
    end

    -- Stamina
    nextUseStaminaTime[playerId] = 1

    -- EXP Stamina
    nextUseXpStamina[playerId] = 1

    -- Prey Stamina
    nextUseStaminaPrey[playerId+1] = {Time = 1}
    nextUseStaminaPrey[playerId+2] = {Time = 1}
    nextUseStaminaPrey[playerId+3] = {Time = 1}

    -- Prey Data
    if (player:getVocation():getId() ~= 0) then
        local columnUnlocked = getUnlockedColumn(player)
        if (not columnUnlocked) then
            columnUnlocked = 0
        end

        for i = 0, columnUnlocked do
            sendPreyData(player, i)
        end
    end

    if (player:getAccountType() == ACCOUNT_TYPE_TUTOR) then
        local msg = [[:: Regras Tutor ::
            1*>3 Advertências você perde o cargo.
            2*>Sem conversas paralelas com jogadores no Help, se o player começar a ofender, você simplesmente o mute.
            3*>Seja educado com os player no Help e principalmente no Privado, tenta ajudar o máximo possível.
            4*>Sempre logue no seu horário, caso não tiver uma justificativa você será removido da staff.
            5*>Help é somente permitido realizar dúvidas relacionadas ao tibia.
            6*>Não é Permitido divulgar time pra upar ou para ajudar em quest.
            7*>Não é permitido venda de itens no Help.
            8*>Caso o player encontre um bug, peça para ir ao site mandar um ticket e explicar em detalhes.
            9*>Mantenha sempre o Chat dos Tutores aberto. (obrigatório).
            10*>Você terminou de cumprir seu horário, viu que não tem nenhum tutor Online, você comunica com algum CM in-game ou ts e fica no help até alguém logar, se der.
            11*>Mantenha sempre um ótimo português no Help, queremos tutores que dêem suporte, não que fiquem falando um ritual satânico.
            12*>Se ver um tutor fazendo algo que infrinja as regras, tire uma print e envie aos superiores."
            -- Comandos --
            Mutar Player: /mute nick,90. (90 segundos)
            Desmutar Player: /unmute nick.
            -- Comandos --]]
        player:popupFYI(msg)
    end

     -- OPEN CHANNERLS (ABRIR CHANNELS)
    if table.contains({"Rookgaard", "Dawnport"}, player:getTown():getName())then
        --player:openChannel(7) -- help channel
        player:openChannel(3) -- world chat
        player:openChannel(6) -- advertsing rook main
    else
        --player:openChannel(7) -- help channel
        player:openChannel(3) -- world chat
        player:openChannel(5) -- advertsing main
    end

      --
    -- Rewards
    local rewards = #player:getRewardList()
    if(rewards > 0) then
        player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
    end

    -- Update player id
    local stats = player:inBossFight()
    if stats then
        stats.playerId = player:getId()
    end


    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Bem vindo(a) ao Eduvio, aproveite a qualidade premium em nosso servidor!')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Relate erros e seja recompensado, assim manteremos sempre a melhor experiencia in game!')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Duvidas e sugestoes? acesse: http://eduvio.com')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, '[BUGS?] Reporte usando Ctrl+Z')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Fique por dentro de tudo que ocorre em nosso servidor utilize nosso forum!')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, '[DUVIDAS?]: Utilize o comando !tutor nele tera resposta para varias perguntas')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, '[!teleport]: Pode ser utilizado este comando para ir ate os Treiners Rooms, Event Room, e etc. No templo das cidades')
  

    -- Events
    for i = 1, #events do
        player:registerEvent(events[i])
    end


     if player:getStorageValue(Storage.combatProtectionStorage) < 1 then
        player:setStorageValue(Storage.combatProtectionStorage, 1)
        onMovementRemoveProtection(playerId, player:getPosition(), 10)
    end

    -- Exp stats
    local staminaMinutes = player:getStamina()
    local Boost = player:getExpBoostStamina()
    if staminaMinutes > 2400 and player:isPremium() and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*2) -- 200 = 1.0x, 200 = 2.0x, ... premium account
    elseif staminaMinutes > 2400 and player:isPremium() and Boost <= 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1.5) -- 150 = 1.0x, 150 = 1.5x, ... premium account
    elseif staminaMinutes <= 2400 and staminaMinutes > 840 and player:isPremium() and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1.5) -- 150 = 1.5x        premium account
    elseif staminaMinutes > 840 and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1.5) -- 150 = 1.5x        free account
    elseif staminaMinutes <= 840 and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1) -- 50 = 0.5x    all players
    elseif staminaMinutes <= 840 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*0.5) -- 50 = 0.5x    all players
    end

    if player:getClient().version > 1110 then
        local worldTime = getWorldTime()
        local hours = math.floor(worldTime / 60)
        local minutes = worldTime % 60
        player:sendTibiaTime(hours, minutes)
    end
player:registerEvent("fly")
    return true
end
Change to this:
Lua:
function Player.sendTibiaTime(self, hours, minutes)
    local msg = NetworkMessage()
    msg:addByte(0xEF)
    msg:addByte(hours)
    msg:addByte(minutes)
    msg:sendToPlayer(self)
    msg:delete()
    return true
end

local events = {
    'ParasiteWarzone',
    'ElementalSpheresOverlords',
    'BigfootBurdenVersperoth',
    'BigfootBurdenWiggler',
    'SvargrondArenaKill',
    'NewFrontierShardOfCorruption',
    'NewFrontierTirecz',
    'ServiceOfYalaharDiseasedTrio',
    'ServiceOfYalaharAzerus',
    'ServiceOfYalaharQuaraLeaders',
    'InquisitionBosses',
    'InquisitionUngreez',
    'KillingInTheNameOfKills',
    'KillingInTheNameOfKillss',
    'KillingInTheNameOfKillsss',
    'MastersVoiceServants',
    'SecretServiceBlackKnight',
    'ThievesGuildNomad',
    'WotELizardMagistratus',
    'WotELizardNoble',
    'WotEKeeper',
    'WotEBosses',
    'WotEZalamon',
    'WarzoneThree',
    'PlayerDeath',
    'AdvanceSave',
    'bossesWarzone',
    'AdvanceRookgaard',
    'PythiusTheRotten',
    'DropLoot',
    'Yielothax',
    'BossParticipation',
    'Energized Raging Mage',
    'Raging Mage',
    'DeathCounter',
    'KillCounter',
    'bless1',
    'lowerRoshamuul',
    'SpikeTaskQuestCrystal',
    'SpikeTaskQuestDrillworm',
    'petlogin',
    'petthink',
    'UpperSpikeKill',
    'MiddleSpikeKill',
    'LowerSpikeKill',
    'BossesForgotten',
    'ReplicaServants',
    'EnergyPrismDeath',
    'AstralPower',
    'BossesKill',
    'TheShattererKill',
    'BossesHero',
    'DragonsKill',
    'deeplingBosses',
    'imbueDamage'
}

local function onMovementRemoveProtection(cid, oldPosition, time)
    local player = Player(cid)
    if not player then
        return true
    end

    local playerPosition = player:getPosition()
    if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then
        player:setStorageValue(Storage.combatProtectionStorage, 0)
        return true
    end

    addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)
end

function onLogin(player)
    local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
    if player:getStorageValue(Storage.TravellingTrader.Mission07) ~= 1 then
        player:setStorageValue(Storage.TravellingTrader.Mission07, 1) --Give full rashid quest
    end
    if player:getLastLoginSaved() <= 0 then
        loginStr = loginStr .. ' Please choose your outfit.'     
        player:setBankBalance(0)

        if player:getSex() == 1 then
            player:setOutfit({lookType = 128, lookHead = 78, lookBody = 106, lookLegs = 58, lookFeet = 76})     
        else
            player:setOutfit({lookType = 136, lookHead = 78, lookBody = 106, lookLegs = 58, lookFeet = 76}) 
        end

        player:sendTutorial(1)
    else
        if loginStr ~= "" then
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
        end

        loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
    end

    player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
    player:openChannel(10) -- LOOT CHANNEL
 
    local playerId = player:getId()

    DailyReward.init(playerId) 

    player:loadSpecialStorage()

    --[[-- Maintenance mode
    if (player:getGroup():getId() < 2) then
        return false
    else
      
    end--]]

    if (player:getGroup():getId() >= 4) then
        player:setGhostMode(true)
    end

    -- Stamina
    nextUseStaminaTime[playerId] = 1

    -- EXP Stamina
    nextUseXpStamina[playerId] = 1

    -- Prey Stamina
    nextUseStaminaPrey[playerId+1] = {Time = 1}
    nextUseStaminaPrey[playerId+2] = {Time = 1}
    nextUseStaminaPrey[playerId+3] = {Time = 1}

    -- Prey Data
    if (player:getVocation():getId() ~= 0) then
        local columnUnlocked = getUnlockedColumn(player)
        if (not columnUnlocked) then
            columnUnlocked = 0
        end

        for i = 0, columnUnlocked do
            sendPreyData(player, i)
        end
    end

    if (player:getAccountType() == ACCOUNT_TYPE_TUTOR) then
        local msg = [[:: Regras Tutor ::
            1*>3 Advertências você perde o cargo.
            2*>Sem conversas paralelas com jogadores no Help, se o player começar a ofender, você simplesmente o mute.
            3*>Seja educado com os player no Help e principalmente no Privado, tenta ajudar o máximo possível.
            4*>Sempre logue no seu horário, caso não tiver uma justificativa você será removido da staff.
            5*>Help é somente permitido realizar dúvidas relacionadas ao tibia.
            6*>Não é Permitido divulgar time pra upar ou para ajudar em quest.
            7*>Não é permitido venda de itens no Help.
            8*>Caso o player encontre um bug, peça para ir ao site mandar um ticket e explicar em detalhes.
            9*>Mantenha sempre o Chat dos Tutores aberto. (obrigatório).
            10*>Você terminou de cumprir seu horário, viu que não tem nenhum tutor Online, você comunica com algum CM in-game ou ts e fica no help até alguém logar, se der.
            11*>Mantenha sempre um ótimo português no Help, queremos tutores que dêem suporte, não que fiquem falando um ritual satânico.
            12*>Se ver um tutor fazendo algo que infrinja as regras, tire uma print e envie aos superiores."
            -- Comandos --
            Mutar Player: /mute nick,90. (90 segundos)
            Desmutar Player: /unmute nick.
            -- Comandos --]]
        player:popupFYI(msg)
    end
 
     -- OPEN CHANNERLS (ABRIR CHANNELS)
    if table.contains({"Rookgaard", "Dawnport"}, player:getTown():getName())then
        --player:openChannel(7) -- help channel
        player:openChannel(3) -- world chat
        player:openChannel(6) -- advertsing rook main
    else
        --player:openChannel(7) -- help channel
        player:openChannel(3) -- world chat
        player:openChannel(5) -- advertsing main
    end

      --
    -- Rewards
    local rewards = #player:getRewardList()
    if(rewards > 0) then
        player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
    end

    -- Update player id
    local stats = player:inBossFight()
    if stats then
        stats.playerId = player:getId()
    end


    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Bem vindo(a) ao Eduvio, aproveite a qualidade premium em nosso servidor!')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Relate erros e seja recompensado, assim manteremos sempre a melhor experiencia in game!')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Duvidas e sugestoes? acesse: http://eduvio.com')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, '[BUGS?] Reporte usando Ctrl+Z')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Fique por dentro de tudo que ocorre em nosso servidor utilize nosso forum!')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, '[DUVIDAS?]: Utilize o comando !tutor nele tera resposta para varias perguntas')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, '[!teleport]: Pode ser utilizado este comando para ir ate os Treiners Rooms, Event Room, e etc. No templo das cidades')
  
 
    -- Events
    for i = 1, #events do
        player:registerEvent(events[i])
    end


     if player:getStorageValue(Storage.combatProtectionStorage) < 1 then
        player:setStorageValue(Storage.combatProtectionStorage, 1)
        onMovementRemoveProtection(playerId, player:getPosition(), 10)
    end

    -- Exp stats
    local staminaMinutes = player:getStamina()
    local Boost = player:getExpBoostStamina()
    if staminaMinutes > 2400 and player:isPremium() and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*2) -- 200 = 1.0x, 200 = 2.0x, ... premium account
    elseif staminaMinutes > 2400 and player:isPremium() and Boost <= 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1.5) -- 150 = 1.0x, 150 = 1.5x, ... premium account
    elseif staminaMinutes <= 2400 and staminaMinutes > 840 and player:isPremium() and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1.5) -- 150 = 1.5x        premium account
    elseif staminaMinutes > 840 and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1.5) -- 150 = 1.5x        free account
    elseif staminaMinutes <= 840 and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1) -- 50 = 0.5x    all players
    elseif staminaMinutes <= 840 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*0.5) -- 50 = 0.5x    all players
    end

    if player:getClient().version > 1110 then
        local worldTime = getWorldTime()
        local hours = math.floor(worldTime / 60)
        local minutes = worldTime % 60
        player:sendTibiaTime(hours, minutes)
    end
player:registerEvent("fly")
    return true
end
 
Change to this:
Lua:
function Player.sendTibiaTime(self, hours, minutes)
    local msg = NetworkMessage()
    msg:addByte(0xEF)
    msg:addByte(hours)
    msg:addByte(minutes)
    msg:sendToPlayer(self)
    msg:delete()
    return true
end

local events = {
    'ParasiteWarzone',
    'ElementalSpheresOverlords',
    'BigfootBurdenVersperoth',
    'BigfootBurdenWiggler',
    'SvargrondArenaKill',
    'NewFrontierShardOfCorruption',
    'NewFrontierTirecz',
    'ServiceOfYalaharDiseasedTrio',
    'ServiceOfYalaharAzerus',
    'ServiceOfYalaharQuaraLeaders',
    'InquisitionBosses',
    'InquisitionUngreez',
    'KillingInTheNameOfKills',
    'KillingInTheNameOfKillss',
    'KillingInTheNameOfKillsss',
    'MastersVoiceServants',
    'SecretServiceBlackKnight',
    'ThievesGuildNomad',
    'WotELizardMagistratus',
    'WotELizardNoble',
    'WotEKeeper',
    'WotEBosses',
    'WotEZalamon',
    'WarzoneThree',
    'PlayerDeath',
    'AdvanceSave',
    'bossesWarzone',
    'AdvanceRookgaard',
    'PythiusTheRotten',
    'DropLoot',
    'Yielothax',
    'BossParticipation',
    'Energized Raging Mage',
    'Raging Mage',
    'DeathCounter',
    'KillCounter',
    'bless1',
    'lowerRoshamuul',
    'SpikeTaskQuestCrystal',
    'SpikeTaskQuestDrillworm',
    'petlogin',
    'petthink',
    'UpperSpikeKill',
    'MiddleSpikeKill',
    'LowerSpikeKill',
    'BossesForgotten',
    'ReplicaServants',
    'EnergyPrismDeath',
    'AstralPower',
    'BossesKill',
    'TheShattererKill',
    'BossesHero',
    'DragonsKill',
    'deeplingBosses',
    'imbueDamage'
}

local function onMovementRemoveProtection(cid, oldPosition, time)
    local player = Player(cid)
    if not player then
        return true
    end

    local playerPosition = player:getPosition()
    if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then
        player:setStorageValue(Storage.combatProtectionStorage, 0)
        return true
    end

    addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)
end

function onLogin(player)
    local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
    if player:getStorageValue(Storage.TravellingTrader.Mission07) ~= 1 then
        player:setStorageValue(Storage.TravellingTrader.Mission07, 1) --Give full rashid quest
    end
    if player:getLastLoginSaved() <= 0 then
        loginStr = loginStr .. ' Please choose your outfit.'    
        player:setBankBalance(0)

        if player:getSex() == 1 then
            player:setOutfit({lookType = 128, lookHead = 78, lookBody = 106, lookLegs = 58, lookFeet = 76})    
        else
            player:setOutfit({lookType = 136, lookHead = 78, lookBody = 106, lookLegs = 58, lookFeet = 76})
        end

        player:sendTutorial(1)
    else
        if loginStr ~= "" then
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
        end

        loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
    end

    player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
    player:openChannel(10) -- LOOT CHANNEL

    local playerId = player:getId()

    DailyReward.init(playerId)

    player:loadSpecialStorage()

    --[[-- Maintenance mode
    if (player:getGroup():getId() < 2) then
        return false
    else
     
    end--]]

    if (player:getGroup():getId() >= 4) then
        player:setGhostMode(true)
    end

    -- Stamina
    nextUseStaminaTime[playerId] = 1

    -- EXP Stamina
    nextUseXpStamina[playerId] = 1

    -- Prey Stamina
    nextUseStaminaPrey[playerId+1] = {Time = 1}
    nextUseStaminaPrey[playerId+2] = {Time = 1}
    nextUseStaminaPrey[playerId+3] = {Time = 1}

    -- Prey Data
    if (player:getVocation():getId() ~= 0) then
        local columnUnlocked = getUnlockedColumn(player)
        if (not columnUnlocked) then
            columnUnlocked = 0
        end

        for i = 0, columnUnlocked do
            sendPreyData(player, i)
        end
    end

    if (player:getAccountType() == ACCOUNT_TYPE_TUTOR) then
        local msg = [[:: Regras Tutor ::
            1*>3 Advertências você perde o cargo.
            2*>Sem conversas paralelas com jogadores no Help, se o player começar a ofender, você simplesmente o mute.
            3*>Seja educado com os player no Help e principalmente no Privado, tenta ajudar o máximo possível.
            4*>Sempre logue no seu horário, caso não tiver uma justificativa você será removido da staff.
            5*>Help é somente permitido realizar dúvidas relacionadas ao tibia.
            6*>Não é Permitido divulgar time pra upar ou para ajudar em quest.
            7*>Não é permitido venda de itens no Help.
            8*>Caso o player encontre um bug, peça para ir ao site mandar um ticket e explicar em detalhes.
            9*>Mantenha sempre o Chat dos Tutores aberto. (obrigatório).
            10*>Você terminou de cumprir seu horário, viu que não tem nenhum tutor Online, você comunica com algum CM in-game ou ts e fica no help até alguém logar, se der.
            11*>Mantenha sempre um ótimo português no Help, queremos tutores que dêem suporte, não que fiquem falando um ritual satânico.
            12*>Se ver um tutor fazendo algo que infrinja as regras, tire uma print e envie aos superiores."
            -- Comandos --
            Mutar Player: /mute nick,90. (90 segundos)
            Desmutar Player: /unmute nick.
            -- Comandos --]]
        player:popupFYI(msg)
    end

     -- OPEN CHANNERLS (ABRIR CHANNELS)
    if table.contains({"Rookgaard", "Dawnport"}, player:getTown():getName())then
        --player:openChannel(7) -- help channel
        player:openChannel(3) -- world chat
        player:openChannel(6) -- advertsing rook main
    else
        --player:openChannel(7) -- help channel
        player:openChannel(3) -- world chat
        player:openChannel(5) -- advertsing main
    end

      --
    -- Rewards
    local rewards = #player:getRewardList()
    if(rewards > 0) then
        player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
    end

    -- Update player id
    local stats = player:inBossFight()
    if stats then
        stats.playerId = player:getId()
    end


    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Bem vindo(a) ao Eduvio, aproveite a qualidade premium em nosso servidor!')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Relate erros e seja recompensado, assim manteremos sempre a melhor experiencia in game!')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Duvidas e sugestoes? acesse: http://eduvio.com')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, '[BUGS?] Reporte usando Ctrl+Z')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, 'Fique por dentro de tudo que ocorre em nosso servidor utilize nosso forum!')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, '[DUVIDAS?]: Utilize o comando !tutor nele tera resposta para varias perguntas')
    player:sendTextMessage(messageType or TALKTYPE_PRIVATE_FROM, '[!teleport]: Pode ser utilizado este comando para ir ate os Treiners Rooms, Event Room, e etc. No templo das cidades')
 

    -- Events
    for i = 1, #events do
        player:registerEvent(events[i])
    end


     if player:getStorageValue(Storage.combatProtectionStorage) < 1 then
        player:setStorageValue(Storage.combatProtectionStorage, 1)
        onMovementRemoveProtection(playerId, player:getPosition(), 10)
    end

    -- Exp stats
    local staminaMinutes = player:getStamina()
    local Boost = player:getExpBoostStamina()
    if staminaMinutes > 2400 and player:isPremium() and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*2) -- 200 = 1.0x, 200 = 2.0x, ... premium account
    elseif staminaMinutes > 2400 and player:isPremium() and Boost <= 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1.5) -- 150 = 1.0x, 150 = 1.5x, ... premium account
    elseif staminaMinutes <= 2400 and staminaMinutes > 840 and player:isPremium() and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1.5) -- 150 = 1.5x        premium account
    elseif staminaMinutes > 840 and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1.5) -- 150 = 1.5x        free account
    elseif staminaMinutes <= 840 and Boost > 0 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*1) -- 50 = 0.5x    all players
    elseif staminaMinutes <= 840 then
        player:setBaseXpGain(Game.getExperienceStage(player:getLevel())*0.5) -- 50 = 0.5x    all players
    end

    if player:getClient().version > 1110 then
        local worldTime = getWorldTime()
        local hours = math.floor(worldTime / 60)
        local minutes = worldTime % 60
        player:sendTibiaTime(hours, minutes)
    end
player:registerEvent("fly")
    return true
end

It's working, thank you!
 
Back
Top