acrumblingskeleton.lua 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. --[[
  2. Script Name : SpawnScripts/Graveyard/acrumblingskeleton.lua
  3. Script Purpose : a crumbling skeleton
  4. Script Author : Scatman
  5. Script Date : 2009.07.10
  6. Script Notes :
  7. --]]
  8. local spoke = false
  9. function spawn(NPC)
  10. spoke = false
  11. end
  12. function hailed(NPC, Spawn)
  13. FaceTarget(NPC, Spawn)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function healthchanged(NPC, Spawn)
  19. local hp_percent = GetHP(NPC) / GetMaxHP(NPC)
  20. if hp_percent <= 0.50 and spoke == false then
  21. spoke = true
  22. RandomCallOut(NPC, Spawn)
  23. AddTimer(NPC, 30000, "ResetSpoke")
  24. end
  25. end
  26. function RandomCallOut(NPC, Spawn)
  27. local choice = math.random(1, 5)
  28. if choice == 1 then
  29. PlayFlavor(NPC, "voiceover/english/optional3/skeleton_base_2/ft/skeleton/skeleton_base_2_1_halfhealth_29344c6f.mp3", "I didn't need those bones anyway.", "", 1704957193, 2042978689)
  30. elseif choice == 2 then
  31. PlayFlavor(NPC, "voiceover/english/skeleton_base_1/ft/skeleton/skeleton_base_1_1_halfhealth_a4c947e4.mp3", "I'm shattered and broken.", "", 4021018144, 1305053073)
  32. elseif choice == 3 then
  33. PlayFlavor(NPC, "voiceover/english/skeleton_base_1/ft/skeleton/skeleton_base_1_1_halfhealth_d9ece37f.mp3", "You've shaken the dust from my bones.", "", 2011286772, 326848383)
  34. elseif choice == 4 then
  35. PlayFlavor(NPC, "voiceover/english/optional3/skeleton_base_2/ft/skeleton/skeleton_base_2_1_halfhealth_f1d542e0.mp3", "Dying didn't feel good the first time.", "", 766636803, 1915881366)
  36. elseif choice == 5 then
  37. PlayFlavor(NPC, "voiceover/english/optional3/skeleton_base_2/ft/skeleton/skeleton_base_2_1_aggro_18d1544d.mp3", "As I rise from the grave, you will now take my place!", "", 485726074, 3646499350)
  38. end
  39. end
  40. function ResetSpoke(NPC)
  41. spoke = false
  42. end
  43. function death(NPC, Spawn)
  44. spoke = false
  45. local chance = math.random(1, 100)
  46. if chance <= 10 then
  47. local choice = math.random(1, 2)
  48. if choice == 1 then
  49. PlayFlavor(NPC, "voiceover/english/skeleton_base_1/ft/skeleton/skeleton_base_1_1_death_fbcb503b.mp3", "Rest in peace.", "", 3591309093, 1423656405, Spawn)
  50. elseif choice == 2 then
  51. PlayFlavor(NPC, "voiceover/english/skeleton_base_1/ft/skeleton/skeleton_base_1_1_death_ff39f327.mp3", "Final death comes at last.", "", 3768284332, 62777040, Spawn)
  52. end
  53. end
  54. end