9
3

GardyExGiftgiver.lua 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. --[[
  2. Script Name : SpawnScripts/FrostfellWonderlandVillage/GardyEx-Giftgiver.lua
  3. Script Purpose : Gardy Ex-Giftgiver
  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) == 7 then
  20. DeepiceMysteryChat1(NPC, Spawn)
  21. elseif GetQuestStep(Spawn, ADeepiceMystery) == 8 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) == 6 and SpellName == "pour acid on" then
  30. SpawnSet(Target, "model_type", "115")
  31. SetStepComplete(Caster, ADeepiceMystery, 6)
  32. end
  33. end
  34. function InRange(NPC, Spawn)
  35. if HasQuest(Spawn, ADeepiceMystery) and GetQuestStep(Spawn, ADeepiceMystery) == 6 then
  36. SpawnSet(NPC, "model_type", "11823")
  37. else
  38. SpawnSet(NPC, "model_type", "115")
  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, "", "Frostfell certainly is the best time of year!", "happy", 1689589577, 4560189, Spawn)
  47. elseif choice == 2 then
  48. PlayFlavor(NPC, "", "Why would anyone beat up a guy giving away gifts?", "", 1689589577, 4560189, Spawn)
  49. elseif choice == 3 then
  50. PlayFlavor(NPC, "", "Owch! Maybe my bruises will be in festive colors.", "", 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 who, or what, froze you?", "DeepiceMysteryChat2")
  57. StartConversation(Conversation, NPC, Spawn, "I was beginning to fear the worst, friend. Thank you for freeing me!")
  58. end
  59. function DeepiceMysteryChat2(NPC, Spawn)
  60. FaceTarget(NPC, Spawn)
  61. Conversation = CreateConversation()
  62. AddConversationOption(Conversation, "I doubt it. Maybe someone else saw something.", "DeepiceMysteryChat3")
  63. StartConversation(Conversation, NPC, Spawn, "No, but considering the magics used do you think it was coldain or ice giants?")
  64. end
  65. function DeepiceMysteryChat3(NPC, Spawn)
  66. FaceTarget(NPC, Spawn)
  67. Conversation = CreateConversation()
  68. SetStepComplete(Spawn, ADeepiceMystery, 7)
  69. AddConversationOption(Conversation, "This seems a little much for them.")
  70. StartConversation(Conversation, NPC, Spawn, "I'm betting it was those troublesome Humbugs.")
  71. end