Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function()
- local insanityGain = 0;
- local currentInsanity = UnitPower("player", SPELL_POWER_INSANITY, forceUpdate);
- local deathAndMadness = nil;
- local maxInsanity = UnitPowerMax("player", SPELL_POWER_INSANITY);
- local currentSpell = UnitCastingInfo('player');
- local specGroup = GetActiveSpecGroup();
- local isFotMSelected = select(4, GetTalentInfo(1, 1, specGroup));
- local S2MName = select(2, GetTalentInfo(7, 3, specGroup));
- local DaMName = select(2, GetTalentInfo(1, 2, specGroup));
- local isS2MActive = select(11, WA_GetUnitBuff("player", S2MName));
- local isDaMActive = select(11, WA_GetUnitBuff("player", DaMName));
- if currentSpell == nil then
- currentSpell = UnitChannelInfo('player');
- end
- if currentSpell == nil then
- for i=1,40 do
- local name, icon, _, _, _, etime = UnitBuff("player",i)
- if name == "Death and Madness" then
- currentSpell = "Death and Madness";
- end
- end
- end
- if currentSpell == nil then
- insanityGain = 0;
- return 0,0,0,0;
- end
- local MB = GetSpellInfo(8092); -- Mind Blast
- local VT = GetSpellInfo(34914); -- Vampiric Touch
- local VOT = GetSpellInfo(263165); -- Void Torrent
- local MF = GetSpellInfo(15407); -- Mind Flay
- if currentSpell == MB then --Mind Blast
- if isFotMSelected then
- insanityGain = (8) * 1.2;
- else
- insanityGain = 8;
- end
- elseif currentSpell == VOT then --Void Torrent
- insanityGain = 15;
- elseif currentSpell == MF then --Mind Flay
- if isFotMSelected then
- insanityGain = (3) * 1.2;
- else
- insanityGain = 3;
- end
- elseif currentSpell == VT then --Vampric Touch
- insanityGain = 5;
- elseif currentSpell == "Death and Madness" then
- if isDaMActive then
- insanityGain = 10;
- else
- insanityGain = 0;
- end
- else
- insanityGain = 0;
- return 0,0,0,0;
- end
- if isS2MActive then
- insanityGain = insanityGain * 2.0;
- end
- local x = (currentInsanity+insanityGain);
- local y = math.modf(x);
- return y,maxInsanity,0,0;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement