• 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!

Lua Quest/npc

argos55

New Member
Joined
Jul 31, 2020
Messages
13
Reaction score
0
how to do it every player at the time of character creation had some missions to access bosses or other places or unlock npc, what like rashid?

Can someone help how to maked ?

Sorry for my english
 
So you want to add storage on first player login to access special missions/bosses? or you want player to talk to NPC which will add those storages?
 
So you want to add storage on first player login to access special missions/bosses? or you want player to talk to NPC which will add those storages?

I want to add storage on first player login to access special missions/bosses.
U make new character and u have this quest maked :)
 
You'll have to add in data/creaturescripts/scripts/login.lua
Lua:
if not player:getStorage(xxxx) == 1 then
player:setStorageValue(xxxx, 1)
end
and replace the xxxx with the storage values you has in your missions/quests or whatever you want player to access, If you don't know storage value for your missions/bosses you'll have to post the boss teleport/lever script or mission teleport/lever script here so I can tell you it.
 
This isn't useful, Can you specify where exactly you want to give them access? What boss? What quest? What mission?
 
if u maked character ( 8 lvla )
Thais all tp i boss
Barbarian Test Quest (complet)
The Explorer Society Quest (complet)
The Ice Islands Quest (complet)
The Postman Missions Quest (complet)
The Travelling Trader Quest (complet)
The Djinn War blue and green (complet)
ew The Ape City Quest (complet)
The Dream Courts Quest (complet)
The New Frontier Quest (complet)
Troubled Animals Quest (complet)
Wrath of the Emperor Quest (no 11 misji)
Children of the Revolution Quest (complet)
Grave Danger Quest
The Secret Library Quest
Heart of Destruction Quest
Grave Danger Quest
Bigfoot's Burden Quest
Dangerous Depths Quest

And name of bosses i must look for his name


and all bosses to can maked any 12 h

And sorry for my english :)
 
Lets start with the first one, There is no storage for its missions in your quests.lua so I guess you'll have all those storages stored in data/lib or might be stored in your schema.sql
Lua:
            name = "Barbarian Test Quest",
            startstorageid = Storage.BarbarianTest.Questline,
            startstoragevalue = 1,
            missions = {
                [1] = {
                    name = "Barbarian Test 1: Barbarian Booze",
                    storageid = Storage.BarbarianTest.Mission01,
                    startvalue = 1,
                    endvalue = 3,
                    states = {
                        [1] = "Talk to Sven about mead and give him a honeycomb. For each honeycomb you will be allowed 20 sips.",
                        [2] = "Now drink from the bucket until you drink 10 sips in a row without passing out",
                        [3] = "You have completed this Test! Talk to Sven about the mead."
                    }
                },
                [2] = {
                    name = "Barbarian Test 2: The Bear Hugging",
                    storageid = Storage.BarbarianTest.Mission02,
                    startvalue = 1,
                    endvalue = 3,
                    states = {
                        [1] = "Sven gave you a Mead Horn. Fill it with mead from the bucket behind Sven (brown contents) \z
                            and then proceed to the sleeping bear. The bear is inside a small ice cave in the north. \z
                            Use the full mead horn on the bear so it becomes unconscious, then use the bear to hug it.",
                        [2] = "You hugging the bear! Go tell Sven that you hugged the bear!",
                        [3] = "You have completed this Test!"
                    }
                },
                [3] = {
                    name = "Barbarian Test 3: The Mammoth Pushing",
                    storageid = Storage.BarbarianTest.Mission03,
                    startvalue = 1,
                    endvalue = 3,
                    states = {
                        [1] = "Go to the north-west of Svargrond and find the Mammoth. Drink your three mugs of mead, \z
                            stand in front of the Mammoth and push it. Just use it...",
                        [2] = "You pushed the Mammoth! Go tell Sven that you pushed the Mammoth!",
                        [3] = "You have completed this Test! You can now be a citizen of Svargrond!"
                    }
                }
            }
 
But where i must put this ?? sorry i try maked this 2 weeks so i have confusion about this :)
Post automatically merged:

i can send u all my lua what to need to look on this then you can tolde me where and what i must going :)
 
Try adding this instead of your login.lua and then try if you have Barbarian Test Quest access
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',
'theGreatDragonHuntKill',
'bonusPreyLootKill',
'bossesMissionCults'
}

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)

