9
3

asuspiciouscrate.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --[[
  2. Script Name : SpawnScripts/WayfarersRest/asuspiciouscrate.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.09.23 03:09:19
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. end
  10. function casted_on(NPC, Spawn, Message)
  11. local zone = GetZone(NPC)
  12. local Crate = (GetSpawnByLocationID(zone,133786873))
  13. local Barrel = (GetSpawnByLocationID(zone,133786872))
  14. if Message == "Inspect" then
  15. if Crate ~= nil then
  16. PlayFlavor(Crate,"","","result_dispell1_out",0,0)
  17. AddTimer(Crate,1500,"Despawning")
  18. end
  19. if Barrel ~= nil then
  20. PlayFlavor(Barrel,"","","result_dispell1_out",0,0)
  21. AddTimer(Barrel,1500,"Despawning")
  22. end
  23. if NPC ~= nil then
  24. PlayFlavor(NPC,"","","result_dispell1_out",0,0)
  25. AddTimer(NPC,1500,"Despawning")
  26. end
  27. end
  28. end
  29. function Despawning(NPC,Spawn)
  30. local zone = GetZone(NPC)
  31. local Crate = (GetSpawnByLocationID(zone,133786873))
  32. local Barrel = (GetSpawnByLocationID(zone,133786872))
  33. local Wall = (GetSpawnByLocationID(zone,133786875))
  34. if Crate ~= nil then
  35. Despawn(Crate)
  36. end
  37. if Barrel ~= nil then
  38. Despawn(Barrel)
  39. end
  40. if NPC ~= nil then
  41. Despawn(NPC)
  42. if Wall ~= nil then
  43. Despawn(Wall)
  44. end
  45. end
  46. end
  47. function respawn(NPC)
  48. spawn(NPC)
  49. end