MrMcScroogle.lua 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. --[[
  2. Script Name : SpawnScripts/FrostfellWonderlandVillage/Mr.McScroogle.lua
  3. Script Purpose : Mr. McScroogle
  4. Script Author : vo1d
  5. Script Date : 2019.10.29
  6. Script Notes :
  7. --]]
  8. local ADeepiceMystery = 486
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 60, "InRange", "OutRange")
  11. end
  12. function respawn(NPC)
  13. spawn(NPC)
  14. end
  15. function hailed(NPC, Spawn)
  16. FaceTarget(NPC, Spawn)
  17. if HasCompletedQuest(Spawn, ADeepiceMystery) then
  18. elseif HasQuest(Spawn, ADeepiceMystery) then
  19. if GetQuestStep(Spawn, ADeepiceMystery) == 9 then
  20. DeepiceMysteryChat1(NPC, Spawn)
  21. elseif GetQuestStep(Spawn, ADeepiceMystery) == 10 then
  22. DeepiceMysteryChat1(NPC, Spawn)
  23. end
  24. else
  25. Greetings(NPC, Spawn)
  26. end
  27. end
  28. function casted_on(Target, Caster, SpellName)
  29. if HasQuest(Caster, ADeepiceMystery) and GetQuestStep(Caster, ADeepiceMystery) == 8 and SpellName == "pour acid on" then
  30. SpawnSet(Target, "model_type", "121")
  31. SetStepComplete(Caster, ADeepiceMystery, 8)
  32. end
  33. end
  34. function InRange(NPC, Spawn)
  35. if HasQuest(Spawn, ADeepiceMystery) and GetQuestStep(Spawn, ADeepiceMystery) == 8 then
  36. SpawnSet(NPC, "model_type", "11823")
  37. else
  38. SpawnSet(NPC, "model_type", "121")
  39. end
  40. end
  41. function OutRange(NPC, Spawn)
  42. end
  43. function Greetings(NPC, Spawn)
  44. local choice = math.random(1,3)
  45. if choice == 1 then
  46. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1054.mp3", "", "", 0, 0, Spawn)
  47. elseif choice == 2 then
  48. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1054.mp3", "", "", 0, 0, Spawn)
  49. elseif choice == 3 then
  50. PlayFlavor(NPC, "", "I hire you for one job and you think you can just harass me anytime? Get out of here.", "scold", 1689589577, 4560189, Spawn)
  51. end
  52. end
  53. function DeepiceMysteryChat1(NPC, Spawn)
  54. FaceTarget(NPC, Spawn)
  55. Conversation = CreateConversation()
  56. AddConversationOption(Conversation, "Did you see what, or who, attacked you?", "DeepiceMysteryChat2")
  57. StartConversation(Conversation, NPC, Spawn, "Brrr! Thanks for the aid. Being stuck in that block was freezing my bones!")
  58. end
  59. function DeepiceMysteryChat2(NPC, Spawn)
  60. FaceTarget(NPC, Spawn)
  61. Conversation = CreateConversation()
  62. AddConversationOption(Conversation, "Wonderful! Who was it?", "DeepiceMysteryChat3")
  63. StartConversation(Conversation, NPC, Spawn, "You bet your last copper, I did!")
  64. end
  65. function DeepiceMysteryChat3(NPC, Spawn)
  66. FaceTarget(NPC, Spawn)
  67. Conversation = CreateConversation()
  68. AddConversationOption(Conversation, "Wait.... The Miragul?", "DeepiceMysteryChat4")
  69. StartConversation(Conversation, NPC, Spawn, "Miragul!")
  70. end
  71. function DeepiceMysteryChat4(NPC, Spawn)
  72. FaceTarget(NPC, Spawn)
  73. Conversation = CreateConversation()
  74. AddConversationOption(Conversation, "So, that's what you saw... Wild animals?", "DeepiceMysteryChat5")
  75. StartConversation(Conversation, NPC, Spawn, "Well, I didn't see Miragul, per se. But can you think of someone else with a fondness for ice, and wild animals?")
  76. end
  77. function DeepiceMysteryChat5(NPC, Spawn)
  78. FaceTarget(NPC, Spawn)
  79. Conversation = CreateConversation()
  80. if GetQuestStep(Spawn, ADeepiceMystery) == 9 then
  81. SetStepComplete(Spawn, ADeepiceMystery, 9)
  82. end
  83. AddConversationOption(Conversation, "Interesting, but maybe not Miragul.")
  84. StartConversation(Conversation, NPC, Spawn, "Animals made of ice, actually.")
  85. end