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: soul pit arena/animus mastery/soul core #3230

Open
wants to merge 91 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
9422272
feat: add getMonstersByRace and getMonstersByBestiaryStars
FelipePaluco Nov 28, 2024
089b455
feat: add method to capture soulcore id from monster type
FelipePaluco Nov 28, 2024
2dd1d02
Code format - (Clang-format)
github-actions[bot] Nov 28, 2024
4193bc2
improve: references and iterations
phacUFPE Dec 1, 2024
a415e89
fix: hpp method declaration
phacUFPE Dec 1, 2024
30c1866
feat: initiating the soulpit stages
phacUFPE Dec 2, 2024
427116c
Lua code format - (Stylua)
github-actions[bot] Dec 2, 2024
9c2cd78
feat: add soul core item drop feature
FelipePaluco Dec 2, 2024
1b7ed4d
Code format - (Clang-format)
github-actions[bot] Dec 2, 2024
691e847
fix: soulpit fight
phacUFPE Dec 2, 2024
5604f68
Merge branch 'feat/soulpit' of https://github.com/opentibiabr/canary …
phacUFPE Dec 2, 2024
44fdece
fix: spells
phacUFPE Dec 2, 2024
3647df2
fix: soulpit fight
phacUFPE Dec 3, 2024
21b6a08
Lua code format - (Stylua)
github-actions[bot] Dec 3, 2024
b67867b
fix: conditions and spells
phacUFPE Dec 3, 2024
2c68216
Merge branch 'feat/soulpit' of https://github.com/opentibiabr/canary …
phacUFPE Dec 3, 2024
8c3842f
improve: monsters soulpit creation
phacUFPE Dec 3, 2024
d15f666
fix: soulpit creatureevents
phacUFPE Dec 4, 2024
2cef8b4
Lua code format - (Stylua)
github-actions[bot] Dec 4, 2024
1d484a9
fix: bestiary on battle and improvements
phacUFPE Dec 4, 2024
4d57457
Merge branch 'feat/soulpit' of https://github.com/opentibiabr/canary …
phacUFPE Dec 4, 2024
89efd86
fix: soulpit bosstiary and hunting task points
phacUFPE Dec 4, 2024
dd2f967
feat: add upgrade soul prism mechanic
FelipePaluco Dec 4, 2024
09aef6b
Lua code format - (Stylua)
github-actions[bot] Dec 4, 2024
d081da2
improve: soulprism code
phacUFPE Dec 4, 2024
19ad890
fix: summons inheriting boss abilities and some improvements
phacUFPE Dec 5, 2024
d26e2e2
Update game.cpp
mehah Dec 4, 2024
11b1101
update
mehah Dec 5, 2024
1783742
improve: customizable bosses abilities
phacUFPE Dec 5, 2024
3b29783
Lua code format - (Stylua)
github-actions[bot] Dec 5, 2024
1106b4c
Merge branch 'main' into feat/soulpit
phacUFPE Dec 5, 2024
b1aa5b3
feat: add downgrade exalted core mechanic
FelipePaluco Dec 6, 2024
b585691
fix: soulprimsm being returned
phacUFPE Dec 6, 2024
b284851
Merge branch 'feat/soulpit' of https://github.com/opentibiabr/canary …
phacUFPE Dec 6, 2024
24e8cd6
feat: add fusion possibility through soul cores
FelipePaluco Dec 6, 2024
698c4e0
Lua code format - (Stylua)
github-actions[bot] Dec 6, 2024
02fff0a
feat: animus mastery
phacUFPE Dec 6, 2024
71e5a78
feat: gain animus mastery experience and exp message update
phacUFPE Dec 7, 2024
c61916e
feat: add chance to drop soul prism
FelipePaluco Dec 7, 2024
384f35d
fix: final adjustments
phacUFPE Dec 9, 2024
e68559d
Merge branch 'feat/soulpit' of https://github.com/opentibiabr/canary …
phacUFPE Dec 9, 2024
25c48e2
Code format - (Clang-format)
github-actions[bot] Dec 9, 2024
14abc60
perf: condition
phacUFPE Jan 5, 2025
03d578c
fix: instace monsters spells and some improvements
phacUFPE Jan 7, 2025
6e993db
fix: bestiary race and stars monsterType to export in Game instead of…
phacUFPE Jan 7, 2025
be7e954
feat: add getMonstersByRace and getMonstersByBestiaryStars
FelipePaluco Nov 28, 2024
db7be76
feat: add method to capture soulcore id from monster type
FelipePaluco Nov 28, 2024
097c7b0
Code format - (Clang-format)
github-actions[bot] Nov 28, 2024
824e6ad
improve: references and iterations
phacUFPE Dec 1, 2024
5f11b76
fix: hpp method declaration
phacUFPE Dec 1, 2024
cf4eec0
feat: initiating the soulpit stages
phacUFPE Dec 2, 2024
3b2f4ed
fix: soulpit fight
phacUFPE Dec 2, 2024
26bc575
Lua code format - (Stylua)
github-actions[bot] Dec 2, 2024
8713f87
feat: add soul core item drop feature
FelipePaluco Dec 2, 2024
1de736c
Code format - (Clang-format)
github-actions[bot] Dec 2, 2024
398793b
fix: spells
phacUFPE Dec 2, 2024
602c733
fix: soulpit fight
phacUFPE Dec 3, 2024
fe97ee5
fix: conditions and spells
phacUFPE Dec 3, 2024
e3b4354
Lua code format - (Stylua)
github-actions[bot] Dec 3, 2024
9c99d35
improve: monsters soulpit creation
phacUFPE Dec 3, 2024
664a806
fix: soulpit creatureevents
phacUFPE Dec 4, 2024
a0f30c3
fix: bestiary on battle and improvements
phacUFPE Dec 4, 2024
5de219c
Lua code format - (Stylua)
github-actions[bot] Dec 4, 2024
eb09ea7
fix: soulpit bosstiary and hunting task points
phacUFPE Dec 4, 2024
1bfea71
feat: add upgrade soul prism mechanic
FelipePaluco Dec 4, 2024
8b87f4a
Lua code format - (Stylua)
github-actions[bot] Dec 4, 2024
9501b44
improve: soulprism code
phacUFPE Dec 4, 2024
319d742
fix: summons inheriting boss abilities and some improvements
phacUFPE Dec 5, 2024
9f654d0
improve: customizable bosses abilities
phacUFPE Dec 5, 2024
c4e539f
Lua code format - (Stylua)
github-actions[bot] Dec 5, 2024
5d91df4
fix: soulprimsm being returned
phacUFPE Dec 6, 2024
9333f5f
feat: add downgrade exalted core mechanic
FelipePaluco Dec 6, 2024
b582c8f
feat: add fusion possibility through soul cores
FelipePaluco Dec 6, 2024
0b0452a
Lua code format - (Stylua)
github-actions[bot] Dec 6, 2024
a14c4bf
feat: animus mastery
phacUFPE Dec 6, 2024
78e9ae0
feat: gain animus mastery experience and exp message update
phacUFPE Dec 7, 2024
c263ad3
fix: final adjustments
phacUFPE Dec 9, 2024
ba5ab7d
feat: add chance to drop soul prism
FelipePaluco Dec 7, 2024
9b5285d
Code format - (Clang-format)
github-actions[bot] Dec 9, 2024
363524a
perf: condition
phacUFPE Jan 5, 2025
84c15c9
fix: instace monsters spells and some improvements
phacUFPE Jan 7, 2025
5ca3287
fix: bestiary race and stars monsterType to export in Game instead of…
phacUFPE Jan 7, 2025
603f498
chore: remove log and adjust drop chances
FelipePaluco Jan 7, 2025
9b807ce
feat: add soulpit move events and actions
FelipePaluco Jan 8, 2025
3a75a56
fix: soulpit positions and obelisk id
FelipePaluco Jan 8, 2025
652ab98
Lua code format - (Stylua)
github-actions[bot] Jan 8, 2025
3e99b3b
fix: conflicts with migrations
FelipePaluco Jan 8, 2025
b3ac65e
Merge branch 'main' into feat/soulpit
FelipePaluco Jan 9, 2025
0f98c28
Merge branch 'main' into feat/soulpit
FelipePaluco Jan 9, 2025
668270b
Merge branch 'feat/soulpit' of https://github.com/opentibiabr/canary …
phacUFPE Jan 10, 2025
4bc4095
fix: change to scoped and fix ubuntu pipeline
phacUFPE Jan 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ maxItem = 5000
maxContainer = 500
maxContainerDepth = 200

