qst_axebeard_totem.lua 820 B

12345678910111213141516171819202122232425262728293031323334
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/qst_axebeard_totem.lua
  3. Script Purpose : for the spawn "qst_axebeard_x4_totem"
  4. Script Author : theFoof
  5. Script Date : 2013.5.28
  6. Script Notes :
  7. --]]
  8. local TotemAnnihilation = 34
  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 SpellName == 'destroy the totem' then
  18. if GetQuestStep(Spawn, TotemAnnihilation) == 1 then
  19. AddStepProgress(Spawn, TotemAnnihilation, 1, 1)
  20. Despawn(NPC)
  21. end
  22. end
  23. end
  24. function SpawnAccess(NPC, Spawn)
  25. if GetQuestStep(Spawn, TotemAnnihilation) == 1 then
  26. AddSpawnAccess(NPC, Spawn)
  27. else
  28. RemoveSpawnAccess(NPC, Spawn)
  29. end
  30. end