Skip to content

Commit

Permalink
All grimoires not just the id of terrys
Browse files Browse the repository at this point in the history
  • Loading branch information
brightrim committed Feb 23, 2025
1 parent b21585b commit 6d1913e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion magic/arcane/arcaneMagicDesk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ local function quillIsInHand(user)
return true
end

local function bookFound(user)

for _, book in pairs(grimoireCreation.books) do
if user:countItemAt("body",2619,{["magicBook"]="true"}) ~= 0 then
return true
end
end

return false
end

function M.mainDialog(user, sourceItem)

if not quillIsInHand(user) then
Expand All @@ -61,7 +72,7 @@ function M.mainDialog(user, sourceItem)

if createSpell.checkForDialogOptions2(user) then

if user:countItemAt("body",2619,{["magicBook"]="true"}) ~= 0 and user:countItemAt("body",463) ~= 0 then
if bookFound(user) and user:countItemAt("body",463) ~= 0 then
createSpell.slotSelection(user)
else
user:inform("Du musst ein magisches Buch und eine Schreibfeder in deinen Händen halten.", "You must hold a magic book and quill in your hands.")
Expand Down
4 changes: 2 additions & 2 deletions magic/arcane/grimoireCreation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ local magic = require("base.magic")

local M = {}

local books = {105,106,129,2609,2610,114,115,2608,2615,107,108,111,112,2605,2617,109,110,117,128,130,2604,131,2602,2620,116,2621,2607,127,2598,2606,2616,2619}
M.books = {105,106,129,2609,2610,114,115,2608,2615,107,108,111,112,2605,2617,109,110,117,128,130,2604,131,2602,2620,116,2621,2607,127,2598,2606,2616,2619}

function M.enchantGrimoire(user)
local leftItem = user:getItemAt(5)
local rightItem = user:getItemAt(6)
local theBook = false

for _, id in pairs(books) do
for _, id in pairs(M.books) do
if id == rightItem.id then
theBook = rightItem
elseif id == leftItem.id then
Expand Down

0 comments on commit 6d1913e

Please sign in to comment.