9
3

halas_three_barrels_snow.lua 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. --[[
  2. Script Name : Quests/FrostfangSea/halas_three_barrels_snow.lua
  3. Script Purpose : the spawns "halas_three_barrels_snow_01" and "halas_three_barrels_snow_02"
  4. Script Author : theFoof
  5. Script Date : 2013.5.14
  6. --]]
  7. local RepellingCritters = 7
  8. function spawn(NPC)
  9. SetRequiredQuest(NPC, RepellingCritters, 3)
  10. end
  11. function casted_on(NPC, Spawn, SpellName)
  12. if SpellName == "Apply the Repellent" and GetQuestStep(Spawn, RepellingCritters) == 3 then
  13. SetStepComplete(Spawn, RepellingCritters, 3)
  14. local zone = GetZone(NPC) -- the following code removes access from publicly spawned raiders, spawns new raiders, makes them path 35 meters south, then despawns them
  15. local raider = GetSpawnByLocationID(zone, 14)
  16. RemoveSpawnAccess(raider, Spawn)
  17. local new = SpawnByLocationID(zone, 14)
  18. AddSpawnAccess(new, Spawn)
  19. SpawnRaider(new)
  20. local raider = GetSpawnByLocationID(zone, 15)
  21. RemoveSpawnAccess(raider, Spawn)
  22. local new = GetSpawnByLocationID(zone, 15)
  23. AddSpawnAccess(new, Spawn)
  24. SpawnRaider(new)
  25. local raider = GetSpawnByLocationID(zone, 26)
  26. RemoveSpawnAccess(raider, Spawn)
  27. local new = SpawnByLocationID(zone, 26)
  28. AddSpawnAccess(new, Spawn)
  29. SpawnRaider(new)
  30. local raider = GetSpawnByLocationID(zone, 33)
  31. RemoveSpawnAccess(raider, Spawn)
  32. local new = SpawnByLocationID(zone, 33)
  33. AddSpawnAccess(new, Spawn)
  34. SpawnRaider(new)
  35. local raider = GetSpawnByLocationID(zone, 38)
  36. RemoveSpawnAccess(raider, Spawn)
  37. local new = SpawnByLocationID(zone, 38)
  38. AddSpawnAccess(new, Spawn)
  39. SpawnRaider(new)
  40. local raider = GetSpawnByLocationID(zone, 48)
  41. RemoveSpawnAccess(raider, Spawn)
  42. local new = SpawnByLocationID(zone, 48)
  43. AddSpawnAccess(new, Spawn)
  44. SpawnRaider(new)
  45. local raider = GetSpawnByLocationID(zone, 50)
  46. RemoveSpawnAccess(raider, Spawn)
  47. local new = SpawnByLocationID(zone, 50)
  48. SpawnRaider(new)
  49. local raider = GetSpawnByLocationID(zone, 74)
  50. RemoveSpawnAccess(raider, Spawn)
  51. local new = SpawnByLocationID(zone, 74)
  52. AddSpawnAccess(new, Spawn)
  53. SpawnRaider(new)
  54. end
  55. end
  56. function SpawnRaider(NPC)
  57. X = GetX(NPC)
  58. Y = GetY(NPC)
  59. Z = GetZ(NPC)
  60. SetSpeed(NPC, 13)
  61. MoveToLocation(NPC, X, Y, Z + 35)
  62. AddTimer(NPC, 3000, "Despawn")
  63. end