Skip to content

Commit

Permalink
Lua code format - (Stylua)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 9, 2024
1 parent 3d5940b commit 1a4617b
Show file tree
Hide file tree
Showing 7 changed files with 180 additions and 180 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ monster.manaCost = 0

monster.events = {
"dreamCourtsDeath",
"facelessHealth"
"facelessHealth",
}

monster.changeTarget = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ monster.manaCost = 0

monster.events = {
"dreamCourtsDeath",
"facelessHealth"
"facelessHealth",
}

monster.changeTarget = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,36 @@ local config = {
to = Position(33433, 31449, 13),
},
onUseExtra = function(player)
addEvent(function()
local baeloc = Creature("Sir Baeloc")
local nictros = Creature("Sir Nictros")
addEvent(function()
local baeloc = Creature("Sir Baeloc")
local nictros = Creature("Sir Nictros")

if baeloc then
baeloc:say("Ah look my Brother! Challengers! After all this time finally a chance to prove our skills!")
addEvent(function()
local nictros = Creature("Sir Nictros")
if nictros then
nictros:say("Indeed! It has been a while! As the elder one I request the right of the first battle!")
end
end, 6 * 1000)
end
if baeloc then
baeloc:say("Ah look my Brother! Challengers! After all this time finally a chance to prove our skills!")
addEvent(function()
local nictros = Creature("Sir Nictros")
if nictros then
nictros:say("Indeed! It has been a while! As the elder one I request the right of the first battle!")
end
end, 6 * 1000)
end

addEvent(function()
local baeloc = Creature("Sir Baeloc")
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
end
end, 12 * 1000)
end, 4 * 1000)
addEvent(function()
local baeloc = Creature("Sir Baeloc")
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
end
end, 12 * 1000)
end, 4 * 1000)
end,
exit = Position(33290, 32474, 9),
}

local lever = BossLever(config)
lever:position(Position(33423, 31413, 13))
lever:register()
lever:register()
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
local config = {
boss = {
name = "Duke Krule",
createFunction = function()
local boss = Game.createMonster("Duke Krule", Position(33456, 31473, 13), true, true)
boss:setStorageValue(1, os.time())
return boss
end,
},
requiredLevel = 250,
playerPositions = {
{ pos = Position(33455, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
{ pos = Position(33456, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
{ pos = Position(33457, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
{ pos = Position(33458, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
{ pos = Position(33459, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
},
specPos = {
from = Position(33447, 31464, 13),
to = Position(33464, 31481, 13),
},
exit = Position(32347, 32167, 12),
boss = {
name = "Duke Krule",
createFunction = function()
local boss = Game.createMonster("Duke Krule", Position(33456, 31473, 13), true, true)
boss:setStorageValue(1, os.time())
return boss
end,
},
requiredLevel = 250,
playerPositions = {
{ pos = Position(33455, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
{ pos = Position(33456, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
{ pos = Position(33457, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
{ pos = Position(33458, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
{ pos = Position(33459, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
},
specPos = {
from = Position(33447, 31464, 13),
to = Position(33464, 31481, 13),
},
exit = Position(32347, 32167, 12),
}

local duke_water = Combat()
duke_water:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO)
duke_water:setArea(createCombatArea(AREA_CIRCLE3X3))

function onTargetTile(cid, pos)
local tile = Tile(pos)
local target = tile:getTopCreature()
if tile then
if target and target:isPlayer() and target:getOutfit().lookType == 49 then
doTargetCombatHealth(0, target, COMBAT_ICEDAMAGE, -1500, -2000)
end
end
local tile = Tile(pos)
local target = tile:getTopCreature()
if tile then
if target and target:isPlayer() and target:getOutfit().lookType == 49 then
doTargetCombatHealth(0, target, COMBAT_ICEDAMAGE, -1500, -2000)
end
end
end

duke_water:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile")
Expand All @@ -43,63 +43,63 @@ duke_fire:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE)
duke_fire:setArea(createCombatArea(AREA_CIRCLE3X3))

function onTargetTile(cid, pos)
local tile = Tile(pos)
local target = tile:getTopCreature()
if tile then
if target and target:isPlayer() and target:getOutfit().lookType == 286 then
doTargetCombatHealth(0, target, COMBAT_FIREDAMAGE, -1500, -2000)
end
end
local tile = Tile(pos)
local target = tile:getTopCreature()
if tile then
if target and target:isPlayer() and target:getOutfit().lookType == 286 then
doTargetCombatHealth(0, target, COMBAT_FIREDAMAGE, -1500, -2000)
end
end
end

duke_fire:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile")

config.onUseExtra = function()
local config = {
centerRoom = Position(33456, 31472, 13),
x = 10,
y = 10,
transformCD = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.TransformCD,
}
local function hitArea(creature)
local player = Player(creature)
local config = {
centerRoom = Position(33456, 31472, 13),
x = 10,
y = 10,
transformCD = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.TransformCD,
}
local function hitArea(creature)
local player = Player(creature)

if player then
if player:getStorageValue(config.transformCD) <= os.time() then
if player:getOutfit().lookType == 49 then
local var = { type = 1, number = creature }
duke_fire:execute(player, var)
player:setStorageValue(config.transformCD, os.time() + 3)
addEvent(hitArea, 3 * 1000, creature)
elseif player:getOutfit().lookType == 286 then
local var = { type = 1, number = creature }
duke_water:execute(player, var)
player:setStorageValue(config.transformCD, os.time() + 3)
addEvent(hitArea, 3 * 1000, creature)
end
end
end
if player then
if player:getStorageValue(config.transformCD) <= os.time() then
if player:getOutfit().lookType == 49 then
local var = { type = 1, number = creature }
duke_fire:execute(player, var)
player:setStorageValue(config.transformCD, os.time() + 3)
addEvent(hitArea, 3 * 1000, creature)
elseif player:getOutfit().lookType == 286 then
local var = { type = 1, number = creature }
duke_water:execute(player, var)
player:setStorageValue(config.transformCD, os.time() + 3)
addEvent(hitArea, 3 * 1000, creature)
end
end
end

return true
end
return true
end

local function transformPlayers(id)
local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y)
local form = { 49, 286 }
local boss = Creature("Duke Krule")
local function transformPlayers(id)
local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y)
local form = { 49, 286 }
local boss = Creature("Duke Krule")

if boss and boss:getStorageValue(1) == id then
if #spectators > 0 then
for _, player in pairs(spectators) do
doSetCreatureOutfit(player, { lookType = form[math.random(#form)] }, 30 * 1000)
addEvent(hitArea, 3 * 1000, player:getId())
end
addEvent(transformPlayers, 36 * 1000, id)
end
end
return true
end
addEvent(transformPlayers, 30 * 1000, os.time())
if boss and boss:getStorageValue(1) == id then
if #spectators > 0 then
for _, player in pairs(spectators) do
doSetCreatureOutfit(player, { lookType = form[math.random(#form)] }, 30 * 1000)
addEvent(hitArea, 3 * 1000, player:getId())
end
addEvent(transformPlayers, 36 * 1000, id)
end
end
return true
end
addEvent(transformPlayers, 30 * 1000, os.time())
end

local lever = BossLever(config)
Expand Down
Loading

0 comments on commit 1a4617b

Please sign in to comment.