Skip to content

Commit

Permalink
Merge branch 'main' into Fix-uptime
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel authored Jul 5, 2024
2 parents 9578aff + 3aeb3e7 commit 94ac5a1
Show file tree
Hide file tree
Showing 143 changed files with 2,279 additions and 1,343 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
1 change: 1 addition & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"DEBUG_LOG": "ON",
"ASAN_ENABLED": "OFF",
"BUILD_STATIC_LIBRARY": "OFF",
"SPEED_UP_BUILD_UNITY": "OFF",
"VCPKG_TARGET_TRIPLET": "x64-windows"
}
},
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
21 changes: 11 additions & 10 deletions data-otservbr-global/npc/sam.lua
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ npcConfig.shop = {
{ itemName = "legion helmet", clientId = 3374, sell = 22 },
{ itemName = "longsword", clientId = 3285, buy = 160, sell = 51 },
{ itemName = "mace", clientId = 3286, buy = 90, sell = 30 },
{ itemName = "magic plate armor", clientId = 3366, sell = 6400 },
{ itemName = "morning star", clientId = 3282, buy = 430, sell = 100 },
{ itemName = "orcish axe", clientId = 3316, sell = 350 },
{ itemName = "plate armor", clientId = 3357, buy = 1200, sell = 400 },
Expand All @@ -227,16 +228,16 @@ npcConfig.shop = {
{ itemName = "steel shield", clientId = 3409, buy = 240, sell = 80 },
{ itemName = "studded armor", clientId = 3378, buy = 90, sell = 25 },
{ itemName = "studded club", clientId = 3336, sell = 10 },
{ itemName = "studded helmet", clientId = 3376, buy = 63 },
{ itemName = "studded legs", clientId = 3362, buy = 50 },
{ itemName = "studded shield", clientId = 3426, buy = 50 },
{ itemName = "sword", clientId = 3264, buy = 85 },
{ itemName = "throwing knife", clientId = 3298, buy = 25 },
{ itemName = "two handed sword", clientId = 3265, buy = 950 },
{ itemName = "viking helmet", clientId = 3367, buy = 265 },
{ itemName = "viking shield", clientId = 3431, buy = 260 },
{ itemName = "war hammer", clientId = 3279, buy = 10000 },
{ itemName = "wooden shield", clientId = 3412, buy = 15 },
{ itemName = "studded helmet", clientId = 3376, buy = 63, sell = 20 },
{ itemName = "studded legs", clientId = 3362, buy = 50, sell = 15 },
{ itemName = "studded shield", clientId = 3426, buy = 50, sell = 16 },
{ itemName = "sword", clientId = 3264, buy = 85, sell = 25 },
{ itemName = "throwing knife", clientId = 3298, buy = 25, sell = 2 },
{ itemName = "two handed sword", clientId = 3265, buy = 950, sell = 450 },
{ itemName = "viking helmet", clientId = 3367, buy = 265, sell = 66 },
{ itemName = "viking shield", clientId = 3431, buy = 260, sell = 85 },
{ itemName = "war hammer", clientId = 3279, buy = 10000, sell = 470 },
{ itemName = "wooden shield", clientId = 3412, buy = 15, sell = 5 },
}
-- On buy npc shop message
npcType.onBuyItem = function(npc, player, itemId, subType, amount, ignore, inBackpacks, totalCost)
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
42 changes: 26 additions & 16 deletions data-otservbr-global/scripts/creaturescripts/customs/freequests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,35 +60,35 @@ local questTable = {
{ storage = Storage.InServiceofYalahar.DoorToMatrix, storageValue = 1 },
{ storage = Storage.InServiceofYalahar.DoorToQuara, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Questline, storageValue = 7 },
{ storage = Storage.CultsOfTibia.Minotaurs.jamesfrancisTask, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Minotaurs.JamesfrancisTask, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Minotaurs.Mission, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Minotaurs.bossTimer, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Minotaurs.BossTimer, storageValue = 1 },
{ storage = Storage.CultsOfTibia.MotA.Mission, storageValue = 1 },
{ storage = Storage.CultsOfTibia.MotA.Pedra1, storageValue = 1 },
{ storage = Storage.CultsOfTibia.MotA.Pedra2, storageValue = 1 },
{ storage = Storage.CultsOfTibia.MotA.Pedra3, storageValue = 1 },
{ storage = Storage.CultsOfTibia.MotA.Respostas, storageValue = 1 },
{ storage = Storage.CultsOfTibia.MotA.Perguntaid, storageValue = 1 },
{ storage = Storage.CultsOfTibia.MotA.Stone1, storageValue = 1 },
{ storage = Storage.CultsOfTibia.MotA.Stone2, storageValue = 1 },
{ storage = Storage.CultsOfTibia.MotA.Stone3, storageValue = 1 },
{ storage = Storage.CultsOfTibia.MotA.Answer, storageValue = 1 },
{ storage = Storage.CultsOfTibia.MotA.QuestionId, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Barkless.Mission, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Barkless.sulphur, storageValue = 4 },
{ storage = Storage.CultsOfTibia.Barkless.Tar, storageValue = 3 },
{ storage = Storage.CultsOfTibia.Barkless.Ice, storageValue = 3 },
{ storage = Storage.CultsOfTibia.Barkless.Objects, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Barkless.Temp, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Orcs.Mission, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Orcs.lookType, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Orcs.bossTimer, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Orcs.LookType, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Orcs.BossTimer, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Life.Mission, storageValue = 7 },
{ storage = Storage.CultsOfTibia.Life.bossTimer, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Life.BossTimer, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Humans.Mission, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Humans.Vaporized, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Humans.Decaying, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Humans.bossTimer, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Humans.BossTimer, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Misguided.Mission, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Misguided.Monsters, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Misguided.Exorcisms, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Misguided.Time, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Misguided.bossTimer, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Misguided.BossTimer, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Minotaurs.EntranceAccessDoor, storageValue = 1 },
{ storage = Storage.CultsOfTibia.Minotaurs.AccessDoor, storageValue = 1 },
{ storage = Storage.ExplorerSociety.QuestLine, storageValue = 1 },
Expand Down Expand Up @@ -119,6 +119,7 @@ local questTable = {
{ storage = Storage.ForgottenKnowledge.LloydKilled, storageValue = 1 },
{ storage = Storage.ForgottenKnowledge.LadyTenebrisKilled, storageValue = 1 },
{ storage = Storage.ForgottenKnowledge.AccessMachine, storageValue = 1 },
{ storage = Storage.ForgottenKnowledge.AccessLavaTeleport, storageValue = 1 },
{ storage = Storage.BarbarianTest.Questline, storageValue = 8 },
{ storage = Storage.BarbarianTest.Mission01, storageValue = 3 },
{ storage = Storage.BarbarianTest.Mission02, storageValue = 3 },
Expand Down Expand Up @@ -146,8 +147,8 @@ local questTable = {
{ storage = Storage.DjinnWar.MaridFaction.Mission02, storageValue = 2 },
{ storage = Storage.DjinnWar.MaridFaction.RataMari, storageValue = 2 },
{ storage = Storage.DjinnWar.MaridFaction.Mission03, storageValue = 3 },
{ storage = Storage.TheWayToYalahar.Questline, storageValue = 1 },
{ storage = Storage.SearoutesAroundYalahar.TownsCounter, storageValue = 1 },
{ storage = Storage.TheWayToYalahar.QuestLine, storageValue = 1 },
{ storage = Storage.SearoutesAroundYalahar.TownsCounter, storageValue = 5 },
{ storage = Storage.SearoutesAroundYalahar.AbDendriel, storageValue = 1 },
{ storage = Storage.SearoutesAroundYalahar.Darashia, storageValue = 1 },
{ storage = Storage.SearoutesAroundYalahar.Venore, storageValue = 1 },
Expand Down Expand Up @@ -205,7 +206,7 @@ local questTable = {
{ storage = Storage.Quest.U8_54.TheNewFrontier.Mission05.KingTibianus, storageValue = 1 },
{ storage = Storage.Quest.U8_54.TheNewFrontier.Mission05.Leeland, storageValue = 1 },
{ storage = Storage.Quest.U8_54.TheNewFrontier.Mission05.Angus, storageValue = 1 },
{ storage = Storage.Quest.U8_54.TheNewFrontier.Mission05.Wydrin, storageValue = 1 },
{ storage = Storage.Quest.U8_54.TheNewFrontier.Mission05.Wyrdin, storageValue = 1 },
{ storage = Storage.Quest.U8_54.TheNewFrontier.Mission05.Telas, storageValue = 1 },
{ storage = Storage.Quest.U8_54.TheNewFrontier.Mission05.Humgolf, storageValue = 1 },
{ storage = Storage.TheShatteredIsles.DefaultStart, storageValue = 3 },
Expand Down Expand Up @@ -314,6 +315,7 @@ local questTable = {
{ storage = Storage.FerumbrasAscension.TarbazDoor, storageValue = 1 },
{ storage = Storage.FerumbrasAscension.HabitatsAccess, storageValue = 1 },
{ storage = Storage.FerumbrasAscension.TheLordOfTheLiceAccess, storageValue = 1 },
{ storage = Storage.FerumbrasAscension.Statue, storageValue = 1 },

{ storage = Storage.Quest.U12_00.TheDreamCourts.AndrewDoor, storageValue = 1 },

Expand Down Expand Up @@ -372,11 +374,19 @@ local questTable = {
{ storage = Storage.OutfitQuest.DefaultStart, storageValue = 1 },

{ storage = Storage.HeroRathleton.AccessDoor, storageValue = 1 },
{ storage = Storage.HeroRathleton.FastWay, storageValue = 1 },
{ storage = Storage.HeroRathleton.AccessTeleport1, storageValue = 1 },
{ storage = Storage.HeroRathleton.AccessTeleport2, storageValue = 1 },
{ storage = Storage.HeroRathleton.AccessTeleport3, storageValue = 1 },

-- Sea Serpent Quest
{ storage = Storage.Quest.U8_2.FishForASerpent.QuestLine, storageValue = 5 },
{ storage = Storage.Quest.U8_2.TheHuntForTheSeaSerpent.QuestLine, storageValue = 2 },

--The White Raven Monastery
{ storage = Storage.WhiteRavenMonastery.QuestLog, storageValue = 1 },
{ storage = Storage.WhiteRavenMonastery.Passage, storageValue = 1 },
{ storage = Storage.WhiteRavenMonastery.Diary, storageValue = 2 },
{ storage = Storage.WhiteRavenMonastery.Door, storageValue = 1 },
}

-- from Position: (33201, 31762, 1)
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()
Loading

0 comments on commit 94ac5a1

Please sign in to comment.