Ir para conteúdo
  • 0

Ferumbras' Ascendant Nao funciona


xbiruta

Pergunta

fala pessoal blz, bom vamos la, alguma alma sabia para poder me ajudar com um script?

o problema é que ao entrar na sala do boss isso tudo normal, transformamos os cristais normalmente, de verde para rosa, posterior aparece o Ferumbras Soul Splinter normal, depois de matá-lo, aparece os Ferumbras Essence normal, e ao passar eles pelo vortex eles se tranformam em poeira tbm normal, porem ao passarem todos pelos vortex, teria que nascer um Ferumbras Desestabilizado e ai que esta o problema, além dos rift invasor da sala não sumirem o ferumbras tbm não nasce na sala, se eu sumono ele com o GM e mato ele na sala, ai o ferumbras mortal sheel aparece normal e quando ele morre o portal se transforma no que vai para sala de recompensa, normalmente. em fim acredito que o problema está neste meio tempo, entre as ferumbras essência e as ferumbras Desestabilizadas. o arquivo vortex, o que acredito que este com problema esta na pasta: movimento/ quest/ ferumbras_ascendant

vortex.lua rift_invader_death.lua ferumbras_lever.lua

Link para o comentário
Compartilhar em outros sites

6 respostass a esta questão

Posts Recomendados

  • 0

Bom dia, teste assim:

ferumbras_lever

local config = AscendingFerumbrasConfig

local function clearFerumbrasRoom()
	local spectators = Game.getSpectators(config.bossPos, false, false, 20, 20, 20, 20)
	for i = 1, #spectators do
		local spectator = spectators[i]
		if spectator:isPlayer() then
			spectator:teleportTo(config.exitPosition)
			spectator:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
			spectator:say("Time out! You were teleported out by strange forces.", TALKTYPE_MONSTER_SAY)
		elseif spectator:isMonster() then
			spectator:remove()
		end
	end
end

local ferumbrasAscendantLever = Action()
function ferumbrasAscendantLever.onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if item.itemid == 8911 then
		if player:getPosition() ~= config.leverPos then
			return true
		end

		for x = 33269, 33271 do
			for y = 31477, 31481 do
				local playerTile = Tile(Position(x, y, 14)):getTopCreature()
				if playerTile and playerTile:isPlayer() then
					if not playerTile:canFightBoss("Ferumbras Mortal Shell") then
						player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You or a member in your team have to wait %d days to face Ferumbras again!", config.days))
						item:transform(8912)
						return true
					end
				end
			end
		end

		local specs, spec = Game.getSpectators(config.centerRoom, false, false, 15, 15, 15, 15)
		for i = 1, #specs do
			spec = specs[i]
			if spec:isPlayer() then
				player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There's someone fighting with Ferumbras.")
				return true
			end
		end

		local spectators = Game.getSpectators(config.bossPos, false, false, 15, 15, 15, 15)
		for i = 1, #spectators do
			local spectator = spectators[i]
			if spectator:isMonster() then
				spectator:remove()
			end
		end

		for x = 33269, 33271 do
			for y = 31477, 31481 do
				local playerTile = Tile(Position(x, y, 14)):getTopCreature()
				if playerTile and playerTile:isPlayer() then
					playerTile:getPosition():sendMagicEffect(CONST_ME_POFF)
					playerTile:teleportTo(config.newPos)
					playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
					playerTile:setBossCooldown("Ferumbras Mortal Shell", os.time() + config.days * 24 * 3600)
					player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have %d minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.", config.time))
					addEvent(clearFerumbrasRoom, config.time * 60 * 1000, player:getId(), config.centerRoom, config.range, config.range, config.exitPosition)

					for b = 1, config.maxSummon do
						local xrand = math.random(-4, 4)
						local yrand = math.random(-4, 4)
						local position = Position(33392 + xrand, 31473 + yrand, 14)
						if not Game.createMonster(config.summonName, position) then
							logger.error("[ferumbrasAscendantLever.onUse] can't create monster {}, on position {}", config.summonName, position:toString())
						end
					end

					Game.createMonster(config.bossName, config.bossPos, true, true)
					item:transform(8912)
				end
			end
		end
	elseif item.itemid == 8912 then
		item:transform(8911)
		return true
	end
