Skip to content

Commit

Permalink
41
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonyrewind committed Nov 24, 2023
1 parent 083d894 commit 5bdb0d6
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,15 @@ local config = {
centerPosition = Position(32456, 32495, 7),
rangeX = 50,
rangeY = 50,
spawn = configManager.getNumber(configKeys.RATE_SPAWN),
timer = configManager.getNumber(configKeys.RATE_SPAWN) * SCHEDULE_SPAWN_RATE,
}

local function checkBoss(centerPosition, rangeX, rangeY, bossName)
local spectators, spec = Game.getSpectators(centerPosition, false, false, rangeX, rangeX, rangeY, rangeY)
for i = 1, #spectators do
spec = spectators[i]
if spec:isMonster() then
if spec:getName() == bossName then
return true
end
end
end
return false
end

local lionKnight = GlobalEvent("ancient lion knight")
function lionKnight.onThink(interval, lastExecution)
if checkBoss(config.centerPosition, config.rangeX, config.rangeY, config.monsterName) then
return true
end

local boss = Game.createMonster(config.monsterName, config.bossPosition, true, true)
boss:setReward(true)
checkBoss(config.centerPosition, config.rangeX, config.rangeY, config.monsterName, config.bossPosition)
return true
end

lionKnight:interval(1 * 60 * 1000)
lionKnight:interval(15 * 60 * 1000 / config.timer)
lionKnight:register()
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local config = {
centerPosition = Position(33376, 32825, 8),
rangeX = 50,
rangeY = 50,
timer = configManager.getNumber(configKeys.RATE_SPAWN) * SCHEDULE_SPAWN_RATE,
}

local miniBoss = GlobalEvent("custodian")
Expand All @@ -12,5 +13,5 @@ function miniBoss.onThink(interval, lastExecution)
return true
end

miniBoss:interval(1 * 60 * 1000)
miniBoss:interval(15 * 60 * 1000 / config.timer)
miniBoss:register()
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local config = {
centerPosition = Position(33394, 32674, 4),
rangeX = 50,
rangeY = 50,
timer = configManager.getNumber(configKeys.RATE_SPAWN) * SCHEDULE_SPAWN_RATE,
}

local miniBoss = GlobalEvent("gaffir")
Expand All @@ -12,5 +13,5 @@ function miniBoss.onThink(interval, lastExecution)
return true
end

miniBoss:interval(1 * 60 * 1000)
miniBoss:interval(15 * 60 * 1000 / config.timer)
miniBoss:register()
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local config = {
centerPosition = Position(33392, 32660, 3),
rangeX = 50,
rangeY = 50,
timer = configManager.getNumber(configKeys.RATE_SPAWN) * SCHEDULE_SPAWN_RATE,
}

local miniBoss = GlobalEvent("guard captain quaid")
Expand All @@ -12,5 +13,5 @@ function miniBoss.onThink(interval, lastExecution)
return true
end

miniBoss:interval(1 * 60 * 1000)
miniBoss:interval(15 * 60 * 1000 / config.timer)
miniBoss:register()
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ function canonDominus.onThink(interval, lastExecution)
return true
end

canonDominus:interval(1 * 60 * 1000 / config.timer)
canonDominus:interval(15 * 60 * 1000 / config.timer)
canonDominus:register()
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local config = {
centerPosition = Position(33370, 31327, 5),
rangeX = 50,
rangeY = 50,
timer = configManager.getNumber(configKeys.RATE_SPAWN) * SCHEDULE_SPAWN_RATE,
}

local chaplaingaunder = GlobalEvent("chaplaingaunder")
Expand All @@ -12,5 +13,5 @@ function chaplaingaunder.onThink(interval, lastExecution)
return true
end

chaplaingaunder:interval(1 * 60 * 1000)
chaplaingaunder:interval(15 * 60 * 1000 / config.timer)
chaplaingaunder:register()
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local config = {
centerPosition = Position(33376, 31320, 2),
rangeX = 50,
rangeY = 50,
timer = configManager.getNumber(configKeys.RATE_SPAWN) * SCHEDULE_SPAWN_RATE,
}

local grandCommander = GlobalEvent("grand commander")
Expand All @@ -12,5 +13,5 @@ function grandCommander.onThink(interval, lastExecution)
return true
end

grandCommander:interval(15 * 60 * 1000) -- 15 minutes
grandCommander:register()
grandCommander:interval(15 * 60 * 1000 / config.timer) -- 15 minutes
grandCommander:register()
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local config = {
centerPosition = Position(33373, 31348, 3),
rangeX = 50,
rangeY = 50,
timer = configManager.getNumber(configKeys.RATE_SPAWN) * SCHEDULE_SPAWN_RATE,
}

local preceptorLazare = GlobalEvent("preceptor lazare")
Expand All @@ -12,5 +13,5 @@ function preceptorLazare.onThink(interval, lastExecution)
return true
end

preceptorLazare:interval(1 * 60 * 1000)
preceptorLazare:interval(15 * 60 * 1000 / config.timer)
preceptorLazare:register()

0 comments on commit 5bdb0d6

Please sign in to comment.