Merge pull request #9 from isfir/deposit

Fix deposit fee calculation
This commit is contained in:
OldManAlpha
2025-10-18 07:05:46 -07:00
committed by GitHub
+3 -3
View File
@@ -363,11 +363,11 @@ function update_item_configuration()
stack_count_slider.editbox:SetNumber(stack_count_slider:GetValue())
do
local deposit_factor = UnitFactionGroup'npc' and .05 or .25
local deposit_factor = 0.025
local duration_factor = UIDropDownMenu_GetSelectedValue(duration_dropdown) / 120
local stack_size, stack_count = selected_item.max_charges and 1 or stack_size_slider:GetValue(), stack_count_slider:GetValue()
local amount = floor(selected_item.unit_vendor_price * deposit_factor * stack_size) * stack_count * duration_factor
amount = floor(amount * 0.6) --according to nelethor this should be more accurate, would like to get accurate fee eventually
local max_stack = selected_item.max_stack
local amount = floor(selected_item.unit_vendor_price * stack_size * duration_factor * (1 + (max_stack - stack_size) * 0.05) * deposit_factor) * stack_count
deposit:SetText('Deposit: ' .. money.to_string(amount, nil, nil, aux.color.text.enabled))
end