9
3

AmbassadorSaera.lua 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. --[[
  2. Script Name : SpawnScripts/IsleRefuge1/AmbassadorSaera.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.08.30 03:08:04
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local BARBARIAN = 0
  10. local DARK_ELF = 1
  11. local DWARF = 2
  12. local ERUDITE = 3
  13. local FROGLOK = 4
  14. local GNOME = 5
  15. local HALF_ELF = 6
  16. local HALFLING = 7
  17. local HIGH_ELF = 8
  18. local HUMAN = 9
  19. local IKSAR = 10
  20. local KERRA = 11
  21. local OGRE = 12
  22. local RATONGA = 13
  23. local TROLL = 14
  24. local WOOD_ELF = 15
  25. local FAE = 16
  26. local ARASAI = 17
  27. local SARNAK = 18
  28. local VAMPIRE = 19
  29. local AERAKYN = 20
  30. local Qeynos = 5717
  31. function spawn(NPC)
  32. ProvidesQuest(NPC,Qeynos)
  33. end
  34. function respawn(NPC)
  35. spawn(NPC)
  36. end
  37. function hailed(NPC, Spawn)
  38. Dialog1(NPC, Spawn)
  39. end
  40. --You look lost refugee. All newcomers must first register with Garven Tralk at the beach.
  41. function Dialog1(NPC, Spawn)
  42. FaceTarget(NPC, Spawn)
  43. Dialog.New(NPC, Spawn)
  44. Dialog.AddDialog("I have been instructed to pass people of your... stature, to T'Kirr, the Ambassador of Freeport. I suggest that you go speak to him, as you will find Freeport a much more fitting environment for you to live in.")
  45. Dialog.AddVoiceover("voiceover/english/ambassador_saera/tutorial_island02/ambassadorsaera007.mp3", 2300745754, 3241256270)
  46. Dialog.AddOption("I don't believe I was speaking to you anyway...")
  47. Dialog.Start()
  48. end
  49. ------
  50. function hailed(NPC, Spawn)
  51. if GetClass(Spawn)>0 then
  52. if not HasQuest(Spawn,5758) and not HasQuest(Spawn,5717) and not HasCompletedQuest(Spawn,5758) and not HasCompletedQuest(Spawn,5717) and not HasItem(Spawn, 1413,1) and GetFactionAmount(Spawn,11) >=0 then
  53. if GetRace(Spawn) == BARBARIAN or GetRace(Spawn) == DWARF or GetRace(Spawn) == ERUDITE or GetRace(Spawn) ==GNOME or GetRace(Spawn) == HALF_ELF or GetRace(Spawn) == HUMAN or GetRace(Spawn) == FROGLOK or GetRace(Spawn) == KERRA or GetRace(Spawn) == HIGH_ELF or GetRace(Spawn) == HALFLING or GetRace(Spawn) == WOOD_ELF or GetRace(Spawn) == FAE or GetRace(Spawn) == VAMPIRE or GetRace(Spawn) == AERAKYN then
  54. Dialog1(NPC, Spawn)
  55. else
  56. NotRace(NPC, Spawn)
  57. end
  58. elseif HasQuest(Spawn,5717) or HasCompletedQuest(Spawn,5717) then
  59. DialogDone(NPC,Spawn)
  60. else
  61. NotRace(NPC, Spawn) --Completed FP Quest or Has FP Quest
  62. end
  63. else
  64. PlayFlavor(NPC, "voiceover/english/highelf_eco_good_1/ft/highelf/highelf_eco_good_1_hail_gf_869cb34a.mp3", "Hello, young adventurer. It is with the utmost delight that I greet you.", "curtsey", 1236739692, 2465236460, Spawn) --COMMONER RESPONSE
  65. end
  66. end
  67. function NotRace(NPC, Spawn)
  68. FaceTarget(NPC, Spawn)
  69. Dialog.New(NPC, Spawn)
  70. Dialog.AddDialog("I have been instructed to pass people of your... stature, to T'Kirr, the Ambassador of Freeport. I suggest that you go speak to him, as you will find Freeport a much more fitting environment for you to live in.")
  71. Dialog.AddVoiceover("voiceover/english/ambassador_saera/tutorial_island02/ambassadorsaera007.mp3", 2300745754, 3241256270)
  72. PlayFlavor(NPC,"","","sniff",0,0,Spawn)
  73. Dialog.AddOption("I don't believe I was speaking to you anyway...")
  74. Dialog.Start()
  75. end
  76. function Dialog1(NPC, Spawn)
  77. FaceTarget(NPC, Spawn)
  78. Dialog.New(NPC, Spawn)
  79. Dialog.AddDialog("I hope you've received a proper welcome to the isles. My name is Saera. I am a Qeynos ambassador and I am here to inform new refugees of our fine city. Do you wish to learn more about Qeynos?")
  80. Dialog.AddVoiceover("voiceover/english/ambassador_saera/tutorial_island02/ambassadorsaera001.mp3", 741146966, 2481777374)
  81. PlayFlavor(NPC,"","","royalwave",0,0,Spawn)
  82. Dialog.AddOption("Yes, I do. Could you tell me of it?", "Dialog2")
  83. Dialog.AddOption("I must be distracted. I meant to talk to Ambassador T'Kirr.")
  84. Dialog.Start()
  85. end
  86. function Dialog2(NPC, Spawn)
  87. FaceTarget(NPC, Spawn)
  88. Dialog.New(NPC, Spawn)
  89. Dialog.AddDialog("Ahh yes, Qeynos. Our city stands as a shining beacon of light in this ever-darkening world and our leader, Queen Antonia Bayle is the fire that inspires us all.")
  90. Dialog.AddVoiceover("voiceover/english/ambassador_saera/tutorial_island02/ambassadorsaera002.mp3", 2077728306, 53108566)
  91. PlayFlavor(NPC,"","","orate",0,0,Spawn)
  92. Dialog.AddOption("[Continue]", "Dialog2a")
  93. Dialog.Start()
  94. end
  95. function Dialog2a(NPC, Spawn)
  96. FaceTarget(NPC, Spawn)
  97. Dialog.New(NPC, Spawn)
  98. Dialog.AddDialog("Through the hearts and souls of every Qeynosian citizen, and the tireless devotion of our Queen, our city prospers during these trying times. Meanwhile, the city of Freeport sadly suffers due to its leader's thirst for war and conquest.")
  99. Dialog.AddVoiceover("voiceover/english/ambassador_saera/tutorial_island02/ambassadorsaera003.mp3", 3391430062, 794106337)
  100. Dialog.AddOption("[Continue]", "Dialog3")
  101. Dialog.AddOption("I've heard enough. I have much to consider.")
  102. Dialog.Start()
  103. end
  104. function Dialog3(NPC, Spawn)
  105. FaceTarget(NPC, Spawn)
  106. Dialog.New(NPC, Spawn)
  107. Dialog.AddDialog("We welcome new citizens of Qeynos with open arms. Our safe city walls offer many opportunities for starting a new life. Together we can rebuild Norrath.")
  108. PlayFlavor(NPC,"","","agree",0,0,Spawn)
  109. Dialog.AddVoiceover("voiceover/english/ambassador_saera/tutorial_island02/ambassadorsaera004.mp3", 436329400, 1699103452)
  110. Dialog.AddOption("[Continue]", "Dialog4")
  111. Dialog.Start()
  112. end
  113. function Dialog4(NPC, Spawn)
  114. FaceTarget(NPC, Spawn)
  115. Dialog.New(NPC, Spawn)
  116. Dialog.AddDialog("We are honored you wish to be a citizen of Qeynos. You would be an asset to our society, but before you decide, please choose wisely. Once I approve your transaction with the Far Seas Trading Company, I cannot rescind your request for citizenship.")
  117. Dialog.AddVoiceover("voiceover/english/ambassador_saera/tutorial_island02/ambassadorsaera005.mp3", 324262694, 747800831)
  118. Dialog.AddOption("I would like to join Qeynos.", "Dialog5")
  119. Dialog.AddOption("Let me consider all of this first.")
  120. Dialog.Start()
  121. end
  122. function Dialog5(NPC, Spawn)
  123. if GetClientVersion(Spawn) <= 546 then
  124. local con = CreateConversation()
  125. if GetClass(Spawn)==1 then
  126. AddConversationOption(con, ""..GetName(Spawn).." the Fighter", "Dialog6")
  127. elseif GetClass(Spawn)==11 then
  128. AddConversationOption(con, ""..GetName(Spawn).." the Priest", "Dialog6")
  129. elseif GetClass(Spawn)==21 then
  130. AddConversationOption(con, ""..GetName(Spawn).." the Mage", "Dialog6")
  131. elseif GetClass(Spawn)==31 then
  132. AddConversationOption(con, ""..GetName(Spawn).." the Scout", "Dialog6")
  133. else
  134. AddConversationOption(con, ""..GetName(Spawn).."", "Dialog6")
  135. end
  136. AddConversationOption(con, "On second thought, I need to reconsider.","CloseConversation")
  137. StartDialogConversation(con, 1, NPC, Spawn, "OFFICIAL QEYNOS DOCUMENTATION:\n-----------------------------------------\nI \""..GetName(Spawn).."\" pledge myself to \nthe City of Qeynos and its ruler,\nQueen Antonia Bayle. \n\nI will strive to uphold its ideals of honor and goodwill for all citizens of Qeynos.\n\nSigned,")
  138. else
  139. window = CreateOptionWindow();
  140. AddOptionWindowOption(window, " Pledge allegiance to Qeynos", "Dedicate yourself to the City of Qeynos and to its leader, Queen Antonia Bayle. [This decision is final!]", 2, 16, "Dialog6")
  141. AddOptionWindowOption(window, " Reconsider", "Rescind your request. Return to Ambassador Saera if you decide Qeynos is right for you.", 2, 13, "Sigh")
  142. SendOptionWindow(window, Spawn, "Pledge allegiance to Qeynos?", "Cancel")
  143. end
  144. end
  145. function Dialog6(NPC, Spawn)
  146. OfferQuest(NPC,Spawn,Qeynos)
  147. FaceTarget(NPC,Spawn)
  148. CloseConversation(NPC,Spawn)
  149. end
  150. function Sigh(NPC, Spawn)
  151. PlayFlavor(NPC,"","","sniff",0,0,Spawn)
  152. FaceTarget(NPC,Spawn)
  153. end
  154. function DialogDone(NPC,Spawn)
  155. FaceTarget(NPC, Spawn)
  156. Dialog.New(NPC, Spawn)
  157. Dialog.AddDialog("We cannot thank you enough for choosing to assist Qeynos. If your travels on our island are an indication of your talents, I know you will do well for yourself, adventurer.")
  158. Dialog.AddVoiceover("voiceover/english/ambassador_saera/tutorial_island02/ambassadorsaera008.mp3", 2202868294,1256407446)
  159. PlayFlavor(NPC,"","","bow",0,0,Spawn)
  160. Dialog.AddOption("Thank you for the compliment.")
  161. Dialog.Start()
  162. end