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

Quest Access

nathan0726

New Member
Joined
Feb 5, 2018
Messages
19
Reaction score
0
Trying to add the ability to have certain access quests skipped. I used the search function and read through all the threads and tried the suggestions but I still can't seem to get it to work properly.
I've got the correct storage ID's i believe for the Yalahar access quest. I tried adding player:setStorageValue(12249, 2) to my login.lua under --Events, but it doesn't appear to be working. Any suggestions?
 
Trying to add the ability to have certain access quests skipped. I used the search function and read through all the threads and tried the suggestions but I still can't seem to get it to work properly.
I've got the correct storage ID's i believe for the Yalahar access quest. I tried adding player:setStorageValue(12249, 2) to my login.lua under --Events, but it doesn't appear to be working. Any suggestions?
If you want help you need to provide more information than just you tried to set a storage value, put yourself in people who might want to help you shoes...
You can't just assume that everyone knows what you are talking about, you need to provide the script you are working with and any script or where you got information from so everyone is on the same page.

I am unfamiliar with this quest, but I know how to code, so that is why I am responding.
 
I'm not sure what other information you need. I don't really have anything else. I said I was working with the login.lua script. Using TFS 1.2/OTXServer 3.10
 
I'm not sure what other information you need. I don't really have anything else. I said I was working with the login.lua script. Using TFS 1.2/OTXServer 3.10
But that tells us nothing.. just post the script.. and post the quest script or at the very least provide a link to the quest script.
 
Login.lua where I'm trying to add player:setStorageValue(12249, 2):

<?xml version="1.0" encoding="UTF-8"?> <quests> <quest name="The Explorer Soc - Pastebin.com


If you search "In service of Yalahar" I'm trying to add the value for Mission 9 Mission State 2
This is the quests.xml where the storageid values reside:

