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 Oct 31, 2024
1 parent 8d49943 commit 9b8d3bd
Show file tree
Hide file tree
Showing 47 changed files with 481 additions and 430 deletions.
17 changes: 14 additions & 3 deletions data-otservbr-global/lib/core/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6645,7 +6645,9 @@ if not Quests then
startValue = 1,
endValue = 3,
states = {
[1] = function(player)return string.format("You already got %d/8 energized ward stones.", math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count), 0)) end,
[1] = function(player)
return string.format("You already got %d/8 energized ward stones.", math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count), 0))
end,
[2] = "You must kill the Nightmare Beast.",
[3] = "By defeating the dreadful Nightmare Beast you did the Winter Court and the Summer Court alike a great favor. From now on, the dream elves will regard you as a friend.",
},
Expand All @@ -6669,7 +6671,14 @@ if not Quests then
startValue = 1,
endValue = 6,
states = {
[1] = function(player)return string.format("A tormented soul trusted you with the secret of this house: join the passages to the three dungeons it connects to reveal a hidden portal within!\n\nCellar %d/1\nTemple %d/1\nTomb %d/1", math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar), 0), math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple), 0), math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb), 0)) end,
[1] = function(player)
return string.format(
"A tormented soul trusted you with the secret of this house: join the passages to the three dungeons it connects to reveal a hidden portal within!\n\nCellar %d/1\nTemple %d/1\nTomb %d/1",
math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar), 0),
math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple), 0),
math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb), 0)
)
end,
[2] = "Part I - burried catedral",
[3] = "Part II - puzzle dos livros",
[4] = "Part III - bosses",
Expand All @@ -6684,7 +6693,9 @@ if not Quests then
startValue = 1,
endValue = 2,
states = {
[1] = function(player)return string.format("You already got %d/7 secret keys.", math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count), 0)) end,
[1] = function(player)
return string.format("You already got %d/7 secret keys.", math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count), 0))
end,
[2] = "You found the seven keys to unlock the Seven Dream Doors in the Labyrinth of Summer's and Winter's Dreams.",
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ monster.light = {
monster.voices = {
interval = 5000,
chance = 10,
{text = "Dream or nightmare?", yell = false},
{ text = "Dream or nightmare?", yell = false },
}

monster.loot = {
Expand Down Expand Up @@ -115,7 +115,7 @@ monster.attacks = {
monster.defenses = {
defense = 76,
armor = 76,
{name = "combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 310, maxDamage = 640, effect = CONST_ME_REDSPARK},
{ name = "combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 310, maxDamage = 640, effect = CONST_ME_REDSPARK },
}

monster.elements = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ monster.light = {
monster.voices = {
interval = 5000,
chance = 10,
{text = "Dream or nightmare?", yell = false},
{ text = "Dream or nightmare?", yell = false },
}

monster.loot = {
Expand Down Expand Up @@ -115,7 +115,7 @@ monster.attacks = {
monster.defenses = {
defense = 76,
armor = 76,
{name = "combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 310, maxDamage = 640, effect = CONST_ME_MAGIC_BLUE},
{ name = "combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 310, maxDamage = 640, effect = CONST_ME_MAGIC_BLUE },
}

monster.elements = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ monster.corpse = 30017
monster.speed = 125
monster.manaCost = 0


monster.events = {
"dreamCourtsDeath",
}
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/scripts/lib/register_actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ local secret_library = {
local oldTable = { Position(32005, 32002, 14), Position(32005, 32003, 14), Position(32006, 32002, 14), Position(32006, 32003, 14) }
local foundItems = {
{ id = 29992, quantity = 1 },
{ id = 953, quantity = 4 }
{ id = 953, quantity = 4 },
}
local storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Lock

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ function actions_acidFishingRod.onUse(player, item, fromPosition, target, toPosi
end

actions_acidFishingRod:id(29950)
actions_acidFishingRod:register()
actions_acidFishingRod:register()
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ function actions_bookOnTable.onUse(player, item, fromPosition, target, toPositio

if player:getStorageValue(questline) == 2 and player:getStorageValue(wordsCount) >= 4 then
player:setStorageValue(questline, 3)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'This book tells you about a spell that draws its wielder towards the most energetic being next to him.')
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It consists of four parts wich have been scratched out of this book. They need to be read in conjunction with chants.')
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This book tells you about a spell that draws its wielder towards the most energetic being next to him.")
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It consists of four parts wich have been scratched out of this book. They need to be read in conjunction with chants.")
elseif player:getStorageValue(questline) >= 4 then
if player:getStorageValue(facelessTime) > os.time() then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have to wait to challange this enemy again!')
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to wait to challange this enemy again!")
return true
else
player:teleportTo(Position(33640, 32561, 13))
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'All chants have been sung in the right order, you are deemed worthy. You are transported away...')
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "All chants have been sung in the right order, you are deemed worthy. You are transported away...")
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ function actions_chargedCompass.onUse(player, item, fromPosition, target, toPosi
target:getPosition():sendMagicEffect(CONST_ME_THUNDER)
target:transform(29335)
item:transform(29291)
addEvent(revertStone, 1000*30, tPos, 33828, 33827)
addEvent(revertStone, 1000 * 30, tPos, 33828, 33827)
end
end

return true
end

actions_chargedCompass:id(29294)
actions_chargedCompass:register()
actions_chargedCompass:register()
Original file line number Diff line number Diff line change
@@ -1,115 +1,115 @@
local containers = {
local containers = {
[1] = {
uniqueid = 23102,
cPosition = Position(32736, 32282, 8),
storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.skeletonContainer,
value = 1,
reward = 29310,
defaultItem = true
defaultItem = true,
},
[2] = {
uniqueid = 23103,
cPosition = Position(33693, 32185, 8),
storage = Storage.Quest.U12_00.TheDreamCourts.Main.courtChest,
value = 1,
reward = 30146,
defaultItem = true
defaultItem = true,
},
[3] = {
uniqueid = 23104,
cPosition = Position(33711, 32108, 4),
storage = Storage.Quest.U12_00.TheDreamCourts.Main.courtChest,
value = 1,
reward = 30146,
defaultItem = true
defaultItem = true,
},
[4] = {
uniqueid = 23105,
cPosition = Position(33578, 32527, 14),
storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.fishingRod,
value = 1,
reward = 29950,
defaultItem = true
defaultItem = true,
},
[5] = {
uniqueid = 23106,
cPosition = Position(33599, 32533, 14),
storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.barrelWord,
value = 1,
defaultItem = false,
text = "The inside of this barrel's lid has a word written onto it: 'O'kteth'."
text = "The inside of this barrel's lid has a word written onto it: 'O'kteth'.",
},
[6] = {
uniqueid = 23107,
cPosition = Position(33618, 32518, 14),
storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.estatueWord,
value = 1,
defaultItem = false,
text = "This statue has a word written on her hand: 'N'ogalu'."
text = "This statue has a word written on her hand: 'N'ogalu'.",
},
[7] = {
uniqueid = 23108,
cPosition = Position(33638, 32507, 14),
storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.bedWord,
value = 1,
defaultItem = false,
text = "This end of the bed has a stack of notes hidden under it. There is only one word on all of them: 'T'sough'."
text = "This end of the bed has a stack of notes hidden under it. There is only one word on all of them: 'T'sough'.",
},
[8] = {
uniqueid = 23109,
cPosition = Position(33703, 32185, 5),
storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Rosebush,
value = 1,
reward = 29993,
defaultItem = true
defaultItem = true,
},
[9] = {
uniqueid = 23110,
cPosition = Position(33663, 32192, 7),
storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Mushroom,
value = 1,
reward = 30009,
defaultItem = true
defaultItem = true,
},
[10] = {
uniqueid = 23111,
cPosition = Position(33671, 32203, 7),
storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Book,
value = 1,
reward = 29991,
defaultItem = true
defaultItem = true,
},
[11] = {
uniqueid = 23112,
cPosition = Position(33683, 32125, 6),
storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.OrcSkull,
value = 1,
reward = 29989,
defaultItem = true
defaultItem = true,
},
[12] = {
uniqueid = 23113,
cPosition = Position(31996, 31981, 13),
storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Recipe,
value = 1,
reward = 30147,
defaultItem = true
defaultItem = true,
},
[13] = {
uniqueid = 23114,
cPosition = Position(32017, 31981, 14),
storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MinotaurSkull,
value = 1,
reward = 29988,
defaultItem = true
defaultItem = true,
},
[14] = {
[14] = {
uniqueid = 23115,
cPosition = Position(32054, 31936, 13),
storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.trollSkull,
value = 1,
reward = 29990,
defaultItem = true
defaultItem = true,
},
}

Expand All @@ -122,7 +122,7 @@ function actions_containerRewards.onUse(player, item, fromPosition, target, toPo
if iPos == k.cPosition and item:getUniqueId() == k.uniqueid then
if player:getStorageValue(k.storage) < k.value then
if k.defaultItem then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a " .. ItemType(k.reward):getName() ..".")
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a " .. ItemType(k.reward):getName() .. ".")
player:addItem(k.reward, 1)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, k.text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,50 @@ local config = {
off = 29336,
hisPosition = Position(32251, 31386, 5),
hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.okolnirStone,
hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light."
hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light.",
},
[2] = {
on = 29337,
off = 29336,
hisPosition = Position(31939, 31653, 10),
hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.foldaStone,
hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light."
hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light.",
},
[3] = {
on = 29337,
off = 29336,
hisPosition = Position(32058, 32792, 13),
hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.calassaStone,
hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light."
hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light.",
},
[4] = {
on = 29335,
off = 29334,
hisPosition = Position(33555, 32220, 7),
hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.feyristStone,
hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light."
hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.",
},
[5] = {
on = 29335,
off = 29334,
hisPosition = Position(32383, 32610, 7),
hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.merianaStone,
hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light."
hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.",
},
[6] = {
on = 29335,
off = 29334,
hisPosition = Position(33273, 31997, 7),
hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.cormayaStone,
hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light."
hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.",
},
[7] = {
on = 29335,
off = 29334,
hisPosition = Position(33576, 32537, 15),
hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.catedralStone,
hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.",
lastStone = true
lastStone = true,
},
}

Expand Down Expand Up @@ -84,7 +84,7 @@ function actions_dreamTalisman.onUse(player, item, fromPosition, target, toPosit
target:getPosition():sendMagicEffect(CONST_ME_THUNDER)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, k.hisMessage)
target:transform(k.on)
addEvent(revertStone, 1000*30, target:getPosition(), k.on, k.off)
addEvent(revertStone, 1000 * 30, target:getPosition(), k.on, k.off)
end
end
end
Expand All @@ -93,4 +93,4 @@ function actions_dreamTalisman.onUse(player, item, fromPosition, target, toPosit
end

actions_dreamTalisman:id(30132)
actions_dreamTalisman:register()
actions_dreamTalisman:register()
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ function actions_dreamcatcher_curse.onUse(player, item, fromPosition, target, to
if item.itemid == 29274 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can rip off a dream catcher!")
item:transform(29275)
local newItem = Game.createItem(maskId, 1, Position(item:getPosition().x, item:getPosition().y+1, item:getPosition().z))
local newItem = Game.createItem(maskId, 1, Position(item:getPosition().x, item:getPosition().y + 1, item:getPosition().z))
if newItem then
newItem:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT)
end
addEvent(placeMask, 10*1000, item:getPosition(), 29274, 29275)
addEvent(placeMask, 10 * 1000, item:getPosition(), 29274, 29275)
elseif item.itemid == 29276 then
if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse) < 1 then
if (target ~= player) and target:isPlayer() then
Expand Down
Loading

0 comments on commit 9b8d3bd

Please sign in to comment.