PDA

View Full Version : Ldon Merchants Buying


KingMort
06-14-2009, 06:04 PM
Seems I can't get the LDON merchants to buy the stuff back ? It should buy stuff back with LDONSOLD set to 1 I would think but no dice...

LDON merchants usually would buy back the items for 85% of the price (or maybe if you can make it so we can set that value)

King

cavedude
06-14-2009, 06:09 PM
Buying back indeed works on TGC, though we just use stock LDoN items. I haven't looked into all the columns just yet to see how they work/what they do.

KingMort
06-14-2009, 07:24 PM
Hmm can you give me a few item examples maybe i can pick through it..

Thanks cavedude

King

KLS
06-14-2009, 07:32 PM
What's the error? The sellrate should be 70%, and it should work if your item is setup right. Ever fallthrough error should have an error message though.

KingMort
06-14-2009, 08:43 PM
No error they will have the already bought item on cursor and the sell button is grey...

KLS
06-14-2009, 09:41 PM
Did you have updated code and .conf files.

Secrets
06-15-2009, 02:00 AM
Did you have updated code and .conf files.

He's on rev 529 if I remember correctly, and I hope to god he has updated conf files, lol.

KingMort
06-15-2009, 11:57 AM
Yes i'm pretty sure I do.. (Though the blue section in bazaar isn't working right) perhaps I don't....

This has NEVER worked you would think this wasn't something new ?

Perhaps it's just something with the Items that are on the merchant something missing...

Here is one of the LDON items for sale..