local events = { 'ElementalSpheresOverlords', 'BigfootBurdenVersperoth - Pastebin.com
Ok, so I took this spells parser I made
Spells Parser - Configurable - Any TFS / OTX Version
and made some modifications to it so we parse the whole xml file (rough draft)

It prints out a table like this so you can use it as a reference
Lua:
    ["Postman Rank"] = {
       storageid = 12460, startvalue = 1, endvalue = 5
   },
   ["Mission 2: Eclipse"] = {
       storageid = 12162, startvalue = 1, endvalue = 3
   },
   ["In Service of Yalahar"] = {
       storageid = 12240, startstorageid = 12240, startstoragevalue = 5
   },
   ["Mission 12: Just Rewards"] = {
       storageid = 12362, startvalue = 0, endvalue = 1
   },
   ["Paw and Fur: Demons"] = {
       storageid = 65044, startvalue = 0, endvalue = 6666
   },
The attached file is the table reference.
 

Attachments

  • questReference.lua
    33.2 KB · Views: 36 · VirusTotal
Last edited:
That's handy! Now how do I get it to load those values upon logging in?
Rename the table "SPELLS" to QUESTS in the questReference.lua, save the file in the same directory as login.lua and then modify login.lua to reflect this code.
Lua:
-- include the questReference lua file
dofile('data/creaturescripts/scripts/questReference.lua')

local questReference = 123456
function reference(cid)
    local player = Player(cid)
    if player and player:getStorageValue(questReference) == -1 then
        for questName, questTable in pairs(QUESTS) do
            player:setStorageValue(questTable.storageid, questTable.endvalue or 1)
        end
        player:setStorageValue(questReference, 1)
    end
end

function onLogin(player)
    reference(player:getId())
This will set all those storages to the endvalue or 1 if it has no endvalue, but it will only do it the 1 time.

If you only want specific quests to be set with the endvalue then make a table with all the quests you want and use this version instead.
Lua:
-- include the questReference lua file
dofile('data/creaturescripts/scripts/questReference.lua')

local activate = {"Sea of Light", "Spike Task", "Paw and Fur: Mutated Tigers"}
local questReference = 123456

function reference(cid)
    local player = Player(cid)
    if player and player:getStorageValue(questReference) == -1 then
        for questName, questTable in pairs(QUESTS) do
            if isInArray(activate, questName) then
                player:setStorageValue(questTable.storageid, questTable.endvalue or 1)
            end
        end
        player:setStorageValue(questReference, 1)
    end
end

function onLogin(player)
    reference(player:getId())

This is the modified version of the script which parses the xml file. Please note you will need a lua interpreter to run this code. In the future when you parse the xml file you won't need to change the name of the table, because I already did that for you which is on line 41. This is just a tool to construct the questReference.lua file and its table.
Lua:
function cwd(name)
    local chr = os.tmpname():sub(1,1)
    if chr == "/" then
      -- linux
      chr = "/[^/]*$"
    else
      -- windows
      chr = "\\[^\\]*$"
    end
    return arg[0]:sub(1, arg[0]:find(chr))..(name or '')
end
function isNumber(v)
    local val = tonumber(v)
    if type(val) == 'number' then
        return val
    end
    return '"'..v..'"'
end
function insert(t, i, v)
    if type(i) == 'number' then
        table.insert(t, i, v)
    else
        if not t[i] then
            t[i] = v
        end
    end
end
--local dir = 'data/spells/'
local path = cwd('x.xml') -- name of the xml file which holds all the quests
local fileEx = cwd('questReference.lua') -- name of the file to create
local outputFile = fileEx
--local storage = 1000
local spells = {}
local para = { -- the attributes to look for in the xml file
    'name', 'storageid', 'startstorageid', 'startstoragevalue', 'startvalue', 'endvalue'
    }
function parseSpells()
    local file = path
    fileEx = io.open(fileEx, "w+")
    local k = {}
    fileEx:write("QUESTS = {\n")
    for line in io.lines(file) do
        if string.match(line, '<(%a-)%s* ') ~= nil then
            spellParam =  string.match(line, '<(%a-)%s* ')
            if spellParam ~= nil and spellParam ~= 'vocation' then
                for type_ in line:gmatch(spellParam) do
                    local sName = ''
                    for i = 1, #para do
                        if line:match(para[i]..'="(.-)"') then
                            if para[i] == 'name' then
                              sName = line:match('name="(.-)"')
                            else
                              table.insert(k, para[i]..' = '..isNumber(line:match(para[i]..'="(.-)"'))..', ')
                            end
                        end
                    end
                    local temp = '{\n\t\t'..table.concat(k)
                    temp = temp:sub(1, #temp - 2)
                    k = {}
                    insert(spells, sName, temp)
                end
            end
        end
    end
    local n = 1
    for k, v in pairs(spells)do
        fileEx:write("\t[\""..k.."\"] = "..v.."\n\t},\n")
        n = n + 1
    end
    fileEx:write("}")
    fileEx:close()
end
parseSpells()
 
Last edited:
Do I need to make any changes to local questReference = 123456? Here is my currently login.lua:

Lua:
local events = {
    'ElementalSpheresOverlords',
    'BigfootBurdenVersperoth',
    'Razzagorn',
    'Shatterer',
    'Zamulosh',   
    'The Hunger',
    'The Rage',
    'Eradicator',
    'Eradicator1',
    'Rupture',
    'World Devourer',   
    'Tarbaz',
    'Shulgrax',
    'Ragiaz',
    'Plagirath',
    'Mazoran',
    'Destabilized',
    'BigfootBurdenWiggler',
    'SvargrondArenaKill',
    'NewFrontierShardOfCorruption',
    'NewFrontierTirecz',
    'ServiceOfYalaharDiseasedTrio',
    'ServiceOfYalaharAzerus',
    'ServiceOfYalaharQuaraLeaders',
    'InquisitionBosses',
    'InquisitionUngreez',
    'KillingInTheNameOfKills',
    'KillingInTheNameOfKillss',
    'KillingInTheNameOfKillsss',
    'MastersVoiceServants',
    'SecretServiceBlackKnight',
    'ThievesGuildNomad',
    'WotELizardMagistratus',
    'WotELizardNoble',
    'WotEKeeper',
    'Maxxed',
    'WotEBosses',
    'WotEZalamon',
    'WarzoneThree',
    'PlayerDeath',
    'AdvanceSave',
    'bossesWarzone',
    'AdvanceRookgaard',
    'PythiusTheRotten',
    'DropLoot',
    'Yielothax',
    'BossParticipation',
    'Energized Raging Mage',
    'Raging Mage',
    'modalMD1',
    'VibrantEgg',
    'DeathCounter',
    'KillCounter',
    'bless1',
    'lowerRoshamuul',
    'SpikeTaskQuestCrystal',
    'SpikeTaskQuestDrillworm',
    'petlogin',
    'Idle',
    'petthink'
}
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)
  
    local playerId = player:getId()
   
    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_EVENT_ADVANCE, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
    end
end
-- include the questReference lua file
dofile('data/creaturescripts/scripts/others/questReference.lua')
local activate = {"In Service of Yalahar"}
local questReference = 123456
function reference(cid)
    local player = Player(cid)
    if player and player:getStorageValue(questReference) == -1 then
        for questName, questTable in pairs(QUESTS) do
            if isInArray(activate, questName) then
                player:setStorageValue(questTable.storageid, questTable.endvalue or 1)
            end
        end
        player:setStorageValue(questReference, 1)
    end
end
function onLogin(player)
    reference(player:getId())
    -- Update player id
    local stats = player:inBossFight()
    if stats then
        stats.playerId = player:getId()
    end
    -- fury gates
    local messageType = nil
    if (player:getClient().os == 3 or
        player:getClient().os == 5) then
        messageType = MESSAGE_EVENT_ADVANCE
    end

    if Game.getStorageValue(9710) == 1 then
        player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Venore Today.')
    elseif Game.getStorageValue(9711) == 2 then
        player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Abdendriel Today.')
    elseif Game.getStorageValue(9712) == 3 then
        player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Thais Today.')
    elseif Game.getStorageValue(9713) == 4 then
        player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Carlin Today.')
    elseif Game.getStorageValue(9714) == 5 then
        player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Edron Today.')
    elseif Game.getStorageValue(9716) == 6 then
        player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Kazordoon Today.')
    end

    player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_ORANGE, '[BUGS?] Reporte em http://www.github.com/malucooo/otxserver-new/issues')
  
    -- Events
    for i = 1, #events do
        player:registerEvent(events[i])
    end
    if player:getStorageValue(Storage.combatProtectionStorage) <= os.time() then
        player:setStorageValue(Storage.combatProtectionStorage, os.time() + 10)
        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(200) -- 200 = 1.0x, 200 = 2.0x, ... premium account       
    elseif staminaMinutes > 2400 and player:isPremium() and Boost <= 0 then
        player:setBaseXpGain(150) -- 150 = 1.0x, 150 = 1.5x, ... premium account   
    elseif staminaMinutes <= 2400 and staminaMinutes > 840 and player:isPremium() and Boost > 0 then
        player:setBaseXpGain(150) -- 150 = 1.5x        premium account
    elseif staminaMinutes > 840 and Boost > 0 then
        player:setBaseXpGain(150) -- 150 = 1.5x        free account
    elseif staminaMinutes <= 840 and Boost > 0 then
        player:setBaseXpGain(100) -- 50 = 0.5x    all players   
    elseif staminaMinutes <= 840 then
        player:setBaseXpGain(50) -- 50 = 0.5x    all players   
    end

    return true
