Skip to content

Commit

Permalink
More Fix: ferumbras Ascendant Quest - review 10
Browse files Browse the repository at this point in the history
  • Loading branch information
htc16 committed Oct 3, 2024
1 parent f05de75 commit e001b9a
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ local config = {
local leverFerumbras = Action()

function leverFerumbras.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local cooldownTime = player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FerumbrasMortalShellTime)
if cooldownTime > os.time() then
local remainingTime = cooldownTime - os.time()
local hours = math.floor(remainingTime / 3600)
local minutes = math.floor((remainingTime % 3600) / 60)

player:sendCancelMessage("You must wait " .. hours .. " hours and " .. minutes .. " minutes to challenge again.")
player:teleportTo(fromPosition)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end

local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to)
for _, spec in pairs(spectators) do
if spec:isPlayer() then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ local config = {
local leverMazoran = Action()

function leverMazoran.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local cooldownTime = player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.MazoranTime)
if cooldownTime > os.time() then
local remainingTime = cooldownTime - os.time()
local hours = math.floor(remainingTime / 3600)
local minutes = math.floor((remainingTime % 3600) / 60)

player:sendCancelMessage("You must wait " .. hours .. " hours and " .. minutes .. " minutes to challenge again.")
player:teleportTo(fromPosition)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end

local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to)
for _, spec in pairs(spectators) do
if spec:isPlayer() then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ local config = {
local leverPlagirath = Action()

function leverPlagirath.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local cooldownTime = player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.PlagirathTime)
if cooldownTime > os.time() then
local remainingTime = cooldownTime - os.time()
local hours = math.floor(remainingTime / 3600)
local minutes = math.floor((remainingTime % 3600) / 60)

player:sendCancelMessage("You must wait " .. hours .. " hours and " .. minutes .. " minutes to challenge again.")
player:teleportTo(fromPosition)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end

local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to)
for _, spec in pairs(spectators) do
if spec:isPlayer() then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ local config = {
local leverRagiaz = Action()

function leverRagiaz.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local cooldownTime = player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.RagiazTime)
if cooldownTime > os.time() then
local remainingTime = cooldownTime - os.time()
local hours = math.floor(remainingTime / 3600)
local minutes = math.floor((remainingTime % 3600) / 60)

player:sendCancelMessage("You must wait " .. hours .. " hours and " .. minutes .. " minutes to challenge again.")
player:teleportTo(fromPosition)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end

local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to)
for _, spec in pairs(spectators) do
if spec:isPlayer() then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ local config = {
local leverRazzagorn = Action()

function leverRazzagorn.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local cooldownTime = player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.RazzagornTime)
if cooldownTime > os.time() then
local remainingTime = cooldownTime - os.time()
local hours = math.floor(remainingTime / 3600)
local minutes = math.floor((remainingTime % 3600) / 60)

player:sendCancelMessage("You must wait " .. hours .. " hours and " .. minutes .. " minutes to challenge again.")
player:teleportTo(fromPosition)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end

local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to)
for _, spec in pairs(spectators) do
if spec:isPlayer() then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ local config = {
local leverShulgrax = Action()

function leverShulgrax.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local cooldownTime = player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.ShulgraxTime)
if cooldownTime > os.time() then
local remainingTime = cooldownTime - os.time()
local hours = math.floor(remainingTime / 3600)
local minutes = math.floor((remainingTime % 3600) / 60)

player:sendCancelMessage("You must wait " .. hours .. " hours and " .. minutes .. " minutes to challenge again.")
player:teleportTo(fromPosition)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end

local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to)
for _, spec in pairs(spectators) do
if spec:isPlayer() then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ local config = {
local leverTarbaz = Action()

function leverTarbaz.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local cooldownTime = player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TarbazTime)
if cooldownTime > os.time() then
local remainingTime = cooldownTime - os.time()
local hours = math.floor(remainingTime / 3600)
local minutes = math.floor((remainingTime % 3600) / 60)

player:sendCancelMessage("You must wait " .. hours .. " hours and " .. minutes .. " minutes to challenge again.")
player:teleportTo(fromPosition)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end

local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to)
for _, spec in pairs(spectators) do
if spec:isPlayer() then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ local config = {
local leverZamulosh = Action()

function leverZamulosh.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local cooldownTime = player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.ZamuloshTime)
if cooldownTime > os.time() then
local remainingTime = cooldownTime - os.time()
local hours = math.floor(remainingTime / 3600)
local minutes = math.floor((remainingTime % 3600) / 60)

player:sendCancelMessage("You must wait " .. hours .. " hours and " .. minutes .. " minutes to challenge again.")
player:teleportTo(fromPosition)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end

local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to)
for _, spec in pairs(spectators) do
if spec:isPlayer() then
Expand Down

0 comments on commit e001b9a

Please sign in to comment.