INSERT INTO `items` (`id`, `minstatus`, `Name`, `aagi`, `ac`, `accuracy`, `acha`, `adex`, `aint`, `artifactflag`, `asta`, `astr`, `attack`, `augrestrict`, `augslot1type`, `augslot1visible`, `augslot2type`, `augslot2visible`, `augslot3type`, `augslot3visible`, `augslot4type`, `augslot4visible`, `augslot5type`, `augslot5visible`, `augtype`, `avoidance`, `awis`, `bagsize`, `bagslots`, `bagtype`, `bagwr`, `banedmgamt`, `banedmgraceamt`, `banedmgbody`, `banedmgrace`, `bardtype`, `bardvalue`, `book`, `casttime`, `casttime_`, `charmfile`, `charmfileid`, `classes`, `color`, `combateffects`, `extradmgskill`, `extradmgamt`, `price`, `cr`, `damage`, `damageshield`, `deity`, `delay`, `augdistiller`, `dotshielding`, `dr`, `clicktype`, `clicklevel2`, `elemdmgtype`, `elemdmgamt`, `endur`, `factionamt1`, `factionamt2`, `factionamt3`, `factionamt4`, `factionmod1`, `factionmod2`, `factionmod3`, `factionmod4`, `filename`, `focuseffect`, `fr`, `fvnodrop`, `haste`, `clicklevel`, `hp`, `regen`, `icon`, `idfile`, `itemclass`, `itemtype`, `ldonprice`, `ldontheme`, `ldonsold`, `light`, `lore`, `loregroup`, `magic`, `mana`, `manaregen`, `enduranceregen`, `material`, `maxcharges`, `mr`, `nodrop`, `norent`, `pendingloreflag`, `pr`, `procrate`, `races`, `range`, `reclevel`, `recskill`, `reqlevel`, `sellrate`, `shielding`, `size`, `skillmodtype`, `skillmodvalue`, `slots`, `clickeffect`, `spellshield`, `strikethrough`, `stunresist`, `summonedflag`, `tradeskills`, `favor`, `weight`, `unknown002`, `unknown003`, `unknown005`, `unknown007`, `unknown018`, `unknown019`, `unknown020`, `UNK012`, `UNK013`, `benefitflag`, `unknown061`, `UNK054`, `unknown067`, `unknown069`, `UNK059`, `UNK061`, `unknown081`, `unknown105`, `booktype`, `unknown122`, `unknown123`, `unknown124`, `recastdelay`, `recasttype`, `guildfavor`, `unknown128`, `UNK123`, `UNK124`, `attuneable`, `nopet`, `unknown133`, `updated`, `comment`, `UNK127`, `pointtype`, `potionbelt`, `potionbeltslots`, `stacksize`, `notransfer`, `stackable`, `UNK134`, `UNK137`, `proceffect`, `proctype`, `proclevel2`, `proclevel`, `UNK142`, `worneffect`, `worntype`, `wornlevel2`, `wornlevel`, `UNK147`, `focustype`, `focuslevel2`, `focuslevel`, `UNK152`, `scrolleffect`, `scrolltype`, `scrolllevel2`, `scrolllevel`, `UNK157`, `serialized`, `verified`, `serialization`, `source`, `UNK033`, `lorefile`, `UNK014`, `svcorruption`, `UNK038`, `UNK060`, `augslot1unk2`, `augslot2unk2`, `augslot3unk2`, `augslot4unk2`, `augslot5unk2`, `UNK098`, `UNK109`, `UNK120`, `UNK121`, `questitemflag`, `UNK131`, `UNK132`, `clickunk5`, `clickunk6`, `clickunk7`, `procunk1`, `procunk2`, `procunk3`, `procunk4`, `procunk6`, `procunk7`, `wornunk1`, `wornunk2`, `wornunk3`, `wornunk4`, `wornunk5`, `wornunk6`, `wornunk7`, `focusunk1`, `focusunk2`, `focusunk3`, `focusunk4`, `focusunk5`, `focusunk6`, `focusunk7`, `scrollunk1`, `scrollunk2`, `scrollunk3`, `scrollunk4`, `scrollunk5`, `scrollunk6`, `scrollunk7`, `UNK193`, `purity`, `evolvinglevel`, `UNK129`, `clickname`, `procname`, `wornname`, `focusname`, `scrollname`, `dsmitigation`, `heroic_str`, `heroic_int`, `heroic_wis`, `heroic_agi`, `heroic_dex`, `heroic_sta`, `heroic_cha`, `healamt`, `spelldmg`, `clairvoyance`, `backstabdmg`, `created`) VALUES
(391, 0, 'Kehns Old Robe', 0, 293, 0, 22, 5, 25, 0, 17, 0, 0, 0, 8, 1, 12, 1, 12, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, '', '0', 15360, 2147483647, '0', 0, 0, 31700, 15, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 9052, 20, 0, 0, 0, 3150, 5, 1575, 'IT63', 0, 10, 31700, 1, 1, 0, 'Runes of an unknown language are stitched into the robe', -1, 1, 3650, 11, 0, 10, -1, 15, 0, 255, 0, 15, 0, 65535, 0, 0, 0, 87, 1, 1, 3, 255, 0, 131072, -1, 4, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '0', '0', 0, -1, 0, '0', -1, 0, 0, 0, '0', '2006-04-18 07:58:40', '', 0, 0, 0, 0, 20, 0, 0, '00000000000000000000000000000000000000', 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 6, 0, 70, 0, -1, 0, 0, 0, 0, NULL, '2006-04-12 17:28:12', NULL, 'KingMort', 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, '', 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, '', '', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');

KingMort
06-15-2009, 12:24 PM
Strange after looking at it, I right click the merchant.. Click on the Kehns Robe says: I will not give you any adventure points for the Kehns Old Robe

Then i accidently clicked on an item with an augment it says:

I will not give you any adventure points for Flameshield Stone
I will not give you any adventure points for Grandmaster's Chest Symbol of Terror
I will not give you any adventure points for Last Blood of the Warmonger
I will not give you any adventure points for Chestplate of the Raid Addict


Listing the augments first ? (could be a new bug)

KLS
06-15-2009, 01:31 PM
It's a recently implemented feature that needs both new code + updated .conf files.

cavedude
06-15-2009, 02:20 PM
Yeah, you need a newer version of the server, Mort. 529 is before the adventure/instancing stuff went into the trunk.

As for bazaar not working, make sure you have doors with either type 153 or 155 placed where you want people to sell. One is for sellers, and the other for buyers. I am not sure which is which by looking, though on TGC it doesn't seem to matter. Players can buy and sell on either. If you're using the standard bazaar zone, PORCH_SHORT and PORCH_LONG are the doors you want. If not, then you'll need to find doors that are invisible or match the current zone's terrain.

KingMort
06-15-2009, 08:53 PM
DOH hehe well thanks guys appreciate it... Time to upgrade at some point I guess...

Domel
06-15-2009, 09:15 PM
My Adventure Merchant will buy back stuff with Titanium, but will not with SoF.
Using 670 source and 669 database. I'm using the latest conf.

It tells me "I will not give you any adventure points for Nightrage Sash."

trevius
06-15-2009, 09:22 PM
Just a guess, but I would bet that for SoF we need to set encodes/decodes for buying from Adventure Merchants. This is because of the slot difference between the 2 clients caused by the addition of the Power Source slot. It should be pretty easy to get the encodes setup and I already have a function that automatically converts the slot numbers, so it shouldn't be too tough. The only thing I don't have much info on is actual slot number that merchants use. I am not sure if that matters or not, though.

KLS
06-16-2009, 04:01 AM
Starting after titanium trev the items have a ldonsellbackrate field somewhere. In titanium it's hardcoded to 70, but sometime after they added it to the item struct, it's usually 70 but in some cases it's 0, I'd set it to 70 if we can find it just to retain backwards compatibility.

edit:

isbs.ldonpoint_type = 0;
isbs.ldontheme = item->LDoNTheme;
isbs.ldonprice = item->LDoNPrice;
isbs.unk098 = 70;
isbs.ldonsold = item->LDoNSold;

perhaps this isn't 100% right?

Oh I guess I should also mention: that message he's seeing is generated by the client not the server which is why I think the item struct may be off.

trevius
06-16-2009, 04:38 AM
Ahh, that makes sense now. I got the 70 value from the items table, so that probably is the right field for sellback. I guess it isn't unknown anymore lol. Whether it is in the correct place or not yet, I am not sure. It should be correct according to what 13th floor has though. It will probably still need slot conversions done on it for sell back or it will try to sell the wrong item. I will have to look at the structs when I get a chance and see how hard it will be to make encodes for them.

EDIT: I added in the Encode and Decode to handle slots for selling, but it doesn't make a difference. After comparing to Titanium, the selling encode/decode will be required anyway, so I added it to the SVN.

KLS, it appears you are correct that the client is the one deciding the the item cannot be sold. You are also probably right that it is related to those fields in the item structure. Maybe I can play around with it a bit sometime soon to see if I can figure out what is up with it. Maybe the fields are just off by a bit. I know I have some augs on my Live Rogue that were purchased from LDoN, so I should be able to use those to figure out where we are going wrong in the struct.

EDIT2: After comparing the structure to Live for a Radiant Permafrost augment purchased from LDoN, it looks like our structure should already be lined up properly unless it is arranged a bit differently than Live. Here is what I got from the packet collect from Live and also the matching fields from 13th floor which line up perfectly with our current structure for SoF as well as the surrounding (verified) parts of the structure:

01 00 00 00 pointtype
02 00 00 00 ldontheme
f8 02 00 00 ldonprice
46 00 00 00 ldonsellbackrate
01 00 00 00 ldonsold

uint32 ldonpoint_type;
uint32 ldontheme;
uint32 ldonprice;
uint32 unk098;
uint32 ldonsold;

Ahh, after looking at the Serialization in SoF.cpp, it looks like ldonpoint being set to 0 is probably the problem:

isbs.ldonpoint_type = 0;
isbs.ldontheme = item->LDoNTheme;
isbs.ldonprice = item->LDoNPrice;
isbs.unk098 = 70;
isbs.ldonsold = item->LDoNSold;

Going to test to verify if that is true.

EDIT3: Yep, that was it! Has to have ldonpoint set to something other than 0 for it to be sellable to an Adventure Merchant. I got it fixed and now on the SVN. I guess it is a good thing I got the encode/decode in already lol. Worked like a charm :)

trevius
06-16-2009, 09:05 PM
Coming back to this just to say that we might want to consider updating the items table to identify the UNK098 field. It's definitely the LDoN Sell Back Rate and items already have the proper values set there from what I have seen. We could probably set the default to 70, since that seems to be standard and would prevent custom item creators from wondering why their items don't sell for anything.

I would change it myself, but I don't know if our fields have to match 13th floor or not for PEQ to update from them. After looking at 13th floor again, it looks like they now have this field named to ldonsellbackrate, which should be fine for us as well.

Since it is currently unknown, we aren't using that field in either client right now. I don't think the change would be very hard. But, I am guessing we would need write some code to use it as well. Right now, there are cases where items might say they are going to sell for one amount and actually sell for a different amount.

Not a high priority, but something worth considering.

KingMort
07-21-2009, 09:44 AM
After finally getting this to work here are my findings:

Unk012 needs to be set to -1
Unk123 needs to be set to -1
Pointtype needs to be set to 1
Ldonsold needs to be set to 1

and of course you set your price... Anyway the guk merchant now buys back all the stuff.. Which made the players very happy..

Just a side note , Unk098 ?? didn't make any difference on my end.. Not sure what the deal is with that trev..

King Mortenson
www.raidaddicts.org