EireneithAlannia.lua 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. --[[
  2. Script Name : SpawnScripts/Castleview/EireneithAlannia.lua
  3. Script Purpose : Eireneith Alannia
  4. Script Author : Dorbin
  5. Script Date : 2022.01.29
  6. Script Notes :
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  9. dofile("SpawnScripts/Generic/GenericVoiceOvers.lua")
  10. -- PlayFlavor(NPC, "", "One of my responsibilities is controlling the population of creatures in the area, and I'm barely keeping up! The glade deer population has grown out of control. Once their numbers rise, those deer are hard to manage!", "", 1689589577, 4560189)
  11. local Deer = 5469
  12. function spawn(NPC)
  13. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  14. ProvidesQuest(NPC, Deer)
  15. end
  16. function respawn(NPC)
  17. end
  18. function InRange(NPC, Spawn) --Quest Callout
  19. if GetFactionAmount(Spawn,11) <0 then
  20. FactionChecking(NPC, Spawn, faction)
  21. else
  22. if math.random(1, 100) <= 60 and GetLevel(Spawn) >=10 then
  23. PlayFlavor(NPC, "", "So much evil ... I don't know which way to turn first.", "ponder", 0, 0, Spawn)
  24. end
  25. end
  26. end
  27. function hailed(NPC, Spawn)
  28. if GetFactionAmount(Spawn,11) <0 then
  29. FactionChecking(NPC, Spawn, faction)
  30. else
  31. GenericHail(NPC, Spawn)
  32. FaceTarget(NPC, Spawn)
  33. if not HasQuest(Spawn, Deer) and not HasCompletedQuest(Spawn, Deer) then
  34. conversation = CreateConversation()
  35. if GetLevel(Spawn)>=10 then
  36. AddConversationOption(conversation, "I happen to have some spare time.", "ICan")
  37. end
  38. if GetQuestStep(Spawn, Deer)==2 then
  39. AddConversationOption(conversation, "I did what you requested.", "DoneDeer")
  40. end
  41. AddConversationOption(conversation, "I don't have time, sorry.")
  42. StartConversation(conversation, NPC, Spawn, "So much evil ... I don't know which way to turn first. Perhaps you can help me?")
  43. PlayFlavor(NPC, "", "", "ponder", 0,0 , Spawn)
  44. elseif HasQuest(Spawn, Deer) then
  45. conversation = CreateConversation()
  46. AddConversationOption(conversation, "I'm still dealing with them.")
  47. StartConversation(conversation, NPC, Spawn, "Have you been able to reduce the deer population in Antonica like we discussed?")
  48. else
  49. GenericHail(NPC, Spawn)
  50. Say(NPC, "Hopefully nature's balance can be restored through our small actions.", Spawn)
  51. end
  52. end
  53. end
  54. function ICan(NPC, Spawn)
  55. FaceTarget(NPC, Spawn)
  56. conversation = CreateConversation()
  57. AddConversationOption(conversation, "What do you need done?", "DeerProb")
  58. AddConversationOption(conversation, "Seems like a silly matter. I must go.")
  59. StartConversation(conversation, NPC, Spawn, "One of my responsibilities is controlling the population of creatures in the area, and I'm barely keeping up! The glade deer population has grown out of control. Once their numbers rise, those deer are hard to manage!")
  60. PlayFlavor(NPC, "", "", "ponder", 0,0 , Spawn)
  61. end
  62. function DeerProb(NPC, Spawn)
  63. FaceTarget(NPC, Spawn)
  64. conversation = CreateConversation()
  65. AddConversationOption(conversation, "All right. I will take care of this for you.", "QuestStart")
  66. AddConversationOption(conversation, "That sounds trival. Goodbye.")
  67. StartConversation(conversation, NPC, Spawn, "Excellent. I'll split my usual take with you if you finish the job.")
  68. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  69. end
  70. function QuestStart (NPC, Spawn)
  71. FaceTarget(NPC, Spawn)
  72. OfferQuest(NPC, Spawn, Deer)
  73. end
  74. function DoneDeer (NPC, Spawn)
  75. FaceTarget(NPC, Spawn)
  76. conversation = CreateConversation()
  77. AddConversationOption(conversation, "I am glad to have played my part.", "QuestDone")
  78. StartConversation(conversation, NPC, Spawn, "Splendid! You did a good job. Thank you for your help!")
  79. PlayFlavor(NPC, "", "", "thank", 0,0 , Spawn)
  80. end
  81. function QuestDone(NPC, Spawn)
  82. SetStepComplete(Spawn, Deer, 2)
  83. end