Untitled

Anonymous
plain_text
02/07/2026 2:31 PM
5.7 KB
9
Indexable
function Wis()
  -- 1. Righteous Fury & Blessing Maintenance
  if (GetNumPartyMembers() > 0 or GetNumRaidMembers() > 0) then
    if not buffed("Spell_Holy_RighteousnessAura") then
      CastSpellByName("Righteous Fury") return
    end
  end

  local units = {"player", "party1", "party2", "party3", "party4"}
  for _, unit in ipairs(units) do
    if UnitExists(unit) then
      local _, class = UnitClass(unit)
      if (class == "WARRIOR" or class == "ROGUE") then
        if not buffed("Blessing of Sanctuary", unit) then
          TargetUnit(unit) CastSpellByName("Blessing of Sanctuary") TargetLastTarget() return
        end
      else
        if not buffed("Blessing of Wisdom", unit) then
          TargetUnit(unit) CastSpellByName("Blessing of Wisdom") TargetLastTarget() return
        end
      end
    end
  end

  -- 2. SAFE Cleanse Logic (Self & Party Healers)
  local checkUnits = {"player", "party1", "party2", "party3", "party4"}
  for _, u in ipairs(checkUnits) do
    if UnitExists(u) and not UnitIsDead(u) then
      if u == "player" or UnitManaMax(u) > 0 then
        for i=1, 16 do
          local _, _, _, _, debuffType = UnitDebuff(u, i)
          if not debuffType then break end 
          if debuffType == "Poison" or debuffType == "Disease" or debuffType == "Magic" then
            if u == "player" then
              CastSpellByName("Cleanse")
            else
              TargetUnit(u) CastSpellByName("Cleanse") TargetLastTarget()
            end
            return 
          end
        end
      end
    end
  end

  -- 3. Emergency Logic
  local hp = UnitHealth("player")
  local mp = UnitMana("player")
  local targetClass = UnitClassification("target")

  if hp < 550 then
    if not buffed("Spell_Holy_RemoveCurse") then
      local _, hopCD = GetSpellCooldown("Hand of Protection", "spell")
      if hopCD == 0 and not buffed("Spell_Holy_SealOfProtection") then
        CastSpellByName("Hand of Protection") return 
      elseif (hopCD > 0) and (targetClass == "elite" or targetClass == "worldboss" or targetClass == "rareelite") then
        CastSpellByName("Lay on Hands") return 
      end
    end
    if mp > 400 then
      CastSpellByName("Holy Light") return
    elseif mp >= 70 then 
      CastSpellByName("Flash of Light") return
    else
      UseItemByName("Superior Healing Potion")
      UseItemByName("Greater Healing Potion")
      return 
    end
  end

  -- 4. Maintenance Healing (SOLO ONLY)
  if GetNumPartyMembers() == 0 and GetNumRaidMembers() == 0 then
    if hp <= 850 and mp > 1500 then
      CastSpellByName("Holy Light") return
    end
  end

  -- 5. Mana Maintenance
  if mp < 300 then
    UseItemByName("Superior Mana Potion") 
    UseItemByName("Greater Mana Potion")
  end

  -- 6. Basics
  if not UnitName("target") or UnitIsDead("target") then 
    TargetNearestEnemy() 
  end
  if not IsCurrentAction(1) then UseAction(1) end

  -- 7. DEFENSIVE PRIORITY: Holy Shield
  local _, hsCD = GetSpellCooldown("Holy Shield", "spell")
  if hsCD == 0 and mp > 200 then
    CastSpellByName("Holy Shield") return
  end

  -- 8. Seal & Judgment Logic
  if not buffed("Seal of Wisdom") then
    CastSpellByName("Seal of Wisdom") return
  end

  local hasWis = false
  for j=1, 16 do
    local debuff = UnitDebuff("target", j)
    if not debuff then break end
    if string.find(debuff, "Spell_Holy_RighteousnessAura") then
      hasWis = true break
    end
  end

  if not hasWis then
    CastSpellByName("Judgement") return
  end

  -- 9. Attack Rotation
  if (UnitManaMax("target") > 0) or (targetClass == "elite" or targetClass == "worldboss" or targetClass == "rareelite") then
    local _, hojCD = GetSpellCooldown("Hammer of Justice", "spell")
    if hojCD == 0 then CastSpellByName("Hammer of Justice") return end
  end

  if (UnitHealth("target") / UnitHealthMax("target") < 0.20) and mp > 150 then
    CastSpellByName("Hammer of Wrath") return
  end

  if mp > 750 then
    CastSpellByName("Consecration(Rank 3)") return
  end

  local creatureType = UnitCreatureType("target")
  if creatureType == "Undead" or creatureType == "Demon" then
    local _, exoCD = GetSpellCooldown("Exorcism", "spell")
    if exoCD == 0 then CastSpellByName("Exorcism") return end
  end

  local _, hstrCD = GetSpellCooldown("Holy Strike", "spell")
  if hstrCD == 0 then CastSpellByName("Holy Strike") end
end
Editor is loading...
Leave a Comment