mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-13 22:34:53 +02:00
fix parchment room quest demons spawning:
https://github.com/TwistedScorpio/Nostalrius/issues/18
This commit is contained in:
@@ -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
|
Reference in New Issue
Block a user