end

ferumbrasAscendantLever:uid(1021)
ferumbrasAscendantLever:register()




rift_invader_death

local crystals = {
    [1] = { fromPosition = Position(33389, 31467, 14), toPosition = Position(33391, 31469, 14), crystalPosition = Position(33390, 31468, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal1 },
    [2] = { fromPosition = Position(33393, 31467, 14), toPosition = Position(33395, 31469, 14), crystalPosition = Position(33394, 31468, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal2 },
    [3] = { fromPosition = Position(33396, 31470, 14), toPosition = Position(33398, 31472, 14), crystalPosition = Position(33397, 31471, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal3 },
    [4] = { fromPosition = Position(33396, 31474, 14), toPosition = Position(33398, 31476, 14), crystalPosition = Position(33397, 31475, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal4 },
    [5] = { fromPosition = Position(33393, 31477, 14), toPosition = Position(33395, 31479, 14), crystalPosition = Position(33394, 31478, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal5 },
    [6] = { fromPosition = Position(33389, 31477, 14), toPosition = Position(33391, 31479, 14), crystalPosition = Position(33390, 31478, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal6 },
    [7] = { fromPosition = Position(33386, 31474, 14), toPosition = Position(33388, 31476, 14), crystalPosition = Position(33387, 31475, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal7 },
    [8] = { fromPosition = Position(33386, 31470, 14), toPosition = Position(33388, 31472, 14), crystalPosition = Position(33387, 31471, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal8 },
}

local config = AscendingFerumbrasConfig

local riftInvaderDeath = CreatureEvent("RiftInvaderDeath")
function riftInvaderDeath.onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
    local pos = Position(33392 + math.random(-4, 4), 31473 + math.random(-4, 4), 14)
    local name = creature:getName():lower()
    if name ~= "rift invader" then
        return true
    end
    Game.createMonster(name, pos)

    for i = 1, #crystals do
        local crystal = crystals[i]
        if creature:getPosition():isInRange(crystal.fromPosition, crystal.toPosition) then
            if Game.getStorageValue(crystal.globalStorage) > 6 then
                local item = Tile(crystal.crystalPosition):getItemById(14955)
                if not item then
                    return true
                end
                item:transform(14961)
                Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals) + 1)
            end
            if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals) == 8 then
                local creature = Tile(config.bossPos):getTopCreature()
                if creature then
                    creature:say("NOOOOOOOOOOO!", TALKTYPE_MONSTER_YELL)
                    creature:say("FERUMBRAS BURSTS INTO SOUL SPLINTERS!", TALKTYPE_MONSTER_YELL, nil, nil, Position(33392, 31475, 14))
                    creature:remove()
                end
                for a = 1, #crystals do
                    local crystalEffect = crystals[a]
                    crystalEffect.crystalPosition:sendMagicEffect(CONST_ME_FERUMBRAS)
                    Game.createMonster("Ferumbras Soul Splinter", Position(33392, 31473, 14), false, true)
                end
            end
            Game.setStorageValue(crystal.globalStorage, Game.getStorageValue(crystal.globalStorage) + 1)
            lasthitkiller:say("The negative energy of the rift creature is absorbed by the crystal!", TALKTYPE_MONSTER_SAY, nil, nil, crystal.crystalPosition)
            lasthitkiller:say("ARGH!", TALKTYPE_MONSTER_SAY, nil, nil, Position(33392, 31473, 14))
        end
    end

    local pool = Tile(creature:getPosition()):getItemById(2886)
    if pool then
        pool:remove()
    end

    local vortex = Game.createItem(config.vortex, 1, creature:getPosition())
    if vortex then
        addEvent(function(creaturePos)
            local tile = Tile(creaturePos)
            if tile then
                local vortexItem = tile:getItemById(config.vortex)
                if vortexItem then
                    vortexItem:remove(1)
                end
            end
        end, 10 * 1000, creature:getPosition())
    end
    return true
end

riftInvaderDeath:register()




Vortex:
 

local vortex = MoveEvent()

local config = AscendingFerumbrasConfig

function vortex.onStepIn(creature, item, position, fromPosition)
    local monster = creature:getMonster()
    if not monster or monster:getName():lower() ~= "ferumbras essence" then
        return true
    end

    monster:remove()
    position:sendMagicEffect(CONST_ME_POFF)
    local essenceCount = Game.getStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence)
    if essenceCount < 0 then
        essenceCount = 0
    end
    Game.setStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence, essenceCount + 1)

    if essenceCount + 1 >= 8 then
        Game.createMonster("Destabilized Ferumbras", config.bossPos, true, true)
        for i = 1, config.maxSummon do
            local summonPos = Position(math.random(33381, 33403), math.random(31462, 31483), 14)
            if not Game.createMonster("Rift Fragment", summonPos, true, true) then
                print(string.format("Error: Could not create Rift Fragment at position %s", summonPos))
            end
        end
    end
    return true
end

vortex:type("stepin")
vortex:id(config.vortex)
vortex:register()


 

Link para o comentário
Compartilhar em outros sites

  • 0
5 horas atrás, Holograma disse:

Bom dia, teste assim:

ferumbras_lever

local config = AscendingFerumbrasConfig

local function clearFerumbrasRoom()
	local spectators = Game.getSpectators(config.bossPos, false, false, 20, 20, 20, 20)
	for i = 1, #spectators do
		local spectator = spectators[i]
		if spectator:isPlayer() then
			spectator:teleportTo(config.exitPosition)
			spectator:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
			spectator:say("Time out! You were teleported out by strange forces.", TALKTYPE_MONSTER_SAY)
		elseif spectator:isMonster() then
			spectator:remove()
		end
	end
end

local ferumbrasAscendantLever = Action()
function ferumbrasAscendantLever.onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if item.itemid == 8911 then
		if player:getPosition() ~= config.leverPos then
			return true
		end

		for x = 33269, 33271 do
			for y = 31477, 31481 do
				local playerTile = Tile(Position(x, y, 14)):getTopCreature()
				if playerTile and playerTile:isPlayer() then
					if not playerTile:canFightBoss("Ferumbras Mortal Shell") then
						player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You or a member in your team have to wait %d days to face Ferumbras again!", config.days))
						item:transform(8912)
						return true
					end
				end
			end
		end

		local specs, spec = Game.getSpectators(config.centerRoom, false, false, 15, 15, 15, 15)
		for i = 1, #specs do
			spec = specs[i]
			if spec:isPlayer() then
				player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There's someone fighting with Ferumbras.")
				return true
			end
		end

		local spectators = Game.getSpectators(config.bossPos, false, false, 15, 15, 15, 15)
		for i = 1, #spectators do
			local spectator = spectators[i]
			if spectator:isMonster() then
				spectator:remove()
			end
		end

		for x = 33269, 33271 do
			for y = 31477, 31481 do
				local playerTile = Tile(Position(x, y, 14)):getTopCreature()
				if playerTile and playerTile:isPlayer() then
					playerTile:getPosition():sendMagicEffect(CONST_ME_POFF)
					playerTile:teleportTo(config.newPos)
					playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
					playerTile:setBossCooldown("Ferumbras Mortal Shell", os.time() + config.days * 24 * 3600)
					player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have %d minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.", config.time))
					addEvent(clearFerumbrasRoom, config.time * 60 * 1000, player:getId(), config.centerRoom, config.range, config.range, config.exitPosition)

					for b = 1, config.maxSummon do
						local xrand = math.random(-4, 4)
						local yrand = math.random(-4, 4)
						local position = Position(33392 + xrand, 31473 + yrand, 14)
						if not Game.createMonster(config.summonName, position) then
							logger.error("[ferumbrasAscendantLever.onUse] can't create monster {}, on position {}", config.summonName, position:toString())
						end
					end

					Game.createMonster(config.bossName, config.bossPos, true, true)
					item:transform(8912)
				end
			end
		end
	elseif item.itemid == 8912 then
		item:transform(8911)
		return true
	end
end

ferumbrasAscendantLever:uid(1021)
ferumbrasAscendantLever:register()




rift_invader_death

local crystals = {
    [1] = { fromPosition = Position(33389, 31467, 14), toPosition = Position(33391, 31469, 14), crystalPosition = Position(33390, 31468, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal1 },
    [2] = { fromPosition = Position(33393, 31467, 14), toPosition = Position(33395, 31469, 14), crystalPosition = Position(33394, 31468, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal2 },
    [3] = { fromPosition = Position(33396, 31470, 14), toPosition = Position(33398, 31472, 14), crystalPosition = Position(33397, 31471, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal3 },
    [4] = { fromPosition = Position(33396, 31474, 14), toPosition = Position(33398, 31476, 14), crystalPosition = Position(33397, 31475, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal4 },
    [5] = { fromPosition = Position(33393, 31477, 14), toPosition = Position(33395, 31479, 14), crystalPosition = Position(33394, 31478, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal5 },
    [6] = { fromPosition = Position(33389, 31477, 14), toPosition = Position(33391, 31479, 14), crystalPosition = Position(33390, 31478, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal6 },
    [7] = { fromPosition = Position(33386, 31474, 14), toPosition = Position(33388, 31476, 14), crystalPosition = Position(33387, 31475, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal7 },
    [8] = { fromPosition = Position(33386, 31470, 14), toPosition = Position(33388, 31472, 14), crystalPosition = Position(33387, 31471, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal8 },
}

local config = AscendingFerumbrasConfig

local riftInvaderDeath = CreatureEvent("RiftInvaderDeath")
function riftInvaderDeath.onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
    local pos = Position(33392 + math.random(-4, 4), 31473 + math.random(-4, 4), 14)
    local name = creature:getName():lower()
    if name ~= "rift invader" then
        return true
    end
    Game.createMonster(name, pos)

    for i = 1, #crystals do
        local crystal = crystals[i]
        if creature:getPosition():isInRange(crystal.fromPosition, crystal.toPosition) then
            if Game.getStorageValue(crystal.globalStorage) > 6 then
                local item = Tile(crystal.crystalPosition):getItemById(14955)
                if not item then
                    return true
                end
                item:transform(14961)
                Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals) + 1)
            end
            if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals) == 8 then
                local creature = Tile(config.bossPos):getTopCreature()
                if creature then
                    creature:say("NOOOOOOOOOOO!", TALKTYPE_MONSTER_YELL)
                    creature:say("FERUMBRAS BURSTS INTO SOUL SPLINTERS!", TALKTYPE_MONSTER_YELL, nil, nil, Position(33392, 31475, 14))
                    creature:remove()
                end
                for a = 1, #crystals do
                    local crystalEffect = crystals[a]
                    crystalEffect.crystalPosition:sendMagicEffect(CONST_ME_FERUMBRAS)
                    Game.createMonster("Ferumbras Soul Splinter", Position(33392, 31473, 14), false, true)
                end
            end
            Game.setStorageValue(crystal.globalStorage, Game.getStorageValue(crystal.globalStorage) + 1)
            lasthitkiller:say("The negative energy of the rift creature is absorbed by the crystal!", TALKTYPE_MONSTER_SAY, nil, nil, crystal.crystalPosition)
            lasthitkiller:say("ARGH!", TALKTYPE_MONSTER_SAY, nil, nil, Position(33392, 31473, 14))
        end
    end

    local pool = Tile(creature:getPosition()):getItemById(2886)
    if pool then
        pool:remove()
    end

    local vortex = Game.createItem(config.vortex, 1, creature:getPosition())
    if vortex then
        addEvent(function(creaturePos)
            local tile = Tile(creaturePos)
            if tile then
                local vortexItem = tile:getItemById(config.vortex)
                if vortexItem then
                    vortexItem:remove(1)
                end
            end
        end, 10 * 1000, creature:getPosition())
    end
    return true
end

riftInvaderDeath:register()




Vortex:
 

local vortex = MoveEvent()

local config = AscendingFerumbrasConfig

function vortex.onStepIn(creature, item, position, fromPosition)
    local monster = creature:getMonster()
    if not monster or monster:getName():lower() ~= "ferumbras essence" then
        return true
    end

    monster:remove()
    position:sendMagicEffect(CONST_ME_POFF)
    local essenceCount = Game.getStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence)
    if essenceCount < 0 then
        essenceCount = 0
    end
    Game.setStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence, essenceCount + 1)

    if essenceCount + 1 >= 8 then
        Game.createMonster("Destabilized Ferumbras", config.bossPos, true, true)
        for i = 1, config.maxSummon do
            local summonPos = Position(math.random(33381, 33403), math.random(31462, 31483), 14)
            if not Game.createMonster("Rift Fragment", summonPos, true, true) then
                print(string.format("Error: Could not create Rift Fragment at position %s", summonPos))
            end
        end
    end
    return true
end

vortex:type("stepin")
vortex:id(config.vortex)
vortex:register()


 

fala meu mano blz , primeiramente ai obrigado pela ajuda, porem ficou da mesma forma, nao funcionou 😢

Link para o comentário
Compartilhar em outros sites

  • 0

vamos alterar a lógica entao:

 

function vortex.onStepIn(creature, item, position, fromPosition)
    local monster = creature:getMonster()
    if not monster or monster:getName():lower() ~= "ferumbras essence" then
        return true
    end

    print("Ferumbras Essence entrou no vortex")

    monster:remove()
    position:sendMagicEffect(CONST_ME_POFF)

    local essenceCount = Game.getStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence)
    if essenceCount < 0 then
        essenceCount = 0
    end
    essenceCount = essenceCount + 1
    Game.setStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence, essenceCount)

    print("Número atual de essências:", essenceCount)

    if essenceCount >= 8 then
        print("Todas as essências transformadas, criando Destabilized Ferumbras")
        Game.createMonster("Destabilized Ferumbras", config.bossPos, true, true)
        for i = 1, config.maxSummon do
            local summonPos = Position(math.random(33381, 33403), math.random(31462, 31483), 14)
            if not Game.createMonster("Rift Fragment", summonPos, true, true) then
                print(string.format("Error: Could not create Rift Fragment at position %s", summonPos))
            end
        end
    end

    return true
end



 

Link para o comentário
Compartilhar em outros sites

  • 0
Em 04/06/2024 em 08:07, Holograma disse:

Bom dia, teste assim:

ferumbras_lever

local config = AscendingFerumbrasConfig

local function clearFerumbrasRoom()
	local spectators = Game.getSpectators(config.bossPos, false, false, 20, 20, 20, 20)
	for i = 1, #spectators do
		local spectator = spectators[i]
		if spectator:isPlayer() then
			spectator:teleportTo(config.exitPosition)
			spectator:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
			spectator:say("Time out! You were teleported out by strange forces.", TALKTYPE_MONSTER_SAY)
		elseif spectator:isMonster() then
			spectator:remove()
		end
	end
end

local ferumbrasAscendantLever = Action()
function ferumbrasAscendantLever.onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if item.itemid == 8911 then
		if player:getPosition() ~= config.leverPos then
			return true
		end

		for x = 33269, 33271 do
			for y = 31477, 31481 do
				local playerTile = Tile(Position(x, y, 14)):getTopCreature()
				if playerTile and playerTile:isPlayer() then
					if not playerTile:canFightBoss("Ferumbras Mortal Shell") then
						player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You or a member in your team have to wait %d days to face Ferumbras again!", config.days))
						item:transform(8912)
						return true
					end
				end
			end
		end

		local specs, spec = Game.getSpectators(config.centerRoom, false, false, 15, 15, 15, 15)
		for i = 1, #specs do
			spec = specs[i]
			if spec:isPlayer() then
				player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There's someone fighting with Ferumbras.")
				return true
			end
		end

		local spectators = Game.getSpectators(config.bossPos, false, false, 15, 15, 15, 15)
		for i = 1, #spectators do
			local spectator = spectators[i]
			if spectator:isMonster() then
				spectator:remove()
			end
		end

		for x = 33269, 33271 do
			for y = 31477, 31481 do
				local playerTile = Tile(Position(x, y, 14)):getTopCreature()
				if playerTile and playerTile:isPlayer() then
					playerTile:getPosition():sendMagicEffect(CONST_ME_POFF)
					playerTile:teleportTo(config.newPos)
					playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
					playerTile:setBossCooldown("Ferumbras Mortal Shell", os.time() + config.days * 24 * 3600)
					player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have %d minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.", config.time))
					addEvent(clearFerumbrasRoom, config.time * 60 * 1000, player:getId(), config.centerRoom, config.range, config.range, config.exitPosition)

					for b = 1, config.maxSummon do
						local xrand = math.random(-4, 4)
						local yrand = math.random(-4, 4)
						local position = Position(33392 + xrand, 31473 + yrand, 14)
						if not Game.createMonster(config.summonName, position) then
							logger.error("[ferumbrasAscendantLever.onUse] can't create monster {}, on position {}", config.summonName, position:toString())
						end
					end

					Game.createMonster(config.bossName, config.bossPos, true, true)
					item:transform(8912)
				end
			end
		end
	elseif item.itemid == 8912 then
		item:transform(8911)
		return true
	end
end

ferumbrasAscendantLever:uid(1021)
ferumbrasAscendantLever:register()




rift_invader_death

local crystals = {
    [1] = { fromPosition = Position(33389, 31467, 14), toPosition = Position(33391, 31469, 14), crystalPosition = Position(33390, 31468, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal1 },
    [2] = { fromPosition = Position(33393, 31467, 14), toPosition = Position(33395, 31469, 14), crystalPosition = Position(33394, 31468, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal2 },
    [3] = { fromPosition = Position(33396, 31470, 14), toPosition = Position(33398, 31472, 14), crystalPosition = Position(33397, 31471, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal3 },
    [4] = { fromPosition = Position(33396, 31474, 14), toPosition = Position(33398, 31476, 14), crystalPosition = Position(33397, 31475, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal4 },
    [5] = { fromPosition = Position(33393, 31477, 14), toPosition = Position(33395, 31479, 14), crystalPosition = Position(33394, 31478, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal5 },
    [6] = { fromPosition = Position(33389, 31477, 14), toPosition = Position(33391, 31479, 14), crystalPosition = Position(33390, 31478, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal6 },
    [7] = { fromPosition = Position(33386, 31474, 14), toPosition = Position(33388, 31476, 14), crystalPosition = Position(33387, 31475, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal7 },
    [8] = { fromPosition = Position(33386, 31470, 14), toPosition = Position(33388, 31472, 14), crystalPosition = Position(33387, 31471, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal8 },
}

local config = AscendingFerumbrasConfig

local riftInvaderDeath = CreatureEvent("RiftInvaderDeath")
function riftInvaderDeath.onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
    local pos = Position(33392 + math.random(-4, 4), 31473 + math.random(-4, 4), 14)
    local name = creature:getName():lower()
    if name ~= "rift invader" then
        return true
    end
    Game.createMonster(name, pos)

    for i = 1, #crystals do
        local crystal = crystals[i]
        if creature:getPosition():isInRange(crystal.fromPosition, crystal.toPosition) then
            if Game.getStorageValue(crystal.globalStorage) > 6 then
                local item = Tile(crystal.crystalPosition):getItemById(14955)
                if not item then
                    return true
                end
                item:transform(14961)
                Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals) + 1)
            end
            if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals) == 8 then
                local creature = Tile(config.bossPos):getTopCreature()
                if creature then
                    creature:say("NOOOOOOOOOOO!", TALKTYPE_MONSTER_YELL)
                    creature:say("FERUMBRAS BURSTS INTO SOUL SPLINTERS!", TALKTYPE_MONSTER_YELL, nil, nil, Position(33392, 31475, 14))
                    creature:remove()
                end
                for a = 1, #crystals do
                    local crystalEffect = crystals[a]
                    crystalEffect.crystalPosition:sendMagicEffect(CONST_ME_FERUMBRAS)
                    Game.createMonster("Ferumbras Soul Splinter", Position(33392, 31473, 14), false, true)
                end
            end
            Game.setStorageValue(crystal.globalStorage, Game.getStorageValue(crystal.globalStorage) + 1)
            lasthitkiller:say("The negative energy of the rift creature is absorbed by the crystal!", TALKTYPE_MONSTER_SAY, nil, nil, crystal.crystalPosition)
            lasthitkiller:say("ARGH!", TALKTYPE_MONSTER_SAY, nil, nil, Position(33392, 31473, 14))
        end
    end

    local pool = Tile(creature:getPosition()):getItemById(2886)
    if pool then
        pool:remove()
    end

    local vortex = Game.createItem(config.vortex, 1, creature:getPosition())
    if vortex then
        addEvent(function(creaturePos)
            local tile = Tile(creaturePos)
            if tile then
                local vortexItem = tile:getItemById(config.vortex)
                if vortexItem then
                    vortexItem:remove(1)
                end
            end
        end, 10 * 1000, creature:getPosition())
    end
    return true
end

riftInvaderDeath:register()




Vortex:
 

local vortex = MoveEvent()

local config = AscendingFerumbrasConfig

function vortex.onStepIn(creature, item, position, fromPosition)
    local monster = creature:getMonster()
    if not monster or monster:getName():lower() ~= "ferumbras essence" then
        return true
    end

    monster:remove()
    position:sendMagicEffect(CONST_ME_POFF)
    local essenceCount = Game.getStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence)
    if essenceCount < 0 then
        essenceCount = 0
    end
    Game.setStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence, essenceCount + 1)

    if essenceCount + 1 >= 8 then
        Game.createMonster("Destabilized Ferumbras", config.bossPos, true, true)
        for i = 1, config.maxSummon do
            local summonPos = Position(math.random(33381, 33403), math.random(31462, 31483), 14)
            if not Game.createMonster("Rift Fragment", summonPos, true, true) then
                print(string.format("Error: Could not create Rift Fragment at position %s", summonPos))
            end
        end
    end
    return true
end

vortex:type("stepin")
vortex:id(config.vortex)
vortex:register()


 

fala maninho blz , mano nd ainda , ja virei e revirei td na net tentando resolver e nd. ta dificil de mais, msm assim eu agradeço por vc disponibilizar um pouco do seu tempo pra me ajudar . obrigado mesmo.

Link para o comentário
Compartilhar em outros sites

  • 0
local config = AscendingFerumbrasConfig

local crystals = {
    [1] = { fromPosition = Position(33389, 31467, 14), toPosition = Position(33391, 31469, 14), crystalPosition = Position(33390, 31468, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal1 },
    [2] = { fromPosition = Position(33393, 31467, 14), toPosition = Position(33395, 31469, 14), crystalPosition = Position(33394, 31468, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal2 },
    [3] = { fromPosition = Position(33396, 31470, 14), toPosition = Position(33398, 31472, 14), crystalPosition = Position(33397, 31471, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal3 },
    [4] = { fromPosition = Position(33396, 31474, 14), toPosition = Position(33398, 31476, 14), crystalPosition = Position(33397, 31475, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal4 },
    [5] = { fromPosition = Position(33393, 31477, 14), toPosition = Position(33395, 31479, 14), crystalPosition = Position(33394, 31478, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal5 },
    [6] = { fromPosition = Position(33389, 31477, 14), toPosition = Position(33391, 31479, 14), crystalPosition = Position(33390, 31478, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal6 },
    [7] = { fromPosition = Position(33386, 31474, 14), toPosition = Position(33388, 31476, 14), crystalPosition = Position(33387, 31475, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal7 },
    [8] = { fromPosition = Position(33386, 31470, 14), toPosition = Position(33388, 31472, 14), crystalPosition = Position(33387, 31471, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal8 },
}

local function createDestabilizedFerumbrasIfNeeded()
    local essenceCount = Game.getStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence)
    if essenceCount == 8 then
        Game.createMonster("Destabilized Ferumbras", config.bossPos, true, true)
        for i = 1, config.maxSummon do
            local summonPos = Position(math.random(33381, 33403), math.random(31462, 31483), 14)
            if not Game.createMonster("Rift Fragment", summonPos, true, true) then
                print(string.format("Error: Could not create Rift Fragment at position %s", summonPos))
            end
        end
    end
end

local riftInvaderDeath = CreatureEvent("RiftInvaderDeath")
function riftInvaderDeath.onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
    local name = creature:getName():lower()
    if name == "rift invader" then
        for i = 1, #crystals do
            local crystal = crystals[i]
            if creature:getPosition():isInRange(crystal.fromPosition, crystal.toPosition) then
                if Game.getStorageValue(crystal.globalStorage) > 6 then
                    local item = Tile(crystal.crystalPosition):getItemById(14955)
                    if item then
                        item:transform(14961)
                        Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals) + 1)
                        lasthitkiller:say("The negative energy of the rift creature is absorbed by the crystal!", TALKTYPE_MONSTER_SAY, nil, nil, crystal.crystalPosition)
                        lasthitkiller:say("ARGH!", TALKTYPE_MONSTER_SAY, nil, nil, Position(33392, 31473, 14))
                    end
                end
                Game.setStorageValue(crystal.globalStorage, Game.getStorageValue(crystal.globalStorage) + 1)
            end
        end

        local pool = Tile(creature:getPosition()):getItemById(2886)
        if pool then
            pool:remove()
        end

        local vortex = Game.createItem(config.vortex, 1, creature:getPosition())
        if vortex then
            addEvent(function(creaturePos)
                local tile = Tile(creaturePos)
                if tile then
                    local vortexItem = tile:getItemById(config.vortex)
                    if vortexItem then
                        vortexItem:remove(1)
                    end
                end
            end, 10 * 1000, creature:getPosition())
        end

        createDestabilizedFerumbrasIfNeeded()
    end
    return true
end

riftInvaderDeath:register()

local vortex = Action()
function vortex.onStepIn(creature, item, position, fromPosition)
    local monster = creature:getMonster()
    if monster and monster:getName():lower() == "ferumbras essence" then
        monster:remove()
        position:sendMagicEffect(CONST_ME_POFF)
        local essenceCount = Game.getStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence)
        if essenceCount < 0 then
            essenceCount = 0
        end
        essenceCount = essenceCount + 1
        Game.setStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence, essenceCount)
        if essenceCount >= 8 then
            createDestabilizedFerumbrasIfNeeded()
        end
    end
    return true
end

vortex:uid(1022)
vortex:register()

Neste código revisado, eu movi a criação do "Destabilized Ferumbras" para uma função separada chamada createDestabilizedFerumbrasIfNeeded. Esta função é chamada tanto na função riftInvaderDeath.onDeath quanto na função vortex.onStepIn, sempre que uma essência é transformada em cristal ou quando uma essência entra no vortex.
 

Link para o comentário
Compartilhar em outros sites

  • 0

Este arquivo no caso é um só ? Ainda preciso dos outros arquivos, ou com este aí eles se tornaram obsoletos? Tipo este é mais um arquivo ou substitui eles ?

Onde ponho este arquivo?

Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...