acorruptMilitiaguard.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. --[[
  2. Script Name : SpawnScripts/ScaleYard2/acorruptMilitiaguard.lua
  3. Script Author : Premierio015
  4. Script Date : 2020.08.28 07:08:31
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SetPlayerProximityFunction(NPC, 20, "InRange", "LeaveRange")
  10. EmoteLoop (NPC)
  11. end
  12. function hailed(NPC, Spawn)
  13. FaceTarget(NPC, Spawn)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function EmoteLoop(NPC)
  19. local choice = math.random(1,2)
  20. local timer = math.random(2500,3500)
  21. if choice == 1 then
  22. PlayAnimation(NPC, 12182)
  23. AddTimer(NPC, timer, "EmoteLoop")
  24. else
  25. PlayAnimation(NPC, 2809)
  26. AddTimer(NPC, timer, "EmoteLoop")
  27. end
  28. end
  29. function InRange(NPC, Spawn)
  30. PlayersLevel = GetLevel(Spawn)
  31. SpawnSet(NPC, "level", PlayersLevel)
  32. end
  33. function LeaveRange(NPC, Spawn)
  34. end
  35. function attacked(NPC, Spawn)
  36. local choice = math.random(1, 4)
  37. if choice == 1 then
  38. PlayFlavor(NPC, "", "Welcome to a lifetime of slavery.", "", 1689589577, 4560189)
  39. elseif choice == 2 then
  40. PlayFlavor(NPC, "", "The iksar fear nothing!", "", 1689589577, 4560189)
  41. elseif choice == 3 then
  42. PlayFlavor(NPC, "", "You made a very serious mistake, my subject.", "", 1689589577, 4560189)
  43. else
  44. PlayFlavor(NPC, "", "Now, prepare to face an eternity of fear.", "", 1689589577, 4560189)
  45. end
  46. end
  47. function death(NPC, Spawn)
  48. PlayFlavor(NPC, "", "Fall back! We'll meet again.", "", 1689589577, 4560189)
  49. end