Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyx14 committed Jul 6, 2024
1 parent 2897f9d commit 6410b20
Show file tree
Hide file tree
Showing 121 changed files with 1,820 additions and 1,134 deletions.
9 changes: 9 additions & 0 deletions data-otxserver/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
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()
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
local feroxaTransform = CreatureEvent("FeroxaTransform")
function feroxaTransform.onThink(creature)
if creature:getName():lower() ~= "feroxa" then
return true
end
if creature:getMaxHealth() == 100000 then
if creature:getHealth() <= 50000 then
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
Game.createMonster("feroxa2", creature:getPosition(), true, true)
creature:remove()
end
end
if creature:getMaxHealth() == 50000 then
if creature:getHealth() <= 25000 then
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
local feroxas = {
[1] = { name = "feroxa3" },
[2] = { name = "feroxa4" },
}
Game.createMonster(feroxas[math.random(#feroxas)].name, creature:getPosition(), true, true)
creature:remove()
end
end
end

feroxaTransform:register()

local feroxaDeath = CreatureEvent("FeroxaDeath")
function feroxaDeath.onDeath(creature, corpse, deathList)
if creature and creature:getMonster() then
local pool = Tile(creature:getPosition()):getItemById(2886)
if pool then
pool:remove()
end
Game.createMonster("Feroxa5", creature:getPosition(), true, true)
end
end

feroxaDeath:register()
32 changes: 22 additions & 10 deletions data/libs/functions/boss_lever.lua
Original file line number Diff line number Diff line change
Expand Up @@ -174,24 +174,36 @@ function BossLever:onUse(player)
end

if creature:getLevel() < self.requiredLevel then
creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "All the players need to be level " .. self.requiredLevel .. " or higher.")
local message = "All players need to be level " .. self.requiredLevel .. " or higher."
creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, message)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, message)
return false
end

if self:lastEncounterTime(creature) > os.time() then
local info = lever:getInfoPositions()
for _, v in pairs(info) do
local newPlayer = v.creature
if newPlayer then
local timeLeft = self:lastEncounterTime(newPlayer) - os.time()
newPlayer:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You or a member in your team have to wait " .. getTimeInWords(timeLeft) .. " to face " .. self.name .. " again!")
if self:lastEncounterTime(newPlayer) > os.time() then
newPlayer:getPosition():sendMagicEffect(CONST_ME_POFF)
if creature:getGroup():getId() < GROUP_TYPE_GOD and self:lastEncounterTime(creature) > os.time() then
local infoPositions = lever:getInfoPositions()
for _, posInfo in pairs(infoPositions) do
local currentPlayer = posInfo.creature
if currentPlayer then
local lastEncounter = self:lastEncounterTime(currentPlayer)
local currentTime = os.time()
if lastEncounter and currentTime < lastEncounter then
local timeLeft = lastEncounter - currentTime
local timeMessage = getTimeInWords(timeLeft) .. " to face " .. self.name .. " again!"
local message = "You have to wait " .. timeMessage

if currentPlayer ~= player then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "A member in your team has to wait " .. timeMessage)
end

currentPlayer:sendTextMessage(MESSAGE_EVENT_ADVANCE, message)
currentPlayer:getPosition():sendMagicEffect(CONST_ME_POFF)
end
end
end
return false
end

self.onUseExtra(creature)
return true
end)
Expand Down
4 changes: 2 additions & 2 deletions data/libs/systems/hireling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ function Hireling:returnToLamp(player_id)

local inbox = owner:getStoreInbox()
local inboxItems = inbox:getItems()
if not inbox or #inboxItems > inbox:getMaxCapacity() then
if not inbox or #inboxItems >= inbox:getMaxCapacity() then
owner:getPosition():sendMagicEffect(CONST_ME_POFF)
return owner:sendTextMessage(MESSAGE_FAILURE, "You don't have enough room in your inbox.")
end
Expand Down Expand Up @@ -556,7 +556,7 @@ function Player:addNewHireling(name, sex)

