Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-caminha committed Feb 10, 2025
2 parents cc26996 + 9719737 commit 0980925
Show file tree
Hide file tree
Showing 246 changed files with 8,294 additions and 6,685 deletions.
147 changes: 73 additions & 74 deletions data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ Storage = {
BossStatus = 43022, --1090
-- unused platinumReward = 43023,
-- unused backpackReward = 43024,
MainReward = 43025,
-- unused MainReward = 43025,
TeleportAccess = {
Rebel = 43026,
Zlak = 43027,
Expand Down Expand Up @@ -2114,84 +2114,83 @@ Storage = {
U10_90 = { -- update 10.90 - Reserved Storages 45201 - 45350
FerumbrasAscension = {
RiftRunner = 45201, -- Scroll
TheShattererTimer = 45202,
TheLordOfTheLiceTimer = 45203,
Tarbaz = 45204,
Razzagorn = 45205,
Ragiaz = 45206,
Zamulosh = 45207,
Shulgrax = 45208,
Mazoran = 45209,
Plagirath = 45210,
Access = 45211,
TheShatterer = 45212,
ZamuloshTeleports = 45213,
BasinCounter = 45214,
TheLordOfTheLiceAccess = 45215,
FirstDoor = 45216,
MonsterDoor = 45217,
TarbazDoor = 45218,
HabitatsAccess = 45219,
HabitatsTimer = 45220,
TarbazNotes = 45221,
ColorLever = 45222,
BoneFluteWall = 45223,
BoneFlute = 45224,
Ring = 45225,
Statue = 45226,
Fount = 45227,
Vampire = 45228,
Flower = 45229,
Ring2 = 45230,
Bone = 45231,
Reward = 45232,
TheShattererLever = 45233,
TheLordOfTheLiceTime = 45234,
TarbazTime = 45235,
RagiazTime = 45236,
PlagirathTime = 45237,
RazzagornTime = 45238,
ZamuloshTime = 45239,
MazoranTime = 45240,
ShulgraxTime = 45241,
FerumbrasMortalShellTime = 45242,
ZamuloshSummon = 45243,
FerumbrasEssence = 45244,
DesperateSoul = 45245,
FlowerPuzzleTimer = 45246,
Tarbaz = 45202,
Razzagorn = 45203,
Ragiaz = 45204,
Zamulosh = 45205,
Shulgrax = 45206,
Mazoran = 45207,
Plagirath = 45208,
Access = 45209,
TheShatterer = 45210,
ZamuloshTeleports = 45211,
BasinCounter = 45212,
TheLordOfTheLiceAccess = 45213,
FirstDoor = 45214,
MonsterDoor = 45215,
TarbazDoor = 45216,
HabitatsAccess = 45217,
HabitatsTimer = 45218,
TarbazNotes = 45219,
ColorLever = 45220,
BoneFluteWall = 45221,
BoneFlute = 45222,
Ring = 45223,
Statue = 45224,
Fount = 45225,
Vampire = 45226,
Flower = 45227,
Ring2 = 45228,
Bone = 45229,
Reward = 45230,
TheShattererLever = 45231,
TheShattererTimer = 45232,
TheLordOfTheLiceTimer = 45233,
TarbazTimer = 45234,
RagiazTimer = 45235,
PlagirathTimer = 45236,
RazzagornTimer = 45237,
ZamuloshTimer = 45238,
MazoranTimer = 45239,
ShulgraxTimer = 45240,
FerumbrasMortalShellTimer = 45241,
ZamuloshSummon = 45242,
FerumbrasEssence = 45243,
DesperateSoul = 45244,
FlowerPuzzleTimer = 45245,
Crystals = {
Crystal1 = 45247,
Crystal2 = 45248,
Crystal3 = 45249,
Crystal4 = 45250,
Crystal5 = 45251,
Crystal6 = 45252,
Crystal7 = 45253,
Crystal8 = 45254,
AllCrystals = 45255,
Crystal1 = 45246,
Crystal2 = 45247,
Crystal3 = 45248,
Crystal4 = 45249,
Crystal5 = 45250,
Crystal6 = 45251,
Crystal7 = 45252,
Crystal8 = 45253,
AllCrystals = 45254,
},
Habitats = {
Roshamuul = 45256,
Grass = 45257,
Mushroom = 45258,
Desert = 45259,
Venom = 45260,
Ice = 45261,
Corrupted = 45262,
Dimension = 45263,
AllHabitats = 45264,
Roshamuul = 45255,
Grass = 45256,
Mushroom = 45257,
Desert = 45258,
Venom = 45259,
Ice = 45260,
Corrupted = 45261,
Dimension = 45262,
AllHabitats = 45263,
},
Elements = {
First = 45265,
Second = 45266,
Third = 45267,
Four = 45268,
Active = 45269,
Done = 45270,
},
TheRiteOfEternalNight = 45271,
StoneCoffinsBones = 45272,
VampireTeeth = 45273,
First = 45264,
Second = 45265,
Third = 45266,
Four = 45267,
Active = 45268,
Done = 45269,
},
TheRiteOfEternalNight = 45270,
StoneCoffinsBones = 45271,
VampireTeeth = 45272,
},
Krailos = {},
},
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")
179 changes: 179 additions & 0 deletions data-otservbr-global/lib/others/soulpit.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
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),
effect = CONST_ME_TELEPORT,
},
{
pos = Position(32375, 31159, 8),
teleport = Position(32374, 31151, 8),
effect = CONST_ME_TELEPORT,
},
{
pos = Position(32375, 31160, 8),
teleport = Position(32375, 31151, 8),
effect = CONST_ME_TELEPORT,
},
{
pos = Position(32375, 31161, 8),
teleport = Position(32376, 31151, 8),
effect = CONST_ME_TELEPORT,
},
{
pos = Position(32375, 31162, 8),
teleport = Position(32377, 31151, 8),
effect = CONST_ME_TELEPORT,
},
},
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 itemCount = item:getCount(item:getId())
if item:getId() == target:getId() and itemCount <= 1 then
return false
end

local itemSoulCore = SoulPit.getSoulCoreMonster(item:getName())
local targetSoulCore = SoulPit.getSoulCoreMonster(target:getName())
if not itemSoulCore or not targetSoulCore then
return false
end

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,
}

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 DEFAULT NULL;")
end
Loading

0 comments on commit 0980925

Please sign in to comment.