Skip to content

Commit

Permalink
feat: implement bosstiary system (opentibiabr#700)
Browse files Browse the repository at this point in the history
Implements the recently launched Bosstiary system into the game. Bosstiary is an addition to the in-game encyclopedia, allowing players to keep track of which bosses they have defeated and how many times. As players progress through the system, they will receive useful and sophisticated rewards such as equipment loot bonuses, temporary and permanent titles, and the ability to display the defeated boss on a Vigor Podium in their house or guild. Additionally, Bosstiary also features a daily strengthened boss, randomly selected each server save. This change implements all the aforementioned aspects of Bosstiary into the game engine.
  • Loading branch information
dudantas committed Feb 13, 2023
1 parent 5aa0b55 commit be7a0db
Show file tree
Hide file tree
Showing 256 changed files with 2,756 additions and 36 deletions.
5 changes: 5 additions & 0 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ forgeFiendishLimit = 3
forgeFiendishIntervalType = "hour"
forgeFiendishIntervalTime = "1"

-- Bosstiary system
boostedBossSlot = true
boostedBossLootBonus = 250
boostedBossKillBonus = 3

-- NOTE: Access only for Premium Account
onlyPremiumAccount = false

Expand Down
4 changes: 4 additions & 0 deletions data-canary/scripts/creaturescripts/login.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ function login.onLogin(player)
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, "Today's boosted creature: " .. Game.getBoostedCreature() .. " \
Boosted creatures yield more experience points, carry more loot than usual and respawn at a faster rate.")

-- Boosted boss
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, "Today's boosted boss: " .. Game.getBoostedBoss() .. " \
Boosted bosses contain more loot and count more kills for your Bosstiary.")

if SCHEDULE_EXP_RATE ~= 100 then
if SCHEDULE_EXP_RATE > 100 then
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, "Exp Rate Event! Monsters yield more experience points than usual \
Expand Down
4 changes: 2 additions & 2 deletions data-canary/scripts/globalevents/global_server_save.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ local function ServerSave()
cleanMap()
end
if configManager.getBoolean(configKeys.GLOBAL_SERVER_SAVE_CLOSE) then
Game.setGameState(GAME_STATE_CLOSED)
Game.setGameState(GAME_STATE_CLOSED, true)
end
if configManager.getBoolean(configKeys.GLOBAL_SERVER_SAVE_SHUTDOWN) then
Game.setGameState(GAME_STATE_SHUTDOWN)
Game.setGameState(GAME_STATE_SHUTDOWN, true)
end
-- Updating daily reward next server save
UpdateDailyRewardGlobalStorage(DailyReward.storages.lastServerSave, os.time())
Expand Down
14 changes: 12 additions & 2 deletions data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2702,8 +2702,10 @@ Storage = {
Darashia = 46860,
Thais = 46861,
Orclands = 46862,
IceIslands = 46863},
Cobra = 46864},
IceIslands = 46863
},
Cobra = 46864
},
HandOfTheInquisitionOutfits = {},
-- Kilmaresh = {}, done earlier in the file
},
Expand All @@ -2730,6 +2732,14 @@ Storage = {
U12_80 = { -- update 12.80 - Reserved Storages 47801 - 47850
RoyalCostumeOutfits = {}
},
},
-- Reserved Storages 64000 - 65000
BosstiaryCooldown = {
EarlOsam = 64000,
CountVlarkorth = 64001,
LordAzaram = 64002,
SirBaelocNictros = 64003,
DukeKrule = 64004
}
}

Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/migrations/23.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function onUpdateDatabase()
`gained` bigint UNSIGNED NOT NULL DEFAULT '0',
CONSTRAINT `forge_history_pk` PRIMARY KEY (`id`),
FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE
) ENGINE='InnoDB' DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
]])
return true
end
26 changes: 25 additions & 1 deletion data-otservbr-global/migrations/27.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
function onUpdateDatabase()
return false -- true = There are others migrations file | false = this is the last migration file
Spdlog.info("Updating database to version 28 (bosstiary system)")
db.query("ALTER TABLE `players` ADD `boss_points` int NOT NULL DEFAULT '0';")
db.query([[
CREATE TABLE IF NOT EXISTS `boosted_boss` (
`boostname` TEXT,
`date` varchar(250) NOT NULL DEFAULT '',
`raceid` varchar(250) NOT NULL DEFAULT '',
`looktype` int(11) NOT NULL DEFAULT "136",
`lookfeet` int(11) NOT NULL DEFAULT "0",
`looklegs` int(11) NOT NULL DEFAULT "0",
`lookhead` int(11) NOT NULL DEFAULT "0",
`lookbody` int(11) NOT NULL DEFAULT "0",
`lookaddons` int(11) NOT NULL DEFAULT "0",
`lookmount` int(11) DEFAULT "0",
PRIMARY KEY (`date`)
) AS SELECT 0 AS date, "default" AS boostname, 0 AS raceid]])

