aLonetuskwarrior.lua 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. --[[
  2. Script Name : SpawnScripts/Ruins/SpawnScripts/Ruins/aLonetuskwarrior.lua
  3. Script Purpose : a Lonetusk warrior
  4. Script Author : Scatman
  5. Script Date : 2009.08.21
  6. Script Notes :
  7. --]]
  8. dofile("SpawnScripts/Ruins/LonetuskVoiceOvers.lua")
  9. local spoke = false
  10. function spawn(NPC)
  11. spoke = false
  12. local sli = GetSpawnLocationID(NPC)
  13. if sli == 159756 then
  14. StartPath1(NPC)
  15. elseif sli == 159757 then
  16. StartPath2(NPC)
  17. end
  18. end
  19. function respawn(NPC)
  20. spawn(NPC)
  21. end
  22. function hailed(NPC, Spawn)
  23. FaceTarget(NPC, Spawn)
  24. end
  25. function aggro(NPC, Spawn)
  26. local chance = math.random(0, 100)
  27. if chance <= 25 then
  28. generic_aggro(NPC, Spawn)
  29. end
  30. end
  31. function healthchanged(NPC, Spawn)
  32. local chance = math.random(0, 100)
  33. if chance <= 25 then
  34. local health_percent = GetHP(NPC) / GetMaxHP(NPC)
  35. if health_percent < 0.50 and spoke == false then
  36. spoke = true
  37. generic_healthchanged(NPC, Spawn)
  38. end
  39. end
  40. end
  41. function killed(NPC, Spawn)
  42. generic_killed(NPC, Spawn)
  43. end
  44. function death(NPC, Spawn)
  45. spoke = false
  46. local chance = math.random(0, 100)
  47. if chance <= 25 then
  48. generic_death(NPC, Spawn)
  49. end
  50. end
  51. function StartPath1(NPC)
  52. MovementLoopAddLocation(NPC, -0.13, -4.26, 165.68, 2, 0)
  53. MovementLoopAddLocation(NPC, -14.62, -4.33, 163.43, 2, 0)
  54. MovementLoopAddLocation(NPC, -23.68, -4.32, 157.94, 2, 0)
  55. MovementLoopAddLocation(NPC, -24.96, -4.28, 139.69, 2, 0)
  56. MovementLoopAddLocation(NPC, -22.01, -4.36, 139.48, 2, 0)
  57. MovementLoopAddLocation(NPC, -20.86, -4.37, 146.05, 2, 0)
  58. MovementLoopAddLocation(NPC, -21.55, -4.29, 153.57, 2, 0)
  59. MovementLoopAddLocation(NPC, -12.1, -4.24, 159.76, 2, 0)
  60. MovementLoopAddLocation(NPC, 11.83, -4.28, 157.78, 2, 0)
  61. MovementLoopAddLocation(NPC, 12.93, -4.24, 164.87, 2, 0)
  62. end
  63. function StartPath2(NPC)
  64. MovementLoopAddLocation(NPC, -18.8, -4.39, 161.74, 2, 0)
  65. MovementLoopAddLocation(NPC, -12.84, -4.29, 163.4, 2, 0)
  66. MovementLoopAddLocation(NPC, 11.15, -4.26, 166.07, 2, 0)
  67. MovementLoopAddLocation(NPC, 11.89, -4.24, 158.55, 2, 0)
  68. MovementLoopAddLocation(NPC, -16.14, -4.24, 158.93, 2, 0)
  69. MovementLoopAddLocation(NPC, -19.88, -4.36, 146.36, 2, 0)
  70. MovementLoopAddLocation(NPC, -24.98, -4.28, 139.56, 2, 0)
  71. MovementLoopAddLocation(NPC, -25.94, -4.42, 155.75, 2, 0)
  72. end