Skip to content

Commit

Permalink
Merge branch 'feat/faceless-bane-boss-room' of https://github.com/Car…
Browse files Browse the repository at this point in the history
…losE-Dev/canary into feat/faceless-bane-boss-room
  • Loading branch information
CarlosEDev committed Mar 18, 2024
2 parents 350af75 + eee4ea7 commit d1f38c8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ monster.manaCost = 0

monster.changeTarget = {
interval = 4000,
chance = 20
chance = 20,
}

monster.reflects = {
Expand Down Expand Up @@ -138,7 +138,6 @@ monster.elements = {
{ type = COMBAT_DEATHDAMAGE, percent = 50 },
}


monster.immunities = {
{ type = "paralyze", condition = true },
{ type = "outfit", condition = false },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end

-- energy effect to make the boss mortal
local function sendEnergyEffect()
-- positions: pipes on room, that should be electrocuted
-- positions: pipes on room, that should be electrocuted
local pipePositions = {
Position(33612, 32568, 13),
Position(33612, 32567, 13),
Expand All @@ -42,7 +42,7 @@ local function sendEnergyEffect()
Position(33622, 32565, 13),
Position(33622, 32566, 13),
Position(33622, 32567, 13),
Position(33622, 32568, 13)
Position(33622, 32568, 13),
}

-- energy effect / sound on pipes
Expand All @@ -56,70 +56,56 @@ end

local facelessBaneStepPositions = MoveEvent()

-- capture steps in the specific SQM's to make the boss mortal
--
-- capture steps in the specific SQM's to make the boss mortal
--
function facelessBaneStepPositions.onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
local player = creature:getPlayer()
if not player then
return true
end

if Game.getStorageValue(GlobalStorage.FacelessBaneResetSteps) == 1 then
Game.setStorageValue(GlobalStorage.FacelessBaneResetSteps, 0)
lastResetTime = os.time()
resetWalkedPositions()
if Game.getStorageValue(GlobalStorage.FacelessBaneResetSteps) == 1 then
Game.setStorageValue(GlobalStorage.FacelessBaneResetSteps, 0)
lastResetTime = os.time()
resetWalkedPositions()
end

if Game.getStorageValue(GlobalStorage.FacelessBaneStepsOn) < 1 then
local positionAlreadyAdded = false
if #walkedPositions == 0 then
position:sendSingleSoundEffect(SOUND_EFFECT_TYPE_SPELL_BUZZ)
position:sendMagicEffect(CONST_ME_YELLOWENERGY)
table.insert(walkedPositions, position)
return true
end

if Game.getStorageValue(GlobalStorage.FacelessBaneStepsOn) < 1 then
local positionAlreadyAdded = false
if #walkedPositions == 0 then
position:sendSingleSoundEffect(SOUND_EFFECT_TYPE_SPELL_BUZZ)
position:sendMagicEffect(CONST_ME_YELLOWENERGY)
table.insert(walkedPositions, position)
return true
for _, p in ipairs(walkedPositions) do
if p == position then
positionAlreadyAdded = true
break
end
end

for _, p in ipairs(walkedPositions) do
if p == position then
positionAlreadyAdded = true
break
end
end
if positionAlreadyAdded then
return true
else
position:sendSingleSoundEffect(SOUND_EFFECT_TYPE_SPELL_BUZZ)
position:sendMagicEffect(CONST_ME_YELLOWENERGY)
table.insert(walkedPositions, position)

if positionAlreadyAdded then
if #walkedPositions == 13 then
Game.setStorageValue(GlobalStorage.FacelessBaneStepsOn, 1)
addEvent(resetWalkedPositions, 60 * 1000)
sendEnergyEffect()
return true
else
position:sendSingleSoundEffect(SOUND_EFFECT_TYPE_SPELL_BUZZ)
position:sendMagicEffect(CONST_ME_YELLOWENERGY)
table.insert(walkedPositions, position)

if #walkedPositions == 13 then
Game.setStorageValue(GlobalStorage.FacelessBaneStepsOn, 1)
addEvent(resetWalkedPositions, 60 * 1000)
sendEnergyEffect()
return true
end
end

return true
end

return true
end
return true
end

-- positions: SQM's to step
facelessBaneStepPositions:position(
Position(33615, 32567, 13),
Position(33613, 32567, 13),
Position(33611, 32563, 13),
Position(33610, 32561, 13),
Position(33611, 32558, 13),
Position(33614, 32557, 13),
Position(33617, 32558, 13),
Position(33620, 32557, 13),
Position(33623, 32558, 13),
Position(33624, 32561, 13),
Position(33623, 32563, 13),
Position(33621, 32567, 13),
Position(33619, 32567, 13)
)
facelessBaneStepPositions:position(Position(33615, 32567, 13), Position(33613, 32567, 13), Position(33611, 32563, 13), Position(33610, 32561, 13), Position(33611, 32558, 13), Position(33614, 32557, 13), Position(33617, 32558, 13), Position(33620, 32557, 13), Position(33623, 32558, 13), Position(33624, 32561, 13), Position(33623, 32563, 13), Position(33621, 32567, 13), Position(33619, 32567, 13))
facelessBaneStepPositions:register()

0 comments on commit d1f38c8

Please sign in to comment.