Skip to content

Commit

Permalink
fix: bosses quest heart of destruction (#2177)
Browse files Browse the repository at this point in the history
Co-authored-by: Elson Costa <elsongabriel@hotmail.com>
  • Loading branch information
Luan Luciano and elsongabriel authored Feb 21, 2024
1 parent fcfba7b commit 2be1f89
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 40 deletions.
10 changes: 5 additions & 5 deletions data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3065,11 +3065,11 @@ GlobalStorage = {
AftershockStage = 60176,
RuptureResonanceStage = 60177,
RuptureResonanceActive = 60178,
EradicatorWeak = 60178,
EradicatorReleaseT = 60179,
OutburstStage = 60180,
OutburstHealth = 60181,
OutburstChargingKilled = 60182,
EradicatorWeak = 60179,
EradicatorReleaseT = 60180,
OutburstStage = 60181,
OutburstHealth = 60182,
OutburstChargingKilled = 60183,
},
WorldBoard = {
NightmareIsle = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function chargedAnomalyDeath.onDeath(creature)
return true
end

local boss = Game.createMonster(config.bossName, bossPosition, false, true)
local boss = Game.createMonster(config.bossName, config.bossPosition, false, true)
if boss then
boss:addHealth(-healthRemove)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function heartMinionDeath.onDeath(creature)
rageSummon = rageSummon - 1
devourerSummon = devourerSummon - 1
elseif monster == "damage resonance" then
resonanceActive = false
Game.setStorageValue(GlobalStorage.HeartOfDestruction.RuptureResonanceActive, 0)
elseif monster == "disruption" or monster == "charged disruption" or monster == "overcharged disruption" then
destructionSummon = destructionSummon - 1
devourerSummon = devourerSummon - 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local function createSpawnWave(stage)
Game.createMonster("Spark of Destruction", Position(32330, 31250, 14), false, true)
Game.createMonster("Spark of Destruction", Position(32338, 31250, 14), false, true)
Game.createMonster("Damage Resonance", Position(32332, 31250, 14), false, true)
Game.setStorageValue(GlobalStorage.HeartOfDestruction.RuptureResonanceStage, stage)
Game.setStorageValue(GlobalStorage.HeartOfDestruction.RuptureResonanceStage, stage + 1)
Game.setStorageValue(GlobalStorage.HeartOfDestruction.RuptureResonanceActive, 1)
end

Expand All @@ -16,20 +16,20 @@ function ruptureResonance.onThink(creature)
end

local ruptureResonanceStage = Game.getStorageValue(GlobalStorage.HeartOfDestruction.RuptureResonanceStage) > 0 and Game.getStorageValue(GlobalStorage.HeartOfDestruction.RuptureResonanceStage) or 0
local resonanceActive = Game.setStorageValue(GlobalStorage.HeartOfDestruction.RuptureResonanceActive)
local resonanceActive = Game.getStorageValue(GlobalStorage.HeartOfDestruction.RuptureResonanceActive)

local thresholds = {
{ limit = 80, stage = 0, wave = 1 },
{ limit = 60, stage = 1, wave = 2 },
{ limit = 40, stage = 2, wave = 3 },
{ limit = 25, stage = 3, wave = 4 },
{ limit = 10, stage = 4, wave = -1 },
{ limit = 80, stage = 0 },
{ limit = 60, stage = 1 },
{ limit = 40, stage = 2 },
{ limit = 25, stage = 3 },
{ limit = 10, stage = 4 },
}

local hpPercent = (creature:getHealth() / creature:getMaxHealth()) * 100
for _, threshold in ipairs(thresholds) do
if hpPercent <= threshold.limit and ruptureResonanceStage == threshold.stage and resonanceActive ~= 1 then
createSpawnWave(threshold.wave)
createSpawnWave(threshold.stage)
break
end
end
Expand Down
32 changes: 7 additions & 25 deletions data-otservbr-global/scripts/spells/monster/outburst_explode.lua
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
local function outExplode()
local upConer = { x = 32223, y = 31273, z = 14 } -- upLeftCorner
local downConer = { x = 32246, y = 31297, z = 14 } -- downRightCorner

for i = upConer.x, downConer.x do
for j = upConer.y, downConer.y do
for k = upConer.z, downConer.z do
local room = { x = i, y = j, z = k }
local tile = Tile(room)
if tile then
local creatures = tile:getCreatures()
if creatures and #creatures > 0 then
for _, creatureUid in pairs(creatures) do
local creature = Creature(creatureUid)
if creature then
if creature:isPlayer() then
creature:teleportTo({ x = 32234, y = 31280, z = 14 })
elseif creature:isMonster() and creature:getName() == "Charging Outburst" then
creature:teleportTo({ x = 32234, y = 31279, z = 14 })
end
end
end
end
end
end
local spectators = Game.getSpectators(Position(32234, 31285, 14), false, true, 10, 10, 10, 10)
for _, spectator in ipairs(spectators) do
if spectator:isPlayer() then
spectator:teleportTo(Position(32234, 31280, 14))
elseif spectator:isMonster() and spectator:getName() == "Charging Outburst" then
spectator:teleportTo(Position(32234, 31279, 14))
end
end
end
Expand Down Expand Up @@ -54,7 +36,7 @@ local function delayedCastSpell(creature, var)
if not creature then
return
end
return combat:execute(creature, positionToVariant(creature:getPosition()))
return combat:execute(creature, Variant(creature:getPosition()))
end

function removeOutburst(cid)
Expand Down

0 comments on commit 2be1f89

Please sign in to comment.