[DiscordArchive] you mean an update join for the "slot" column?
[DiscordArchive] you mean an update join for the "slot" column?
Archived author: Barbz • Posted: 2020-05-31T16:23:02.274000+00:00
Original source
you mean an update join for the "slot" column?
Archived author: MaloW • Posted: 2020-05-31T16:24:27.472000+00:00
Original source
If I were to guess there's some optimization setting the core uses to do selects where it operates on a sort of "find first" rather than "maintain original order" if no specific order is asked for. Probably has to do with different internal partitions of the DB or something. I'm no DB expert but I've heard DB experts talk about these things hehe
Archived author: MaloW • Posted: 2020-05-31T16:24:55.891000+00:00
Original source
Yeah, basically like pulling the ilvl from item_template and inserting the ilvl into "slot" for each item, that way they will all be sorted by ilvl
Archived author: Barbz • Posted: 2020-05-31T16:25:46.794000+00:00
Original source
i think the slot is tinyint (255 max)
Archived author: Barbz • Posted: 2020-05-31T16:26:13.927000+00:00
Original source
no
Archived author: Barbz • Posted: 2020-05-31T16:26:15.886000+00:00
Original source
it's smallint
Archived author: Barbz • Posted: 2020-05-31T16:26:33.244000+00:00
Original source
with insert join, you can't get the right order too, i had to make crazy queries with temporary tables + subqueries and it still didn't order correctly
i had to make a loop in sql to put the slot number right but it's hacky and awful (took me two hours)
Archived author: MaloW • Posted: 2020-05-31T16:26:38.242000+00:00
Original source
UPDATE npc_vendor INNER JOIN item_template ON npc_vendor.item = item_template.entry
SET npc_vendor.slot = item_template.RequiredLevel WHERE X
This for example will order all the items based on required level to use it. I used that to order all food and water on vendors correctly
Archived author: Barbz • Posted: 2020-05-31T16:27:21.191000+00:00
Original source
ok cool but still the items with same slot will be ordered seemingly randomly and we are still clueless as to why it happens
Archived author: Barbz • Posted: 2020-05-31T16:27:40.060000+00:00
Original source
while the original NPC vendor is ordered logically