9
3

CaptainGavinBook.lua 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. --[[
  2. Script Name : SpawnScripts/Nektropos1/CaptainGavinBook.lua
  3. Script Author : smash
  4. Script Date : 2016.09.11 12:09:11
  5. Script Purpose :
  6. :
  7. --]]
  8. function casted_on(NPC, Spawn, Message)
  9. local conversation = CreateConversation()
  10. AddConversationOption(conversation, "Read the book.", "ReadBook1")
  11. AddConversationOption(conversation, "Leave the book alone.", "CloseConversation")
  12. StartDialogConversation(conversation, 1, NPC, Spawn, "As you pick up the book several pages fall out and crumble to dust. You flip through the book, but very few pages are legible.")
  13. end
  14. function ReadBook1(NPC, Spawn)
  15. local conversation = CreateConversation()
  16. AddConversationOption(conversation, "Turn the page carefully.", "ReadBook2")
  17. AddConversationOption(conversation, "Flip through the book.", "FinishReading")
  18. StartDialogConversation(conversation, 1, NPC, Spawn, "Droplets of water appear to mar what little writing is left on this page.....beloved sons Ollix and Maltus have passed beyond my grasp. For all my wealth I could not save them from.....")
  19. end
  20. function ReadBook2(NPC, Spawn)
  21. local conversation = CreateConversation()
  22. AddConversationOption(conversation, "Keep reading.", "ReadBook3")
  23. AddConversationOption(conversation, "Stop reading.", "CloseConversation")
  24. StartDialogConversation(conversation, 1, NPC, Spawn, "3145 Firstchill..........with the death of our sons, Alana's heart was broken. I buried her this morning..........")
  25. end
  26. function ReadBook3(NPC, Spawn)
  27. local conversation = CreateConversation()
  28. AddConversationOption(conversation, "Turn the page.", "ReadBook4")
  29. AddConversationOption(conversation, "Stop reading.", "CloseConversation")
  30. StartDialogConversation(conversation, 1, NPC, Spawn, "...entry 3151 Busheldown, Burnday the 15th, I have sent my daughters guardians away at my daughters requests. I did not want to do this, but I love my daughters too much to deny their....")
  31. end
  32. function ReadBook4(NPC, Spawn)
  33. local conversation = CreateConversation()
  34. AddConversationOption(conversation, "Continue reading.", "ReadBook5")
  35. AddConversationOption(conversation, "Stop reading.", "CloseConversation")
  36. StartDialogConversation(conversation, 1, NPC, Spawn, "...entry 3174 Lastleaf, Feastday the 27th, .......guardians to watch over my daughters they have become more reckless, especially Elise. Twice now we have caught her out walking the ramparts............")
  37. end
  38. function ReadBook5(NPC, Spawn)
  39. local conversation = CreateConversation()
  40. AddConversationOption(conversation, "Keep reading.", "ReadBook6")
  41. AddConversationOption(conversation, "Stop reading.", "CloseConversation")
  42. StartDialogConversation(conversation, 1, NPC, Spawn, "...I was forced to watch the horror.....my own children....before my eyes......I live now only to avenge them........")
  43. end
  44. function ReadBook6(NPC, Spawn)
  45. local conversation = CreateConversation()
  46. AddConversationOption(conversation, "The last few pages are all but illegible.", "FinishReading")
  47. StartDialogConversation(conversation, 1, NPC, Spawn, "3397....fathers work shall not go unfinished....descendants of the guardians.......")
  48. end
  49. function FinishReading(NPC, Spawn)
  50. CloseConversation(NPC, Spawn)
  51. SendMessage(Spawn, "The pages of the book deteriorate into dust.")
  52. if GetTempVariable(NPC, "CaptainSpawned") ~= "true" then
  53. SpawnByLocationID(GetZone(NPC), 616620)
  54. SetTempVariable(NPC, "CaptainSpawned", "true")
  55. end
  56. end