AdamGagorik / ffxiahbot

A python module for interacting with a darkstar server.
MIT License
22 stars 55 forks source link

Pull Prices from NPC Sale sale values in Database? #29

Open xMANAx opened 3 years ago

xMANAx commented 3 years ago

I was wondering if it's possible to somehow populate the prices for items from the database, namely what items will sell to the NPC for. Server economies are a hard thing to manage, and scraping XIAH has a LOT of downfalls, namely items used to clean gil by RMT. You'll find tons of things that sell for obscene amounts of gil, like a single arrow for 800m, etc. Editing the entire items.csv by hand is a ridiculous undertaking. I was thinking if NPC sale values could be used to populate the items.csv, then you could just multiply the value x number of times manually afterwards, or have a variable you could define elsewhere to do it automatically. Just a thought.

xMANAx commented 3 years ago

I do realize that some items have a wonky NPC value, whether it be on retail or just a private server database error, but I feel like going back through the items.csv and spotting these (such as items that have no NPC value) would be a lot easier to spot and fix than the XIAH pull.

xMANAx commented 3 years ago

If not that, then would it be possible to rework how scrubbing is done, changing the items.csv into sections and ordered by level? Say Weapons -> H2H then all the H2H weapons 1-99 in order, etc and so forth. One of these days I've really gotta sit down and teach myself Python.

AdamGagorik commented 3 years ago

It would be theoretically possible to determine the item prices from the dark star server itself, as I think they probably have that information in a SQL table somewhere. That or I think they might specify the prices in Lua scripts for each NPC. So, that would be quite the undertaking and probably a little error prone.

As for sorting the item table - I think that is also possible. I do not know if we could get the item level from FFXIAH though. That means we would probably need to, again, read an SQL table from dark star server itself. So that is also a lot of work.

There actually already is a little bit of support so separating the items.csv. For example, you can have the scrub app only download information for a specific category if you know the URL for that category. Likewise, you can also have the broker load multiple item.csv files by specifying them as a list in the config.yaml. It will merge them together in memory.

TeoTwawki commented 3 years ago

@AdamGagorik

as I think they probably have that information in a SQL table somewhere

the item basic table contains the base price (before fame modifiers, which aren't fully implemented) the NPCs will pay to players. the price NPC's sell to the player is done in script except for the older style guild shops which are a convoluted mess being phased out from their former home in the guild table.

@xMANAx Tip for both sorting and some editing: the items.csv file is excel compatible, you can load it in excel, LibreOffice, google sheets, whatever you prefer, and just make sure when you save that you save as comma separated values still and it will work (tho it changes the spacing, but python doesn't care about that).

I have hand made mine just by doing some regex transforms to build just list off the results of a query on my item db (select blah blah where item is a sword and between lv19 and 39, etc) for my sections, then filled in prices I felt were reasonably expensive so my crafters could undercut them (I have buying back from players disabled to facilitate this).