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

The Inquisition Quest (Tested on Canary 13.21)

Draconis

New Member
Joined
Aug 11, 2023
Messages
3
Reaction score
4
GitHub
whitecrixu
So Hi everyone I'm special modifed script otservbr for myself maybe someone use thsi for ots is only map and scipts everything is configure. I'm not test this on TFS so we start.

First you need to add Holy water to
data-project/scipts/actions/other/holy_water.lua
Lua:
local shadowNexusPosition = Position(3074, 4333, 6)
local effectPositions = {
    Position(3073, 4333, 6),
    Position(3075, 4333, 6),
}

local function revertItem(position, itemId, transformId)
    local item = Tile(position):getItemById(itemId)
    if item then
        item:transform(transformId)
    end
end

local function nexusMessage(player, message)
    local spectators = Game.getSpectators(shadowNexusPosition, false, true, 3, 3)
    for i = 1, #spectators do
        player:say(message, TALKTYPE_MONSTER_YELL, false, spectators[i], shadowNexusPosition)
    end
end

local config = {
    antler_talisman = 22008,
    sacred_antler_talisman = 22009,
}

local othersHolyWater = Action()
function othersHolyWater.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if target.itemid == config.antler_talisman then
        item:transform(config.sacred_antler_talisman)
        item:remove(1)
        target:remove(1)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You besprinkle the antler talisman with holy water. It glittlers faintly")
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
        return true
    end

    -- Shadow Nexus
    if table.contains({ 7925, 7927, 7929 }, target.itemid) then
        if target.itemid == 7929 then
            Game.setStorageValue(GlobalStorage.Inquisition, math.random(4, 5))
        end
        local newShadowNexus = Game.createItem(target.itemid + 1, 1, shadowNexusPosition)
        if newShadowNexus then
            target:remove()
            newShadowNexus:decay()
        end
        nexusMessage(player, player:getName() .. " damaged the shadow nexus! You can't damage it while it's burning.")
        toPosition:sendMagicEffect(CONST_ME_ENERGYHIT)
    elseif target.itemid == 7931 then
        if Game.getStorageValue(GlobalStorage.Inquisition) > 0 then
            Game.setStorageValue(GlobalStorage.Inquisition, (Game.getStorageValue(GlobalStorage.Inquisition) - 1))
            if player:getStorageValue(Storage.TheInquisition.Questline) < 22 then
                -- The Inquisition Questlog- 'Mission 7: The Shadow Nexus'
                player:setStorageValue(Storage.TheInquisition.Mission07, 2)
                player:setStorageValue(Storage.TheInquisition.Questline, 22)
            end
            for i = 1, #effectPositions do
                effectPositions[i]:sendMagicEffect(CONST_ME_HOLYAREA)
            end
            nexusMessage(player, player:getName() .. " destroyed the shadow nexus! In 10 seconds it will return to its original state.")
            item:remove(1)
            toPosition:sendMagicEffect(CONST_ME_HOLYAREA)
        else
            target:transform(7925)
        end
    end

    return true
end

othersHolyWater:id(133)
othersHolyWater:register()

Now we have to add brother_lever.lua to data-project/scripts/actions
Lua:
local config = {
    [1006] = {
        wallPositions = {
            Position(3146, 4245, 5),
            Position(3147, 4245, 5),
            Position(3148, 4245, 5),
            Position(3149, 4245, 5),
            Position(3150, 4245, 5),
            Position(3151, 4245, 5),
            Position(3152, 4245, 5),
          Position(3153, 4245, 5),
            Position(3154, 4245, 5),
            Position(3155, 4245, 5),
            Position(3156, 4245, 5),
            Position(3157, 4245, 5),
            Position(3158, 4245, 5),
        },
        wallDown = 2162,
        wallUp = 1295,
    },
    [1007] = {
        wallPositions = {
            Position(3143, 4248, 5),
            Position(3143, 4249, 5),
            Position(3143, 4250, 5),
            Position(3143, 4251, 5),
            Position(3143, 4252, 5),
            Position(3143, 4253, 5),
            Position(3143, 4254, 5),
            Position(3143, 4255, 5),
            Position(3143, 4256, 5),
        },
        wallDown = 2164,
        wallUp = 1294,
    },
    [1008] = {
        wallPositions = {
            Position(3146, 4259, 5),
            Position(3147, 4259, 5),
            Position(3148, 4259, 5),
            Position(3149, 4259, 5),
            Position(3150, 4259, 5),
            Position(3151, 4259, 5),
            Position(3152, 4259, 5),
            Position(3153, 4259, 5),
            Position(3154, 4259, 5),
            Position(3155, 4259, 5),
            Position(3156, 4259, 5),
            Position(3157, 4259, 5),
            Position(3158, 4259, 5),
        },
        wallDown = 2162,
        wallUp = 1295,
    },
    [1009] = {
        wallPositions = {
            Position(3161, 4248, 5),
            Position(3161, 4249, 5),
            Position(3161, 4250, 5),
            Position(3161, 4251, 5),
            Position(3161, 4252, 5),
            Position(3161, 4253, 5),
            Position(3161, 4254, 5),
            Position(3161, 4255, 5),
            Position(3161, 4256, 5),
        },
        wallDown = 2164,
        wallUp = 1294,
    },
}

