Skip to content

Commit

Permalink
fix: stop mechanics on bosses death
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and dudantas committed Sep 10, 2024
1 parent a231525 commit 5d9e835
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 13 deletions.
18 changes: 16 additions & 2 deletions data-otservbr-global/lib/quests/soul_war.lua
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,13 @@ SoulWarQuest = {
{ 45, "Blaze of Burning Hatred" },
},

burningHatredMonsters = {
"Ashes of Burning Hatred",
"Spark of Burning Hatred",
"Flame of Burning Hatred",
"Blaze of Burning Hatred",
},

requiredCountPerApparition = 25,

-- Ebb and flow
Expand Down Expand Up @@ -1293,7 +1300,7 @@ end

function Monster:increaseHatredDamageMultiplier(multiplierCount)
local attackMultiplier = self:getHatredDamageMultiplier()
self:getSoulWarKV():set("burning-hatred-empowered", attackMultiplier + multiplierCount or 10)
self:getSoulWarKV():set("burning-hatred-empowered", attackMultiplier + multiplierCount)
end

function Monster:resetHatredDamageMultiplier()
Expand Down Expand Up @@ -1346,6 +1353,12 @@ function Monster:onThinkGoshnarTormentCounter(interval, maxLimit, intervalBetwee
for i = 1, #spectators do
local player = spectators[i]
local tormentCounter = player:getGoshnarSymbolTormentCounter()
local goshnarsHatred = Creature("Goshnar's Hatred")
if not goshnarsHatred then
player:resetGoshnarSymbolTormentCounter()
goto continue
end

if tormentCounter <= maxLimit then
player:increaseGoshnarSymbolTormentCounter(maxLimit)
logger.trace("Player {} has {} damage counter", player:getName(), tormentCounter)
Expand Down Expand Up @@ -1373,6 +1386,8 @@ function Monster:onThinkGoshnarTormentCounter(interval, maxLimit, intervalBetwee
elseif tormentCounter == 36 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The dread's torment is now lethal!")
end

::continue::
end
end

Expand Down Expand Up @@ -1535,7 +1550,6 @@ function Creature:applyZoneEffect(var, combat, zoneName)
return true
end


conditionOutfit:setTicks(outfitConfig.time)
conditionOutfit:setOutfit(outfitConfig.outfit)
target:addCondition(conditionOutfit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,14 @@ mType.onSpawn = function(monsterCallback)
firstTime = 0
end

mType.onDisappear = function(monster, creature) end
mType.onDisappear = function(monster, creature)
if creature:getName() == "Goshnar's Cruelty" then
local eyeCreature = Creature("A Greedy Eye")
if eyeCreature then
eyeCreature:remove()
end
end
end

mType.onMove = function(monster, creature, fromPosition, toPosition) end

Expand Down
11 changes: 10 additions & 1 deletion data-otservbr-global/monster/quests/soul_war/goshnars_hatred.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,16 @@ mType.onSpawn = function(monster)
monster:resetHatredDamageMultiplier()
end

mType.onDisappear = function(monster, creature) end
mType.onDisappear = function(monster, creature)
if creature:getName() == "Goshnar's Hatred" then
for _, monsterName in pairs(SoulWarQuest.burningHatredMonsters) do
local ashesCreature = Creature(monsterName)
if ashesCreature then
ashesCreature:remove()
end
end
end
end

mType.onMove = function(monster, creature, fromPosition, toPosition) end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,21 +552,14 @@ end
goshnarsHatredAccess:position(SoulWarQuest.goshnarsHatredAccessPosition.from)
goshnarsHatredAccess:register()

local burningHatredMonsters = {
"Ashes of Burning Hatred",
"Spark of Burning Hatred",
"Flame of Burning Hatred",
"Blaze of Burning Hatred",
}

local goshnarsHatredSorrow = Action()

function goshnarsHatredSorrow.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not target then
return
end

if not table.contains(burningHatredMonsters, target:getName()) then
if not table.contains(SoulWarQuest.burningHatredMonsters, target:getName()) then
logger.error("Player {} tried to use the item on a non-burning hatred monster.", player:getName())
return
end
Expand Down Expand Up @@ -610,7 +603,7 @@ function burningChangeForm.onThink(creature)
local boss = Creature("Goshnar's Hatred")
if boss then
logger.debug("Increasing hatred damage multiplier.")
boss:increaseHatredDamageMultiplier()
boss:increaseHatredDamageMultiplier(10)
end
logger.debug("Beginning of the burning transformation cycle.")
end
Expand Down
21 changes: 21 additions & 0 deletions data-otservbr-global/world/otservbr-monster.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162010,6 +162010,9 @@
<monster centerx="32505" centery="31594" centerz="14" radius="3">
<monster name="Warlock" x="0" y="-1" z="14" spawntime="90" />
</monster>
<monster centerx="33739" centery="31595" centerz="14" radius="1">
<monster name="Dreadful Harvester" x="0" y="0" z="14" spawntime="10" />
</monster>
<monster centerx="33349" centery="31596" centerz="14" radius="7">
<monster name="Dark Torturer" x="0" y="-7" z="14" spawntime="90" />
<monster name="Betrayed Wraith" x="5" y="-5" z="14" spawntime="90" />
Expand All @@ -162036,6 +162039,9 @@
<monster name="Dark Torturer" x="4" y="5" z="14" spawntime="90" />
<monster name="Lost Soul" x="0" y="6" z="14" spawntime="90" />
</monster>
<monster centerx="33748" centery="31596" centerz="14" radius="1">
<monster name="Dreadful Harvester" x="0" y="0" z="14" spawntime="10" />
</monster>
<monster centerx="32805" centery="31598" centerz="14" radius="1">
<monster name="Skeleton" x="1" y="0" z="14" spawntime="90" />
</monster>
Expand All @@ -162045,6 +162051,12 @@
<monster centerx="33161" centery="31598" centerz="14" radius="1">
<monster name="Dark Magician" x="0" y="1" z="14" spawntime="90" />
</monster>
<monster centerx="33738" centery="31599" centerz="14" radius="1">
<monster name="Symbol of Hatred" x="0" y="0" z="14" spawntime="10" />
</monster>
<monster centerx="33748" centery="31599" centerz="14" radius="1">
<monster name="Symbol of Hatred" x="0" y="0" z="14" spawntime="10" />
</monster>
<monster centerx="32808" centery="31600" centerz="14" radius="1">
<monster name="Ghoul" x="1" y="0" z="14" spawntime="90" />
</monster>
Expand All @@ -162059,6 +162071,9 @@
<monster centerx="33140" centery="31601" centerz="14" radius="1">
<monster name="Monk" x="1" y="-1" z="14" spawntime="90" />
</monster>
<monster centerx="33745" centery="31601" centerz="14" radius="1">
<monster name="Hateful Soul" x="1" y="0" z="14" spawntime="10" />
</monster>
<monster centerx="32423" centery="31602" centerz="14" radius="3">
<monster name="Warlock" x="-1" y="-3" z="14" spawntime="90" />
<monster name="Elf Arcanist" x="1" y="1" z="14" spawntime="90" />
Expand All @@ -162071,6 +162086,9 @@
<monster name="Demon Skeleton" x="1" y="0" z="14" spawntime="90" />
<monster name="Demon Skeleton" x="1" y="1" z="14" spawntime="90" />
</monster>
<monster centerx="33748" centery="31602" centerz="14" radius="1">
<monster name="Dreadful Harvester" x="0" y="0" z="14" spawntime="10" />
</monster>
<monster centerx="33156" centery="31603" centerz="14" radius="1">
<monster name="Stone Golem" x="1" y="-1" z="14" spawntime="90" />
</monster>
Expand All @@ -162092,6 +162110,9 @@
<monster name="Fire Elemental" x="0" y="4" z="14" spawntime="90" />
<monster name="Fire Elemental" x="4" y="4" z="14" spawntime="90" />
</monster>
<monster centerx="33743" centery="31603" centerz="14" radius="1">
<monster name="Hateful Soul" x="0" y="0" z="14" spawntime="10" />
</monster>
<monster centerx="33137" centery="31604" centerz="14" radius="1">
<monster name="Monk" x="0" y="-1" z="14" spawntime="90" />
</monster>
Expand Down

0 comments on commit 5d9e835

Please sign in to comment.