aRustySword.lua 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. --[[
  2. Script Name : ItemScripts/aRustySword.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.05.15 07:05:27
  5. Script Purpose :
  6. :
  7. --]]
  8. local Quest = 5830
  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, "[Inspect the blade closely]", "Dialog2")
  25. AddConversationOption(conversation, "[Put the rusty sword away]", "CloseItemConversation")
  26. StartDialogConversation(conversation, 2, Item, Player, "I've found a rusty blade that looks like it was once a very powerful sword. It may be possible to restore this sword back to its original condition.")
  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, "[Mix the flour into a paste and apply it to the rust]", "Dialog3")
  35. end
  36. AddConversationOption(conversation, "[Put the rusty sword away]", "CloseItemConversation")
  37. StartDialogConversation(conversation, 2, Item, Player, "As you continue to inspect the sword, you can see that it once had some carvings on both the hilt and the blade. Again, you detect some type of power coming from it. Maybe if you made a paste from some flour and water, you could try to scrub the rust off of the blade.")
  38. end
  39. function Dialog3(Item,Player)
  40. conversation = CreateConversation()
  41. if GetQuestStep(Player,Quest)==4 then
  42. AddConversationOption(conversation, "[Repair the stars etched in the blade]", "Dialog4")
  43. end
  44. if GetQuestStep(Player,Quest)==2 then
  45. SetStepComplete(Player,Quest,2)
  46. end
  47. AddConversationOption(conversation, "[Put the sword away]", "CloseItemConversation")
  48. StartDialogConversation(conversation, 2, Item, Player, "You apply the paste to the blade, scouring it for quite a while. After a long time you manage to remove nearly all of the rust. This sword is actually rather elegant and you can now see that there were carvings of stars along the entirety of the sword. Perhaps if you had an etcher, you might be able to carve the stars back into the blade.")
  49. end
  50. function Dialog4(Item,Player)
  51. conversation = CreateConversation()
  52. if GetQuestStep(Player,Quest)==6 then
  53. AddConversationOption(conversation, "I am victorious! Starwisp is renewed!", "QuestFinish")
  54. end
  55. if GetQuestStep(Player,Quest)==4 then
  56. SetStepComplete(Player,Quest,4)
  57. end
  58. AddConversationOption(conversation, "[Put Starwisp away]", "CloseItemConversation")
  59. StartDialogConversation(conversation, 2, Item, Player, "Looking at the sword, you can see each one of the stars you etched have a faint glow coming from them. It's as if each of the klicnicks you killed was transferred into the sword somehow. Another thought enters your head - Starwisp.")
  60. end
  61. --I've killed quite a number of klicniks in Antonica. I have a feeling my desire to do so came from the sword.
  62. function QuestFinish(Item,Player)
  63. CloseItemConversation(Item,Player)
  64. if GetQuestStep(Player,Quest)==6 then
  65. SetStepComplete(Player,Quest,6)
  66. end
  67. if HasItem(Player,10331) then
  68. RemoveItem(Player,10331,1)
  69. end
  70. end
  71. function Completed(Item,Player)
  72. conversation = CreateConversation()
  73. AddConversationOption(conversation, "[Hold on to the blade as a keepsake]")
  74. AddConversationOption(conversation, "[Get rid of the rusted junk.]", "QuestFinish")
  75. StartDialogConversation(conversation, 2, Item, Player, "The rusted blade glows slightly in your hands. Your mind flashes a faint memory, a sword you've seen before.")
  76. end