9
3

entrysarcophagus01.lua 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --[[
  2. Script Name : SpawnScripts/The Sepulcher of Jahnda/entrysarcophagus01.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.10.22 06:10:08
  5. Script Purpose : TEMP VARIABLES SHOULD BE CHANGED TO PREVENT ABUSE
  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, "sarcophagus1_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, "turn_tonmerk_friendly", "true")
  18. end
  19. elseif SpellName == 'Defile remains' then
  20. local zone = GetZone(NPC)
  21. local object_remains = GetSpawnByLocationID(zone, 133772674)
  22. local check_spawn = GetSpawnByLocationID(zone, 133772680)
  23. if check_spawn == nil then
  24. local a_desecrated_remains = SpawnByLocationID(zone, 133772680) -- a_desecrated_remains01 ID
  25. Despawn(object_remains)
  26. AddTimer(NPC, 4600, "visual_effect", 1)
  27. end
  28. SpawnSet(NPC, "show_command_icon", 0)
  29. SpawnSet(NPC, "display_hand_icon", 0)
  30. SetTempVariable(Spawn, "remains_defiled_1", "true")
  31. 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
  32. SetTempVariable(Spawn, "MobAccess", "true")
  33. SetTempVariable(Spawn, "turn_tonmerk_hostile", "true")
  34. end
  35. end
  36. end
  37. function visual_effect(NPC, Spawn)
  38. local zone = GetZone(NPC)
  39. local a_desecrated_remains = GetSpawnByLocationID(zone, 133772680) -- a_desecrated_remains01 ID
  40. if a_desecrated_remains ~= nil then
  41. PlayAnimation(a_desecrated_remains, 1300)
  42. end
  43. end
  44. function respawn(NPC)
  45. spawn(NPC)
  46. end