9
3

aforgottenresident.lua 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. end
  21. function spawn(NPC)
  22. spoke = false
  23. end
  24. function respawn(NPC)
  25. spawn(NPC)
  26. end
  27. function hailed(NPC, Spawn)
  28. FaceTarget(NPC, Spawn)
  29. end
  30. function aggro(NPC, Spawn)
  31. local chance = math.random(1, 100)
  32. if chance <= 25 then
  33. if GetGender(NPC) == MALE then
  34. 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)
  35. elseif GetGender(NPC) == FEMALE then
  36. 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)
  37. end
  38. end
  39. end
  40. function healthchanged(NPC, Spawn)
  41. local hp_percent = GetHP(NPC) / GetMaxHP(NPC)
  42. if hp_percent <= 0.50 and spoke == false then
  43. spoke = true
  44. if GetGender(NPC) == MALE then
  45. 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)
  46. elseif GetGender(NPC) == FEMALE then
  47. local choice = math.random(1, 2)
  48. if choice == 1 then
  49. 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)
  50. elseif choice == 2 then
  51. 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)
  52. end
  53. end
  54. AddTimer(NPC, 30000, "ResetSpoke")
  55. end
  56. end
  57. function ResetSpoke(NPC)
  58. spoke = false
  59. end
  60. function killed(NPC, Spawn)
  61. local chance = math.random(1, 100)
  62. if chance <= 25 then
  63. if GetGender(NPC) == MALE then
  64. 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)
  65. elseif GetGender(NPC) == FEMALE then
  66. local choice = math.random(1, 2)
  67. if choice == 1 then
  68. 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)
  69. elseif choice == 2 then
  70. 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)
  71. end
  72. end
  73. end
  74. end
  75. function death(NPC, Spawn)
  76. spoke = false
  77. local chance = math.random(1, 100)
  78. if chance <= 25 then
  79. end
  80. end