Skip to content

Commit ee5606e

Browse files
committed
Merge branch 'main' into scheduler-stats
2 parents f0c3ee5 + ffe4db5 commit ee5606e

File tree

41 files changed

+836
-465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+836
-465
lines changed

data-crystal/monster/bosses/chagorz.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ monster.loot = {
9292
{ name = "ultimate spirit potion", chance = 10934, maxCount = 18 },
9393
{ name = "white gem", chance = 9600, maxCount = 3 },
9494
{ id = 43895, chance = 360 }, -- Bag you covet
95+
{ name = "darklight geode", chance = 500 },
9596
}
9697

9798
monster.attacks = {

data-crystal/monster/bosses/ichgahal.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ monster.loot = {
9999
{ name = "ichgahal's fungal infestation", chance = 7902, maxCount = 1 },
100100
{ name = "white gem", chance = 13559, maxCount = 3 },
101101
{ id = 43895, chance = 360 }, -- Bag you covet
102+
{ id = 43899, chance = 500 }, -- cursed wood
102103
}
103104

104105
monster.attacks = {

data-crystal/monster/bosses/vemiath.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ monster.loot = {
9696
{ name = "vemiath's infused basalt", chance = 7914, maxCount = 1 },
9797
{ name = "violet gem", chance = 7210, maxCount = 1 },
9898
{ id = 43895, chance = 360 }, -- Bag you covet
99+
{ name = "darklight geode", chance = 500 },
99100
}
100101

101102
monster.attacks = {

data-global/lib/quests/soul_war.lua

Lines changed: 51 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,63 +1283,70 @@ function Player:resetTaints(skipCheckTime)
12831283
end
12841284

12851285
function Monster:tryTeleportToPlayer(sayMessage)
1286+
if math.random(100) > 10 then
1287+
return
1288+
end
1289+
12861290
local range = 30
1287-
local spectators = Game.getSpectators(self:getPosition(), false, false, range, range, range, range)
1291+
local selfPos = self:getPosition()
1292+
1293+
local spectators = Game.getSpectators(selfPos, false, true, range, range, range, range)
12881294
local maxDistance = 0
12891295
local farthestPlayer = nil
12901296

1291-
for i, spectator in ipairs(spectators) do
1292-
if spectator:isPlayer() then
1293-
local player = spectator:getPlayer()
1294-
if player:getTaintNameByNumber(1) and player:getSoulWarZoneMonster() ~= nil then
1295-
local distance = self:getPosition():getDistance(player:getPosition())
1296-
if distance > maxDistance then
1297-
maxDistance = distance
1298-
farthestPlayer = player
1299-
logger.trace("Found player {} to teleport", player:getName())
1300-
end
1297+
for i = 1, #spectators do
1298+
local player = spectators[i]
1299+
if player and player:getTaintNameByNumber(1) and player:getSoulWarZoneMonster() ~= nil then
1300+
local playerPos = player:getPosition()
1301+
local distance = selfPos:getDistance(playerPos)
1302+
if distance > maxDistance then
1303+
maxDistance = distance
1304+
farthestPlayer = player
1305+
logger.trace("Found player {} to teleport", player:getName())
13011306
end
13021307
end
13031308
end
13041309

1305-
if farthestPlayer and math.random(100) <= 10 then
1306-
local playerPosition = farthestPlayer:getPosition()
1307-
if TaintTeleportCooldown[farthestPlayer:getId()] then
1308-
logger.trace("Cooldown is active to player {}", farthestPlayer:getName())
1310+
if not farthestPlayer then
1311+
return
1312+
end
1313+
1314+
if TaintTeleportCooldown[farthestPlayer:getId()] then
1315+
logger.trace("Cooldown is active to player {}", farthestPlayer:getName())
1316+
return
1317+
end
1318+
1319+
TaintTeleportCooldown[farthestPlayer:getId()] = true
1320+
1321+
logger.trace("Scheduling player {} to teleport", farthestPlayer:getName())
1322+
selfPos:sendMagicEffect(CONST_ME_MORTAREA)
1323+
farthestPlayer:getPosition():sendMagicEffect(CONST_ME_MORTAREA)
1324+
1325+
addEvent(function(playerId, monsterId, sayText)
1326+
local monsterEvent = Monster(monsterId)
1327+
local playerEvent = Player(playerId)
1328+
if not monsterEvent or not playerEvent then
13091329
return
13101330
end
13111331

1312-
if not TaintTeleportCooldown[farthestPlayer:getId()] then
1313-
TaintTeleportCooldown[farthestPlayer:getId()] = true
1314-
1315-
logger.trace("Scheduling player {} to teleport", farthestPlayer:getName())
1316-
self:getPosition():sendMagicEffect(CONST_ME_MORTAREA)
1317-
farthestPlayer:getPosition():sendMagicEffect(CONST_ME_MORTAREA)
1318-
addEvent(function(playerId, monsterId)
1319-
local monsterEvent = Monster(monsterId)
1320-
local playerEvent = Player(playerId)
1321-
if monsterEvent and playerEvent then
1322-
local destinationTile = Tile(playerPosition)
1323-
if destinationTile and not (destinationTile:hasProperty(CONST_PROP_BLOCKPROJECTILE) or destinationTile:hasProperty(CONST_PROP_MOVEABLE)) then
1324-
monsterEvent:say(sayMessage)
1325-
monsterEvent:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
1326-
monsterEvent:teleportTo(playerPosition, true)
1327-
monsterEvent:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
1328-
end
1329-
end
1330-
end, 2000, farthestPlayer:getId(), self:getId())
1331-
1332-
addEvent(function(playerId)
1333-
local playerEvent = Player(playerId)
1334-
if not playerEvent then
1335-
return
1336-
end
1332+
local destinationPos = playerEvent:getPosition()
1333+
local destinationTile = Tile(destinationPos)
1334+
if destinationTile and not (destinationTile:hasProperty(CONST_PROP_BLOCKPROJECTILE) or destinationTile:hasProperty(CONST_PROP_MOVEABLE)) then
1335+
monsterEvent:say(sayText)
1336+
monsterEvent:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
1337+
monsterEvent:teleportTo(destinationPos, true)
1338+
monsterEvent:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
1339+
end
1340+
end, 2000, farthestPlayer:getId(), self:getId(), sayMessage)
13371341

1338-
logger.trace("Cleaning player cooldown")
1339-
TaintTeleportCooldown[playerEvent:getId()] = nil
1340-
end, 10000, farthestPlayer:getId())
1342+
addEvent(function(playerId)
1343+
local playerEvent = Player(playerId)
1344+
if not playerEvent then
1345+
return
13411346
end
1342-
end
1347+
logger.trace("Cleaning player cooldown")
1348+
TaintTeleportCooldown[playerEvent:getId()] = nil
1349+
end, 10000, farthestPlayer:getId())
13431350
end
13441351

13451352
function Monster:getSoulWarKV()

data-global/monster/bosses/chagorz.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ monster.loot = {
9999
{ name = "the essence of chagorz", chance = 1050, maxCount = 1 },
100100
{ name = "unicorn figurine", chance = 500 },
101101
{ id = 43895, chance = 360 }, -- Bag you covet
102+
{ name = "darklight geode", chance = 500 },
102103
}
103104

104105
monster.attacks = {

data-global/monster/bosses/ichgahal.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ monster.loot = {
101101
{ name = "ichgahal's fungal infestation", chance = 7902, maxCount = 1 },
102102
{ name = "white gem", chance = 13559, maxCount = 3 },
103103
{ id = 43895, chance = 360 }, -- Bag you covet
104+
{ id = 43899, chance = 500 }, -- cursed wood
104105
}
105106

106107
monster.attacks = {

data-global/monster/bosses/vemiath.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ monster.loot = {
9898
{ name = "vemiath's infused basalt", chance = 7914, maxCount = 1 },
9999
{ name = "violet gem", chance = 7210, maxCount = 1 },
100100
{ id = 43895, chance = 360 }, -- Bag you covet
101+
{ name = "darklight geode", chance = 500 },
101102
}
102103

103104
monster.attacks = {

data-global/monster/quests/forgotten_knowledge/dragon_egg.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ monster.defenses = {
6969
}
7070

7171
monster.heals = {
72-
{ type = COMBAT_FIREDAMAGE, percent = 100 },
72+
{ type = COMBAT_FIREDAMAGE, percent = 90 },
7373
}
7474

7575
monster.elements = {
7676
{ type = COMBAT_PHYSICALDAMAGE, percent = 0 },
7777
{ type = COMBAT_ENERGYDAMAGE, percent = 0 },
7878
{ type = COMBAT_EARTHDAMAGE, percent = 0 },
79-
{ type = COMBAT_FIREDAMAGE, percent = 10 },
79+
{ type = COMBAT_FIREDAMAGE, percent = 100 },
8080
{ type = COMBAT_LIFEDRAIN, percent = 0 },
8181
{ type = COMBAT_MANADRAIN, percent = 0 },
8282
{ type = COMBAT_DROWNDAMAGE, percent = 0 },

data-global/monster/quests/the_secret_library/bosses/grand_master_oberon.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ monster.immunities = {
123123
}
124124

125125
mType.onThink = function(monster, interval)
126-
if monster:getStorageValue(GrandMasterOberonConfig.Storage.Life) <= GrandMasterOberonConfig.AmountLife then
126+
if monster:getStorageValue(GrandMasterOberonConfig.Storage.Life) == -1 then
127+
monster:setStorageValue(GrandMasterOberonConfig.Storage.Life, 0)
128+
end
129+
local currentLifeStorage = monster:getStorageValue(GrandMasterOberonConfig.Storage.Life)
130+
if currentLifeStorage < GrandMasterOberonConfig.AmountLife then
127131
local percentageHealth = (monster:getHealth() * 100) / monster:getMaxHealth()
128132
if percentageHealth <= 20 then
129133
SendOberonAsking(monster)

data-global/monster/quests/the_secret_library/bosses/grand_master_oberon_functions.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ local function healOberon(monster)
4747
end
4848

4949
function SendOberonAsking(monster)
50+
local currentLife = monster:getStorageValue(GrandMasterOberonConfig.Storage.Life)
51+
if currentLife >= GrandMasterOberonConfig.AmountLife then
52+
return
53+
end
5054
monster:registerEvent("OberonImmunity")
5155
local random = math.random(#GrandMasterOberonAsking)
5256
monster:say(GrandMasterOberonAsking[random].msg, TALKTYPE_MONSTER_SAY)
5357
monster:setStorageValue(GrandMasterOberonConfig.Storage.Asking, random)
54-
5558
healOberon(monster)
56-
5759
Game.createMonster(GrandMasterOberonConfig.Monster[math.random(#GrandMasterOberonConfig.Monster)], monster:getPosition(), true, true)
5860
end

0 commit comments

Comments
 (0)