Thread Tools Display Modes
12-17-18, 03:56 PM   #1
gruggy
A Murloc Raider
Join Date: Dec 2018
Posts: 5
itemSellPrice from GetItemInfo wrong?

Hi,

i'am new in writing addons and tryed to get an info of vendorsellprice if i loot an item

all works fine and i can print name and some info of the item(s)
but the vendor sellprice is mostly wrong

...
local itemprice = select(11, GetItemInfo(item));
...

but its the same thing like tsm displays

it works (mostly) fine for greens and white items, but for blue items it always have an difference factor of 10.15

i testet it in ragefire and it is for blues always the same factor
f.i. tooth of adarogg (translated it from german, so can be something simular) is displayed on my addon and in tsm with vendor sell of 60g 54s and 93c
the real vendorsellprice is 5g 96 s 17c

how can i get the real price?

does someone had the same prob

thanks for help

ps: sorry for my english
  Reply With Quote
12-17-18, 05:19 PM   #2
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
With numbers like that, I think you are confusing what Tradeskillmaster is telling you. VendorSell is what the NPC vendor will to buy the item from you. In this case, Fang of Adarogg has a VendorSell of 12s 93c.

VendorBuy is the price you pay the NPC vendor to purchase the item. As Fang of Adarogg cannot be bought from a vendor, it will either have a value of 0c or nil.

Using local itemprice = select(11, GetItemInfo(82880)) should give you a value of 1293 (12 * 100 + 93 copper pieces).

I have no idea where your values came from, as the weapon cannot be bought or traded, meaning it has no VendorBuy, DBMarket, DBRegionMarketAvg, or DBHistorical values.
  Reply With Quote
12-17-18, 05:32 PM   #3
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
The only way I can think of that might return the values you see is TSM's Destroy value. Destroy is either milling, disenchanting, etc. You can't mill the Fang, but you can disenchant it.

The dust and shards might sell on the auction house for the amount you see. One value will be DBMarket, the other will be DBRegionMarketAvg for the dust and shards.
  Reply With Quote
12-17-18, 05:54 PM   #4
gruggy
A Murloc Raider
Join Date: Dec 2018
Posts: 5
Hi myrroddin,

thanks for the fast answer.
You are right, i was confused in the case of TSM, the number was from vendorsellvalue
but it is not about TSM, i wrote my own little addon

my eventhandling is this:

Code:
	if (event == "LOOT_OPENED" ) then
		
		local n = GetNumLootItems()
		print("Items looted" .. " nr: " .. n);
		for i = 1, n do
			local item = GetLootSlotLink(i)
			print(item);
			
			if (item ~= nil) then
				print(GetItemInfo(item));
				local itemprice = select(11, GetItemInfo(item)); 
				print(item .. select(1, GetItemInfo(item)) .. (" Preis: %dg %ds %dc"):format(itemprice / 100 / 100, (itemprice / 100) % 100, itemprice % 100));
			end
		end
	end
but i don't understand the underlined code

in the api description the 11. return of GetItemInfo is this:

11. itemSellPrice
Number - The price, in copper, a vendor is willing to pay for this item, 0 for items that cannot be sold.

that sounds like the money i get from vendor

but the value is same to vendorsellvalue

so my question is where can i get the real sellvalue from me to vendor
or does it depends on reputation?

the number i like to have is the number in the standard wow-tooltip which is called vandorprice

thanks a lot

Best Regards

Gruggy

Last edited by gruggy : 12-17-18 at 05:57 PM.
  Reply With Quote
12-17-18, 07:07 PM   #5
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Are you trying to see the price you pay to buy the item? Yes, that depends on reputation. If you are trying to see the price for selling the item back to the vendor, that is never modified by reputation.

Here's an example. Let's invent an item named Staff of Green Cats, and you can buy it from the staff vendor in Stormwind. You can purchase it for 100g, and sell it back for 20g.

If you are neutral with Stormwind, you pay 100g. For each faction level above neutral, you save 5%. This savings is does not stack; it replaces the previous savings. This means at friendly you pay 95g. At honoured you pay 90g. Revered is 85g, and finally at exalted you pay 80g.

Great, but what about selling the item? At neutral you sell it back to the vendor for 20g, and at exalted you sell it back for 20g. The sell value never changes.

The eleventh return of GetItemInfo is the second value, or 20g in the above example.

Last edited by myrroddin : 12-17-18 at 07:09 PM. Reason: clarity
  Reply With Quote
12-18-18, 01:58 AM   #6
gruggy
A Murloc Raider
Join Date: Dec 2018
Posts: 5
Hi,

ok, maybe it was missunderstanding

the facts are:
the money i get from vendor is (in some cases) not the same like the value of "select(11, GetItemInfo(item));" (a value that is described as "The price, in copper, a vendor is willing to pay for this item")
it works fine for grey and white items, but goes wrong for most(or maybe all) of the blues
recipes are fine as well

i tested it in ragefire with a level 120 char
maybe thats the Problem
my idea is, that there is a misscalculating at scalable items (in case of ragefire it is capped to Level 60)
cause it seems to be the right value for non scalable

iam currently not on my gaming pc, so i can't test it by now, but i'll do it
this evening i try to test with a character between 12 and 60, i think this could deliver the right value

all the best

gruggy

Last edited by gruggy : 12-18-18 at 02:01 AM.
  Reply With Quote
12-18-18, 06:32 PM   #7
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
I can confirm the 11th return sometimes does not match the tooltip vendor price. I'm confident this is due to item scaling. Calling GetItemInfo using an itemID will return the "default" item, however, if you use GetItemInfo("[itemLink]"), the correct price is returned due to the item link containing all the bonus ids that make up the item you actually have.

My test used Shadowshroud Vambraces. The itemID gives me data for the item level 300 version, which sells for about 24g. Using the item link of the version I have, a Mythic 9 365 piece, price is the 34g reported in the tooltip.
  Reply With Quote
12-19-18, 01:38 AM   #8
gruggy
A Murloc Raider
Join Date: Dec 2018
Posts: 5
Hi Again,

yeh Kanegasi seems to be right, i tested ragefire again with a group of a level 23 and a level 120
both got the same item and for the lvl 23 ItemValue works good and for 120 not
the value of itemlevel was 18 in both ways

so the problem seems to be the scaleing of items but i think, it scales to my actual level, not to cap of lvl 60

i try to use the itemlink

if it works fine for me, i will report

thanks

gruggy
  Reply With Quote
12-20-18, 02:03 AM   #9
gruggy
A Murloc Raider
Join Date: Dec 2018
Posts: 5
Hi again,

yesterday i tryed a lot of different ways to get the value i want, but whatever i do "LOOT_OPENED" ist the wrong event to catch for this purpose

if i use GetLootSlotInfo, i get only the baseitem like kanegasi described
if i used GetLootSlotLink, i get an item scaled to my actual level and the value was to high

I think, something happened between firing event and display items

however, LOOT_OPENED is also wrong, because when i switch off autoloot, i can open loot several times, so it do some miscalculation in my addon

then i tried to switch to ITEM_PUSH, but this had a problem, if you shift your item in your bag

finally i took the event "CHAT_MSG_LOOT" with some parsing from the message, but it works great
but there is some additional parsing like quantity and player

thanks for the help

gruggy

Last edited by gruggy : 12-20-18 at 02:08 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » itemSellPrice from GetItemInfo wrong?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off