Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.92 KB | None | 0 0
  1.  
  2. ---NOTE THESE FEW LINES BELOW HAS TO BE ADDED IN THE FSMB:OnUpdate() function.
  3. elseif (event == "PLAYER_LOGIN") then
  4. if myclass=="Priest" then
  5. xPriestCheck()
  6. end
  7. ---that makes the xPriestCheck load for priests on login, if that check aint done it cant calculate the healvalue
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15. function xPriestCheck() --this whole function actually calculates with the help of the addon BonusScanner and the math's exactly(+-about 30-40) how much each priestheal spell(not renew) will heal with your buffs+gear. should be read onevent up there at priest login.
  16. local p= Printd
  17. local _,_,_,_,talentRank,_ = GetTalentInfo(2,14);
  18. local _,spw,_,_ = UnitStat('player',5);
  19. local sgf = spw * 5*talentRank/100;
  20.  
  21. local _,_,_,_,talentRank,_ = GetTalentInfo(2,15);
  22. local shMod = 2*talentRank/100 + 1;
  23.  
  24. local _,_,_,_,talentRank,_ = GetTalentInfo(2,10);
  25. local ihMod = 1 - 5*talentRank/100;
  26.  
  27. local _,_,_,_,talentRank,_ = GetTalentInfo(2,12);
  28. local pohMod = 1 - 10*talentRank/100;
  29.  
  30.  
  31. local hpw = BonusScanner:GetBonus("HEAL")
  32.  
  33.  
  34.  
  35. if sgf>0 then
  36. g1h = math.floor(((924+1038)/2)*shMod + ((hpw +sgf)*(3/3.5)));
  37. g2h = math.floor(((1178+1318)/2)*shMod + ((hpw +sgf)*(3/3.5)));
  38. g3h = math.floor(((1470+1642)/2)*shMod + ((hpw +sgf)*(3/3.5)));
  39. g4h = math.floor(((1813+2021)/2)*shMod + ((hpw +sgf)*(3/3.5)));
  40. g5h = math.floor(((1966+2194)/2)*shMod + ((hpw +sgf)*(3/3.5)));
  41. h1e = math.floor(((307+353)/2)*shMod + (hpw +sgf)*(3/3.5)*(1-((20-16)*0.0375)));
  42. h2e = math.floor(((445+507)/2)*shMod + (hpw +sgf)*(3/3.5));
  43. h3e = math.floor(((586+662)/2)*shMod + (hpw +sgf)*(3/3.5));
  44. h4e = math.floor(((734+826)/2)*shMod + (hpw +sgf)*(3/3.5));
  45. poh1 = math.floor(((301+321)/2)*shMod + (hpw +sgf)*(1/3));
  46. poh2 = math.floor(((444+472)/2)*shMod + (hpw +sgf)*(1/3));
  47. poh3 = math.floor(((657+695)/2)*shMod + (hpw +sgf)*(1/3));
  48. poh4 = math.floor(((939+991)/2)*shMod + (hpw +sgf)*(1/3));
  49. poh5 = math.floor(((1041+1099)/2)*shMod + (hpw +sgf)*(1/3));
  50.  
  51. else
  52. g1h = math.floor(((924+1038)/2)*shMod + (hpw *3/3.5));
  53. g2h = math.floor(((1178+1318)/2)*shMod + (hpw *3/3.5));
  54. g3h = math.floor(((1470+1642)/2)*shMod + (hpw *3/3.5));
  55. g4h = math.floor(((1813+2021)/2)*shMod + (hpw *3/3.5));
  56. g5h = math.floor(((1966+2194)/2)*shMod + (hpw *3/3.5));
  57. h1e = math.floor(((307+353)/2)*shMod + (hpw *3/3.5)*(1-((20-16)*0.0375)));
  58. h2e = math.floor(((445+507)/2)*shMod + (hpw *3/3.5));
  59. h3e = math.floor(((586+662)/2)*shMod + (hpw *3/3.5));
  60. h4e = math.floor(((734+826)/2)*shMod + (hpw *3/3.5));
  61. poh1 = math.floor(((301+321)/2)*shMod + (hpw)*(1/3));
  62. poh2 = math.floor(((444+472)/2)*shMod + (hpw)*(1/3));
  63. poh3 = math.floor(((657+695)/2)*shMod + (hpw)*(1/3));
  64. poh4 = math.floor(((939+991)/2)*shMod + (hpw)*(1/3));
  65. poh5 = math.floor(((1041+1099)/2)*shMod + (hpw)*(1/3));
  66.  
  67.  
  68. end
  69.  
  70. p(pohMod)
  71. p("- Spiritual Guidance healing: "..sgf)
  72. p("- Spiritual Healing factor: "..shMod -1)
  73. p(" - Spirit: "..spw)
  74. p(" - Healing: "..hpw)
  75. p("Greater Healing(Rank 1): "..g1h.." (g1h)".." - "..(math.floor((g1h/(370*ihMod))*1000)/1000).. " HpM")
  76. p("Greater Healing(Rank 2): "..g2h.." (g2h)".." - "..(math.floor((g2h/(455*ihMod))*1000)/1000).. " HpM")
  77. p("Greater Healing(Rank 3): "..g3h.." (g3h)".." - "..(math.floor((g3h/(545*ihMod))*1000)/1000).. " HpM")
  78. p("Greater Healing(Rank 4): "..g4h.." (g4h)".." - "..(math.floor((g4h/(655*ihMod))*1000)/1000).. " HpM")
  79. p("Greater Healing(Rank 5): "..g5h.." (g5h)".." - "..(math.floor((g5h/(710*ihMod))*1000)/1000).. " HpM")
  80. p("Heal(Rank 1): "..h1e.." (h1e)".." - "..(math.floor((h1e/(155*ihMod))*1000)/1000).. " HpM")
  81. p("Heal(Rank 2): "..h2e.." (h2e)".." - "..(math.floor((h2e/(205*ihMod))*1000)/1000).. " HpM")
  82. p("Heal(Rank 3): "..h3e.." (h3e)".." - "..(math.floor((h3e/(255*ihMod))*1000)/1000).. " HpM")
  83. p("Heal(Rank 4): "..h4e.." (h4e)".." - "..(math.floor((h4e/(305*ihMod))*1000)/1000).. " HpM")
  84. p("PoH(Rank 1): "..poh1.." (poh1)".." - "..(math.floor((poh1*5/(410*pohMod))*1000)/1000).. " HpM")
  85. p("PoH(Rank 2): "..poh2.." (poh2)".." - "..(math.floor((poh2*5/(560*pohMod))*1000)/1000).. " HpM")
  86. p("PoH(Rank 3): "..poh3.." (poh3)".." - "..(math.floor((poh3*5/(770*pohMod))*1000)/1000).. " HpM")
  87. p("PoH(Rank 4): "..poh4.." (poh4)".." - "..(math.floor((poh4*5/(1030*pohMod))*1000)/1000).. " HpM")
  88. p("PoH(Rank 5): "..poh5.." (poh5)".." - "..(math.floor((poh5*5/(1070*pohMod))*1000)/1000).. " HpM")
  89. end
  90.  
  91. --MTHEALS
  92. function xPriestHeals2()
  93. TargetByName("Tanksname") --Hard targets the tank to heal so nothing fucks the healtarget ever
  94.  
  95. if (UnitMana("player") < 250) and InCombat() and HasItem("Superior Mana Potion")>=1 then UseItemByName("Superior Mana Potion") return end
  96. if (UnitMana("player") < 3550) and InCombat() and HasItem("Major Mana Potion")>=1 then UseItemByName("Major Mana Potion") return end -- priests use major mana first if less than 3550 mana, might wanna change this.
  97. if (UnitMana("player") < 250) and InCombat() and HasItem("Greater Mana Potion")>=1 then UseItemByName("Greater Mana Potion") return end
  98.  
  99.  
  100. if (TargetHealthPct() < .30) and not OnCooldown("Power Word: Shield") and not buffed("Weakened Soul", "target") then --casts PWS if target drops below 30%
  101. CastSpellByName("Power Word: Shield")
  102. end
  103.  
  104. if not ImBusy() and InCombat() and (renewtime==nil or GetTime()-renewtime>= 16) then -- Renew every 16 sec, doesnt check buffed.
  105. CastSpellByName("Renew")
  106. renewtime = GetTime()
  107. end
  108.  
  109. if not OnCooldown("Inner Focus") and not ImBusy() then SpellStopCasting() CastSpellByName("Inner Focus") end
  110.  
  111. xpriestMtHeals()
  112. end
  113.  
  114. function xpriestMtHeals()
  115. if (g5h~=nil) then xPriestCheck() end
  116. gh_shouldStop = gh_shouldStop or false
  117. gh_castFinishTime = gh_castFinishTime or 0
  118. gh_nextCastAt = gh_nextCastAt or 0
  119.  
  120. local currentTime = GetTime()
  121. local gh_cooldown = GetActionCooldown(6)-- VERY IMPORTANT THAT YOU GUYS EITHER CHANGE THIS 6 VALUE OR PUT A SPELL WITH A GCD ON ACTIONSLOT 6 ON THE FIRST 1-12 ACTIONSLOTS, ELSE IT WONT WORK.
  122.  
  123. if gh_cooldown > 0 then
  124. gh_castFinishTime = gh_cooldown + 2.5
  125. gh_shouldStop = true
  126. end
  127.  
  128. if UnitHealth("Target") > UnitHealthMax("Target")-(0.8*g5h) and currentTime > gh_castFinishTime-0.3 and gh_shouldStop then -- This is abit more advanced than the ones for the other classes, here its 0.8*g5h wich means it allows for 20% overheal on what xpriestcheck() has calculated that greater heal 5 will heal.
  129. SpellStopCasting()
  130. gh_nextCastAt = gh_castFinishTime + 0.1
  131. gh_shouldStop = false
  132. end
  133.  
  134. if gh_cooldown <= 0 and currentTime > gh_nextCastAt then
  135. CastSpellByName("Greater Heal(rank 5)") -- if you wanna change rank, dont forget to change g5h up a few rows.
  136. end
  137. end
  138.  
  139.  
  140. function xDruidTonkHeal()
  141. TargetByName("Tanksname") --Hard targets the tank to heal so nothing fucks the healtarget ever
  142.  
  143. if (UnitMana("player") < 250) and InCombat() and HasItem("Superior Mana Potion")>=1 then UseItemByName("Superior Mana Potion") return end -- 1 superior manapot, 2 greater, 3 major, all three if less than 250mana, i didnt wanna spend expensive pots on my druid, used the superior from drops and greater from sos.
  144. if (UnitMana("player") < 250) and InCombat() and HasItem("Greater Mana Potion")>=1 then UseItemByName("Greater Mana Potion") return end
  145. if (UnitMana("player") < 250) and InCombat() and HasItem("Major Mana Potion")>=1 then UseItemByName("Major Mana Potion") return end
  146. local mymanapct = UnitMana("player")/UnitManaMax("player")
  147.  
  148. if not buffed("Rejuvenation", "target") then
  149. rejutime = nil
  150. end
  151.  
  152. if not ImBusy() and (rejutime==nil or GetTime()-rejutime>= 12) and not buffed("Rejuvenation", "target") then --switch the 12 to 15 if you got a druid with 8/8 t2.
  153. rejutime = GetTime()
  154. CastSpellByName("Rejuvenation") --not sure if highest rank is very manaeffective and all that, you guys decide yourself.
  155. end
  156.  
  157. if buffed("Curse of Veil", "target") then CastSpellByName("Remove Curse") end --think this was for nefarian, cant rememeber lol
  158. if not OnCooldown("Innervate") and mymanapct <= 45 then --45% mana on the druid himself, and he casts innervate on himself.
  159. CastSpellByName("Innervate", 1)
  160. end
  161.  
  162. if SpellExists("Swiftmend") and not OnCooldown("Swiftmend") and (TargetHealthPct() < .4) and buffed("Rejuvenation", "target") then
  163. SpellStopCasting()
  164. CastSpellByName("Swiftmend")
  165. rejutime = nil
  166.  
  167. elseif SpellExists("Swiftmend") and not OnCooldown("Swiftmend") and (TargetHealthPct() < .4) and buffed("Regrowth", "target") then
  168. SpellStopCasting()
  169. CastSpellByName("Swiftmend")
  170. regrtime = nil
  171. end
  172.  
  173. if SpellExists("Nature's Swiftness") and not OnCooldown("Nature's Swiftness") and (TargetHealthPct() < .20) then
  174. SpellStopCasting()
  175. CastSpellByName("Nature's Swiftness")
  176. SpellStopCasting()
  177. CastSpellByName("Healing Touch")
  178. end
  179.  
  180. if (TargetHealthPct() < .2) and OnCooldown("Nature's Swiftness") and not buffed("Regrowth", "target") then
  181. xDruidRegr()
  182. end
  183.  
  184. xDruidHT()
  185.  
  186. end
  187.  
  188. function xDruidRegr()
  189. Regr_shouldStop = Regr_shouldStop or false
  190. Regr_castFinishTime = Regr_castFinishTime or 0
  191. Regr_nextCastAt = Regr_nextCastAt or 0
  192.  
  193. local currentTime = GetTime()
  194. local Regr_cooldown = GetActionCooldown(6)-- VERY IMPORTANT THAT YOU GUYS EITHER CHANGE THIS 6 VALUE OR PUT A SPELL WITH A GCD ON ACTIONSLOT 6 ON THE FIRST 1-12 ACTIONSLOTS, ELSE IT WONT WORK.
  195.  
  196. if Regr_cooldown > 0 then
  197. Regr_castFinishTime = Regr_cooldown + 1.8
  198. Regr_shouldStop = true
  199. end
  200.  
  201. if buffed("Regrowth", "target") then
  202. Regr_shouldStop = true
  203. regrtime = GetTime()
  204. end
  205.  
  206. if UnitHealth("Target") > UnitHealthMax("Target")-(0.8*1500) and currentTime > Regr_castFinishTime-0.3 and Regr_shouldStop then
  207. SpellStopCasting()
  208. Regr_nextCastAt = Regr_castFinishTime + 0.1
  209. Regr_shouldStop = false
  210. end
  211.  
  212. if Regr_cooldown <= 0 and currentTime > Regr_nextCastAt then
  213. CastSpellByName("Regrowth")
  214. end
  215. end
  216.  
  217. function xDruidHT()
  218. HT_shouldStop = HT_shouldStop or false
  219. HT_castFinishTime = HT_castFinishTime or 0
  220. HT_nextCastAt = HT_nextCastAt or 0
  221.  
  222. local currentTime = GetTime()
  223. local HT_cooldown = GetActionCooldown(6)-- VERY IMPORTANT THAT YOU GUYS EITHER CHANGE THIS 6 VALUE OR PUT A SPELL WITH A GCD ON ACTIONSLOT 6 ON THE FIRST 1-12 ACTIONSLOTS, ELSE IT WONT WORK.
  224.  
  225. if HT_cooldown > 0 then
  226. HT_castFinishTime = HT_cooldown + 2.5
  227. HT_shouldStop = true
  228. end
  229.  
  230. if UnitHealth("Target") > UnitHealthMax("Target")-(0.8*1300) and currentTime > HT_castFinishTime-0.3 and HT_shouldStop then -- THE 1300 VALUE IS AROUND WHAT MY DRUID HEALS WITH HEALING TOUCH RANK 4.
  231. SpellStopCasting()
  232. HT_nextCastAt = HT_castFinishTime + 0.1
  233. HT_shouldStop = false
  234. end
  235.  
  236. if HT_cooldown <= 0 and currentTime > HT_nextCastAt then
  237. CastSpellByName("Healing Touch(rank 4)")
  238. end
  239. end
  240.  
  241.  
  242.  
  243. --- with this shamancode i won the meters in beta with a boxshaman with 8/8 t1 while still being top4 on dmgmeter with my 2h fury warrior on PW. this code worked really good. made this for PW thats why it uses runes/majormanapots only compared to the other ones
  244. function xShamanSingleHW()
  245. TargetByName("Tanksname") --Hard targets the tank to heal so nothing fucks the healtarget ever
  246. if (UnitMana("player") < 7500) and InCombat() and not OnCooldown("Mana Tide Totem") then CastSpellByName("Mana Tide Totem") return end --hardcoded manavalues for that shaman i used to destroy meters on PW with, so this was the effective mana to use mana tide
  247. if (UnitMana("player") < 5850) and InCombat() and HasItem("Major Mana Potion") >= 0 then UseItemByName("Major Mana Potion") return end --same here with hardcoded mana (when you rewrite these manavalues to fit your shamans, take in mind raidbuffs :))
  248. if (UnitMana("player") < 5000) and InCombat() and HasItem("Dark Rune") >=0 then UseItemByName("Dark Rune") return end -- same as above, might wanna comment this whole line out if you dont wanna use dark runes
  249.  
  250. if SpellExists("Nature's Swiftness") and not OnCooldown("Nature's Swiftness") and (TargetHealthPct() < .15) then
  251. SpellStopCasting()
  252. CastSpellByName("Nature's Swiftness")
  253. SpellStopCasting()
  254. CastSpellByName("Healing Wave")
  255. HW_nextCastAt = HW_castFinishTime + 0.1
  256. HW_shouldStop = false
  257. end
  258.  
  259. if buffed("Nature's Swiftness","player") then
  260. CastSpellByName("Healing Wave")
  261. HW_nextCastAt = HW_castFinishTime + 0.1
  262. HW_shouldStop = false
  263. end
  264.  
  265. HW_shouldStop = HW_shouldStop or false
  266. HW_castFinishTime = HW_castFinishTime or 0
  267. HW_nextCastAt = HW_nextCastAt or 0
  268.  
  269. local currentTime = GetTime()
  270. local HW_cooldown = GetActionCooldown(6) -- VERY IMPORTANT THAT YOU GUYS EITHER CHANGE THIS 6 VALUE OR PUT A SPELL WITH A GCD ON ACTIONSLOT 6 ON THE FIRST 1-12 ACTIONSLOTS, ELSE IT WONT WORK.
  271.  
  272. if HW_cooldown > 0 then
  273. HW_castFinishTime = HW_cooldown + 2.5
  274. HW_shouldStop = true
  275. end
  276.  
  277. if UnitHealth("Target") > UnitHealthMax("Target")-(0.8*2150) and currentTime > HW_castFinishTime-0.2 and HW_shouldStop then -- THIS VALUE OF 2150 IS WHAT THE RANK 5 HW IS EXPECTED TO HEAL FOR ON MY SHAMAN, CHECK WHAT YOUR RANK 5(or change rank below and check that value) AND PUT IN THERE, THE x0.8 MEANS IT ALLOWS FOR 20% OVERHEAL BEFORE SPELLSTOPCASTING TO RECAST.
  278. SpellStopCasting()
  279. HW_nextCastAt = HW_castFinishTime + 0.1
  280. HW_shouldStop = false
  281. end
  282.  
  283. if HW_cooldown <= 0 and currentTime > HW_nextCastAt then
  284. CastSpellByName("Healing Wave(rank 5)")
  285. end
  286. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement