Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implementing bosstiary system #700

Merged
merged 12 commits into from
Feb 13, 2023
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