Skip to content

Commit

Permalink
Self Buff Option / Added Spellstone Support
Browse files Browse the repository at this point in the history
Added the self buff option back in classic versions which was previously broken and temporary hidden.  Added support for Warlock Spellstone's and added additional checks for Fel Intelligence.
  • Loading branch information
Softrix committed Sep 26, 2022
1 parent 4be871c commit 5fc8f2a
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 18 deletions.
17 changes: 11 additions & 6 deletions SmartBuff.buffs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ function SMARTBUFF_InitItemList()
SMARTBUFF_SUPERIORMANAOIL = GetItemInfo(22521); -- Brilliant Mana Oil
SMARTBUFF_SUPERIORWIZARDOIL = GetItemInfo(22522); -- Superior Wizard Oil
SMARTBUFF_EXCEPTIONALWIZARDOIL = GetItemInfo(36900); -- Exceptional Wizard Oil
SMARTBUFF_LOCKSPELLSTONE1 = GetItemInfo(41192); -- Warlock Create Spellstone 1
SMARTBUFF_LOCKSPELLSTONE2 = GetItemInfo(41193); -- Warlock Create Spellstone 2
SMARTBUFF_LOCKSPELLSTONE3 = GetItemInfo(41194); -- Warlock Create Spellstone 3
SMARTBUFF_LOCKSPELLSTONE4 = GetItemInfo(41195); -- Warlock Create Spellstone 4
SMARTBUFF_LOCKSPELLSTONE5 = GetItemInfo(41196); -- Warlock Create Spellstone 5

SMARTBUFF_OILOFIMMOLATION = GetItemInfo(8956); -- Oil of Immolation
SMARTBUFF_SOLIDWSTONE = GetItemInfo(7965); -- Solid Weighstone
Expand Down Expand Up @@ -261,6 +266,7 @@ function SMARTBUFF_InitSpellIDs()
-- Misc
SMARTBUFF_KIRUSSOV = GetSpellInfo(46302); --"K'iru's Song of Victory"
SMARTBUFF_FISHING = GetSpellInfo(7620) or GetSpellInfo(111541); --"Fishing"
SMARTBUFF_FELINTELLIGENCE = GetSpellInfo(54424) -- "Fel Intelligence"

-- Druid
SMARTBUFF_DRUID_CAT = GetSpellInfo(768); --"Cat Form"
Expand Down Expand Up @@ -675,12 +681,11 @@ function SMARTBUFF_InitSpellList()
{SMARTBUFF_CREATESS, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_SOULSTONEGEM},
{SMARTBUFF_CREATESSLES, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_SOULSTONEGEM},
{SMARTBUFF_CREATESSMIN, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_SOULSTONEGEM},
{SMARTBUFF_SPELLSTONE6, 60, SMARTBUFF_CONST_INV},
{SMARTBUFF_SPELLSTONE5, 60, SMARTBUFF_CONST_INV},
{SMARTBUFF_SPELLSTONE4, 60, SMARTBUFF_CONST_INV},
{SMARTBUFF_SPELLSTONE3, 60, SMARTBUFF_CONST_INV},
{SMARTBUFF_SPELLSTONE2, 60, SMARTBUFF_CONST_INV},
{SMARTBUFF_SPELLSTONE1, 60, SMARTBUFF_CONST_INV},
{SMARTBUFF_LOCKSPELLSTONE5, 60, SMARTBUFF_CONST_INV},
{SMARTBUFF_LOCKSPELLSTONE4, 60, SMARTBUFF_CONST_INV},
{SMARTBUFF_LOCKSPELLSTONE3, 60, SMARTBUFF_CONST_INV},
{SMARTBUFF_LOCKSPELLSTONE2, 60, SMARTBUFF_CONST_INV},
{SMARTBUFF_LOCKSPELLSTONE1, 60, SMARTBUFF_CONST_INV},
{SMARTBUFF_FIRESTONE7, 60, SMARTBUFF_CONST_INV},
{SMARTBUFF_FIRESTONE6, 60, SMARTBUFF_CONST_INV},
{SMARTBUFF_FIRESTONE5, 60, SMARTBUFF_CONST_INV},
Expand Down
22 changes: 17 additions & 5 deletions SmartBuff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-- Cast the most important buffs on you, tanks or party/raid members/pets.
-------------------------------------------------------------------------------

SMARTBUFF_DATE = "210922 Dev";
SMARTBUFF_DATE = "260922";
SMARTBUFF_VERSION = "r35."..SMARTBUFF_DATE;
SMARTBUFF_VERSIONMIN = 11403; -- min version
SMARTBUFF_VERSIONNR = 30400; -- max version
Expand All @@ -23,7 +23,7 @@ local SmartbuffSession = true;
local SmartbuffVerCheck = false; -- for my use when checking guild users/testers versions :)
local wowVersionString, wowBuild, _, wowTOC = GetBuildInfo();
local isWOTLKC = (_G.WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC and wowTOC >= 30400);
local SmartbuffRevision = 34;
local SmartbuffRevision = 35;
local SmartbuffVerNotifyList = {}

