9
3

AlfredIronforge.lua 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. --[[
  2. Script Name : SpawnScripts/QeynosHarbor/AlfredIronforge.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.10.08 03:10:34
  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, 11) <0 then
  14. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  15. elseif GetTradeskillLevel(Spawn)==9 and GetTradeskillClass(Spawn)== 1 then
  16. PlayFlavor(NPC, "voiceover/english/alfred_ironforge/qey_harbor/100_trd_alfred_ironforge_callout_b5408196.mp3", "Please form a line to my left if you need to be certified.", "tapfoot", 3630438710, 674962613, Spawn)
  17. end
  18. end
  19. function hailed(NPC, Spawn)
  20. FaceTarget(NPC, Spawn)
  21. if GetFactionAmount(Spawn, 11) <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. elseif GetTradeskillClass(Spawn)<1 then
  30. NotSkilled(NPC,Spawn)
  31. end
  32. end
  33. function NotSkilled(NPC,Spawn)
  34. FaceTarget(NPC, Spawn)
  35. Dialog.New(NPC, Spawn)
  36. 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.")
  37. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1034.mp3", "", "hello", 0, 0, Spawn)
  38. Dialog.AddOption("Ok I will do.")
  39. Dialog.Start()
  40. end
  41. function AlreadySkilled(NPC,Spawn)
  42. FaceTarget(NPC, Spawn)
  43. Dialog.New(NPC, Spawn)
  44. Dialog.AddDialog("You're certified already friend.")
  45. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  46. Dialog.AddVoiceover("voiceover/english/alfred_ironforge/qey_harbor/alfred_ironforge001.mp3",2173353496, 3693694171)
  47. Dialog.AddOption("Oh yes I forgot.")
  48. Dialog.AddOption("Good to see you again, Alfred.")
  49. Dialog.Start()
  50. end
  51. function Dialog1(NPC, Spawn)
  52. FaceTarget(NPC, Spawn)
  53. Dialog.New(NPC, Spawn)
  54. Dialog.AddDialog("I'm glad you introduced yourself to The Ironforge Exchange. My name is Alfred Ironforge, and I can certify you in your chosen trade class. Before I begin your paperwork, I'll need your name and profession.")
  55. Dialog.AddVoiceover("voiceover/english/alfred_ironforge/qey_harbor/alfred_ironforge003.mp3", 3524215617, 3865129979)
  56. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  57. Dialog.AddOption("My name is "..GetName(Spawn)..", a Crafter.", "Crafter")
  58. Dialog.AddOption("My name is "..GetName(Spawn)..", an Outfitter.", "Outfitter")
  59. Dialog.AddOption("My name is "..GetName(Spawn)..", a Scholar", "Scholar")
  60. Dialog.Start()
  61. end
  62. --CRAFTSMAN
  63. function Crafter(NPC, Spawn)
  64. FaceTarget(NPC, Spawn)
  65. Dialog.New(NPC, Spawn)
  66. 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?")
  67. Dialog.AddVoiceover("voiceover/english/alfred_ironforge/qey_harbor/alfred_ironforge005.mp3",2473814327, 4225068215)
  68. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  69. Dialog.AddOption("Yes.", "CrafterYes1")
  70. Dialog.AddOption("On second thought, let me get back to you.")
  71. Dialog.Start()
  72. end
  73. function CrafterYes1(NPC, Spawn)
  74. window = CreateOptionWindow();
  75. 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, "CrafterYes2")
  76. 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")
  77. SendOptionWindow(window, Spawn, "Are you sure you wish to become a Craftsman?", "Cancel")
  78. end
  79. function CrafterYes2(NPC, Spawn)
  80. FaceTarget(NPC, Spawn)
  81. if GetTradeskillClass(Spawn)== 1 then
  82. SetTradeskillClass(Spawn,2)
  83. SendMessage(Spawn, "Congratulations! You have chosen the path of the Craftsman.","yellow")
  84. SendPopUpMessage(Spawn, "Congratulations! You have chosen the path of the Craftsman.",250,250,200)
  85. PlaySound(Spawn, "sounds/test/endquest.wav", GetX(Spawn), GetY(Spawn), GetZ(Spawn), Spawn)
  86. end
  87. FinalHail(NPC,Spawn)
  88. end
  89. --OUTFITTER
  90. function Outfitter(NPC, Spawn)
  91. FaceTarget(NPC, Spawn)
  92. Dialog.New(NPC, Spawn)
  93. 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?")
  94. Dialog.AddVoiceover("voiceover/english/alfred_ironforge/qey_harbor/alfred_ironforge004.mp3",1043864057, 3920328023)
  95. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  96. Dialog.AddOption("Yes.", "OutfitterYes1")
  97. Dialog.AddOption("On second thought, let me get back to you.")
  98. Dialog.Start()
  99. end
  100. function OutfitterYes1(NPC, Spawn)
  101. window = CreateOptionWindow();
  102. 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")
  103. 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")
  104. SendOptionWindow(window, Spawn, "Are you sure you wish to become a Outfitter?", "Cancel")
  105. end
  106. function OutfitterYes2(NPC, Spawn)
  107. FaceTarget(NPC, Spawn)
  108. if GetTradeskillClass(Spawn)== 1 then
  109. SetTradeskillClass(Spawn,6)
  110. SendMessage(Spawn, "Congratulations! You have chosen the path of the Outfitter.","yellow")
  111. SendPopUpMessage(Spawn, "Congratulations! You have chosen the path of the Outfitter.",250,250,200)
  112. PlaySound(Spawn, "sounds/test/endquest.wav", GetX(Spawn), GetY(Spawn), GetZ(Spawn), Spawn)
  113. end
  114. FinalHail(NPC,Spawn)
  115. end
  116. --SCHOLAR
  117. function Scholar(NPC, Spawn)
  118. FaceTarget(NPC, Spawn)
  119. Dialog.New(NPC, Spawn)
  120. 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?")
  121. Dialog.AddVoiceover("voiceover/english/alfred_ironforge/qey_harbor/alfred_ironforge006.mp3",2810852405, 855246268)
  122. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  123. Dialog.AddOption("Yes.", "ScholarYes1")
  124. Dialog.AddOption("On second thought, let me get back to you.")
  125. Dialog.Start()
  126. end
  127. function ScholarYes1(NPC, Spawn)
  128. window = CreateOptionWindow();
  129. 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")
  130. 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")
  131. SendOptionWindow(window, Spawn, "Are you sure you wish to become a Scholar?", "Cancel")
  132. end
  133. function ScholarYes2(NPC, Spawn)
  134. FaceTarget(NPC, Spawn)
  135. if GetTradeskillClass(Spawn)== 1 then
  136. SetTradeskillClass(Spawn,10)
  137. SendMessage(Spawn, "Congratulations! You have chosen the path of the Scholar.","yellow")
  138. SendPopUpMessage(Spawn, "Congratulations! You have chosen the path of the Scholar.",250,250,200)
  139. PlaySound(Spawn, "sounds/test/endquest.wav", GetX(Spawn), GetY(Spawn), GetZ(Spawn), Spawn)
  140. end
  141. FinalHail(NPC,Spawn)
  142. end
  143. function FinalHail(NPC,Spawn)
  144. 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.")
  145. Dialog.AddVoiceover("voiceover/english/alfred_ironforge/qey_harbor/alfred_ironforge008.mp3",3289915162, 765479278)
  146. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  147. Dialog.AddOption("Many thanks, friend.")
  148. Dialog.Start()
  149. ApplySpellVisual(Spawn, 324)
  150. end
  151. function respawn(NPC)
  152. spawn(NPC)
  153. end