AletheaAugustine.lua 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. --[[
  2. Script Name : SpawnScripts/WestFreeport/AletheaAugustine.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.10.08 05:10:29
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 12, "InRange", "LeaveRange")
  11. end
  12. function InRange(NPC,Spawn)
  13. if GetFactionAmount(Spawn, 12) <0 then
  14. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  15. elseif GetTradeskillLevel(Spawn)==9 and GetTradeskillClass(Spawn)== 1 then
  16. PlayFlavor(NPC, "", "Please form a line to my left if you need to be certified.", "tapfoot", 0, 0, Spawn)
  17. end
  18. end
  19. function hailed(NPC, Spawn)
  20. FaceTarget(NPC, Spawn)
  21. if GetFactionAmount(Spawn, 12) <0 then
  22. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  23. elseif GetTradeskillLevel(Spawn)<9 and GetTradeskillClass(Spawn)== 1 then
  24. NotSkilled(NPC,Spawn)
  25. elseif GetTradeskillLevel(Spawn)==9 and GetTradeskillClass(Spawn)== 1 then
  26. Dialog1(NPC,Spawn)
  27. elseif GetTradeskillClass(Spawn)>1 then
  28. AlreadySkilled(NPC,Spawn)
  29. end
  30. end
  31. function NotSkilled(NPC,Spawn)
  32. FaceTarget(NPC, Spawn)
  33. Dialog.New(NPC, Spawn)
  34. Dialog.AddDialog("Hello, friend. You're not skilled enough to receive certification in a tradesman specialty. Practice your skills and return to me after you gain more experience.")
  35. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1033.mp3", "", "hello", 0, 0, Spawn)
  36. Dialog.AddOption("Ok I will do.")
  37. Dialog.Start()
  38. end
  39. function AlreadySkilled(NPC,Spawn)
  40. FaceTarget(NPC, Spawn)
  41. Dialog.New(NPC, Spawn)
  42. Dialog.AddDialog("You're certified already friend.")
  43. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  44. Dialog.AddVoiceover("voiceover/english/alethea_augustine/fprt_west/alethea_augustine001.mp3", 462001478, 657343064)
  45. Dialog.AddOption("Oh yes I forgot.")
  46. Dialog.AddOption("Just saying hello!")
  47. Dialog.Start()
  48. end
  49. function Dialog1(NPC, Spawn)
  50. FaceTarget(NPC, Spawn)
  51. Dialog.New(NPC, Spawn)
  52. Dialog.AddDialog("I'm glad you introduced yourself to The Coalition of Tradesfolke. My name is Alethea Augustine, and I can certify you in your chosen trade class. Before I begin your paperwork, I'll need your name and profession.")
  53. Dialog.AddVoiceover("voiceover/english/alethea_augustine/fprt_west/alethea_augustine003.mp3", 1834765729, 1721020886)
  54. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  55. Dialog.AddOption("My name is "..GetName(Spawn)..", a Crafter.", "Crafter")
  56. Dialog.AddOption("My name is "..GetName(Spawn)..", an Outfitter.", "Outfitter")
  57. Dialog.AddOption("My name is "..GetName(Spawn)..", a Scholar", "Scholar")
  58. Dialog.Start()
  59. end
  60. --CRAFTSMAN
  61. function Crafter(NPC, Spawn)
  62. FaceTarget(NPC, Spawn)
  63. Dialog.New(NPC, Spawn)
  64. Dialog.AddDialog("A craftsman, eh? We could always use another craftsman in the city. I want to make sure we are on the same page. A craftsman makes food, drink, furniture, staves, bows, shields, arrows, and instruments. You wanna be certified to make these goods, correct?")
  65. Dialog.AddVoiceover("voiceover/english/alethea_augustine/fprt_west/alethea_augustine005.mp3", 1977611715, 1233493093)
  66. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  67. Dialog.AddOption("Yes.", "CarpenterYes1")
  68. Dialog.AddOption("On second thought, let me get back to you.")
  69. Dialog.Start()
  70. end
  71. function CarpenterYes1(NPC, Spawn)
  72. window = CreateOptionWindow();
  73. AddOptionWindowOption(window, " Become a Crafstman", "Become proficient in the arts of a Craftsman. You will learn to craft food, drink, furniture, staves, bows, shields, arrows, and instruments in this profession. [This can not be undone!]", 0, 26, "CarpenterYes2")
  74. AddOptionWindowOption(window, " Reconsider", "Stay an Artisan. You will not advance beyond tradeskill level 9. Return to Alfred Ironforge when you've made your decission.", 2, 13, "Cancel")
  75. SendOptionWindow(window, Spawn, "Are you sure you wish to become a Craftsman?", "Cancel")
  76. end
  77. function CarpenterYes2(NPC, Spawn)
  78. FaceTarget(NPC, Spawn)
  79. if GetTradeskillClass(Spawn)== 1 then
  80. SetTradeskillClass(Spawn,2)
  81. SendMessage(Spawn, "Congratulations! You have chosen the path of the Craftsman.","yellow")
  82. SendPopUpMessage(Spawn, "Congratulations! You have chosen the path of the Craftsman.",250,250,200)
  83. PlaySound(Spawn, "sounds/test/endquest.wav", GetX(Spawn), GetY(Spawn), GetZ(Spawn), Spawn)
  84. end
  85. FinalHail(NPC,Spawn)
  86. end
  87. --OUTFITTER
  88. function Outfitter(NPC, Spawn)
  89. FaceTarget(NPC, Spawn)
  90. Dialog.New(NPC, Spawn)
  91. Dialog.AddDialog("An outfitter, eh? We could always use another outfitter in the city. I want to make sure we're on the same page. As an outfitter, you delight in making weapons, plate armor, chain armor, cloth armor, and leather armor. You want certification to make these goods, correct?")
  92. Dialog.AddVoiceover("voiceover/english/alethea_augustine/fprt_west/alethea_augustine004.mp3", 1977611715, 1233493093)
  93. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  94. Dialog.AddOption("Yes.", "OutfitterYes1")
  95. Dialog.AddOption("On second thought, let me get back to you.")
  96. Dialog.Start()
  97. end
  98. function OutfitterYes1(NPC, Spawn)
  99. window = CreateOptionWindow();
  100. AddOptionWindowOption(window, " Become a Outfitter", "Become proficient in the arts of an Outfitter. You will learn to craft weapons and armor for all classes in this profession. [This can not be undone!]", 0, 32, "OutfitterYes2")
  101. AddOptionWindowOption(window, " Reconsider", "Stay an Artisan. You will not advance beyond tradeskill level 9. Return to Alfred Ironforge when you've made your decission.", 2, 13, "Cancel")
  102. SendOptionWindow(window, Spawn, "Are you sure you wish to become a Outfitter?", "Cancel")
  103. end
  104. function OutfitterYes2(NPC, Spawn)
  105. FaceTarget(NPC, Spawn)
  106. if GetTradeskillClass(Spawn)== 1 then
  107. SetTradeskillClass(Spawn,6)
  108. SendMessage(Spawn, "Congratulations! You have chosen the path of the Outfitter.","yellow")
  109. SendPopUpMessage(Spawn, "Congratulations! You have chosen the path of the Outfitter.",250,250,200)
  110. PlaySound(Spawn, "sounds/test/endquest.wav", GetX(Spawn), GetY(Spawn), GetZ(Spawn), Spawn)
  111. end
  112. FinalHail(NPC,Spawn)
  113. end
  114. --SCHOLAR
  115. function Scholar(NPC, Spawn)
  116. FaceTarget(NPC, Spawn)
  117. Dialog.New(NPC, Spawn)
  118. Dialog.AddDialog("A scholar, eh? We could always use another scholar in the city. I want to make sure we are on the same page. A scholar makes spell scrolls, combat scrolls, potions, poisons, and jewelry. You wanna be certified to make these goods, correct?")
  119. Dialog.AddVoiceover("voiceover/english/alethea_augustine/fprt_west/alethea_augustine006.mp3", 1977611715, 1233493093)
  120. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  121. Dialog.AddOption("Yes.", "ScholarYes1")
  122. Dialog.AddOption("On second thought, let me get back to you.")
  123. Dialog.Start()
  124. end
  125. function ScholarYes1(NPC, Spawn)
  126. window = CreateOptionWindow();
  127. AddOptionWindowOption(window, " Become a Scholar", "Become proficient in the arts of a Scholar. You will learn to craft spell scrolls, combat scrolls, potions, poisons, and jewelry in this profession. [This can not be undone!]", 0, 3807, "ScholarYes2")
  128. AddOptionWindowOption(window, " Reconsider", "Stay an Artisan. You will not advance beyond tradeskill level 9. Return to Alfred Ironforge when you've made your decission.", 2, 13, "Cancel")
  129. SendOptionWindow(window, Spawn, "Are you sure you wish to become a Scholar?", "Cancel")
  130. end
  131. function ScholarYes2(NPC, Spawn)
  132. FaceTarget(NPC, Spawn)
  133. if GetTradeskillClass(Spawn)== 1 then
  134. SetTradeskillClass(Spawn,10)
  135. SendMessage(Spawn, "Congratulations! You have chosen the path of the Scholar.","yellow")
  136. SendPopUpMessage(Spawn, "Congratulations! You have chosen the path of the Scholar.",250,250,200)
  137. PlaySound(Spawn, "sounds/test/endquest.wav", GetX(Spawn), GetY(Spawn), GetZ(Spawn), Spawn)
  138. end
  139. FinalHail(NPC,Spawn)
  140. end
  141. function FinalHail(NPC,Spawn)
  142. Dialog.AddDialog("Okay. You're certified in your chosen tradesman class. I'm glad I could serve you. We always need skilled tradesman in the city.")
  143. Dialog.AddVoiceover("voiceover/english/alethea_augustine/fprt_west/alethea_augustine008.mp3", 1879179238, 3019465921)
  144. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  145. Dialog.AddOption("Many thanks, friend.")
  146. Dialog.Start()
  147. end
  148. function respawn(NPC)
  149. spawn(NPC)
  150. end