equation.lua 883 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --[[
  2. Script Name : SpawnScripts/TempleStreet2/equation.lua
  3. Script Author : Premierio015
  4. Script Date : 2020.08.14 04:08:12
  5. Script Purpose :
  6. :
  7. --]]
  8. local QUEST = 574
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 50, "SpawnAccess", "SpawnAccess")
  11. AddSpawnAccess(NPC, NPC)
  12. end
  13. function hailed(NPC, Spawn)
  14. FaceTarget(NPC, Spawn)
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function casted_on(NPC, Spawn, SpellName)
  20. if HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) == 2 then
  21. if SpellName == 'Copy Equation' then
  22. SummonItem(Spawn, 12090, 1)
  23. Despawn(NPC)
  24. end
  25. end
  26. end
  27. function SpawnAccess(NPC, Spawn)
  28. if HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) == 2 then
  29. AddSpawnAccess(NPC, Spawn)
  30. else
  31. RemoveSpawnAccess(NPC, Spawn)
  32. end
  33. end