-
-
Notifications
You must be signed in to change notification settings - Fork 651
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into improve-boss-foreshock
- Loading branch information
Showing
74 changed files
with
747 additions
and
616 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
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
165 changes: 38 additions & 127 deletions
165
data-otservbr-global/scripts/actions/quests/heart_of_destruction/rupture_lever.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,130 +1,41 @@ | ||
-- FUNCTIONS | ||
local function doCheckArea() | ||
local upConer = { x = 32324, y = 31239, z = 14 } -- upLeftCorner | ||
local downConer = { x = 32347, y = 31263, z = 14 } -- downRightCorner | ||
|
||
for i = upConer.x, downConer.x do | ||
for j = upConer.y, downConer.y do | ||
for k = upConer.z, downConer.z do | ||
local room = { x = i, y = j, z = k } | ||
local tile = Tile(room) | ||
if tile then | ||
local creatures = tile:getCreatures() | ||
if creatures and #creatures > 0 then | ||
for _, creature in pairs(creatures) do | ||
local player = Player(creature) | ||
if player then | ||
return true | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
return false | ||
end | ||
|
||
local function clearArea() | ||
local upConer = { x = 32324, y = 31239, z = 14 } -- upLeftCorner | ||
local downConer = { x = 32347, y = 31263, z = 14 } -- downRightCorner | ||
|
||
for i = upConer.x, downConer.x do | ||
for j = upConer.y, downConer.y do | ||
for k = upConer.z, downConer.z do | ||
local room = { x = i, y = j, z = k } | ||
local tile = Tile(room) | ||
if tile then | ||
local creatures = tile:getCreatures() | ||
if creatures and #creatures > 0 then | ||
for _, creatureUid in pairs(creatures) do | ||
local creature = Creature(creatureUid) | ||
if creature then | ||
if creature:isPlayer() then | ||
creature:teleportTo({ x = 32088, y = 31321, z = 13 }) | ||
elseif creature:isMonster() then | ||
creature:remove() | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
-- FUNCTIONS END | ||
|
||
local heartDestructionRupture = Action() | ||
function heartDestructionRupture.onUse(player, item, fromPosition, itemEx, toPosition) | ||
local config = { | ||
playerPositions = { | ||
Position(32309, 31248, 14), | ||
Position(32309, 31249, 14), | ||
Position(32309, 31250, 14), | ||
Position(32309, 31251, 14), | ||
Position(32309, 31252, 14), | ||
}, | ||
|
||
newPos = { x = 32335, y = 31257, z = 14 }, | ||
} | ||
|
||
local pushPos = { x = 32309, y = 31248, z = 14 } | ||
|
||
if item.actionid == 14327 then | ||
if item.itemid == 8911 then | ||
if player:getPosition().x == pushPos.x and player:getPosition().y == pushPos.y and player:getPosition().z == pushPos.z then | ||
local storePlayers = {} | ||
for i = 1, #config.playerPositions do | ||
local tile = Tile(Position(config.playerPositions[i])) | ||
if tile then | ||
local playerTile = tile:getTopCreature() | ||
if playerTile and playerTile:isPlayer() then | ||
storePlayers[#storePlayers + 1] = playerTile | ||
end | ||
end | ||
end | ||
|
||
if doCheckArea() == false then | ||
clearArea() | ||
|
||
local players | ||
|
||
for i = 1, #storePlayers do | ||
players = storePlayers[i] | ||
config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF) | ||
players:teleportTo(config.newPos) | ||
players:setBossCooldown("Rupture", os.time() + configManager.getNumber(configKeys.BOSS_DEFAULT_TIME_TO_FIGHT_AGAIN)) | ||
end | ||
Position(config.newPos):sendMagicEffect(11) | ||
|
||
areaRupture1 = addEvent(clearArea, 15 * 60000) | ||
|
||
ruptureResonanceStage = 0 | ||
resonanceActive = false | ||
|
||
Game.createMonster("Spark of Destruction", { x = 32331, y = 31254, z = 14 }, false, true) | ||
Game.createMonster("Spark of Destruction", { x = 32338, y = 31254, z = 14 }, false, true) | ||
Game.createMonster("Spark of Destruction", { x = 32330, y = 31250, z = 14 }, false, true) | ||
Game.createMonster("Spark of Destruction", { x = 32338, y = 31250, z = 14 }, false, true) | ||
Game.createMonster("Rupture", { x = 32332, y = 31250, z = 14 }, false, true) | ||
|
||
local vortex = Tile({ x = 32326, y = 31250, z = 14 }):getItemById(23482) | ||
if vortex then | ||
vortex:transform(23483) | ||
vortex:setActionId(14343) | ||
end | ||
else | ||
player:sendTextMessage(19, "Someone is in the area.") | ||
end | ||
else | ||
return true | ||
local config = { | ||
boss = { | ||
name = "Rupture", | ||
position = Position(32332, 31250, 14), | ||
}, | ||
playerPositions = { | ||
{ pos = Position(32309, 31248, 14), teleport = Position(32335, 31257, 14), effect = CONST_ME_TELEPORT }, | ||
{ pos = Position(32309, 31249, 14), teleport = Position(32335, 31257, 14), effect = CONST_ME_TELEPORT }, | ||
{ pos = Position(32309, 31250, 14), teleport = Position(32335, 31257, 14), effect = CONST_ME_TELEPORT }, | ||
{ pos = Position(32309, 31251, 14), teleport = Position(32335, 31257, 14), effect = CONST_ME_TELEPORT }, | ||
{ pos = Position(32309, 31252, 14), teleport = Position(32335, 31257, 14), effect = CONST_ME_TELEPORT }, | ||
}, | ||
specPos = { | ||
from = Position(32324, 31239, 14), | ||
to = Position(32347, 31263, 14), | ||
}, | ||
monsters = { | ||
{ name = "Spark of Destruction", pos = Position(32331, 31254, 14) }, | ||
{ name = "Spark of Destruction", pos = Position(32338, 31254, 14) }, | ||
{ name = "Spark of Destruction", pos = Position(32330, 31250, 14) }, | ||
{ name = "Spark of Destruction", pos = Position(32338, 31250, 14) }, | ||
}, | ||
onUseExtra = function() | ||
Game.setStorageValue(GlobalStorage.HeartOfDestruction.RuptureResonanceStage, -1) | ||
Game.setStorageValue(GlobalStorage.HeartOfDestruction.RuptureResonanceActive, -1) | ||
|
||
local tile = Tile(Position(32326, 31250, 14)) | ||
if tile then | ||
local vortex = tile:getItemById(23482) | ||
if vortex then | ||
vortex:transform(23483) | ||
vortex:setActionId(14343) | ||
end | ||
end | ||
item:transform(item.itemid == 8911 and 8912 or 8911) | ||
end | ||
return true | ||
end | ||
end, | ||
exit = Position(32088, 31321, 13), | ||
} | ||
|
||
heartDestructionRupture:aid(14327) | ||
heartDestructionRupture:register() | ||
local lever = BossLever(config) | ||
lever:aid(14327) | ||
lever:register() |
6 changes: 4 additions & 2 deletions
6
data-otservbr-global/scripts/creaturescripts/quests/heart_of_destruction/rupture_heal.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
Oops, something went wrong.