Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
luanluciano93 committed Jul 7, 2024
2 parents ad81adf + 9825f4c commit bf48447
Show file tree
Hide file tree
Showing 123 changed files with 1,727 additions and 1,031 deletions.
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ QualifierAlignment: Left
ReferenceAlignment: Right
ReflowComments: true
RemoveBracesLLVM: false
SortIncludes: false
SortIncludes: Never
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
Expand All @@ -138,4 +138,4 @@ StatementMacros:
- QT_REQUIRE_VERSION
TabWidth: 4
UseCRLF: false
UseTab: true
UseTab: AlignWithSpaces
6 changes: 3 additions & 3 deletions .github/workflows/clang-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ jobs:

- name: Run clang format lint
if: ${{ github.ref != 'refs/heads/main' }}
uses: DoozyX/clang-format-lint-action@v0.16.2
uses: DoozyX/clang-format-lint-action@v0.17
with:
source: "src"
exclude: "src/protobuf"
extensions: "cpp,hpp,h"
clangFormatVersion: 16
clangFormatVersion: 17
inplace: true

- name: Run add and commit
if: ${{ github.ref != 'refs/heads/main' }}
uses: EndBug/add-and-commit@v9
uses: EndBug/add-and-commit@v9.1.4
with:
author_name: GitHub Actions
author_email: github-actions[bot]@users.noreply.github.com
Expand Down
9 changes: 9 additions & 0 deletions data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3079,6 +3079,15 @@ GlobalStorage = {
DarashiaWest = 60193,
},
},
TheDreamCourts = {
-- Reserved storage from 60194 - 60196
FacelessBane = {
-- Global
StepsOn = 60194,
Deaths = 60195,
ResetSteps = 60196,
},
},
FuryGates = 65000,
Yakchal = 65001,
PitsOfInfernoLevers = 65002,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ monster.events = {
"GraveDangerBossDeath",
}

monster.health = 75000
monster.maxHealth = 75000
monster.health = 300000
monster.maxHealth = 300000
monster.race = "venom"
monster.corpse = 31599
monster.speed = 125
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Faceless Bane")
local monster = {}

