9
3

HelmsmanNyles.lua 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. -- AddConversationOption(conversation, "Test Remove","Test")
  16. if GetClass(Spawn)>0 then
  17. AddConversationOption(conversation, "Wait, I'm just a commoner.\n\n[CLASSIC CLASS CHANGE TO COMMONER].","Commoner")
  18. end
  19. StartConversation(conversation, NPC, Spawn, "Head for land?\n[Leave The Far Journey?]")
  20. end
  21. function Test(NPC,Spawn)
  22. PlayFlavor(NPC, "", "Done", "", 0, 0, Spawn, 0)
  23. if HasQuest(Spawn, 524)then -- COMPLETES REMAINING QUEST STEPS (Replace w/ quest removal once we figure that out)
  24. RemovePlayerQuest(Spawn,524)
  25. end
  26. end
  27. function leave(NPC, Spawn)
  28. PlayFlavor(NPC, "", "The captain's gonna kill me for this...", "", 0, 0, Spawn, 0)
  29. if not HasItem(Spawn,185427) then -- GIVES THREADBARE TUNIC
  30. SummonItem(Spawn,185427,1,1)
  31. end
  32. if not HasItem(Spawn,20902) then -- GIVES SMALL BAG
  33. SummonItem(Spawn,20902,1,1)
  34. end
  35. if GetLevel(Spawn)<2 then --SET LEVEL TO 2
  36. SetPlayerLevel(Spawn,2)
  37. end
  38. if HasQuest(Spawn, 524)then -- COMPLETES REMAINING QUEST STEPS (Replace w/ quest removal once we figure that out)
  39. if GetQuestStep(Spawn,524)==1 then
  40. SetStepComplete(Spawn,524,1)
  41. SetStepComplete(Spawn,524,2)
  42. SetStepComplete(Spawn,524,3)
  43. SetStepComplete(Spawn,524,4)
  44. SetStepComplete(Spawn,524,5)
  45. SetStepComplete(Spawn,524,6)
  46. SetStepComplete(Spawn,524,7)
  47. SetStepComplete(Spawn,524,8)
  48. SetStepComplete(Spawn,524,9)
  49. SetStepComplete(Spawn,524,10)
  50. end
  51. if GetQuestStep(Spawn,524)==2 then
  52. SetStepComplete(Spawn,524,2)
  53. SetStepComplete(Spawn,524,3)
  54. SetStepComplete(Spawn,524,4)
  55. SetStepComplete(Spawn,524,5)
  56. SetStepComplete(Spawn,524,6)
  57. SetStepComplete(Spawn,524,7)
  58. SetStepComplete(Spawn,524,8)
  59. SetStepComplete(Spawn,524,9)
  60. SetStepComplete(Spawn,524,10)
  61. end
  62. if GetQuestStep(Spawn,524)==3 then
  63. SetStepComplete(Spawn,524,3)
  64. SetStepComplete(Spawn,524,4)
  65. SetStepComplete(Spawn,524,5)
  66. SetStepComplete(Spawn,524,6)
  67. SetStepComplete(Spawn,524,7)
  68. SetStepComplete(Spawn,524,8)
  69. SetStepComplete(Spawn,524,9)
  70. SetStepComplete(Spawn,524,10)
  71. end
  72. if GetQuestStep(Spawn,524)==4 then
  73. SetStepComplete(Spawn,524,4)
  74. SetStepComplete(Spawn,524,5)
  75. SetStepComplete(Spawn,524,6)
  76. SetStepComplete(Spawn,524,7)
  77. SetStepComplete(Spawn,524,8)
  78. SetStepComplete(Spawn,524,9)
  79. SetStepComplete(Spawn,524,10)
  80. end
  81. if GetQuestStep(Spawn,524)==5 then
  82. SetStepComplete(Spawn,524,5)
  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)==6 then
  90. SetStepComplete(Spawn,524,6)
  91. SetStepComplete(Spawn,524,7)
  92. SetStepComplete(Spawn,524,8)
  93. SetStepComplete(Spawn,524,9)
  94. SetStepComplete(Spawn,524,10)
  95. end
  96. if GetQuestStep(Spawn,524)==7 then
  97. SetStepComplete(Spawn,524,7)
  98. SetStepComplete(Spawn,524,8)
  99. SetStepComplete(Spawn,524,9)
  100. SetStepComplete(Spawn,524,10)
  101. end
  102. if GetQuestStep(Spawn,524)==8 then
  103. SetStepComplete(Spawn,524,8)
  104. SetStepComplete(Spawn,524,9)
  105. SetStepComplete(Spawn,524,10)
  106. end
  107. if GetQuestStep(Spawn,524)==9 then
  108. SetStepComplete(Spawn,524,9)
  109. SetStepComplete(Spawn,524,10)
  110. end
  111. if GetQuestStep(Spawn,524)==10 then
  112. SetStepComplete(Spawn,524,10)
  113. end
  114. end
  115. AddTimer(NPC,3300,"ToShore",1,Spawn)
  116. end
  117. function ToShore(NPC, Spawn)
  118. if HasItem(Spawn,9357) then --REMOVES Mariner's Charm
  119. RemoveItem(Spawn,9357,1)
  120. end
  121. if HasItem(Spawn,15354) then
  122. RemoveItem(Spawn,15354,1) --REMOVES Waulon's Hat
  123. end
  124. if HasItem(Spawn,12565) then --REMOVES Shard of Luclin
  125. RemoveItem(Spawn,12565,1)
  126. end
  127. if GetClass(Spawn) == 0 then
  128. ZoneRef = GetZone("IsleRefuge1")
  129. Zone(ZoneRef,Spawn)
  130. elseif GetDeity(Spawn) == 0 then
  131. ZoneRef = GetZone("OutpostOverlord")
  132. Zone(ZoneRef,Spawn)
  133. elseif GetDeity(Spawn) == 1 then
  134. ZoneRef = GetZone("QueensColony")
  135. Zone(ZoneRef,Spawn)
  136. end
  137. end
  138. function respawn(NPC)
  139. spawn(NPC)
  140. end
  141. function Commoner(NPC, Spawn)
  142. local conversation = CreateConversation()
  143. AddConversationOption(conversation, "Yes, I am a Commoner.", "Commoner2")
  144. AddConversationOption(conversation, "Nevermind.")
  145. 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.")
  146. end
  147. function Commoner2(NPC, Spawn)
  148. PlayFlavor(NPC, "", "Well, so ya are. Let me help you with that.", "", 0, 0, Spawn, 0)
  149. RemoveGear(NPC,Spawn)
  150. SetAdventureClass(Spawn,0)
  151. SendMessage(Spawn, "You are now a Commoner.")
  152. SendPopUpMessage(Spawn, "You are now a Commoner.", 255, 255, 255)
  153. if GetTradeskillClass(Spawn)>0 then
  154. SetTradeskillClass(Spawn,0)
  155. end
  156. end