Skip to content

Commit

Permalink
First pass at missing TWW fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ynazar1 committed Jul 28, 2024
1 parent 2c7c0b9 commit 694e5cb
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 39 deletions.
38 changes: 21 additions & 17 deletions SmartBuff.buffs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ function SMARTBUFF_InitSpellIDs()
SMARTBUFF_WINDFURYW = getSpellBookItemByName(33757); --"Windfury Weapon"
SMARTBUFF_FLAMETONGUEW = getSpellBookItemByName(318038); --"Flametongue Weapon"
SMARTBUFF_EVERLIVINGW = getSpellBookItemByName(382021); --"Everliving Weapon"
SMARTBUFF_SKYFURY = getSpellBookItemByName(462854); --"Skyfury"

-- Shaman buff links
S.ChainShamanShield = { SMARTBUFF_LIGHTNINGSHIELD, SMARTBUFF_WATERSHIELD, SMARTBUFF_EARTHSHIELD };
Expand Down Expand Up @@ -651,51 +652,52 @@ function SMARTBUFF_InitSpellIDs()

-- Paladin
SMARTBUFF_RIGHTEOUSFURY = getSpellBookItemByName(25780); --"Righteous Fury"
-- SMARTBUFF_HOLYSHIELD = getSpellBookIteByName(20925); --"Sacred Shield"
-- SMARTBUFF_HOLYSHIELD = getSpellBookItemByName(20925); --"Sacred Shield"
SMARTBUFF_BOK = getSpellBookItemByName(203538); --"Greater Blessing of Kings"
-- SMARTBUFF_BOM = getSpellBookIteByName(203528); --"Greater Blessing of Might"
-- SMARTBUFF_BOM = getSpellBookItemByName(203528); --"Greater Blessing of Might"
SMARTBUFF_BOW = getSpellBookItemByName(203539); --"Greater Blessing of Wisdom"
SMARTBUFF_HOF = getSpellBookItemByName(1044); --"Blessing of Freedom"
SMARTBUFF_HOP = getSpellBookItemByName(1022); --"Blessing of Protection"
SMARTBUFF_HOSAL = getSpellBookItemByName(204013); --"Blessing of Salvation"
-- SMARTBUFF_SOJUSTICE = getSpellBookIteByName(20164); --"Seal of Justice"
-- SMARTBUFF_SOINSIGHT = getSpellBookIteByName(20165); --"Seal of Insight"
-- SMARTBUFF_SORIGHTEOUSNESS = getSpellBookIteByName(20154); --"Seal of Righteousness"
-- SMARTBUFF_SOTRUTH = getSpellBookIteByName(31801); --"Seal of Truth"
-- SMARTBUFF_SOCOMMAND = getSpellBookIteByName(105361); --"Seal of Command"
-- SMARTBUFF_SOJUSTICE = getSpellBookItemByName(20164); --"Seal of Justice"
-- SMARTBUFF_SOINSIGHT = getSpellBookItemByName(20165); --"Seal of Insight"
-- SMARTBUFF_SORIGHTEOUSNESS = getSpellBookItemByName(20154); --"Seal of Righteousness"
-- SMARTBUFF_SOTRUTH = getSpellBookItemByName(31801); --"Seal of Truth"
-- SMARTBUFF_SOCOMMAND = getSpellBookItemByName(105361); --"Seal of Command"
SMARTBUFF_AVENGINGWARTH = getSpellBookItemByName(31884); --"Avenging Wrath"
SMARTBUFF_BEACONOFLIGHT = getSpellBookItemByName(53563); --"Beacon of Light"
SMARTBUFF_BEACONOFAITH = getSpellBookItemByName(156910); --"Beacon of Faith"
SMARTBUFF_CRUSADERAURA = getSpellBookItemByName(32223); --"Crusader Aura"
SMARTBUFF_DEVOTIONAURA = getSpellBookItemByName(465); --"Devotion Aura"
SMARTBUFF_RETRIBUTIONAURA = getSpellBookItemByName(183435); --"Retribution Aura"
SMARTBUFF_CONCENTRATIONAURA = getSpellBookItemByName(317920); --"Concentration Aura"
-- Paladin buff links
S.ChainPaladinAura = { SMARTBUFF_DEVOTIONAURA, SMARTBUFF_RETRIBUTIONAURA };
S.ChainPaladinAura = { SMARTBUFF_DEVOTIONAURA, SMARTBUFF_RETRIBUTIONAURA, SMARTBUFF_CONCENTRATIONAURA };
S.ChainPaladinSeal = { SMARTBUFF_SOCOMMAND, SMARTBUFF_SOTRUTH, SMARTBUFF_SOJUSTICE, SMARTBUFF_SOINSIGHT, SMARTBUFF_SORIGHTEOUSNESS };
S.ChainPaladinBlessing = { SMARTBUFF_BOK, SMARTBUFF_BOM, SMARTBUFF_BOW};

