9
3

abrokenmusicbox.lua 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --[[
  2. Script Name : ItemScripts/abrokenmusicbox.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.06.25 06:06:14
  5. Script Purpose :
  6. :
  7. --]]
  8. local RewardForAMissingMusicBox = 5261
  9. function examined(Item, Player)
  10. if CanReceiveQuest(Player,RewardForAMissingMusicBox) then
  11. Dialog1(Item,Player)
  12. else
  13. conversation = CreateConversation()
  14. AddConversationOption(conversation, "[Keep the musicbox]")
  15. AddConversationOption(conversation, "[Destroy the musicbox]", "QuestFinish")
  16. StartDialogConversation(conversation, 2, Item, Player, "This floral designed music box is broken like one you found before. Perhaps it is the same one? Oh well.")
  17. end
  18. end
  19. function Dialog1(Item,Player)
  20. conversation = CreateConversation()
  21. if CanReceiveQuest(Player,RewardForAMissingMusicBox) then
  22. AddConversationOption(conversation, "[Open the musicbox]", "Dialog2")
  23. end
  24. AddConversationOption(conversation, "[Put the box away]", "CloseItemConversation")
  25. StartDialogConversation(conversation, 2, Item, Player, "The music box is decorated with gold trim and a floral design is carved into the lid. The lid is unlocked.")
  26. end
  27. function Dialog2(Item,Player)
  28. conversation = CreateConversation()
  29. if CanReceiveQuest(Player,RewardForAMissingMusicBox) then
  30. AddConversationOption(conversation, "[Write the name in your journal]", "Offer")
  31. end
  32. AddConversationOption(conversation, "[Put the music box away.]", "CloseItemConversation")
  33. StartDialogConversation(conversation, 2, Item, Player, "Inside the music box is a small engraving of the name \"Lucilla Quietus\" on a little gold plate. You also discover that the music box no longer plays music.")
  34. end
  35. function Offer(Item,Player)
  36. if CanReceiveQuest(Player,RewardForAMissingMusicBox) then
  37. OfferQuest(nil,Player,RewardForAMissingMusicBox)
  38. end
  39. CloseItemConversation(Item,Player)
  40. end
  41. function QuestFinish(Item,Player)
  42. CloseItemConversation(Item,Player)
  43. if HasItem(Player,1286,1) then
  44. RemoveItem(Player,1286)
  45. end
  46. end