Skip to content

Commit

Permalink
Lua code format - (Stylua)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 19, 2024
1 parent 839d5de commit 3396f68
Show file tree
Hide file tree
Showing 26 changed files with 1,210 additions and 1,213 deletions.
18 changes: 9 additions & 9 deletions data-otservbr-global/npc/mazarius.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ local function creatureSayCallback(npc, creature, type, message)
"Yet even he deemed this so-called '{godbreaker}' too dangerous, and split it into seven parts. These were at some point entrusted to his powerful minions, known as the Ruthless Seven. ...",
"Ancient, forbidden texts hinted at a hellish place where the seven built deadly dungeons, and placed some of their most fearsome and terrible minions as guards, before they sealed the place off. ...",
"I'm confident that I can prepare a matching ritual that will breach their protection and allow someone to enter their realm; but I'm in no way suited to handle the horrors to be encountered there. ...",
"Therefore I have to ask you, if you are willing to retrieve the parts of the godbreaker, and face the threat of the ascending Ferumbras?"
"Therefore I have to ask you, if you are willing to retrieve the parts of the godbreaker, and face the threat of the ascending Ferumbras?",
}, npc, creature)
npcHandler:setTopic(playerId, 0)
elseif MsgContains(message, "short") then
npcHandler:say({
"My studies indicate that without all doubt Ferumbras the fiendish is in the process of accumulating nearly godlike powers. We have to stop him.",
"Therefore I need you to enter a hellish dimension and acquire the parts of a weapon, the {godbreaker}, powerful enough to stop him once and for all. Are you willing to help me in this dire mission?"
"Therefore I need you to enter a hellish dimension and acquire the parts of a weapon, the {godbreaker}, powerful enough to stop him once and for all. Are you willing to help me in this dire mission?",
}, npc, creature)
npcHandler:setTopic(playerId, 2)
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 2 and player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Access) < 1 then
Expand Down Expand Up @@ -115,7 +115,7 @@ local function creatureSayCallback(npc, creature, type, message)
"However, it has to be assumed that in the end the sheer power of his creation scared Zathroth, who had to fear the weapon could one day be used against him. So he disassembled it. ...",
"He kept the parts hidden and guarded, and if the resources can be trusted and my interpretation is right, moved them again and again, never satisfied with a hiding place. In the end he entrusted the parts to the {Ruthless Seven}. ...",
"Knowing that they would never, ever allow one of their own to come in possession of all parts. Since then, the parts have been hidden in a {demi-plane} shared by the Seven.",
"Well, I need 30 {demonic essences} to exchange for a passage so you can access."
"Well, I need 30 {demonic essences} to exchange for a passage so you can access.",
}, npc, creature)
npcHandler:setTopic(playerId, 0)
elseif MsgContains(message, "Ruthless Seven") or MsgContains(message, "ruthless seven") then
Expand All @@ -124,7 +124,7 @@ local function creatureSayCallback(npc, creature, type, message)
elseif MsgContains(message, "demi-plane") then
npcHandler:say({
"It is a place, so to say, not completely of this world. It is separate of, yet strongly connected to, our own world. I would imagine it is quite limited in size and its laws of physics and magic should be roughly the same as ours. ...",
"Being home to a host of demons for a while, I expect it to be a hostile and dangerous environment."
"Being home to a host of demons for a while, I expect it to be a hostile and dangerous environment.",
}, npc, creature)
npcHandler:setTopic(playerId, 0)
elseif MsgContains(message, "ascension") then
Expand All @@ -133,7 +133,7 @@ local function creatureSayCallback(npc, creature, type, message)
"Probably born out of desperation, they extensively researched ways to acquire godhood themselves. ...",
"Some of them at least even met with moderate success. But the process is complicated at best, and may vary from race to race or even from one individual to another. ...",
"The theories differ vastly and waxed and waned in popularity over the centuries if not aeons. Even today and in human society there are a number of obscure ascension cults. ...",
"Some of them claim that humans are most suitable for ascension because they already own a bit of divinity through Banor's godly spark."
"Some of them claim that humans are most suitable for ascension because they already own a bit of divinity through Banor's godly spark.",
}, npc, creature)
npcHandler:setTopic(playerId, 0)
elseif MsgContains(message, "ferumbras") then
Expand All @@ -142,7 +142,7 @@ local function creatureSayCallback(npc, creature, type, message)
"His whole existence seems to be centred on becoming a name that strikes fear into the heart of men and to become a persistent figure in the minds of humanity. ...",
"This gives him a hold in reality and a kind of mould to fill with his power and conscience. It's also obvious that this kind of belief of the people alone won't be enough to empower him sufficiently. ...",
"Therefore he has to tap into other, probably even more sinister power sources. I can't tell what these sources are, but my scrying revealed that he has reached massive amounts of power. He has probably been infusing himself since years. ...",
"By now he is apparently reaching the end circle of his ascension and could make his final move any day."
"By now he is apparently reaching the end circle of his ascension and could make his final move any day.",
}, npc, creature)
npcHandler:setTopic(playerId, 0)
elseif MsgContains(message, "bozarn") then
Expand All @@ -160,13 +160,13 @@ local function creatureSayCallback(npc, creature, type, message)
elseif MsgContains(message, "kazordoon") then
npcHandler:say({
"The dwarves are leftovers from a time long gone by. They have outlived their usefulness to the gods and seem to have come to terms with that. ...",
"They are as unchanging as rock and no greatness awaits them any more. They missed their chance, if they ever had any."
"They are as unchanging as rock and no greatness awaits them any more. They missed their chance, if they ever had any.",
}, npc, creature)
npcHandler:setTopic(playerId, 0)
elseif MsgContains(message, "ab'dendriel") then
npcHandler:say({
"The elves are like lost children. Their potential might be great, but they lack focus and dedication to truly improve. If their myths are true, some of the more early elves might have accomplished ascension. ...",
"Yet even if hints strongly suggest those stories are true, the sheer inaction of those assumedly ascended beings is disturbing. Perhaps what those legendary elves achieved was something completely different."
"Yet even if hints strongly suggest those stories are true, the sheer inaction of those assumedly ascended beings is disturbing. Perhaps what those legendary elves achieved was something completely different.",
}, npc, creature)
npcHandler:setTopic(playerId, 0)
elseif MsgContains(message, "edron") then
Expand All @@ -175,7 +175,7 @@ local function creatureSayCallback(npc, creature, type, message)
elseif MsgContains(message, "demons") then
npcHandler:say({
"With all their powers and vast magic knowledge they are still more pawns than anything else. Given their resources, ascension might seem within reach. ...",
"The absence of any ascendant demon might prove that they are no true beings at all and literally damned to be stuck in their accursed forms."
"The absence of any ascendant demon might prove that they are no true beings at all and literally damned to be stuck in their accursed forms.",
}, npc, creature)
npcHandler:setTopic(playerId, 0)
elseif MsgContains(message, "venore") then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,56 +1,55 @@
local config = {
boss = {
name = "Ferumbras Mortal Shell",
position = Position(33392, 31473, 14),
},
playerPositions = {
{ pos = Position(33269, 31477, 14), teleport = Position(33390, 31483, 14), effect = CONST_ME_TELEPORT },

},
specPos = {
from = Position(33374, 31458, 14),
to = Position(33414, 31498, 14),
},
exit = Position(33319, 32318, 13),
centerRoom = Position(33392, 31473, 14),
summonName = "Rift Fragment",
maxSummon = 3,
boss = {
name = "Ferumbras Mortal Shell",
position = Position(33392, 31473, 14),
},
playerPositions = {
{ pos = Position(33269, 31477, 14), teleport = Position(33390, 31483, 14), effect = CONST_ME_TELEPORT },
},
specPos = {
from = Position(33374, 31458, 14),
to = Position(33414, 31498, 14),
},
exit = Position(33319, 32318, 13),
centerRoom = Position(33392, 31473, 14),
summonName = "Rift Fragment",
maxSummon = 3,
}

