forked from opentibiabr/canary
-
Notifications
You must be signed in to change notification settings - Fork 2
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 fix/support-outfit-crashs
- Loading branch information
Showing
63 changed files
with
901 additions
and
401 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
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
47 changes: 47 additions & 0 deletions
47
data-otservbr-global/scripts/creaturescripts/monster/faceless_bane_immunity.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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
local bossName = "Faceless Bane" | ||
|
||
local function healBoss(creature) | ||
if creature then | ||
creature:addHealth(creature:getMaxHealth()) | ||
creature:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT) | ||
end | ||
end | ||
|
||
local function createSummons(creature) | ||
if creature then | ||
local pos = creature:getPosition() | ||
Game.createMonster("Gazer Spectre", pos, true, false, creature) | ||
Game.createMonster("Ripper Spectre", pos, true, false, creature) | ||
Game.createMonster("Burster Spectre", pos, true, false, creature) | ||
end | ||
end | ||
|
||
local function resetBoss(creature, deaths) | ||
if creature then | ||
healBoss(creature) | ||
createSummons(creature) | ||
Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.Deaths, deaths + 1) | ||
Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn, 0) | ||
Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.ResetSteps, 1) | ||
end | ||
end | ||
|
||
local facelessBaneImmunity = CreatureEvent("facelessBaneImmunity") | ||
|
||
function facelessBaneImmunity.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) | ||
if creature and creature:isMonster() and creature:getName() == bossName then | ||
local creatureHealthPercent = (creature:getHealth() * 100) / creature:getMaxHealth() | ||
local facelessBaneDeathsStorage = Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.Deaths) | ||
|
||
if creatureHealthPercent <= 20 and facelessBaneDeathsStorage < 1 then | ||
resetBoss(creature, facelessBaneDeathsStorage) | ||
return true | ||
elseif Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn) < 1 then | ||
healBoss(creature) | ||
return true | ||
end | ||
end | ||
return primaryDamage, primaryType, secondaryDamage, secondaryType | ||
end | ||
|
||
facelessBaneImmunity:register() |
114 changes: 114 additions & 0 deletions
114
...tservbr-global/scripts/movements/quests/the_dream_courts/faceless_bane_step_positions.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 |
---|---|---|
@@ -0,0 +1,114 @@ | ||
local walkedPositions = {} | ||
local lastResetTime = os.time() | ||
local checkTime = false | ||
|
||
local function resetWalkedPositions(checkLastResetTime) | ||
if lastResetTime > os.time() and checkLastResetTime then | ||
return true | ||
end | ||
|
||
walkedPositions = {} | ||
Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn, 0) | ||
lastResetTime = os.time() + (1 * 60) | ||
end | ||
|
||
local pipePositions = { | ||
Position(33612, 32568, 13), | ||
Position(33612, 32567, 13), | ||
Position(33612, 32566, 13), | ||
Position(33612, 32565, 13), | ||
Position(33612, 32564, 13), | ||
Position(33612, 32563, 13), | ||
Position(33612, 32562, 13), | ||
Position(33612, 32561, 13), | ||
Position(33612, 32560, 13), | ||
Position(33612, 32559, 13), | ||
Position(33612, 32558, 13), | ||
Position(33612, 32557, 13), | ||
Position(33612, 32556, 13), | ||
Position(33622, 32556, 13), | ||
Position(33622, 32557, 13), | ||
Position(33622, 32558, 13), | ||
Position(33622, 32559, 13), | ||
Position(33622, 32560, 13), | ||
Position(33622, 32561, 13), | ||
Position(33622, 32562, 13), | ||
Position(33622, 32563, 13), | ||
Position(33622, 32564, 13), | ||
Position(33622, 32565, 13), | ||
Position(33622, 32566, 13), | ||
Position(33622, 32567, 13), | ||
Position(33622, 32568, 13), | ||
} | ||
|
||
local function sendEnergyEffect() | ||
for _, position in ipairs(pipePositions) do | ||
position:sendMagicEffect(CONST_ME_PURPLEENERGY) | ||
position:sendSingleSoundEffect(SOUND_EFFECT_TYPE_SPELL_GREAT_ENERGY_BEAM) | ||
end | ||
|
||
return true | ||
end | ||
|
||
local facelessBaneStepPositions = MoveEvent() | ||
|
||
function facelessBaneStepPositions.onStepIn(creature, item, position, fromPosition) | ||
local player = creature:getPlayer() | ||
if not player then | ||
return true | ||
end | ||
|
||
if Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.ResetSteps) == 1 then | ||
Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.ResetSteps, 0) | ||
lastResetTime = os.time() | ||
resetWalkedPositions(true) | ||
end | ||
|
||
if not checkTime then | ||
checkTime = addEvent(resetWalkedPositions, 15 * 1000, false) | ||
end | ||
|
||
if Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn) < 1 then | ||
if #walkedPositions > 0 then | ||
for _, walkedPos in ipairs(walkedPositions) do | ||
if walkedPos == position then | ||
return true | ||
end | ||
end | ||
end | ||
|
||
position:sendSingleSoundEffect(SOUND_EFFECT_TYPE_SPELL_BUZZ) | ||
position:sendMagicEffect(CONST_ME_YELLOWENERGY) | ||
table.insert(walkedPositions, position) | ||
|
||
if #walkedPositions == 13 then | ||
Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn, 1) | ||
addEvent(resetWalkedPositions, 60 * 1000, true) | ||
sendEnergyEffect() | ||
checkTime = nil | ||
end | ||
end | ||
return true | ||
end | ||
|
||
local facelessBaneSteps = { | ||
Position(33615, 32567, 13), | ||
Position(33613, 32567, 13), | ||
Position(33611, 32563, 13), | ||
Position(33610, 32561, 13), | ||
Position(33611, 32558, 13), | ||
Position(33614, 32557, 13), | ||
Position(33617, 32558, 13), | ||
Position(33620, 32557, 13), | ||
Position(33623, 32558, 13), | ||
Position(33624, 32561, 13), | ||
Position(33623, 32563, 13), | ||
Position(33621, 32567, 13), | ||
Position(33619, 32567, 13), | ||
} | ||
|
||
for _, pos in ipairs(facelessBaneSteps) do | ||
facelessBaneStepPositions:position(pos) | ||
end | ||
|
||
facelessBaneStepPositions:register() |
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
Oops, something went wrong.