end
 
This is how it should be, the quests that you want to activate must be listed just as they are listed in the QUESTS table otherwise it won't work.
Lua:
-- include the questReference lua file
dofile('data/creaturescripts/scripts/others/questReference.lua')

local activate = {"In Service of Yalahar"}
local questReference = 123456
function reference(cid)
    local player = Player(cid)
    if player and player:getStorageValue(questReference) == -1 then
        for questName, questTable in pairs(QUESTS) do
            if isInArray(activate, questName) then
                player:setStorageValue(questTable.storageid, questTable.endvalue or 1)
            end
        end
        player:setStorageValue(questReference, 1)
    end
end

local events = {
    'ElementalSpheresOverlords',
    'BigfootBurdenVersperoth',
    'Razzagorn',
    'Shatterer',
    'Zamulosh',
    'The Hunger',
    'The Rage',
    'Eradicator',
    'Eradicator1',
    'Rupture',
    'World Devourer',
    'Tarbaz',
    'Shulgrax',
    'Ragiaz',
    'Plagirath',
    'Mazoran',
    'Destabilized',
    'BigfootBurdenWiggler',
    'SvargrondArenaKill',
    'NewFrontierShardOfCorruption',
    'NewFrontierTirecz',
    'ServiceOfYalaharDiseasedTrio',
    'ServiceOfYalaharAzerus',
    'ServiceOfYalaharQuaraLeaders',
    'InquisitionBosses',
    'InquisitionUngreez',
    'KillingInTheNameOfKills',
    'KillingInTheNameOfKillss',
    'KillingInTheNameOfKillsss',
    'MastersVoiceServants',
    'SecretServiceBlackKnight',
    'ThievesGuildNomad',
    'WotELizardMagistratus',
    'WotELizardNoble',
    'WotEKeeper',
    'Maxxed',
    'WotEBosses',
    'WotEZalamon',
    'WarzoneThree',
    'PlayerDeath',
    'AdvanceSave',
    'bossesWarzone',
    'AdvanceRookgaard',
    'PythiusTheRotten',
    'DropLoot',
    'Yielothax',
    'BossParticipation',
    'Energized Raging Mage',
    'Raging Mage',
    'modalMD1',
    'VibrantEgg',
    'DeathCounter',
    'KillCounter',
    'bless1',
    'lowerRoshamuul',
    'SpikeTaskQuestCrystal',
    'SpikeTaskQuestDrillworm',
    'petlogin',
    'Idle',
    'petthink'
}

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)
    -- this is the reference method for the quests
    reference(player:getId())
    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)
    local playerId = player:getId()
 
    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_EVENT_ADVANCE, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
    end


    reference(player:getId())
    -- Update player id
    local stats = player:inBossFight()
    if stats then
        stats.playerId = player:getId()
    end
    -- fury gates
    local messageType = nil
    if (player:getClient().os == 3 or
        player:getClient().os == 5) then
        messageType = MESSAGE_EVENT_ADVANCE
    end
    if Game.getStorageValue(9710) == 1 then
        player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Venore Today.')
    elseif Game.getStorageValue(9711) == 2 then
        player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Abdendriel Today.')
    elseif Game.getStorageValue(9712) == 3 then
        player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Thais Today.')
    elseif Game.getStorageValue(9713) == 4 then
        player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Carlin Today.')
    elseif Game.getStorageValue(9714) == 5 then
        player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Edron Today.')
    elseif Game.getStorageValue(9716) == 6 then
        player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Kazordoon Today.')
    end
    player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_ORANGE, '[BUGS?] Reporte em http://www.github.com/malucooo/otxserver-new/issues')
    -- Events
    for i = 1, #events do
        player:registerEvent(events[i])
    end
    if player:getStorageValue(Storage.combatProtectionStorage) <= os.time() then
        player:setStorageValue(Storage.combatProtectionStorage, os.time() + 10)
        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(200) -- 200 = 1.0x, 200 = 2.0x, ... premium account   
    elseif staminaMinutes > 2400 and player:isPremium() and Boost <= 0 then
        player:setBaseXpGain(150) -- 150 = 1.0x, 150 = 1.5x, ... premium account
    elseif staminaMinutes <= 2400 and staminaMinutes > 840 and player:isPremium() and Boost > 0 then
        player:setBaseXpGain(150) -- 150 = 1.5x        premium account
    elseif staminaMinutes > 840 and Boost > 0 then
        player:setBaseXpGain(150) -- 150 = 1.5x        free account
    elseif staminaMinutes <= 840 and Boost > 0 then
        player:setBaseXpGain(100) -- 50 = 0.5x    all players
    elseif staminaMinutes <= 840 then
        player:setBaseXpGain(50) -- 50 = 0.5x    all players
    end
    return true
