-
Member
Vendor item order on Mangos 1.12 Vanilla server
Recently I downloaded Brotalnia's Vanilla 1.12 pack and everything suits me fine except when I add items to a vendor they appear in some sort of random order even tho I write script in order, even when I add items manually in the game, after server restart there is a mess. I noticed Trinity code has 'slot' but what about Mangos?
SOLUTION: The only way to make them in order is to add them in order the first time. If you delete 1+ items or if you delete a vendor it will be given random order after you make vendor with same "entry" and/or "id".
Last edited by Judgemend; 05-18-2017 at 11:13 AM.
-
OwnedCore News Correspondent
Check out this function: server/ObjectMgr.cpp at master * mangosone/server * GitHub
In particular this line: server/ObjectMgr.cpp at master * mangosone/server * GitHub
it is the line that queries the DB. It doesn't have a ORDERBY directive in it, so you could maybe add that, recompile the server and see if that solves your issue.
-
Member
Where do I put those lines? I am complete noob to server scripting.
-
Elite User
You would have to edit the core's source code and recompile it. If you're a noob, then it's not for you.
Vendor items should be in the order you first added them, but if you delete an item from the list, then it starts acting weird when you add another one. I think it goes in the spot of the item you deleted, instead of being the last one. Make sure you add everything in the order you want the first time!
-
OwnedCore News Correspondent
If you want to run your own server, you should be compiling from source anyway. I mean, no offense, I started doing the same thing... just running someones pre-compiled code.
But once I figured out how the package I was using compiled, things I needed to make work. I could actually go and change certain things and re-compile at will.
I could even fix bugs myself
-
Member
Originally Posted by
brotalnia
You would have to edit the core's source code and recompile it. If you're a noob, then it's not for you.
Vendor items should be in the order you first added them, but if you delete an item from the list, then it starts acting weird when you add another one. I think it goes in the spot of the item you deleted, instead of being the last one. Make sure you add everything in the order you want the first time!
Well, the thing is I add around 80 items to vendor at a time with a similar SQL script you have on your repack. And even tho the script itself is in order for some reason they appear randomly in "npc_vendor" list. If what you're saying is true then I have to add them directly in "npc_vendor" one by one which will take huge ass long time for 2k+ items.
-
Elite User
Are you sure you did not run your sql twice? If you first added items to the vendor, then deleted them and ran the same sql again, they will be in random order. Make sure this is the first time you are adding items to this vendor. If you **** up, you have to delete the whole mangos database, and then recreate it by importing your clean backup that was made before you tried adding anything. Now if you run your sql on the clean db, the items should be in the right order.
-
Member
I very often used script to delete NPCs and and everything about them including items they sell, then running the script again to put them into database. Is there a clean back up that is stored somewhere in your repack?
-
Elite User
Yes there is a backup in the "sql" folder. Both of the clean db from github, and of the updated one that comes with the repack (all migrations already applied).
-
Post Thanks / Like - 1 Thanks
Judgemend (1 members gave Thanks to brotalnia for this useful post)