CraggedSpinesupplycrate.lua 903 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/CraggedSpinesupplycrate.lua
  3. Script Purpose : for the supply crate spawns
  4. Script Author : theFoof
  5. Script Date : 2013.7.21
  6. Script Notes :
  7. --]]
  8. local ClanImps = 79
  9. function spawn(NPC)
  10. AddSpawnAccess(NPC, NPC)
  11. SetPlayerProximityFunction(NPC, 50, "SpawnAccess", "SpawnAccess")
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function casted_on(NPC, Spawn, SpellName)
  17. if HasQuest(Spawn, ClanImps) and GetQuestStep(Spawn, ClanImps) < 3 then
  18. if SpellName == 'stolen crate' then
  19. AddStepProgress(Spawn, ClanImps, 1, 1)
  20. local imp = SpawnMob(GetZone(NPC), 4701143, 0, GetX(Spawn) - 3, GetY(Spawn), GetZ(Spawn) - 3, 0)
  21. Attack(imp, Spawn)
  22. Despawn(NPC)
  23. end
  24. end
  25. end
  26. function SpawnAccess(NPC, Spawn)
  27. if HasQuest(Spawn, ClanImps) then
  28. AddSpawnAccess(NPC, Spawn)
  29. else
  30. RemoveSpawnAccess(NPC, Spawn)
  31. end
  32. end