local inbox = self:getStoreInbox()
local inboxItems = inbox:getItems()
if not inbox or #inboxItems > inbox:getMaxCapacity() then
if not inbox or #inboxItems >= inbox:getMaxCapacity() then
self:getPosition():sendMagicEffect(CONST_ME_POFF)
self:sendTextMessage(MESSAGE_FAILURE, "You don't have enough room in your inbox.")
return false
Expand Down
4 changes: 2 additions & 2 deletions data/modules/scripts/blessings/blessings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Blessings.Credits = {

Blessings.Config = {
AdventurerBlessingLevel = configManager.getNumber(configKeys.ADVENTURERSBLESSING_LEVEL), -- Free full bless until level
HasToF = false, -- Enables/disables twist of fate
HasToF = not configManager.getBoolean(configKeys.TOGGLE_SERVER_IS_RETRO), -- Enables/disables twist of fate
InquisitonBlessPriceMultiplier = 1.1, -- Bless price multiplied by henricus
SkulledDeathLoseStoreItem = configManager.getBoolean(configKeys.SKULLED_DEATH_LOSE_STORE_ITEM), -- Destroy all items on store when dying with red/blackskull
InventoryGlowOnFiveBless = configManager.getBoolean(configKeys.INVENTORY_GLOW), -- Glow in yellow inventory items when the player has 5 or more bless,
Expand Down Expand Up @@ -142,7 +142,7 @@ Blessings.sendBlessDialog = function(player)
msg:addU16(Blessings.BitWiseTable[v.id])
msg:addByte(player:getBlessingCount(v.id))
if player:getClient().version > 1200 then
msg:addByte(0) -- Store Blessings Count
msg:addByte(player:getBlessingCount(v.id, true)) -- Store Blessings Count
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion data/modules/scripts/daily_reward/daily_reward.lua
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ function Player.selectDailyReward(self, msg)
-- Adding items to store inbox
local inbox = self:getStoreInbox()
local inboxItems = inbox:getItems()
if not inbox or #inboxItems > inbox:getMaxCapacity() then
if not inbox or #inboxItems >= inbox:getMaxCapacity() then
self:sendError("You do not have enough space in your store inbox.")
return false
end
Expand Down
4 changes: 2 additions & 2 deletions data/modules/scripts/gamestore/gamestore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ GameStore.Categories = {
icons = { "Blood_of_the_Mountain.png" },
name = "Blood of the Mountain",
price = 25,
blessid = 8,
blessid = 7,
count = 1,
id = GameStore.SubActions.BLESSING_BLOOD,
description = "<i>Reduces your character's chance to lose any items as well as the amount of your character's experience and skill loss upon death:</i>\n\n&#8226; 1 blessing = 8.00% less Skill / XP loss, 30% equipment protection\n&#8226; 2 blessing = 16.00% less Skill / XP loss, 55% equipment protection\n&#8226; 3 blessing = 24.00% less Skill / XP loss, 75% equipment protection\n&#8226; 4 blessing = 32.00% less Skill / XP loss, 90% equipment protection\n&#8226; 5 blessing = 40.00% less Skill / XP loss, 100% equipment protection\n&#8226; 6 blessing = 48.00% less Skill / XP loss, 100% equipment protection\n&#8226; 7 blessing = 56.00% less Skill / XP loss, 100% equipment protection\n\n{character} \n{limit|5} \n{info} added directly to the Record of Blessings \n{info} characters with a red or black skull will always lose all equipment upon death",
Expand All @@ -154,7 +154,7 @@ GameStore.Categories = {
icons = { "Heart_of_the_Mountain.png" },
name = "Heart of the Mountain",
price = 25,
blessid = 7,
blessid = 8,
count = 1,
id = GameStore.SubActions.BLESSING_HEART,
description = "<i>Reduces your character's chance to lose any items as well as the amount of your character's experience and skill loss upon death:</i>\n\n&#8226; 1 blessing = 8.00% less Skill / XP loss, 30% equipment protection\n&#8226; 2 blessing = 16.00% less Skill / XP loss, 55% equipment protection\n&#8226; 3 blessing = 24.00% less Skill / XP loss, 75% equipment protection\n&#8226; 4 blessing = 32.00% less Skill / XP loss, 90% equipment protection\n&#8226; 5 blessing = 40.00% less Skill / XP loss, 100% equipment protection\n&#8226; 6 blessing = 48.00% less Skill / XP loss, 100% equipment protection\n&#8226; 7 blessing = 56.00% less Skill / XP loss, 100% equipment protection\n\n{character} \n{limit|5} \n{info} added directly to the Record of Blessings \n{info} characters with a red or black skull will always lose all equipment upon death",
Expand Down
Loading

0 comments on commit 6410b20

Please sign in to comment.