Skip to content

Commit

Permalink
Update movements_sacrifice_teleport.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
htc16 committed Sep 3, 2024
1 parent 9fc12c4 commit 5114a9f
Showing 1 changed file with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
local teleportDestinations = {
[4541] = {position = Position(33017, 32419, 11), storageKey = Storage.Quest.U10_10.TheGravediggerOfDrefia.Mission74},
[4542] = {position = Position(33018, 32425, 11), storageKey = Storage.Quest.U10_10.TheGravediggerOfDrefia.Mission75}
}

local sacrificeTeleport = MoveEvent()

function sacrificeTeleport.onStepIn(creature, item, position, fromPosition)
Expand All @@ -6,17 +11,19 @@ function sacrificeTeleport.onStepIn(creature, item, position, fromPosition)
return true
end

if item.actionid == 4541 and player:getStorageValue(Storage.Quest.U10_10.TheGravediggerOfDrefia.Mission74) == 1 then
player:teleportTo(Position(33017, 32419, 11))
local destination = teleportDestinations[item.actionid]
if destination and player:getStorageValue(destination.storageKey) == 1 then
player:teleportTo(destination.position)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end

if item.actionid == 4542 and player:getStorageValue(Storage.Quest.U10_10.TheGravediggerOfDrefia.Mission75) == 1 then
player:teleportTo(Position(33018, 32425, 11))
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end
return true
end

sacrificeTeleport:type("stepin")
sacrificeTeleport:aid(4541, 4542)
sacrificeTeleport:register()

for actionId in pairs(teleportDestinations) do
sacrificeTeleport:aid(actionId)
end

sacrificeTeleport:register()

0 comments on commit 5114a9f

Please sign in to comment.