CordiusSejanius.lua 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. --[[
  2. Script Name : SpawnScripts/BeggarsCourt/CordiusSejanius.lua
  3. Script Purpose : Cordius Sejanius
  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. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  12. SetTempVariable(NPC,"CalloutTimeCheck","false") -- used to delay between callout uses
  13. end
  14. function InRange(NPC, Spawn)
  15. if GetFactionAmount(Spawn,12) <0 then
  16. FaceTarget(NPC, Spawn)
  17. FactionChecking(NPC, Spawn, faction)
  18. else
  19. if GetTempVariable(NPC,"CalloutTimeCheck") == "false" then
  20. SetTempVariable(NPC,"CalloutTimeCheck","true") -- used to delay between callout uses
  21. AddTimer(NPC,25000,"ResetCalloutTimer")
  22. if MakeRandomInt(1,2)==1 then
  23. FaceTarget(NPC, Spawn)
  24. Talk(NPC, Spawn)
  25. else
  26. zone = GetZone(NPC)
  27. Other = GetSpawnByLocationID(zone,402980)
  28. OtherTalk(Other,Spawn)
  29. end
  30. end
  31. end
  32. end
  33. function ResetTimer(NPC) -- resets hail timer after initial use
  34. TimeCheck = false
  35. end
  36. function ResetCalloutTimer(NPC) -- resets callout timer after use
  37. SetTempVariable(NPC,"CalloutTimeCheck","false")
  38. end
  39. function respawn(NPC)
  40. spawn(NPC)
  41. end
  42. function hailed(NPC, Spawn)
  43. if GetFactionAmount(Spawn,12) <0 then
  44. FaceTarget(NPC, Spawn)
  45. FactionChecking(NPC, Spawn, faction)
  46. else
  47. if TimeCheck == false then -- checks timer
  48. TimeCheck = true -- turns on timer to stop player spamming
  49. AddTimer(NPC,2500,"ResetTimer")
  50. FaceTarget(NPC, Spawn)
  51. Talk(NPC, Spawn)
  52. end
  53. end
  54. end
  55. function Talk(NPC, Spawn)
  56. local FP_PriestFaction = GetFactionAmount(Spawn, 105 )
  57. if FP_PriestFaction >=10000 then
  58. local choice = MakeRandomInt(1, 3) --Adds faction praise callout 33% of the time when applicable.
  59. else
  60. local choice = MakeRandomInt(1, 2)
  61. if choice == 1 then
  62. BasicTalk(NPC,Spawn)
  63. elseif choice == 2 then
  64. BasicTalk(NPC,Spawn)
  65. elseif choice == 3 then
  66. FactionTalk(NPC,Spawn)
  67. end
  68. end
  69. end
  70. function BasicTalk(NPC,Spawn)
  71. local choice = MakeRandomInt(1, 5)
  72. if choice == 1 then
  73. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_dismalrage/ft/eco/evil/darkelf_female_eco_evil_dismalrage_hail_gf_b9254acf.mp3", "The words preached by the Dismal Rage bring spiritual enlightenment to the weak.", "", 116806204, 1893451787, Spawn, 0)
  74. elseif choice == 2 then
  75. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_dismalrage/ft/eco/evil/darkelf_female_eco_evil_dismalrage_hail_gf_f7ca6051.mp3", "I find it vile that our great city has entrusted its protection to a group of degenerates such as the Freeport Militia.", "", 1175835727, 2628271838, Spawn, 0)
  76. elseif choice == 3 then
  77. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_dismalrage/ft/eco/evil/darkelf_female_eco_evil_dismalrage_hail_gf_5a9793ef.mp3", "The Coalition of Tradesfolke aren't capable of serving anyone other than to serve its own greed.", "", 3353210602, 2809554948, Spawn)
  78. elseif choice == 4 then
  79. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_dismalrage/ft/eco/evil/darkelf_female_eco_evil_dismalrage_hail_gf_7abc3066.mp3", "Too often the Arcane Scientists at the academy dedicate themselves to useless knowledge that is of no use to our city.", "", 1261386119, 1368644822, Spawn)
  80. elseif choice == 5 then
  81. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_dismalrage/ft/eco/evil/darkelf_female_eco_evil_dismalrage_hail_gf_7d78cf9d.mp3", "The weak souls of the Seafury Buccaneers only cry, running to a priest when facing certain death.", "", 683812929, 1852419614, Spawn)
  82. end
  83. end
  84. function FactionTalk(NPC,Spawn)
  85. local FP_PriestFaction = GetFactionAmount(Spawn, 105 )
  86. if FP_PriestFaction >=40000 then
  87. FaceTarget(NPC, Spawn)
  88. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_40_gf_c38c736.mp3", "To aid the Dismal Rage is to worship the One True God for power that binds us to this realm!", "cheer", 0, 0, Spawn)
  89. elseif FP_PriestFaction >=30000 then
  90. FaceTarget(NPC, Spawn)
  91. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_dismalrage/ft/eco/evil/darkelf_female_eco_evil_dismalrage_30_gf_350ac522.mp3", "To realize your full potential you must drive all empathy and pity from your heart.", "", 2475957665, 3294345346, Spawn, 0)
  92. elseif FP_PriestFaction >=20000 then
  93. FaceTarget(NPC, Spawn)
  94. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_20_gf_7b836853.mp3", "The ritualistic power of Dismal Rage is what gives spiritual strength to us all.", "", 0, 0, Spawn)
  95. elseif FP_PriestFaction >=10000 then
  96. FaceTarget(NPC, Spawn)
  97. PlayFlavor(NPC, "voiceover/english/darkelf_eco_evil_dismalrage/ft/eco/evil/darkelf_female_eco_evil_dismalrage_10_gf_1a36b724.mp3", "You must learn to release the chaos and destruction of your power.", "", 1739074440, 1700879521, Spawn)
  98. end
  99. end
  100. function OtherTalk(Other, Spawn)
  101. local FP_MageFaction = GetFactionAmount(Spawn, 104)
  102. if FP_MageFaction >=10000 then
  103. local choice = MakeRandomInt(1, 3) --Adds faction praise callout 33% of the time when applicable.
  104. else
  105. local choice = MakeRandomInt(1, 2)
  106. if choice == 1 then
  107. OtherBasicTalk(Other,Spawn)
  108. elseif choice == 2 then
  109. OtherBasicTalk(Other,Spawn)
  110. elseif choice == 3 then
  111. OtherFactionTalk(Other,Spawn)
  112. end
  113. end
  114. end
  115. function OtherBasicTalk(Other,Spawn)
  116. local choice = MakeRandomInt(1, 5)
  117. if choice == 1 then
  118. PlayFlavor(Other, "voiceover/english/human_eco_evil_arcanescientists/ft/eco/evil/human_male_eco_evil_arcanescientists_hail_gm_d4cf5e3d.mp3", "The Dismal Rage is an evil entity that can destroy your soul.", "", 561192192, 3579530691, Spawn, 0)
  119. elseif choice == 2 then
  120. PlayFlavor(Other, "voiceover/english/human_eco_evil_arcanescientists/ft/eco/evil/human_male_eco_evil_arcanescientists_hail_gm_52cf3660.mp3", "The Seafuries are just a bunch of mindless sea dwellers.", "", 2052685278, 167982355, Spawn, 0)
  121. elseif choice == 3 then
  122. PlayFlavor(Other, "voiceover/english/human_eco_evil_arcanescientists/ft/eco/evil/human_male_eco_evil_arcanescientists_hail_gm_6727c950.mp3", "The minds at the Academy of Arcane Science are infinite.", "", 137200926, 848953238, Spawn, 0)
  123. elseif choice == 4 then
  124. PlayFlavor(Other, "voiceover/english/human_eco_evil_arcanescientists/ft/eco/evil/human_male_eco_evil_arcanescientists_hail_gm_43509cc2.mp3", "The Freeport Militia is only as competent as their ability to swing a longsword.", "", 1079669242, 1377863119, Spawn, 0)
  125. elseif choice == 5 then
  126. PlayFlavor(Other, "voiceover/english/human_eco_evil_arcanescientists/ft/eco/evil/human_male_eco_evil_arcanescientists_hail_gm_85a84d51.mp3", "The members within the Coalition of Tradefolke are nothing more than common thieves that empty your pockets before your eyes.", "", 1941815786, 1528387739, Spawn, 0)
  127. end
  128. end
  129. function OtherFactionTalk(Other,Spawn)
  130. local FP_MageFaction = GetFactionAmount(Spawn, 104)
  131. if FP_MageFaction >=40000 then
  132. FaceTarget(Other, Spawn)
  133. PlayFlavor(Other, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_40_gf_c38c736.mp3", "To aid the Academy of Arcane Science is to unleash the force for power that burns within us all!", "cheer", 0, 0, Spawn)
  134. elseif FP_MageFaction >=30000 then
  135. FaceTarget(Other, Spawn)
  136. PlayFlavor(Other, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_30_gf_130c3c71.mp3", "You have helped the Academy of Arcane Science rise in power and brought some invaluable assets within these walls.", "thank", 0, 0, Spawn)
  137. elseif FP_MageFaction >=20000 then
  138. FaceTarget(Other, Spawn)
  139. PlayFlavor(Other, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_20_gf_7b836853.mp3", "Your actions have assisted the Academy of Arcane Science in its quest for all knowledge!", "", 0, 0, Spawn)
  140. elseif FP_MageFaction >=10000 then
  141. FaceTarget(Other, Spawn)
  142. PlayFlavor(Other, "voiceover/english/darkelf_eco_evil_arcanescientists/ft/eco/evil/darkelf_female_eco_evil_arcanescientists_10_gf_5547196e.mp3", "Your actions have done well for the Academy of Arcane Science, but there is always more to know.", "nod", 0, 0, Spawn)
  143. end
  144. end