-- Death Knight
SMARTBUFF_DANCINGRW = getSpellBookItemByName(49028); --"Dancing Rune Weapon"
-- SMARTBUFF_BLOODPRESENCE = getSpellBookIteByName(48263); --"Blood Presence"
-- SMARTBUFF_FROSTPRESENCE = getSpellBookIteByName(48266); --"Frost Presence"
-- SMARTBUFF_UNHOLYPRESENCE = getSpellBookIteByName(48265); --"Unholy Presence"
-- SMARTBUFF_BLOODPRESENCE = getSpellBookItemByName(48263); --"Blood Presence"
-- SMARTBUFF_FROSTPRESENCE = getSpellBookItemByName(48266); --"Frost Presence"
-- SMARTBUFF_UNHOLYPRESENCE = getSpellBookItemByName(48265); --"Unholy Presence"
SMARTBUFF_PATHOFFROST = getSpellBookItemByName(3714); --"Path of Frost"
-- SMARTBUFF_BONESHIELD = getSpellBookIteByName(49222); --"Bone Shield"
-- SMARTBUFF_BONESHIELD = getSpellBookItemByName(49222); --"Bone Shield"
SMARTBUFF_HORNOFWINTER = getSpellBookItemByName(57330); --"Horn of Winter"
SMARTBUFF_RAISEDEAD = getSpellBookItemByName(46584); --"Raise Dead"
-- SMARTBUFF_POTGRAVE = getSpellBookIteByName(155522); --"Power of the Grave" (P)
-- SMARTBUFF_POTGRAVE = getSpellBookItemByName(155522); --"Power of the Grave" (P)
-- Death Knight buff links
S.ChainDKPresence = { SMARTBUFF_BLOODPRESENCE, SMARTBUFF_FROSTPRESENCE, SMARTBUFF_UNHOLYPRESENCE };

-- Monk
-- SMARTBUFF_LOTWT = getSpellBookIteByName(116781); --"Legacy of the White Tiger"
-- SMARTBUFF_LOTE = getSpellBookIteByName(115921); --"Legacy of the Emperor"
-- SMARTBUFF_LOTWT = getSpellBookItemByName(116781); --"Legacy of the White Tiger"
-- SMARTBUFF_LOTE = getSpellBookItemByName(115921); --"Legacy of the Emperor"
SMARTBUFF_BLACKOX = getSpellBookItemByName(115315); --"Summon Black Ox Statue"
SMARTBUFF_JADESERPENT = getSpellBookItemByName(115313); --"Summon Jade Serpent Statue"
SMARTBUFF_SOTFIERCETIGER = getSpellBookItemByName(103985); --"Stance of the Fierce Tiger"
SMARTBUFF_SOTSTURDYOX = getSpellBookItemByName(115069); --"Stagger"
-- SMARTBUFF_SOTWISESERPENT = getSpellBookIteByName(115070); --"Stance of the Wise Serpent"
-- SMARTBUFF_SOTSPIRITEDCRANE= getSpellBookIteByName(154436); --"Stance of the Spirited Crane"
-- SMARTBUFF_SOTWISESERPENT = getSpellBookItemByName(115070); --"Stance of the Wise Serpent"
-- SMARTBUFF_SOTSPIRITEDCRANE= getSpellBookItemByName(154436); --"Stance of the Spirited Crane"

