Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.87 KB | None | 0 0
  1. MB_manacosts={
  2. ["Prayer of Fortitude"]=3400,
  3. ["Prayer of Spirit"]=1940,
  4. ["Gift of the Wild"]=1200,
  5. ["Prayer of Shadow Protection"]=1300,
  6. ["Arcane Brilliance"]=3230,
  7. ["Amplify Magic"]=450,
  8. ["Not Specified"]=3399,
  9. }
  10.  
  11. /script MB_Raidbuff({"Prayer of Fortitude"}) --spells specified in the MB_manacosts get cast like this
  12. /script MB_Raidbuff("Thorns", "Hornagaur") -- to buff on a specified target
  13. /script if MB_buffed("Scorch", "target", "5") then CastSpellByName("Fireball") else CastSpellByName("Scorch") end
  14. /script if MB_buffed("Ignite", "target", "5") then CastSpellByName("Scorch") else CastSpellByName("Fireball")
  15.  
  16. function MB_Raidbuff(spell, target)--target can be nil, but used for special types of boffs
  17. local Reqspell = spell
  18.  
  19. local i = 1
  20. local x = 10
  21. local spacejam = "party" or "raid"
  22.  
  23. if target then
  24. TargetByName(target);
  25. if not MB_buffed(spell, "target") then CastSpellByName(spell) end
  26. return end
  27.  
  28. if not spell then
  29. return
  30. end
  31.  
  32. if not knowSpell(spell) then
  33. RunLine("/raid I dont know spell: "..spell..". its time you take me to a trainer or the auctionhouse! Empty=macro not specifying spell");
  34. return
  35. end
  36.  
  37. if not MB_manacosts[spell] == nil then
  38. MB_manacosts[spell] = MB_manacosts["Not Specified"]
  39. end
  40.  
  41. if mana("player") < MB_manacosts[spell] then smartdrink(); end
  42.  
  43. if UnitInRaid("player") then
  44. x = GetNumRaidMembers();
  45. spacejam = ("raid"..i);
  46. elseif UnitInParty("player") and not UnitInRaid("player") then
  47. x = GetNumPartyMembers();
  48. spacejam = ("party"..i);
  49. RunLine("/p im buffing a partymember with spell: "..spell.." ");
  50. else
  51. x = 5;
  52. spacejam = "target"
  53. RunLine("/s no raid no parteh whats to buff eyh");
  54. end
  55.  
  56. if spacejam == nil then
  57. local myname = UnitName("player");
  58. TargetUnit(myname);
  59. spacejam = "target";
  60. end
  61.  
  62. for i=1,x do
  63. 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
  64. if not spacejam == "target" then
  65. TargetUnit(spacejam)
  66. elseif spacejam == "target" then
  67. TargetNearestFriend()
  68. end
  69. CastSpellByName(spell)
  70. return end
  71. end
  72. end
  73. function MB_buffed(spell, target, buffname, amount)
  74. if spell == "Prayer of Fortitude" then
  75. return MB_buffCheck("Interface\\Icons\\Spell_Holy_PrayerOfFortitude", target, "Prayer of Fortitude")
  76.  
  77. elseif spell == "Power Word: Fortitude" then
  78. return MB_buffCheck("Interface\\Icons\\Spell_Holy_WordFortitude", target, "Power Word: Fortitude")
  79.  
  80. elseif spell == "Prayer of Spirit" then
  81. return MB_buffCheck("Interface\\Icons\\Spell_Holy_PrayerofSpirit", target, "Prayer of Spirit")
  82.  
  83. elseif spell == "Prayer of Shadow Protection" then
  84. return MB_buffCheck("Interface\\Icons\\Spell_Holy_PrayerofShadowProtection", target, "Prayer of Shadow Protection")
  85.  
  86. elseif spell == "Gift of the Wild" then
  87. return MB_buffCheck("Interface\\Icons\\Spell_Nature_Regeneration", target, "Gift of the Wild")
  88.  
  89. elseif spell == "Thorns" then
  90. return MB_buffCheck("Interface\\Icons\\Spell_Nature_Thorns", target, "Thorns")
  91.  
  92. elseif spell == "Arcane Brilliance" then
  93. return MB_buffCheck("Interface\\Icons\\Spell_Holy_ArcaneIntellect", target, "Arcane Brilliance")
  94.  
  95. elseif spell == "Ignite" then
  96. return MB_debuffCheck("Interface\\Icons\\Spell_Fire_Incinerate", target, "Ignite", "5")--barongeddons ignite mana same debuff.
  97.  
  98. elseif spell == "Ignite Mana" then
  99. return MB_debuffCheck("Interface\\Icons\\Spell_Fire_Incinerate", target, "Ignite Mana")--ignite same debuff.
  100.  
  101. elseif spell == "Flame Buffet" then
  102. return MB_debuffCheck("Interface\\Icons\\Spell_Fire_Fireball", target, "Flame Buffet", "6") --FireBall?
  103.  
  104. elseif spell == "Scorch" then
  105. return MB_debuffCheck("Interface\\Icons\\Spell_Fire_SoulBurn", target, "Scorch", "5") --spell_shadow_curseoftounges - curse of tounges, and curse of weakness: spell_shadow_curseofmannoro
  106.  
  107. elseif spell == "Curse of Recklessness" then
  108. return MB_debuffCheck("Interface\\Icons\\Spell_Shadow_UnholyStrength", target, "Curse of Recklessness")
  109.  
  110. elseif spell == "Curse of Shadow" then
  111. return MB_debuffCheck("Interface\\Icons\\Spell_Shadow_CurseOfAchimonde", target, "Curse of Shadow")
  112.  
  113. elseif spell == "Curse of the Elements" then
  114. return MB_debuffCheck("Interface\\Icons\\Spell_Shadow_ChillTouch", target, "Curse of the Elements") --spell_holy_powerwordshield
  115.  
  116. elseif spell == "Curse of Tongues" then
  117. return MB_debuffCheck("Interface\\Icons\\Spell_Shadow_CurseOfTounges", target, "Curse of Tongues")
  118.  
  119. elseif spell == "Curse of Weakness" then
  120. return MB_debuffCheck("Interface\\Icons\\Spell_Shadow_CurseOfMannoroth", target, "Curse of Weakness")
  121.  
  122. elseif spell == "Power Word: Shield" then
  123. local isdebuffed = MB_debuffCheck("Interface\\Icons\\Spell_Holy_AshesToAshes", target, "Weakened Soul")
  124. local isbuffed = MB_buffCheck("Interface\\Icons\\Spell_Holy_PowerWordShield", target, "Power Word: Shield")
  125. if not isdebuffed and not isbuffed then
  126. return false
  127. elseif not isdebuffed and isbuffed then
  128. return true
  129. elseif isdebuffed and not isbuffed then
  130. return true
  131. elseif isdebuffed and isbuffed then
  132. return true
  133. end
  134. 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.
  135. 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)
  136. end
  137. end
  138. function MB_buffCheck(text, target, buffname, amount)
  139. local buffname = buffname or nil
  140. local i = 1
  141. local buff, buffApplications = UnitBuff(target, i)
  142. while buff do
  143. if buff == text then
  144. if amount then
  145. local amounts = tonumber(amount);
  146. local amounta = tonumber(debuffApplications);
  147. if amounts == amounta then
  148. return true
  149. elseif amounts ~= amounta then
  150. return false
  151. end
  152. end
  153. return true
  154. end
  155. i = i + 1
  156. buff = UnitBuff(target, i)
  157. end
  158. return
  159. end
  160. function MB_debuffCheck(text, target, debuffname, amount)
  161. local debuffname = debuffname or nil
  162. local i = 1
  163. local debuffTexture, debuffApplications, debuffDispelType = UnitDebuff(target, i)
  164. while debuffTexture do
  165. if debuffTexture == text then
  166. if amount then
  167. local amounts = tonumber(amount);
  168. local amounta = tonumber(debuffApplications);
  169. if amounts == amounta then
  170. return true
  171. elseif amounts ~= amounta then
  172. return false
  173. end
  174. end
  175. return true
  176. end
  177. i = i + 1
  178. debuffTexture = UnitDebuff(target, i)
  179. end
  180. return
  181. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement