9
3

asandyboneshardClassic.lua 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. --[[
  2. Script Name : ItemScripts/asandyboneshardClassic.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.16 09:09:30
  5. Script Purpose : Classic Version of a Sandy Bone Shard quest.
  6. :
  7. --]]
  8. local BoneShard = 5746
  9. function examined(Item, Player)
  10. if not HasQuest(Player, BoneShard) and not HasCompletedQuest(Player, BoneShard) then
  11. Dialog1(Item,Player)
  12. elseif GetQuestStep(Player,BoneShard)==1 or GetQuestStep(Player,BoneShard)==2 then
  13. Dialog2(Item,Player)
  14. elseif GetQuestStep(Player,BoneShard)==3 or GetQuestStep(Player,BoneShard)==4 then
  15. Dialog3(Item,Player)
  16. elseif GetQuestStep(Player,BoneShard)==5 or GetQuestStep(Player,BoneShard)==6 then
  17. Dialog4(Item,Player)
  18. elseif HasCompletedQuest(Player, BoneShard)then
  19. Completed(Item,Player)
  20. end
  21. end
  22. function Dialog1(Item,Player)
  23. conversation = CreateConversation()
  24. AddConversationOption(conversation, "I should try to see if other crabs have more missing pieces to the token.", "Dialog2")
  25. AddConversationOption(conversation, "[Put the Piece Away]", "CloseItemConversation")
  26. StartDialogConversation(conversation, 2, Item, Player, "It appears as if there once were other pieces to the token and this is only one part. If you could find the rest and a chain or strap you might be able to fashion a necklace from the repaired trinket and gain a momento of the island. The other pieces may be near where you found this one.")
  27. end
  28. function Dialog2(Item,Player)
  29. conversation = CreateConversation()
  30. if not HasQuest(Player, BoneShard) and not HasCompletedQuest(Player, BoneShard) then
  31. OfferQuest(nil,Player,BoneShard)
  32. end
  33. if GetQuestStep(Player,BoneShard)==2 then
  34. AddConversationOption(conversation, "[Assemble the Pieces]", "Dialog3")
  35. end
  36. AddConversationOption(conversation, "[Put the Piece Away]", "CloseItemConversation")
  37. StartDialogConversation(conversation, 2, Item, Player, "This old and yellowed piece of bone seems to be more than it first appears. Intricate etchings appear on the surface as you brush away the sand.")
  38. end
  39. function Dialog3(Item,Player)
  40. conversation = CreateConversation()
  41. if GetQuestStep(Player,BoneShard)==4 then
  42. AddConversationOption(conversation, "[Glue the Pieces Together]", "Dialog4")
  43. end
  44. if GetQuestStep(Player,BoneShard)==2 then
  45. SetStepComplete(Player,BoneShard,2)
  46. end
  47. AddConversationOption(conversation, "[Put the Piece Away]", "CloseItemConversation")
  48. StartDialogConversation(conversation, 2, Item, Player, "As you assemble the pieces of the taken the intricate carving of a ship becomes clear. The pieces can be repaired but some sort of glue will be needed to hold them together again. Fish skin may be a good start to create the glue.")
  49. end
  50. function Dialog4(Item,Player)
  51. conversation = CreateConversation()
  52. if GetQuestStep(Player,BoneShard)==6 then
  53. AddConversationOption(conversation, "[Add the Leather Cord]", "QuestFinish")
  54. end
  55. if GetQuestStep(Player,BoneShard)==4 then
  56. SetStepComplete(Player,BoneShard,4)
  57. end
  58. AddConversationOption(conversation, "[Put the Token Away]", "CloseItemConversation")
  59. StartDialogConversation(conversation, 2, Item, Player, "The glue holds well and the lines made by the cracks are barely visible. The small hoop that had been carved long ago at the top only needs a cord of leather and the necklace will be complete.")
  60. end
  61. function QuestFinish(Item,Player)
  62. CloseItemConversation(Item,Player)
  63. if GetQuestStep(Player,BoneShard)==6 then
  64. SetStepComplete(Player,BoneShard,6)
  65. end
  66. if HasItem(Player,1001012) then
  67. RemoveItem(Player,1001012,1)
  68. end
  69. end
  70. function Completed(Item,Player)
  71. conversation = CreateConversation()
  72. AddConversationOption(conversation, "[Throw the token]", "QuestFinish")
  73. StartDialogConversation(conversation, 2, Item, Player, "This piece of bone looks like the talisman you've already remade. It may be best to throw it back into the sea for another crab to find.")
  74. end