-- Smartbuff now uses LibRangeCheck-2.0 by Mitchnull, not fully implemented
Expand Down Expand Up @@ -1029,7 +1029,7 @@ function SMARTBUFF_AddSoloSetup()
cUnits[0] = { };
cUnits[0][0] = "player";
if (sPlayerClass == "HUNTER" or sPlayerClass == "WARLOCK" or sPlayerClass == "MAGE") then cGroups[0][1] = "pet"; end
if (B[CS()][currentTemplate]) then
if (B[CS()][currentTemplate] and B[CS()][currentTemplate].SelfFirst) then
if (not cClassGroups) then
cClassGroups = { };
end
Expand Down Expand Up @@ -2009,7 +2009,7 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell)
if (bUsable) then
bUsable = IsPowerLimitOk(bs);
end

-- Check for buffs which depends on a pet
if (bUsable and cBuff.Params == SG.CheckPet and UnitExists("pet")) then bUsable = false end
if (bUsable and cBuff.Params == SG.CheckPetNeeded and not UnitExists("pet")) then bUsable = false end
Expand Down Expand Up @@ -2037,7 +2037,14 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell)
bUsable = false;
end
end


-- check for Fel Intelligence
if (bUsable and CheckForBuff(SMARTBUFF_FELINTELLIGENCE) and (sPlayerClass == "PRIEST" or sPlayerClass == "MAGE")) then
if (buffnS == SMARTBUFF_AI or buffnS == SMARTBUFF_ABRB1 or buffnS == SMARTBUFF_DS or buffnS == SMARTBUFF_POSRB1) then
bUsable = false;
end
end

if (bUsable and not (cBuff.Type == SMARTBUFF_CONST_TRACK or SMARTBUFF_IsItem(cBuff.Type))) then
-- check if you have enough mana/rage/energy to cast
local isUsable, notEnoughMana = IsUsableSpell(buffnS);
Expand Down Expand Up @@ -3779,6 +3786,9 @@ function SMARTBUFF_OHideSAButton()
O.HideSAButton = not O.HideSAButton;
SMARTBUFF_ShowSAButton();
end
function SMARTBUFF_OSelfFirst()
B[CS()][currentTemplate].SelfFirst = not B[CS()][currentTemplate].SelfFirst;
end
function SMARTBUFF_OWarnWhenMountedButton()
O.WarnWhileMounted = not O.WarnWhileMounted;
end
Expand Down Expand Up @@ -4117,6 +4127,8 @@ function SMARTBUFF_Options_OnShow()

SMARTBUFF_ShowSubGroupsOptions();
SMARTBUFF_SetCheckButtonBuffs(0);

SmartBuffOptionsFrame_cbSelfFirst:SetChecked(B[CS()][currentTemplate].SelfFirst);

SMARTBUFF_Splash_Show();

Expand Down
31 changes: 31 additions & 0 deletions SmartBuff.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,37 @@
</OnShow>
</Scripts>
</ScrollFrame>
<CheckButton name="SmartBuffOptionsFrame_cbSelfFirst" inherits="OptionsCheckButtonTemplate">
<Size>
<AbsDimension x="20" y="20" />
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="SmartBuffOptionsFrame_ScrollFrameBuffs" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="110" y="-4" />
</Offset>
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="0" top="0" bottom="0" />
</HitRectInsets>
<Scripts>
<OnLoad>
getglobal(self:GetName().."Text"):SetText(SMARTBUFF_OFT_SELFFIRST);
getglobal(self:GetName().."Text"):SetFontObject(GameFontNormalSmall);
</OnLoad>
<OnClick>
SMARTBUFF_OSelfFirst();
</OnClick>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(SMARTBUFF_OFTT_SELFFIRST, SMARTBUFF_TTC_R, SMARTBUFF_TTC_G, SMARTBUFF_TTC_B, SMARTBUFF_TTC_A);
</OnEnter>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
</Scripts>
</CheckButton>
<Button name="SmartBuffOptionsFrameRBT" inherits="OptionsButtonTemplate" text="SMARTBUFF_OFT_RBT">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="BOTTOMLEFT">
Expand Down
13 changes: 6 additions & 7 deletions localization.en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
SMARTBUFF_WHATSNEW = "\n\n|cffffffff Whats new:|r\n\n"
.." |cffffffffClassic version by Codermik\n"
.." Please report any issues on Curse or Discord.|r\n\n\n"
.." Changes in r34:\n\n"
.." * Added the ability to change the missing buff\n"
.." sound from the options screen.\n\n"
.." * Added option to warn for missing buffs while\n"
.." you are mounted.\n\n"
.." * Fixed issue with Moonkin form not prompting \n"
.." with missing buff notifications.\n\n"
.." Changes in r35:\n\n"
.." * Added the self buff option into classic\n"
.." versions of Smartbuff.\n\n"
.." * Added Warlock Spellstones to the list.\n\n"
.." * Added checks for Fel Intelligence that was \n"
.." causing missing buff spam.\n\n"
.."\n\n"
.." |c0000FF96Many thanks to Chris S. for his donation and\n"
.." supporting my addon development.\n\n"
Expand Down

0 comments on commit 5fc8f2a

Please sign in to comment.