9
3

LeavetheIsleofRefuge.lua 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. --[[
  2. Script Name : SpawnScripts/IsleRefuge1/LeavetheIsleofRefuge.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.26 03:09:10
  5. Script Purpose :
  6. :
  7. --]]
  8. local BARBARIAN = 0
  9. local DARK_ELF = 1
  10. local DWARF = 2
  11. local ERUDITE = 3
  12. local FROGLOK = 4
  13. local GNOME = 5
  14. local HALF_ELF = 6
  15. local HALFLING = 7
  16. local HIGH_ELF = 8
  17. local HUMAN = 9
  18. local IKSAR = 10
  19. local KERRA = 11
  20. local OGRE = 12
  21. local RATONGA = 13
  22. local TROLL = 14
  23. local WOOD_ELF = 15
  24. local FAE = 16
  25. local ARASAI = 17
  26. local SARNAK = 18
  27. local VAMPIRE = 19
  28. local AERAKYN = 20
  29. function spawn(NPC)
  30. end
  31. function respawn(NPC)
  32. spawn(NPC)
  33. end
  34. function casted_on(NPC, Spawn, Message)
  35. if Message == "leave the isle" then
  36. if GetClass(Spawn)<0 then -- STILL NEED CLASS UPDATE
  37. PlaySound(Spawn,"sounds/objectsandparticlesounds/amb_marinersbell_001.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  38. SendPopUpMessage(Spawn,"Speak with Garven Tralk to advance your training.",200,200,200)
  39. SendMessage(Spawn,"Speak with Garven Tralk to advance your training before leaving the island.")
  40. elseif GetQuestStep(Spawn,5758)==1 or GetQuestStep(Spawn,5717)==1 then -- STILL NEED DUKE FERRIN UPDATE
  41. PlaySound(Spawn,"sounds/objectsandparticlesounds/amb_marinersbell_003.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  42. SendPopUpMessage(Spawn,"Speak with Duke Ferrin about securing a vessel off the island.",200,200,200)
  43. SendMessage(Spawn,"Speak with Duke Ferrin about securing a vessel off the island.")
  44. elseif GetQuestStep(Spawn,5758)==2 or HasCompletedQuest(Spawn, 5758) then --FREEPORT LEAVING
  45. PlaySound(Spawn,"sounds/objectsandparticlesounds/amb_marinersbell_002.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  46. if GetClientVersion(Spawn) <= 546 then
  47. local con = CreateConversation()
  48. AddConversationOption(con, "Leave for Freeport", "LeaveIslandFP")
  49. AddConversationOption(con, "Stay","CloseConversation")
  50. StartDialogConversation(con, 1, NPC, Spawn, "Are you sure you wish to leave the Isle of Refuge?\n\nLeave the Island - It is unlikely you will return, but you will continue to pursue greatness in Freeport.\n\n[All active Isle of Refuge quests will be removed!]")
  51. else
  52. window = CreateOptionWindow();
  53. AddOptionWindowOption(window, " Leave for Freeport", "Leave the Island - It is unlikely you will return, but you will continue to pursue greatness in Freeport. [All active Isle of Refuge quests will be removed!]", 0, 2297, "LeaveIslandFP")
  54. AddOptionWindowOption(window, " Stay", "Stay on the Island - Continue your adventures here and return to this bell when you are ready to leave.", 0, 2296, "Cancel")
  55. SendOptionWindow(window, Spawn, "Are you sure you wish to leave the Isle of Refuge?", "Cancel")
  56. end
  57. elseif GetQuestStep(Spawn,5717)==2 or HasCompletedQuest(Spawn, 5717) then --QEYNOS LEAVING
  58. PlaySound(Spawn,"sounds/objectsandparticlesounds/amb_marinersbell_002.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  59. if GetClientVersion(Spawn) <= 546 then
  60. local con = CreateConversation()
  61. AddConversationOption(con, "Leave for Qeynos", "LeaveIslandQ")
  62. AddConversationOption(con, "Stay","CloseConversation")
  63. StartDialogConversation(con, 1, NPC, Spawn, "Are you sure you wish to leave the Isle of Refuge?\n\nLeave the Island - It is unlikely you will return, but you will continue to pursue greatness in Qeynos.\n\n[All active Isle of Refuge quests will be removed!]")
  64. else
  65. window = CreateOptionWindow();
  66. AddOptionWindowOption(window, " Leave for Qeynos", "Leave the Island - It is unlikely you will return, but you will continue to pursue greatness in Qeynos. [All active Isle of Refuge quests will be removed!]", 0, 2297, "LeaveIslandQ")
  67. AddOptionWindowOption(window, " Stay", "Stay on the Island - Continue your adventures here and return to this bell when you are ready to leave.", 0, 2296, "Cancel")
  68. SendOptionWindow(window, Spawn, "Are you sure you wish to leave the Isle of Refuge?", "Cancel")
  69. end
  70. else -- STILL NEED ALIGNMENT QUEST
  71. PlaySound(Spawn,"sounds/objectsandparticlesounds/amb_marinersbell_001.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  72. SendPopUpMessage(Spawn,"Speak with an Ambassador if you are ready to leave the island.",200,200,200)
  73. SendMessage(Spawn,"Speak with an ambassador if you are ready to leave the island.")
  74. end
  75. end
  76. end
  77. function HumanQStarcrest(NPC,Spawn)
  78. PlaySound(Spawn,"sounds/objectsandparticlesounds/amb_marinersbell_005.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  79. ZoneRef = GetZone("Starcrest")
  80. Zone(ZoneRef,Spawn)
  81. end
  82. function HumanQNettleville(NPC,Spawn)
  83. PlaySound(Spawn,"sounds/objectsandparticlesounds/amb_marinersbell_005.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  84. ZoneRef = GetZone("Nettleville")
  85. Zone(ZoneRef,Spawn)
  86. end
  87. function LeaveIslandQ(NPC, Spawn)
  88. PlaySound(Spawn,"sounds/objectsandparticlesounds/amb_marinersbell_005.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  89. local Race = GetRace(Spawn)
  90. -- Kerra
  91. if Race == 11 or Race == 19 then
  92. -- AddSpellBookEntry(Spawn, 8057, 1)
  93. ZoneRef = GetZone("Nettleville")
  94. Zone(ZoneRef,Spawn)
  95. -- Erudite
  96. elseif Race == 3 or Race == 20 then
  97. -- AddSpellBookEntry(Spawn, 8057, 1)
  98. ZoneRef = GetZone("Starcrest")
  99. Zone(ZoneRef,Spawn)
  100. elseif Race == 9 then --Human
  101. if GetClientVersion(Spawn) <= 546 then
  102. local con = CreateConversation()
  103. AddConversationOption(con, "Nettleville Hovel", "HumanQNettleville")
  104. AddConversationOption(con, "Starcrest Commune", "HumanQStarcrest")
  105. AddConversationOption(con, "Tell me about these places", "Human2")
  106. AddConversationOption(con, "Stay","CloseConversation")
  107. StartDialogConversation(con, 1, NPC, Spawn, "Humans must select their next desitnation in Qeynos.")
  108. else
  109. window = CreateOptionWindow();
  110. AddOptionWindowOption(window, " Nettleville Hovel", "Depart for Nettleville - Home to the reserved Kerra and diverse Humans of Qeynos. It’s a busy district area with plenty of opportunties for adventure seekers and back-alley trade.", 2, 26, "HumanQNettleville")
  111. AddOptionWindowOption(window, " Starcrest Commune", "Depart for Starcrest - Starcrest is a grand political experiment implemented by the intellectual Erudites to serve as their home in Qeynos. Residents often frown on noise and distraction that might hinder their research, so be mindful of your activities. ", 2, 27, "HumanQStarcrest")
  112. AddOptionWindowOption(window, " Stay", "Stay on the Island. Continue your adventures here and return to this bell when you are ready to leave.", 0, 2296, "Cancel")
  113. SendOptionWindow(window, Spawn, "Humans Must Select Their Next Desitnation", "Cancel")
  114. end
  115. -- Barbarian / Dwarf
  116. elseif Race == 0 or Race == 2 then
  117. -- AddSpellBookEntry(Spawn, 8057, 1)
  118. ZoneRef = GetZone("Graystone")
  119. Zone(ZoneRef,Spawn)
  120. -- Froglok / High Elf
  121. elseif Race == 4 or Race == 8 then
  122. -- AddSpellBookEntry(Spawn, 8057, 1)
  123. ZoneRef = GetZone("Castleview")
  124. Zone(ZoneRef,Spawn)
  125. -- Half Elf / Wood Elf
  126. elseif Race == 6 or Race == 15 or Race == 16 then
  127. -- AddSpellBookEntry(Spawn, 8057, 1)
  128. ZoneRef = GetZone("Willowwood")
  129. Zone(ZoneRef,Spawn)
  130. -- Gnome / Halfling
  131. elseif Race == 5 or Race == 7 then
  132. -- AddSpellBookEntry(Spawn, 8057, 1)
  133. ZoneRef = GetZone("Baubbleshire")
  134. Zone(ZoneRef,Spawn)
  135. else
  136. SendMessage(Spawn,"There doesn't seem to be a boat available for you to Qeynos right now. [Report this!]")
  137. end
  138. end
  139. function Human2(NPC,Spawn)
  140. local con = CreateConversation()
  141. AddConversationOption(con, "Nettleville Hovel", "HumanQNettleville")
  142. AddConversationOption(con, "Starcrest Commune", "HumanQStarcrest")
  143. AddConversationOption(con, "Stay","CloseConversation")
  144. StartDialogConversation(con, 1, NPC, Spawn, "Nettlevilel Hovel:\n\nHome to the reserved Kerra and diverse Humans of Qeynos. It’s a busy district area with plenty of opportunties for adventure seekers and back-alley trade.\n\nStarcrest Commune:\n\nStarcrest is a grand political experiment implemented by the intellectual Erudites to serve as their home in Qeynos. Residents often frown on noise and distraction that might hinder their research, so be mindful of your activities.")
  145. end
  146. function LeaveIslandFP(NPC, Spawn)
  147. PlaySound(Spawn,"sounds/objectsandparticlesounds/amb_marinersbell_005.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  148. Race = GetRace(Spawn)
  149. -- Erudite / Kerra
  150. if Race == 3 or Race == 11 then
  151. -- AddSpellBookEntry(Spawn, 8057, 1)
  152. ZoneRef = GetZone("Stonestair")
  153. Zone(ZoneRef,Spawn)
  154. -- Ratonga / Gnome
  155. elseif Race == 5 or Race == 13 then
  156. -- AddSpellBookEntry(Spawn, 8057, 1)
  157. ZoneRef = GetZone("TempleSt")
  158. Zone(ZoneRef,Spawn)
  159. -- Human / Half Elf
  160. elseif Race == 9 or Race == 6 then
  161. -- AddSpellBookEntry(Spawn, 8057, 1)
  162. ZoneRef = GetZone("BeggarsCourt")
  163. Zone(ZoneRef,Spawn)
  164. -- Orge / Troll
  165. elseif Race == 12 or Race == 14 then
  166. -- AddSpellBookEntry(Spawn, 8057, 1)
  167. ZoneRef = GetZone("BigBend")
  168. Zone(ZoneRef,Spawn)
  169. -- Dark Elf
  170. elseif Race == 1 or Race == 19 or Race == 17 then
  171. -- AddSpellBookEntry(Spawn, 8057, 1)
  172. ZoneRef = GetZone("Longshadow")
  173. Zone(ZoneRef,Spawn)
  174. -- Barbarian / Iksar / Sarnak
  175. elseif Race == 0 or Race == 10 or Race == 18 then
  176. -- AddSpellBookEntry(Spawn, 8057, 1)
  177. ZoneRef = GetZone("ScaleYard")
  178. Zone(ZoneRef,Spawn)
  179. else
  180. -- AddSpellBookEntry(Spawn, 8057, 1)
  181. ZoneRef = GetZone("BeggarsCourt")
  182. Zone(ZoneRef,Spawn)
  183. end
  184. end