AadalianFarenair.lua 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. --[[
  2. Script Name : SpawnScripts/Castleview/AadalianFarenair.lua
  3. Script Purpose : Aadalian Farenair
  4. Script Author : Dorbin
  5. Script Date : 2022.01.25
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  10. dofile("SpawnScripts/Generic/UnknownLanguage.lua")
  11. local Sword = 5455
  12. function spawn(NPC)
  13. ProvidesQuest(NPC,Sword)
  14. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  15. waypoints(NPC)
  16. end
  17. function respawn(NPC)
  18. spawn(NPC)
  19. end
  20. function InRange(NPC, Spawn)
  21. if GetFactionAmount(Spawn,11) <0 then
  22. FactionChecking(NPC, Spawn, faction)
  23. else
  24. if not HasLanguage(Spawn, 9) then
  25. if math.random(1, 100) <= 70 then
  26. Garbled(NPC, Spawn, Faction)
  27. end
  28. elseif
  29. not HasCompletedQuest (Spawn, Sword) and not HasQuest (Spawn, Sword) then
  30. if math.random(1, 100) <= 70 then
  31. FaceTarget(NPC,Spawn)
  32. local choice = math.random(1,3)
  33. if choice == 1 then
  34. PlayFlavor(NPC, "voiceover/english/aadalian_farenair/qey_village04/100_customer_aadalian_multhail1_489c1202.mp3", "Ah, a busy adventurer like you has no time to run errands. Farewell!", "tap", 1714607542, 3679115405, Spawn)
  35. elseif choice == 2 then
  36. PlayFlavor(NPC, "voiceover/english/aadalian_farenair/qey_village04/100_customer_aadalian_multhail2_b98a70c.mp3", "Well met! I am Aadalian, son of Ethralin. Welcome to Castleview! I'm sorry I can't show you more of our village, for I am in wait.", "hello", 2059471651, 1229334005, Spawn)
  37. else
  38. PlayFlavor(NPC, "voiceover/english/aadalian_farenair/qey_village04/100_customer_aadalian_callout_357f6ef7.mp3", "Can you spare a moment?", "hello", 4143835238, 3043367579, Spawn)
  39. end
  40. elseif HasCompletedQuest (Spawn, Sword) and MakeRandomInt(1, 100) <= 60 then
  41. PlayFlavor(NPC, "","", "hello", 0, 0, Spawn)
  42. FaceTarget(NPC,Spawn)
  43. end
  44. end
  45. end
  46. end
  47. function LeaveRange(NPC, Spawn)
  48. end
  49. function Action(NPC)
  50. local choice = MakeRandomInt(1, 4)
  51. if choice == 1 then
  52. PlayFlavor(NPC, "", "", "tap", 0, 0, Spawn)
  53. elseif choice == 2 then
  54. PlayFlavor(NPC, "", "", "ponder", 0, 0, Spawn)
  55. elseif choice == 3 then
  56. PlayFlavor(NPC, "", "", "sniff", 0, 0, Spawn)
  57. elseif choice == 4 then
  58. PlayFlavor(NPC, "", "", "tap", 0, 0, Spawn)
  59. end
  60. end
  61. function waypoints(NPC)
  62. MovementLoopAddLocation(NPC, 741.68, -13.69, -111.25, 2, 2,0)
  63. MovementLoopAddLocation(NPC, 741.68, -13.69, -111.25, 2, math.random(10, 15),"Action")
  64. MovementLoopAddLocation(NPC, 742.24, -13.83, -116.86, 2, math.random(10, 15),0)
  65. MovementLoopAddLocation(NPC, 738.53, -13.69, -123.61, 2, 2,0)
  66. MovementLoopAddLocation(NPC, 738.53, -13.69, -123.61, 2, math.random(10, 15),"Action")
  67. MovementLoopAddLocation(NPC, 747.38, -13.82, -123.27, 2, 2,0)
  68. MovementLoopAddLocation(NPC, 747.38, -13.82, -123.27, 2, math.random(10, 15),"Action")
  69. MovementLoopAddLocation(NPC, 753.18, -13.71, -121.28, 2, math.random(10, 15),0)
  70. MovementLoopAddLocation(NPC, 737.73, -13.67, -122.91, 2, 2,0)
  71. MovementLoopAddLocation(NPC, 737.73, -13.67, -122.91, 2, math.random(10, 15),"Action")
  72. MovementLoopAddLocation(NPC, 746.87, -13.88, -117.4, 2, 2,0)
  73. MovementLoopAddLocation(NPC, 746.87, -13.88, -117.4, 2, math.random(10, 15),"Action")
  74. end
  75. function QuestStart(NPC, Spawn, conversation)
  76. FaceTarget(NPC, Spawn)
  77. Dialog.New(NPC, Spawn)
  78. Dialog.AddDialog("Well met! I am Aadalian, son of Ethralin. Welcome to Castleview! I'm sorry I do not have the time to show you more of our village, for I am in wait.")
  79. Dialog.AddVoiceover("voiceover/english/aadalian_farenair/qey_village04/100_customer_aadalian_multhail2_b98a70c.mp3",2059471651, 1229334005)
  80. PlayFlavor(NPC, "", "", "hello", 0,0 , Spawn)
  81. if not HasQuest (Spawn, Sword) and not HasCompletedQuest(Spawn,Sword)then
  82. Dialog.AddOption("What are you waiting for?", "Waitting")
  83. end
  84. if HasQuest (Spawn, Sword) and GetQuestStep(Spawn, Sword) == 2 then
  85. Dialog.AddOption("I've returned with the sword.", "SwordReturned")
  86. end
  87. Dialog.AddOption("Greetings Aadalian.")
  88. Dialog.Start()
  89. end
  90. function Waitting(NPC, Spawn)
  91. FaceTarget(NPC, Spawn)
  92. Dialog.New(NPC, Spawn)
  93. Dialog.AddDialog("I wait for my sword. You see, I've asked Froptub to etch an inscription along the blade. For generations each elf in my family has placed a unique mark along his blade. Now I must follow this tradition.")
  94. Dialog.AddVoiceover("voiceover/english/aadalian_farenair/qey_village04/aadalianfarenair000.mp3",2830176428, 3645028717)
  95. PlayFlavor(NPC, "", "", "shrug", 0,0 , Spawn)
  96. Dialog.AddOption("I'd thought frogloks weren't much for ornamentation.", "Froptub")
  97. Dialog.AddOption("Fascinating, but I must be off.")
  98. Dialog.Start()
  99. end
  100. function Froptub (NPC, Spawn)
  101. FaceTarget(NPC, Spawn)
  102. OfferQuest(NPC, Spawn, Sword)
  103. end
  104. function SwordReturned(NPC, Spawn)
  105. SetEquipment(NPC, 0, 2258 , 255, 255, 255, 255, 255, 255) --Examines Sword
  106. SetStepComplete(Spawn, Sword, 2)
  107. FaceTarget(NPC, Spawn)
  108. Dialog.New(NPC, Spawn)
  109. Dialog.AddDialog("Hmmm ... this inscription is far more rudimentary than I expected ... Though it does fit perfectly with what I imagined. Forevermore this blade shall bear the union of our races. May the story of this sword carry on for generations!")
  110. Dialog.AddVoiceover("voiceover/english/aadalian_farenair/qey_village04/aadalianfarenair002.mp3",1199681985, 2816919734)
  111. PlayFlavor(NPC, "", "", "brandish", 0,0 , Spawn)
  112. Dialog.AddOption("I'm sure Froptub would be happy to hear that.")
  113. Dialog.AddOption("As long as you're happy with it. Good luck.")
  114. Dialog.Start()
  115. AddTimer(NPC,8500,"HideSword")
  116. end
  117. function HideSword (NPC)
  118. SetEquipment(NPC, 0, 0 , 255, 255, 255, 255, 255, 255) --Hides Sword
  119. end
  120. function hailed(NPC, Spawn)
  121. FaceTarget(NPC, Spawn)
  122. if GetFactionAmount(Spawn,11) <0 then
  123. FactionChecking(NPC, Spawn, faction)
  124. else
  125. if not HasLanguage(Spawn, 9) then -- Language Check for KoaDal (9)
  126. Garbled(NPC, Spawn, Faction)
  127. --PlayFlavor(NPC, "voiceover/english/highelf_base_1/ft/highelf/highelf_base_1_1_garbled_gm_755db2c3.mp3", "Castleview is beautiful this time of year.", "", 2766992983, 3224256482, Spawn, 9)
  128. else
  129. if not HasCompletedQuest(Spawn, Sword) then
  130. QuestStart(NPC, Spawn)
  131. elseif HasCompletedQuest (Spawn, Sword) then
  132. PlayFlavor(NPC, "voiceover/english/aadalian_farenair/qey_village04/aadalianfarenair.mp3", "Well met! I am Aadalian, son of Ethralin. Welcome to Castleview! I'm sorry I can't show you more of our village, for I am in wait.", "", 2296905326, 696379844, Spawn)
  133. end
  134. end
  135. end
  136. end