qst_scourgeson_x5_ceiling_crystals.lua 984 B

123456789101112131415161718192021222324252627282930313233343536
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/qst_scourgeson_x5_ceiling_crystals.lua
  3. Script Purpose : for the ceiling crystal spawns in the velinoid caves
  4. Script Author : theFoof
  5. Script Date : 2013.7.18
  6. Script Notes :
  7. --]]
  8. local WatchBelow = 77
  9. function spawn(NPC)
  10. SetRequiredQuest(NPC, WatchBelow, 1)
  11. end
  12. function respawn(NPC)
  13. spawn(NPC)
  14. end
  15. function casted_on(NPC, Spawn, SpellName)
  16. if SpellName == 'knock off a crystal' then
  17. x = GetX(NPC)
  18. z = GetZ(NPC)
  19. SetTempVariable(Spawn, "crystal_x", x)
  20. SetTempVariable(Spawn, "crystal_z", z)
  21. SetSpeed(NPC, 5)
  22. AddTimer(NPC, 3000, "SpawnCrystal", 1, Spawn)
  23. MoveToLocation(NPC, x, GetY - 25, z)
  24. end
  25. end
  26. function SpawnCrystal(NPC, Spawn)
  27. SpawnMob(GetZone(NPC), 4701752, 0, GetTempVariable(Spawn, "crystal_x"), GetY(Spawn), GetTempVariable(Spawn, "crystal_z"), GetHeading(NPC))
  28. Despawn(NPC)
  29. SetTempVariable(Spawn, "crystal_x", nil)
  30. SetTempVariable(Spawn, "crystal_z", nil)
  31. end