Ir para conteúdo
  • 0
Entre para seguir isso  
ricow

Scripting Bosses Grave Danger

Pergunta

ricow    2
ricow

Antes de fazer a sua pergunta, tenha certeza de ter lido as regras da seção e o guia abaixo:

https://forums.otserv.com.br/index.php?/forums/topic/168583-regras-da-seção/

https://forums.otserv.com.br/index.php?/forums/topic/165121-como-fazer-uma-pergunta-ou-o-grande-guia-do-usuário-com-dúvidas/

Obs: não delete esse formulário pré-definido, preencha-o corretamente para postar o seu tópico!

Descreva em algumas palavras a base utilizada. (Nome do servidor / Nome do cliente / Nome do website / etc.).

Base: OTServBR ; MyACC

 

Qual é a sua pergunta?

Oii gente!

Segui um tópico recente aqui do forum e consegui colocar os bosses da Grave Danger. Tudo funcionou perfeitamente, exceto uma coisa. Ao relogar o tempo de espera de 20h é perdido e o jogador pode fazer o boss novamente.

Eu imagino que faltou adicionar algum storage, mas quando eu tento fazer isso no storage.lua recebo diversos erros. Alguem sabe como fazer isso?

Postei o storage da Scarlett, que faz parte dessa quest e esta funcionando corretamente.

 

Você tem o código disponível? Se tiver poste-o na caixa de código que está dentro do spoiler abaixo:

Spoiler

-- Storage

GraveDanger = {
        -- Reserved storage from 52310 - 52339
        Questline = 52310,
        CobraBastion = {
            Questline = 52311,
            ScarlettTimer = 52312
        }
    },




-- King Zelos

local config = {
	requiredLevel = 250,
	daily = true,
	roomCenterPosition = Position(33443, 31546, 13),
	playerPositions = {
		Position(33485, 31546, 13),
		Position(33485, 31548, 13),
		Position(33485, 31547, 13),
		Position(33485, 31545, 13),
		Position(33485, 31544, 13),
		Position(33486, 31544, 13),
		Position(33486, 31545, 13),
		Position(33486, 31546, 13),
		Position(33486, 31547, 13),
		Position(33486, 31548, 13)
	},
	teleportPosition = Position(33446, 31552, 13),
	bossPosition = Position(33443, 31536, 13)
}

local leverboss = Action()

function leverboss.onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if item.itemid == 9825 then
		-- Check if the player that pulled the lever is on the correct position
		if player:getPosition() ~= config.playerPositions[1] then
			player:sendTextMessage(MESSAGE_STATUS_SMALL, "You can\'t start the battle.")
			return true
		end
		
		local team, participant = {}

		for i = 1, #config.playerPositions do
			participant = Tile(config.playerPositions[i]):getTopCreature()
			
			-- Check there is a participant player
			if participant and participant:isPlayer() then
				-- Check participant level
				if participant:getLevel() < config.requiredLevel then
					player:sendTextMessage(MESSAGE_STATUS_SMALL,
						"All the players need to be level ".. config.requiredLevel .." or higher.")
					return true
				end

				-- Check participant boss timer
				if config.daily and participant:getStorageValue(Storage.GraveDanger.KingZelosTimer) > os.time() then
					player:getPosition():sendMagicEffect(CONST_ME_POFF)
					player:sendCancelMessage("Not all players are ready yet from last battle.")
					return true
				end

				team[#team + 1] = participant
			end
		end

		-- Check if a team currently inside the boss room
		local specs, spec = Game.getSpectators(config.roomCenterPosition, false, false, 14, 14, 13, 13)
		for i = 1, #specs do
			spec = specs[i]
			if spec:isPlayer() then
				player:sendTextMessage(MESSAGE_STATUS_SMALL, "A team is already inside the boss room.")
				return true
			end

			spec:remove()
		end

		-- Spawn boss
		Game.createMonster("King Zelos", config.bossPosition)

		-- Teleport team participants
		for i = 1, #team do
			team[i]:getPosition():sendMagicEffect(CONST_ME_POFF)
			team[i]:teleportTo(config.teleportPosition)
			-- Assign boss timer
			team[i]:setStorageValue(Storage.GraveDanger.KingZelosTimer, os.time() + 20*60*60) -- 20 hours
		end
		
		config.teleportPosition:sendMagicEffect(CONST_ME_ENERGYAREA)
	end

	item:transform(9825)
	return true
end

leverboss:uid(9999)
leverboss:register()

 

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, anexe-a dentro do spoiler abaixo:

Spoiler

 

 

Compartilhar este post


Link para o post

0 respostass a esta questão

Recommended Posts

Até agora não há respostas para essa pergunta

Visitante
Este tópico está impedido de receber novos posts.
Entre para seguir isso  
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×