Ir para conteúdo
  • Cadastre-se

Script Lion's Rock Quest


Posts Recomendados

Olá pessoal, sou novo no TK e gostaria de fazer um pedido

Alguém que pudesse me ajudar com script? é o seguinte, a quest aparentemente funciona, mas parece que o script está incompleto. Vejam as imagens abaixo

-- O portal parece não ter nenhuma action

image.thumb.png.ca4f1ecee7437951e9aedc398b533216.png

 

--Segundo que os items anexados abaixo na imagem não estão tendo função ao dar use nos monumentos

-Cobra tongue => Slightly Feline Statue não tem função ao dar use

-Orange-Red Flower => Coal Basin

-Ewer with holy water => Ornamented Stone Pedestal

 

Todos os items mencionados estão com o mesmo problema, agora não tenho certeza se são realmente os items ou os monumentos

quem puder ajudar eu agradeço, o esqueleto que da incício a quest funciona perfeitamente.

image.thumb.png.91f2f3053880a540a8a1286cc1c0bd15.png

 

data\scripts\actions\quests\lions_rock\lions_rock.lua

local lionsRockSanctuaryRockId = 3608

local rewards = {
	'emerald bangle',
	'giant shimmering pearl',
	'gold ingot',
	'green gem',
	'red gem',
	"lion's heart",
	'yellow gem'
}

local UniqueTable = {
	[40004] = {
		storage = Storage.LionsRock.LionsStrength,
		itemPosition = {x = 33134, y = 32289, z = 8},
		item = 10551,
		storage = Storage.LionsRock.Questline,
		value = 1,
		newValue = 2,
		message = "You have sacrificed a cobra tongue at an ancient statue. The light in the small \z
		pyramid nearby begins to shine.",
		effect = CONST_ME_BLOCKHIT
	},
	[40005] = {
		storage = Storage.LionsRock.LionsBeauty,
		itemPosition = {x = 33136, y = 32369, z = 8},
		item = 23760,
		storage = Storage.LionsRock.Questline,
		value = 2,
		newValue = 3,
		message = "You burnt a lion's mane flower. The light in the small pyramid nearby begins to shine.",
		effect = CONST_ME_REDSMOKE
	},
	[40006] = {
		storage = Storage.LionsRock.LionsTears,
		itemPosition = {x = 33156, y = 32279, z = 8},
		item = 23835,
		storage = Storage.LionsRock.Questline,
		value = 3,
		newValue = 4,
		message = "You have purified a sacret pedestal with holy water. You have now passed the last test\z
		to enter thge inner sanctum.",
		effect = CONST_ME_LOSEENERGY
	}
}

-- Lions rock skeleton
local lionsRockSkeleton = Action()

function lionsRockSkeleton.onUse(player, item, fromPosition, target, toPosition, isHotkey)
	local setting = CorpseUnique[item.uid]
	if not setting then
		return true
	end

	if player:getStorageValue(Storage.LionsRock.Questline) < 0 then
		player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have discovered a skeleton. It seems to hold an old parchment.')
		player:addItem(23784, 1):setAttribute(
			ITEM_ATTRIBUTE_TEXT,
			"\"Still it is hard to believe that I finally found the mystical rock formations near Darashia, \z
			known as Lion's Rock. According to ancient records there is a temple for an unknown, probably long \z
			forgotten deity, built in the tunnels deep below the rock centuries ago. This holy site was once guarded \z
			by mystical lions and they may still be down there. But yet I haven't succeeded in entering the inner \z
			sanctum. The entrance to the lower temple areas is protected by an old and powerful enchantment. I \z
			studied the inscriptions on the temple walls and thus learned that the key to the inner sanctum is the \z
			passing of three tests. The first test is the Lion's Strength. In order to honour the site's mystical \z
			cats of prey one has to hunt and slay a cobra. The cobra's tongue must be laid down at a stone statue as \z
			a sacrifice. The second test is the Lion's Beauty. One has to burn the petals of a lion's mane flower on \z
			a coal basin. In the sand at the rock's foot I saw some dried lion's mane petals. Maybe these flowers \z
			grow somewhere upwards. The third test is called the Lion's Tears. It seems one has to purify an \z
			ornamented stone pedestal with ...\" At this point the records end because the parchment is destroyed. \z
			It seems that is was torn by a big paw ..."
		)
		player:setStorageValue(Storage.LionsRock.Questline, 1)
		player:setStorageValue(Storage.TibiaTales.DefaultStart, 1)
		player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
	end
	return true
end

lionsRockSkeleton:uid(20002)
lionsRockSkeleton:register()

-- Lions rock sacrifices
local lionsRockSacrificesTest = Action()