db.query([[
CREATE TABLE IF NOT EXISTS `player_bosstiary` (
`player_id` int NOT NULL,
`bossIdSlotOne` int NOT NULL DEFAULT 0,
`bossIdSlotTwo` int NOT NULL DEFAULT 0,
`removeTimes` int NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8;]])
return true
end
3 changes: 3 additions & 0 deletions data-otservbr-global/migrations/28.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function onUpdateDatabase()
return false -- true = There are others migrations file | false = this is the last migration file
end
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/bibby_bloodbath.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 10
}

monster.bosstiary = {
bossRaceId = 900,
bossRace = RARITY_ARCHFOE
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/big_boss_trolliver.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 5
}

monster.bosstiary = {
bossRaceId = 432,
bossRace = RARITY_NEMESIS
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/black_knight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 10
}

monster.bosstiary = {
bossRaceId = 46,
bossRace = RARITY_BANE
}

monster.strategiesTarget = {
nearest = 80,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/bullwark.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 3
}

monster.bosstiary = {
bossRaceId = 1060,
bossRace = RARITY_BANE
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/chikhaton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 30
}

monster.bosstiary = {
bossRaceId = 647,
bossRace = RARITY_NEMESIS
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/custodian.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 10
}

monster.bosstiary = {
bossRaceId = 1770,
bossRace = RARITY_BANE
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/dharalion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 8
}

monster.bosstiary = {
bossRaceId = 203,
bossRace = RARITY_NEMESIS
}

monster.strategiesTarget = {
nearest = 10,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/diblis_the_fair.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 10
}

monster.bosstiary = {
bossRaceId = 477,
bossRace = RARITY_NEMESIS
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/diseased_bill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 0
}

monster.bosstiary = {
bossRaceId = 485,
bossRace = RARITY_BANE
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/diseased_dan.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 0
}

monster.bosstiary = {
bossRaceId = 486,
bossRace = RARITY_BANE
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/diseased_fred.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 0
}

monster.bosstiary = {
bossRaceId = 484,
bossRace = RARITY_BANE
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/ekatrix.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 10
}

monster.bosstiary = {
bossRaceId = 1140,
bossRace = RARITY_ARCHFOE
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/fleshslicer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 50
}

monster.bosstiary = {
bossRaceId = 858,
bossRace = RARITY_BANE
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/gaffir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ monster.changeTarget = {
chance = 10
}

monster.bosstiary = {
bossRaceId = 1778,
bossRace = RARITY_BANE
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/general_murius.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 8
}

monster.bosstiary = {
bossRaceId = 207,
bossRace = RARITY_NEMESIS
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/glitterscale.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 10
}

monster.bosstiary = {
bossRaceId = 670,
bossRace = RARITY_BANE
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/grandfather_tridian.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 10
}

monster.bosstiary = {
bossRaceId = 431,
bossRace = RARITY_NEMESIS
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/gravelord_oshuran.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 10
}

monster.bosstiary = {
bossRaceId = 426,
bossRace = RARITY_NEMESIS
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/groam.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 50
}

monster.bosstiary = {
bossRaceId = 736,
bossRace = RARITY_NEMESIS
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/guard_captain_quaid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 10
}

monster.bosstiary = {
bossRaceId = 1791,
bossRace = RARITY_BANE
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/hairman_the_huge.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 14
}

monster.bosstiary = {
bossRaceId = 425,
bossRace = RARITY_NEMESIS
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/heoni.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 10
}

monster.bosstiary = {
bossRaceId = 671,
bossRace = RARITY_BANE
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/jesse_the_wicked.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 5
}

monster.bosstiary = {
bossRaceId = 763,
bossRace = RARITY_NEMESIS
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/monster/bosses/kroazur.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ monster.changeTarget = {
chance = 20
}

monster.bosstiary = {
bossRaceId = 1515,
bossRace = RARITY_BANE
}

monster.strategiesTarget = {
nearest = 70,
health = 10,
Expand Down
Loading

0 comments on commit be7a0db

Please sign in to comment.