Skip to content

Commit

Permalink
Add "Third Wind" Potion to the list of potions (#39)
Browse files Browse the repository at this point in the history
This potion is only usable in unrated battlegrounds. It is currently
healing the user for 50% of their health instantly so should be of high
priority to use.

Fix #36
  • Loading branch information
alex-ross authored Mar 24, 2024
1 parent 65e206a commit c1298d3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Core/Potions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ local isWrath = (WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC)
--ham.leywine = ham.Item.new(194684,"Azure Leywine")
--ham.healthstone = ham.Item.new(117, "Healthstone")
ham.healthstone = ham.Item.new(5512, "Healthstone")
ham.thirdWind = ham.Item.new(138486, "\"Third Wind\" Potion")
ham.witheringDreamsR3 = ham.Item.new(207041, "Potion of Withering Dreams")
ham.witheringDreamsR2 = ham.Item.new(207040, "Potion of Withering Dreams")
ham.witheringDreamsR1 = ham.Item.new(207039, "Potion of Withering Dreams")
Expand Down Expand Up @@ -75,9 +76,18 @@ ham.fel0 = ham.Item.new(36892, "Fel Healthstone")
ham.fel1 = ham.Item.new(36893, "Fel Healthstone")
ham.fel2 = ham.Item.new(36894, "Fel Healthstone")

function RemoveFromList(list, itemToRemove)
for i = #list, 1, -1 do
if list[i] == itemToRemove then
table.remove(list, i)
end
end
end

function ham.getPots()
if isRetail then
local pots = {
ham.thirdWind,
ham.dreamR3,
ham.dreamsR2,
ham.dreamR1,
Expand Down Expand Up @@ -107,6 +117,12 @@ function ham.getPots()
ham.healingPotion
}


local isUnratedBattleground = C_PvP.IsBattleground() and not C_PvP.IsRatedBattleground()
if not isUnratedBattleground then
RemoveFromList(pots, ham.thirdWind)
end

if HAMDB.witheringPotion then
table.insert(pots, 1, ham.witheringR1)
table.insert(pots, 1, ham.witheringR2)
Expand Down
1 change: 1 addition & 0 deletions code.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ local onCombat = true
local updateFrame = CreateFrame("Frame")
updateFrame:RegisterEvent("BAG_UPDATE")
updateFrame:RegisterEvent("PLAYER_LOGIN")
updateFrame:RegisterEvent("PLAYER_ENTERING_WORLD") -- Initial login and UI reload
if isClassic == false then
updateFrame:RegisterEvent("TRAIT_CONFIG_UPDATED")
end
Expand Down

0 comments on commit c1298d3

Please sign in to comment.