function lionsRockSacrificesTest.onUse(player, item, fromPosition, target, toPosition, isHotkey)
	local setting = UniqueTable[target.uid]
	if not setting then
		return true
	end

	local function reset()
		local pagodaLit = Tile(setting.itemPosition):getItemById(3710)
		if pagodaLit then
			pagodaLit:transform(3709)
		end
	end

	if item.itemid == setting.item then
		if player:getStorageValue(setting.storage) == setting.value then
			if player:getStorageValue(setting.storage) < 0 then
				local pagoda = Tile(setting.itemPosition):getItemById(3709)
				if pagoda then
					pagoda:transform(3710)
					player:sendTextMessage(MESSAGE_EVENT_ADVANCE, setting.message)
					player:setStorageValue(setting.storage, 1)
					player:setStorageValue(setting.storage, setting.newValue)
					player:removeItem(setting.item, 1)
					toPosition:sendMagicEffect(setting.effect)
					addEvent(reset, 15 * 1000)
				end
			end
		end
	end
	return true
end

lionsRockSacrificesTest:id(10551)
lionsRockSacrificesTest:id(23760)
lionsRockSacrificesTest:id(23835)
lionsRockSacrificesTest:register()

-- Get lions mane
local lionsGetLionsMane = Action()

function lionsGetLionsMane.onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if item.itemid == 23759 then
		if player:getStorageValue(Storage.LionsRock.Questline) > 0 then
			if player:getStorageValue(Storage.LionsRock.GetLionsMane) < 0 then
				player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You picked a beautiful lion's mane flower.")
				player:addItem(23760, 1)
				player:setStorageValue(Storage.LionsRock.GetLionsMane, 1)
			end
		end
	end
	return true
end

lionsGetLionsMane:id(23759)
lionsGetLionsMane:register()

-- Get holy water
local lionsGetHolyWater = Action()

function lionsGetHolyWater.onUse(player, item, fromPosition, target, toPosition, isHotkey)
	local setting = ItemUnique[item.uid]
	if not setting then
		return true
	end

	if player:getStorageValue(Storage.LionsRock.Questline) > 0 then
		if player:getStorageValue(Storage.LionsRock.GetHolyWater) < 0 then
			player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You took some holy water from the sacred well.')
			player:addItem(23835, 1)
			player:setStorageValue(Storage.LionsRock.GetHolyWater, 1)
		end
	end
	return true
end

lionsGetHolyWater:uid(40007)
lionsGetHolyWater:register()

-- Rock translation scroll
local lionsRockTranslationScroll = Action()

function lionsRockTranslationScroll.onUse(player, item, fromPosition, target, toPosition, isHotkey)
	local setting = UniqueTable[item.uid]
	if not setting then
		return true
	end

	local amphoraPos = Position(33119, 32247, 9)
	local amphoraID = 24314
	local amphoraBrokenID = 24315

	local function reset()
		local brokenAmphora = Tile(amphoraPos):getItemById(amphoraBrokenID)
		if brokenAmphora then
			brokenAmphora:transform(amphoraID)
		end
	end

	if player:getStorageValue(Storage.LionsRock.Questline) == 4 then
		local amphora = Tile(amphoraPos):getItemById(amphoraID)
		if amphora then
			amphora:transform(amphoraBrokenID)
			player:sendTextMessage(
				MESSAGE_EVENT_ADVANCE,
				'As you pass incautiously, the ancient amphora crumbles to shards and dust. \z
				Amidst the debris you discover an old scroll.'
			)
			player:setStorageValue(Storage.LionsRock.Questline, 5)
			player:addItem(23836, 1)
			toPosition:sendMagicEffect(CONST_ME_GROUNDSHAKER)
			addEvent(reset, 15 * 1000)
		end
	end
	return true
end

lionsRockTranslationScroll:id(40008)
lionsRockTranslationScroll:register()

-- Lions rock fountain
local lionsRockFountain = Action()

