aGruttoothsaboteur.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. function spawn(NPC)
  10. AddTimer(NPC,2000,"EmoteLoop")
  11. end
  12. function aggro(NPC, Spawn)
  13. aggrotimer(NPC)
  14. end
  15. function aggrotimer(NPC)
  16. local distance = GetRunbackDistance(NPC)
  17. if IsInCombat(NPC) and distance <=35 then
  18. AddTimer(NPC,8000,"aggrotimer") -- Check is Goblins and Campfire are up
  19. else
  20. Despawn(NPC) --Despawns Goblins and Campfire, which disables update
  21. zone = GetZone(NPC)
  22. local Campfire = GetSpawnByLocationID(zone,133776522)
  23. Despawn(Campfire)
  24. end
  25. end
  26. function respawn(NPC)
  27. spawn(NPC)
  28. end
  29. function EmoteLoop(NPC,Spawn)
  30. if IsInCombat(NPC) == false and HasMoved(NPC)==false then
  31. choice = MakeRandomInt(1,10)
  32. if choice == 1 then
  33. PlayFlavor(NPC, "", "", "treaten", 0, 0, Spawn, 0)
  34. elseif choice == 2 then
  35. PlayFlavor(NPC, "", "", "sniff", 0, 0, Spawn, 0)
  36. elseif choice == 3 then
  37. PlayFlavor(NPC, "", "", "frustrated", 0, 0, Spawn, 0)
  38. elseif choice == 4 then
  39. PlayFlavor(NPC, "", "", "peer", 0, 0, Spawn, 0)
  40. elseif choice == 5 then
  41. PlayFlavor(NPC, "", "", "feint", 0, 0, Spawn, 0)
  42. elseif choice == 6 then
  43. PlayFlavor(NPC, "", "", "confused", 0, 0, Spawn, 0)
  44. elseif choice == 7 then
  45. PlayFlavor(NPC, "", "", "treaten", 0, 0, Spawn, 0)
  46. elseif choice == 8 then
  47. PlayFlavor(NPC, "", "", "stare", 0, 0, Spawn, 0)
  48. elseif choice == 9 then
  49. PlayFlavor(NPC, "", "", "brandish", 0, 0, Spawn, 0)
  50. elseif choice == 10 then
  51. PlayFlavor(NPC, "", "", "cackle", 0, 0, Spawn, 0)
  52. end
  53. AddTimer(NPC,MakeRandomInt(7000,9000),"EmoteLoop")
  54. else
  55. AddTimer(NPC,MakeRandomInt(10000,11000),"EmoteLoop")
  56. end
  57. end