Skip to content

Commit

Permalink
Fix for red potions bug reported here https://discord.com/channels/40…
Browse files Browse the repository at this point in the history
  • Loading branch information
brightrim committed Nov 17, 2024
1 parent 0fd3187 commit 0c0cdb2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions alchemy/item/id_59_red_bottle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,25 @@ local function DrinkPotion(user,SourceItem)
alchemy.generateTasteMessage(user,dataZList) -- potion taste
GenerateEffectMessage(user,dataZList) -- inform about the effects

local attribValue, bottomBorder

for i=1,8 do

attribValue = user:increaseAttrib(M.attribList[i],0)

bottomBorder = 1

if (attribValue + dataZList[i] - 5) < bottomBorder then
dataZList[i] = (bottomBorder - attribValue) + 5
end

if dataZList[i] ~= 5 then
user:increaseAttrib(M.attribList[i],dataZList[i]-5)
myEffect:addValue("".. M.attribList[i],dataZList[i])
end

end

foundEffect = user.effects:find(59) -- security check, there shouldn't be an effect at this point anymore
if not foundEffect then
user.effects:addEffect(myEffect)
Expand Down

0 comments on commit 0c0cdb2

Please sign in to comment.