[TFS 1.3] Using this Distro but with an updated map for 10.98
This script came with the Distro I downloaded and I am trying to make it work like Retail since it was a bit choppy and missing parts originally.
Im been out of the OT Game for quite some time so alot of the coding is new to me but ive been chipping away at this script for some time now trying to fix it.
Some parts of the script are giving me a bit of trouble and would like some insight on how to fix my issues.
This became quite the long post. But I wanted to make sure it was as detailed and explained as possible. Sorry for the long read.
If anything is unclear (hopefully not) just ask and I will try and do a better job explaining.
Lion's Rock Quest on Retail
Quick Rundown of Quest
There is alot of comments in the script ive added for myself and also for how the script is supposed to be when working as intended.
Here are the Action+Movement.xml lines
Action part of the script
Movement Part
Lib part
This script came with the Distro I downloaded and I am trying to make it work like Retail since it was a bit choppy and missing parts originally.
Im been out of the OT Game for quite some time so alot of the coding is new to me but ive been chipping away at this script for some time now trying to fix it.
Some parts of the script are giving me a bit of trouble and would like some insight on how to fix my issues.
This became quite the long post. But I wanted to make sure it was as detailed and explained as possible. Sorry for the long read.
If anything is unclear (hopefully not) just ask and I will try and do a better job explaining.
Lion's Rock Quest on Retail
Quick Rundown of Quest
Pickup Flower - WorksPickup Water - WorksLoot Dead Explorer for "Old Parchment (Brown)" - Script triggers, But does not contain text inside the scroll. (Is this named "Lion's Rock Three Tests (Book)" on Retail?)- Use Flower>Basin - Works. Missing part to change Pyramid into Lit up Pyramid > change back after some time?
- Use Water>Pedestal - Works. ^
- Use Cobra>Statue - Works. ^
Enter Inner Sanctum after all 3 Tasks completed - Works- Exit Inner Sanctum - Missing, not gotten to that yet. I could just use a simple teleport script for this, since you need to do quest steps to even get in.
- Break Amphora - Works. Missing part to change Amphora into broken version > Should respawn after some time also?
Translate Scroll 4 different steps - Works- Place Gems to Spawn Fountain and Use for Reward - Works. Fountain should transform back into Rubble after you have gotten reward. Also missing spawning of Fires when placing Gems, Fires should also decay after a bit.
- You then get 1 random piece of treasure from a list of 6 items. If you have the Noble Lion mount you are unable to get the Lion's Heart.
- Possible to do the reward once every 24h - Untested at the moment if this works.
There is alot of comments in the script ive added for myself and also for how the script is supposed to be when working as intended.
Here are the Action+Movement.xml lines
XML:
<!-- Lions Rock Quest -->
<action itemid="23760" script="quests/lions rock/lionRock.lua" /> <!--Flower-->
<action itemid="23835" script="quests/lions rock/lionRock.lua" /> <!--Water-->
<action itemid="10551" script="quests/lions rock/lionRock.lua" /> <!--Cobra-->
<action fromaid="41354" toaid="41357" script="quests/lions rock/lionRock.lua" /> <!--UsingItems-->
<!-- Lions Rock Quest -->
<movevent event="StepIn" fromaid="41344" toaid="41349" script="others/quests/lionRock.lua" />
Action part of the script
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local itemEx = target
-- Flower
if item.actionid == 41354 then
if player:getStorageValue(lionrock.storages.getFlower) < 1 then
player:addItem(lionrock.items.flower)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You picked a beautiful lion's mane.")
player:setStorageValue(lionrock.storages.getFlower, 1)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
end
return true
end
-- Holy Water
if item.actionid == 41355 then
if player:getStorageValue(lionrock.storages.getHolyWater) < 1 then -- Getting Holy Water
player:addItem(lionrock.items.holywater, 1)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You took some holy water from the sacred well.")
player:setStorageValue(lionrock.storages.getHolyWater, 1)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
end
end
-- Loot Dead Explorer
if item.actionid == 41356 then
if player:getStorageValue(lionrock.storages.skeleton) < 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found an old parchment.")
local book = player:addItem(lionrock.items.parchment)
book:setAttribute(ITEM_ATTRIBUTE_TEXT, "Still it is hard to believe that I finally found the mystical rock formations near Darashia, known as Lion's Rock. According to ancient records there is a temple for an unknown, probably long forgotten deity, built in the tunnels deep below the rock centuries ago. This holy site was once guarded by mystical lions and they may still be down there. But yet I haven't succeeded in entering the inner sanctum. The entrance to the lower temple areas is protected by an old and powerful enchantment. I studied the inscriptions on the temple walls and thus learned that the key to the inner sanctum is the passing of three tests. The first test is the Lion's Strength. In order to honour the site's mystical cats of prey one has to hunt and slay a cobra. The cobra's tongue must be laid down at a stone statue as a sacrifice. The second test is the Lion's Beauty. One has to burn the petals of a lion's mane flower on a coal basin. In the sand at the rock's foot I saw some dried lion's mane petals. Maybe these flowers grow somewhere upwards. The third test is called the Lion's Tears. It seems one has to purify an ornamented stone pedestal with ... At this point the records end because the parchment is destroyed. It seems that is was torn by a big paw...")
player:setStorageValue(lionrock.storages.skeleton, 1)
end
end
-- Using Flower with Basin
if item:getId() == lionrock.items.flower and itemEx.actionid == 41340 then
if player:getStorageValue(lionrock.storages.usedFlower) < 1 then
player:removeItem(lionrock.items.flower, 1)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You burnt a lion's mane flower. The light in the small pyramid nearby begins to shine.")
player:setStorageValue(lionrock.storages.usedFlower, 1)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
--Change Pyramid into Light version 33136, 32369, 8 -3709>3710
end
return true
end
-- Using Holy Water with Pedestal
if item:getId() == lionrock.items.holywater and itemEx.actionid == 41343 then
if player:getStorageValue(lionrock.storages.usedHolyWater) < 1 then
player:removeItem(lionrock.items.holywater, 1)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have purified a sacred pedestal with holy water. You have now passed the last test to enter the inner sanctum.")
player:setStorageValue(lionrock.storages.usedHolyWater, 1)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
--Change Pyramid into Light version 33156, 32279, 8 -3709>3710
end
return true
end
-- Using Tongue with Statue
if item:getId() == lionrock.items.tongue and itemEx.actionid == 41341 then
if player:getStorageValue(lionrock.storages.usedTongue) < 1 then
player:removeItem(lionrock.items.tongue, 1)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have sacrificed a cobra tongue at an ancient statue. The light in the small pyramid nearby begins to shine.")
player:setStorageValue(lionrock.storages.usedTongue, 1)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
--Change Pyramid into Light version 33135, 32289, 8 -3709>3710
end
return true
end
-- Reward script
if item.actionid == 41357 then
if player:getStorageValue(lionrock.storages.playerCanDoTasks) - os.time() > 0 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Come back after the server save.")
return false
end
if player:getStorageValue(lionrock.storages.translation1) < 1 or player:getStorageValue(lionrock.storages.translation2) < 1 or player:getStorageValue(lionrock.storages.translation3) < 1 or player:getStorageValue(lionrock.storages.translation4) < 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "At the moment there is neither a treasure nor anything else in the fountain. Perhaps you might return later.")
return false
end
-- Player reward
player:setStorageValue(lionrock.storages.playerCanDoTasks, os.time() + 1 * 24 * 60 * 60 )
local reward = lionrock.rewards[math.random(#lionrock.rewards)]
player:addItem(reward.id, 1)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Something sparkles in the fountain's water. You draw out a beautiful and certainly precious amulet.")
--player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Something sparkles in the fountain's water. You draw out a '.. ItemType(rewards[random].item):getName() ..'.') --Added to make the script say what item you have obtained. If its the Lions Heart it should say 'You draw out a beautiful and certainly precious amulet.' if not it should just say "You draw out a ITEM"
-- Reseting tasks
lionrock.taskactive.ruby = false
lionrock.taskactive.sapphire = false
lionrock.taskactive.amethyst = false
lionrock.taskactive.topaz = false
-- Ruby
local redflamePosition = Position(33069, 32298, 9)
local redItem = Tile(redflamePosition):getItemById(1488) --Does this create a field?
if redItem then
redItem:remove()
--Game.createItem(1488, 1, redflamePosition) Create fields like this?
end
-- Amethyst
local yellowflamePosition = Position(33077, 32302, 9)
local yellowItem = Tile(yellowflamePosition):getItemById(1500)
if yellowItem then
yellowItem:remove()
end
-- Topaz
local purpleflamePosition = Position(33077, 32298, 9)
local purpleItem = Tile(purpleflamePosition):getItemById(7473)
if purpleItem then
purpleItem:remove()
end
-- Sapphire
local violetflamePosition = Position(33069, 32302, 9)
local violetflamePosition = Tile(violetflamePosition):getItemById(8058)
if violetflamePosition then
violetflamePosition:remove()
end
-- Removing Fountain
local Item = Tile(position(33073, 32300, 9)):getItemById(6390)
if Item then
Item:remove()
-- Stone back;
Game.createItem(3608, 1, { x=33073, y=32300, z=9})
end
end
end
Movement Part
Lua:
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if player == nil then
return true
end
if not lionrock.checkPlayerCanEnterMysticFlame(player) then
if item.actionid == 41344 then
player:teleportTo(fromPosition, true)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "CANT PASS YET MESSAGE (If there is any).")
end
return false
end
-- Mystic Flame
if item.actionid == 41344 then
if player:getStorageValue(lionrock.storages.firstMysticEnter) < 1 then
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_MAGIC_GREEN)
player:setStorageValue(lionrock.storages.firstMysticEnter, 1)
end
-- Teleport to Inner Sanctum
player:teleportTo({x = 33122, y = 32308, z = 8})
return true
end
-- Large Amphora
if item.actionid == 41345 then
if player:getStorageValue(lionrock.storages.getScroll) < 1 and player:getStorageValue(lionrock.storages.skeleton) > 1 then
player:addItem(lionrock.items.scroll)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "As you pass incautiously, the ancient amphora crumbles to shards and dust. Amidst the debris you discover an old scroll.")
player:setStorageValue(lionrock.storages.getScroll, 1)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
-- Destroy amphora and remake after couple of minutes script
end
end
-- Translations
if item.actionid == 41346 then -- 1
if player:getStorageValue(lionrock.storages.translation1) < 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE,
"With the aid of the old scroll you translate the inscriptions on the golden statue: And the mighty lion defeated the greedy hyaena." ..
"As a sign of victory he took its blood, red as voracity and lust, and created a precious treasure.")
player:setStorageValue(lionrock.storages.translation1, 1)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
end
end
if item.actionid == 41347 then -- 2
if player:getStorageValue(lionrock.storages.translation2) < 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE,
"With the aid of the old scroll you translate the inscriptions on the floor: And the mighty lion defeated the lazy lizard." ..
"As a sign of victory he took its egg, blue as sloth and conceit, and out of a foul creature he created a precious treasure.")
player:setStorageValue(lionrock.storages.translation2, 1)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
end
end
if item.actionid == 41348 then -- 3
if player:getStorageValue(lionrock.storages.translation3) < 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE,
"With the aid of the old scroll you translate the inscriptions on the floor: And the mighty lion defeated the jealous snake." ..
"As a sign of victory he took its eye, yellow as envy and malevolence, and out of a foul creature he created a precious treasure.")
player:setStorageValue(lionrock.storages.translation3, 1)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
end
end
if item.actionid == 41349 then -- 4
if player:getStorageValue(lionrock.storages.translation4) < 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE,
"With the aid of the old scroll you translate the inscriptions on the golden altar: And the mighty lion defeated the treacherous." ..
"scorpion. As a sign of victory he took its poison, violet as deceit and betrayal, and created a precious treasure.")
player:setStorageValue(lionrock.storages.translation4, 1)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
end
end
return true
end
Lib part
Code:
lionrock = {
items = {
nflower = 23759,
flower = 23760,
holywater = 23835,
tongue = 10551,
parchment = 23784,
scroll = 25521,
ruby = 2147,
sapphire = 2146,
amethyst = 2150,
topaz = 9970,
rewardfountain = 6390,
redflame = 1488,
yellowflame = 1500,
blueflame = 8058,
violetflame = 7473
},
-- For information only..
actionIds = {
getFlower = 41354,
getWater = 41355,
getScroll = 41356
},
storages = {
skeleton = 50880,
getFlower = 50881,
usedFlower = 50882,
getHolyWater = 50883,
usedHolyWater = 50884,
usedTongue = 50885,
getScroll = 50886,
firstMysticEnter = 50887,
translation1 = 50888,
translation2 = 50889,
translation3 = 50890,
translation4 = 50891,
playerCanDoTasks = 50892
},
positions = {
ruby = { x = 33069, y = 32298, z = 9 },
sapphire = { x = 33069, y = 32302, z = 9 },
amethyst = { x = 33077, y = 32302, z = 9 },
topaz = { x = 33077, y = 32298, z = 9 }
},
-- Global Variaables used in all situations;
taskactive = {
ruby = false,
sapphire = false,
amethyst = false,
topaz = false
},
rewards = {
{ id = 23810}, -- Lion's heart
{ id = 9971}, -- Gold ingot
{ id = 2154}, -- Yellow gem
{ id = 2156}, -- Red gem
{ id = 2127}, -- Emerlad bangle
{ id = 7633} -- Giant shimmering pearl
},
checkPlayerCanEnterMysticFlame = function(player)
if player:getStorageValue(lionrock.storages.usedFlower) < 1
or player:getStorageValue(lionrock.storages.usedHolyWater) < 1
or player:getStorageValue(lionrock.storages.usedTongue) < 1 then
return false
end
return true
end,
checkPlayerDoneQuest = function(player)
if lionrock.checkPlayerCanEnterMysticFlame(player) ~= true then
return false
end
if player:getStorageValue(lionrock.storages.translation1) < 1
or player:getStorageValue(lionrock.storages.translation2) < 1
or player:getStorageValue(lionrock.storages.translation3) < 1
or player:getStorageValue(lionrock.storages.translation4) < 1 then
return false
end
return true
end
}
Last edited: