AadalianFarenair.lua 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  9. dofile("SpawnScripts/Generic/UnknownLanguage.lua")
  10. local Sword = 5455
  11. function spawn(NPC)
  12. ProvidesQuest(NPC,Sword)
  13. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  14. waypoints(NPC)
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function InRange(NPC, Spawn)
  20. if GetFactionAmount(Spawn,11) <0 then
  21. FactionChecking(NPC, Spawn, faction)
  22. else
  23. if not HasLanguage(Spawn, 9) then
  24. if math.random(1, 100) <= 70 then
  25. Garbled(NPC, Spawn, Faction)
  26. --[[ local choice = math.random(1,2)
  27. if choice == 1 then
  28. PlayFlavor(NPC, "voiceover/english/highelf_base_1/ft/highelf/highelf_base_1_1_garbled_gm_755db2c3.mp3", "Castleview is beautiful this time of year.", "tap", 2766992983, 3224256482, Spawn, 9)
  29. elseif choice == 2 then
  30. PlayFlavor(NPC, "voiceover/english/highelf_base_1/ft/highelf/highelf_base_1_1_garbled_gm_d396c4fc.mp3", "Oh dont look at me that way. Speak my language!.", "", 3403333804, 3641522203, Spawn, 9)
  31. end]]--
  32. end
  33. elseif
  34. not HasCompletedQuest (Spawn, Sword) and not HasQuest (Spawn, Sword) then
  35. if math.random(1, 100) <= 70 then
  36. FaceTarget(NPC,Spawn)
  37. local choice = math.random(1,3)
  38. if choice == 1 then
  39. 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)
  40. elseif choice == 2 then
  41. 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)
  42. else
  43. PlayFlavor(NPC, "voiceover/english/aadalian_farenair/qey_village04/100_customer_aadalian_callout_357f6ef7.mp3", "Can you spare a moment?", "hello", 4143835238, 3043367579, Spawn)
  44. end
  45. elseif HasCompletedQuest (Spawn, Sword) and math.random(1, 100) <= 50 then
  46. PlayFlavor(NPC, "","", "tap", 0, 0, Spawn)
  47. end
  48. end
  49. end
  50. end
  51. function LeaveRange(NPC, Spawn)
  52. end
  53. function Action(NPC)
  54. local choice = MakeRandomInt(1, 4)
  55. if choice == 1 then
  56. PlayFlavor(NPC, "", "", "tap", 0, 0, Spawn)
  57. elseif choice == 2 then
  58. PlayFlavor(NPC, "", "", "ponder", 0, 0, Spawn)
  59. elseif choice == 3 then
  60. PlayFlavor(NPC, "", "", "sniff", 0, 0, Spawn)
  61. elseif choice == 4 then
  62. PlayFlavor(NPC, "", "", "tap", 0, 0, Spawn)
  63. end
  64. end
  65. function waypoints(NPC)
  66. MovementLoopAddLocation(NPC, 741.68, -13.69, -111.25, 2, 2,0)
  67. MovementLoopAddLocation(NPC, 741.68, -13.69, -111.25, 2, math.random(10, 15),"Action")
  68. MovementLoopAddLocation(NPC, 742.24, -13.83, -116.86, 2, math.random(10, 15),0)
  69. MovementLoopAddLocation(NPC, 738.53, -13.69, -123.61, 2, 2,0)
  70. MovementLoopAddLocation(NPC, 738.53, -13.69, -123.61, 2, math.random(10, 15),"Action")
  71. MovementLoopAddLocation(NPC, 747.38, -13.82, -123.27, 2, 2,0)
  72. MovementLoopAddLocation(NPC, 747.38, -13.82, -123.27, 2, math.random(10, 15),"Action")
  73. MovementLoopAddLocation(NPC, 753.18, -13.71, -121.28, 2, math.random(10, 15),0)
  74. MovementLoopAddLocation(NPC, 737.73, -13.67, -122.91, 2, 2,0)
  75. MovementLoopAddLocation(NPC, 737.73, -13.67, -122.91, 2, math.random(10, 15),"Action")
  76. MovementLoopAddLocation(NPC, 746.87, -13.88, -117.4, 2, 2,0)
  77. MovementLoopAddLocation(NPC, 746.87, -13.88, -117.4, 2, math.random(10, 15),"Action")
  78. end
  79. function QuestStart(NPC, Spawn, conversation)
  80. FaceTarget(NPC,Spawn)
  81. if not HasQuest (Spawn, Sword) then
  82. conversation = CreateConversation()
  83. PlayFlavor(NPC, "voiceover/english/aadalian_farenair/qey_village04/100_customer_aadalian_multhail2_b98a70c.mp3", "", "hello", 2059471651, 1229334005, Spawn)
  84. AddConversationOption(conversation, "What are you waiting for?", "Waitting")
  85. StartConversation(conversation, NPC, Spawn, "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.")
  86. elseif HasQuest (Spawn, Sword) then
  87. conversation = CreateConversation()
  88. if GetQuestStep(Spawn, Sword) == 2 then
  89. AddConversationOption(conversation, "Here is your sword. What do you think?", "SwordReturned")
  90. end
  91. AddConversationOption(conversation, "I'm heading there soon.")
  92. StartConversation(conversation, NPC, Spawn, "Have you heard from Froptub about my sword?")
  93. end
  94. end
  95. function Waitting(NPC, Spawn)
  96. PlayFlavor(NPC, "voiceover/english/aadalian_farenair/qey_village04/aadalianfarenair000.mp3","", "brandish", 2830176428, 3645028717, Spawn)
  97. FaceTarget(NPC,Spawn)
  98. conversation = CreateConversation()
  99. AddConversationOption(conversation, "What etching have you decided on?", "Decoration")
  100. AddConversationOption(conversation, "Fascinating, but I must be off.")
  101. StartConversation(conversation, NPC, Spawn, "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. ")
  102. end
  103. function Decoration(NPC, Spawn)
  104. PlayFlavor(NPC, "voiceover/english/aadalian_farenair/qey_village04/aadalianfarenair001.mp3","", "brandish", 1068773246, 2639950014, Spawn)
  105. FaceTarget(NPC,Spawn)
  106. conversation = CreateConversation()
  107. AddConversationOption(conversation, "I'll go speak with Froptub.", "Froptub")
  108. AddConversationOption(conversation, "Sorry, I'm busy.")
  109. StartConversation(conversation, NPC, Spawn, "My design is not mere decoration, friend. The inscription chronicals the cohabitation of our two races. Would you be kind, and see what is keeping the sword at Froptub's smithy? ")
  110. end
  111. function Froptub (NPC, Spawn)
  112. FaceTarget(NPC, Spawn)
  113. OfferQuest(NPC, Spawn, Sword)
  114. end
  115. function SwordReturned(NPC, Spawn)
  116. PlayFlavor(NPC, "voiceover/english/aadalian_farenair/qey_village04/aadalianfarenair002.mp3","", "brandish", 1199681985, 2816919734, Spawn)
  117. FaceTarget(NPC, Spawn)
  118. conversation = CreateConversation()
  119. AddConversationOption(conversation, "I'm glad I could assist.", "Payment")
  120. AddConversationOption(conversation, "As long as you're happy with it. Good luck.", "Payment")
  121. PlayFlavor(NPC, "","", "brandish", 0, 0, Spawn)
  122. StartConversation(conversation, NPC, Spawn, "Hmm, this inscription is far more rudimentary than I expected. Though, it does fit perfectly with what I imagined. Forever more, this blade shall bare the union of our races. May the story of this sword carry on for generations.")
  123. end
  124. function Payment(NPC, Spawn)
  125. SetStepComplete(Spawn, Sword, 2)
  126. end
  127. function hailed(NPC, Spawn)
  128. FaceTarget(NPC, Spawn)
  129. if GetFactionAmount(Spawn,11) <0 then
  130. FactionChecking(NPC, Spawn, faction)
  131. else
  132. if not HasLanguage(Spawn, 9) then -- Language Check for KoaDal (9)
  133. Garbled(NPC, Spawn, Faction)
  134. --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)
  135. else
  136. if not HasCompletedQuest(Spawn, Sword) then
  137. QuestStart(NPC, Spawn)
  138. elseif HasCompletedQuest (Spawn, Sword) then
  139. 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)
  140. end
  141. end
  142. end
  143. end