9
3

IgnatiaCellusFamilyHistoryBook.lua 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. --[[
  2. Script Name : ItemScripts/IgnatiaCellusFamilyHistoryBook.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.05.30 03:05:08
  5. Script Purpose :
  6. :
  7. --]]
  8. local Quest = 5844
  9. function examined(Item, Player)
  10. conversation = CreateConversation()
  11. if not HasQuest(Player,Quest) and not HasCompletedQuest(Player,Quest) then
  12. AddConversationOption(conversation, "Read the intro","Intro")
  13. AddConversationOption(conversation, "Close the book.","CloseItemConversation")
  14. StartDialogConversation(conversation, 2, Item, Player, "I am trying to compile the Cellus' family stories into remembrances of what was and how it has changed over time. If you bought this volume and its covers were removed, know that the seller is probably keeping out the good bits for him or herself!")
  15. else
  16. Intro(Item,Player)
  17. end
  18. end
  19. function Intro(Item,Player)
  20. conversation = CreateConversation()
  21. AddConversationOption(conversation, "Entry One","Page1")
  22. if HasQuest(Player,Quest) then
  23. AddConversationOption(conversation, "Turn to last page","PageCheck")
  24. end
  25. AddConversationOption(conversation, "Close the book.","CloseItemConversation")
  26. StartDialogConversation(conversation, 2, Item, Player, "I am sure that some of my family's writings still exist elsewhere in Norrath. Unless they were destroyed in the Shattering or as mentioned before, held back by unscrupulous vendors. Whatever portion of this tome you have, cherish it and remember the Cellus family of Qeynos.")
  27. end
  28. function PageCheck(Item,Player)
  29. if GetQuestStep(Player,Quest) ==1 or GetQuestStep(Player,Quest) ==2 then
  30. Page1(Item, Player)
  31. elseif GetQuestStep(Player,Quest) ==3 or GetQuestStep(Player,Quest) == 4 then
  32. Page2(Item, Player)
  33. elseif GetQuestStep(Player,Quest) == 5 or GetQuestStep(Player,Quest) ==6 then
  34. Page3(Item, Player)
  35. elseif GetQuestStep(Player,Quest) ==7 or GetQuestStep(Player,Quest) ==8 then
  36. Page4(Item, Player)
  37. elseif GetQuestStep(Player,Quest) ==9 or GetQuestStep(Player,Quest) ==10 then
  38. Page5(Item, Player)
  39. elseif GetQuestStep(Player,Quest) ==11 or GetQuestStep(Player,Quest) ==12 then
  40. Page6(Item, Player)
  41. elseif GetQuestStep(Player,Quest) ==13 or GetQuestStep(Player,Quest) ==14 then
  42. Page7(Item, Player)
  43. elseif GetQuestStep(Player,Quest) ==15 or GetQuestStep(Player,Quest) ==16 then
  44. Page8(Item, Player)
  45. elseif GetQuestStep(Player,Quest) ==17 or GetQuestStep(Player,Quest) ==18 then
  46. Page9(Item, Player)
  47. end
  48. end
  49. function Page1(Item, Player)
  50. conversation = CreateConversation()
  51. if CanReceiveQuest(Player,Quest)then
  52. QuestStart(Item,Player)
  53. end
  54. if GetQuestStep(Player,Quest) >=2 then
  55. AddConversationOption(conversation, "Entry Two","Page2")
  56. end
  57. AddConversationOption(conversation, "Close the book.","CloseItemConversation")
  58. StartDialogConversation(conversation, 2, Item, Player, "My name is Ignatia Cellus and my story is nothing like my grandmother's Isabella Cellus' tale. She lived in a time of relative peace, while I am in a world besieged by terrors unimaginable. The undead rise up outside Qeynos and we all fear for our --")
  59. end
  60. function Page2(Item, Player)
  61. conversation = CreateConversation()
  62. if GetQuestStep(Player,Quest)==2 then
  63. SetStepComplete(Player,Quest,2)
  64. end
  65. if GetQuestStep(Player,Quest) >=4 then
  66. AddConversationOption(conversation, "Entry Three","Page3")
  67. end
  68. AddConversationOption(conversation, "Turn back to previous entry.","Page1")
  69. AddConversationOption(conversation, "Close the book.","CloseItemConversation")
  70. StartDialogConversation(conversation, 2, Item, Player, "-- lives. Thank the gods for Kane Bayle, commander of the Guard. His guidance will surely lead Qeynos through this dark time! He has ordered the Guard to watch every possible entry to Qeynos, which means longer shifts and journeys far from home. I am in the Guard and and fortunately, patrol --")
  71. end
  72. function Page3(Item, Player)
  73. conversation = CreateConversation()
  74. if GetQuestStep(Player,Quest)==4 then
  75. SetStepComplete(Player,Quest,4)
  76. end
  77. if GetQuestStep(Player,Quest) >=6 then
  78. AddConversationOption(conversation, "Entry Four","Page4")
  79. end
  80. AddConversationOption(conversation, "Turn back to previous entry.","Page2")
  81. AddConversationOption(conversation, "Close the book.","CloseItemConversation")
  82. StartDialogConversation(conversation, 2, Item, Player, "-- inside the catacombs near the Guild Halls. There is a strange odor in the air; it is the smell of death. The dead are piled high and cannot be buried, for there is no one to stand guard over the mourners and keep them safe. The undead appear --")
  83. end
  84. function Page4(Item, Player)
  85. conversation = CreateConversation()
  86. if GetQuestStep(Player,Quest)==6 then
  87. SetStepComplete(Player,Quest,6)
  88. end
  89. if GetQuestStep(Player,Quest) >=8 then
  90. AddConversationOption(conversation, "Entry Five","Page5")
  91. end
  92. AddConversationOption(conversation, "Turn back to previous entry.","Page3")
  93. AddConversationOption(conversation, "Close the book.","CloseItemConversation")
  94. StartDialogConversation(conversation, 2, Item, Player, "-- in waves that we cannot repel easily, as there are so many of them and so few of us. With the Guard trying to keep Qeynos' entrances safe, there are not enough to do other tasks. I do not remember the last time I slept at home. This is exhausting.")
  95. end
  96. function Page5(Item, Player)
  97. conversation = CreateConversation()
  98. if GetQuestStep(Player,Quest)==8 then
  99. SetStepComplete(Player,Quest,8)
  100. end
  101. if GetQuestStep(Player,Quest) >=10 then
  102. AddConversationOption(conversation, "Entry Six","Page6")
  103. end
  104. AddConversationOption(conversation, "Turn back to previous entry.","Page4")
  105. AddConversationOption(conversation, "Close the book.","CloseItemConversation")
  106. StartDialogConversation(conversation, 2, Item, Player, "Alas! Finally, I was able to return to my home in South Qeynos, only to find such sorrow. The block of homes on my street were filled with the dead. The patrol in that quadrant had not reported in a fortnight, so I was sent to check on them. My mother --")
  107. end
  108. function Page6(Item, Player)
  109. conversation = CreateConversation()
  110. if GetQuestStep(Player,Quest)==10 then
  111. SetStepComplete(Player,Quest,10)
  112. end
  113. if GetQuestStep(Player,Quest) >=12 then
  114. AddConversationOption(conversation, "Entry Seven","Page7")
  115. end
  116. AddConversationOption(conversation, "Turn back to previous entry.","Page5")
  117. AddConversationOption(conversation, "Close the book.","CloseItemConversation")
  118. StartDialogConversation(conversation, 2, Item, Player, "-- is one who died of this horrible plague that seems to rise from beneath us. Captain Keldrane has been sent to investigate the deepest areas of the Catacombs. Commander Bayle asked me personally to escort the unarmed to safety in Qeynos Hills. Some have said this will --")
  119. end
  120. function Page7(Item, Player)
  121. conversation = CreateConversation()
  122. if GetQuestStep(Player,Quest)==12 then
  123. SetStepComplete(Player,Quest,12)
  124. end
  125. if GetQuestStep(Player,Quest) >=14 then
  126. AddConversationOption(conversation, "Entry Eight","Page8")
  127. end
  128. AddConversationOption(conversation, "Turn back to previous entry.","Page6")
  129. AddConversationOption(conversation, "Close the book.","CloseItemConversation")
  130. StartDialogConversation(conversation, 2, Item, Player, "-- spread the Guard too thinly, but Commander Bayle doubtless knows more than the general populace. I trust his judgment. He would never betray Qeynos, never! Meanwhile, I am happy to leave the city; being here reminds me too much of --")
  131. end
  132. function Page8(Item, Player)
  133. conversation = CreateConversation()
  134. if GetQuestStep(Player,Quest)==14 then
  135. SetStepComplete(Player,Quest,14)
  136. end
  137. AddConversationOption(conversation, "Turn back to previous entry.","Page7")
  138. AddConversationOption(conversation, "Close the book.","CloseItemConversation")
  139. StartDialogConversation(conversation, 2, Item, Player, "-- the family and friends I have lost. I am accompanying a group of non-combatants out of the city to a secret place known only to my family until now. I hope we will be safe there. I did not tell the commander of this place, but I know our family's stronghold will not remain secret or hidden for long.")
  140. end
  141. function QuestStart(Item,Player)
  142. CloseItemConversation(Item,Player)
  143. OfferQuest(nil, Player, Quest)
  144. end