equation.lua 823 B

12345678910111213141516171819202122232425262728293031323334353637
  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 respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function casted_on(NPC, Spawn, SpellName)
  17. if HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) == 2 then
  18. if SpellName == 'Copy Equation' then
  19. SummonItem(Spawn, 12090, 1)
  20. Despawn(NPC)
  21. end
  22. end
  23. end
  24. function SpawnAccess(NPC, Spawn)
  25. if HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) == 2 then
  26. AddSpawnAccess(NPC, Spawn)
  27. else
  28. RemoveSpawnAccess(NPC, Spawn)
  29. end
  30. end