CaptainPegrinos.lua 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. --[[
  2. Script Name : SpawnScripts/FermentedGrape/CaptainPegrinos.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.12.04 05:12:19
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/CombatModule"
  9. function spawn(NPC, Spawn)
  10. combatModule(NPC, Spawn)
  11. end
  12. local Quest = 5785
  13. local greetingsTable = { "voiceover/english/voice_emotes/greetings/greetings_1_1004.mp3",
  14. "voiceover/english/voice_emotes/greetings/greetings_2_1004.mp3",
  15. "voiceover/english/voice_emotes/greetings/greetings_3_1004.mp3"};
  16. function spawn(NPC)
  17. end
  18. function hailed(NPC, Spawn)
  19. PlayFlavor(NPC, greetingsTable[math.random(#greetingsTable)], "", "glare", 0, 0, Spawn)
  20. FaceTarget(NPC, Spawn)
  21. local conversation = CreateConversation()
  22. AddConversationOption(conversation, "Take it easy on her, it`s hard to perform!","Dialog1")
  23. StartConversation(conversation, NPC, Spawn, "Hey waddya want? Her performance is terrible and we`re gonna fix that...for good.")
  24. end
  25. function respawn(NPC)
  26. spawn(NPC)
  27. end
  28. function Dialog1(NPC, Spawn)
  29. FaceTarget(NPC, Spawn)
  30. PlayFlavor(NPC,"","","sniff",0,0,Spawn)
  31. local conversation = CreateConversation()
  32. AddConversationOption(conversation, "Don't be a fool! People come here to take it easy- not to get their face punched!","Attack1")
  33. AddConversationOption(conversation, "How do you expect her to get better if you hurt her now?","Dialog2")
  34. AddConversationOption(conversation, "Surely you and your lot have better things to do than attack a minstrel?","Dialog3")
  35. StartConversation(conversation, NPC, Spawn, "Now what should we be doing that? Her song was off-key, the lyrics were terrible, and I think one of me hearties ruptured an ear listenin` to her rot!")
  36. end
  37. function Attack1(NPC,Spawn)
  38. PlayFlavor(NPC,"","Did ya hear that boys? We've been called fools! Time to punch this one's face!","shakefist",0,0,Spawn)
  39. FaceTarget(NPC, Spawn)
  40. AddTimer(NPC,3000,"AttackFinal",1,Spawn)
  41. end
  42. function AttackFinal(NPC,Spawn)
  43. local zone = GetZone(NPC)
  44. local Pirate1 = GetSpawnByLocationID(zone, 133781037) --FIRSTMATE
  45. local Pirate2 = GetSpawnByLocationID(zone, 133781036) --CUTTER
  46. local Pirate3 = GetSpawnByLocationID(zone, 133781038)
  47. local Pirate4 = GetSpawnByLocationID(zone, 133781039)
  48. local Pirate5 = GetSpawnByLocationID(zone, 133781035)
  49. local Pirate6 = GetSpawnByLocationID(zone, 133781034)
  50. local Captain = GetSpawnByLocationID(zone, 133781033)
  51. Attack(Pirate1,Spawn)
  52. Attack(Pirate2,Spawn)
  53. Attack(Pirate3,Spawn)
  54. Attack(Pirate4,Spawn)
  55. Attack(Pirate5,Spawn)
  56. Attack(Pirate6,Spawn)
  57. Attack(Captain,Spawn)
  58. end
  59. function Dialog2(NPC, Spawn)
  60. FaceTarget(NPC, Spawn)
  61. PlayFlavor(NPC,"","","stare",0,0,Spawn)
  62. local conversation = CreateConversation()
  63. AddConversationOption(conversation, "Bully! That's what you are! A big gnoll-kissing meany! ","Boot")
  64. AddConversationOption(conversation, "But she`s just a poor, innocent bard!","Dialog2a")
  65. AddConversationOption(conversation, "How about you leave her alone and nobody gets hurt...","Attack2")
  66. StartConversation(conversation, NPC, Spawn, "Ya weak-bellied scoundrel! We`re not expectin`her to get better, that`s rather the point!")
  67. end
  68. function Attack2(NPC,Spawn)
  69. PlayFlavor(NPC,"","Nobody get's hurt except YOU that is! Haha! It's time, boys! Get'm!","chuckle",0,0,Spawn)
  70. FaceTarget(NPC, Spawn)
  71. AddTimer(NPC,3000,"AttackFinal",1,Spawn)
  72. PlaySound(Spawn,"sounds/e3_scripted/mage_ohh02.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  73. end
  74. function Dialog2a(NPC,Spawn)
  75. PlayFlavor(NPC,"","Àrrr! Ya went and made em run! It`s just up to me and my mates here now! Prepare yerself, ya angered the wrong captain!","grumble",0,0,Spawn)
  76. FaceTarget(NPC, Spawn)
  77. AddTimer(NPC,4500,"AttackFinal",1,Spawn)
  78. SendPopUpMessage(Spawn,"Some pirates disperse after your conversation with their captain.",250,250,250)
  79. PlaySound(NPC,"sounds/widgets/ecology_city_sounds/ecology_crowd_clap001.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  80. -- PlaySound(Spawn,"sounds/e3_scripted/mage_boo01.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  81. zone = GetZone(NPC)
  82. local Pirate3 = GetSpawnByLocationID(zone, 133781038)
  83. local Pirate4 = GetSpawnByLocationID(zone, 133781039)
  84. local Pirate5 = GetSpawnByLocationID(zone, 133781035)
  85. local Pirate6 = GetSpawnByLocationID(zone, 133781034)
  86. Despawn(Pirate3)
  87. Despawn(Pirate4)
  88. Despawn(Pirate5)
  89. Despawn(Pirate6)
  90. end
  91. function Boot(NPC,Spawn)
  92. FaceTarget(NPC, Spawn)
  93. local conversation = CreateConversation()
  94. AddConversationOption(conversation, "Wait...WAIT!")
  95. StartConversation(conversation, NPC, Spawn, "That's cute... I don't even got 'da heart to rough you up! Boys, carry this one out of here!")
  96. -- Dialog.New(NPC, Spawn)
  97. -- Dialog.AddDialog("That's cute... I don't even got 'da heart to rough you up! Boys, carry this one out of here!")
  98. PlayFlavor(NPC, "", "", "sigh", 0, 0, Spawn)
  99. -- Dialog.AddOption("Wait...WAIT!")
  100. -- Dialog.Start()
  101. SendPopUpMessage(Spawn,"The pirates have upi kicked out!",255,0,0)
  102. PlaySound(Spawn,"sounds/ui/ui_warning.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  103. PlaySound(Spawn,"sounds/e3_scripted/mage_boo01.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  104. AddTimer(NPC,3500,"Kick",1,Spawn)
  105. end
  106. function Kick(NPC,Spawn)
  107. SQ = GetZone("SouthQeynos")
  108. Zone(SQ,Spawn,582.89, -17.48, 255.57, 254)
  109. end
  110. function Dialog3(NPC, Spawn)
  111. FaceTarget(NPC, Spawn)
  112. PlayFlavor(NPC,"","","stare",0,0,Spawn)
  113. local conversation = CreateConversation()
  114. AddConversationOption(conversation, "But she`s just a poor, innocent bard!","Dialog2a")
  115. AddConversationOption(conversation, "You want to tumble? I've got your answer right here!","Attack3")
  116. AddConversationOption(conversation, "You're just a ... Drunder-headed bully!","Boot")
  117. StartConversation(conversation, NPC, Spawn, "'Tis our first landfall in months just to hear this dribble! Give me one reason I shouldn't bash some teeth in...")
  118. end
  119. function Attack3(NPC,Spawn)
  120. PlayFlavor(NPC,"","Let's gett'm boys! Bring me those teeth!","cutthroat",0,0,Spawn)
  121. FaceTarget(NPC, Spawn)
  122. AddTimer(NPC,3000,"AttackFinal",1,Spawn)
  123. PlaySound(Spawn,"sounds/e3_scripted/mage_ohh01.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  124. end
  125. function aggro(NPC,Spawn)
  126. local zone = GetZone(NPC)
  127. local Pirate1 = GetSpawnByLocationID(zone, 133781037) --FIRSTMATE
  128. local Pirate2 = GetSpawnByLocationID(zone, 133781036) --CUTTER
  129. local Pirate3 = GetSpawnByLocationID(zone, 133781038)
  130. local Pirate4 = GetSpawnByLocationID(zone, 133781039)
  131. local Pirate5 = GetSpawnByLocationID(zone, 133781035)
  132. local Pirate6 = GetSpawnByLocationID(zone, 133781034)
  133. local Captain = GetSpawnByLocationID(zone, 133781033)
  134. Attack(Pirate1,Spawn)
  135. Attack(Pirate2,Spawn)
  136. Attack(Pirate3,Spawn)
  137. Attack(Pirate4,Spawn)
  138. Attack(Pirate5,Spawn)
  139. Attack(Pirate6,Spawn)
  140. Attack(Captain,Spawn)
  141. end
  142. function death(NPC,Spawn)
  143. CloseConversation(NPC,Spawn)
  144. local zone = GetZone(NPC)
  145. local Pirate1 = GetSpawnByLocationID(zone, 133781037) --FIRSTMATE
  146. local Pirate2 = GetSpawnByLocationID(zone, 133781036) --CUTTER
  147. local Pirate3 = GetSpawnByLocationID(zone, 133781038)
  148. local Pirate4 = GetSpawnByLocationID(zone, 133781039)
  149. local Pirate5 = GetSpawnByLocationID(zone, 133781035)
  150. local Pirate6 = GetSpawnByLocationID(zone, 133781034)
  151. local Captain = GetSpawnByLocationID(zone, 133781033)
  152. local Bartender = GetSpawnByLocationID(zone, 133781031)
  153. local Bard = GetSpawnByLocationID(zone, 133781032)
  154. local Bobick = GetSpawnByLocationID(zone, 133781027)
  155. if not IsAlive(Pirate1) and not IsAlive(Pirate2) and not IsAlive(Pirate3) and not IsAlive(Pirate4) and not IsAlive(Pirate5) and not IsAlive(Pirate6) and not IsAlive(Captain) then
  156. if HasQuest(Spawn,5784) then
  157. SetStepComplete(Spawn,5784,1)
  158. end
  159. SpawnSet(Bartender,"name","a relieved bartender")
  160. SpawnSet(Bartender,"mood_state",0)
  161. SpawnSet(Bartender,"action_state",11214)
  162. SpawnSet(Bard,"name","a thankful bard")
  163. SpawnSet(Bard,"mood_state",11854)
  164. SpawnSet(Bard,"action_state",0)
  165. SpawnSet(Bobick,"action_state",11422)
  166. SpawnSet(Bobick,"name","a satisfied patron")
  167. end
  168. end