View Single Post
  #3  
Unread 06-06-2015, 12:19 PM
Sigrdrifa Sigrdrifa is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Jan 2006
Server: Crushbone
Posts: 153
Default

Quote:
Originally Posted by lordebon View Post
...doing that much math and trying to pull that many pieces of data from that window is going to be ugly.
DarqUI's eq2ui_popup_setprice.xml is already doing the math of taking a number and showing it at 10%, 20% and 40%.

eq2ui_inventory_market.xml has:
<Text AbsorbsInput="false" Font="/TextStyles.Normal.NormalStyle" Location="170,26" Margin="0,0,15,0" MaxLines="1" Name="SelectedPrice" PackSize="a,f" ScrollExtent="374,20" Size="374,20" TextAlignmentVertical="Center" TextColor="#F0D080" UserMovable="true">:5f6b97aeaf09212c:[DEVL]N to seller and M to broker</Text>

<Text AbsorbsInput="false" Font="/TextStyles.Normal.NormalStyle" Location="170,43" Margin="0,0,15,0" MaxLines="1" Name="BrokerCommission" PackSize="a,f" ScrollExtent="374,20" Size="374,20" TextAlignmentVertical="Center" TextColor="#F0D080" UserMovable="true">:5f6b97ae8f12816e:[DEVL]15% to broker</Text>
I think that these are the base price and broker commission amounts being listed here. In that ":5f6b97aeaf09212c:[DEVL]N to seller and M to broker", "N" is SellerBasePrice and "M" is CommissionAmt.

The next line has ":5f6b97ae8f12816e:[DEVL]15% to broker", and that value can be harvested to give CommissionPercent. If we can't get CommissionPercent there, then:
IF (M/(N+M) <= 0.10) THEN CommissionPercent = 0.10
ELSE IF ((M/(N+M) > 0.10) AND (M/(N+M) <= 0.15)) THEN CommissionPercent = 0.15

ELSE IF ((M/(N+M) > 0.15) AND (M/(N+M) <= 0.20)) THEN CommissionPercent = 0.20

ELSE IF (M/(N+M) > 0.20) THEN CommissionPercent = 0.40
END IF
(There's probably a CEILING expression that would do this more neatly, but I am still on my first cup of coffee).

The last bit of information needed is the commission percentage of the sales crate in which the player has an item highlighted. I think I see where the window gets the info on what kind of sales container it is:
<Text AbsorbsInput="false" Font="/TextStyles.VeryLarge.VeryLargeStyle" Location="3,1" Margin="1,-1,1,1" Name="NameText" PackLocation="fixed,fixed" ScrollExtent="382,26" Size="382,26">:5f6b97aedd6c46d8:Pristine strengthened leather backpack</Text>

There are only three sales containers that discount the broker commission, so far as I am aware:
3-year veteran reward, 40-slot, commission 10%:
  • \aITEM -1057013449 1254478062:Veteran's Display Case\/a
  • \aITEM 1865448438 125174344:Veteran's Display Case\/a

9-year veteran reward, 50-slot, commission 10%:
  • \aITEM -1147436452 -800540100:Expanded Veteran's Display Case\/a
  • \aITEM 1453137537 -1753555612:Expanded Veteran's Display Case\/a

LON Loot, 30-slot, commission 15%:
  • \aITEM -1961269843 -1120555058:Legend's Display Case\/a
  • \aITEM -844465566 -201343624:Legend's Display Case\/a
Then all you'd need are these relationships:
TotalSellerPrice = SellerBasePrice + CommissionAmt

TargetSalePrice = TotalSellerPrice - ReduceByAmount

MySalePrice = TargetSalePrice - (TargetSalePrice * MyBoxCommissionAmt)

MyDisplayedPrice = MySalePrice + (MySalePrice * MyBoxCommissionAmt)
Reply With Quote