monster.description = "Faceless Bane"
monster.experience = 30000
monster.experience = 20000
monster.outfit = {
lookType = 1119,
lookHead = 0,
Expand All @@ -22,7 +22,11 @@ monster.manaCost = 0

monster.changeTarget = {
interval = 4000,
chance = 10,
chance = 20,
}

monster.reflects = {
{ type = COMBAT_DEATHDAMAGE, percent = 90 },
}

monster.bosstiary = {
Expand Down Expand Up @@ -131,11 +135,7 @@ monster.elements = {
{ type = COMBAT_DROWNDAMAGE, percent = 0 },
{ type = COMBAT_ICEDAMAGE, percent = 0 },
{ type = COMBAT_HOLYDAMAGE, percent = 0 },
{ type = COMBAT_DEATHDAMAGE, percent = 99 },
}

monster.heals = {
{ type = COMBAT_DEATHDAMAGE, percent = 100 },
{ type = COMBAT_DEATHDAMAGE, percent = 50 },
}

monster.immunities = {
Expand All @@ -149,6 +149,11 @@ mType.onThink = function(monster, interval) end

mType.onAppear = function(monster, creature)
if monster:getType():isRewardBoss() then
-- reset global storage state to default / ensure sqm's reset for the next team
Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.Deaths, -1)
Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn, -1)
Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.ResetSteps, 1)
monster:registerEvent("facelessBaneImmunity")
monster:setReward(true)
end
end
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/emael.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:say("Ah, I see you killed a lot of dangerous creatures. Here's your podium of vigour!", npc, creature)
local inbox = player:getStoreInbox()
local inboxItems = inbox:getItems()
if inbox and #inboxItems <= inbox:getMaxCapacity() then
if inbox and #inboxItems < inbox:getMaxCapacity() then
local decoKit = inbox:addItem(ITEM_DECORATION_KIT, 1)
if decoKit then
decoKit:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Unwrap it in your own house to create a <" .. ItemType(38707):getName() .. ">.")
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/emperor_kruzak.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ local function creatureSayCallback(npc, creature, type, message)
if player:getMoney() + player:getBankBalance() >= 500000000 then
local inbox = player:getStoreInbox()
local inboxItems = inbox:getItems()
if inbox and #inboxItems <= inbox:getMaxCapacity() then
if inbox and #inboxItems < inbox:getMaxCapacity() then
local decoKit = inbox:addItem(ITEM_DECORATION_KIT, 1)
local decoItemName = ItemType(31510):getName()
decoKit:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "You bought this item in the Store.\nUnwrap it in your own house to create a " .. decoItemName .. ".")
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/hireling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ function createHirelingType(HirelingName)
local inboxItems = inbox:getItems()
if player:getFreeCapacity() < itType:getWeight(1) then
npcHandler:say("Sorry, but you don't have enough capacity.", npc, creature)
elseif not inbox or #inboxItems > inbox:getMaxCapacity() then
elseif not inbox or #inboxItems >= inbox:getMaxCapacity() then
player:getPosition():sendMagicEffect(CONST_ME_POFF)
npcHandler:say("Sorry, you don't have enough room on your inbox", npc, creature)
elseif not player:removeMoneyBank(15000) then
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/king_tibianus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ local function creatureSayCallback(npc, creature, type, message)
if player:getMoney() + player:getBankBalance() >= 500000000 then
local inbox = player:getStoreInbox()
local inboxItems = inbox:getItems()
if inbox and #inboxItems <= inbox:getMaxCapacity() then
if inbox and #inboxItems < inbox:getMaxCapacity() then
local decoKit = inbox:addItem(ITEM_DECORATION_KIT, 1)
local decoItemName = ItemType(31510):getName()
decoKit:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Unwrap it in your own house to create a " .. decoItemName .. ".")
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/queen_eloise.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ local function creatureSayCallback(npc, creature, type, message)
if player:getMoney() + player:getBankBalance() >= 500000000 then
local inbox = player:getStoreInbox()
local inboxItems = inbox:getItems()
if inbox and #inboxItems <= inbox:getMaxCapacity() then
if inbox and #inboxItems < inbox:getMaxCapacity() then
local decoKit = inbox:addItem(ITEM_DECORATION_KIT, 1)
local decoItemName = ItemType(31510):getName()
decoKit:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "You bought this item in the Store.\nUnwrap it in your own house to create a " .. decoItemName .. ".")
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/walter_jaeger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ local function processItemInboxPurchase(player, name, id)

local inbox = player:getStoreInbox()
local inboxItems = inbox:getItems()
if inbox and #inboxItems <= inbox:getMaxCapacity() then
if inbox and #inboxItems < inbox:getMaxCapacity() then
local decoKit = inbox:addItem(ITEM_DECORATION_KIT, 1)
if decoKit then
decoKit:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "You bought this item with the Walter Jaeger.\nUnwrap it in your own house to create a <" .. name .. ">.")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
local bossName = "Faceless Bane"

local function healBoss(creature)
if creature then
creature:addHealth(creature:getMaxHealth())
creature:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT)
end
end

local function createSummons(creature)
if creature then
local pos = creature:getPosition()
Game.createMonster("Gazer Spectre", pos, true, false, creature)
Game.createMonster("Ripper Spectre", pos, true, false, creature)
Game.createMonster("Burster Spectre", pos, true, false, creature)
end
end

local function resetBoss(creature, deaths)
if creature then
healBoss(creature)
createSummons(creature)
Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.Deaths, deaths + 1)
Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn, 0)
Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.ResetSteps, 1)
end
end

local facelessBaneImmunity = CreatureEvent("facelessBaneImmunity")

function facelessBaneImmunity.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
if creature and creature:isMonster() and creature:getName() == bossName then
local creatureHealthPercent = (creature:getHealth() * 100) / creature:getMaxHealth()
local facelessBaneDeathsStorage = Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.Deaths)

if creatureHealthPercent <= 20 and facelessBaneDeathsStorage < 1 then
resetBoss(creature, facelessBaneDeathsStorage)
return true
elseif Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn) < 1 then
healBoss(creature)
return true
end
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end

facelessBaneImmunity:register()
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
local walkedPositions = {}
local lastResetTime = os.time()
local checkTime = false

local function resetWalkedPositions(checkLastResetTime)
if lastResetTime > os.time() and checkLastResetTime then
return true
end

walkedPositions = {}
Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn, 0)
lastResetTime = os.time() + (1 * 60)
end

