9
3

aGruttoothsaboteur.lua 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. --[[
  2. Script Name : SpawnScripts/IsleRefuge1/aGruttoothsaboteur.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.20 03:09:28
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/MonsterCallouts/BaseGoblin2.lua")
  9. require "SpawnScripts/Generic/NPCModule"
  10. function spawn(NPC, Spawn)
  11. NPCModule(NPC, Spawn)
  12. AddTimer(NPC,2000,"EmoteLoop")
  13. end
  14. function aggro(NPC, Spawn)
  15. aggrotimer(NPC)
  16. end
  17. function aggrotimer(NPC)
  18. local distance = GetRunbackDistance(NPC)
  19. if IsInCombat(NPC) and distance <=35 then
  20. AddTimer(NPC,8000,"aggrotimer") -- Check is Goblins and Campfire are up
  21. else
  22. Despawn(NPC) --Despawns Goblins and Campfire, which disables update
  23. zone = GetZone(NPC)
  24. local Campfire = GetSpawnByLocationID(zone,133776522)
  25. Despawn(Campfire)
  26. end
  27. end
  28. function respawn(NPC)
  29. spawn(NPC)
  30. end
  31. function EmoteLoop(NPC,Spawn)
  32. if IsInCombat(NPC) == false and HasMoved(NPC)==false then
  33. choice = MakeRandomInt(1,10)
  34. if choice == 1 then
  35. PlayFlavor(NPC, "", "", "treaten", 0, 0, Spawn, 0)
  36. elseif choice == 2 then
  37. PlayFlavor(NPC, "", "", "sniff", 0, 0, Spawn, 0)
  38. elseif choice == 3 then
  39. PlayFlavor(NPC, "", "", "frustrated", 0, 0, Spawn, 0)
  40. elseif choice == 4 then
  41. PlayFlavor(NPC, "", "", "peer", 0, 0, Spawn, 0)
  42. elseif choice == 5 then
  43. PlayFlavor(NPC, "", "", "feint", 0, 0, Spawn, 0)
  44. elseif choice == 6 then
  45. PlayFlavor(NPC, "", "", "confused", 0, 0, Spawn, 0)
  46. elseif choice == 7 then
  47. PlayFlavor(NPC, "", "", "treaten", 0, 0, Spawn, 0)
  48. elseif choice == 8 then
  49. PlayFlavor(NPC, "", "", "stare", 0, 0, Spawn, 0)
  50. elseif choice == 9 then
  51. PlayFlavor(NPC, "", "", "brandish", 0, 0, Spawn, 0)
  52. elseif choice == 10 then
  53. PlayFlavor(NPC, "", "", "cackle", 0, 0, Spawn, 0)
  54. end
  55. AddTimer(NPC,MakeRandomInt(7000,9000),"EmoteLoop")
  56. else
  57. AddTimer(NPC,MakeRandomInt(10000,11000),"EmoteLoop")
  58. end
  59. end