-- Monk buff links
S.ChainMonkStatue = { SMARTBUFF_BLACKOX, SMARTBUFF_JADESERPENT };
Expand Down Expand Up @@ -1091,6 +1093,7 @@ function SMARTBUFF_InitSpellList()
{SMARTBUFF_ASCENDANCE_ENH, 0.25, SMARTBUFF_CONST_SELF},
{SMARTBUFF_ASCENDANCE_RES, 0.25, SMARTBUFF_CONST_SELF},
{SMARTBUFF_EMASTERY, 0.5, SMARTBUFF_CONST_SELF},
{SMARTBUFF_SKYFURY, 10, SMARTBUFF_CONST_GROUP, {16}},
{SMARTBUFF_WATERWALKING, 10, SMARTBUFF_CONST_GROUP, {28}}
};
end
Expand Down Expand Up @@ -1146,6 +1149,7 @@ function SMARTBUFF_InitSpellList()
{SMARTBUFF_CRUSADERAURA, -1, SMARTBUFF_CONST_SELF},
{SMARTBUFF_DEVOTIONAURA, -1, SMARTBUFF_CONST_SELF, nil, nil, nil, S.ChainPaladinAura},
{SMARTBUFF_RETRIBUTIONAURA, -1, SMARTBUFF_CONST_SELF, nil, nil, nil, S.ChainPaladinAura},
{SMARTBUFF_CONCENTRATIONAURA, -1, SMARTBUFF_CONST_SELF, nil, nil, nil, S.ChainPaladinAura},
{SMARTBUFF_SOTRUTH, -1, SMARTBUFF_CONST_STANCE, nil, nil, nil, S.ChainPaladinSeal},
{SMARTBUFF_SORIGHTEOUSNESS, -1, SMARTBUFF_CONST_STANCE, nil, nil, nil, S.ChainPaladinSeal},
{SMARTBUFF_SOJUSTICE, -1, SMARTBUFF_CONST_STANCE, nil, nil, nil, S.ChainPaladinSeal},
Expand Down
45 changes: 23 additions & 22 deletions SmartBuff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
SMARTBUFF_DATE = "111223";

SMARTBUFF_VERSION = "r25." .. SMARTBUFF_DATE;
-- Update the NR below to force full reload of SB_Data on first login
SMARTBUFF_VERSIONNR = 100200;
SMARTBUFF_TITLE = "SmartBuff";
SMARTBUFF_SUBTITLE = "Supports you in casting buffs";
Expand Down Expand Up @@ -666,12 +667,11 @@ function SMARTBUFF_OnEvent(self, event, ...)
local unit = nil;
local spell = nil;
local target = nil;

if (arg1 and arg2) then
if (not arg3) then arg3 = ""; end
if (not arg4) then arg4 = ""; end
SMARTBUFF_AddMsgD("Spellcast succeeded: target " ..
arg1 .. ", spellID " .. arg3 .. " (" .. GetSpellInfo(arg3) .. "), " .. arg4)
arg1 .. ", spellID " .. arg3 .. " (" .. C_Spell.GetSpellName(arg3) .. "), " .. arg4)
if (string.find(arg1, "party") or string.find(arg1, "raid")) then
spell = arg2;
end
Expand Down Expand Up @@ -1041,7 +1041,7 @@ function SMARTBUFF_SetBuffs()
if (B[CS()] == nil) then
B[CS()] = {};
end

