RustamtheVile.lua 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --[[
  2. Script Name : SpawnScripts/The Sepulcher of Jahnda/RustamtheVile.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.10.22 07:10:55
  5. Script Purpose :
  6. :
  7. --]]
  8. local LordTonmerkID = 133772252 -- location ID for Lord Tonmerk frinedly NPC
  9. function spawn(NPC)
  10. AddSpawnAccess(NPC, NPC)
  11. SetPlayerProximityFunction(NPC, 10, "SpawnAccess", "SpawnAccess")
  12. end
  13. function SpawnAccess(NPC, Spawn)
  14. if GetTempVariable(Spawn, "MobAccess") == "true" then
  15. AddSpawnAccess(NPC, Spawn)
  16. SpawnSet(NPC, "faction", 1)
  17. else
  18. RemoveSpawnAccess(NPC, Spawn)
  19. end
  20. end
  21. function hailed(NPC, Spawn)
  22. FaceTarget(NPC, Spawn)
  23. end
  24. function death(NPC, Spawn)
  25. SetTempVariable(Spawn, "MobAccess", nil)
  26. local group = GetSpawnByGroupID(zone, 1049684)
  27. if not IsAlive(group) then
  28. local zone = GetZone(NPC)
  29. local LordTonmerk = SpawnByLocationID(zone, LordTonmerkID)
  30. if GetTempVariable(Spawn, "turn_tonmerk_hostile") == "true" then
  31. SpawnSet(LordTonmerk, "faction", 1)
  32. SpawnSet(LordTonmerk, "show_command_icon", 1)
  33. SpawnSet(LordTonmerk, "attackable", 1)
  34. SpawnSet(LordTonmerk, "show_level", 1)
  35. end
  36. end
  37. end
  38. function respawn(NPC)
  39. spawn(NPC)
  40. end