9
3

DirtCakedShield.lua 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. --[[
  2. Script Name : ItemScripts/DirtCakedShield.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.05.16 12:05:54
  5. Script Purpose :
  6. :
  7. --]]
  8. local Quest = 5831
  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 shield more closely.]", "Dialog2")
  25. AddConversationOption(conversation, "[Put the dirt-encrusted shield away.]", "CloseItemConversation")
  26. StartDialogConversation(conversation, 2, Item, Player, "This dirt-encrusted shield has seen better days. Whoever originally owned it didn't care of it. Even now it's caked with so much dirt that it's hard to make out what was originally embossed on the face.")
  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, "[Wipe the caked dirt off the shield face.]", "Dialog3")
  35. end
  36. AddConversationOption(conversation, "[Put the shield away.]", "CloseItemConversation")
  37. StartDialogConversation(conversation, 2, Item, Player, "The dirt is hard-packed into the grooves of the shield. It may be possible to remove all the dried soil and see what the shield originally looked like. You may want to dip it in Crater Lake to loosen up the outer layer.")
  38. end
  39. function Dialog3(Item,Player)
  40. conversation = CreateConversation()
  41. if GetQuestStep(Player,Quest)==4 then
  42. AddConversationOption(conversation, "[Scrub the dirt with the badger fur]", "Dialog4")
  43. end
  44. if GetQuestStep(Player,Quest)==2 then
  45. SetStepComplete(Player,Quest,2)
  46. end
  47. AddConversationOption(conversation, "[Put the shield away]", "CloseItemConversation")
  48. StartDialogConversation(conversation, 2, Item, Player, "The water from Crater Lake was able to loosen up most of the dirt, making it a bit muddy. Scraping away the outer layer of mud reveals even more dirt inside all of the etchings. You're going to need to scrub it out with something. The fur from the badgers in Antonica might do the job.")
  49. end
  50. function Dialog4(Item,Player)
  51. conversation = CreateConversation()
  52. if GetQuestStep(Player,Quest)==6 then
  53. AddConversationOption(conversation, "[Scrub the tarnish away with the centipede poison.]", "Dialog5")
  54. end
  55. if GetQuestStep(Player,Quest)==4 then
  56. SetStepComplete(Player,Quest,4)
  57. end
  58. AddConversationOption(conversation, "[Put the shield away]", "CloseItemConversation")
  59. StartDialogConversation(conversation, 2, Item, Player, "The hard fur from the badgers seems to do the trick. You are able to brush out all of the grime from the crevices. In the end, you see that it's an old shield with an image of the Qeynos gates on it. Unfortunately, it's rather tarnished. Maybe the poison from centipedes might be able to get rid of the tarnish.")
  60. end
  61. function Dialog5(Item,Player)
  62. conversation = CreateConversation()
  63. AddConversationOption(conversation, "[Admire your reflection in the smooth shield face]", "QuestFinish")
  64. StartDialogConversation(conversation, 2, Item, Player, "Making sure not to get any on your hands, you scrub at the metal with the centipede poison. After a while, you start to see the original luster shine on the face of the shield again. Even though it's a very old shield, you're certain it'll work just as good as it did when it was originally forged.")
  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,6448) then
  73. RemoveItem(Player,6448,1)
  74. end
  75. end
  76. function Completed(Item,Player)
  77. conversation = CreateConversation()
  78. AddConversationOption(conversation, "[Keep the shield, for whatever reason.]")
  79. AddConversationOption(conversation, "[Toss the shield into the mud]", "QuestFinish")
  80. StartDialogConversation(conversation, 2, Item, Player, "This dirt-caked shield resembles one you cleaned up before! You have no need to keep this one around.")
  81. end