Skip to content

Commit

Permalink
fix: add missing set.lua import (opentibiabr#1773)
Browse files Browse the repository at this point in the history
  • Loading branch information
luan authored and marcusvcj committed Nov 20, 2023
1 parent afe0553 commit a8c806c
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ local bosses = {

local bossesFeasterOfSouls = CreatureEvent("FeasterOfSoulsBossDeath")
function bossesFeasterOfSouls.onDeath(creature)
local targetMonster = creature:getMonster()
if not targetMonster or targetMonster:getMaster() then
return true
end
local bossConfig = bosses[targetMonster:getName():lower()]
local bossConfig = bosses[creature:getName():lower()]
if not bossConfig then
return true
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ local bosses = {
["king zelos"] = { storage = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelosKilled },
}

local bossesGraveDanger = CreatureEvent("GraveDangerKillGraveDangerBossDeath")
local bossesGraveDanger = CreatureEvent("GraveDangerBossDeath")
function bossesGraveDanger.onDeath(creature)
local targetMonster = creature:getMonster()
if not targetMonster or targetMonster:getMaster() then
return true
end
local bossConfig = bosses[targetMonster:getName():lower()]
local bossConfig = bosses[creature:getName():lower()]
if not bossConfig then
return true
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ local bosses = {

local bossesSecretLibrary = CreatureEvent("SecretLibraryBossDeath")
function bossesSecretLibrary.onDeath(creature)
local targetMonster = creature:getMonster()
if not targetMonster or targetMonster:getMaster() then
return true
end
local bossConfig = bosses[targetMonster:getName():lower()]
local bossConfig = bosses[creature:getName():lower()]
if not bossConfig then
return true
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ local bosses = {

local bossesSoulWar = CreatureEvent("SoulwarsBossDeath")
function bossesSoulWar.onDeath(creature)
local targetMonster = creature:getMonster()
if not targetMonster or targetMonster:getMaster() then
return true
end
local bossConfig = bosses[targetMonster:getName():lower()]
local bossConfig = bosses[creature:getName():lower()]
if not bossConfig then
return true
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ local bosses = {

local bossesDreamCourts = CreatureEvent("DreamCourtsBossDeath")
function bossesDreamCourts.onDeath(creature)
local targetMonster = creature:getMonster()
if not targetMonster or targetMonster:getMaster() then
return true
end
local bossConfig = bosses[targetMonster:getName():lower()]
local bossConfig = bosses[creature:getName():lower()]
if not bossConfig then
return true
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ local bosses = {

local bossesForgottenKill = CreatureEvent("ForgottenKnowledgeBossDeath")
function bossesForgottenKill.onDeath(creature)
local bossConfig = bosses[targetMonster:getName():lower()]
local bossConfig = bosses[creature:getName():lower()]
if not bossConfig then
return true
end

onDeathForDamagingPlayers(creature, function(creature, player)
if bossConfig.storage then
player:setStorageValue(bossConfig.storage, os.time() + 20 * 3600)
elseif targetMonster:getName():lower() == "the enraged thorn knight" then
elseif creature:getName():lower() == "the enraged thorn knight" then
player:setStorageValue(Storage.ForgottenKnowledge.PlantCounter, 0)
player:setStorageValue(Storage.ForgottenKnowledge.BirdCounter, 0)
end
end)

if targetMonster:getName():lower() == "melting frozen horror" then
if creature:getName():lower() == "melting frozen horror" then
local egg = Tile(Position(32269, 31084, 14)):getTopCreature()
if egg then
local pos = egg:getPosition()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,27 @@ local function revertLloyd(prismId)
local lloydTile = Tile(Position(32799, 32826, 14))
if lloydTile then
local lloyd = lloydTile:getTopCreature()
if lloyd then
lloyd:teleportTo(Position(32799, 32829, 14))
lloyd:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end
lloyd:teleportTo(Position(32799, 32829, 14))
lloyd:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end

local tile = Tile(monsters[prismId].pos)
if tile then
local creatures = tile:getCreatures()
for _, creature in ipairs(creatures) do
if creature:isMonster() then
creature:remove()
end
local creature = tile:getTopCreature()
if creature then
creature:remove()
end
Game.createMonster(monsters[prismId].cosmicInvu, Position(monsters[prismId].pos), true, true)
end
end

local lloydPrepareDeath = CreatureEvent("LloydPrepareDeath")
function lloydPrepareDeath.onPrepareDeath(creature, lastHitKiller, mostDamageKiller)
local targetMonster = creature:getMonster()
if not creature or not targetMonster then
return true
end

local prismCount = 1
for m = 1, #monsters do
local cosmic = Tile(Position(monsters[m].pos)):getTopCreature()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local servants = {
}
local replicaServant = CreatureEvent("ReplicaServantDeath")
function replicaServant.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller)
local bossConfig = servants[targetMonster:getName():lower()]
local bossConfig = servants[creature:getName():lower()]
if not bossConfig then
return true
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ end

local rathletonBossKill = CreatureEvent("RathletonBossDeath")
function rathletonBossKill.onDeath(creature)
local bossConfig = bosses[targetMonster:getName():lower()]
local bossConfig = bosses[creature:getName():lower()]
if not bossConfig then
return true
end
if targetMonster:getName():lower() == "empowered glooth horror" then
if creature:getName():lower() == "empowered glooth horror" then
if checkHorror() == true then
return true
end
Expand All @@ -67,7 +67,7 @@ function rathletonBossKill.onDeath(creature)
local newPos = bossConfig.nextpos
if teleport then
teleport:transform(22761)
targetMonster:getPosition():sendMagicEffect(CONST_ME_THUNDER)
creature:getPosition():sendMagicEffect(CONST_ME_THUNDER)
teleport:setDestination(newPos)
addEvent(revertTeleport, 2 * 60 * 1000, teleportPos, 22761, 1949, oldPos)
Game.setStorageValue(bossConfig.globaltimer, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ local diseasedTrio = {

local diseasedTrioKill = CreatureEvent("DiseasedTrioDeath")
function diseasedTrioKill.onDeath(creature)
local bossStorage = diseasedTrio[targetMonster:getName():lower()]
local bossStorage = diseasedTrio[creature:getName():lower()]
if not bossStorage then
return true
end

onDeathForDamagingPlayers(creature, function(creature, player)
if player:getStorageValue(bossStorage) < 1 then
player:setStorageValue(bossStorage, 1)
player:say("You slayed " .. targetMonster:getName() .. ".", TALKTYPE_MONSTER_SAY)
player:say("You slayed " .. creature:getName() .. ".", TALKTYPE_MONSTER_SAY)
end

if player:getStorageValue(Storage.InServiceofYalahar.DiseasedDan) == 1 and player:getStorageValue(Storage.InServiceofYalahar.DiseasedBill) == 1 and player:getStorageValue(Storage.InServiceofYalahar.DiseasedFred) == 1 and player:getStorageValue(Storage.InServiceofYalahar.AlchemistFormula) ~= 1 then
Expand Down

0 comments on commit a8c806c

Please sign in to comment.