local inquisitionBrother = Action()

function inquisitionBrother.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local targetLever = config[item.uid]
    if not targetLever then
        return true
    end

    local tile, thing
    for i = 1, #targetLever.wallPositions do
        tile = Tile(targetLever.wallPositions[i])
        if tile then
            thing = tile:getItemById(item.itemid == 2772 and targetLever.wallDown or targetLever.wallUp)
            if thing then
                thing:transform(item.itemid == 2772 and targetLever.wallUp or targetLever.wallDown)
            end
        end
    end

    item:transform(item.itemid == 2772 and 2773 or 2772)
    return true
end

for uniqueId, info in pairs(config) do
    inquisitionBrother:uid(uniqueId)
end

inquisitionBrother:register()
to this same folder we have to add reward.lua
Lua:
local rewards = {
    [1300] = 8062,
    [1301] = 8090,
    [1302] = 8053,
    [1303] = 8060,
    [1304] = 8023,
    [1305] = 8096,
    [1306] = 8100,
    [1307] = 8102,
    [1308] = 8026,
}

local inquisitionRewards = Action()
function inquisitionRewards.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(Storage.TheInquisition.Reward) < 1 then
        player:setStorageValue(Storage.TheInquisition.Reward, 1)
        player:setStorageValue(Storage.TheInquisition.Questline, 25)
        player:setStorageValue(Storage.TheInquisition.Mission07, 5) -- The Inquisition Questlog- "Mission 7: The Shadow Nexus"
        player:addItem(rewards[item.uid], 1)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. ItemType(rewards[item.uid]):getName() .. ".")
        player:addAchievement("Master of the Nexus")
        player:addOutfitAddon(288, 2)
        player:addOutfitAddon(288, 1)
        player:addOutfitAddon(289, 1)
        player:addOutfitAddon(289, 2)
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The chest is empty.")
    end
    return true
end

for uniqueId, info in pairs(rewards) do
    inquisitionRewards:uid(uniqueId)
end

inquisitionRewards:register()
Now we have to create and add
data-project/scripts/creaturescripts/inquistion_boss.lua
Lua:
local bosses = {
    ["ushuriel"] = 200,
    ["zugurosh"] = 201,
    ["madareth"] = 202,
    ["latrivan"] = 203,
    ["golgordan"] = 203,
    ["annihilon"] = 204,
    ["hellgorak"] = 205,
}

