aBloodsaberplaguebearer.lua 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. --[[
  2. Script Name : SpawnScripts/PeatBog/aBloodsaberplaguebearer.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.05.26 04:05:22
  5. Script Purpose : Running from sewer to location and despawning.
  6. :
  7. --]]
  8. function spawn(NPC)
  9. waypoints(NPC)
  10. SpawnCheck(NPC, Spawn)
  11. Appearance(NPC,Spawn)
  12. end
  13. function hailed(NPC, Spawn)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function waypoints(NPC)
  19. if GetSpawnLocationID(NPC) == 133773314 then
  20. MovementLoopAddLocation(NPC, 669.08, -34.1, 410.02, 4, 0)
  21. MovementLoopAddLocation(NPC, 679.26, -33.36, 424.96, 4, 0)
  22. MovementLoopAddLocation(NPC, 686.9, -32.43, 458.65, 4, 0)
  23. MovementLoopAddLocation(NPC, 703.01, -33.46, 485.47, 4, 0)
  24. MovementLoopAddLocation(NPC, 692.71, -32.6, 496.42, 4, 0)
  25. MovementLoopAddLocation(NPC, 690.75, -32.44, 496.36, 4, 1)
  26. MovementLoopAddLocation(NPC, 690.75, -32.44, 496.36, 4, 30,"Action")
  27. MovementLoopAddLocation(NPC, 690.75, -32.44, 496.36, 4, 1)
  28. elseif GetSpawnLocationID(NPC) == 133773315 then
  29. MovementLoopAddLocation(NPC, 668.86, -34.13, 409.6, 4, 0)
  30. MovementLoopAddLocation(NPC, 679.24, -33.37, 424.54, 4, 0)
  31. MovementLoopAddLocation(NPC, 683.93, -33.29, 451.02, 4, 0)
  32. MovementLoopAddLocation(NPC, 699.36, -32.7, 454.26, 4, 0)
  33. MovementLoopAddLocation(NPC, 709.55, -33.35, 462.09, 4, 0)
  34. MovementLoopAddLocation(NPC, 718.29, -33.64, 460.4, 4, 1)
  35. MovementLoopAddLocation(NPC, 718.29, -33.64, 460.4, 4, 30,"Action")
  36. MovementLoopAddLocation(NPC, 718.29, -33.64, 460.4, 4, 1)
  37. elseif GetSpawnLocationID(NPC) == 133773316 then
  38. MovementLoopAddLocation(NPC, 666.72, -33.63, 403.08, 4, 0)
  39. MovementLoopAddLocation(NPC, 645.01, -33.36, 419.49, 4, 0)
  40. MovementLoopAddLocation(NPC, 637.37, -33.14, 423.14, 4, 0)
  41. MovementLoopAddLocation(NPC, 633.45, -32.81, 427.24, 4, 0)
  42. MovementLoopAddLocation(NPC, 628.36, -33.28, 435.28, 4, 0)
  43. MovementLoopAddLocation(NPC, 627.06, -33.11, 443.75, 4, 0)
  44. MovementLoopAddLocation(NPC, 633.24, -33.41, 457.71, 4, 0)
  45. MovementLoopAddLocation(NPC, 632.07, -33.16, 459.32, 4, 0)
  46. MovementLoopAddLocation(NPC, 624.71, -33.10, 458.06, 4, 1)
  47. MovementLoopAddLocation(NPC, 624.71, -33.10, 458.06, 4, 30,"Action")
  48. MovementLoopAddLocation(NPC, 624.71, -33.10, 458.06, 4, 1)
  49. end
  50. end
  51. function Action(NPC,Spawn)
  52. PlayFlavor(NPC,"","","itch",0,0)
  53. AddTimer(NPC,6500,"Action2",1)
  54. end
  55. function Action2(NPC,Spawn)
  56. PlayFlavor(NPC,"","","result_acid_rain_damage",0,0)
  57. AddTimer(NPC,2300,"Action3",1)
  58. end
  59. function Action3(NPC,Spawn)
  60. PlayFlavor(NPC,"","","result_poison_cloud_aoe",0,0)
  61. SpawnSet(NPC,"visual_state",0)
  62. AddTimer(NPC,2300,"Action4")
  63. AddTimer(NPC,2200,"despawn",1,Spawn)
  64. end
  65. function Action4(NPC)
  66. Despawn(NPC)
  67. end
  68. function SpawnCheck(NPC, Spawn)
  69. if GetSpawnLocationID(NPC) == 133773314 then
  70. AddTimer(NPC,60000,"spawn2")
  71. AddTimer(NPC,120000,"spawn3")
  72. end
  73. end
  74. function spawn2(NPC,Spawn)
  75. zone = GetZone(NPC)
  76. SpawnByLocationID(zone,133773315)
  77. end
  78. function spawn3(NPC,Spawn)
  79. zone = GetZone(NPC)
  80. SpawnByLocationID(zone,133773316)
  81. end
  82. function Appearance(NPC,Spawn)
  83. local choice = math.random (1,2)
  84. if choice == 1 then
  85. SpawnSet(NPC,"gender",2)
  86. SpawnSet(NPC,"model_type",105)
  87. else
  88. end
  89. end
  90. function aggro(NPC,Spawn)
  91. if GetGender(NPC)==1 then
  92. local choice = MakeRandomInt(1,2)
  93. if choice == 1 then
  94. PlayFlavor(NPC,"voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_battle_gm_ee1e1a8.mp3","Attack!","",3180104139, 2926558993)
  95. else
  96. PlayFlavor(NPC,"voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_battle_cm_bbd7a8ed.mp3","Too many shiney things! Can't concentrate!","",445162395, 3277644756)
  97. end
  98. else
  99. PlayFlavor(NPC,"voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_aggro_gf_b7e0b3a.mp3","Me's gonna eat kidney first!","",750980753, 3740010516)
  100. end
  101. end
  102. function healthchanged(NPC, Spawn)
  103. if GetHP(NPC) < GetMaxHP(NPC) * 0.55 then
  104. if GetHP(NPC) > GetMaxHP(NPC) * 0.45 then
  105. if GetGender(NPC)==1 then
  106. local choice = MakeRandomInt(1,2)
  107. if choice == 1 then
  108. PlayFlavor(NPC, "voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_halfhealth_gm_f462f6ff.mp3", "Is this supposed to hurt?", "", 4202180867, 1393988988, Spawn, 0)
  109. elseif choice == 2 then
  110. PlayFlavor(NPC, "voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_halfhealth_gm_aa145f4d.mp3", "Neat, that'll leave a pretty scar", "", 675684950, 4088135432, Spawn, 0)
  111. end
  112. else
  113. local choice = MakeRandomInt(1,2)
  114. if choice == 1 then
  115. PlayFlavor(NPC, "voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_halfhealth_gf_aa145f4d.mp3", "Neat, that'll leave a pretty scar", "", 70455099, 2953679351, Spawn, 0)
  116. elseif choice == 2 then
  117. PlayFlavor(NPC, "voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_halfhealth_gf_f462f6ff.mp3", "Is this supposed to hurt?", "", 216769747, 692696120, Spawn, 0)
  118. end
  119. end
  120. end
  121. end
  122. end
  123. function death(NPC,Spawn)
  124. if GetGender(NPC)==1 then
  125. local choice = MakeRandomInt(1,2)
  126. if choice == 1 then
  127. PlayFlavor(NPC,"voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_death_gm_e1755f3f.mp3","Come at me coward. I'm not dead yet!...","result_poison_cloud_aoe",86111608, 3954832486)
  128. elseif choice == 2 then
  129. PlayFlavor(NPC, "voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_death_gm_e8c02d1e.mp3", "Feel kinda sleepy. Whacha do to me?", "result_poison_cloud_aoe", 3298938103, 1410551282, Spawn, 0)
  130. end
  131. else
  132. PlayFlavor(NPC,"voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_death_gf_e8c02d1e.mp3","Feel kinda sleepy. What'chyou do ta me?!","result_poison_cloud_aoe",3447489483, 4136415601)
  133. end
  134. end