9
3

fgepicaccessbookcase.lua 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --[[
  2. Script Name : SpawnScripts/FallenGate/fgepicaccessbookcase.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.09 09:07:48
  5. Script Purpose : bookcase that gives an item "Ilucide's battered journal"
  6. :
  7. --]]
  8. local IlucidesBatteredJournal = 8259
  9. local SearchTheDepthsOfFallenGate = 5307
  10. function spawn(NPC)
  11. end
  12. function respawn(NPC)
  13. spawn(NPC)
  14. end
  15. function casted_on(NPC, Spawn, SpellName)
  16. if SpellName == 'Search the Books' then
  17. if not HasItem(Spawn, IlucidesBatteredJournal) then
  18. SummonItem(Spawn, IlucidesBatteredJournal, 1)
  19. SendMessage(Spawn, "You find an old battered journal.")
  20. SendPopUpMessage(Spawn, "You receive Ilucide's battered journal", 255, 255, 255)
  21. elseif HasItem(Player, IlucidesBatteredJournal) and not HasQuest(Spawn, SearchTheDepthsOfFallenGate) then
  22. SendMessage(Spawn, "You have already found the spell you needed.", 20)
  23. elseif HasQuest(Spawn, SearchTheDepthsOfFallenGate) and not QuestStepIsComplete(Spawn, SearchTheDepthsOfFallenGate, 3) then
  24. SetStepComplete(Spawn, SearchTheDepthsOfFallenGate, 3)
  25. SendMessage(Spawn, "You search through the books on the bookcase and quickly discern the book with the spell you need!")
  26. elseif QuestStepIsComplete(Spawn, SearchTheDepthsOfFallenGate, 3) then
  27. SetAccessToEntityCommand(Spawn,NPC,"Leave the supplies", 0)
  28. SpawnSet(NPC, "show_command_icon", 0)
  29. SpawnSet(NPC, "display_hand_icon", 0)
  30. end
  31. end
  32. end