anemptysmugglingcrate.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/anemptysmugglingcrate.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.03.29 09:03:46
  5. Script Purpose :
  6. :
  7. --]]
  8. local QUEST = 453 -- Crates on the Nerves Quest
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "SpawnAccess", "SpawnAccess")
  11. end
  12. function SpawnAccess(NPC, Spawn)
  13. if GetQuestStep(Spawn, QUEST) == 3 then
  14. SpawnSet(NPC, "show_command_icon", 1)
  15. SpawnSet(NPC, "display_hand_icon", 1)
  16. elseif not HasQuest(Spawn, QUEST) then
  17. SpawnSet(NPC, "show_command_icon", 0)
  18. SpawnSet(NPC, "display_hand_icon", 0)
  19. end
  20. end
  21. function casted_on(NPC, Spawn, SpellName)
  22. if HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) == 3 then
  23. if SpellName == 'Sprinkle Tracking Powder' then
  24. ApplySpellVisual(Spawn, 568)
  25. SpawnSet(NPC, "visual_state", 17432)
  26. AddTimer(NPC, 10000, "return_state", 1, Spawn)
  27. AddStepProgress(Spawn, QUEST, 3, 1)
  28. end
  29. end
  30. end
  31. function return_state(NPC, Spawn)
  32. SpawnSet(NPC, "visual_state", 0)
  33. end
  34. function respawn(NPC)
  35. spawn(NPC)
  36. end