end
 
For reference, I added the first script you gave to the same folder as my login.lua in creaturescripts/scripts/others. Then added the second script to the login.lua itself.
 
The server launches properly now without errors, but still doesn't let me through quarter gates in Yalahar. To test I even added Joining the Explorers, to give me the first mission of the Explorer Society quest and checked and I was still able to take the quest from the Explorer's Society.
 
Last edited:
The server launches properly now without errors, but still doesn't let me through quarter gates in Yalahar. To test I even added Joining the Explorers, to give me the first mission of the Explorer Society quest and checked and I was still able to take the quest from the Explorer's Society.
Once the 123456 storage value is set to 1 no matter what you add to the activate table it will not set the storage value of the quests, so change the questReference value so that you can retest the login script, you can also just delete the value of the storage in the database.
 
Can you clarify what I need to change? I looked in my DB and couldn't find where the characters storage value is set at. In the script I need to change local questReference = 123456?
 
Can you clarify what I need to change? I looked in my DB and couldn't find where the characters storage value is set at. In the script I need to change local questReference = 123456?
Are you only reading part of the explanation?
Because that is exactly how it seems, I've explained how to do everything more than once,

In post 7 you ask me how to use the table I gave you in post 6 so in post 8 I provided you with the code and a full explanation, in post 9 you ask me where do you put the last script i made and I already explained that this is not part of the server in post 8 that you need a lua interpreter to run it. In post 10 I re-explain this, in post 12 you completely ignored post 8's instructions because in post 13 I correct your login script. In post 16 I give you 2 options and in post 17 you ask for me to clarify what you need to change.

I am sorry I can not help you any further, you don't follow instructions and are a little frustrating to deal with, rather than just flat out ignoring your issue I am providing you with the reason. I wish you the best but I can't help someone who doesn't seem to be paying attention.
 
Okay, thanks. The scripts your provided clearly do not work. The only reason I had to ask for clarification because your initial posts didn't make a lot of sense until you went back and edited them after the fact. But thanks.
 
Back
Top