-- Animus Mastery - SoulPit (Get more info in: https://github.com/opentibiabr/canary/pull/3230)
-- NOTE: animusMasteryMaxMonsterXpMultiplier is the maximum experience the multiplier can be.
-- NOTE: animusMasteryMonsterXpMultiplier is the monster experience multiplier that has the animus mastery unlocked.
-- NOTE: animusMasteryMonstersXpMultiplier is the multiplier for each 'animusMasteryMonstersToIncreaseXpMultiplier' monsters that
-- the player has the animus mastery unlocked.
-- NOTE: animusMasteryMonstersToIncreaseXpMultiplier is the amount of monster to increase the experience multiplier by 'animusMasteryMonstersXpMultiplier'.
animusMasteryMaxMonsterXpMultiplier = 4.0
animusMasteryMonsterXpMultiplier = 2.0
animusMasteryMonstersXpMultiplier = 0.1
animusMasteryMonstersToIncreaseXpMultiplier = 10

-- Augments System (Get more info in: https://github.com/opentibiabr/canary/pull/2602)
-- NOTE: the following values are for all weapons and equipments that have type of "increase damage", "powerful impact" and "strong impact".
-- To customize the percentage of a particular item with these augment types, please add to the item "augments" section on items.xml as the example above.
Expand Down
1 change: 1 addition & 0 deletions data-otservbr-global/lib/others/load.lua
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dofile(DATA_DIRECTORY .. "/lib/others/dawnport.lua")
dofile(DATA_DIRECTORY .. "/lib/others/soulpit.lua")
169 changes: 169 additions & 0 deletions data-otservbr-global/lib/others/soulpit.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
SoulPit = {
SoulCoresConfiguration = {
chanceToGetSameMonsterSoulCore = 15, -- 15%
chanceToDropSoulCore = 5, -- 5%
chanceToGetOminousSoulCore = 2, -- 2%
chanceToDropSoulPrism = 4, -- 4%
monsterVariationsSoulCore = {
["Horse"] = "horse soul core (taupe)",
["Brown Horse"] = "horse soul core (brown)",
["Grey Horse"] = "horse soul core (gray)",
["Nomad"] = "nomad soul core (basic)",
["Nomad Blue"] = "nomad soul core (blue)",
["Nomad Female"] = "nomad soul core (female)",
["Purple Butterfly"] = "butterfly soul core (purple)",
["Butterfly"] = "butterfly soul core (blue)",
["Blue Butterfly"] = "butterfly soul core (blue)",
["Red Butterfly"] = "butterfly soul core (red)",
},
monstersDifficulties = {
["Harmless"] = 1,
["Trivial"] = 2,
["Easy"] = 3,
["Medium"] = 4,
["Hard"] = 5,
["Challenge"] = 6,
},
},
encounter = nil,
kickEvent = nil,
soulCores = Game.getSoulCoreItems(),
requiredLevel = 8,
playerPositions = {
{
pos = Position(32375, 31158, 8),
teleport = Position(32373, 31151, 8),
},
{
pos = Position(32375, 31159, 8),
teleport = Position(32374, 31151, 8),
},
{
pos = Position(32375, 31160, 8),
teleport = Position(32375, 31151, 8),
},
{
pos = Position(32375, 31161, 8),
teleport = Position(32376, 31151, 8),
},
{
pos = Position(32375, 31162, 8),
teleport = Position(32377, 31151, 8),
},
},
waves = {
[1] = {
stacks = {
[1] = 7,
},
},
[2] = {
stacks = {
[1] = 4,
[5] = 3,
},
},
[3] = {
stacks = {
[1] = 5,
[15] = 2,
},
},
[4] = {
stacks = {
[1] = 3,
[5] = 3,
[40] = 1,
},
},
},
effects = {
[1] = CONST_ME_TELEPORT,
[5] = CONST_ME_ORANGETELEPORT,
[15] = CONST_ME_REDTELEPORT,
[40] = CONST_ME_PURPLETELEPORT,
},
possibleAbilities = {
"overpowerSoulPit",
"enrageSoulPit",
"opressorSoulPit",
},
bossAbilities = {
overpowerSoulPit = {
criticalChance = 50, -- 50%
criticalDamage = 25, -- 25%
apply = function(monster)
monster:criticalChance(SoulPit.bossAbilities.overpowerSoulPit.criticalChance)
monster:criticalDamage(SoulPit.bossAbilities.overpowerSoulPit.criticalDamage)
end,
},
enrageSoulPit = {
bounds = {
[{ 0.8, 0.6 }] = 0.9, -- 10% damage reduction
[{ 0.6, 0.4 }] = 0.75, -- 25% damage reduction
[{ 0.4, 0.2 }] = 0.6, -- 40% damage reduction
[{ 0.0, 0.2 }] = 0.4, -- 60% damage reduction
},
apply = function(monster)
monster:registerEvent("enrageSoulPit")
end,
},
opressorSoulPit = {
spells = {
{ name = "soulpit opressor", interval = 2000, chance = 25, minDamage = 0, maxDamage = 0 },
{ name = "soulpit powerless", interval = 2000, chance = 30, minDamage = 0, maxDamage = 0 },
{ name = "soulpit intensehex", interval = 2000, chance = 15, minDamage = 0, maxDamage = 0 },
},
apply = function(monster)
-- Applying spells
for _, spell in pairs(SoulPit.bossAbilities.opressorSoulPit.spells) do
monster:addAttackSpell(readSpell(spell, monster:getType()))
end

return true
end,
},
},
timeToKick = 10 * 60 * 1000, -- 10 minutes
checkMonstersDelay = 4.5 * 1000, -- 4.5 seconds | The check delay should never be less than the timeToSpawnMonsters.
timeToSpawnMonsters = 4 * 1000, -- 4 seconds
totalMonsters = 7,
obeliskActive = 47379,
obeliskInactive = 47367,
obeliskPosition = Position(32375, 31157, 8),
bossPosition = Position(32376, 31144, 8),
exit = Position(32373, 31158, 8),
zone = Zone("soulpit"),

getMonsterVariationNameBySoulCore = function(searchName)
for mTypeName, soulCoreName in pairs(SoulPit.SoulCoresConfiguration.monsterVariationsSoulCore) do
if soulCoreName == searchName then
return mTypeName
end
end

return nil
end,
getSoulCoreMonster = function(name)
return name:match("^(.-) soul core")
end,
onFuseSoulCores = function(player, item, target)
local itemName = item:getName()
local targetItemName = target:getName()

if SoulPit.getSoulCoreMonster(itemName) and SoulPit.getSoulCoreMonster(targetItemName) then
local randomSoulCore = SoulPit.soulCores[math.random(#SoulPit.soulCores)]
player:addItem(randomSoulCore:getId(), 1)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have received a %s soul core.", randomSoulCore:getName()))
item:remove(1)
target:remove(1)
return true
end

return false
end,
}

SoulPit.zone:addArea(Position(32362, 31132, 8), Position(32390, 31153, 8))
SoulPit.zone:setRemoveDestination(SoulPit.exit)
5 changes: 5 additions & 0 deletions data-otservbr-global/migrations/49.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function onUpdateDatabase()
logger.info("Updating database to version 49 (feat: animus mastery (soulpit))")

db.query("ALTER TABLE `players` ADD `animus_mastery` mediumblob NOT NULL;")
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
local soulpitArenaExitConfig = {
arenaExit = Position(32375, 31153, 8),
destination = Position(32373, 31158, 8),
}

local soulpitArenaExit = Action()

function soulpitArenaExit.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not player then
return false
end
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
player:teleportTo(soulpitArenaExitConfig.destination)
end

soulpitArenaExit:position(soulpitArenaExitConfig.arenaExit)
soulpitArenaExit:register()
57 changes: 57 additions & 0 deletions data-otservbr-global/scripts/actions/soulpit/soulpit_entrance.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
local config = {
entrance = {
positions = {
Position(32350, 31030, 3),
Position(32349, 31030, 3),
},
destination = Position(32374, 31171, 8),
},
exit = {
position = Position(32374, 31173, 8),
destination = Position(32349, 31032, 3),
},
}

local soulpitEntrance = MoveEvent()

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

if not config.entrance.destination then
return true
end

player:teleportTo(config.entrance.destination)
position:sendMagicEffect(CONST_ME_TELEPORT)
return true
end

soulpitEntrance:type("stepin")
for value in pairs(config.entrance.positions) do
soulpitEntrance:position(config.entrance.positions[value])
end
soulpitEntrance:register()

local soulpitExit = MoveEvent()

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

if not config.exit then
return true
end

player:teleportTo(config.exit.destination)
position:sendMagicEffect(CONST_ME_TELEPORT)
return true
end

soulpitExit:type("stepin")
soulpitExit:position(config.exit.position)
soulpitExit:register()
92 changes: 92 additions & 0 deletions data-otservbr-global/scripts/quests/soulpit/exalted_core.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
local exaltedCore = Action()

local function getPreviousDifficultyLevel(currentLevel)
for level, value in pairs(SoulPit.SoulCoresConfiguration.monstersDifficulties) do
if value == currentLevel - 1 then
return level
end
end
return nil
end

local function getSoulCoreItemForMonster(monsterName)
local lowerMonsterName = monsterName:lower()
local soulCoreName = SoulPit.SoulCoresConfiguration.monsterVariationsSoulCore[monsterName]

if soulCoreName then
local newSoulCoreId = getItemIdByName(soulCoreName)
if newSoulCoreId then
return newSoulCoreId
end
else
local newMonsterSoulCore = string.format("%s soul core", monsterName)
local newSoulCoreId = getItemIdByName(newMonsterSoulCore)
if newSoulCoreId then
return newSoulCoreId
end
end

return false
end

function exaltedCore.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local itemName = target:getName()
local monsterName = SoulPit.getSoulCoreMonster(itemName)

if not monsterName then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can only use Exalted Core with a Soul Core.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end

local monsterType = MonsterType(monsterName)
if not monsterType then
player:sendTextMessage(MESSAGE_GAME_HIGHLIGHT, "Invalid monster type. Please contact an administrator.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end

local currentDifficulty = monsterType:BestiaryStars()
local previousDifficultyLevel = getPreviousDifficultyLevel(currentDifficulty)
local previousDifficultyMonsters = nil

if previousDifficultyLevel then
previousDifficultyMonsters = Game.getMonstersByBestiaryStars(SoulPit.SoulCoresConfiguration.monstersDifficulties[previousDifficultyLevel])
else
previousDifficultyLevel = currentDifficulty
previousDifficultyMonsters = Game.getMonstersByBestiaryStars(SoulPit.SoulCoresConfiguration.monstersDifficulties[currentDifficulty])
end

if #previousDifficultyMonsters == 0 then
player:sendTextMessage(MESSAGE_GAME_HIGHLIGHT, "No monsters available for the previous difficulty level.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end

local newMonsterType = previousDifficultyMonsters[math.random(#previousDifficultyMonsters)]
local newSoulCoreItem = getSoulCoreItemForMonster(newMonsterType:getName())
if not newSoulCoreItem then -- Retry a second time.
newSoulCoreItem = getSoulCoreItemForMonster(newMonsterType:getName())
if not newSoulCoreItem then
player:sendTextMessage(MESSAGE_GAME_HIGHLIGHT, "Failed to generate a Soul Core.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end
end

if player:getFreeCapacity() < ItemType(newSoulCoreItem):getWeight() then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You do not have enough capacity.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end

player:addItem(newSoulCoreItem, 1)
player:removeItem(target:getId(), 1)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have received a %s soul core.", newMonsterType:getName()))
player:removeItem(item:getId(), 1)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
return true
end

exaltedCore:id(37110)
exaltedCore:register()
Loading
Loading