Jump to content

Recommended Posts

Spoiler

204014280efe73cd8ce1b2e253e352b1e56c40.p

 

ClientManagerBoot.cpp

 

//search

    static const char * s_szQuery =
        "SELECT "
        "shop.vnum, "
        "shop.npc_vnum, "
        "shop_item.item_vnum, "
        "shop_item.count "
        "FROM shop LEFT JOIN shop_item "
        "ON shop.vnum = shop_item.shop_vnum ORDER BY shop.vnum, shop_item.item_vnum";

 

//replace or adapt:

    static const char * s_szQuery =
        "SELECT "
        "shop.vnum, "
        "shop.npc_vnum, "
        "shop_item.item_vnum, "
        "shop_item.count "
        "FROM shop LEFT JOIN shop_item "
        "ON shop.vnum = shop_item.shop_vnum ORDER BY shop.vnum, shop_item.id";    // shop_item.item_vnum - shop_item.id

 

shop_item.sql

 

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for shop_item
-- ----------------------------
DROP TABLE IF EXISTS `shop_item`;
CREATE TABLE `shop_item` (
  `id` int(10) UNSIGNED NOT NULL DEFAULT 1,
  `shop_vnum` int(11) NOT NULL DEFAULT 0,
  `item_vnum` int(11) NOT NULL DEFAULT 0,
  `count` tinyint(4) unsigned NOT NULL DEFAULT 1
) ENGINE = MyISAM CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Fixed;

-- ----------------------------
-- Records of shop_item
-- ----------------------------
INSERT INTO `shop_item` VALUES (1, 1, 1009, 1);
INSERT INTO `shop_item` VALUES (2, 1, 297, 1);
INSERT INTO `shop_item` VALUES (3, 1, 4049, 1);
SET FOREIGN_KEY_CHECKS=1;

 

  • Love 6
Link to comment
https://metin2.dev/topic/24290-order-items-in-shop-according-to-id/
Share on other sites

  • 5 months later...

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.