Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local GetActionCountOrig = GetActionCount;
- function GetActionCount(button)
- --Check each spell name that requires shards/reagents.
- --Search bags for the right reagent count.
- local s, rank, reagent;
- local actionType, id, subType = GetActionInfo(button);
- if (id ~= nil) then
- s = GetSpellInfo(id);
- rank = GetSpellSubtext(id);
- end
- if (s ~= nil and (s == "Soul Fire" or s == "Summon Voidwalker" or s == "Summon Succubus"
- or s == "Summon Felhunter" or s == "Ritual of Summoning" or s == "Enslave Demon"
- or s == "Shadowburn"
- or string.match(s, "Create Soulstone") or string.match(s, "Create Healthstone")
- or string.match(s, "Create Spellstone") or string.match(s, "Create Firestone"))) then
- reagent = "Soul Shard";
- elseif (s ~= nil and string.match(s, "Teleport")) then
- reagent = "Rune of Teleportation";
- elseif (s ~= nil and string.match(s, "Portal")) then
- reagent = "Rune of Portals";
- elseif (s ~= nil and s == "Vanish") then
- reagent = "Flash Powder";
- elseif (s ~= nil and s == "Blind") then
- reagent = "Blinding Powder";
- elseif (s ~= nil and s == "Reincarnation") then
- reagent = "Ankh";
- elseif (s ~= nil and string.match(s, "Greater Blessing of")) then
- reagent = "Symbol of Kings";
- elseif (s ~= nil and s == "Rebirth") then
- reagent = "Maple Seed";
- elseif (s ~= nil and s == "Inferno") then
- reagent = "Infernal Stone";
- elseif (s ~= nil and s == "Arcane Brilliance") then
- reagent = "Arcane Powder";
- elseif (s ~= nil and s == "Divine Intervention") then
- reagent = "Symbol of Divinity";
- elseif (s ~= nil and s == "Ritual of Doom") then
- reagent = "Demonic Figurine";
- end
- --These spells have diff reagents for diff ranks.
- if (s ~= nil and s == "Prayer of Fortitude") then
- if (rank == "Rank 1") then
- reagent = "Sacred Candle";
- else
- reagent = "Holy Candle";
- end
- elseif (s ~= nil and string.match(s, "Prayer of")) then
- --All other prayers use sacred candle.
- reagent = "Sacred Candle";
- end
- if (s ~= nil and s == "Rebirth") then
- if (rank == "Rank 1") then
- reagent = "Maple Seed";
- elseif (rank == "Rank 2") then
- reagent = "Stranglethorn Seed";
- elseif (rank == "Rank 3") then
- reagent = "Ashwood Seed";
- elseif (rank == "Rank 4") then
- reagent = "Hornbeam Seed";
- else
- reagent = "Ironwood Seed";
- end
- end
- if (s ~= nil and s == "Gift of the Wild") then
- if (rank == "Rank 1") then
- reagent = "Wild Berries";
- else
- reagent = "Wild Thornroot";
- end
- end
- if (reagent ~= nil) then
- local count = 0;
- for bag = 0, NUM_BAG_SLOTS do
- for slot = 1, GetContainerNumSlots(bag) do
- local _, itemCount, _, _, _, _, itemLink = GetContainerItemInfo(bag, slot)
- if (itemLink and string.find(itemLink, "%[" .. reagent .. "%]")) then --Brackets to match exact name.
- count = count + (itemCount or 1);
- end
- end
- end
- return count;
- end
- --If no reagent type found return the original Blizzard function.
- return GetActionCountOrig(button);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement