9
3

TheTrialsofSirMorgan.lua 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. --[[
  2. Script Name : ItemScripts/TheTrialsofSirMorgan.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.21 08:07:18
  5. Script Purpose :
  6. :
  7. --]]
  8. local TheTrialsOfSirMorgan = 5330
  9. function examined(Item, Player)
  10. conversation = CreateConversation()
  11. AddConversationOption(conversation, "Read the book.", "PAGE1")
  12. AddConversationOption(conversation, "Leave the book closed.", "CloseItemConversation")
  13. StartDialogConversation(conversation, 2, Item, Player, "This book is of an ornate Old Antonican design. A crest appears on the cover depicting images of a sword, a long mountain trail, a storm cloud and a bridge made of titanic timbers. There is a title, \"The Trials of Sir Morgan.\"")
  14. end
  15. function PAGE1(Item, Player)
  16. conversation = CreateConversation()
  17. AddConversationOption(conversation, "Next page.", "PAGE2")
  18. AddConversationOption(conversation, "Close the book.", "CloseItemConversation")
  19. StartDialogConversation(conversation, 2, Item, Player, "Once, many quatrains ago, there lived a brave knight named Sir Morgan. Mighty was his blade and fearless was his soul. Along with his noble friend and squire they traveled the wilds of Old Antonica, defending the helpless and defeating the evil.")
  20. end
  21. function PAGE2(Item, Player)
  22. conversation = CreateConversation()
  23. AddConversationOption(conversation, "Next page.", "PAGE3")
  24. AddConversationOption(conversation, "Previous page.", "PAGE1")
  25. AddConversationOption(conversation, "Close the book.", "CloseItemConversation")
  26. StartDialogConversation(conversation, 2, Item, Player, "One day the gods of valor spoke to noble Sir Morgan and told him to go to the great and stormy plains of the Storm Lord, Karana. There, in the vastness of green and wind, travelers were being assaulted by giantkin and gnollkin. Many brave knights fell to the evil in the plains, but Sir Morgan rode to the rescue.")
  27. end
  28. function PAGE3(Item, Player)
  29. conversation = CreateConversation()
  30. AddConversationOption(conversation, "Next page.", "PAGE4")
  31. AddConversationOption(conversation, "Previous page.", "PAGE2")
  32. AddConversationOption(conversation, "Close the book.", "CloseItemConversation")
  33. StartDialogConversation(conversation, 2, Item, Player, "Sir Morgan and his faithful squire set foot near the edge of a mighty bridge of timber that only the giants could have built. There at the bridge Sir Morgan repelled wave after wave of evil, making the roads safe for travelers. His reputation grew and the residents of Karana came to love him and hold celebrations in his name.")
  34. end
  35. function PAGE4(Item, Player)
  36. conversation = CreateConversation()
  37. AddConversationOption(conversation, "Next page.", "PAGE5")
  38. AddConversationOption(conversation, "Previous page.", "PAGE3")
  39. AddConversationOption(conversation, "Close the book.", "CloseItemConversation")
  40. StartDialogConversation(conversation, 2, Item, Player, "But the seeds of evil were planted. Gods of hatred and envy whispered to his foes and the brave and mighty Sir Morgan was soon to stand alone. The faithful squire was kidnapped and taken away from Sir Morgan. The humble servant of the brave knight was nowhere to be seen. In the squire's tent all that remained was a note written in blood.")
  41. end
  42. function PAGE5(Item, Player)
  43. conversation = CreateConversation()
  44. AddConversationOption(conversation, "Next page.", "PAGE6")
  45. AddConversationOption(conversation, "Previous page.", "PAGE4")
  46. AddConversationOption(conversation, "Close the book.", "CloseItemConversation")
  47. StartDialogConversation(conversation, 2, Item, Player, "The note was addressed to Sir Morgan and it was a challenge to him. \"Defeat each of the trials and you shall see your squire alive again.\" Sir Morgan spared no time. His faithful squire was in need of rescue. With exquisite armor donned and the greatest blade in hand, Sir Morgan set foot towards the trials ahead.")
  48. end
  49. function PAGE6(Item, Player)
  50. conversation = CreateConversation()
  51. if not HasQuest(Player, TheTrialsOfSirMorgan) and not HasCompletedQuest(Player, TheTrialsOfSirMorgan) then
  52. OfferQuest(nil, Player, TheTrialsOfSirMorgan)
  53. elseif GetQuestStep(Player, TheTrialsOfSirMorgan) == 2 then
  54. AddConversationOption(conversation, "Next page.", "PAGE7")
  55. end
  56. AddConversationOption(conversation, "Previous page.", "PAGE5")
  57. AddConversationOption(conversation, "Close the book.", "CloseItemConversation")
  58. StartDialogConversation(conversation, 2, Item, Player, "Sir Morgan raced to meet his first challenge at the Fields of the Corrupted, home of farmers in league with the coalition of evil that wished for the knight's demise. There, amidst the field, he arrived knowing full well that no pitchfork could dare challenge the strength of his armor, but upon arrival his true challenge lumbered forth- scarecrows! One after another the ten effigies fell to his blade. Sticks and hay were no match for him. He then rode to his next challenge.")
  59. end
  60. function PAGE7(Item, Player)
  61. conversation = CreateConversation()
  62. SetStepComplete(Player, TheTrialsOfSirMorgan, 2)
  63. if GetQuestStep(Player, TheTrialsOfSirMorgan) == 4 then
  64. AddConversationOption(conversation, "Next page.", "PAGE8")
  65. end
  66. AddConversationOption(conversation, "Previous page.", "PAGE6")
  67. AddConversationOption(conversation, "Close the book.", "CloseItemConversation")
  68. StartDialogConversation(conversation, 2, Item, Player, "On thundering hooves Sir Morgan rode, racing onward to the ancient pyramid and evil uncertain. Having to dismount from his steed, the knight was faced with an obstacle unbecoming, the pyramid had slipped into the sea. A beguiling sextet called to him in hopes of leading him to the Hold of Prexus. Grabbing soft clay from the shoreline the knight filled his ears. He removed his armor and fearlessly swam into battle. Yet again, against odds meant to cause him defeat, Sir Morgan was victorious. And on he rode.")
  69. end
  70. function PAGE8(Item, Player)
  71. conversation = CreateConversation()
  72. if not QuestStepIsComplete(Player, TheTrialsOfSirMorgan, 4) then
  73. SetStepComplete(Player, TheTrialsOfSirMorgan, 4)
  74. end
  75. if GetQuestStep(Player, TheTrialsOfSirMorgan) == 8 then
  76. AddConversationOption(conversation, "Next page.", "PAGE9")
  77. end
  78. AddConversationOption(conversation, "Previous page.", "PAGE7")
  79. AddConversationOption(conversation, "Close the book.", "CloseItemConversation")
  80. StartDialogConversation(conversation, 2, Item, Player, "Sir Morgan rode across the south bridge spanning the Plaincutter River when he found himself trapped by his next trial. There, on either side, were Bloodsaber knights, worshipers of death and decay. The commander and his platoon marched forward, weapons drawn. In a flurry and charge Sir Morgan began to dispatch of the evil knights, tossing them into the unyielding grasp of the river below. Surely such vile men shall rise again as a horde of revenants, but not this day. He won this battle, but with each battle his strength dwindled. Still, onward he rode.")
  81. end
  82. function PAGE9(Item, Player)
  83. conversation = CreateConversation()
  84. AddConversationOption(conversation, "Next page.", "PAGE10")
  85. AddConversationOption(conversation, "Previous page.", "PAGE8")
  86. AddConversationOption(conversation, "Close the book.", "CloseItemConversation")
  87. StartDialogConversation(conversation, 2, Item, Player, "When the brave Sir Morgan arrived at Deadview Pass the ground began to quake. He was met by hill giants whose rumble arrived before their gaze. Trapped with the Plaincutter to his back he was forced to charge upon his steed. Galloping around and around the gallant knight caused the giants to lose their balance, many fell into the river never to rise. With but one to go he was tossed from his saddle by a club made of whole timber. Lumbering closer and closer came the last giant surely to crush the disoriented knight.")
  88. end
  89. function PAGE10(Item, Player)
  90. conversation = CreateConversation()
  91. if not QuestStepIsComplete(Player, TheTrialsOfSirMorgan, 8) then
  92. SetStepComplete(Player, TheTrialsOfSirMorgan, 8)
  93. end
  94. if GetQuestStep(Player, TheTrialsOfSirMorgan) == 10 then
  95. AddConversationOption(conversation, "Next page.", "PAGE11")
  96. end
  97. AddConversationOption(conversation, "Previous page.", "PAGE9")
  98. AddConversationOption(conversation, "Close the book.", "CloseItemConversation")
  99. StartDialogConversation(conversation, 2, Item, Player, "Doom was upon him, he could not gain his ground. Just when all hope seemed for naught his noble steed charged forward with great speed and great might. The steed pounced upon the barrel chested giant and forced him into the river, but the steed too fell to the water. The great steed gave his life for the valorous knight. With his spirit nearly crushed and a long march ahead, the knight put one foot in front of the other going forward to the final trial.")
  100. end
  101. function PAGE11(Item, Player)
  102. conversation = CreateConversation()
  103. AddConversationOption(conversation, "Next page.", "PAGE12")
  104. AddConversationOption(conversation, "Previous page.", "PAGE10")
  105. AddConversationOption(conversation, "Close the book.", "CloseItemConversation")
  106. StartDialogConversation(conversation, 2, Item, Player, "In a field of ancient ruins Sir Morgan arrived. The stench of undeath permeated the rubble. Here he stepped trampling upon toppled stone and crushed bones. This was once the place of ancient magic, the ruins of the Keep of Immortality -- all that is left of the evil mage, Varsoon. The silence was broken when a figure arose and called forth familiars of two. The arcane creatures ripped and tore at even metal armor. Sir Morgan fought on despite his dwindling strength.")
  107. end
  108. function PAGE12(Item, Player)
  109. if not QuestStepIsComplete(Player, TheTrialsOfSirMorgan, 10) then
  110. SetStepComplete(Player, TheTrialsOfSirMorgan, 10)
  111. end
  112. conversation = CreateConversation()
  113. if GetQuestStep(Player, TheTrialsOfSirMorgan) == 12 then
  114. AddConversationOption(conversation, "Next page.", "PAGE13")
  115. end
  116. AddConversationOption(conversation, "Previous page.", "PAGE11")
  117. AddConversationOption(conversation, "Close the book.", "CloseItemConversation")
  118. StartDialogConversation(conversation, 2, Item, Player, "As all seemed to get dark a ray of blessing beamed down upon the knight. The gaze of the Twin Deities gave him great might. Sir Morgan arose from near death and slew the familiars with ease. He spied the dark shadow that let them loose darting to the hills. He gave chase.")
  119. end
  120. function PAGE13(Item, Player)
  121. conversation = CreateConversation()
  122. if not QuestStepIsComplete(Player, TheTrialsOfSirMorgan, 12) then
  123. SetStepComplete(Player, TheTrialsOfSirMorgan, 12)
  124. end
  125. if GetQuestStep(Player, TheTrialsOfSirMorgan) == 14 then
  126. AddConversationOption(conversation, "Next page.", "PAGE14")
  127. end
  128. AddConversationOption(conversation, "Previous page.", "PAGE12")
  129. AddConversationOption(conversation, "Close the book.", "CloseItemConversation")
  130. StartDialogConversation(conversation, 2, Item, Player, "His chase was long and his prey would not tire. When it seemed as though the chase would never end it began to slow. The figure of evil stepped foot upon a mound surrounded by titanic thorns, like talons or a great maw rising from the ground. The shadowy figure stood quiet and waited for Sir Morgan and the final battle.")
  131. end
  132. function PAGE14(Item, Player)
  133. conversation = CreateConversation()
  134. AddConversationOption(conversation, "Next page.", "PAGE15")
  135. AddConversationOption(conversation, "Previous page.", "PAGE13")
  136. AddConversationOption(conversation, "Close the book.", "CloseItemConversation")
  137. StartDialogConversation(conversation, 2, Item, Player, "To great shock the evil behind the trials removed the veil of secrecy. The light of dusk gave way his features. It was Squire Wimbley, his faithful servant. \"Why?\" the knight asked. \"I tire of being the servant\", Wimbley said with an evil bellow. \"Now I see the truth of your arrogance and selfish ways. I wish to be the hero, but I cannot be the hero until Sir Morgan dies!\" The squire was not himself.")
  138. end
  139. function PAGE15(Item, Player)
  140. conversation = CreateConversation()
  141. if not QuestStepIsComplete(Player, TheTrialsOfSirMorgan, 14) then
  142. SetStepComplete(Player, TheTrialsOfSirMorgan, 14)
  143. end
  144. AddConversationOption(conversation, "Previous page.", "PAGE14")
  145. AddConversationOption(conversation, "Close the book.", "CloseItemConversation")
  146. StartDialogConversation(conversation, 2, Item, Player, "Unknown to the knight, the squire was possessed by the evil of an ancient amulet he procured from the remnants of a place called the Keep of Immortality. The powers of envy and hate slowly overtook him. It lead to this battle to the death. The brave knight tried to suppress the advances of his once faithful squire. He did not want to harm him, but he was forced to or his own life would have been taken. Squire Wimbley fell to his blade. Sir Morgan freed the squire from his madness and all was well once again.")
  147. end