Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Easy Way to Populate Market with Game Items

Initiate Mage
Joined
Jul 13, 2018
Messages
20
Reaction score
2
I saw someone asking about this in a thread so I thought I'd share what I did to make it work.


1. Install windows python and pymongo (I don't remember if pymongo comes with it)

2. Run this python script

This will populate the market with most of the weapon, armor and accessory sets in the game, as well as some enhancing items like black stones.

You should only ever need to run this once, but if you want to tweak the script to add more items or whatever, you will probably need to manually delete itemMarket and itemMarketMaster collections from mongo's gameserver database. I included code in the script to do this but it fails silently, I'm not sure why, and I'm not too interested in polishing this little one-off any further.

BTW, part of the reason I use this is because I have made some SQLite queries which remove all non-stacking items from mob loot tables. So I needed another way to make these items available. I did this because I pumped up the item drop rate on my server and non stacking items quickly became a massive inventory nuisance. By replacing things like weapons and armor with stacking things like ores and feathers, you can still build currency from grinding without a big management hassle. If anyone wants the queries I used to do this, let me know and I'll share them.
 
Last edited:
Initiate Mage
Joined
Aug 5, 2018
Messages
2
Reaction score
0
You could not just share your itemMarket and itemMarketMaster files? I do not know how it all works, it's just an idea, I do not even know if I said some nonsense up there.
 
Initiate Mage
Joined
Jul 13, 2018
Messages
20
Reaction score
2
That data is stored in the mongo backend, so you need to use mongo to access it.
 
Initiate Mage
Joined
Aug 29, 2018
Messages
10
Reaction score
0
do you guys have a file from the market that i can use?
 
Initiate Mage
Joined
Jan 3, 2016
Messages
41
Reaction score
7
Using this marks the server as closed, any help?
 
Initiate Mage
Joined
Jul 13, 2018
Messages
20
Reaction score
2
Using this marks the server as closed, any help?

I haven't run into this issue, but I can suggest a few things.

1. Which repack are you using? This was made for devilspeak's.

2. Did you shut off the server before running the script to change it's backend? If not, that would probably be the problem and you're hosed unless you have a backup of the mongo database.

3. Did you create a user account to be the owner of the items being posted to the marketplace? Create a second account if you haven't already, doesn't need any special permissions just exist.
 
Initiate Mage
Joined
Jan 3, 2016
Messages
41
Reaction score
7
3. Might be the issue as I didn't create any accounts for this, as I didn't know I needed to
2. Yes
1. I am using devilspeak's
 
Initiate Mage
Joined
Jan 3, 2016
Messages
41
Reaction score
7
I've just just tried again with a user set for it but i still server closed (after resetting database)
 
Initiate Mage
Joined
Jul 13, 2018
Messages
20
Reaction score
2
I've tampered extensively with the two mongo tables this script changes. In the process of getting the script to work, I've put bad data in, incomplete data in, and dropped the tables entirely.

The python script literally only touches those two tables, and if you drop them (itemMarket, and itemMarketMaster), the server can still start fine, it just recreates them as needed. If dropping those tables doesn't fix your server and those tables are literally the only thing the script touches then it looks like the problem is elsewhere.

Whatever has gone wrong for you, and sorry if it seems like I'm just dodging, but I don't see how my script could have caused it. It could be that starting the server without creating the user first caused it to enter this new error state but it would be atypical of the issues I have seen, so I kind of doubt it.

If you have done anything else with your server recently, I would focus on that.
 
Initiate Mage
Joined
Jan 3, 2016
Messages
41
Reaction score
7
I've tampered extensively with the two mongo tables this script changes. In the process of getting the script to work, I've put bad data in, incomplete data in, and dropped the tables entirely.

The python script literally only touches those two tables, and if you drop them (itemMarket, and itemMarketMaster), the server can still start fine, it just recreates them as needed. If dropping those tables doesn't fix your server and those tables are literally the only thing the script touches then it looks like the problem is elsewhere.

Whatever has gone wrong for you, and sorry if it seems like I'm just dodging, but I don't see how my script could have caused it. It could be that starting the server without creating the user first caused it to enter this new error state but it would be atypical of the issues I have seen, so I kind of doubt it.

If you have done anything else with your server recently, I would focus on that.
My server is a fresh install following a tutorial that was using devilspeak's.

Could it have something to do with those two tables not existing originally?
 
Initiate Mage
Joined
Jul 13, 2018
Messages
20
Reaction score
2
My server is a fresh install following a tutorial that was using devilspeak's.

Could it have something to do with those two tables not existing originally?

Just to confirm, you were able to play and login prior to running my script right? Your server worked, you shut it off, you left mongodb running, you ran my script, then you restarted loginserver and gameserver with no other configuration changes, and when you hit play from the main menu you got "Server Closed" message. If all of that is true that it certainly appears my script caused the issue but I still don't see how.

The only time I've seen the server closed message was when I tried to login before the gameserver had fully completed it's initialization. Take a look at gameserver's console output and see if it reaches the point of successfully connecting to the loginserver at the end.

Have you tried dropping the two tables I mentioned? It's a long shot imo but should be ruled out.
 
Initiate Mage
Joined
Jan 3, 2016
Messages
41
Reaction score
7
Just to confirm, you were able to play and login prior to running my script right? Your server worked, you shut it off, you left mongodb running, you ran my script, then you restarted loginserver and gameserver with no other configuration changes, and when you hit play from the main menu you got "Server Closed" message. If all of that is true that it certainly appears my script caused the issue but I still don't see how.

The only time I've seen the server closed message was when I tried to login before the gameserver had fully completed it's initialization. Take a look at gameserver's console output and see if it reaches the point of successfully connecting to the loginserver at the end.

Have you tried dropping the two tables I mentioned? It's a long shot imo but should be ruled out.
Dropping the 2 tables does fix the server closed, and yes I was able to play prior
 
Initiate Mage
Joined
Jul 13, 2018
Messages
20
Reaction score
2
ok then, not sure how your environment could be different then mine but fair enough you apparently can't use this.
 
Experienced Elementalist
Joined
Jun 17, 2014
Messages
273
Reaction score
33
Ok I made it run and it works, thanks !
Can your script be edited to add like crafting components etc... ? Or does it require another script ?
+ I could be interested in the queries your mention in your first post.
Thanks !
 
Initiate Mage
Joined
Jul 13, 2018
Messages
20
Reaction score
2
Yes you can add more items to the script. Make sure to delete itemMarket and itemMarketMaster before you run it each time. You can get item IDs from bddatabase and add them to the lists for weapons or armor.

Here are some queries I used to buff gear a bit. To run these queries, use something like sqlitedatabase browser portable on gameserver\bin\data\sqlite3\bdo.sqlite3.

-Boss Gears, Steel Taritas, Taritas, Zereth, Agerian, Hercules', Grunil, Fortuna, Rocaba, Heve, Talis and their Ultimate versions

-AP Bonus to helmets (Enchant x3, so +60 AP at PEN
UPDATE `2_Blunt` SET
AddedDDD = (Enchant * 3) + AddedDDD,
AddedRDD = (Enchant * 3) + AddedRDD,
AddedMDD = (Enchant * 3) + AddedMDD
WHERE `Index` IN (11013, 10813, 10821, 10809, 11005, 11001, 11009, 10817, 10933, 10937, 10421, 10853, 10869, 10837, 11030, 11062, 10985, 11046, 10885);

-Damage reduction bonus to chest pieces, 60 DR at PEN
UPDATE `2_Blunt` SET
DPV = (Enchant * 3) + DPV,
RPV = (Enchant * 3) + RPV,
MPV = (Enchant * 3) + MPV,
HDPV = (Enchant * 3) + HDPV,
HRPV = (Enchant * 3) + HRPV,
HMPV = (Enchant * 3) + HMPV
WHERE `Index` IN (11017, 11014, 10814, 10822, 10810, 11006, 11002, 11010, 10818, 10934, 10938, 14122, 10854, 10870, 10838, 11031, 10962, 11063, 10986, 11047, 10886);

-Accuracy bonus to gloves, 60 accuracy at PEN
UPDATE `2_Blunt` SET
DHit = (Enchant * 3) + DHit,
MHit = (Enchant * 3) + MHit,
RHit = (Enchant * 3) + RHit
WHERE `Index` IN (11015, 10815, 10823, 10811, 11007, 11003, 11011, 10819, 10935, 10939, 14123, 10855, 10871, 10839, 11032, 10963, 11064, 10987, 11048, 10887);


-Evasion bonus to shoes, 60 evasion at PEN
UPDATE `2_Blunt` SET
DDV = (Enchant * 3) + DDV,
RDV = (Enchant * 3) + RDV,
MDV = (Enchant * 3) + MDV
WHERE `Index` IN (11016, 10816, 10824, 10812, 11008, 11004, 11012, 10820, 10936, 10940, 14124, 10856, 10872, 10840, 10964, 11065, 10988, 11033, 11049, 10888);

These bonuses apply in addition to any hidden bonuses that may already be present on this items. These cover boss armors, regular green armors, and their ultimate variants. They do not apply to all possible reform versions of an item though, so if you reform a piece of Grunil to blue, it will lose the bonus.

I also buffed some individual pieces of armour and jewelry, usually to have more regen, because I like regen.

Some random examples:
--2 HP/MP regen on all binder accessories
UPDATE `3_TwoHandSword` SET VariedRecovHP = 2, VariedRecovMP = 2 WHERE `Index` IN (11608, 11809, 12009, 12209);
--Sometimes regen doesn't work until you use a potion, but then it starts working as normal

--Mark of Shadow: - Crit+2,HPRegen+5
UPDATE `3_TwoHandSword` SET Itemname='Mark of Shadow', VariedCriticalRate=2, VariedRecovHP=5 WHERE `Index`=12007;

--Shrine Guardian's Token: MPRegen+10,Attack/Cast speed+2
UPDATE `3_TwoHandSword` SET Itemname='Shrine Guardian Token', VariedRecovMP=10, VariedAttackSpeedRate=2,VariedCastingSpeedRate=2 WHERE `Index`=12008;

--Ancient Guardian's Seal: Gathering+3,Luck+3,HPRegen+20
UPDATE `3_TwoHandSword` SET Itemname='Ancient Guardian Seal', VariedRecovHP=20, VariedCollectionSpeedRate=2, VariedFishingSpeedRate=2, VariedDropItemRate=2 WHERE `Index`=11613;

The reason the queries also save the name of the item is because names in the DB are in korean. So sometimes I'm snooping through the data it's nice to see what the items are. The name in the db doesn't actually do anything, it's just one of the many many instances of the backend being bizarre/poorly implemented but it can be handy.

Finally, some God items so you can solo world bosses.
-- Jarette Necklace: Ultimate Damage
UPDATE `3_TwoHandSword` SET Itemname='Jarette Necklace', AddedDDD=8000, AddedRDD=8000, AddedMDD=8000, DHIT=8000, RHIT=8000, MHIT=8000, VariedCriticalRate=5, VariedAttackSpeedRate=5, VariedCastingSpeedRate=5, VariedCollectionSpeedRate=5, VariedFishingSpeedRate=5, VariedDropItemRate=5, VariedMaxMP=8000, VariedMaxMP=8000, VariedRecovMP=500 WHERE `Index`=11626;

-- Jarette Ring More Ultimate Damage
UPDATE `3_TwoHandSword` SET Itemname='Jarette Ring', AddedDDD=32000, AddedRDD=32000, AddedMDD=32000 WHERE `Index`=12035;

-- Jarette Earring Even More Ultimate Damage
UPDATE `3_TwoHandSword` SET Itemname='Jarette Earring', AddedDDD=64000, AddedRDD=64000, AddedMDD=64000 WHERE `Index`=11829;

-- Jarette Belt: Ultimate Tank
UPDATE `3_TwoHandSword` SET Itemname='Jarette Belt', DPV=2000, RPV=2000, MPV=2000, HDPV=2000, HRPV=2000, HMPV=2000, VariedRecovHP=2000, VariedMaxHP=8000 WHERE `Index`=12231;

Princess Jarette was an invincible god of death the whole time.
 
Experienced Elementalist
Joined
Jun 17, 2014
Messages
273
Reaction score
33
Thank you for such information !
Outside of gear, is it possible to add items like crafting components you gather in the world ?
 
Experienced Elementalist
Joined
Jun 17, 2014
Messages
273
Reaction score
33
Oh ok, will read again.
Thanks.

Hello fullhawk,

Hoping I won't bother you witht he following question: I'm trying to understand your script in order to add items.
My question is: in the specific case of Black Stone, why are you putting them 2 times...

Here:
  • ## Crafting ##
  • [ 50000, 44195 ], # Memory Fragment
  • [ 100000, 4911, 4910 ], # grade 3 reform stones
  • [ 100000, 16001, 16002 ], # Black stones
  • [ 10000000, 16004, 16005 ], # Concentrated Black stones

And here:
  • [ 100000, 9999, 16001, 16002 ], # Black stones
  • [ 10000000, 999, 16004, 16005 ], # Concentrated Black stones

Why not only leave the code with the quantity ?

Thanks.
 
Last edited by a moderator:
Initiate Mage
Joined
Jul 13, 2018
Messages
20
Reaction score
2
Hello @fullhawk,

Hoping I won't bother you witht he following question: I'm trying to understand your script in order to add items.
My question is: in the specific case of Black Stone, why are you putting them 2 times...

Here:


And here:


Why not only leave the code with the quantity ?

Thanks.

It's no bother at all. As you have seen, there are definitions for weapons, armor and miscellaneous items ("other"). I initially intended to have miscellaneous items be processed differently than weapons or armor, but later changed it so that everything gets quantity of 9999, which means misc items are no longer processed differently than weapons. Actually the same is true of armor. There is a comment in the code that says chest pieces are more expensive than other pieces, but that doesn't actually happen so technically nothing would change if you just stuff all data into the weapon section.

Just ignore the "other" section and add anything you want to add to the weapon section. It was very sloppy of me to leave in unused code, I should have removed that before sharing the script, sorry about that. You can also safely remove the addDupes() and buildOther() functions as they are not used.
 
Back
Top