9
3

aBrokentuskoverseer.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --[[
  2. Script Name : SpawnScripts/Ruins/aBrokentuskoverseer.lua
  3. Script Purpose : a Brokentusk overseer
  4. Script Author : Scatman
  5. Script Date : 2009.08.21
  6. Script Notes :
  7. --]]
  8. dofile("SpawnScripts/Generic/BrokentuskVoiceOvers.lua")
  9. local spoke = false
  10. function spawn(NPC)
  11. spoke = false
  12. AddVisualStateLoop(NPC, 1000, math.random(0, 2000), 10783, 450) -- attack
  13. AddVisualStateLoop(NPC, 1000, math.random(0, 2000), 12028, 450) -- point
  14. AddVisualStateLoop(NPC, 1000, math.random(0, 2000), 10912, 450) -- brandish
  15. AddVisualStateLoop(NPC, 1000, math.random(0, 2000), 1646, 450) -- pugilist attack 2
  16. end
  17. function respawn(NPC)
  18. spawn(NPC)
  19. end
  20. function hailed(NPC, Spawn)
  21. FaceTarget(NPC, Spawn)
  22. end
  23. function aggro(NPC, Spawn)
  24. local chance = math.random(0, 100)
  25. if chance <= 25 then
  26. generic_aggro(NPC, Spawn)
  27. end
  28. end
  29. function healthchanged(NPC, Spawn)
  30. local chance = math.random(0, 100)
  31. if chance <= 25 then
  32. local health_percent = GetHP(NPC) / GetMaxHP(NPC)
  33. if health_percent < 0.50 and spoke == false then
  34. spoke = true
  35. generic_healthchanged(NPC, Spawn)
  36. end
  37. end
  38. end
  39. function killed(NPC, Spawn)
  40. generic_killed(NPC, Spawn)
  41. end
  42. function death(NPC, Spawn)
  43. spoke = false
  44. local chance = math.random(0, 100)
  45. if chance <= 25 then
  46. generic_death(NPC, Spawn)
  47. end
  48. end