Skip to content

Commit

Permalink
Fixed time_machine and added others usages.
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel committed Dec 28, 2023
1 parent f68972d commit 3743a63
Showing 1 changed file with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
local forgottenKnowledgeMachine = Action()
function forgottenKnowledgeMachine.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local timeMachine = Action()
function timeMachine.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getPosition() == Position(32870, 32723, 15) then
player:teleportTo(Position(32870, 32724, 14))
player:getPosition():sendMagicEffect(CONST_ME_ENERGYHIT)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The mechanism takes you back in time.")
return true
end

if player:getPosition() == Position(32870, 32723, 14) then
elseif player:getPosition() == Position(32870, 32723, 14) then
if player:canFightBoss("The Time Guardian") then
player:teleportTo(Position(32870, 32724, 15))
player:getPosition():sendMagicEffect(CONST_ME_ENERGYHIT)
Expand All @@ -17,10 +15,22 @@ function forgottenKnowledgeMachine.onUse(player, item, fromPosition, target, toP
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to wait a while before travel in time!")
return true
end
else
return false
end

if player:getPosition() == Position(33453, 31029, 8) then
player:teleportTo(Position(32430, 32167, 8))
player:getPosition():sendMagicEffect(CONST_ME_ENERGYHIT)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The mechanism takes you back in time.")
return true
elseif player:getPosition() == Position(32430, 32166, 8) then
player:teleportTo(Position(33453, 31030, 8))
player:getPosition():sendMagicEffect(CONST_ME_ENERGYHIT)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The mechanism takes you back in time.")
return true
end

return false
end

forgottenKnowledgeMachine:id(25096)
forgottenKnowledgeMachine:register()
timeMachine:id(25096)
timeMachine:register()

0 comments on commit 3743a63

Please sign in to comment.