9
3

TotemoftheIcecladManta.lua 792 B

1234567891011121314151617181920212223242526272829303132333435
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/TotemoftheIcecladManta.lua
  3. Script Purpose : for the totem of the iceclad manta spawn
  4. Script Author : theFoof
  5. Script Date : 2013.06.11
  6. Script Notes :
  7. --]]
  8. local BelowWaves = 59
  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 SpawnAccess(NPC, Spawn)
  17. if HasCompletedQuest(Spawn, BelowWaves) or HasQuest(Spawn, BelowWaves) then
  18. if not HasItem(Spawn, 48603) then
  19. AddSpawnAccess(NPC, Spawn)
  20. end
  21. end
  22. end
  23. function casted_on(NPC, Spawn, SpellName)
  24. if SpellName == 'Gather Totem of the Iceclad Manta' then
  25. if not HasItem(Spawn, 48603) then
  26. SummonItem(Spawn, 48603, 1)
  27. RemoveSpawnAccess(NPC, Spawn)
  28. end
  29. end
  30. end