-- Prey system 2 slots unlocked by default
for slot = CONST_PREY_SLOT_FIRST, CONST_PREY_SLOT_SECOND do
player:setPreyUnlocked(slot, 1)
player:setPreyState(slot, Prey.StateTypes.SELECTION_CHANGE_MONSTER)
end
player:setPreyUnlocked(CONST_PREY_SLOT_THIRD, 0)
player:setPreyState(CONST_PREY_SLOT_THIRD, Prey.StateTypes.LOCKED)

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

-- New Prey
nextPreyTime[playerId] = {
[CONST_PREY_SLOT_FIRST] = 1,
[CONST_PREY_SLOT_SECOND] = 1,
[CONST_PREY_SLOT_THIRD] = 1
}

if (player:getAccountType() == ACCOUNT_TYPE_TUTOR) then
local msg = [[:: Tutor Rules
1 *> 3 Warnings you lose the job.
2 *> Without parallel conversations with players in Help, if the player starts offending, you simply mute it.
3 *> Be educated with the players in Help and especially in the Private, try to help as much as possible.
4 *> Always be on time, if you do not have a justification you will be removed from the staff.
5 *> Help is only allowed to ask questions related to tibia.
6 *> It is not allowed to divulge time up or to help in quest.
7 *> You are not allowed to sell items in the Help.
8 *> If the player encounters a bug, ask to go to the website to send a ticket and explain in detail.
9 *> Always keep the Tutors Chat open. (required).
10 *> You have finished your schedule, you have no tutor online, you communicate with some CM in-game or ts and stay in the help until someone logs in, if you can.
11 *> Always keep a good Portuguese in the Help, we want tutors who support, not that they speak a satanic ritual.
12 *> If you see a tutor doing something that violates the rules, take a print and send it to your superiors. "
- Commands -
Mute Player: / mute nick, 90. (90 seconds)
Unmute Player: / unmute nick.
- Commands -]]
player:popupFYI(msg)
end

-- OPEN 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

local config = {
   [1] = {storage = Storage.BarbarianTest.Mission01, questStatus = 1},
   [2] = {storage = Storage.BarbarianTest.Mission02, questStatus = 1},
   [3] = {storage = Storage.BarbarianTest.Mission03, questStatus = 1}
}

if not player:getStorage(Storage.BarbarianTest.Mission01) >= 1 then
player:setStorageValue(config[i].storage, config[i].questStatus)
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

if player:getStorageValue(Storage.ForgottenKnowlage.Tomes) < 1 then
    player:getStorageValue(Storage.ForgottenKnowlage.Tomes, 1)
    player:getStorageValue(Storage.ForgottenKnowlage.AccessEarth, 1)
    player:getStorageValue(Storage.ForgottenKnowlage.AccessViolet, 1)
    player:getStorageValue(Storage.ForgottenKnowlage.AccessIce, 1)
    player:getStorageValue(Storage.ForgottenKnowlage.AccessGolden, 1)
    player:getStorageValue(Storage.ForgottenKnowlage.AccessDeath, 1)
    player:getStorageValue(Storage.ForgottenKnowlage.AccessFire, 1)
end
-- 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
return true
end
 
ok give me minute
Post automatically merged:

187 line dont working and i cant login my character
Post automatically merged:

Looking like this
 

Attachments

