entrysarcophagus03.lua 2.6 KB

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