Skip to content

Commit edcfd6a

Browse files
feat: Playable Bookworld (zimbadev#575)
* Feat: Playable Bookworld This PR just add the teleporter in the bookworld to make it playable. Just to add the book ID at Edron same as in real Tibia and it will work. - If anyone has progress in this quest, please share with us! The command to check effects for Gods is also updated in this PR. * Lua code format - (Stylua) --------- Co-authored-by: GitHub Actions <github-actions[bot]@users.noreply.github.com>
1 parent ea28029 commit edcfd6a

2 files changed

Lines changed: 55 additions & 2 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
local teleport = Action()
2+
3+
function teleport.onUse(player, item, fromPosition, target, toPosition, isHotkey)
4+
local itemId = item:getId()
5+
local itemPos = item:getPosition()
6+
7+
if itemId == 50978 and itemPos == Position(33185, 31794, 7) then
8+
local targetPosition = Position(32520, 32514, 8) -- chapter I
9+
player:teleportTo(targetPosition)
10+
player:getPosition():sendMagicEffect(CONST_ME_OPEN_BOOKMACHINE)
11+
itemPos:sendMagicEffect(CONST_ME_OPEN_BOOKSPELL)
12+
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are drawn into the pages of the book.")
13+
return true
14+
elseif itemId == 51528 and itemPos == Position(32522, 32512, 8) then
15+
local targetPosition = Position(33185, 31795, 7) -- front of edron book
16+
player:teleportTo(targetPosition)
17+
player:getPosition():sendMagicEffect(CONST_ME_OPEN_BOOKMACHINE)
18+
itemPos:sendMagicEffect(CONST_ME_OPEN_BOOKSPELL)
19+
return true
20+
elseif itemId == 51624 and itemPos == Position(32526, 32512, 8) then
21+
local targetPosition = Position(32526, 32513, 9) -- chapter II
22+
player:teleportTo(targetPosition)
23+
player:getPosition():sendMagicEffect(CONST_ME_OPEN_BOOKMACHINE)
24+
itemPos:sendMagicEffect(CONST_ME_OPEN_BOOKSPELL)
25+
return true
26+
elseif itemId == 51625 and itemPos == Position(32536, 32512, 8) then
27+
local targetPosition = Position(32526, 32513, 9) -- chapter III
28+
player:teleportTo(targetPosition)
29+
player:getPosition():sendMagicEffect(CONST_ME_OPEN_BOOKMACHINE)
30+
itemPos:sendMagicEffect(CONST_ME_OPEN_BOOKSPELL)
31+
return true
32+
elseif itemId == 51626 and itemPos == Position(32540, 32512, 8) then
33+
local targetPosition = Position(32585, 32558, 11) -- chapter IV
34+
player:teleportTo(targetPosition)
35+
player:getPosition():sendMagicEffect(CONST_ME_OPEN_BOOKMACHINE)
36+
itemPos:sendMagicEffect(CONST_ME_OPEN_BOOKSPELL)
37+
return true
38+
elseif itemId == 51756 then
39+
local targetPosition = Position(32520, 32514, 8) -- chapter I
40+
41+
if itemPos == Position(32526, 32512, 9) or itemPos == Position(32552, 32594, 10) or itemPos == Position(32585, 32557, 11) then
42+
player:teleportTo(targetPosition)
43+
player:getPosition():sendMagicEffect(CONST_ME_OPEN_BOOKMACHINE)
44+
itemPos:sendMagicEffect(CONST_ME_OPEN_BOOKSPELL)
45+
return true
46+
end
47+
end
48+
49+
return false
50+
end
51+
52+
teleport:id(50978, 51528, 51624, 51625, 51626, 51756)
53+
teleport:register()

data/scripts/talkactions/god/effect.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ function talkaction.onSay(player, words, param)
88
return true
99
end
1010

11-
if effectId < 0 or effectId > 252 then
12-
player:sendCancelMessage("Effect ID must be between 0 and 252.")
11+
if effectId < 0 or effectId > 303 then
12+
player:sendCancelMessage("Effect ID must be between 0 and 303.")
1313
return true
1414
end
1515

0 commit comments

Comments
 (0)