x_marks_the_spot.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. --[[
  2. Script Name : Quests/IsleofRefuge/x_marks_the_spot.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.20 12:09:11
  5. Script Purpose :
  6. Zone : IsleofRefuge
  7. Quest Giver: fallen pirate map
  8. Preceded by: None
  9. Followed by:
  10. --]]
  11. function Init(Quest)
  12. AddQuestStep(Quest, 1, "I need to find the location on the map. It should be near a waterfall.", 1, 100, "I should find the location on the map. The waterfall it mentions should be somewhere on this island.", 11)
  13. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  14. end
  15. function Accepted(Quest, QuestGiver, Player)
  16. CloseItemConversation(nil,Player)
  17. if HasItem(Player,7027) then
  18. RemoveItem(Player,7027,1)
  19. end
  20. SendMessage(Player, "Your fallen pirate's map has been placed in your quest satchel.")
  21. end
  22. function Declined(Quest, QuestGiver, Player)
  23. -- Add dialog here for when the quest is declined
  24. end
  25. function Deleted(Quest, QuestGiver, Player)
  26. -- Remove any quest specific items here when the quest is deleted
  27. end
  28. function Step1Complete(Quest, QuestGiver, Player)
  29. UpdateQuestStepDescription(Quest, 1, "I found the location on the map.")
  30. UpdateQuestTaskGroupDescription(Quest, 1, "I found the location on the map but I seem to have disturbed a ghost!")
  31. AddQuestStepKill(Quest, 2, "I need to defeat the ghost to get his treasure!", 1, 100, "I need to defeat the ghost to get his treasure!", 611, 3250054)
  32. AddQuestStepCompleteAction(Quest, 2, "QuestComplete")
  33. end
  34. function QuestComplete(Quest, QuestGiver, Player)
  35. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  36. UpdateQuestStepDescription(Quest, 2, "I defeated the ghost pirate!")
  37. UpdateQuestTaskGroupDescription(Quest, 2, "I defeated the ghost pirate!")
  38. UpdateQuestDescription(Quest, "The map seemed to have led to the grave of an old sailor. He wasn't resting peacefully though and I had to defend myself against an attack from the grave's ghost! I did manage to get some coin and an old cutlass.")
  39. GiveQuestReward(Quest, Player)
  40. end
  41. function Reload(Quest, QuestGiver, Player, Step)
  42. if Step == 1 then
  43. Step1Complete(Quest, QuestGiver, Player)
  44. elseif Step == 2 then
  45. QuestComplete(Quest, QuestGiver, Player)
  46. end
  47. end