entrysarcophagus06.lua 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. --[[
  2. Script Name : SpawnScripts/The Sepulcher of Jahnda/entrysarcophagus06.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.10.22 07:10:38
  5. Script Purpose :
  6. :
  7. --]]
  8. local LordTonmerkID = 133772252
  9. function spawn(NPC)
  10. end
  11. function casted_on(NPC, Spawn, SpellName)
  12. if SpellName == 'Whisper a prayer' then
  13. SpawnSet(NPC, "show_command_icon", 0)
  14. SpawnSet(NPC, "display_hand_icon", 0)
  15. SetTempVariable(Spawn, "sarcophagus6_used", "true")
  16. if GetTempVariable(Spawn, "sarcophagus1_used") == "true" and GetTempVariable(Spawn, "sarcophagus2_used") == "true" and GetTempVariable(Spawn, "sarcophagus3_used") == "true" and GetTempVariable(Spawn, "sarcophagus4_used") == "true" and GetTempVariable(Spawn, "sarcophagus5_used") == "true" and GetTempVariable(Spawn, "sarcophagus6_used") == "true" then
  17. SetTempVariable(Spawn, "MobAccess", "true")
  18. SetTempVariable(Spawn, "sarcophagus1_used", nil)
  19. SetTempVariable(Spawn, "sarcophagus2_used", nil)
  20. SetTempVariable(Spawn, "sarcophagus3_used", nil)
  21. SetTempVariable(Spawn, "sarcophagus4_used", nil)
  22. SetTempVariable(Spawn, "sarcophagus5_used", nil)
  23. SetTempVariable(Spawn, "sarcophagus6_used", nil)
  24. SetTempVariable(Spawn, "turn_tonmerk_friendly", nil)
  25. end
  26. elseif SpellName == 'Defile remains' then
  27. local zone = GetZone(NPC)
  28. local object_remains = GetSpawnByLocationID(zone, 133772679)
  29. local check_spawn = GetSpawnByLocationID(zone, 133772685)
  30. if check_spawn == nil then
  31. local a_desecrated_remains = SpawnByLocationID(zone, 133772685) -- a_desecrated_remains06 ID
  32. Despawn(object_remains)
  33. AddTimer(NPC, 4600, "visual_effect", 1)
  34. end
  35. SpawnSet(NPC, "show_command_icon", 0)
  36. SpawnSet(NPC, "display_hand_icon", 0)
  37. SetTempVariable(Spawn, "remains_defiled_6", "true")
  38. if GetTempVariable(Spawn, "remains_defiled_1") == "true" and GetTempVariable(Spawn, "remains_defiled_2") == "true" and GetTempVariable(Spawn, "remains_defiled_3") == "true" and GetTempVariable(Spawn, "remains_defiled_4") == "true" and GetTempVariable(Spawn, "remains_defiled_5") == "true" and GetTempVariable(Spawn, "remains_defiled_6") == "true" then
  39. SetTempVariable(Spawn, "MobAccess", "true")
  40. SetTempVariable(Spawn, "turn_tonmerk_hostile", "true")
  41. end
  42. end
  43. end
  44. function visual_effect(NPC, Spawn)
  45. local zone = GetZone(NPC)
  46. local a_desecrated_remains = GetSpawnByLocationID(zone, 133772685) -- a_desecrated_remains06 ID
  47. if a_desecrated_remains ~= nil then
  48. PlayAnimation(a_desecrated_remains, 1300)
  49. end
  50. end
  51. function respawn(NPC)
  52. spawn(NPC)
  53. end