local leverFerumbras = Action()

function leverFerumbras.onUse(player, item, fromPosition, target, toPosition, isHotkey)
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
player:say("Someone is already inside the room.", TALKTYPE_MONSTER_SAY)
return true
end
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
player:say("Someone is already inside the room.", TALKTYPE_MONSTER_SAY)
return true
end
end

if isBossInRoom(config.specPos.from, config.specPos.to, config.boss.name) then
player:say("The room is being cleared. Please wait a moment.", TALKTYPE_MONSTER_SAY)
return true
end
if isBossInRoom(config.specPos.from, config.specPos.to, config.boss.name) then
player:say("The room is being cleared. Please wait a moment.", TALKTYPE_MONSTER_SAY)
return true
end

local players = {}
for i = 1, #config.playerPositions do
local pos = config.playerPositions[i].pos
local creature = Tile(pos):getTopCreature()
if not creature or not creature:isPlayer() then
player:sendCancelMessage("You need " .. #config.playerPositions .. " players to challenge " .. config.boss.name .. ".")
return true
end
table.insert(players, creature)
end
for i = 1, #config.playerPositions do
local pos = config.playerPositions[i].pos
local creature = Tile(pos):getTopCreature()
if not creature or not creature:isPlayer() then
player:sendCancelMessage("You need " .. #config.playerPositions .. " players to challenge " .. config.boss.name .. ".")
return true
end
table.insert(players, creature)
end

for i = 1, #players do
local playerToTeleport = players[i]
local teleportPos = config.playerPositions[i].teleport
local effect = config.playerPositions[i].effect
playerToTeleport:teleportTo(teleportPos)
teleportPos:sendMagicEffect(effect)
end
for i = 1, #players do
local playerToTeleport = players[i]
local teleportPos = config.playerPositions[i].teleport
local effect = config.playerPositions[i].effect
playerToTeleport:teleportTo(teleportPos)
teleportPos:sendMagicEffect(effect)
end

Game.createMonster(config.boss.name, config.boss.position, true, true)
for b = 1, config.maxSummon do
Expand All @@ -66,39 +65,39 @@ function leverFerumbras.onUse(player, item, fromPosition, target, toPosition, is
item:transform(8911)
end

return true
return true
end

function clearBossRoom(fromPos, toPos, exitPos)
local spectators = Game.getSpectators(fromPos, false, false, 0, 0, 0, 0, toPos)
for _, spec in pairs(spectators) do
if spec:isPlayer() then
spec:teleportTo(exitPos)
exitPos:sendMagicEffect(CONST_ME_TELEPORT)
spec:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You took too long, the battle has ended.")
else
spec:remove()
end
end
local spectators = Game.getSpectators(fromPos, false, false, 0, 0, 0, 0, toPos)
for _, spec in pairs(spectators) do
if spec:isPlayer() then
spec:teleportTo(exitPos)
exitPos:sendMagicEffect(CONST_ME_TELEPORT)
spec:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You took too long, the battle has ended.")
else
spec:remove()
end
end
end

function isBossInRoom(fromPos, toPos, bossName)
local monstersRemoved = false
for x = fromPos.x, toPos.x do
for y = fromPos.y, toPos.y do
for z = fromPos.z, toPos.z do
local tile = Tile(Position(x, y, z))
if tile then
local creature = tile:getTopCreature()
if creature and creature:isMonster() then
creature:remove()
monstersRemoved = true
end
end
end
end
end
return monstersRemoved
local monstersRemoved = false
for x = fromPos.x, toPos.x do
for y = fromPos.y, toPos.y do
for z = fromPos.z, toPos.z do
local tile = Tile(Position(x, y, z))
if tile then
local creature = tile:getTopCreature()
if creature and creature:isMonster() then
creature:remove()
monstersRemoved = true
end
end
end
end
end
return monstersRemoved
end

leverFerumbras:uid(1021)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ function ferumbrasAscendantFlowerPuzzle.onUse(player, item, fromPosition, target
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The portal still activated.")
else
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FlowerPuzzleTimer, 1)
addEvent(function() player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FlowerPuzzleTimer, 0) end, 30 * 1000)
addEvent(function()
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FlowerPuzzleTimer, 0)
end, 30 * 1000)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "A portal forms as two beams of a strange construction dividing this room move towards each other.")
for x = 33475, 33479 do
local pos = Position(x, 32698, 14)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,18 +376,17 @@ local function transformArea()
end

local function resetFerumbrasAscendantHabitats(player)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, 0)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, 0)
end


local ferumbrasAscendantHabitatCorrupted = Action()

function ferumbrasAscendantHabitatCorrupted.onUse(player, item, fromPosition, target, toPosition, isHotkey)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,15 @@ local function transformArea()
end

local function resetFerumbrasAscendantHabitats(player)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, 0)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, 0)
end

local ferumbrasAscendantHabitatDesert = Action()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,15 +391,15 @@ local function transformArea()
end

local function resetFerumbrasAscendantHabitats(player)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, 0)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension, -1)
player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, 0)
end

local ferumbrasAscendantHabitatDimension = Action()
Expand Down
Loading

0 comments on commit 3396f68

Please sign in to comment.