aspectralresident.lua 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. --[[
  2. Script Name : SpawnScripts/SunkenCity/aspectralresident.lua
  3. Script Purpose : a spectral resident
  4. Script Author : Scatman
  5. Script Date : 2009.08.01
  6. Script Notes :
  7. --]]
  8. local MALE = 1
  9. local FEMALE = 2
  10. local spoke = false
  11. function spawn(NPC)
  12. spoke = false
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function hailed(NPC, Spawn)
  18. FaceTarget(NPC, Spawn)
  19. end
  20. function aggro(NPC, Spawn)
  21. local chance = math.random(1, 100)
  22. if chance <= 25 then
  23. if GetGender(NPC) == MALE then
  24. PlayFlavor(NPC, "voiceover/english/ghost_human_base_1/ft/ghost/ghost_human_base_1_1_aggro_gm_119a2ca8.mp3", "No. I'm unrest and you will suffer.", "", 3626119416, 3545522817)
  25. elseif GetGender(NPC) == FEMALE then
  26. PlayFlavor(NPC, "voiceover/english/optional3/ghost_human_base_1/ft/ghost/ghost_human_base_1_1_aggro_gf_821554e3.mp3", "Must you aggravate me so!", "", 735262000, 1417243472)
  27. end
  28. end
  29. end
  30. function healthchanged(NPC, Spawn)
  31. local hp_percent = GetHP(NPC) / GetMaxHP(NPC)
  32. if hp_percent <= 0.50 and spoke == false then
  33. spoke = true
  34. if GetGender(NPC) == MALE then
  35. PlayFlavor(NPC, "voiceover/english/ghost_human_base_1/ft/ghost/ghost_human_base_1_1_halfhealth_gm_8bdfff2d.mp3", "I won't miss again!", "", 1970756563, 618808961)
  36. elseif GetGender(NPC) == FEMALE then
  37. local choice = math.random(1, 2)
  38. if choice == 1 then
  39. PlayFlavor(NPC, "voiceover/english/optional3/ghost_human_base_1/ft/ghost/ghost_human_base_1_1_halfhealth_gf_fa0af03c.mp3", "For Thule's sake!", "", 2960095639, 2634994717)
  40. elseif choice == 2 then
  41. PlayFlavor(NPC, "voiceover/english/optional3/ghost_human_base_2/ft/ghost/ghost_human_base_2_1_halfhealth_gf_4214f9be.mp3", "Well struck, but I withstood it!", "", 2750294931, 1365592478)
  42. end
  43. end
  44. AddTimer(NPC, 30000, "ResetSpoke")
  45. end
  46. end
  47. function ResetSpoke(NPC)
  48. spoke = false
  49. end
  50. function killed(NPC, Spawn)
  51. local chance = math.random(1, 100)
  52. if chance <= 25 then
  53. if GetGender(NPC) == MALE then
  54. PlayFlavor(NPC, "voiceover/english/ghost_human_base_1/ft/ghost/ghost_human_base_1_1_victory_gm_79236cb9.mp3", "It was too late. They have met our fate.", "", 869850080, 2857504352)
  55. elseif GetGender(NPC) == FEMALE then
  56. local choice = math.random(1, 2)
  57. if choice == 1 then
  58. PlayFlavor(NPC, "voiceover/english/optional3/ghost_human_base_1/ft/ghost/ghost_human_base_1_1_victory_gf_65116994.mp3", "One down! An eternity to go.", "", 3147020467, 1377166074)
  59. elseif choice == 2 then
  60. PlayFlavor(NPC, "voiceover/english/optional3/ghost_human_base_1/ft/ghost/ghost_human_base_1_1_victory_gf_7e0e07b4.mp3", "They can't all be this easy.", "", 2091285193, 1124297002)
  61. end
  62. end
  63. end
  64. end
  65. function death(NPC, Spawn)
  66. spoke = false
  67. local chance = math.random(1, 100)
  68. if chance <= 25 then
  69. end
  70. end