SeniorInitiateDelvin.lua 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. --[[
  2. Script Name : SpawnScripts/ElddarGrove/SeniorInitiateDelvin.lua
  3. Script Purpose : Senior Initiate Delvin
  4. Script Author : Dorbin
  5. Script Date : 2022.05.09
  6. --]]
  7. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  8. function spawn(NPC)
  9. waypoints(NPC)
  10. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  11. end
  12. function InRange(NPC,Spawn)
  13. if GetFactionAmount(Spawn,11) <0 then
  14. local choice = math.random(1,6)
  15. if choice == 1 then
  16. PlayFlavor(NPC, "voiceover/english/human_eco_good_1/ft/human/human_eco_good_1_notcitizen_gm_1a98f879.mp3", "How did you get past the city gates?!", "doubletake", 2984037816, 3824691347)
  17. elseif choice == 2 then
  18. PlayFlavor(NPC, "voiceover/english/human_eco_good_1/ft/human/human_eco_good_1_notcitizen_gm_6da83eeb.mp3", "I'll defend myself if it comes to that, savage!", "shakefist", 1112175527, 3181748573)
  19. elseif choice == 3 then
  20. PlayFlavor(NPC, "voiceover/english/human_eco_good_1/ft/human/human_eco_good_1_notcitizen_gm_48350e59.mp3", "You're not allowed in here!", "point", 1734668326, 429140096)
  21. elseif choice == 4 then
  22. PlayFlavor(NPC, "voiceover/english/human_eco_good_1/ft/human/human_eco_good_1_notcitizen_gm_8236a789.mp3", "Remove yourself from my presence, outsider.", "glare", 742840308, 1978260864)
  23. elseif choice == 5 then
  24. PlayFlavor(NPC, "voiceover/english/human_eco_good_1/ft/human/human_eco_good_1_notcitizen_gm_5afcbd03.mp3", "The streets aren't safe with your kind upon them.", "no", 3192824592, 3089779490)
  25. elseif choice == 6 then
  26. PlayFlavor(NPC, "voiceover/english/human_eco_good_1/ft/human/human_eco_good_1_notcitizen_gm_7e3f7ca.mp3", "I refuse to contaminate myself by conversing with you.", "sulk", 2165609155, 3535416550)
  27. end
  28. end
  29. end
  30. function hailed(NPC, Spawn)
  31. if GetFactionAmount(Spawn,11) <0 then
  32. InRange(NPC,Spawn)
  33. else
  34. FaceTarget(NPC, Spawn)
  35. GenericRaceCheckHail(NPC, Spawn, faction)
  36. RandomGreeting(NPC, Spawn)
  37. end
  38. end
  39. function RandomGreeting(NPC, Spawn)
  40. local choice = MakeRandomInt(1,3)
  41. if choice == 1 then
  42. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1004.mp3", 0, 0, Spawn)
  43. elseif choice == 2 then
  44. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1004.mp3", 0, 0, Spawn)
  45. elseif choice == 3 then
  46. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1004.mp3", 0, 0, Spawn)
  47. end
  48. end
  49. function waypoints(NPC)
  50. MovementLoopAddLocation(NPC, 783.26, -19.63, -362.84, 2, math.random(0,5))
  51. MovementLoopAddLocation(NPC, 758.18, -19.63, -363.62, 2, math.random(0,5))
  52. MovementLoopAddLocation(NPC, 757.65, -19.64, -375.84, 2, 0)
  53. MovementLoopAddLocation(NPC, 744.46, -18.86, -376.24, 2, 0)
  54. MovementLoopAddLocation(NPC, 743.15, -18.87, -376.27, 2, 1)
  55. MovementLoopAddLocation(NPC, 743.15, -18.87, -376.27, 2, math.random(6,8),"EcologyEmotes")
  56. MovementLoopAddLocation(NPC, 734.59, -19.54, -376.26, 2, 1)
  57. MovementLoopAddLocation(NPC, 734.59, -19.54, -376.26, 2, math.random(6,8),"EcologyEmotes")
  58. MovementLoopAddLocation(NPC, 734.59, -19.54, -376.26, 2, 1)
  59. MovementLoopAddLocation(NPC, 751.71, -18.86, -376.49, 2, 0)
  60. MovementLoopAddLocation(NPC, 757.26, -19.64, -376.43, 2, 0)
  61. MovementLoopAddLocation(NPC, 757.85, -19.63, -365.15, 2, math.random(0,5))
  62. MovementLoopAddLocation(NPC, 783.04, -19.63, -364.71, 2, 0)
  63. MovementLoopAddLocation(NPC, 782.83, -19.63, -393.74, 2, 0)
  64. MovementLoopAddLocation(NPC, 757.42, -19.64, -392.88, 2, 0)
  65. MovementLoopAddLocation(NPC, 757.59, -19.65, -380.17, 2, 1)
  66. MovementLoopAddLocation(NPC, 757.59, -19.65, -380.17, 2, 2,"Door")
  67. MovementLoopAddLocation(NPC, 757.59, -19.65, -380.17, 2, 1)
  68. MovementLoopAddLocation(NPC, 760.07, -19.26, -379.85, 2, 0)
  69. MovementLoopAddLocation(NPC, 767.19, -19.26, -379.31, 2, 0)
  70. MovementLoopAddLocation(NPC, 770.62, -19.26, -378.68, 2, 0)
  71. MovementLoopAddLocation(NPC, 773.85, -19.26, -378.44, 2, 0)
  72. MovementLoopAddLocation(NPC, 774.11, -19.26, -372.12, 2, 1)
  73. MovementLoopAddLocation(NPC, 774.11, -19.26, -372.12, 2, math.random(6,10),"EcologyEmotes")
  74. MovementLoopAddLocation(NPC, 777.24, -19.26, -371.24, 2, 1)
  75. MovementLoopAddLocation(NPC, 777.24, -19.26, -371.24, 2, math.random(6,10),"EcologyEmotes")
  76. MovementLoopAddLocation(NPC, 776.04, -19.26, -371.19, 2, 1)
  77. MovementLoopAddLocation(NPC, 776.04, -19.26, -371.19, 2, math.random(6,10),"EcologyEmotes")
  78. MovementLoopAddLocation(NPC, 776.04, -19.26, -371.19, 2, 1)
  79. MovementLoopAddLocation(NPC, 772.36, -19.26, -378.49, 2, 0)
  80. MovementLoopAddLocation(NPC, 764.45, -19.26, -378.64, 2, 1)
  81. MovementLoopAddLocation(NPC, 764.45, -19.26, -378.64, 2, 3,"Door")
  82. MovementLoopAddLocation(NPC, 762.89, -18.99, -378.67, 2, 0)
  83. MovementLoopAddLocation(NPC, 757.91, -19.64, -378.77, 2, 0)
  84. MovementLoopAddLocation(NPC, 758.32, -19.63, -393.75, 2, 0)
  85. MovementLoopAddLocation(NPC, 782.62, -19.63, -393.73, 2, 1)
  86. MovementLoopAddLocation(NPC, 782.62, -19.63, -393.73, 2, math.random(5,8),"EcologyEmotes")
  87. end
  88. function Door(NPC,Spawn)
  89. local widget = GetSpawn(NPC, 2070109)
  90. -- if GetSpawnByLocationID(Zone ,440091)~=nil then
  91. UseWidget(widget)
  92. -- end
  93. end