Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---NOTE THESE FEW LINES BELOW HAS TO BE ADDED IN THE FSMB:OnUpdate() function.
- elseif (event == "PLAYER_LOGIN") then
- if myclass=="Priest" then
- xPriestCheck()
- end
- ---that makes the xPriestCheck load for priests on login, if that check aint done it cant calculate the healvalue
- 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.
- local p= Printd
- local _,_,_,_,talentRank,_ = GetTalentInfo(2,14);
- local _,spw,_,_ = UnitStat('player',5);
- local sgf = spw * 5*talentRank/100;
- local _,_,_,_,talentRank,_ = GetTalentInfo(2,15);
- local shMod = 2*talentRank/100 + 1;
- local _,_,_,_,talentRank,_ = GetTalentInfo(2,10);
- local ihMod = 1 - 5*talentRank/100;
- local _,_,_,_,talentRank,_ = GetTalentInfo(2,12);
- local pohMod = 1 - 10*talentRank/100;
- local hpw = BonusScanner:GetBonus("HEAL")
- if sgf>0 then
- g1h = math.floor(((924+1038)/2)*shMod + ((hpw +sgf)*(3/3.5)));
- g2h = math.floor(((1178+1318)/2)*shMod + ((hpw +sgf)*(3/3.5)));
- g3h = math.floor(((1470+1642)/2)*shMod + ((hpw +sgf)*(3/3.5)));
- g4h = math.floor(((1813+2021)/2)*shMod + ((hpw +sgf)*(3/3.5)));
- g5h = math.floor(((1966+2194)/2)*shMod + ((hpw +sgf)*(3/3.5)));
- h1e = math.floor(((307+353)/2)*shMod + (hpw +sgf)*(3/3.5)*(1-((20-16)*0.0375)));
- h2e = math.floor(((445+507)/2)*shMod + (hpw +sgf)*(3/3.5));
- h3e = math.floor(((586+662)/2)*shMod + (hpw +sgf)*(3/3.5));
- h4e = math.floor(((734+826)/2)*shMod + (hpw +sgf)*(3/3.5));
- poh1 = math.floor(((301+321)/2)*shMod + (hpw +sgf)*(1/3));
- poh2 = math.floor(((444+472)/2)*shMod + (hpw +sgf)*(1/3));
- poh3 = math.floor(((657+695)/2)*shMod + (hpw +sgf)*(1/3));
- poh4 = math.floor(((939+991)/2)*shMod + (hpw +sgf)*(1/3));
- poh5 = math.floor(((1041+1099)/2)*shMod + (hpw +sgf)*(1/3));
- else
- g1h = math.floor(((924+1038)/2)*shMod + (hpw *3/3.5));
- g2h = math.floor(((1178+1318)/2)*shMod + (hpw *3/3.5));
- g3h = math.floor(((1470+1642)/2)*shMod + (hpw *3/3.5));
- g4h = math.floor(((1813+2021)/2)*shMod + (hpw *3/3.5));
- g5h = math.floor(((1966+2194)/2)*shMod + (hpw *3/3.5));
- h1e = math.floor(((307+353)/2)*shMod + (hpw *3/3.5)*(1-((20-16)*0.0375)));
- h2e = math.floor(((445+507)/2)*shMod + (hpw *3/3.5));
- h3e = math.floor(((586+662)/2)*shMod + (hpw *3/3.5));
- h4e = math.floor(((734+826)/2)*shMod + (hpw *3/3.5));
- poh1 = math.floor(((301+321)/2)*shMod + (hpw)*(1/3));
- poh2 = math.floor(((444+472)/2)*shMod + (hpw)*(1/3));
- poh3 = math.floor(((657+695)/2)*shMod + (hpw)*(1/3));
- poh4 = math.floor(((939+991)/2)*shMod + (hpw)*(1/3));
- poh5 = math.floor(((1041+1099)/2)*shMod + (hpw)*(1/3));
- end
- p(pohMod)
- p("- Spiritual Guidance healing: "..sgf)
- p("- Spiritual Healing factor: "..shMod -1)
- p(" - Spirit: "..spw)
- p(" - Healing: "..hpw)
- p("Greater Healing(Rank 1): "..g1h.." (g1h)".." - "..(math.floor((g1h/(370*ihMod))*1000)/1000).. " HpM")
- p("Greater Healing(Rank 2): "..g2h.." (g2h)".." - "..(math.floor((g2h/(455*ihMod))*1000)/1000).. " HpM")
- p("Greater Healing(Rank 3): "..g3h.." (g3h)".." - "..(math.floor((g3h/(545*ihMod))*1000)/1000).. " HpM")
- p("Greater Healing(Rank 4): "..g4h.." (g4h)".." - "..(math.floor((g4h/(655*ihMod))*1000)/1000).. " HpM")
- p("Greater Healing(Rank 5): "..g5h.." (g5h)".." - "..(math.floor((g5h/(710*ihMod))*1000)/1000).. " HpM")
- p("Heal(Rank 1): "..h1e.." (h1e)".." - "..(math.floor((h1e/(155*ihMod))*1000)/1000).. " HpM")
- p("Heal(Rank 2): "..h2e.." (h2e)".." - "..(math.floor((h2e/(205*ihMod))*1000)/1000).. " HpM")
- p("Heal(Rank 3): "..h3e.." (h3e)".." - "..(math.floor((h3e/(255*ihMod))*1000)/1000).. " HpM")
- p("Heal(Rank 4): "..h4e.." (h4e)".." - "..(math.floor((h4e/(305*ihMod))*1000)/1000).. " HpM")
- p("PoH(Rank 1): "..poh1.." (poh1)".." - "..(math.floor((poh1*5/(410*pohMod))*1000)/1000).. " HpM")
- p("PoH(Rank 2): "..poh2.." (poh2)".." - "..(math.floor((poh2*5/(560*pohMod))*1000)/1000).. " HpM")
- p("PoH(Rank 3): "..poh3.." (poh3)".." - "..(math.floor((poh3*5/(770*pohMod))*1000)/1000).. " HpM")
- p("PoH(Rank 4): "..poh4.." (poh4)".." - "..(math.floor((poh4*5/(1030*pohMod))*1000)/1000).. " HpM")
- p("PoH(Rank 5): "..poh5.." (poh5)".." - "..(math.floor((poh5*5/(1070*pohMod))*1000)/1000).. " HpM")
- end
- --MTHEALS
- function xPriestHeals2()
- TargetByName("Tanksname") --Hard targets the tank to heal so nothing fucks the healtarget ever
- if (UnitMana("player") < 250) and InCombat() and HasItem("Superior Mana Potion")>=1 then UseItemByName("Superior Mana Potion") return end
- 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.
- if (UnitMana("player") < 250) and InCombat() and HasItem("Greater Mana Potion")>=1 then UseItemByName("Greater Mana Potion") return end
- if (TargetHealthPct() < .30) and not OnCooldown("Power Word: Shield") and not buffed("Weakened Soul", "target") then --casts PWS if target drops below 30%
- CastSpellByName("Power Word: Shield")
- end
- if not ImBusy() and InCombat() and (renewtime==nil or GetTime()-renewtime>= 16) then -- Renew every 16 sec, doesnt check buffed.
- CastSpellByName("Renew")
- renewtime = GetTime()
- end
- if not OnCooldown("Inner Focus") and not ImBusy() then SpellStopCasting() CastSpellByName("Inner Focus") end
- xpriestMtHeals()
- end
- function xpriestMtHeals()
- if (g5h~=nil) then xPriestCheck() end
- gh_shouldStop = gh_shouldStop or false
- gh_castFinishTime = gh_castFinishTime or 0
- gh_nextCastAt = gh_nextCastAt or 0
- local currentTime = GetTime()
- 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.
- if gh_cooldown > 0 then
- gh_castFinishTime = gh_cooldown + 2.5
- gh_shouldStop = true
- end
- 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.
- SpellStopCasting()
- gh_nextCastAt = gh_castFinishTime + 0.1
- gh_shouldStop = false
- end
- if gh_cooldown <= 0 and currentTime > gh_nextCastAt then
- CastSpellByName("Greater Heal(rank 5)") -- if you wanna change rank, dont forget to change g5h up a few rows.
- end
- end
- function xDruidTonkHeal()
- TargetByName("Tanksname") --Hard targets the tank to heal so nothing fucks the healtarget ever
- 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.
- if (UnitMana("player") < 250) and InCombat() and HasItem("Greater Mana Potion")>=1 then UseItemByName("Greater Mana Potion") return end
- if (UnitMana("player") < 250) and InCombat() and HasItem("Major Mana Potion")>=1 then UseItemByName("Major Mana Potion") return end
- local mymanapct = UnitMana("player")/UnitManaMax("player")
- if not buffed("Rejuvenation", "target") then
- rejutime = nil
- end
- 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.
- rejutime = GetTime()
- CastSpellByName("Rejuvenation") --not sure if highest rank is very manaeffective and all that, you guys decide yourself.
- end
- if buffed("Curse of Veil", "target") then CastSpellByName("Remove Curse") end --think this was for nefarian, cant rememeber lol
- if not OnCooldown("Innervate") and mymanapct <= 45 then --45% mana on the druid himself, and he casts innervate on himself.
- CastSpellByName("Innervate", 1)
- end
- if SpellExists("Swiftmend") and not OnCooldown("Swiftmend") and (TargetHealthPct() < .4) and buffed("Rejuvenation", "target") then
- SpellStopCasting()
- CastSpellByName("Swiftmend")
- rejutime = nil
- elseif SpellExists("Swiftmend") and not OnCooldown("Swiftmend") and (TargetHealthPct() < .4) and buffed("Regrowth", "target") then
- SpellStopCasting()
- CastSpellByName("Swiftmend")
- regrtime = nil
- end
- if SpellExists("Nature's Swiftness") and not OnCooldown("Nature's Swiftness") and (TargetHealthPct() < .20) then
- SpellStopCasting()
- CastSpellByName("Nature's Swiftness")
- SpellStopCasting()
- CastSpellByName("Healing Touch")
- end
- if (TargetHealthPct() < .2) and OnCooldown("Nature's Swiftness") and not buffed("Regrowth", "target") then
- xDruidRegr()
- end
- xDruidHT()
- end
- function xDruidRegr()
- Regr_shouldStop = Regr_shouldStop or false
- Regr_castFinishTime = Regr_castFinishTime or 0
- Regr_nextCastAt = Regr_nextCastAt or 0
- local currentTime = GetTime()
- 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.
- if Regr_cooldown > 0 then
- Regr_castFinishTime = Regr_cooldown + 1.8
- Regr_shouldStop = true
- end
- if buffed("Regrowth", "target") then
- Regr_shouldStop = true
- regrtime = GetTime()
- end
- if UnitHealth("Target") > UnitHealthMax("Target")-(0.8*1500) and currentTime > Regr_castFinishTime-0.3 and Regr_shouldStop then
- SpellStopCasting()
- Regr_nextCastAt = Regr_castFinishTime + 0.1
- Regr_shouldStop = false
- end
- if Regr_cooldown <= 0 and currentTime > Regr_nextCastAt then
- CastSpellByName("Regrowth")
- end
- end
- function xDruidHT()
- HT_shouldStop = HT_shouldStop or false
- HT_castFinishTime = HT_castFinishTime or 0
- HT_nextCastAt = HT_nextCastAt or 0
- local currentTime = GetTime()
- 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.
- if HT_cooldown > 0 then
- HT_castFinishTime = HT_cooldown + 2.5
- HT_shouldStop = true
- end
- 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.
- SpellStopCasting()
- HT_nextCastAt = HT_castFinishTime + 0.1
- HT_shouldStop = false
- end
- if HT_cooldown <= 0 and currentTime > HT_nextCastAt then
- CastSpellByName("Healing Touch(rank 4)")
- end
- end
- --- 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
- function xShamanSingleHW()
- TargetByName("Tanksname") --Hard targets the tank to heal so nothing fucks the healtarget ever
- 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
- 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 :))
- 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
- if SpellExists("Nature's Swiftness") and not OnCooldown("Nature's Swiftness") and (TargetHealthPct() < .15) then
- SpellStopCasting()
- CastSpellByName("Nature's Swiftness")
- SpellStopCasting()
- CastSpellByName("Healing Wave")
- HW_nextCastAt = HW_castFinishTime + 0.1
- HW_shouldStop = false
- end
- if buffed("Nature's Swiftness","player") then
- CastSpellByName("Healing Wave")
- HW_nextCastAt = HW_castFinishTime + 0.1
- HW_shouldStop = false
- end
- HW_shouldStop = HW_shouldStop or false
- HW_castFinishTime = HW_castFinishTime or 0
- HW_nextCastAt = HW_nextCastAt or 0
- local currentTime = GetTime()
- 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.
- if HW_cooldown > 0 then
- HW_castFinishTime = HW_cooldown + 2.5
- HW_shouldStop = true
- end
- 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.
- SpellStopCasting()
- HW_nextCastAt = HW_castFinishTime + 0.1
- HW_shouldStop = false
- end
- if HW_cooldown <= 0 and currentTime > HW_nextCastAt then
- CastSpellByName("Healing Wave(rank 5)")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement