-
-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
converted the lever logic to the new bossLever() pattern
- Loading branch information
Showing
11 changed files
with
270 additions
and
728 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
data-otservbr-global/scripts/actions/bosses_levers/duke_krule.lua
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
data-otservbr-global/scripts/actions/bosses_levers/sir_baeloc_sir_nictros.lua
This file was deleted.
Oops, something went wrong.
137 changes: 55 additions & 82 deletions
137
data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,58 @@ | ||
local nictrosPosition = Position(33427, 31428, 13) | ||
local baelocPosition = Position(33422, 31428, 13) | ||
|
||
local config = { | ||
centerRoom = Position(33424, 31439, 13), | ||
newPosition = Position(33425, 31431, 13), | ||
exitPos = Position(33290, 32474, 9), | ||
x = 12, | ||
y = 12, | ||
baelocPos = Position(33422, 31428, 13), | ||
nictrosPos = Position(33427, 31428, 13), | ||
timer = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Timer, | ||
room = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Room, | ||
fromPos = Position(33415, 31426, 13), | ||
toPos = Position(33434, 31450, 13), | ||
boss = { | ||
name = "Sir Nictros", | ||
createFunction = function() | ||
local nictros = Game.createMonster("Sir Nictros", nictrosPosition, true, true) | ||
local baeloc = Game.createMonster("Sir Baeloc", baelocPosition, true, true) | ||
return nictros and baeloc | ||
end, | ||
}, | ||
requiredLevel = 250, | ||
playerPositions = { | ||
{ pos = Position(33424, 31413, 13), teleport = Position(33423, 31448, 13) }, | ||
{ pos = Position(33425, 31413, 13), teleport = Position(33423, 31448, 13) }, | ||
{ pos = Position(33426, 31413, 13), teleport = Position(33423, 31448, 13) }, | ||
{ pos = Position(33427, 31413, 13), teleport = Position(33423, 31448, 13) }, | ||
{ pos = Position(33428, 31413, 13), teleport = Position(33423, 31448, 13) }, | ||
}, | ||
specPos = { | ||
from = Position(33414, 31426, 13), | ||
to = Position(33433, 31449, 13), | ||
}, | ||
onUseExtra = function(player) | ||
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 | ||
|
||
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 function brothers_play() | ||
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 | ||
|
||
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 | ||
|
||
local baeloc_fight = Action() | ||
|
||
function baeloc_fight.onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
if not player:doCheckBossRoom("Sir Baeloc", config.fromPos, config.toPos) then | ||
player:sendCancelMessage("The room is already in use. Please wait.") | ||
return true | ||
end | ||
|
||
local baeloc = Game.createMonster("Sir Baeloc", config.baelocPos, true, true) | ||
local nictros = Game.createMonster("Sir Nictros", config.nictrosPos, true, true) | ||
|
||
if baeloc then | ||
baeloc:setMoveLocked(true) | ||
baeloc:registerEvent("sir_baeloc_health") | ||
baeloc:registerEvent("brothers_summon") | ||
end | ||
|
||
if nictros then | ||
nictros:setMoveLocked(true) | ||
nictros:registerEvent("sir_nictros_health") | ||
nictros:registerEvent("brothers_summon") | ||
end | ||
|
||
addEvent(brothers_play, 4 * 1000) | ||
|
||
for x = 33424, 33428 do | ||
local playerTile = Tile(Position(x, 31413, 13)):getTopCreature() | ||
if playerTile and playerTile:isPlayer() then | ||
playerTile:getPosition():sendMagicEffect(CONST_ME_POFF) | ||
playerTile:teleportTo(config.newPosition) | ||
playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | ||
playerTile:setStorageValue(config.timer, os.time() + 20 * 3600) | ||
playerTile:setStorageValue(config.room, os.time() + 30 * 60) | ||
playerTile:say("You have 30 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.", TALKTYPE_MONSTER_SAY, false, playerTile) | ||
end | ||
end | ||
|
||
addEvent(clearForgotten, 30 * 60 * 1000, config.centerRoom, config.x, config.y, config.exitPos, config.room) | ||
|
||
return true | ||
end | ||
|
||
baeloc_fight:aid(14559) | ||
baeloc_fight:register() | ||
local lever = BossLever(config) | ||
lever:position(Position(33423, 31413, 13)) | ||
lever:register() |
Oops, something went wrong.