local inquisitionBossKill = CreatureEvent("InquisitionBossKill")
function inquisitionBossKill.onKill(player, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end

    local targetName = targetMonster:getName():lower()
    local bossStorage = bosses[targetName]
    if not bossStorage then
        return true
    end

    local newValue = 2
    if targetName == "latrivan" or targetName == "golgordan" then
        newValue = math.max(0, Game.getStorageValue(bossStorage)) + 1
    end
    Game.setStorageValue(bossStorage, newValue)

    if newValue == 2 then
        player:say("You now have 10 minutes to exit this room through the teleporter. It will bring you to the next room.", TALKTYPE_MONSTER_SAY)
        addEvent(Game.setStorageValue, 10 * 60 * 1000, bossStorage, 0)
    end
    return true
end

inquisitionBossKill:register()
Right now we go to movements
data-project/scripts/movements/entrance.lua
Lua:
local entrance = MoveEvent()

function entrance.onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    if player:getLevel() >= 100 then
        local destination = Position(3072, 4062, 8)
        player:teleportTo(destination)
        position:sendMagicEffect(CONST_ME_TELEPORT)
        destination:sendMagicEffect(CONST_ME_TELEPORT)
        return true
    end

    player:teleportTo(fromPosition, true)
    position:sendMagicEffect(CONST_ME_TELEPORT)
    fromPosition:sendMagicEffect(CONST_ME_TELEPORT)
    return true
end

entrance:type("stepin")
entrance:uid(9014)
entrance:register()
data-project/scripts/movements/reward_room_text.lua
Lua:
local textPos = {
    {x = 3149, y = 4160, z = 6},
    {x = 3150, y = 4160, z = 6},
    {x = 3151, y = 4160, z = 6},
}

local rewardRoomText = MoveEvent()

function rewardRoomText.onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player or player:getStorageValue(Storage.TheInquisition.RewardRoomText) == 1 then
        return true
    end

    player:setStorageValue(Storage.TheInquisition.RewardRoomText, 1)
    player:say("You can choose exactly one of these chests. Choose wisely!", TALKTYPE_MONSTER_SAY)
    return true
end

for a = 1, #textPos do
    rewardRoomText:position(textPos[a])
end
rewardRoomText:register()
data-project/scripts/movements/teleport_main.lua
Lua:
local teleports = {
    -- to ushuriel ward
    [2150] = {
        text = "Entering Ushuriel's ward.",
        newPos = Position(3103, 4219, 5),
        storage = 0,
        alwaysSetStorage = true,
    },
    -- from ushuriel ward
    [2151] = {
        text = "Entering the Crystal Caves.",
        bossStorage = 200,
        newPos = Position(3178, 4142, 5),
        storage = 1,
    },
    -- from crystal caves
    [2152] = {
        text = "Escaping back to the Retreat.",
        newPos = Position(3068, 4088, 7),
    },
    -- to crystal caves
    [2153] = {
        text = "Entering the Crystal Caves.",
        newPos = Position(3178, 4142, 5),
        storage = 1,
    },
    -- to sunken caves
    [2154] = {
        text = "Entering the Sunken Caves.",
        newPos = Position(3190, 4072, 5),
    },
    -- from sunken caves
    [2155] = {
        text = "Entering the Mirror Maze of Madness.",
        newPos = Position(3172, 4124, 2),
    },
    -- to zugurosh ward
    [2156] = {
        text = "Entering Zugurosh's ward.",
        newPos = Position(3135, 4218, 5),
    },
    -- from zugurosh ward
    [2157] = {
        text = "Entering the Blood Halls.",
        bossStorage = 201,
        newPos = Position(3134, 4155, 5),
        storage = 2,
    },
    -- from blood halls
    [2158] = {
        text = "Escaping back to the Retreat.",
        newPos = Position(3068, 4088, 7),
    },
    -- to blood halls
    [2159] = {
        text = "Entering the Blood Halls.",
        newPos = Position(3134, 4155, 5),
        storage = 2,
    },
    -- to foundry
    [2160] = {
        text = "Entering the Foundry.",
        newPos = Position(3153, 4132, 5),
    },
    -- to madareth ward
    [2161] = {
        text = "Entering Madareth's ward.",
        newPos = Position(3117, 4258, 5),
    },
    -- from madareth ward
    [2162] = {
        text = "Entering the Vats.",
        bossStorage = 202,
        newPos = Position(3050, 4210, 6),
        storage = 3,
    },
    -- from vats
    [2163] = {
        text = "Escaping back to the Retreat.",
        newPos = Position(3068, 4088, 7),
    },
    -- to vats
    [2164] = {
        text = "Entering the Vats.",
        newPos = Position(3050, 4210, 6),
        storage = 3,
    },
    -- to battlefield
    [2165] = {
        text = "Entering the Battlefield.",
        newPos = Position(3048, 4138, 6),
    },
    -- from battlefield
    [2166] = {
        text = "Entering the Vats.",
        newPos = Position(3118, 4183, 6),
    },
    -- to brothers ward
    [2167] = {
        text = "Entering the Demon Forge.",
        newPos = Position(3152, 4257, 5),
    },
    -- from demon forge
    [2168] = {
        text = "Entering the Arcanum.",
        bossStorage = 203,
        newPos = Position(3157, 4200, 6),
        storage = 4,
    },
    -- from arcanum
    [2169] = {
        text = "Escaping back to the Retreat.",
        newPos = Position(3068, 4088, 7),
    },
    -- to arcanum
    [2170] = {
        text = "Entering the Arcanum.",
        newPos = Position(3157, 4200, 6),
        storage = 4,
    },
    -- to soul wells
    [2171] = {
        text = "Entering the Soul Wells.",
        newPos = Position(3245, 4144, 6),
    },
    -- from soul wells
    [2172] = {
        text = "Entering the Arcanum.",
        newPos = Position(3231, 4150, 6),
    },
    -- to annihilon ward
    [2173] = {
        text = "Entering the Annihilon's ward.",
        newPos = Position(3189, 4217, 5),
    },
    -- from annihilon ward
    [2174] = {
        text = "Entering the Hive.",
        bossStorage = 204,
        newPos = Position(3252, 4301, 5),
        storage = 5,
    },
    -- from hive
    [2175] = {
        text = "Escaping back to the Retreat.",
        newPos = Position(3068, 4088, 7),
    },
    -- to hive
    [2176] = {
        text = "Entering the Hive.",
        newPos = Position(3252, 4301, 5),
        storage = 5,
    },
    -- to hellgorak ward
    [2177] = {
        text = "Entering the Hellgorak's ward.",
        newPos = Position(3196, 4260, 5),
    },
    -- from hellgorak ward
    [2178] = {
        text = "Entering the Shadow Nexus. Abandon all Hope.",
        bossStorage = 205,
        newPos = Position(3070, 4313, 6),
        storage = 6,
    },
    -- from shadow nexus
    [2179] = {
        text = "Escaping back to the Retreat.",
        newPos = Position(3068, 4088, 7),
    },
    -- from foundry to blood halls
    [2180] = {
        text = "Entering the Blood Halls.",
        newPos = Position(3119, 4132, 3),
    },
}

local teleportMain = MoveEvent()

function teleportMain.onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    local teleport = teleports[item.uid]
    if teleport.alwaysSetStorage and player:getStorageValue(Storage.TheInquisition.EnterTeleport) < teleport.storage then
        player:setStorageValue(Storage.TheInquisition.EnterTeleport, teleport.storage)
    end

    if teleport.bossStorage then
        if Game.getStorageValue(teleport.bossStorage) >= 2 then
            if player:getStorageValue(Storage.TheInquisition.EnterTeleport) < teleport.storage then
                player:setStorageValue(Storage.TheInquisition.EnterTeleport, teleport.storage)
                player:setStorageValue(teleport.bossStorage, 0)
            end
        else
            player:teleportTo(Position(33165, 31709, 14))
            player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
            player:say("Escaping back to the Retreat.", TALKTYPE_MONSTER_SAY)
            return true
        end
    elseif teleport.storage and player:getStorageValue(Storage.TheInquisition.EnterTeleport) < teleport.storage then
        player:teleportTo(fromPosition)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        player:say("You don't have enough energy to enter this portal", TALKTYPE_MONSTER_SAY)
        return true
    end

    player:teleportTo(teleport.newPos)
    player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
    player:say(teleport.text, TALKTYPE_MONSTER_SAY)
    return true
end

teleportMain:type("stepin")

for index, value in pairs(teleports) do
    teleportMain:uid(index)
end

teleportMain:register()
ok we done scipts so now we go to data-project/startup/tables/door_quest.lua
we add to questdooraction
Lua:
        [Storage.TheInquisition.Mission07] = {
        itemId = false,
        itemPos = { {x = 3150, y = 4162, z = 6} },
print.png

Work with Canary 3.0.0
Github Link
 

Attachments

Last edited by a moderator:
can somebody convert the map for 8,6 pls?
Take it, it was done as best as possible.

edit: It must be said that I feel a little disappointed that it was not made in the same coordinates as Tibia :(
 

Attachments

  • INQ_MAP_converted860.zip
    251.8 KB · Views: 2 · VirusTotal
Last edited:
Take it, it was done as best as possible.

edit: It must be said that I feel a little disappointed that it was not made in the same coordinates as Tibia :(
Because this map is create for custom server. not for RL
 
Back
Top