Ir para conteúdo
  • 0
Famosiin

Scripting [ERROR] Ice Portal Forgotten knowledge

Pergunta

Famosiin    0
Famosiin

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:

OTServerBR

Qual é a sua pergunta?

Fala pessoal beleza? estou com o seguinte erro no boss ice portal da forgotten quest. ao bater as bombs no egg quando ele se cura por completo apresenta o seguinte erro

Lua Script Error: [Scripts Interface]
C:\Users\Leonardo Macedo\Desktop\otservbr-global\data\scripts\creaturescripts\quests\forgotten_knowledge\dragon_egg.lua:callback
...reaturescripts\quests\forgotten_knowledge\dragon_egg.lua:32: attempt to index local 'melting' (a nil value)
stack traceback:
        [C]: in function '__index'
        ...reaturescripts\quests\forgotten_knowledge\dragon_egg.lua:32: in function 'changeHorror'
        ...reaturescripts\quests\forgotten_knowledge\dragon_egg.lua:61: in function <...reaturescripts\quests\forgotten_knowledge\dragon_egg.lua:49>
        [C]: at 0x7ff6c04eb220

postei o script abaixo

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

Spoiler

 local function revertHorror()
	local melting = Tile(Position(32267, 31071, 14)):getTopCreature()
	local diference, pos, monster = 0, 0, false
	local specs, spec = Game.getSpectators(Position(32269, 31091, 14), false, false, 12, 12, 12, 12)
	for i = 1, #specs do
		spec = specs[i]
		if spec:isMonster() and spec:getName():lower() == 'melting frozen horror' then
			health = spec:getHealth()
			pos = spec:getPosition()
			spec:teleportTo(Position(32267, 31071, 14))
			diference = melting:getHealth() - health
			melting:addHealth( - diference)
			melting:teleportTo(pos)
			monster = true
		end
	end
	if not monster then
		if melting then
			melting:remove()
		end
	end
end

local function changeHorror()
	local melting = Tile(Position(32267, 31071, 14)):getTopCreature()
	local pos = 0
	local specs, spec = Game.getSpectators(Position(32269, 31091, 14), false, false, 12, 12, 12, 12)
	for i = 1, #specs do
		spec = specs[i]
		if spec:isMonster() and spec:getName():lower() == 'solid frozen horror' then
			pos = spec:getPosition()
			spec:teleportTo(Position(32267, 31071, 14))
			melting:teleportTo(pos)
		end
	end
	addEvent(revertHorror, 20 * 1000)
end

local dragonEggPrepareDeath = CreatureEvent("DragonEggPrepareDeath")
function dragonEggPrepareDeath.onPrepareDeath(creature, lastHitKiller, mostDamageKiller)
	if not creature:getName():lower() == "dragon egg" and creature:isMonster() then
		return true
	end
	creature:addHealth(1, false)
	return true
end
dragonEggPrepareDeath:register()

local dragonEggHealthChange = CreatureEvent("DragonEggHealthChange")
function dragonEggHealthChange.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
	if creature:getName():lower() == 'dragon egg' then
		if primaryType == COMBAT_HEALING then
			doTargetCombatHealth(0, creature, COMBAT_ICEDAMAGE, -primaryDamage, -primaryDamage, CONST_ME_MAGIC_GREEN)
			return true
		end
		if primaryType == COMBAT_FIREDAMAGE then
			primaryType = COMBAT_HEALING
			creature:addHealth(primaryDamage, true)
			if creature:getHealth() == creature:getMaxHealth() then
				creature:say('The egg sends out a fiery eruption!\n Weakening the frozen horror significantly!', TALKTYPE_MONSTER_SAY)
				doTargetCombatHealth(0, creature, COMBAT_ICEDAMAGE, -creature:getMaxHealth()/2, -creature:getMaxHealth()/2, CONST_ME_MAGIC_GREEN)
				changeHorror()
			end
			return true
		end
	end
	return primaryDamage, primaryType, secondaryDamage, secondaryType
end
dragonEggHealthChange: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
Compartilhar em outros sites

1 resposta a esta questão

Recommended Posts

Visitante
Este tópico está impedido de receber novos posts.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×