function lionsRockFountain.onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if player:getStorageValue(Storage.LionsRock.Time) < os.time() then
		local reward = ''
		if (player:hasMount(40)) then
			repeat
				reward = math.random(1, #rewards)
			until (rewards[reward] ~= "lion's heart")
		else
			reward = math.random(1, #rewards)
		end

		if (player:getStorageValue(Storage.LionsRock.Questline) == 10) then
			player:setStorageValue(Storage.LionsRock.Questline, 11)
		end

		player:sendTextMessage(MESSAGE_EVENT_ADVANCE,
			"Something sparkles in the fountain's water. You draw out a " .. rewards[reward] .. '.')
		toPosition:sendMagicEffect(CONST_ME_HOLYAREA)
		player:addAchievement("Lion's Den Explorer")
		item:transform(lionsRockSanctuaryRockId)
		player:addItem(rewards[reward], 1)
		player:setStorageValue(Storage.LionsRock.Time, os.time() + 24 * 60 * 60)
	else
		player:sendTextMessage(MESSAGE_EVENT_ADVANCE,
		'At the moment there is neither a treasure nor anything else in the fountain. Perhaps you might return later.')
	end
	return true
end

lionsRockFountain:id(6390)
lionsRockFountain:register()

 

 

data\scripts\movements\quests\lions_rock\lions_rock.lua

local UniqueTable = {
	[25001] = {
		storage = Storage.LionsRock.SnakeSign,
		needStorage = Storage.LionsRock.Questline,
		value = 5,
		item = 23836,
		message1 = "With the aid of the old scroll you translate the inscriptions on the floor: \z
		And the mighty lion defeated the jealous snake.",
		message2 = "As a sign of victory he tooks its eye, yellow as envy and malevolence, and out \z
		of a foul creature created a precious treasure."
	},
	[25002] = {
		storage = Storage.LionsRock.LizardSign,
		needStorage = Storage.LionsRock.Questline,
		value = 5,
		item = 23836,
		message1 = "With the aid of the old scroll you translate the inscriptions on the floor: \z
		And the mighty lion defeated the lazy lizard.",
		message2 = "As a sign of victory he tooks its egg, blue as sloth and conceit, and out \z
		of a foul creature created a precious treasure."
	},
	[25003] = {
		storage = Storage.LionsRock.ScorpionSign,
		needStorage = Storage.LionsRock.Questline,
		value = 5,
		item = 23836,
		message1 = "With the aid of the old scroll you translate the inscriptions on the golden altar: \z
		And the mighty lion defeated the treacherous scorpion.",
		message2 = "As a sign of victory he tooks its poison, violet as deceit and betrayal, and \z
		created a precious treasure."
	},
	[25004] = {
		storage = Storage.LionsRock.HyenaSign,
		needStorage = Storage.LionsRock.Questline,
		value = 5,
		item = 23836,
		message1 = "With the aid of the old scroll you translate the inscriptions on the golden statue: \z
		And the mighty lion defeated the greedy hyaena.",
		message2 = "As a sign of victory he tooks its blood, red as voracity and lust, and \z
		created a precious treasure."
	}
}

-- Lions rock entrance
local lionsRockEntrance = MoveEvent()

function lionsRockEntrance.onStepIn(creature, item, position, fromPosition)
	local player = creature:getPlayer()
	if not player then
		return true
	end

	if player:getStorageValue(Storage.LionsRock.Questline) >= 4 then
		player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
		player:teleportTo({x = 33122, y = 32308, z = 8})
		player:sendTextMessage(MESSAGE_EVENT_ADVANCE,
					"You have passed the Lion's Tests and are now worthy to enter the inner sanctum!")
		player:getPosition():sendMagicEffect(CONST_ME_THUNDER)
	else
		player:getPosition():sendMagicEffect(CONST_ME_ENERGYHIT)
		player:teleportTo(fromPosition, true)
		player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to pass the Lion's Tests to enter the inner sanctum!")
	end
	return true
end

lionsRockEntrance:uid(35009)
lionsRockEntrance:register()

-- Lions rock sign
local lionsRockSigns = MoveEvent()

function lionsRockSigns.onStepIn(creature, item, position, fromPosition)
	local player = creature:getPlayer()
	if not player then
		return
	end

	local setting = UniqueTable[item.uid]
	if not setting then
		return true
	end

	if player:getStorageValue(setting.needStorage) >= setting.value
					and player:getStorageValue(setting.needStorage) < 10 then
		if player:getStorageValue(setting.storage) < 0 then
			if player:getItemCount(setting.item) == 1 then
				player:sendTextMessage(MESSAGE_EVENT_ADVANCE, setting.message1)
				player:sendTextMessage(MESSAGE_EVENT_ADVANCE, setting.message2)
				player:setStorageValue(setting.needStorage, player:getStorageValue(setting.needStorage) + 1)
				player:setStorageValue(setting.storage, 1)
			end
		end
	end
	return true
end

for index, value in pairs(UniqueTable) do
	lionsRockSigns:uid(index)
end

lionsRockSigns:register()

 

Link para o post
Compartilhar em outros sites

Sobre o portal, você precisa destinar a posição usando o remeres map editorimage.thumb.png.ebf463352718f62c4d28717c0f8a8b95.png

Sobre os itens não terem use, provavelmente seja a opção desmarcada no items.otb do seu servidor, nada muito grave, usando o Item Editor você resolve

Link para o post
Compartilhar em outros sites
35 minutos atrás, FlameArcixt disse:

Sobre o portal, você precisa destinar a posição usando o remeres map editorimage.thumb.png.ebf463352718f62c4d28717c0f8a8b95.png

Sobre os itens não terem use, provavelmente seja a opção desmarcada no items.otb do seu servidor, nada muito grave, usando o Item Editor você resolve

 

O portal sim pode ser alterado pelo remeres, vou testar. Mas acho que fazendo isso ele ficará aberto para players que não fizeram os 3 testes que precisam para liberar o acesso. Vou testar não custa nada

 

Sobre os items, eu não consigo abrir. tem alguma dica?

Link para o post
Compartilhar em outros sites
40 minutos atrás, douglaseps disse:

 

O portal sim pode ser alterado pelo remeres, vou testar. Mas acho que fazendo isso ele ficará aberto para players que não fizeram os 3 testes que precisam para liberar o acesso. Vou testar não custa nada

 

Sobre os items, eu não posso te enviar um topico sobre pois os que eu achei sao de outro forum.. me desculpe

Eu nunca fiz essa quest nem sei como é, mas se precisa checar o que foi feito vai precisar de um script proprio pro tp, ja o item da uma olhada nesse 

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo