mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-04-30 01:29:21 +02:00
fix parchment room quest demons spawning:
https://github.com/TwistedScorpio/Nostalrius/issues/18
This commit is contained in:
parent
c46ab0d012
commit
0364ba62ed
@ -55,6 +55,17 @@ function Game.isPlayerThere(position)
|
||||
return false
|
||||
end
|
||||
|
||||
function Game.isMonsterThere(position, monsterName)
|
||||
local tile = Tile(position)
|
||||
local creatures = tile:getCreatures()
|
||||
for _, creature in ipairs(creatures) do
|
||||
if creature:isMonster() and creature:getName():lower() == monsterName:lower() then
|
||||
return creature
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
function Game.broadcastMessage(message, messageType)
|
||||
if messageType == nil then
|
||||
messageType = MESSAGE_STATUS_WARNING
|
||||
|
@ -1,10 +1,31 @@
|
||||
function onRemoveItem(item, tileitem, position)
|
||||
doRelocate({x = 33336, y = 31954, z = 15},{x = 33060, y = 31623, z = 15})
|
||||
doRelocate({x = 33340, y = 31954, z = 15},{x = 33066, y = 31623, z = 15})
|
||||
doRelocate({x = 33340, y = 31958, z = 15},{x = 33066, y = 31627, z = 15})
|
||||
doRelocate({x = 33336, y = 31958, z = 15},{x = 33060, y = 31627, z = 15})
|
||||
Game.sendMagicEffect({x = 33060, y = 31622, z = 15}, 14)
|
||||
Game.sendMagicEffect({x = 33066, y = 31622, z = 15}, 14)
|
||||
Game.sendMagicEffect({x = 33066, y = 31628, z = 15}, 14)
|
||||
Game.sendMagicEffect({x = 33060, y = 31628, z = 15}, 14)
|
||||
end
|
||||
local demonsInRoomCount = 0;
|
||||
local spectators = Game.getSpectators(Position(33063, 31624, 15), false, false, 20, 20, 20, 20)
|
||||
for i = 1, #spectators do
|
||||
local creature = spectators[i]
|
||||
if creature:getName():lower() == "demon" then
|
||||
demonsInRoomCount = demonsInRoomCount + 1
|
||||
end
|
||||
end
|
||||
|
||||
if (demonsInRoomCount <= 1) then
|
||||
local demon1 = Game.isMonsterThere({x = 33336, y = 31954, z = 15}, "Demon")
|
||||
local demon2 = Game.isMonsterThere({x = 33340, y = 31954, z = 15}, "Demon")
|
||||
local demon3 = Game.isMonsterThere({x = 33340, y = 31958, z = 15}, "Demon")
|
||||
local demon4 = Game.isMonsterThere({x = 33336, y = 31958, z = 15}, "Demon")
|
||||
if demon1 ~= nil and demon2 ~= nil and demon3 ~= nil and demon4 ~= nil then
|
||||
demon1:addHealth(-demon1:getMaxHealth())
|
||||
demon2:addHealth(-demon2:getMaxHealth())
|
||||
demon3:addHealth(-demon3:getMaxHealth())
|
||||
demon4:addHealth(-demon4:getMaxHealth())
|
||||
Game.createMonster("Demon", {x = 33060, y = 31623, z = 15})
|
||||
Game.createMonster("Demon", {x = 33066, y = 31623, z = 15})
|
||||
Game.createMonster("Demon", {x = 33066, y = 31627, z = 15})
|
||||
Game.createMonster("Demon", {x = 33060, y = 31627, z = 15})
|
||||
Game.sendMagicEffect({x = 33060, y = 31622, z = 15}, 14)
|
||||
Game.sendMagicEffect({x = 33066, y = 31622, z = 15}, 14)
|
||||
Game.sendMagicEffect({x = 33066, y = 31628, z = 15}, 14)
|
||||
Game.sendMagicEffect({x = 33060, y = 31628, z = 15}, 14)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user