aforgottenresident.lua 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. --[[
  2. Script Name : SpawnScripts/SunkenCity/aforgottenresident.lua
  3. Script Purpose : a forgotten 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 prespawn(NPC)
  12. local choice = MakeRandomInt(1, 2)
  13. if choice == 1 then
  14. SpawnSet(NPC, "model_type", 2851)
  15. SpawnSet(NPC, "gender", 2)
  16. elseif choice == 2 then
  17. SpawnSet(NPC, "model_type", 2852)
  18. SpawnSet(NPC, "gender", 1)
  19. end
  20. function spawn(NPC)
  21. spoke = false
  22. end
  23. function respawn(NPC)
  24. spawn(NPC)
  25. end
  26. function hailed(NPC, Spawn)
  27. FaceTarget(NPC, Spawn)
  28. end
  29. function aggro(NPC, Spawn)
  30. local chance = math.random(1, 100)
  31. if chance <= 25 then
  32. if GetGender(NPC) == MALE then
  33. 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)
  34. elseif GetGender(NPC) == FEMALE then
  35. 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)
  36. end
  37. end
  38. end
  39. function healthchanged(NPC, Spawn)
  40. local hp_percent = GetHP(NPC) / GetMaxHP(NPC)
  41. if hp_percent <= 0.50 and spoke == false then
  42. spoke = true
  43. if GetGender(NPC) == MALE then
  44. 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)
  45. elseif GetGender(NPC) == FEMALE then
  46. local choice = math.random(1, 2)
  47. if choice == 1 then
  48. 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)
  49. elseif choice == 2 then
  50. 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)
  51. end
  52. end
  53. AddTimer(NPC, 30000, "ResetSpoke")
  54. end
  55. end
  56. function ResetSpoke(NPC)
  57. spoke = false
  58. end
  59. function killed(NPC, Spawn)
  60. local chance = math.random(1, 100)
  61. if chance <= 25 then
  62. if GetGender(NPC) == MALE then
  63. 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)
  64. elseif GetGender(NPC) == FEMALE then
  65. local choice = math.random(1, 2)
  66. if choice == 1 then
  67. 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)
  68. elseif choice == 2 then
  69. 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)
  70. end
  71. end
  72. end
  73. end
  74. function death(NPC, Spawn)
  75. spoke = false
  76. local chance = math.random(1, 100)
  77. if chance <= 25 then
  78. end
  79. end