Page 5 of 5
Re: Merchant Issues Thread
Posted: Sat Jan 05, 2013 6:10 pm
by John Adams
FYI, when I click the "Not for sale" checkbox, this appears in the console:
18:06:01 D Command : Player 'Killer' (1), Command: frommerchant
0: 09 01 00 00 | ....
18:06:01 D Command : Player 'Killer' (1), Command: clearallqueuedabilities
0: 18 00 16 00 6E 6F 73 61 - 6C 65 20 32 31 30 30 32 | ....nosale 21002
16: 33 39 30 31 34 36 36 34 - 20 31 | 39014664 1
18:06:57 D Command : Player 'Killer' (1), Command: inventory
18:06:57 I Command : command: inventory
0: 21 00 0B 00 69 6E 76 65 - 6E 74 6F 72 79 20 32 | !...inventory 2
Not sure if that's helpful for when we get around to implementing that flag. We don't even have a field for it yet in character_items.
Re: Merchant Issues Thread
Posted: Sat Jan 05, 2013 7:16 pm
by John Adams
Jab, I found the old faction-based merchant code.
Code: Select all
float Client::CalculateBuyMultiplier(int32 merchant_id){
/*MerchantFactionMultiplier* multiplier = world.GetMerchantMultiplier(merchant_id);
if(multiplier){
sint32 faction_val = player->GetFactions()->GetFactionValue(multiplier->faction_id);
float diff_low = faction_val - multiplier->faction_min;
if(diff_low < 0)
diff_low*=-1;
float total_diff = multiplier->faction_max - multiplier->faction_min;
if(total_diff < 0)
total_diff*=-1;
float buy_multiplier = multiplier->high_buy_multiplier - multiplier->low_buy_multiplier;
float total1 = (diff_low/total_diff);
float final_buy_multiplier = total1*buy_multiplier + total1*multiplier->low_buy_multiplier;
return final_buy_multiplier;
}*/
return 1;
}
float Client::CalculateSellMultiplier(int32 merchant_id){
/*MerchantFactionMultiplier* multiplier = world.GetMerchantMultiplier(merchant_id);
if(multiplier){
sint32 faction_val = player->GetFactions()->GetFactionValue(multiplier->faction_id);
float diff_low = faction_val - multiplier->faction_min;
if(diff_low < 0)
diff_low*=-1;
float total_diff = multiplier->faction_max - multiplier->faction_min;
if(total_diff < 0)
total_diff*=-1;
float sell_multiplier = multiplier->high_sell_multiplier - multiplier->low_sell_multiplier;
float total1 = (diff_low/total_diff);
float final_sell_multiplier = total1*sell_multiplier + total1*multiplier->low_sell_multiplier;
return final_sell_multiplier;
}*/
return 1;
}
Code: Select all
void Commands::Command_SendMerchantWindow(Client* client, Seperator* sep, bool sell) {
Spawn* spawn = client->GetPlayer()->GetTarget();
if(spawn) {
client->SetMerchantTransaction(spawn);
if (spawn->GetMerchantID() > 0){
//MerchantFactionMultiplier* multiplier = world.GetMerchantMultiplier(spawn->GetMerchantID());
//if(!multiplier || (multiplier && client->GetPlayer()->GetFactions()->GetFactionValue(multiplier->faction_id) >= multiplier->faction_min)){
.
.
.
Pretty sure when LE stopped using merchant_multipliers (for a reason I cannot remember), I went in and removed the table and commented out the code. Not sure if this is useful, or better to just start from scratch.
Re: Merchant Issues Thread
Posted: Sat Jan 05, 2013 7:23 pm
by John Adams
Last items for tonight.
merchant_mouse.jpg
Are item mouseovers in Merchant window supposed to be just a sliver of info? I think it should be more. To the right is the right-click Examine, which looks okay.
In Buy Back, should stackable items list as individual buy backs? Ie, i had a stack of hawk feathers, sold one. then sold the other. there are 2 line items in buy back for the feathers (not stacked). When I do buy them back, they stack in the Sell window just fine.
Note: there is a new option in CoE merchant window to "Double-click to sell", which double-clicking works regardless:) I'm sure that's just how it used to be, though.
Finally, rations and water are NO VALUE items. Is that why I cannot sell them to a merchant, even for 0cp? I think that's okay, but forgot the rules:)
Re: Merchant Issues Thread
Posted: Sat Jan 05, 2013 7:33 pm
by Jabantiz
The not for sale stuff will be useful for when we get around to that, good find.
Mouse over examines in merchant windows seem to be broke in CoE, I assume this was with a CoE client?
I am not sure on the buy back question, will have to log into live and check the behavior, I would assume they are suppose to stack though.
I swear you could always double click on live...
An NO VALUE you shouldn't be able to sell to the merchant, so that is working right.
If we could figure out what was wrong with that faction code we could fix it and add it back in. Does live change the item price based on faction? never noticed, either way it is a neat idea we could put in a rule.
Re: Merchant Issues Thread
Posted: Sat Jan 05, 2013 7:56 pm
by John Adams
Yeah this was the current live CoE client (patched today).
And yeah, I think double click always worked in live and Emu. I was just mentioning that now there's a client option to supposedly enable that (as in, now it is disabled by default?) but it works for us even without the checkmark... which I assumed was a Client-only thing, and nothing in code. But, maybe our merchant packet has a flag? Dunno.
Ok. Mass Effect 3 time. Later

Re: Merchant Issues Thread
Posted: Sat Jan 05, 2013 9:55 pm
by Jabantiz
The mouse over has been fixed for CoE clients.
Re: Merchant Issues Thread
Posted: Sun Jan 06, 2013 9:32 am
by John Adams
Jab, is there some reason why WS_ExamineInfoItemLinkRequest needs to be ClientVersion="1191", where every other CoE struct has been 1188 or 1193?
Re: Merchant Issues Thread
Posted: Sun Jan 06, 2013 10:54 am
by Jabantiz
I looked it up in an 1191 log, I am sure it is the same for 1188 just haven't looked it up and don't have an 1188 client to test, and it work for 1193 if you want to bump it, I just gave it the version from the log I pulled it from.
Re: Merchant Issues Thread
Posted: Sun Jan 06, 2013 12:18 pm
by John Adams
Ahh, that makes sense. Reason I ask is that I plan to go through the Structs (someday) and yank out all the obsolete clients we no longer support (meaning, no client will ever connect using that version again), and 1191 would be one of them. In fact, so would 1188. But that's a low priority TODO on my list.
Removing old structs will also prevent me from feeling the need to parse every log we have since 2007 