local pipePositions = {
Position(33612, 32568, 13),
Position(33612, 32567, 13),
Position(33612, 32566, 13),
Position(33612, 32565, 13),
Position(33612, 32564, 13),
Position(33612, 32563, 13),
Position(33612, 32562, 13),
Position(33612, 32561, 13),
Position(33612, 32560, 13),
Position(33612, 32559, 13),
Position(33612, 32558, 13),
Position(33612, 32557, 13),
Position(33612, 32556, 13),
Position(33622, 32556, 13),
Position(33622, 32557, 13),
Position(33622, 32558, 13),
Position(33622, 32559, 13),
Position(33622, 32560, 13),
Position(33622, 32561, 13),
Position(33622, 32562, 13),
Position(33622, 32563, 13),
Position(33622, 32564, 13),
Position(33622, 32565, 13),
Position(33622, 32566, 13),
Position(33622, 32567, 13),
Position(33622, 32568, 13),
}

local function sendEnergyEffect()
for _, position in ipairs(pipePositions) do
position:sendMagicEffect(CONST_ME_PURPLEENERGY)
position:sendSingleSoundEffect(SOUND_EFFECT_TYPE_SPELL_GREAT_ENERGY_BEAM)
end

return true
end

local facelessBaneStepPositions = MoveEvent()

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

if Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.ResetSteps) == 1 then
Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.ResetSteps, 0)
lastResetTime = os.time()
resetWalkedPositions(true)
end

if not checkTime then
checkTime = addEvent(resetWalkedPositions, 15 * 1000, false)
end

if Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn) < 1 then
if #walkedPositions > 0 then
for _, walkedPos in ipairs(walkedPositions) do
if walkedPos == position then
return true
end
end
end

position:sendSingleSoundEffect(SOUND_EFFECT_TYPE_SPELL_BUZZ)
position:sendMagicEffect(CONST_ME_YELLOWENERGY)
table.insert(walkedPositions, position)

if #walkedPositions == 13 then
Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn, 1)
addEvent(resetWalkedPositions, 60 * 1000, true)
sendEnergyEffect()
checkTime = nil
end
end
return true
end

local facelessBaneSteps = {
Position(33615, 32567, 13),
Position(33613, 32567, 13),
Position(33611, 32563, 13),
Position(33610, 32561, 13),
Position(33611, 32558, 13),
Position(33614, 32557, 13),
Position(33617, 32558, 13),
Position(33620, 32557, 13),
Position(33623, 32558, 13),
Position(33624, 32561, 13),
Position(33623, 32563, 13),
Position(33621, 32567, 13),
Position(33619, 32567, 13),
}

for _, pos in ipairs(facelessBaneSteps) do
facelessBaneStepPositions:position(pos)
end

facelessBaneStepPositions:register()
2 changes: 1 addition & 1 deletion data/libs/functions/boss_lever.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function BossLever:onUse(player)
local currentTime = os.time()
if lastEncounter and currentTime < lastEncounter then
local timeLeft = lastEncounter - currentTime
local timeMessage = getTimeInWords(timeLeft) .. " to face " .. monsterName .. " again!"
local timeMessage = getTimeInWords(timeLeft) .. " to face " .. self.name .. " again!"
local message = "You have to wait " .. timeMessage

if currentPlayer ~= player then
Expand Down
4 changes: 2 additions & 2 deletions data/libs/systems/hireling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ function Hireling:returnToLamp(player_id)

local inbox = owner:getStoreInbox()
local inboxItems = inbox:getItems()
if not inbox or #inboxItems > inbox:getMaxCapacity() then
if not inbox or #inboxItems >= inbox:getMaxCapacity() then
owner:getPosition():sendMagicEffect(CONST_ME_POFF)
return owner:sendTextMessage(MESSAGE_FAILURE, "You don't have enough room in your inbox.")
end
Expand Down Expand Up @@ -556,7 +556,7 @@ function Player:addNewHireling(name, sex)

