9
3

InvisCubeOttThunderingSteppes.lua 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. --[[
  2. Script Name : SpawnScripts/ThunderingSteppes/InvisCubeOttThunderingSteppes.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.06.20 03:06:21
  5. Script Purpose : Spawns Ott Stompgutt and bears if player is on Armor Quest 6 Finding Ian's Heirlooms.
  6. :
  7. --]]
  8. local RespawnTimer = false
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC,16, "InRange", "LeaveRange")
  11. end
  12. function hailed(NPC, Spawn)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function InRange(NPC,Spawn)
  18. if RespawnTimer == false then --Disable respawns for 11 min
  19. if GetQuestStep(Spawn,5593)==3 then --Player Quest Step Check (should be step 3, but available anywhere between 1-3)
  20. Ott = GetSpawn(NPC,2490835)
  21. Bears = GetSpawn(NPC,2490836)
  22. if Ott == nil and Bears == nil then
  23. RespawnTimer = true
  24. zone = GetZone(Spawn)
  25. local OttSpawn = SpawnByLocationID(zone,133773389)
  26. local Bear1 = SpawnByLocationID(zone,133773387)
  27. local Bear2 = SpawnByLocationID(zone,133773388)
  28. AddTimer(NPC,3000,"OttShout")
  29. AddTimer(NPC,660000,"ResetTimer")
  30. SetTarget(Ott,Spawn)
  31. SetTarget(Bear1,Spawn)
  32. SetTarget(Bear2,Spawn)
  33. AddHate(Spawn, OttSpawn, 100)
  34. AddHate(Spawn, Bear1, 100)
  35. AddHate(Spawn, Bear2, 100)
  36. else --forces spawns to attack if still up
  37. zone = GetZone(Spawn)
  38. local OttSpawn = GetSpawnByLocationID(zone,133773389)
  39. local Bear1 = GetSpawnByLocationID(zone,133773387)
  40. local Bear2 = GetSpawnByLocationID(zone,133773388)
  41. SetTarget(Ott,Spawn)
  42. SetTarget(Bear1,Spawn)
  43. SetTarget(Bear2,Spawn)
  44. AddHate(Spawn, OttSpawn, 100)
  45. AddHate(Spawn, Bear1, 100)
  46. AddHate(Spawn, Bear2, 100)
  47. end
  48. end
  49. end
  50. end
  51. function OttShout(NPC,Spawn)
  52. Ott = GetSpawn(NPC,2490835)
  53. if Ott ~= nil then
  54. PlayFlavor(Ott,"","Ye come lookin' for that sticker the fool dropped when he ran? Ye can't have it! It's mine now!","",0,0)
  55. end
  56. end
  57. function ResetTimer(NPC,Spawn)
  58. RespawnTimer = false
  59. end