SMARTBUFF_InitSpellIDs();
SMARTBUFF_InitItemList();
SMARTBUFF_InitSpellList();
Expand Down Expand Up @@ -1148,14 +1148,14 @@ function SMARTBUFF_SetBuff(buff, i, ia)
end
elseif (ia or cBuffs[i].Type == SMARTBUFF_CONST_ITEMGROUP) then
-- itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice
local _, _, _, _, minLevel, _, _, _, _, texture = GetItemInfo(cBuffs[i].BuffS);
local _, _, _, _, minLevel, _, _, _, _, texture = C_Item.GetItemInfo(cBuffs[i].BuffS);
if (not IsMinLevel(minLevel)) then
cBuffs[i] = nil;
return i;
end
cBuffs[i].IconS = texture;
else
local _, _, _, _, minLevel = GetItemInfo(cBuffs[i].BuffS);
local _, _, _, _, minLevel = C_Item.GetItemInfo(cBuffs[i].BuffS);
if (not IsMinLevel(minLevel)) then
cBuffs[i] = nil;
return i;
Expand Down Expand Up @@ -1296,10 +1296,10 @@ function SMARTBUFF_PreCheck(mode, force)

if (UnitAffectingCombat("player")) then
isCombat = true;
SMARTBUFF_AddMsgD("In combat");
--SMARTBUFF_AddMsgD("In combat");
else
isCombat = false;
SMARTBUFF_AddMsgD("Out of combat");
--SMARTBUFF_AddMsgD("Out of combat");
end

if (not isCombat and isSetBuffs) then
Expand Down Expand Up @@ -1513,7 +1513,7 @@ function SMARTBUFF_SyncBuffTimers()
isSync = true;
tSync = GetTime();

local ct = currentTemplate;
local ct = CT();
local rbTime = 0;
local i = 0;
local buffS = nil;
Expand Down Expand Up @@ -1583,7 +1583,7 @@ end
function SMARTBUFF_IsShapeshifted()
if (sPlayerClass == "SHAMAN") then
if (GetShapeshiftForm(true) > 0) then
return true, "Ghost Wolf";
return true, C_Spell.GetSpellInfo("Ghost Wolf");
end
elseif (sPlayerClass == "DRUID") then
local i;
Expand Down Expand Up @@ -1951,7 +1951,7 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell)
if (cr > 0) then
buff = buffnS;
if (cBuff.Type == SMARTBUFF_CONST_ITEMGROUP or cBuff.Type == SMARTBUFF_CONST_SCROLL) then
cds, cd = GetItemCooldown(iid);
cds, cd = C_Container.GetItemCooldown(iid);
cd = (cds + cd) - GetTime();
SMARTBUFF_AddMsgD(cr .. " " .. buffnS .. " found, cd = " .. cd);
if (cd > 0) then
Expand Down Expand Up @@ -2111,9 +2111,9 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell)
-- check if shapeshifted and cancel buff if it is not possible to cast it
if (buff and cBuff.Type ~= SMARTBUFF_CONST_TRACK and cBuff.Type ~= SMARTBUFF_CONST_FORCESELF) then
--isShapeshifted = true;
--sShapename = "Moonkingestalt";
--sShapename["name"] = "Moonkingestalt";
if (isShapeshifted) then
if (string.find(cBuff.Params, sShapename)) then
if (string.find(cBuff.Params, sShapename["name"])) then
--SMARTBUFF_AddMsgD("Cast " .. buff .. " while shapeshifted");
else
if (cBuff.Params == SMARTBUFF_DRUID_CAT) then
Expand Down Expand Up @@ -2145,7 +2145,7 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell)
local bag, slot, count = SMARTBUFF_FindItem(buffnS, cBuff.Chain);
if (count > 0) then
sMsgWarning = "";
return 0, SMARTBUFF_ACTION_ITEM, GetItemInfo(buffnS), iSlot, "player", cBuff.Type;
return 0, SMARTBUFF_ACTION_ITEM, C_Item.GetItemInfo(buffnS), iSlot, "player", cBuff.Type;
end
end
r = 50;
Expand Down Expand Up @@ -2392,7 +2392,7 @@ function SMARTBUFF_CanApplyWeaponBuff(buff, slot)

