Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MB_manacosts={
- ["Prayer of Fortitude"]=3400,
- ["Prayer of Spirit"]=1940,
- ["Gift of the Wild"]=1200,
- ["Prayer of Shadow Protection"]=1300,
- ["Arcane Brilliance"]=3230,
- ["Amplify Magic"]=450,
- ["Not Specified"]=3399,
- }
- function MB_Raidbuff(spell, target)--target can be nil, but used for special types of boffs
- local Reqspell = spell
- local i = 1
- local x = 10
- local spacejam = "party" or "raid"
- if target then
- TargetByName(target);
- if not MB_buffed(spell, "target") then CastSpellByName(spell) end
- return end
- if not spell then
- return
- end
- if not knowSpell(spell) then
- RunLine("/raid I dont know spell: "..spell..". its time you take me to a trainer or the auctionhouse! Empty=macro not specifying spell");
- return
- end
- if not MB_manacosts[spell] == nil then
- MB_manacosts[spell] = MB_manacosts["Not Specified"]
- end
- if mana("player") < MB_manacosts[spell] then smartdrink(); end
- if UnitInRaid("player") then
- x = GetNumRaidMembers();
- spacejam = ("raid"..i);
- elseif UnitInParty("player") and not UnitInRaid("player") then
- x = GetNumPartyMembers();
- spacejam = ("party"..i);
- RunLine("/p im buffing a partymember with spell: "..spell.." ");
- else
- x = 5;
- spacejam = "target"
- RunLine("/s no raid no parteh whats to buff eyh");
- end
- if spacejam == nil then
- local myname = UnitName("player");
- TargetUnit(myname);
- spacejam = "target";
- end
- for i=1,x do
- if UnitLevel(spacejam)~=nil and UnitIsVisible(spacejam) and UnitIsConnected(spacejam) and not UnitIsGhost(spacejam) and not UnitIsDead(spacejam) and not UnitIsEnemy(spacejam,"player") and not UnitCanAttack("player",spacejam) and not MB_buffed(spell, spacejam) and not MB_buffed(spell, spacejam) then
- if not spacejam == "target" then
- TargetUnit(spacejam)
- elseif spacejam == "target" then
- TargetNearestFriend()
- end
- CastSpellByName(spell)
- return end
- end
- end
- function MB_buffed(spell, target)
- if spell == "Prayer of Fortitude" then
- return MB_buffCheck("Interface\\Icons\\Spell_Holy_PrayerOfFortitude", target, "Prayer of Fortitude")
- elseif spell == "Power Word: Fortitude" then
- return MB_buffCheck("Interface\\Icons\\Spell_Holy_WordFortitude", target, "Power Word: Fortitude")
- elseif spell == "Prayer of Spirit" then
- return MB_buffCheck("Interface\\Icons\\Spell_Holy_PrayerofSpirit", target, "Prayer of Spirit")
- elseif spell == "Prayer of Shadow Protection" then
- return MB_buffCheck("Interface\\Icons\\Spell_Holy_PrayerofShadowProtection", target, "Prayer of Shadow Protection")
- elseif spell == "Gift of the Wild" then
- return MB_buffCheck("Interface\\Icons\\Spell_Nature_Regeneration", target, "Gift of the Wild")
- elseif spell == "Thorns" then
- return MB_buffCheck("Interface\\Icons\\Spell_Nature_Thorns", target, "Thorns")
- elseif spell == "Arcane Brilliance" then
- return MB_buffCheck("Interface\\Icons\\Spell_Holy_ArcaneIntellect", target, "Arcane Brilliance")
- elseif spell == "Ignite" then
- return MB_debuffCheck("Interface\\Icons\\Spell_Fire_Incinerate", target, "Ignite", "5")--barongeddons ignite mana same debuff.
- elseif spell == "Ignite Mana" then
- return MB_debuffCheck("Interface\\Icons\\Spell_Fire_Incinerate", target, "Ignite Mana")--ignite same debuff.
- elseif spell == "Flame Buffet" then
- return MB_debuffCheck("Interface\\Icons\\Spell_Fire_Fireball", target, "Flame Buffet", "6") --FireBall?
- elseif spell == "Scorch" then
- return MB_debuffCheck("Interface\\Icons\\Spell_Fire_SoulBurn", target, "Scorch", "5") --spell_shadow_curseoftounges - curse of tounges, and curse of weakness: spell_shadow_curseofmannoro
- elseif spell == "Curse of Recklessness" then
- return MB_debuffCheck("Interface\\Icons\\Spell_Shadow_UnholyStrength", target, "Curse of Recklessness")
- elseif spell == "Curse of Shadow" then
- return MB_debuffCheck("Interface\\Icons\\Spell_Shadow_CurseOfAchimonde", target, "Curse of Shadow")
- elseif spell == "Curse of the Elements" then
- return MB_debuffCheck("Interface\\Icons\\Spell_Shadow_ChillTouch", target, "Curse of the Elements") --spell_holy_powerwordshield
- elseif spell == "Curse of Tongues" then
- return MB_debuffCheck("Interface\\Icons\\Spell_Shadow_CurseOfTounges", target, "Curse of Tongues")
- elseif spell == "Curse of Weakness" then
- return MB_debuffCheck("Interface\\Icons\\Spell_Shadow_CurseOfMannoroth", target, "Curse of Weakness")
- elseif spell == "Power Word: Shield" then
- local isdebuffed = MB_debuffCheck("Interface\\Icons\\Spell_Holy_AshesToAshes", target, "Weakened Soul")
- local isbuffed = MB_buffCheck("Interface\\Icons\\Spell_Holy_PowerWordShield", target, "Power Word: Shield")
- if not isdebuffed and not isbuffed then
- return false
- elseif not isdebuffed and isbuffed then
- return true
- elseif isdebuffed and not isbuffed then
- return true
- elseif isdebuffed and isbuffed then
- return true
- end
- else --if you havent specified any buffname+its iconpath it will default and use Supermacros buffed, remember that MB_buffed is ALOT faster if you can search through icons as here.
- return buffed(spell, target) --but ex giants in aq20 debuff has same icon but different names, so have to tooltipscrape like supermacros buffed does. but otherwise try to change all your buffed to MB_buffed(spellname, unit)
- end
- end
- function MB_buffCheck(text, target, buffname, amount)
- local buffname = buffname or nil
- local i = 1
- local buff, buffApplications = UnitBuff(target, i)
- while buff do
- if buff == text then
- if amount then
- local amounts = tonumber(amount);
- local amounta = tonumber(debuffApplications);
- if amounts == amounta then
- return true
- elseif amounts ~= amounta then
- return false
- end
- end
- return true
- end
- i = i + 1
- buff = UnitBuff(target, i)
- end
- return
- end
- function MB_debuffCheck(text, target, debuffname, amount)
- local debuffname = debuffname or nil
- local i = 1
- local debuffTexture, debuffApplications, debuffDispelType = UnitDebuff(target, i)
- while debuffTexture do
- if debuffTexture == text then
- if amount then
- local amounts = tonumber(amount);
- local amounta = tonumber(debuffApplications);
- if amounts == amounta then
- return true
- elseif amounts ~= amounta then
- return false
- end
- end
- return true
- end
- i = i + 1
- debuffTexture = UnitDebuff(target, i)
- end
- return
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement