9
3

achainedbundle.lua 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. --[[
  2. Script Name : ItemScripts/achainedbundle.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.05.16 06:05:51
  5. Script Purpose :
  6. :
  7. --]]
  8. local Quest = 5837
  9. function examined(Item, Player)
  10. if not HasQuest(Player, Quest) and not HasCompletedQuest(Player, Quest) then
  11. Dialog1(Item,Player)
  12. elseif GetQuestStep(Player,Quest)==1 or GetQuestStep(Player,Quest)==2 then
  13. Dialog2(Item,Player)
  14. elseif GetQuestStep(Player,Quest)==3 or GetQuestStep(Player,Quest)==4 then
  15. Dialog3(Item,Player)
  16. elseif GetQuestStep(Player,Quest)==5 or GetQuestStep(Player,Quest)==6 then
  17. Dialog4(Item,Player)
  18. elseif HasCompletedQuest(Player, Quest)then
  19. Completed(Item,Player)
  20. end
  21. end
  22. function Dialog1(Item,Player)
  23. conversation = CreateConversation()
  24. AddConversationOption(conversation, "[Examine the bundle more closely.]", "Dialog2")
  25. AddConversationOption(conversation, "[Put the chained bundle away.]", "CloseItemConversation")
  26. StartDialogConversation(conversation, 2, Item, Player, "I've found a very odd bundle of chains and leather straps. I'm certain there's something in the center of this bundle, but I can't make out what it is.")
  27. end
  28. function Dialog2(Item,Player)
  29. conversation = CreateConversation()
  30. if CanReceiveQuest(Player,Quest) then
  31. OfferQuest(nil,Player,Quest)
  32. end
  33. if GetQuestStep(Player,Quest)==2 then
  34. AddConversationOption(conversation, "[Inspect what caused the noise from the bundle.]", "Dialog3")
  35. end
  36. AddConversationOption(conversation, "[Put the chained bundle away.]", "CloseItemConversation")
  37. StartDialogConversation(conversation, 2, Item, Player, "This chained bundle is exceptionally heavy and you're not sure what it really is. There seem to be hundreds of chained links that are wrapped around something. To make matters worse there are a bunch of straps that are bound so tight they can't be undone. Finally there is a huge lock binding all of it together.")
  38. end
  39. function Dialog3(Item,Player)
  40. conversation = CreateConversation()
  41. if GetQuestStep(Player,Quest)==4 then
  42. AddConversationOption(conversation, "[Use the crab claws to cut the leather straps]", "Dialog4")
  43. end
  44. if GetQuestStep(Player,Quest)==2 then
  45. SetStepComplete(Player,Quest,2)
  46. end
  47. AddConversationOption(conversation, "[Put the chained bundle away.]", "CloseItemConversation")
  48. StartDialogConversation(conversation, 2, Item, Player, "You look at bundle and can see that the lock has snapped open. Something about getting close to the crypt seems to have destroyed the lock. Unfortunately, the straps still old tight. If you're going to find out what's hidden inside this bundle, you're going to have to find a way to cut through these straps.")
  49. end
  50. function Dialog4(Item,Player)
  51. conversation = CreateConversation()
  52. if GetQuestStep(Player,Quest)==6 then
  53. AddConversationOption(conversation, "[Use the arcane saw to cut the chains]", "Dialog5")
  54. end
  55. if GetQuestStep(Player,Quest)==4 then
  56. SetStepComplete(Player,Quest,4)
  57. end
  58. AddConversationOption(conversation, "[Put the chained bundle away.]", "CloseItemConversation")
  59. StartDialogConversation(conversation, 2, Item, Player, "You take the sharp ends of the crab claws and start cutting though the leather straps. You wind up going through each of the claws you collected. Unfortunately, the chain links are wrapped so tight that the now loosened straps have done you no good. You're going to need to find a way to cut through all of the chains. Perhaps the witches of the hills might have something to help you.")
  60. end
  61. function Dialog5(Item,Player)
  62. conversation = CreateConversation()
  63. AddConversationOption(conversation, "Liberated at last!", "QuestFinish")
  64. StartDialogConversation(conversation, 2, Item, Player, "You used the arcane saw on the bundle of chain links and are surprised at how easy it cuts through the metal. As you approach the center, nearly all of the chains have been fully cut away. Once you have cut through all of the chains, the saw disappears from your hands. Finally, you see what all the effort has brought you - hidden beneath all those oppressing chains is the fabled maul, Freedom.")
  65. end
  66. --
  67. function QuestFinish(Item,Player)
  68. CloseItemConversation(Item,Player)
  69. if GetQuestStep(Player,Quest)==6 then
  70. SetStepComplete(Player,Quest,6)
  71. end
  72. if HasItem(Player,1343) then
  73. RemoveItem(Player,1343,1)
  74. end
  75. end
  76. function Completed(Item,Player)
  77. conversation = CreateConversation()
  78. AddConversationOption(conversation, "[Hold on to the chained bundle.]")
  79. AddConversationOption(conversation, "[Get rid of the budnle. You have no further use of it.]", "QuestFinish")
  80. StartDialogConversation(conversation, 2, Item, Player, "The bound bundle feels familiar in your hands, but lighter. Whatever was inside it is gone.")
  81. end