local itemLink = GetInventoryItemLink("player", slot);
local _, _, itemCode = string.find(itemLink, "(%d+):");
local _, _, _, _, _, itemType, itemSubType = GetItemInfo(itemCode);
local _, _, _, _, _, itemType, itemSubType = C_Item.GetItemInfo(itemCode);

--if (itemType and itemSubType) then
-- SMARTBUFF_AddMsgD("Type: " .. itemType .. ", Subtype: " .. itemSubType);
Expand Down Expand Up @@ -2428,16 +2428,16 @@ end

-- Casts a spell
function SMARTBUFF_doCast(unit, id, spellName, levels, type)
SMARTBUFF_AddMsgD("doCast spellName "..spellName);
--SMARTBUFF_AddMsgD("doCast spellName "..spellName);
if (id == nil) then return 9; end
if (type == SMARTBUFF_CONST_TRACK and (GetTrackingTexture() ~= "Interface\\Minimap\\Tracking\\None")) then
--SMARTBUFF_AddMsgD("Track already enabled: " .. iconTrack);
return 7;
end

-- check if spell has cooldown
local cooldown = C_Spell.GetSpellCooldown(spellName)
local cd = cooldown["duration"]
local cooldown = C_Spell.GetSpellCooldown(spellName);
local cd = cooldown["duration"];
if (not cd) then
-- move on
elseif (cd > maxSkipCoolDown) then
Expand Down Expand Up @@ -2791,7 +2791,7 @@ function SMARTBUFF_IsFishingPoleEquiped()
local link = GetInventoryItemLink("player", GetInventorySlotInfo("MainHandSlot"));
if (not link) then return false end

local _, _, _, _, _, _, subType = GetItemInfo(link);
local _, _, _, _, _, _, subType = C_Item.GetItemInfo(link);
if (not subType) then return false end

--print(SG.FishingPole.." - "..subType);
Expand Down Expand Up @@ -2848,7 +2848,7 @@ function SMARTBUFF_CountReagent(reagent, chain)
return -1, nil;
end
if (O.IncludeToys) then
local _, link = GetItemInfo(reagent) -- itemlink
local _, link = C_Item.GetItemInfo(reagent) -- itemlink
local toy = SG.Toybox[link];
if (toy) then
return 1, toy[1];
Expand Down Expand Up @@ -2886,7 +2886,7 @@ function SMARTBUFF_FindItem(reagent, chain)
end

if (O.IncludeToys) then
local _, link = GetItemInfo(reagent) -- itemlink
local _, link = C_Item.GetItemInfo(reagent) -- itemlink
local toy = SG.Toybox[link];
if (toy) then
return 999, toy[1], 1, toy[2];
Expand Down Expand Up @@ -3163,7 +3163,7 @@ function SMARTBUFF_Options_Init(self)
SMARTBUFF_SetBuffs();
InitBuffOrder(true);
end
SMARTBUFF_AddMsg("Upgraded SmartBuff to " .. SMARTBUFF_VERSION);
--SMARTBUFF_AddMsg("Upgraded SmartBuff to " .. SMARTBUFF_VERSION);

if (SMARTBUFF_OptionsGlobal == nil) then
SMARTBUFF_OptionsGlobal = {};
Expand Down Expand Up @@ -4582,12 +4582,13 @@ local function OnScroll(self, cData, sBtnName)
end

FauxScrollFrame_Update(self, num, floor(numToDisplay / 3 + 0.5), ScrLineHeight);
-- [B]ufflist for current spec, current template
local t = B[CS()][CT()];
for i = 1, maxScrollButtons, 1 do
n = i + FauxScrollFrame_GetOffset(self);
btn = _G[sBtnName .. i];
if (btn) then
if (n <= num) then
if (n <= num and t ~= nil) then
btn:SetNormalFontObject("GameFontNormalSmall");
btn:SetHighlightFontObject("GameFontHighlightSmall");
btn:SetText(cData[n]);
Expand Down

0 comments on commit 694e5cb

Please sign in to comment.