qst_scourgeson_x2_rygorr_tent.lua 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/qst_scourgeson_x2_rygorr_tent.lua
  3. Script Purpose : for the quest tent spawns
  4. Script Author : theFoof
  5. Script Date : 2013.6.20
  6. Script Notes :
  7. --]]
  8. local HighlyMaterials = 74
  9. function spawn(NPC)
  10. SetRequiredQuest(NPC, HighlyMaterials, 2)
  11. end
  12. function respawn(NPC)
  13. spawn(NPC)
  14. end
  15. function casted_on(NPC, Spawn, SpellName)
  16. if SpellName == 'burn tent' then
  17. if GetQuestStep(Spawn, HighlyMaterials) == 2 and GetTempVariable(NPC, "on_fire") ~= "true" then
  18. local zone = GetZone(NPC)
  19. local fire
  20. if GetSpawnLocationID(NPC) == 435782 then
  21. fire = SpawnByLocationID(zone, 572721)
  22. elseif GetSpawnLocationID(NPC) == 435783 then
  23. fire = SpawnByLocationID(zone, 572720)
  24. elseif GetSpawnLocationID(NPC) == 435788 then
  25. fire = SpawnByLocationID(zone, 572719)
  26. elseif GetSpawnLocationID(NPC) == 435793 then
  27. fire = SpawnByLocationID(zone, 572722)
  28. elseif GetSpawnLocationID(NPC) == 435792 then
  29. fire = SpawnByLocationID(zone, 572718)
  30. elseif GetSpawnLocationID(NPC) == 435790 then
  31. fire = SpawnByLocationID(zone, 442666)
  32. end
  33. AddStepProgress(Spawn, HighlyMaterials, 2, 1)
  34. AddTimer(fire, 25000, "Despawn")
  35. AddTimer(NPC, 25000, "ReapplyPrimaryCommand")
  36. AddTimer(NPC, 5000, "KillArea")
  37. RemovePrimaryCommand(NPC)
  38. end
  39. end
  40. end
  41. function KillArea(NPC)
  42. KillSpawnByDistance(NPC, 20, 0, 0)
  43. end
  44. function RemovePrimaryCommand(NPC)
  45. SpawnSet(NPC, "primary_command", "0")
  46. SetTempVariable(NPC, "on_fire", "true")
  47. end
  48. function ReapplyPrimaryCommand(NPC)
  49. SpawnSet(NPC, "primary_command", "871")
  50. SetTempVariable(NPC, "on_fire", nil)
  51. end