NilniarUrsus.lua 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. --[[
  2. Script Name : SpawnScripts/BeggarsCourt/NilniarUrsus.lua
  3. Script Purpose : Nilniar Ursus
  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. -- SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  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 MakeRandomInt(1, 100) <= 30 and CalloutTimeCheck == false then
  20. CalloutTimeCheck = true
  21. FaceTarget(NPC, Spawn)
  22. AddTimer(NPC,25000,"ResetCalloutTimer")
  23. Talk(NPC, Spawn)
  24. end
  25. end
  26. end
  27. function ResetTimer(NPC) -- resets hail timer after initial use
  28. TimeCheck = false
  29. end
  30. function ResetCalloutTimer(NPC) -- resets callout timer after use
  31. CalloutTimeCheck = false
  32. end
  33. function respawn(NPC)
  34. spawn(NPC)
  35. end
  36. function hailed(NPC, Spawn)
  37. if GetFactionAmount(Spawn,12) <0 then
  38. FaceTarget(NPC, Spawn)
  39. FactionChecking(NPC, Spawn, faction)
  40. else
  41. if TimeCheck == false then -- checks timer
  42. TimeCheck = true -- turns on timer to stop player spamming
  43. AddTimer(NPC,2500,"ResetTimer")
  44. FaceTarget(NPC, Spawn)
  45. Talk(NPC, Spawn)
  46. end
  47. end
  48. end
  49. function Talk(NPC, Spawn)
  50. local FP_MageFaction = GetFactionAmount(Spawn, 104)
  51. if FP_MageFaction >=10000 then
  52. local choice = MakeRandomInt(1, 3) --Adds faction praise callout 33% of the time when applicable.
  53. else
  54. local choice = MakeRandomInt(1, 2)
  55. if choice == 1 then
  56. BasicTalk(NPC,Spawn)
  57. elseif choice == 2 then
  58. BasicTalk(NPC,Spawn)
  59. elseif choice == 3 then
  60. FactionTalk(NPC,Spawn)
  61. end
  62. end
  63. end
  64. function BasicTalk(NPC,Spawn)
  65. local choice = MakeRandomInt(1, 5)
  66. if choice == 1 then
  67. PlayFlavor(NPC, "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)
  68. elseif choice == 2 then
  69. PlayFlavor(NPC, "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)
  70. elseif choice == 3 then
  71. PlayFlavor(NPC, "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)
  72. elseif choice == 4 then
  73. PlayFlavor(NPC, "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)
  74. elseif choice == 5 then
  75. PlayFlavor(NPC, "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)
  76. end
  77. end
  78. function FactionTalk(NPC,Spawn)
  79. local FP_MageFaction = GetFactionAmount(Spawn, 104)
  80. if FP_MageFaction >=40000 then
  81. FaceTarget(NPC, Spawn)
  82. PlayFlavor(NPC, "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)
  83. elseif FP_MageFaction >=30000 then
  84. FaceTarget(NPC, Spawn)
  85. PlayFlavor(NPC, "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)
  86. elseif FP_MageFaction >=20000 then
  87. FaceTarget(NPC, Spawn)
  88. 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 Academy of Arcane Science in its quest for all knowledge!", "", 0, 0, Spawn)
  89. elseif FP_MageFaction >=10000 then
  90. FaceTarget(NPC, Spawn)
  91. PlayFlavor(NPC, "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)
  92. end
  93. end