HelmsmanNyles.lua 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. --[[
  2. Script Name : SpawnScripts/FarJourneyFreeport/HelmsmanNyles.lua
  3. Script Author : Premierio015
  4. Script Date : 2022.04.30 05:04:27
  5. Script Purpose : Bypasses Boat/tutorial and Zones players to their cities/starting areas
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/SubClassToCommoner.lua")
  9. function spawn(NPC)
  10. end
  11. function hailed(NPC, Spawn)
  12. local conversation = CreateConversation()
  13. AddConversationOption(conversation, "Yes", "leave")
  14. AddConversationOption(conversation, "No")
  15. if GetClass(Spawn)>0 then
  16. AddConversationOption(conversation, " Wait, I'm just a commoner. [CLASSIC CLASS CHANGE TO COMMONER].","Commoner")
  17. end
  18. StartConversation(conversation, NPC, Spawn, " Head for land? [Leave The Far Journey?]")
  19. end
  20. function leave(NPC, Spawn)
  21. PlayFlavor(NPC, "", "The captain's gonna kill me for this...", "", 0, 0, Spawn, 0)
  22. if not HasItem(Spawn,185427) then -- GIVES THREADBARE TUNIC
  23. SummonItem(Spawn,185427,1,1)
  24. end
  25. if not HasItem(Spawn,20902) then -- GIVES SMALL BAG
  26. SummonItem(Spawn,20902,1,1)
  27. end
  28. if GetLevel(Spawn)<2 then --SET LEVEL TO 2
  29. SetPlayerLevel(Spawn,2)
  30. end
  31. if HasQuest(Spawn, 524)then -- COMPLETES REMAINING QUEST STEPS (Replace w/ quest removal once we figure that out)
  32. if GetQuestStep(Spawn,524)==1 then
  33. SetStepComplete(Spawn,524,1)
  34. SetStepComplete(Spawn,524,2)
  35. SetStepComplete(Spawn,524,3)
  36. SetStepComplete(Spawn,524,4)
  37. SetStepComplete(Spawn,524,5)
  38. SetStepComplete(Spawn,524,6)
  39. SetStepComplete(Spawn,524,7)
  40. SetStepComplete(Spawn,524,8)
  41. SetStepComplete(Spawn,524,9)
  42. SetStepComplete(Spawn,524,10)
  43. end
  44. if GetQuestStep(Spawn,524)==2 then
  45. SetStepComplete(Spawn,524,2)
  46. SetStepComplete(Spawn,524,3)
  47. SetStepComplete(Spawn,524,4)
  48. SetStepComplete(Spawn,524,5)
  49. SetStepComplete(Spawn,524,6)
  50. SetStepComplete(Spawn,524,7)
  51. SetStepComplete(Spawn,524,8)
  52. SetStepComplete(Spawn,524,9)
  53. SetStepComplete(Spawn,524,10)
  54. end
  55. if GetQuestStep(Spawn,524)==3 then
  56. SetStepComplete(Spawn,524,3)
  57. SetStepComplete(Spawn,524,4)
  58. SetStepComplete(Spawn,524,5)
  59. SetStepComplete(Spawn,524,6)
  60. SetStepComplete(Spawn,524,7)
  61. SetStepComplete(Spawn,524,8)
  62. SetStepComplete(Spawn,524,9)
  63. SetStepComplete(Spawn,524,10)
  64. end
  65. if GetQuestStep(Spawn,524)==4 then
  66. SetStepComplete(Spawn,524,4)
  67. SetStepComplete(Spawn,524,5)
  68. SetStepComplete(Spawn,524,6)
  69. SetStepComplete(Spawn,524,7)
  70. SetStepComplete(Spawn,524,8)
  71. SetStepComplete(Spawn,524,9)
  72. SetStepComplete(Spawn,524,10)
  73. end
  74. if GetQuestStep(Spawn,524)==5 then
  75. SetStepComplete(Spawn,524,5)
  76. SetStepComplete(Spawn,524,6)
  77. SetStepComplete(Spawn,524,7)
  78. SetStepComplete(Spawn,524,8)
  79. SetStepComplete(Spawn,524,9)
  80. SetStepComplete(Spawn,524,10)
  81. end
  82. if GetQuestStep(Spawn,524)==6 then
  83. SetStepComplete(Spawn,524,6)
  84. SetStepComplete(Spawn,524,7)
  85. SetStepComplete(Spawn,524,8)
  86. SetStepComplete(Spawn,524,9)
  87. SetStepComplete(Spawn,524,10)
  88. end
  89. if GetQuestStep(Spawn,524)==7 then
  90. SetStepComplete(Spawn,524,7)
  91. SetStepComplete(Spawn,524,8)
  92. SetStepComplete(Spawn,524,9)
  93. SetStepComplete(Spawn,524,10)
  94. end
  95. if GetQuestStep(Spawn,524)==8 then
  96. SetStepComplete(Spawn,524,8)
  97. SetStepComplete(Spawn,524,9)
  98. SetStepComplete(Spawn,524,10)
  99. end
  100. if GetQuestStep(Spawn,524)==9 then
  101. SetStepComplete(Spawn,524,9)
  102. SetStepComplete(Spawn,524,10)
  103. end
  104. if GetQuestStep(Spawn,524)==10 then
  105. SetStepComplete(Spawn,524,10)
  106. end
  107. end
  108. AddTimer(NPC,3000,"ToShore",1,Spawn)
  109. end
  110. function ToShore(NPC, Spawn)
  111. if HasItem(Spawn,9357) then --REMOVES Mariner's Charm
  112. RemoveItem(Spawn,9357,1)
  113. end
  114. if HasItem(Spawn,15354) then
  115. RemoveItem(Spawn,15354,1) --REMOVES Waulon's Hat
  116. end
  117. if HasItem(Spawn,12565) then --REMOVES Shard of Luclin
  118. RemoveItem(Spawn,12565,1)
  119. end
  120. if GetClass(Spawn) == 0 then
  121. ZoneRef = GetZone("IsleRefuge1")
  122. Zone(ZoneRef,Spawn)
  123. elseif GetDeity(Spawn) == 0 then
  124. ZoneRef = GetZone("OutpostOverlord")
  125. Zone(ZoneRef,Spawn)
  126. elseif GetDeity(Spawn) == 1 then
  127. ZoneRef = GetZone("QueensColony")
  128. Zone(ZoneRef,Spawn)
  129. end
  130. end
  131. function respawn(NPC)
  132. spawn(NPC)
  133. end
  134. function Commoner(NPC, Spawn)
  135. local conversation = CreateConversation()
  136. AddConversationOption(conversation, "Yes, I am a Commoner.", "Commoner2")
  137. AddConversationOption(conversation, "Nevermind.")
  138. StartConversation(conversation, NPC, Spawn, "Are you sure? This can't be undone. We'll take you to The Isle of Refuge if that is the case.")
  139. end
  140. function Commoner2(NPC, Spawn)
  141. PlayFlavor(NPC, "", "Well, so ya are. Let me help you with that.", "", 0, 0, Spawn, 0)
  142. RemoveGear(NPC,Spawn)
  143. SetAdventureClass(Spawn,0)
  144. SendMessage(Spawn, "You are now a Commoner.")
  145. SendPopUpMessage(Spawn, "You are now a Commoner.", 255, 255, 255)
  146. if GetTradeskillClass(Spawn)>0 then
  147. SetTradeskillClass(Spawn,0)
  148. end
  149. end