Skip to content

Commit

Permalink
Lions Rock Quest - minor tweaks to finish
Browse files Browse the repository at this point in the history
  • Loading branch information
htc16 committed Sep 12, 2024
1 parent eed0054 commit e35d65d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions data-otservbr-global/scripts/actions/other/gems.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ local lionsRock = {
itemId = 21442,
itemPos = { x = 33069, y = 32302, z = 9 },
storage = Storage.Quest.U10_70.LionsRock.Questline,
value = 6,
value = 7,
item = 3029,
fieldId = 21463,
message = "You place the sapphire on the small socket. A blue flame begins to burn.",
Expand All @@ -57,7 +57,7 @@ local lionsRock = {
itemId = 21440,
itemPos = { x = 33077, y = 32302, z = 9 },
storage = Storage.Quest.U10_70.LionsRock.Questline,
value = 6,
value = 8,
item = 3033,
fieldId = 7465,
message = "You place the amethyst on the small socket. A violet flame begins to burn.",
Expand All @@ -67,7 +67,7 @@ local lionsRock = {
itemId = 21437,
itemPos = { x = 33077, y = 32298, z = 9 },
storage = Storage.Quest.U10_70.LionsRock.Questline,
value = 6,
value = 9,
item = 9057,
fieldId = 21465,
message = "You place the topaz on the small socket. A yellow flame begins to burn.",
Expand Down Expand Up @@ -142,7 +142,7 @@ function gems.onUse(player, item, fromPosition, target, toPosition, isHotkey)
stone:transform(lionsRockSanctuaryFountainId)
lionsRockSanctuaryPos:sendMagicEffect(CONST_ME_THUNDER)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Something happens at the center of the room ...")
player:setStorageValue(storage, 7)
player:setStorageValue(storage, 10)
return true
end
end
Expand All @@ -159,19 +159,22 @@ function gems.onUse(player, item, fromPosition, target, toPosition, isHotkey)
end
end

if player:getStorageValue(setting.storage) >= setting.value then
if player:getStorageValue(setting.storage) == setting.value then
if setting.item == item.itemid then
local gemSpot = Tile(setting.itemPos):getItemById(setting.fieldId)
if not gemSpot then
toPosition:sendMagicEffect(setting.effect)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, setting.message)
item:remove(1)
-- Incrementa a storage para o próximo valor
player:setStorageValue(setting.storage, setting.value + 1)
addEvent(lionsRockCreateField, 2 * 1000, setting.itemPos, setting.fieldId, setting.storage)
addEvent(lionsRockFieldReset, 60 * 1000)
return true
end
end
end

return false
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function lionsRockFountain.onUse(player, item, fromPosition, target, toPosition,
item:transform(lionsRockSanctuaryRockId)
player:addItem(rewards[reward], 1)
player:setStorageValue(Storage.Quest.U10_70.LionsRock.Time, os.time() + 24 * 60 * 60)
player:setStorageValue(Storage.Quest.U10_70.LionsRock.Questline, 8)
player:setStorageValue(Storage.Quest.U10_70.LionsRock.Questline, 11)
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
Expand Down

0 comments on commit e35d65d

Please sign in to comment.