evilgravestonespawner.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --[[
  2. Script Name : SpawnScripts/OutpostOverlord/evilgravestonespawner.lua
  3. Script Author : Lemmeron
  4. Script Date : 2020.08.19 05:08:41
  5. Script Purpose : To allow Anius Oakwind (2780031) to spawn when Grave is kicked.
  6. : To control NPC summon of grave to reset 5 minutes after Anius is killed.
  7. --]]
  8. local ZoneID = 278 --outpost of the overlord
  9. local GraveID = 2780153
  10. local GravelocID = 485806
  11. local AniusID = 2780031
  12. local AniuslocID = 398907
  13. function spawn(NPC)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function casted_on(NPC, Spawn, Message)
  19. local zone = GetZone(NPC)
  20. if Message == "kick gravestone" then
  21. SpawnSet(NPC, "show_command_icon", "0")
  22. AddTimer(NPC, 2000, "Vanish", 1, Spawn)
  23. local Anius = SpawnByLocationID(zone, AniuslocID)
  24. if Anius ~= nil then
  25. if IsAlive(Anius) then
  26. AddTimer(Anius, 5000, "AskWhy", 1, Spawn)
  27. else
  28. SpawnByLocationID(ZoneID, AniuslocID)
  29. AddTimer(Anius, 5000, "AskWhy", 1, Spawn)
  30. end
  31. else
  32. Say(NPC, "Anius not found")
  33. end
  34. else Say(NPC, "kick gravestone message not working")
  35. end
  36. end
  37. function Vanish(NPC, Spawn)
  38. SpawnSet(NPC, "visual_state", "0")
  39. SpawnSet(NPC, "targetable", "0")
  40. SpawnSet(NPC, "show_name", "0")
  41. end
  42. function Respawntimer(NPC)
  43. SpawnSet(NPC, "show_command_icon", "1")
  44. SpawnSet(NPC, "visual_state", "1")
  45. SpawnSet(NPC, "targetable", "0")
  46. SpawnSet(NPC, "show_name", "0")
  47. end