Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ monster.speed = 125
monster.manaCost = 0

monster.events = {
"sir_baeloc_health",
"brothers_summon",
"grave_danger_death",
"BossHealthCheck",
}

monster.changeTarget = {
Expand Down Expand Up @@ -80,14 +78,14 @@ monster.voices = {
monster.loot = {
{ name = "platinum coin", minCount = 1, maxCount = 5, chance = 100000 },
{ name = "crystal coin", minCount = 0, maxCount = 2, chance = 50000 },
{ name = "silver token", minCount = 0, maxCount = 3, chance = 40000 },
{ name = "supreme health potion", minCount = 0, maxCount = 6, chance = 35000 },
{ name = "ultimate mana potion", minCount = 0, maxCount = 20, chance = 32000 },
{ name = "ultimate spirit potion", minCount = 0, maxCount = 20, chance = 32000 },
{ name = "mastermind potion", minCount = 0, maxCount = 10, chance = 12000 },
{ name = "berserk potion", minCount = 0, maxCount = 10, chance = 12000 },
{ name = "piece of draconian steel", minCount = 0, maxCount = 4, chance = 9000 },
{ id = 3039, minCount = 0, maxCount = 1, chance = 12000 }, -- red gem
{ name = "silver token", minCount = 0, maxCount = 2, chance = 9500 },
{ id = 23542, chance = 5200 }, -- collar of blue plasma
{ id = 23544, chance = 5200 }, -- collar of red plasma
{ name = "knight legs", chance = 11000 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ monster.corpse = 31599
monster.speed = 125
monster.manaCost = 0

monster.events = {
"sir_nictros_health",
"brothers_summon",
}

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

monster.events = {
"BossHealthCheck",
}

monster.bosstiary = {
bossRaceId = 1754,
bossRace = RARITY_ARCHFOE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
local nictrosPosition = Position(33427, 31428, 13)
local baelocPosition = Position(33422, 31428, 13)

local healthStates = {
nictros85 = false,
baeloc85 = false,
}

local config = {
boss = {
name = "Sir Nictros",
createFunction = function()
local nictros = Game.createMonster("Sir Nictros", nictrosPosition, true, true)
local baeloc = Game.createMonster("Sir Baeloc", baelocPosition, true, true)

if nictros then
nictros:registerEvent("BossHealthCheck")
-- Start with Nictros active
nictros:setMoveLocked(false)
end
if baeloc then
-- Start with Baeloc locked
baeloc:setMoveLocked(true)
baeloc:registerEvent("BossHealthCheck")
end

healthStates.nictros85 = false
healthStates.baeloc85 = false

return nictros and baeloc
end,
},
Expand Down Expand Up @@ -42,10 +62,11 @@ local config = {
local nictros = Creature("Sir Nictros")
if baeloc then
baeloc:say("Oh, man! You always get the fun!")
if nictros then
nictros:teleportTo(Position(33426, 31437, 13))
nictros:setMoveLocked(false)
end
baeloc:setMoveLocked(true)
end
if nictros then
nictros:teleportTo(Position(33426, 31437, 13))
nictros:setMoveLocked(false)
end
end, 12 * 1000)
end, 4 * 1000)
Expand All @@ -56,3 +77,55 @@ local config = {
local lever = BossLever(config)
lever:position(Position(33423, 31413, 13))
lever:register()

-- Health Trigger Logic
local BossHealthCheck = CreatureEvent("BossHealthCheck")

function BossHealthCheck.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if not creature or not creature:isMonster() then
return primaryDamage, primaryType, secondaryDamage, secondaryType
end

local name = creature:getName()

local function getHealthPercentage(creature)
local health = creature:getHealth()
local maxHealth = creature:getMaxHealth()
return (health / maxHealth) * 100
end

local healthPercent = getHealthPercentage(creature)

if name == "Sir Nictros" and not healthStates.nictros85 and healthPercent <= 85 then
healthStates.nictros85 = true

creature:say("I'll step back now. Let's see how you handle my brother!")
creature:teleportTo(nictrosPosition)
creature:setMoveLocked(true)

-- Release Baeloc to fight
local baeloc = Creature("Sir Baeloc")
if baeloc then
baeloc:teleportTo(Position(33426, 31435, 13))
baeloc:setDirection(DIRECTION_SOUTH)
baeloc:setMoveLocked(false)
baeloc:say("My turn! Let me show you my skills!")
end
elseif name == "Sir Baeloc" and healthStates.nictros85 and not healthStates.baeloc85 and healthPercent <= 85 then
healthStates.baeloc85 = true

creature:say("Brother! I need your assistance!")

-- Release Nictros to join the fight
local nictros = Creature("Sir Nictros")
if nictros then
nictros:setMoveLocked(false)
nictros:teleportTo(Position(33424, 31435, 13))
nictros:say("Now we fight together, brother!")
end
end

return primaryDamage, primaryType, secondaryDamage, secondaryType
end

BossHealthCheck:register()

This file was deleted.