smashedbarrel3.lua 701 B

123456789101112131415161718192021222324252627282930
  1. --[[
  2. Script Name : SpawnScripts/CrowsTomb/smashedbarrel3.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.10.03 07:10:22
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  10. end
  11. function InRange(NPC, Spawn)
  12. local zone = GetZone(Spawn)
  13. local taskmaster = GetSpawnByLocationID(zone, 434503)
  14. if GetTempVariable(taskmaster, "spoken") == "2" then
  15. SpawnSet(NPC, "show_command_icon", 1)
  16. SpawnSet(NPC, "display_hand_icon", 1)
  17. end
  18. end
  19. function casted_on(NPC, Spawn, SpellName)
  20. if SpellName == 'clean' then
  21. Despawn(NPC)
  22. end
  23. end
  24. function respawn(NPC)
  25. spawn(NPC)
  26. end