aBlackshieldassassin.lua 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/aBlackshieldassassin.lua
  3. Script Author : Premierio015
  4. Script Date : 2020.11.17 06:11:14
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/NPCModule"
  9. function spawn(NPC, Spawn)
  10. NPCModule(NPC, Spawn)
  11. race(NPC)
  12. AddTimer(NPC, 1500, "movement")
  13. end
  14. function movement(NPC, Spawn)
  15. if IsHeroic(NPC) == false then
  16. RandomMovement(NPC, Spawn, 12, -12, 2, 8, 15)
  17. else
  18. IdleAlert(NPC)
  19. end
  20. end
  21. function hailed(NPC, Spawn)
  22. FaceTarget(NPC, Spawn)
  23. end
  24. function respawn(NPC)
  25. spawn(NPC)
  26. end
  27. function healthchanged(NPC, Spawn)
  28. if GetGender(NPC) == 2 then
  29. local hp_percent = GetHP(NPC) / GetMaxHP(NPC)
  30. if hp_percent <= 0.50 then
  31. PlayFlavor(NPC, "voiceover/english/optional3/human_base_1/ft/human/human_base_1_1_halfhealth_gf_1babf022.mp3", "Is that all you have?", "", 2979351329, 4050238683, Spawn)
  32. end
  33. end
  34. end
  35. function death(NPC, Spawn)
  36. if GetGender(NPC) == 1 then
  37. local chance = math.random(1, 100)
  38. if chance <= 40 then
  39. local choice2 = math.random(1, 2)
  40. if choice2 == 1 then
  41. PlayFlavor(NPC, "voiceover/english/human_base_1/ft/human/human_base_1_1_death_gm_3e24be0b.mp3", "Cover me while we regroup!", "", 144951462, 3922442401, Spawn)
  42. else
  43. PlayFlavor(NPC, "voiceover/english/human_base_1/ft/human/human_base_1_1_death_gm_7612214f.mp3", "All hands retreat!", "", 3033325782, 1103449586, Spawn)
  44. end
  45. elseif GetGender(NPC) == 2 then
  46. local chance = math.random(1, 100)
  47. if chance <= 40 then
  48. PlayFlavor(NPC, "voiceover/english/optional3/human_base_1/ft/human/human_base_1_1_death_gf_7612214f.mp3", "All hands retreat!", "", 3620177897, 757784861, Spawn)
  49. end
  50. end
  51. end
  52. end
  53. function aggro(NPC, Spawn)
  54. if GetGender(NPC) == 2 then
  55. local choice = math.random(1, 3)
  56. if choice == 1 then
  57. PlayFlavor(NPC, "voiceover/english/optional3/human_base_1/ft/human/human_base_1_1_aggro_gf_583690dc.mp3" , "Summon help! We have invaders!", "", 1598905349, 2204481929, Spawn)
  58. elseif choice == 2 then
  59. PlayFlavor(NPC, "voiceover/english/optional3/human_base_1/ft/human/human_base_1_1_aggro_gf_a30c4f9d.mp3", "To arms!", "", 2291750057, 1030180613, Spawn)
  60. else
  61. PlayFlavor(NPC, "voiceover/english/optional3/human_base_1/ft/human/human_base_1_1_aggro_gf_a203c9ec.mp3", "Prepare to face your doom, meddler.", "", 1496819882, 365167432, Spawn)
  62. end
  63. elseif GetGender(NPC) == 1 then
  64. local choice = math.random(1, 3)
  65. if choice == 1 then
  66. PlayFlavor(NPC, "voiceover/english/human_base_1/ft/human/human_base_1_1_aggro_gm_a30c4f9d.mp3", "To Arms!", "", 1238020980, 748146443, Spawn)
  67. elseif choice == 2 then
  68. PlayFlavor(NPC, "voiceover/english/human_base_1/ft/human/human_base_1_1_aggro_gm_583690dc.mp3", "Summon help! We have invaders!", "", 3340212225, 279643307, Spawn)
  69. else
  70. PlayFlavor(NPC, "voiceover/english/human_base_1/ft/human/human_base_1_1_aggro_gm_a203c9ec.mp3", "Prepare to face your doom, meddler.", "", 1496819882, 365167432, Spawn)
  71. end
  72. end
  73. end
  74. function race(NPC)
  75. setrace = MakeRandomInt(1,2)
  76. if setrace == 1 then
  77. human(NPC)
  78. elseif setrace == 2 then
  79. halfelf(NPC)
  80. end
  81. end