LeavetheIsleofRefuge.lua 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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. window = CreateOptionWindow();
  47. 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")
  48. 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")
  49. SendOptionWindow(window, Spawn, "Are you sure you wish to leave the Isle of Refuge?", "Cancel")
  50. elseif GetQuestStep(Spawn,5717)==2 or HasCompletedQuest(Spawn, 5717) then --QEYNOS LEAVING
  51. PlaySound(Spawn,"sounds/objectsandparticlesounds/amb_marinersbell_002.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  52. window = CreateOptionWindow();
  53. 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")
  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. else -- STILL NEED ALIGNMENT QUEST
  57. PlaySound(Spawn,"sounds/objectsandparticlesounds/amb_marinersbell_001.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  58. SendPopUpMessage(Spawn,"Speak with an Ambassador if you are ready to leave the island.",200,200,200)
  59. SendMessage(Spawn,"Speak with an ambassador if you are ready to leave the island.")
  60. end
  61. end
  62. end
  63. function HumanQStarcrest(NPC,Spawn)
  64. PlaySound(Spawn,"sounds/objectsandparticlesounds/amb_marinersbell_005.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  65. ZoneRef = GetZone("Starcrest")
  66. Zone(ZoneRef,Spawn)
  67. end
  68. function HumanQNettleville(NPC,Spawn)
  69. PlaySound(Spawn,"sounds/objectsandparticlesounds/amb_marinersbell_005.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  70. ZoneRef = GetZone("Nettleville")
  71. Zone(ZoneRef,Spawn)
  72. end
  73. function LeaveIslandQ(NPC, Spawn)
  74. PlaySound(Spawn,"sounds/objectsandparticlesounds/amb_marinersbell_005.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  75. local Race = GetRace(Spawn)
  76. -- Kerra
  77. if Race == 11 then
  78. -- AddSpellBookEntry(Spawn, 8057, 1)
  79. ZoneRef = GetZone("Nettleville")
  80. Zone(ZoneRef,Spawn)
  81. -- Erudite
  82. elseif Race == 3 or Race == 20 then
  83. -- AddSpellBookEntry(Spawn, 8057, 1)
  84. ZoneRef = GetZone("Starcrest")
  85. Zone(ZoneRef,Spawn)
  86. elseif Race == 9 then --Human
  87. window = CreateOptionWindow();
  88. 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")
  89. 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")
  90. 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")
  91. SendOptionWindow(window, Spawn, "Humans Must Select Their Next Desitnation", "Cancel")
  92. -- Barbarian / Dwarf
  93. elseif Race == 0 or Race == 2 then
  94. -- AddSpellBookEntry(Spawn, 8057, 1)
  95. ZoneRef = GetZone("Graystone")
  96. Zone(ZoneRef,Spawn)
  97. -- Froglok / High Elf
  98. elseif Race == 4 or Race == 8 then
  99. -- AddSpellBookEntry(Spawn, 8057, 1)
  100. ZoneRef = GetZone("Castleview")
  101. Zone(ZoneRef,Spawn)
  102. -- Half Elf / Wood Elf
  103. elseif Race == 6 or Race == 15 then
  104. -- AddSpellBookEntry(Spawn, 8057, 1)
  105. ZoneRef = GetZone("Willowwood")
  106. Zone(ZoneRef,Spawn)
  107. -- Gnome / Halfling
  108. elseif Race == 5 or Race == 7 then
  109. -- AddSpellBookEntry(Spawn, 8057, 1)
  110. ZoneRef = GetZone("Baubbleshire")
  111. Zone(ZoneRef,Spawn)
  112. else
  113. SendMessage(Spawn,"There doesn't seem to be a boat available for you to Qeynos right now. [Report this!]")
  114. end
  115. end
  116. function LeaveIslandFP(NPC, Spawn)
  117. PlaySound(Spawn,"sounds/objectsandparticlesounds/amb_marinersbell_005.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  118. Race = GetRace(Spawn)
  119. -- Erudite / Kerra
  120. if Race == 3 or Race == 11 then
  121. -- AddSpellBookEntry(Spawn, 8057, 1)
  122. ZoneRef = GetZone("Stonestair")
  123. Zone(ZoneRef,Spawn)
  124. -- Ratonga / Gnome
  125. elseif Race == 5 or Race == 13 then
  126. -- AddSpellBookEntry(Spawn, 8057, 1)
  127. ZoneRef = GetZone("TempleSt")
  128. Zone(ZoneRef,Spawn)
  129. -- Human / Half Elf
  130. elseif Race == 9 or Race == 6 then
  131. -- AddSpellBookEntry(Spawn, 8057, 1)
  132. ZoneRef = GetZone("BeggarsCourt")
  133. Zone(ZoneRef,Spawn)
  134. -- Orge / Troll
  135. elseif Race == 12 or Race == 14 then
  136. -- AddSpellBookEntry(Spawn, 8057, 1)
  137. ZoneRef = GetZone("BigBend")
  138. Zone(ZoneRef,Spawn)
  139. -- Dark Elf
  140. elseif Race == 1 then
  141. -- AddSpellBookEntry(Spawn, 8057, 1)
  142. ZoneRef = GetZone("Longshadow")
  143. Zone(ZoneRef,Spawn)
  144. -- Barbarian / Iksar
  145. elseif Race == 0 or Race == 10 then
  146. -- AddSpellBookEntry(Spawn, 8057, 1)
  147. ZoneRef = GetZone("ScaleYard")
  148. Zone(ZoneRef,Spawn)
  149. else
  150. -- AddSpellBookEntry(Spawn, 8057, 1)
  151. ZoneRef = GetZone("EastFreeport")
  152. Zone(ZoneRef,Spawn)
  153. end
  154. end