diff --git a/SmartBuff.buffs.lua b/SmartBuff.buffs.lua index 538d0a5..fe63078 100644 --- a/SmartBuff.buffs.lua +++ b/SmartBuff.buffs.lua @@ -78,18 +78,40 @@ function SMARTBUFF_InitItemList() SMARTBUFF_SYMBOLOFKINGS = GetItemInfo(21177); -- Symbol of Kings -- Stones and oils etc. + SMARTBUFF_HEALTHSTONEGEM1 = GetItemInfo(5512); -- Healthstone Rank 1 + SMARTBUFF_HEALTHSTONEGEM2 = GetItemInfo(5511); -- Healthstone Rank 2 + SMARTBUFF_HEALTHSTONEGEM3 = GetItemInfo(5509); -- Healthstone Rank 3 + SMARTBUFF_HEALTHSTONEGEM4 = GetItemInfo(5510); -- Healthstone Rank 4 + SMARTBUFF_HEALTHSTONEGEM5 = GetItemInfo(9421); -- Healthstone Rank 5 + SMARTBUFF_HEALTHSTONEGEM6 = GetItemInfo(22103); -- Healthstone Rank 6 + SMARTBUFF_HEALTHSTONEGEM7 = GetItemInfo(36889); -- Healthstone Rank 7 + SMARTBUFF_HEALTHSTONEGEM8 = GetItemInfo(36892); -- Healthstone Rank 8 + SMARTBUFF_SOULSTONEGEM1 = GetItemInfo(5232); -- Soulstone Rank 1 + SMARTBUFF_SOULSTONEGEM2 = GetItemInfo(16892); -- Soulstone Rank 2 + SMARTBUFF_SOULSTONEGEM3 = GetItemInfo(16893); -- Soulstone Rank 3 + SMARTBUFF_SOULSTONEGEM4 = GetItemInfo(16895); -- Soulstone Rank 4 + SMARTBUFF_SOULSTONEGEM5 = GetItemInfo(16896); -- Soulstone Rank 5 + SMARTBUFF_SOULSTONEGEM6 = GetItemInfo(22116); -- Soulstone Rank 6 + SMARTBUFF_SOULSTONEGEM7 = GetItemInfo(36895); -- Soulstone Rank 7 + SMARTBUFF_LOCKSPELLSTONE1 = GetItemInfo(41191); -- Warlock Spellstone 1 + SMARTBUFF_LOCKSPELLSTONE2 = GetItemInfo(41192); -- Warlock Spellstone 2 + SMARTBUFF_LOCKSPELLSTONE3 = GetItemInfo(41193); -- Warlock Spellstone 3 + SMARTBUFF_LOCKSPELLSTONE4 = GetItemInfo(41194); -- Warlock Spellstone 4 + SMARTBUFF_LOCKSPELLSTONE5 = GetItemInfo(41195); -- Warlock Spellstone 5 + SMARTBUFF_LOCKSPELLSTONE6 = GetItemInfo(41196); -- Warlock Spellstone 6 + SMARTBUFF_LOCKFIRESTONE1 = GetItemInfo(41170); -- Warlock Firestone 1 + SMARTBUFF_LOCKFIRESTONE2 = GetItemInfo(41169); -- Warlock Firestone 2 + SMARTBUFF_LOCKFIRESTONE3 = GetItemInfo(41171); -- Warlock Firestone 3 + SMARTBUFF_LOCKFIRESTONE4 = GetItemInfo(41172); -- Warlock Firestone 4 + SMARTBUFF_LOCKFIRESTONE5 = GetItemInfo(40773); -- Warlock Firestone 5 + SMARTBUFF_LOCKFIRESTONE6 = GetItemInfo(41173); -- Warlock Firestone 6 + SMARTBUFF_LOCKFIRESTONE7 = GetItemInfo(41174); -- Warlock Firestone 7 SMARTBUFF_LESSERMANAOIL = GetItemInfo(20747); -- Lesser Mana Oil SMARTBUFF_BRILLIANTMANAOIL = GetItemInfo(20748); -- Brilliant Mana Oil SMARTBUFF_BRILLIANTWIZARDOIL = GetItemInfo(20749); -- Brilliant Wizard Oil 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_EXCEPTIONALWIZARDOIL = GetItemInfo(36900); -- Exceptional Wizard Oil SMARTBUFF_OILOFIMMOLATION = GetItemInfo(8956); -- Oil of Immolation SMARTBUFF_SOLIDWSTONE = GetItemInfo(7965); -- Solid Weighstone SMARTBUFF_SOLIDSSTONE = GetItemInfo(7964); -- Solid Sharpening Stone @@ -346,6 +368,7 @@ function SMARTBUFF_InitSpellIDs() SMARTBUFF_SHADOWWARD = GetSpellInfo(6229); --"Shadow Ward" SMARTBUFF_DARKPACT = GetSpellInfo(18220); --"Dark Pact" SMARTBUFF_LIFETAP = GetSpellInfo(1454); --"Life Tap" + SMARTBUFF_CREATEHSMIN = GetSpellInfo(6201); --"Create Healthstone (Minor)" SMARTBUFF_CREATEHSLES = GetSpellInfo(6202); --"Create Healthstone (Lesser)" SMARTBUFF_CREATEHS = GetSpellInfo(5699); --"Create Healthstone" @@ -354,7 +377,7 @@ function SMARTBUFF_InitSpellIDs() SMARTBUFF_CREATEHSMAS = GetSpellInfo(27230); --"Create Healthstone (Master)" SMARTBUFF_CREATEHSDEM = GetSpellInfo(47871); --"Create Healthstone (Demonic)" SMARTBUFF_CREATEHSFEL = GetSpellInfo(47878); --"Create Healthstone (Fel)" - SMARTBUFF_SOULSTONE = GetSpellInfo(20707); --"Soulstone" + SMARTBUFF_CREATESSMIN = GetSpellInfo(693); --"Create Soulstone (Minor)" SMARTBUFF_CREATESSLES = GetSpellInfo(20752); --"Create Soulstone (Lesser)" SMARTBUFF_CREATESS = GetSpellInfo(20755); --"Create Soulstone" @@ -362,10 +385,24 @@ function SMARTBUFF_InitSpellIDs() SMARTBUFF_CREATESSMAJ = GetSpellInfo(20757); --"Create Soulstone (Major)" SMARTBUFF_CREATESSMAS = GetSpellInfo(27238); --"Create Soulstone (Master)" SMARTBUFF_CREATESSDEM = GetSpellInfo(47884); --"Create Soulstone (Demonic)" + + SMARTBUFF_CREATESPSTONE1 = GetSpellInfo(2362); --"Create Spellstone Rank 1" + SMARTBUFF_CREATESPSTONE2 = GetSpellInfo(17727); --"Create Spellstone Rank 2" + SMARTBUFF_CREATESPSTONE3 = GetSpellInfo(17728); --"Create Spellstone Rank 3" + SMARTBUFF_CREATESPSTONE4 = GetSpellInfo(28172); --"Create Spellstone Rank 4" + SMARTBUFF_CREATESPSTONE5 = GetSpellInfo(47886); --"Create Spellstone Rank 5" + SMARTBUFF_CREATESPSTONE6 = GetSpellInfo(47888); --"Create Spellstone Rank 6" + + SMARTBUFF_CREATEFSTONE1 = GetSpellInfo(6366); --"Create Firestone Rank 1" + SMARTBUFF_CREATEFSTONE2 = GetSpellInfo(17951); --"Create Firestone Rank 2" + SMARTBUFF_CREATEFSTONE3 = GetSpellInfo(17952); --"Create Firestone Rank 3" + SMARTBUFF_CREATEFSTONE4 = GetSpellInfo(17953); --"Create Firestone Rank 4" + SMARTBUFF_CREATEFSTONE5 = GetSpellInfo(27250); --"Create Firestone Rank 5" + SMARTBUFF_CREATEFSTONE6 = GetSpellInfo(60219); --"Create Firestone Rank 6" + SMARTBUFF_CREATEFSTONE7 = GetSpellInfo(60220); --"Create Firestone Rank 7" -- Warlock chained S.ChainWarlockArmor = { SMARTBUFF_DEMONSKIN, SMARTBUFF_DEMONARMOR, SMARTBUFF_FELARMOR }; - -- Hunter SMARTBUFF_TRUESHOTAURA = GetSpellInfo(19506); --"Trueshot Aura" @@ -676,34 +713,54 @@ function SMARTBUFF_InitSpellList() {SMARTBUFF_SHADOWWARD, 0.5, SMARTBUFF_CONST_SELF}, {SMARTBUFF_DARKPACT, 0.5, SMARTBUFF_CONST_SELF}, {SMARTBUFF_SOULSTONE, 15, SMARTBUFF_CONST_GROUP, {18}, "WARRIOR;DRUID;SHAMAN;HUNTER;ROGUE;MAGE;PRIEST;PALADIN;WARLOCK;DEATHKNIGHT;MONK;DEMONHUNTER;HPET;WPET;DKPET"}, - {SMARTBUFF_CREATEHSMAJ, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM}, - {SMARTBUFF_CREATEHSGRE, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM}, - {SMARTBUFF_CREATEHS, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM}, - {SMARTBUFF_CREATEHSLES, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM}, - {SMARTBUFF_CREATEHSMIN, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM}, - {SMARTBUFF_CREATEHSMAS, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM}, - {SMARTBUFF_CREATEHSDEM, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM}, - {SMARTBUFF_CREATEHSFEL, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM}, - {SMARTBUFF_CREATESSMAJ, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_SOULSTONEGEM}, - {SMARTBUFF_CREATESSGRE, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_SOULSTONEGEM}, - {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_CREATESSMAS, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_SOULSTONEGEM}, - {SMARTBUFF_CREATESSDEM, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_SOULSTONEGEM}, + + -- healthstones. + {SMARTBUFF_CREATEHSMIN, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM1}, + {SMARTBUFF_CREATEHSLES, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM2}, + {SMARTBUFF_CREATEHS, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM3}, + {SMARTBUFF_CREATEHSGRE, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM4}, + {SMARTBUFF_CREATEHSMAJ, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM5}, + {SMARTBUFF_CREATEHSMAS, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM6}, + {SMARTBUFF_CREATEHSDEM, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM7}, + {SMARTBUFF_CREATEHSFEL, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_HEALTHSTONEGEM8}, + -- soulstones. + {SMARTBUFF_CREATESSMIN, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_SOULSTONEGEM1}, + {SMARTBUFF_CREATESSLES, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_SOULSTONEGEM2}, + {SMARTBUFF_CREATESS, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_SOULSTONEGEM3}, + {SMARTBUFF_CREATESSGRE, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_SOULSTONEGEM4}, + {SMARTBUFF_CREATESSMAJ, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_SOULSTONEGEM5}, + {SMARTBUFF_CREATESSMAS, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_SOULSTONEGEM6}, + {SMARTBUFF_CREATESSDEM, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_SOULSTONEGEM7}, + -- spellstones. + {SMARTBUFF_CREATESPSTONE1, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_LOCKSPELLSTONE1}, + {SMARTBUFF_CREATESPSTONE2, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_LOCKSPELLSTONE2}, + {SMARTBUFF_CREATESPSTONE3, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_LOCKSPELLSTONE3}, + {SMARTBUFF_CREATESPSTONE4, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_LOCKSPELLSTONE4}, + {SMARTBUFF_CREATESPSTONE5, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_LOCKSPELLSTONE5}, + {SMARTBUFF_CREATESPSTONE6, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_LOCKSPELLSTONE6}, + {SMARTBUFF_LOCKSPELLSTONE6, 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}, - {SMARTBUFF_FIRESTONE4, 60, SMARTBUFF_CONST_INV}, - {SMARTBUFF_FIRESTONE3, 60, SMARTBUFF_CONST_INV}, - {SMARTBUFF_FIRESTONE2, 60, SMARTBUFF_CONST_INV}, - {SMARTBUFF_FIRESTONE1, 60, SMARTBUFF_CONST_INV} - }; + {SMARTBUFF_LOCKSPELLSTONE1, 60, SMARTBUFF_CONST_INV}, + -- firestones. + {SMARTBUFF_CREATEFSTONE1, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_LOCKFIRESTONE1}, + {SMARTBUFF_CREATEFSTONE2, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_LOCKFIRESTONE2}, + {SMARTBUFF_CREATEFSTONE3, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_LOCKFIRESTONE3}, + {SMARTBUFF_CREATEFSTONE4, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_LOCKFIRESTONE4}, + {SMARTBUFF_CREATEFSTONE5, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_LOCKFIRESTONE5}, + {SMARTBUFF_CREATEFSTONE6, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_LOCKFIRESTONE6}, + {SMARTBUFF_CREATEFSTONE7, 0.03, SMARTBUFF_CONST_ITEM, nil, SMARTBUFF_LOCKFIRESTONE7}, + {SMARTBUFF_LOCKFIRESTONE7, 60, SMARTBUFF_CONST_INV}, + {SMARTBUFF_LOCKFIRESTONE6, 60, SMARTBUFF_CONST_INV}, + {SMARTBUFF_LOCKFIRESTONE5, 60, SMARTBUFF_CONST_INV}, + {SMARTBUFF_LOCKFIRESTONE4, 60, SMARTBUFF_CONST_INV}, + {SMARTBUFF_LOCKFIRESTONE3, 60, SMARTBUFF_CONST_INV}, + {SMARTBUFF_LOCKFIRESTONE2, 60, SMARTBUFF_CONST_INV}, + {SMARTBUFF_LOCKFIRESTONE1, 60, SMARTBUFF_CONST_INV}, + + }; end -- Hunter diff --git a/SmartBuff.lua b/SmartBuff.lua index a2de12a..55cefe3 100644 --- a/SmartBuff.lua +++ b/SmartBuff.lua @@ -6,7 +6,7 @@ -- Cast the most important buffs on you, tanks or party/raid members/pets. ------------------------------------------------------------------------------- -SMARTBUFF_DATE = "081022 Dev"; +SMARTBUFF_DATE = "091022"; SMARTBUFF_VERSION = "r36."..SMARTBUFF_DATE; SMARTBUFF_VERSIONMIN = 11403; -- min version SMARTBUFF_VERSIONNR = 30400; -- max version @@ -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 = 35; +local SmartbuffRevision = 36; local SmartbuffVerNotifyList = {} -- Smartbuff now uses LibRangeCheck-2.0 by Mitchnull, not fully implemented @@ -681,6 +681,16 @@ function SMARTBUFF_OnEvent(self, event, ...) local unit = nil; local spell = nil; local target = nil; + + -- temporary dirty hack to force a spell list refresh and check when a warlock stone is created. + -- yes yes, i know its horrible but its temporary as a quick fix - i will tidy this up later. + if (sPlayerClass == "WARLOCK") then + -- only really interested if im a warlock, otherwise just skip over. + if arg3 == 2362 or arg3 == 17727 or arg3 == 17728 or arg3 == 28172 or arg3 == 47886 or arg3 == 47888 or + arg3 == 6366 or arg3 == 17951 or arg3 == 17952 or arg3 == 17954 or arg3 == 27250 or arg3 == 60219 then + isSetBuffs = true; + end + end if (arg1 and arg2) then if (not arg3) then arg3 = ""; end @@ -1973,8 +1983,9 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) uct = UnitCreatureType(unit); ucf = UnitCreatureFamily(unit); if (uct == nil) then uct = ""; end - if (ucf == nil) then ucf = ""; end - + if (ucf == nil) then ucf = ""; end + + -- debug -- if (un) then SMARTBUFF_AddMsgD("Grp "..subgroup.." checking "..un.." ("..unit.."/"..uc.."/"..ur.."/"..uct.."/"..ucf..")", 0, 1, 0.5); end isShapeshifted, sShapename = SMARTBUFF_IsShapeshifted(); @@ -1997,9 +2008,8 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) if (bUsable and spell and spell ~= buffnS) then bUsable = false; - --SMARTBUFF_AddMsgD("Exclusive check on " .. spell .. ", current spell = " .. buffnS); end - + if (bUsable and cBuff.Type == SMARTBUFF_CONST_SELF and not SMARTBUFF_IsPlayer(unit)) then bUsable = false end if (bUsable and not cBuff.Type == SMARTBUFF_CONST_TRACK and not SMARTBUFF_IsItem(cBuff.Type) and not IsUsableSpell(buffnS)) then bUsable = false end if (bUsable and bs.SelfNot and SMARTBUFF_IsPlayer(unit)) then bUsable = false end @@ -2099,7 +2109,7 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) or (cBuff.Type ~= SMARTBUFF_CONST_GROUP and SMARTBUFF_IsPlayer(unit)) or SMARTBUFF_IsInList(unit, un, bs.AddList))) then buff = nil; - + --Tracking ability ------------------------------------------------------------------------ if (cBuff.Type == SMARTBUFF_CONST_TRACK) then @@ -2144,7 +2154,6 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) buff = nil; if (cBuff.Params ~= SG.NIL) then local cr = SMARTBUFF_CountReagent(cBuff.Params, cBuff.Chain); - --SMARTBUFF_AddMsgD(cr.." "..cBuff.Params.." found"); if (cr == 0) then buff = cBuff.Params; end @@ -2352,12 +2361,11 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) end end - if (buff) then + if (buff) then -- Cast mode --------------------------------------------------------------------------------------- if (mode == 0 or mode == 5) then currentUnit = nil; currentSpell = nil; - --try to apply weapon buffs on main/off hand if (cBuff.Type == SMARTBUFF_CONST_INV) then if (iSlot and (handtype ~= "" or bExpire)) then @@ -2374,8 +2382,7 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) return 0, SMARTBUFF_ACTION_SPELL, buffnS, iSlot, "player", cBuff.Type; --return 0, SMARTBUFF_ACTION_SPELL, buffnS, iId, "player", cBuff.Type; end - r = 50; - + r = 50; -- eat food or use scroll or potion elseif (cBuff.Type == SMARTBUFF_CONST_FOOD or cBuff.Type == SMARTBUFF_CONST_SCROLL or cBuff.Type == SMARTBUFF_CONST_POTION) then local bag, slot, count = SMARTBUFF_FindItem(buffnS, cBuff.Chain); @@ -2383,8 +2390,7 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) sMsgWarning = ""; return 0, SMARTBUFF_ACTION_ITEM, buffnS, 0, "player", cBuff.Type; end - r = 20; - + r = 20; -- use item on a unit elseif (cBuff.Type == SMARTBUFF_CONST_ITEMGROUP) then local bag, slot, count = SMARTBUFF_FindItem(buffnS, cBuff.Chain); @@ -2392,8 +2398,7 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) sMsgWarning = ""; return 0, SMARTBUFF_ACTION_ITEM, buffnS, 0, unit, cBuff.Type; end - r = 20; - + r = 20; -- create item elseif (cBuff.Type == SMARTBUFF_CONST_ITEM) then r = 20; @@ -2404,12 +2409,11 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) currentUnit = unit; currentSpell = buffnS; end - end - + end -- cast spell else r, _, rankText = SMARTBUFF_doCast(unit, cBuff.IDS, buffnS, cBuff.LevelsS, cBuff.Type); - if (r == 0) then + if (r == 0) then currentUnit = unit; currentSpell = buffnS; end @@ -2644,7 +2648,6 @@ end -- Casts a spell function SMARTBUFF_doCast(unit, id, spellName, levels, type) if (id == nil) then return 9; end - if (type == SMARTBUFF_CONST_TRACK) then local iconTrack = GetTrackingTexture(); if (iconTrack ~= nil and iconTrack ~= "Interface\\Minimap\\Tracking\\None") then @@ -2663,11 +2666,10 @@ function SMARTBUFF_doCast(unit, id, spellName, levels, type) return 1; end - -- switched to using the LibRangeCheck-2.0 library by mitchnull for range checking. if ((type == SMARTBUFF_CONST_GROUP or type == SMARTBUFF_CONST_ITEMGROUP)) then local minRange, maxRange = LRC:GetRange(unit) - if (UnitInRange(unit) or unit == "player") then + if (UnitInRange(unit) or unit == "player" or (unit == "target" and O.BuffTarget)) then if (SpellHasRange(spellName)) then if not minRange then return 3; -- unit is out of range for spell @@ -2678,7 +2680,6 @@ function SMARTBUFF_doCast(unit, id, spellName, levels, type) return 3; end end - -- check if target is to low for this spell local newId, rank, rankText = SMARTBUFF_CheckUnitLevel(unit, id, levels); diff --git a/localization.en.lua b/localization.en.lua index 6d7e848..232636f 100644 --- a/localization.en.lua +++ b/localization.en.lua @@ -7,8 +7,10 @@ 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 r36:\n\n" - .." * Added some missing spells and/or ranks for\n" - .." existing spells in Smartbuff.\n\n" + .." * Fixed various warlock stones such as spellstone,\n" + .." healthstone and soulstones - you can now create\n" + .." and use these created stones.\n\n" + .." * Fixed target buffing.\n" .."\n\n" .." |c0000FF96Many thanks to Chris S. for his donation and\n" .." supporting my addon development.\n\n"