diff --git a/game-server/app/servers/role/handler/shopHandler.ts b/game-server/app/servers/role/handler/shopHandler.ts index 29c31a687..8299cb5ea 100644 --- a/game-server/app/servers/role/handler/shopHandler.ts +++ b/game-server/app/servers/role/handler/shopHandler.ts @@ -10,6 +10,7 @@ import { SHOP } from "../../../pubUtils/dicParam"; import { HeroModel } from "../../../db/Hero"; import { getShopListById } from "../../../services/shopService"; import { RewardInter } from "../../../pubUtils/interface"; +import { RoleModel } from "../../../db/Role"; export default function(app: Application) { return new ShopHandler(app); @@ -54,6 +55,12 @@ export class ShopHandler { return resResult(STATUS.GUILD_LV_LIMIT); } } + if(dicShopItem.lvlimit) { + let role = await RoleModel.findByRoleId(roleId, 'lv'); + if(role.lv < dicShopItem.lvlimit) { + return resResult(STATUS.LV_LIMIT); + } + } let userShop = await UserShopModel.findByRoleAndItem(roleId, dicShopItem.id); if(dicShopItem.purchaseLimit != -1) { diff --git a/shared/consts/statusCode.ts b/shared/consts/statusCode.ts index 0242da3d5..ac12399d1 100644 --- a/shared/consts/statusCode.ts +++ b/shared/consts/statusCode.ts @@ -391,6 +391,7 @@ export const STATUS = { ITEM_NOT_SOUL: { code: 30902, simStr: '该物品不是将魂' }, SKIN_HAS_NOT_HERO: { code: 30903, simStr: '未拥有该武将不可获得皮肤' }, HERO_NOT_MAX: { code: 30904, simStr: '该武将未升满星' }, + LV_LIMIT: { code: 30905, simStr: '玩家等级不足' }, // 任务相关 31001-31100 TASK_NOT_REACH_CONDITION: { code: 31001, simStr: '任务不满足条件' }, diff --git a/shared/pubUtils/dictionary/DicShop.ts b/shared/pubUtils/dictionary/DicShop.ts index d93174355..280b48dde 100644 --- a/shared/pubUtils/dictionary/DicShop.ts +++ b/shared/pubUtils/dictionary/DicShop.ts @@ -16,6 +16,8 @@ export interface DicShop { readonly type: number; // 军团等级需求 readonly guildLvLimit: number; + // 玩家等级需求 + readonly lvlimit: number; // 购买次数限制 readonly purchaseLimit: number; // 刷新类型 1-每日 2-每周 3-每月 @@ -36,6 +38,7 @@ export function loadShop() { arr.forEach(o => { o.guildLvLimit = o.guildlvlimit == '&'?0: o.guildlvlimit; + o.lvlimit = o.lvlimit == '&'?0: o.lvlimit; o.purchaseLimit = o.purchaselimit == '&'?-1: o.purchaselimit; if(!dicShop.has(o.shop)) { dicShop.set(o.shop, [o]); diff --git a/shared/resource/jsons/dic_zyz_shop.json b/shared/resource/jsons/dic_zyz_shop.json index 3f4d5242a..4d7b35922 100644 --- a/shared/resource/jsons/dic_zyz_shop.json +++ b/shared/resource/jsons/dic_zyz_shop.json @@ -6,6 +6,7 @@ "shop": 1, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 15, "refreshType": 1, "money": 31002, @@ -20,6 +21,7 @@ "shop": 1, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 8, "refreshType": 2, "money": 31002, @@ -34,6 +36,7 @@ "shop": 1, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 10, "refreshType": 1, "money": 31002, @@ -48,6 +51,7 @@ "shop": 1, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 30, "refreshType": 1, "money": 31002, @@ -62,6 +66,7 @@ "shop": 1, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 20, "refreshType": 1, "money": 31002, @@ -76,6 +81,7 @@ "shop": 1, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 20, "refreshType": 1, "money": 31002, @@ -90,6 +96,7 @@ "shop": 1, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 400, "refreshType": 1, "money": 31002, @@ -104,6 +111,7 @@ "shop": 1, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 20, "refreshType": 1, "money": 31002, @@ -118,6 +126,7 @@ "shop": 1, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 30, "refreshType": 2, "money": 31002, @@ -132,6 +141,7 @@ "shop": 1, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 5, "refreshType": 2, "money": 31002, @@ -146,6 +156,7 @@ "shop": 1, "type": 2, "guildlvlimit": "&", + "lvlimit": 41, "purchaselimit": 250, "refreshType": 1, "money": 31002, @@ -160,6 +171,7 @@ "shop": 1, "type": 2, "guildlvlimit": "&", + "lvlimit": 41, "purchaselimit": 250, "refreshType": 1, "money": 31002, @@ -174,6 +186,7 @@ "shop": 1, "type": 2, "guildlvlimit": "&", + "lvlimit": 41, "purchaselimit": 250, "refreshType": 1, "money": 31002, @@ -188,6 +201,7 @@ "shop": 1, "type": 2, "guildlvlimit": "&", + "lvlimit": 41, "purchaselimit": 250, "refreshType": 1, "money": 31002, @@ -202,6 +216,7 @@ "shop": 1, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 10, "refreshType": 1, "money": 31002, @@ -216,6 +231,7 @@ "shop": 1, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 1000, "refreshType": 1, "money": 31002, @@ -230,6 +246,7 @@ "shop": 1, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 1000, "refreshType": 1, "money": 31002, @@ -244,6 +261,7 @@ "shop": 2, "type": 5, "guildlvlimit": 1, + "lvlimit": 0, "purchaselimit": 200, "refreshType": 1, "money": 40005, @@ -258,6 +276,7 @@ "shop": 2, "type": 5, "guildlvlimit": 1, + "lvlimit": 0, "purchaselimit": 200, "refreshType": 1, "money": 40005, @@ -272,6 +291,7 @@ "shop": 2, "type": 5, "guildlvlimit": 1, + "lvlimit": 0, "purchaselimit": 200, "refreshType": 1, "money": 40005, @@ -286,6 +306,7 @@ "shop": 2, "type": 5, "guildlvlimit": 1, + "lvlimit": 0, "purchaselimit": 200, "refreshType": 1, "money": 40005, @@ -300,6 +321,7 @@ "shop": 2, "type": 5, "guildlvlimit": 1, + "lvlimit": 0, "purchaselimit": 200, "refreshType": 1, "money": 40005, @@ -314,6 +336,7 @@ "shop": 2, "type": 5, "guildlvlimit": 2, + "lvlimit": 0, "purchaselimit": 16, "refreshType": 1, "money": 40005, @@ -328,6 +351,7 @@ "shop": 3, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 7, "refreshType": 1, "money": 40001, @@ -342,6 +366,7 @@ "shop": 3, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 2, "refreshType": 2, "money": 40001, @@ -356,6 +381,7 @@ "shop": 3, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 2, "refreshType": 1, "money": 40001, @@ -370,6 +396,7 @@ "shop": 3, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 4, "refreshType": 1, "money": 40001, @@ -384,6 +411,7 @@ "shop": 3, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 6, "refreshType": 1, "money": 40001, @@ -398,6 +426,7 @@ "shop": 3, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 6, "refreshType": 1, "money": 40001, @@ -412,6 +441,7 @@ "shop": 4, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 2, "refreshType": 2, "money": 40004, @@ -426,10 +456,11 @@ "shop": 4, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 80, "refreshType": 2, "money": 40004, - "price": 20, + "price": 240, "chosen": 1, "indirectId": 0 }, @@ -440,6 +471,7 @@ "shop": 4, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 10, "refreshType": 2, "money": 40004, @@ -454,6 +486,7 @@ "shop": 4, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 10, "refreshType": 2, "money": 40004, @@ -468,6 +501,7 @@ "shop": 4, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 10, "refreshType": 2, "money": 40004, @@ -482,6 +516,7 @@ "shop": 4, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 10, "refreshType": 2, "money": 40004, @@ -496,6 +531,7 @@ "shop": 4, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 10, "refreshType": 2, "money": 40004, @@ -510,6 +546,7 @@ "shop": 5, "type": 7, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 1, "refreshType": 1, "money": 40006, @@ -524,6 +561,7 @@ "shop": 5, "type": 7, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 1, "refreshType": 1, "money": 40006, @@ -538,6 +576,7 @@ "shop": 5, "type": 7, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 1, "refreshType": 1, "money": 40006, @@ -552,6 +591,7 @@ "shop": 5, "type": 7, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 1, "refreshType": 1, "money": 40006, @@ -566,6 +606,7 @@ "shop": 5, "type": 7, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 1, "refreshType": 1, "money": 40006, @@ -580,6 +621,7 @@ "shop": 6, "type": 11, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 10, "refreshType": 1, "money": 40002, @@ -594,6 +636,7 @@ "shop": 6, "type": 12, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 10, "refreshType": 1, "money": 40002, @@ -608,6 +651,7 @@ "shop": 6, "type": 13, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 10, "refreshType": 1, "money": 40002, @@ -622,6 +666,7 @@ "shop": 6, "type": 14, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 10, "refreshType": 1, "money": 40002, @@ -636,6 +681,7 @@ "shop": 6, "type": 15, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 10, "refreshType": 1, "money": 40002, @@ -650,6 +696,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -664,6 +711,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -678,6 +726,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -692,6 +741,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -706,6 +756,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -720,6 +771,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -734,6 +786,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -748,6 +801,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -762,6 +816,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -776,6 +831,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -790,6 +846,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -804,6 +861,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -818,6 +876,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -832,6 +891,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -846,6 +906,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -860,6 +921,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -874,6 +936,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -888,6 +951,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -902,6 +966,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -916,6 +981,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -930,6 +996,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -944,6 +1011,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -958,6 +1026,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -972,6 +1041,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -986,6 +1056,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -1000,6 +1071,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -1014,6 +1086,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -1028,6 +1101,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -1042,6 +1116,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -1056,6 +1131,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -1070,6 +1146,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -1084,6 +1161,7 @@ "shop": 7, "type": 3, "guildlvlimit": "&", + "lvlimit": 20, "purchaselimit": 100, "refreshType": 1, "money": 40007, @@ -1098,6 +1176,7 @@ "shop": 7, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 20, "refreshType": 1, "money": 40007, @@ -1112,6 +1191,7 @@ "shop": 7, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 30, "refreshType": 2, "money": 40007, @@ -1126,6 +1206,7 @@ "shop": 7, "type": 5, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 5, "refreshType": 2, "money": 40007, @@ -1140,6 +1221,7 @@ "shop": 8, "type": 10, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 20, "refreshType": 1, "money": 40011, @@ -1154,6 +1236,7 @@ "shop": 8, "type": 10, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 30, "refreshType": 2, "money": 40011, @@ -1168,6 +1251,7 @@ "shop": 8, "type": 10, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 5, "refreshType": 2, "money": 40011, @@ -1182,6 +1266,7 @@ "shop": 8, "type": 10, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 5, "refreshType": 2, "money": 40011, @@ -1196,6 +1281,7 @@ "shop": 8, "type": 10, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 5, "refreshType": 2, "money": 40011, @@ -1210,6 +1296,7 @@ "shop": 8, "type": 10, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 5, "refreshType": 2, "money": 40011, @@ -1224,6 +1311,7 @@ "shop": 8, "type": 10, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 1, "refreshType": 1, "money": 40011, @@ -1238,6 +1326,7 @@ "shop": 8, "type": 10, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 1, "refreshType": 1, "money": 40011, @@ -1252,6 +1341,7 @@ "shop": 8, "type": 10, "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 1, "refreshType": 1, "money": 40011, @@ -1266,6 +1356,22 @@ "shop": 8, "type": 10, "guildlvlimit": "&", + "lvlimit": 0, + "purchaselimit": 1, + "refreshType": 1, + "money": 40011, + "price": 150000, + "chosen": 0, + "indirectId": 0 + }, + { + "id": 99, + "goodid": 17052, + "goodname": "玉石", + "shop": 8, + "type": 10, + "guildlvlimit": "&", + "lvlimit": 0, "purchaselimit": 1, "refreshType": 1, "money": 40011,