Skip to content

Commit

Permalink
fix: revert some onSpawn monstertype callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Dec 24, 2024
1 parent 145da70 commit 8b8b28c
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ local function initialize(monster)
end

-- Functions for the fight
mType.onSpawn = function(monster, spawnPosition)
initialize(monster)
end

local function getHazardPoints(monster)
local hazard = Hazard.getByName("hazard.gnomprona-gardens")
if not hazard then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,15 @@ monster.immunities = {
{ type = "bleed", condition = false },
}

mType.onSpawn = function(monster, spawnPosition)
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

mType:register(monster)
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,16 @@ monster.immunities = {
{ type = "bleed", condition = false },
}

mType.onSpawn = function(monster, spawnPosition)
for i = 1, 5 do
local sum = Game.createMonster(monster:getType():getSummonList()[math.random(1, #monster:getType():getSummonList())].name, monster:getPosition(), true)
if sum then
monster:setSummon(sum)
sum:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
sum:setStorageValue(Storage.TheOrderOfTheLion.Drume.Commander, 1)
end
end
monster:setStorageValue(Storage.TheOrderOfTheLion.Drume.Commander, 1)
end

mType:register(monster)
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,17 @@ monster.immunities = {
{ type = "bleed", condition = false },
}

mType.onSpawn = function(monster, spawnPosition)
local sum
for i = 1, 5 do
sum = Game.createMonster(monster:getType():getSummonList()[math.random(1, #monster:getType():getSummonList())].name, monster:getPosition(), true)
if sum then
monster:setSummon(sum)
sum:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
sum:setStorageValue(Storage.TheOrderOfTheLion.Drume.Commander, 1)
end
end
monster:setStorageValue(Storage.TheOrderOfTheLion.Drume.Commander, 1)
end

mType:register(monster)
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ monster.immunities = {
{ type = "bleed", condition = false },
}

mType.onSpawn = function(monster, spawnPosition)
monster:setStorageValue(GrandMasterOberonConfig.Storage.Asking, 1)
monster:setStorageValue(GrandMasterOberonConfig.Storage.Life, 1)
end

mType.onThink = function(monster, interval)
if monster:getStorageValue(GrandMasterOberonConfig.Storage.Life) <= GrandMasterOberonConfig.AmountLife then
local percentageHealth = (monster:getHealth() * 100) / monster:getMaxHealth()
Expand Down

0 comments on commit 8b8b28c

Please sign in to comment.