EireneithAlannia.lua 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. SetInfoStructString(NPC, "action_state", "tapfoot")
  16. end
  17. function respawn(NPC)
  18. end
  19. function InRange(NPC, Spawn) --Quest Callout
  20. if GetFactionAmount(Spawn,11) <0 then
  21. FactionChecking(NPC, Spawn, faction)
  22. else
  23. if math.random(1, 100) <= 60 and GetLevel(Spawn) >=10 then
  24. PlayFlavor(NPC, "", "So much evil ... I don't know which way to turn first.", "ponder", 0, 0, Spawn)
  25. end
  26. end
  27. end
  28. function hailed(NPC, Spawn)
  29. if GetFactionAmount(Spawn,11) <0 then
  30. FactionChecking(NPC, Spawn, faction)
  31. else
  32. GenericHail(NPC, Spawn)
  33. FaceTarget(NPC, Spawn)
  34. conversation = CreateConversation()
  35. if not HasQuest(Spawn, Deer) and not HasCompletedQuest(Spawn, Deer) then
  36. if GetLevel(Spawn)>=10 then
  37. AddConversationOption(conversation, "I happen to have some spare time.", "ICan")
  38. end
  39. AddConversationOption(conversation, "I don't have time, sorry.")
  40. StartConversation(conversation, NPC, Spawn, "So much evil ... I don't know which way to turn first. Perhaps you can help me?")
  41. PlayFlavor(NPC, "", "", "ponder", 0,0 , Spawn)
  42. elseif HasQuest(Spawn, Deer) then
  43. conversation = CreateConversation()
  44. if GetQuestStep(Spawn, Deer)==2 then
  45. AddConversationOption(conversation, "I did what you requested.", "DoneDeer")
  46. end
  47. AddConversationOption(conversation, "I'm still dealing with them.")
  48. StartConversation(conversation, NPC, Spawn, "Have you been able to reduce the deer population in Antonica like we discussed?")
  49. else
  50. GenericHail(NPC, Spawn)
  51. Say(NPC, "Hopefully nature's balance can be restored through our small actions.", Spawn)
  52. end
  53. end
  54. end
  55. function ICan(NPC, Spawn)
  56. FaceTarget(NPC, Spawn)
  57. conversation = CreateConversation()
  58. AddConversationOption(conversation, "What do you need done?", "DeerProb")
  59. AddConversationOption(conversation, "Seems like a silly matter. I must go.")
  60. 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!")
  61. PlayFlavor(NPC, "", "", "ponder", 0,0 , Spawn)
  62. end
  63. function DeerProb(NPC, Spawn)
  64. FaceTarget(NPC, Spawn)
  65. conversation = CreateConversation()
  66. AddConversationOption(conversation, "All right. I will take care of this for you.", "QuestStart")
  67. AddConversationOption(conversation, "That sounds trival. Goodbye.")
  68. StartConversation(conversation, NPC, Spawn, "Excellent. I'll split my usual take with you if you finish the job.")
  69. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  70. end
  71. function QuestStart (NPC, Spawn)
  72. FaceTarget(NPC, Spawn)
  73. OfferQuest(NPC, Spawn, Deer)
  74. end
  75. function DoneDeer (NPC, Spawn)
  76. FaceTarget(NPC, Spawn)
  77. conversation = CreateConversation()
  78. AddConversationOption(conversation, "I am glad to have played my part.")
  79. StartConversation(conversation, NPC, Spawn, "Splendid! You did a good job. Thank you for your help!")
  80. PlayFlavor(NPC, "", "", "thank", 0,0 , Spawn)
  81. SetStepComplete(Spawn, Deer, 2)
  82. end