local inbox = self:getStoreInbox()
local inboxItems = inbox:getItems()
if not inbox or #inboxItems > inbox:getMaxCapacity() then
if not inbox or #inboxItems >= inbox:getMaxCapacity() then
self:getPosition():sendMagicEffect(CONST_ME_POFF)
self:sendTextMessage(MESSAGE_FAILURE, "You don't have enough room in your inbox.")
return false
Expand Down
4 changes: 2 additions & 2 deletions data/modules/scripts/blessings/blessings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Blessings.Credits = {

Blessings.Config = {
AdventurerBlessingLevel = configManager.getNumber(configKeys.ADVENTURERSBLESSING_LEVEL), -- Free full bless until level
HasToF = false, -- Enables/disables twist of fate
HasToF = not configManager.getBoolean(configKeys.TOGGLE_SERVER_IS_RETRO), -- Enables/disables twist of fate
InquisitonBlessPriceMultiplier = 1.1, -- Bless price multiplied by henricus
SkulledDeathLoseStoreItem = configManager.getBoolean(configKeys.SKULLED_DEATH_LOSE_STORE_ITEM), -- Destroy all items on store when dying with red/blackskull
InventoryGlowOnFiveBless = configManager.getBoolean(configKeys.INVENTORY_GLOW), -- Glow in yellow inventory items when the player has 5 or more bless,
Expand Down Expand Up @@ -142,7 +142,7 @@ Blessings.sendBlessDialog = function(player)
msg:addU16(Blessings.BitWiseTable[v.id])
msg:addByte(player:getBlessingCount(v.id))
if player:getClient().version > 1200 then
msg:addByte(0) -- Store Blessings Count
msg:addByte(player:getBlessingCount(v.id, true)) -- Store Blessings Count
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion data/modules/scripts/daily_reward/daily_reward.lua
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ function Player.selectDailyReward(self, msg)
-- Adding items to store inbox
local inbox = self:getStoreInbox()
local inboxItems = inbox:getItems()
if not inbox or #inboxItems > inbox:getMaxCapacity() then
if not inbox or #inboxItems >= inbox:getMaxCapacity() then
self:sendError("You do not have enough space in your store inbox.")
return false
end
Expand Down
4 changes: 2 additions & 2 deletions data/modules/scripts/gamestore/gamestore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ GameStore.Categories = {
icons = { "Blood_of_the_Mountain.png" },
name = "Blood of the Mountain",
price = 25,
blessid = 8,
blessid = 7,
count = 1,
id = GameStore.SubActions.BLESSING_BLOOD,
description = "<i>Reduces your character's chance to lose any items as well as the amount of your character's experience and skill loss upon death:</i>\n\n&#8226; 1 blessing = 8.00% less Skill / XP loss, 30% equipment protection\n&#8226; 2 blessing = 16.00% less Skill / XP loss, 55% equipment protection\n&#8226; 3 blessing = 24.00% less Skill / XP loss, 75% equipment protection\n&#8226; 4 blessing = 32.00% less Skill / XP loss, 90% equipment protection\n&#8226; 5 blessing = 40.00% less Skill / XP loss, 100% equipment protection\n&#8226; 6 blessing = 48.00% less Skill / XP loss, 100% equipment protection\n&#8226; 7 blessing = 56.00% less Skill / XP loss, 100% equipment protection\n\n{character} \n{limit|5} \n{info} added directly to the Record of Blessings \n{info} characters with a red or black skull will always lose all equipment upon death",
Expand All @@ -154,7 +154,7 @@ GameStore.Categories = {
icons = { "Heart_of_the_Mountain.png" },
name = "Heart of the Mountain",
price = 25,
blessid = 7,
blessid = 8,
count = 1,
id = GameStore.SubActions.BLESSING_HEART,
description = "<i>Reduces your character's chance to lose any items as well as the amount of your character's experience and skill loss upon death:</i>\n\n&#8226; 1 blessing = 8.00% less Skill / XP loss, 30% equipment protection\n&#8226; 2 blessing = 16.00% less Skill / XP loss, 55% equipment protection\n&#8226; 3 blessing = 24.00% less Skill / XP loss, 75% equipment protection\n&#8226; 4 blessing = 32.00% less Skill / XP loss, 90% equipment protection\n&#8226; 5 blessing = 40.00% less Skill / XP loss, 100% equipment protection\n&#8226; 6 blessing = 48.00% less Skill / XP loss, 100% equipment protection\n&#8226; 7 blessing = 56.00% less Skill / XP loss, 100% equipment protection\n\n{character} \n{limit|5} \n{info} added directly to the Record of Blessings \n{info} characters with a red or black skull will always lose all equipment upon death",
Expand Down
Loading

0 comments on commit bf48447

Please sign in to comment.