Last edited:
Seems harder than I thought, You'll have to find all scripts related to a quest and find the correct storages for it in your lib folder then create a list with them all and add on login, its impossible for me to know every storage value.
Each quest has different script for example Barbarian Test Quest has different storage set like in this scripts.
Lua:
local function sendSleepEffect(position)
    position:sendMagicEffect(CONST_ME_SLEEP)
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if target.uid == 3110 and item.itemid == 7140 then
        player:say('You fill your horn with ale.', TALKTYPE_MONSTER_SAY)
        item:transform(7141)
        toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
    elseif target.itemid == 7174 and item.itemid == 7141 then
        player:say('The bear is now unconcious.', TALKTYPE_MONSTER_SAY)
        item:transform(7140)
        target:transform(7175)
        toPosition:sendMagicEffect(CONST_ME_STUN)
    elseif item.itemid == 7175 then
        if player:getStorageValue(Storage.BarbarianTest.Questline) == 4 then
            player:say('You hug the unconcious bear.', TALKTYPE_MONSTER_SAY)
            player:setStorageValue(Storage.BarbarianTest.Questline, 5)
            player:setStorageValue(Storage.BarbarianTest.Mission02, 2) -- Questlog Barbarian Test Quest Barbarian Test 2: The Bear Hugging
            player:addAchievement('Bearhugger')
            item:transform(7174)
            toPosition:sendMagicEffect(CONST_ME_SLEEP)
        else
            player:say('You don\'t feel like hugging an unconcious bear.', TALKTYPE_MONSTER_SAY)
        end
    elseif item.itemid == 7174 then
        player:say('Grr.', TALKTYPE_MONSTER_SAY)
        player:say('The bear is not amused by the disturbance.', TALKTYPE_MONSTER_SAY)
        doAreaCombatHealth(player, COMBAT_PHYSICALDAMAGE, player:getPosition(), 0, -10, -30, CONST_ME_POFF)
    elseif item.itemid == 7176 then
        if player:getStorageValue(Storage.BarbarianTest.Questline) == 6 then
            if player:getCondition(CONDITION_DRUNK) then
                player:say('You hustle the mammoth. What a fun. *hicks*.', TALKTYPE_MONSTER_SAY)
                player:setStorageValue(Storage.BarbarianTest.Questline, 7)
                player:setStorageValue(Storage.BarbarianTest.Mission03, 2) -- Questlog Barbarian Test Quest Barbarian Test 3: The Mammoth Pushing
                item:transform(7177)
                item:decay()
                addEvent(sendSleepEffect, 60 * 1000, toPosition)
                toPosition:sendMagicEffect(CONST_ME_SLEEP)
            else
                player:say('You are not drunk enought to hustle a mammoth.', TALKTYPE_MONSTER_SAY)
            end
        end
    end
    return true
end
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(Storage.BarbarianTest.Questline) == 2 and player:getStorageValue(Storage.BarbarianTest.MeadTotalSips) <= 20 then
        if math.random(5) > 1 then
            player:say('The world seems to spin but you manage to stay on your feet.', TALKTYPE_MONSTER_SAY)
            player:setStorageValue(Storage.BarbarianTest.MeadSuccessSips, player:getStorageValue(Storage.BarbarianTest.MeadSuccessSips) + 1)
            if player:getStorageValue(Storage.BarbarianTest.MeadSuccessSips) == 9 then -- 9 sips here cause local player at start
                player:say('10 sips in a row. Yeah!', TALKTYPE_MONSTER_SAY)
                player:setStorageValue(Storage.BarbarianTest.Questline, 3)
                player:setStorageValue(Storage.BarbarianTest.Mission01, 3) -- Questlog Barbarian Test Quest Barbarian Test 1: Barbarian Booze
                return true
            end
        else
            player:say('The mead was too strong. You passed out for a moment.', TALKTYPE_MONSTER_SAY)
            player:setStorageValue(Storage.BarbarianTest.MeadSuccessSips, 0)
        end
        player:setStorageValue(Storage.BarbarianTest.MeadTotalSips, player:getStorageValue(Storage.BarbarianTest.MeadTotalSips) + 1)
    elseif player:getStorageValue(Storage.BarbarianTest.MeadTotalSips) > 20 then
        player:say('Ask Sven for another round.', TALKTYPE_MONSTER_SAY)
        player:setStorageValue(Storage.BarbarianTest.Questline, 1)
        player:setStorageValue(Storage.BarbarianTest.Mission01, 1) -- Questlog Barbarian Test Quest Barbarian Test 1: Barbarian Booze
    elseif player:getStorageValue(Storage.BarbarianTest.Questline) >= 3 then
        player:say('You already passed the test, no need to torture yourself anymore.', TALKTYPE_MONSTER_SAY)
    end
    return true
end
 
U know how to maked this ??
Or can u meked this for me? i can pay for it .....
becouse its hard for me :(

I send u all may lua if u wont :) i try make this that many time and nothing :(
 
Sorry I don't accept any jobs and you are not allowed to make monetary offerings in Support board, If you want someone to do the whole thing for you then you'll have to create a thread Here.
Otherwise you'll have to wait if someone got a better solution than what I tried above.
 
I understand, I just don't have the strength anymore. and I am looking for help, if you could, for example, explain to me exactly what it is about, I would be grateful or prepare a template how it should look more or less.

of course, I didn't want to offend you either .
 
Back
Top