OctaviaJovina.lua 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. --[[
  2. Script Name : SpawnScripts/BeggarsCourt/OctaviaJovina.lua
  3. Script Purpose : Octavia Jovina
  4. Script Author : Dorbin
  5. Script Date : 2022.07.18
  6. Script Notes : Auto-Generated Conversation from PacketParser Data
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  9. local TimeCheck = false -- used to delay between hail uses
  10. local CalloutTimeCheck = false -- used to delay between callout uses
  11. function spawn(NPC)
  12. waypoints(NPC)
  13. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function InRange(NPC, Spawn)
  19. if GetFactionAmount(Spawn,12) <0 then
  20. FaceTarget(NPC, Spawn)
  21. FactionChecking(NPC, Spawn, faction)
  22. else
  23. if MakeRandomInt(1, 100) <= 30 and CalloutTimeCheck == false then
  24. CalloutTimeCheck = true
  25. FaceTarget(NPC, Spawn)
  26. AddTimer(NPC,60000,"ResetCalloutTimer")
  27. Talk(NPC, Spawn)
  28. end
  29. end
  30. end
  31. function ResetTimer(NPC) -- resets hail timer after initial use
  32. TimeCheck = false
  33. end
  34. function ResetCalloutTimer(NPC) -- resets callout timer after use
  35. CalloutTimeCheck = false
  36. end
  37. function hailed(NPC, Spawn)
  38. if GetFactionAmount(Spawn,12) <0 then
  39. FaceTarget(NPC, Spawn)
  40. FactionChecking(NPC, Spawn, faction)
  41. else
  42. if TimeCheck == false then -- checks timer
  43. TimeCheck = true -- turns on timer to stop player spamming
  44. AddTimer(NPC,2500,"ResetTimer")
  45. FaceTarget(NPC, Spawn)
  46. Talk(NPC, Spawn)
  47. end
  48. end
  49. end
  50. function Talk(NPC, Spawn)
  51. local FP_FighterFaction = GetFactionAmount(Spawn, 102)
  52. if FP_FighterFaction >=10000 then
  53. local choice = MakeRandomInt(1, 3) --Adds faction praise callout 33% of the time when applicable.
  54. else
  55. local choice = MakeRandomInt(1, 2)
  56. if choice == 1 then
  57. BasicTalk(NPC,Spawn)
  58. elseif choice == 2 then
  59. BasicTalk(NPC,Spawn)
  60. elseif choice == 3 then
  61. FactionTalk(NPC,Spawn)
  62. end
  63. end
  64. end
  65. function BasicTalk(NPC,Spawn)
  66. local choice = MakeRandomInt(1, 5)
  67. if choice == 1 then
  68. PlayFlavor(NPC, "voiceover/english/human_eco_evil_freeportmilitia/ft/eco/evil/human_eco_evil_freeportmilitia_hail_gf_6509ed3d.mp3", "The Arcane Scientists are just a cowardly bunch that can't stand getting their hands dirty.", "", 1024489319, 2331992073, Spawn, 0)
  69. elseif choice == 2 then
  70. PlayFlavor(NPC, "voiceover/english/human_eco_evil_freeportmilitia/ft/eco/evil/human_eco_evil_freeportmilitia_hail_gf_f2eb775b.mp3", "There is no better collection of fearless warriors than the Freeport Militia.", "", 3315984902, 4037913760, Spawn, 0)
  71. elseif choice == 3 then
  72. PlayFlavor(NPC, "voiceover/english/human_eco_evil_freeportmilitia/ft/eco/evil/human_eco_evil_freeportmilitia_hail_gf_d59d3347.mp3", "The Seafury Buccaneers can't be trusted. They will turn on you when you least expect it.", "", 1280576093, 2130150895, Spawn, 0)
  73. elseif choice == 4 then
  74. PlayFlavor(NPC, "voiceover/english/human_eco_evil_freeportmilitia/ft/eco/evil/human_eco_evil_freeportmilitia_hail_gf_c9e6b7a9.mp3", "The priests of Dismal Rage are better at running from battle than leading one.", "", 2396198417, 3099644701, Spawn, 0)
  75. elseif choice == 5 then
  76. PlayFlavor(NPC, "voiceover/english/human_eco_evil_freeportmilitia/ft/eco/evil/human_eco_evil_freeportmilitia_hail_gf_2972d442.mp3", "What does a thief and a trader from Coalition of Tradesfolke have in common? They both will strip you of your coins.", "", 1516863043, 2498897125, Spawn, 0)
  77. end
  78. end
  79. function FactionTalk(NPC,Spawn)
  80. local FP_FighterFaction = GetFactionAmount(Spawn, 102)
  81. if FP_MageFaction >=40000 then
  82. FaceTarget(NPC, Spawn)
  83. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_40_gf_c38c736.mp3", "To aid the Freeport Militia is to weild the blade of The Overlord! Bravo!", "cheer", 0, 0, Spawn)
  84. elseif FP_MageFaction >=30000 then
  85. FaceTarget(NPC, Spawn)
  86. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_30_gf_130c3c71.mp3", "You have helped the Freeport Militia remain steadfast in these dark times.", "salute", 0, 0, Spawn)
  87. elseif FP_MageFaction >=20000 then
  88. FaceTarget(NPC, Spawn)
  89. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_20_gf_7b836853.mp3", "Your actions have assisted the Freeport Militia, but there is more you can do to tighten its grip!", "", 0, 0, Spawn)
  90. elseif FP_MageFaction >=10000 then
  91. FaceTarget(NPC, Spawn)
  92. PlayFlavor(NPC, "voiceover/english/human_eco_evil_freeportmilitia/ft/eco/evil/human_eco_evil_freeportmilitia_10_gf_1236a75.mp3", "The Freeport Militia demands unconditional obedience among its ranks.", "", 70786309, 2889649459, Spawn)
  93. end
  94. end
  95. function waypoints(NPC)
  96. MovementLoopAddLocation(NPC, 42.39, 3.5, 0.08, 2, 1)
  97. MovementLoopAddLocation(NPC, 42.39, 3.5, 0.08, 2, 15,"Action")
  98. MovementLoopAddLocation(NPC, 42.39, 3.5, 0.08, 2, 0)
  99. MovementLoopAddLocation(NPC, 40.65, 3.5, 0.51, 2, 0)
  100. MovementLoopAddLocation(NPC, 39.35, 3.5, -2.47, 2, 0)
  101. MovementLoopAddLocation(NPC, 37.65, 3.75, -4.75, 2, 0)
  102. MovementLoopAddLocation(NPC, 35.29, 5.25, -11.22, 2, 0)
  103. MovementLoopAddLocation(NPC, 33.69, 5.25, -17.74, 2, 1)
  104. MovementLoopAddLocation(NPC, 33.69, 5.25, -17.74, 2, 15,"Action")
  105. MovementLoopAddLocation(NPC, 34.46, 5.25, -16.87, 2, 0)
  106. MovementLoopAddLocation(NPC, 36.85, 5.25, -17.99, 2, 0)
  107. MovementLoopAddLocation(NPC, 37.56, 5.25, -18.94, 2, 0)
  108. MovementLoopAddLocation(NPC, 36.84, 5.25, -19.89, 2, 0)
  109. MovementLoopAddLocation(NPC, 34, 6.65, -21.18, 2, 0)
  110. MovementLoopAddLocation(NPC, 29.59, 9.12, -23.44, 2, 0)
  111. MovementLoopAddLocation(NPC, 26.83, 9.46, -24.65, 2, 1)
  112. MovementLoopAddLocation(NPC, 26.83, 9.46, -24.65, 2, 35,"Action")
  113. MovementLoopAddLocation(NPC, 26.83, 9.46, -24.65, 2, 0)
  114. MovementLoopAddLocation(NPC, 27.74, 9.46, -24.83, 2, 0)
  115. MovementLoopAddLocation(NPC, 31.31, 8.58, -24.29, 2, 0)
  116. MovementLoopAddLocation(NPC, 34.24, 6.93, -23.07, 2, 0)
  117. MovementLoopAddLocation(NPC, 38.8, 5.25, -20.4, 2, 0)
  118. MovementLoopAddLocation(NPC, 40.73, 5.25, -16.68, 2, 1)
  119. MovementLoopAddLocation(NPC, 40.73, 5.25, -16.68, 2, 15,"Action")
  120. MovementLoopAddLocation(NPC, 36.63, 5.25, -10.9, 2, 0)
  121. MovementLoopAddLocation(NPC, 35.68, 4.75, -7.51, 2, 0)
  122. MovementLoopAddLocation(NPC, 36.8, 3.5, -1.57, 2, 0)
  123. MovementLoopAddLocation(NPC, 37.17, 3.5, -0.14, 2, 1)
  124. MovementLoopAddLocation(NPC, 37.17, 3.5, -0.14, 2, 15,"Action")
  125. end
  126. function Action(NPC)
  127. local choice = MakeRandomInt(1, 4)
  128. if choice == 1 then
  129. PlayFlavor(NPC, "", "", "confused", 0, 0, Spawn)
  130. elseif choice == 2 then
  131. PlayFlavor(NPC, "", "", "ponder", 0, 0, Spawn)
  132. elseif choice == 3 then
  133. PlayFlavor(NPC, "", "", "sniff", 0, 0, Spawn)
  134. elseif choice == 4 then
  135. PlayFlavor(NPC, "", "", "tapfoot", 0, 0, Spawn)
  136. end
  137. end