EireneithAlannia.lua 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. conversation = CreateConversation()
  34. if not HasQuest(Spawn, Deer) and not HasCompletedQuest(Spawn, Deer) then
  35. if GetLevel(Spawn)>=10 then
  36. AddConversationOption(conversation, "I happen to have some spare time.", "ICan")
  37. end
  38. AddConversationOption(conversation, "I don't have time, sorry.")
  39. StartConversation(conversation, NPC, Spawn, "So much evil ... I don't know which way to turn first. Perhaps you can help me?")
  40. PlayFlavor(NPC, "", "", "ponder", 0,0 , Spawn)
  41. elseif HasQuest(Spawn, Deer) then
  42. conversation = CreateConversation()
  43. if GetQuestStep(Spawn, Deer)==2 then
  44. AddConversationOption(conversation, "I did what you requested.", "DoneDeer")
  45. end
  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.")
  78. StartConversation(conversation, NPC, Spawn, "Splendid! You did a good job. Thank you for your help!")
  79. PlayFlavor(NPC, "", "", "thank", 0,0 , Spawn)
  80. SetStepComplete(Spawn, Deer, 2)
  81. end