9
3

aGruttoothprotector.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. --[[
  2. Script Name : SpawnScripts/GrimgashsLair/aGruttoothprotector.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.23 12:09:07
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/CombatModule"
  9. function spawn(NPC, Spawn)
  10. combatModule(NPC, Spawn)
  11. AddTimer(NPC,2000,"EmoteLoop")
  12. end
  13. function EmoteLoop(NPC,Spawn)
  14. if IsInCombat(NPC) == false and HasMoved(NPC)==false then
  15. choice = MakeRandomInt(1,10)
  16. if choice == 1 then
  17. PlayFlavor(NPC, "", "", "treaten", 0, 0, Spawn, 0)
  18. elseif choice == 2 then
  19. PlayFlavor(NPC, "", "", "sniff", 0, 0, Spawn, 0)
  20. elseif choice == 3 then
  21. PlayFlavor(NPC, "", "", "frustrated", 0, 0, Spawn, 0)
  22. elseif choice == 4 then
  23. PlayFlavor(NPC, "", "", "peer", 0, 0, Spawn, 0)
  24. elseif choice == 5 then
  25. PlayFlavor(NPC, "", "", "feint", 0, 0, Spawn, 0)
  26. elseif choice == 6 then
  27. PlayFlavor(NPC, "", "", "confused", 0, 0, Spawn, 0)
  28. elseif choice == 7 then
  29. PlayFlavor(NPC, "", "", "treaten", 0, 0, Spawn, 0)
  30. elseif choice == 8 then
  31. PlayFlavor(NPC, "", "", "stare", 0, 0, Spawn, 0)
  32. elseif choice == 9 then
  33. PlayFlavor(NPC, "", "", "brandish", 0, 0, Spawn, 0)
  34. elseif choice == 10 then
  35. PlayFlavor(NPC, "", "", "cackle", 0, 0, Spawn, 0)
  36. end
  37. AddTimer(NPC,MakeRandomInt(7000,9000),"EmoteLoop")
  38. else
  39. AddTimer(NPC,MakeRandomInt(10000,11000),"EmoteLoop")
  40. end
  41. end
  42. function death(NPC,Spawn)
  43. local zone = GetZone(NPC)
  44. local Gob1 = GetSpawnByLocationID(zone, 133776472)
  45. local Gob2 = GetSpawnByLocationID(zone, 133776473)
  46. local Gob3 = GetSpawnByLocationID(zone, 133776474)
  47. local GobChamp = GetSpawnByLocationID(zone, 133776471)
  48. local Grimgash = GetSpawnByLocationID(zone, 133776469)
  49. if IsAlive(Gob1) == false and IsAlive(Gob2) == false and IsAlive(Gob3) == false then
  50. if IsInCombat(Grimgash)==false then
  51. SetTarget(Grimgash,Spawn)
  52. SetTarget(GobChamp,Spawn)
  53. FaceTarget(Grimgash,Spawn)
  54. FaceTarget(GobChamp,Spawn)
  55. AddTimer(NPC,1200,"Taunt",1,Spawn)
  56. AddTimer(NPC,5000,"GrimAttack",1,Spawn)
  57. end
  58. end
  59. end
  60. function Taunt(NPC,Spawn)
  61. local zone = GetZone(NPC)
  62. local GobChamp = GetSpawnByLocationID(zone, 133776471)
  63. local Grimgash = GetSpawnByLocationID(zone, 133776469)
  64. if not HasLanguage(Spawn,20)then
  65. PlayFlavor(GobChamp,"voiceover/english/goblin_base_1/ft/goblin/goblin_base_1_2_garbled_27d93e2a.mp3","They want to kill us all! Charge!","point",4004358685,1661226684,Spawn,20)
  66. else
  67. PlayFlavor(GobChamp,"voiceover/english/goblin_base_1/ft/goblin/goblin_base_1_1_aggro_3e6d7bc3.mp3","They want to kill us all! Charge!","point",1297886042,938149593,Spawn,20)
  68. end
  69. PlayFlavor(Grimgash,"","","shakefist",0,0)
  70. end
  71. function GrimAttack(NPC,Spawn)
  72. local zone = GetZone(NPC)
  73. local GobChamp = GetSpawnByLocationID(zone, 133776471)
  74. local Grimgash = GetSpawnByLocationID(zone, 133776469)
  75. Attack(Grimgash,Spawn)
  76. end