9
3

PelleShinkicker.lua 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. --[[
  2. Script Name : SpawnScripts/ElddarGrove/PelleShinkicker.lua
  3. Script Purpose : Pelle Shinkicker
  4. Script Author : Dorbin
  5. Script Date : 5.2.2022
  6. Script Notes :
  7. --]]
  8. local BookDelivery = 5514
  9. function spawn(NPC)
  10. ProvidesQuest(NPC,BookDelivery)
  11. SetPlayerProximityFunction(NPC, 9, "InRange", "LeaveRange")
  12. end
  13. function InRange(NPC, Spawn)
  14. if not HasCompletedQuest (Spawn, 5514) and not HasQuest (Spawn, 5514) then
  15. if math.random(1, 100) <= 80 then
  16. PlayFlavor(NPC, "voiceover/english/pelle_shinkicker/qey_elddar/100_quest_pelle_shinkicker_hail_f015f9a0.mp3", "Shoo shoo! I am much too busy to speak with you now.", "frustrated", 1998455291, 633133163, Spawn)
  17. end
  18. end
  19. end
  20. function hailed(NPC, Spawn)
  21. if GetFactionAmount(Spawn, 11) <0 then
  22. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  23. FaceTarget(NPC, Spawn)
  24. else
  25. FaceTarget(NPC, Spawn)
  26. PlayFlavor(NPC, "voiceover/english/pelle_shinkicker/qey_elddar/pelleshinkicker000.mp3", "", "", 4147340962, 3983315910, Spawn)
  27. local conversation = CreateConversation()
  28. if not HasQuest(Spawn,BookDelivery) and not HasCompletedQuest(Spawn, BookDelivery) then
  29. AddConversationOption(conversation, "You seem busy. Need any help?", "Option1")
  30. end
  31. if GetQuestStep(Spawn,BookDelivery)==3 then
  32. AddConversationOption(conversation, "I've delivered your book.", "Delivered")
  33. end
  34. if HasCompletedQuest(Spawn,BookDelivery) then
  35. AddConversationOption(conversation, "Don't worry. I've helped you already once before. Take care.")
  36. end
  37. AddConversationOption(conversation, "Oh, sorry. I'll leave you alone.")
  38. StartConversation(conversation, NPC, Spawn, "Oh, what is it now? Bristlebane's no doubt playing tricks on me again, causing all this interruption! Is there something meaningful I can help you with, or are you just going to gawk?")
  39. end
  40. end
  41. function Option1(NPC, Spawn)
  42. FaceTarget(NPC, Spawn)
  43. PlayFlavor(NPC, "voiceover/english/pelle_shinkicker/qey_elddar/pelleshinkicker001.mp3", "", "agree", 2510348441, 2397724897, Spawn)
  44. local conversation = CreateConversation()
  45. AddConversationOption(conversation, "On with it. What do you need?", "Option2")
  46. AddConversationOption(conversation, "Sounds like you should have stayed at the tavern. Farewell.")
  47. StartConversation(conversation, NPC, Spawn, "I could in fact! I've been slightly worried that you've come to me with another story to write, or some other such thing. I already write my stiff fingers closer to their doom, and don't need more work to keep me away from my tavern in the Buabbleshire! ")
  48. end
  49. function Option2(NPC, Spawn)
  50. FaceTarget(NPC, Spawn)
  51. PlayFlavor(NPC, "voiceover/english/pelle_shinkicker/qey_elddar/pelleshinkicker002.mp3", "", "scold", 1275889861, 2180981417, Spawn)
  52. local conversation = CreateConversation()
  53. AddConversationOption(conversation, "Sorry. I'll deliver your book.", "StartQuest")
  54. AddConversationOption(conversation, "I've changed my mind. Good day.")
  55. StartConversation(conversation, NPC, Spawn, "Calm yourself sir! I'll have you know I'm just as respected around here for my exploits as an adventurer as my skill with a quill, Heh! Are you going to take my friend this book or not? I can't sit around here chatting all day about whether you'll do it or not.")
  56. end
  57. function StartQuest(NPC, Spawn)
  58. FaceTarget(NPC, Spawn)
  59. OfferQuest(NPC, Spawn,BookDelivery)
  60. end
  61. function Delivered(NPC, Spawn)
  62. FaceTarget(NPC, Spawn)
  63. PlayFlavor(NPC, "voiceover/english/pelle_shinkicker/qey_elddar/pelleshinkicker004.mp3", "", "heelclick", 1303257616, 1299740157, Spawn)
  64. local conversation = CreateConversation()
  65. AddConversationOption(conversation, "Glad to have helped. Thanks.", "FinishQuest")
  66. StartConversation(conversation, NPC, Spawn, "Splendid indeed! How was old Rune anyway? Getting along well I hope! I keep inviting him over to the tavern for an ale, but he always has his head buried in a musty old book. And not the exciting type I write either, Heh! Well, I wish you luck on your adventures! Perhaps this will help. I picked it up on one of mine!")
  67. end
  68. function FinishQuest(NPC, Spawn)
  69. FaceTarget(NPC, Spawn)
  70. SetStepComplete(Spawn,BookDelivery, 3)
  71. end