Files
ZYZ/shared/consts/constModules/itemConst.ts
2021-03-16 11:21:17 +08:00

257 lines
13 KiB
TypeScript

export const IT_TYPE = {
BLUEPRT: 28,
EQUIP_PIECE: 3,
EQUIP: 2,
HERO_PIECE: 7,
}
// 背包页签
export const GOOD_TYPE = {
ITEM: 1,
EQUIP: 2,
PIECE: 3,
BLUEPRT: 4,
JEWEL: 5,
PICTURE: 6
};
// 存到消耗品表内显示的类型
export const CONSUME_TYPE = {
CONSUME: 1, // 消耗品
SOUL: 2, // 将魂
BLUEPRT: 3, // 藏宝图
POINT: 4, // 远征币等
EXP: 5, // 经验书
FAVOUR: 6, // 好感度道具
SKIN: 7, // 时装
PIECE: 8, // 装备碎片
JEWEL: 9, //宝石
FRIEND_FAVOUR: 10, // 好友道具
HEAD: 11, // 头像
FRAME: 12, // 相框
SPINE: 13, // 形象
};
export enum ROLE_TERAPH {
START = 1,
END = 4
}
export enum PVP_PLAYER_POS {
START = 1,
END = 3
}
export enum PVP_HERO_POS {
START = 2001,
END = 2009
}
export enum PVP_HERO_ORDER {
START = 1,
END = 9
}
export enum EQUIP_TYPE {
START = 1,
WEAPON = 1, // 神兵(武器)
CLOTHES = 2, // 宝甲(上装)
SHOES = 3, // 行具(下装)
CAP = 4, // 冠冕(头部)
BOOK = 5, // 典籍(饰品)
ACCESSORY = 6, // 礼器(饰品)
END = 6
}
export enum JEWEL_TYPE {
WEAPON = 42, // 神兵(武器)
CLOTHES = 43, // 宝甲(上装)
SHOES = 45, // 行具(下装)
CAP = 44, // 冠冕(头部)
BOOK = 47, // 典籍(饰品)
ACCESSORY = 46, // 礼器(饰品)
}
export const ITEM_TABLE = {
EQUIP: 'equip',
ITEM: 'item',
ROLE: 'role',
HERO: 'hero'
}
const itid_array = [
{ id: 1, name: '短兵(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON},
{ id: 2, name: '枪矛(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 3, name: '重兵(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 4, name: '弓弩(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 5, name: '奇门(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 6, name: '羽扇(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 7, name: '法器(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 8, name: '杖(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 9, name: '头盔(冠冕)', table: 'equip', type: EQUIP_TYPE.CAP, equipJewel: JEWEL_TYPE.CAP },
{ id: 10, name: '头冠(冠冕)', table: 'equip', type: EQUIP_TYPE.CAP, equipJewel: JEWEL_TYPE.CAP },
{ id: 11, name: '头巾(冠冕)', table: 'equip', type: EQUIP_TYPE.CAP, equipJewel: JEWEL_TYPE.CAP },
{ id: 12, name: '重铠(宝甲)', table: 'equip', type: EQUIP_TYPE.CLOTHES, equipJewel: JEWEL_TYPE.CLOTHES },
{ id: 13, name: '皮甲(宝甲)', table: 'equip', type: EQUIP_TYPE.CLOTHES, equipJewel: JEWEL_TYPE.CLOTHES },
{ id: 14, name: '布衣(宝甲)', table: 'equip', type: EQUIP_TYPE.CLOTHES, equipJewel: JEWEL_TYPE.CLOTHES },
{ id: 15, name: '兵书(典籍)', table: 'equip', type: EQUIP_TYPE.BOOK, equipJewel: JEWEL_TYPE.BOOK },
{ id: 16, name: '杂记(典籍)', table: 'equip', type: EQUIP_TYPE.BOOK, equipJewel: JEWEL_TYPE.BOOK },
{ id: 17, name: '经典(典籍)', table: 'equip', type: EQUIP_TYPE.BOOK, equipJewel: JEWEL_TYPE.BOOK },
{ id: 18, name: '马(行具)', table: 'equip', type: EQUIP_TYPE.SHOES, equipJewel: JEWEL_TYPE.SHOES },
{ id: 19, name: '鞋(行具)', table: 'equip', type: EQUIP_TYPE.SHOES, equipJewel: JEWEL_TYPE.SHOES },
{ id: 20, name: '车(行具)', table: 'equip', type: EQUIP_TYPE.SHOES, equipJewel: JEWEL_TYPE.SHOES },
{ id: 21, name: '佩饰(礼器)', table: 'equip', type: EQUIP_TYPE.ACCESSORY, equipJewel: JEWEL_TYPE.ACCESSORY },
{ id: 22, name: '钟鼎(礼器)', table: 'equip', type: EQUIP_TYPE.ACCESSORY, equipJewel: JEWEL_TYPE.ACCESSORY },
{ id: 23, name: '印章(礼器)', table: 'equip', type: EQUIP_TYPE.ACCESSORY, equipJewel: JEWEL_TYPE.ACCESSORY },
{ id: 24, name: '消耗品', table: 'item', type: CONSUME_TYPE.CONSUME },
{ id: 37, name: '消耗类物品(图纸类)', table: 'item', type: CONSUME_TYPE.CONSUME },
{ id: 35, name: '消耗类物品(经验书)', table: 'item', type: CONSUME_TYPE.EXP },
{ id: 36, name: '消耗类物品(好感道具)', table: 'item', type: CONSUME_TYPE.FAVOUR },
{ id: 38, name: '消耗类物品(材料类)', table: 'item', type: CONSUME_TYPE.CONSUME },
{ id: 24, name: '使用类物品(宝箱类)', table: 'item', type: CONSUME_TYPE.CONSUME },
{ id: 25, name: '武将碎片', table: 'item', type: CONSUME_TYPE.SOUL },
{ id: 26, name: '剧情物品', table: 'item', type: CONSUME_TYPE.CONSUME },
{ id: 27, name: '货币', table: 'role', isCurrency: true },
{ id: 28, name: '藏宝图', table: 'item', type: CONSUME_TYPE.BLUEPRT },
{ id: 29, name: '礼器', table: 'equip', type: EQUIP_TYPE.ACCESSORY },
{ id: 30, name: '宝甲', table: 'equip', type: EQUIP_TYPE.CLOTHES },
{ id: 31, name: '名驹', table: 'equip', type: EQUIP_TYPE.SHOES },
{ id: 32, name: '典籍', table: 'equip', type: EQUIP_TYPE.BOOK },
{ id: 33, name: '神兵', table: 'equip', type: EQUIP_TYPE.WEAPON },
{ id: 34, name: '代币', table: 'item', type: CONSUME_TYPE.POINT },
{ id: 39, name: '时装', table: 'hero', type: CONSUME_TYPE.SKIN },
{ id: 40, name: '装备碎片', table: 'item', type: CONSUME_TYPE.PIECE },
{ id: 41, name: '图纸', table: 'item', type: CONSUME_TYPE.CONSUME },
{ id: 42, name: '神兵宝石', table: 'item', type: CONSUME_TYPE.JEWEL },
{ id: 43, name: '宝甲宝石', table: 'item', type: CONSUME_TYPE.JEWEL },
{ id: 44, name: '免冠宝石', table: 'item', type: CONSUME_TYPE.JEWEL },
{ id: 45, name: '足具宝石', table: 'item', type: CONSUME_TYPE.JEWEL },
{ id: 46, name: '礼器宝石', table: 'item', type: CONSUME_TYPE.JEWEL },
{ id: 47, name: '典籍宝石', table: 'item', type: CONSUME_TYPE.JEWEL },
{ id: 48, name: '灵玄石', table: 'item', type: CONSUME_TYPE.JEWEL },
{ id: 49, name: '玩家好感道具', table: 'item', type: CONSUME_TYPE.FRIEND_FAVOUR },
{ id: 50, name: '形象', table: 'role', type: CONSUME_TYPE.HEAD },
{ id: 51, name: '相框', table: 'role', type: CONSUME_TYPE.FRAME },
{ id: 52, name: '玩家形象', table: 'role', type: CONSUME_TYPE.SPINE }
];
export const ITID = new Map<number, {id: number, name: string, table: string, type?: number, isCurrency?: boolean, equipJewel?: number}>();
for(let obj of itid_array) {
ITID.set(obj.id, obj);
}
export const CURRENCY_TYPE = {
GOLD: "gold",
COIN: "coin",
ACTION_POINT: "ap",
TREASURE_POINT: "treasurePoint",
EXPEDITION_POINT: "expeditionPoint",
DUNGEON_POINT: "dungeonPoint",
FRIEND_POINT: "friendPoint",
HONOUR: "honour"
}
export const SPEICAL_ITEM = {
REFINE_ADD_RATE: [17039]
};
const currencyArr = [
{ "gid": 31001, "name": "铜钱", "type": CURRENCY_TYPE.COIN },
{ "gid": 31002, "name": "元宝", "type": CURRENCY_TYPE.GOLD },
{ "gid": 31003, "name": "体力", "type": CURRENCY_TYPE.ACTION_POINT },
{ "gid": 40001, "name": "远征币", "type": CURRENCY_TYPE.EXPEDITION_POINT },
{ "gid": 40002, "name": "寻宝币", "type": CURRENCY_TYPE.TREASURE_POINT },
{ "gid": 40003, "name": "情谊点", "type": CURRENCY_TYPE.FRIEND_POINT },
{ "gid": 40004, "name": "秘境币", "type": CURRENCY_TYPE.DUNGEON_POINT },
{ "gid": 40005, "name": "功勋", "type": CURRENCY_TYPE.HONOUR }
];
export const CURRENCY = new Map<number, {gid: number, name: string, type: string}>();
export const CURRENCY_BY_TYPE = new Map<string, number>();
for(let obj of currencyArr) {
CURRENCY.set(obj.gid, obj);
CURRENCY_BY_TYPE.set(obj.type, obj.gid);
}
export enum QUALITY_TYPE {
BLUE = 1, // 蓝
PURPLE = 2, // 紫
ORANGE = 3, // 橙
RED = 4, // 红
GOLD = 5 // 金
}
export const GOOD_QUALITY = [QUALITY_TYPE.BLUE, QUALITY_TYPE.PURPLE, QUALITY_TYPE.ORANGE, QUALITY_TYPE.RED, QUALITY_TYPE.GOLD];
export const COM_BTL_QUALITY = [QUALITY_TYPE.BLUE, QUALITY_TYPE.PURPLE, QUALITY_TYPE.ORANGE, QUALITY_TYPE.RED];
// 各品质随机属性条数 quality => number
export const RANDOM_SE_COUNT = new Map<number, number>([
[QUALITY_TYPE.BLUE, 0],
[QUALITY_TYPE.PURPLE, 1],
[QUALITY_TYPE.ORANGE, 2],
[QUALITY_TYPE.RED, 3],
[QUALITY_TYPE.GOLD, 4]
]);
export const FIX_ATTRIBUTES_RAN = 20; // 固定属性值+-20%随机
export function getCurNameById(gid) {
let currency = CURRENCY.get(gid);
if (!currency) {
return;
}
if (currency.type == CURRENCY_TYPE.COIN) {
return 'coin';
} else if (currency.type == CURRENCY_TYPE.GOLD) {
return 'gold';
} else if (currency.type == CURRENCY_TYPE.ACTION_POINT) {
return 'ap';
} else if (currency.type == CURRENCY_TYPE.FRIEND_POINT) {
return 'frdCnt';
} else if (currency.type == CURRENCY_TYPE.EXPEDITION_POINT) {
return 'expeditionPoint';
} else if (currency.type == CURRENCY_TYPE.HONOUR) {
return 'honour'
}
}
export function getDropItems() {
let items = [
{ id:25 ,count: 1 },{ id:225 ,count: 1 },{ id:625 ,count: 1 },{ id:2025 ,count: 1 },{ id:3025 ,count: 1 },{ id:4025 ,count: 1 },{ id:5025 ,count: 1 },{ id:6025 ,count: 1 },
{ id:1 ,count: 1 },{ id:2 ,count: 1 },{ id:101 ,count: 1 },{ id:102 ,count: 1 },{ id:201 ,count: 1 },{ id:202 ,count: 1 },{ id:301 ,count: 1 },{ id:302 ,count: 1 },
{ id:401 ,count: 1 },{ id:501 ,count: 1 },{ id:601 ,count: 1 },{ id:602 ,count: 1 },{ id:701 ,count: 1 },{ id:702 ,count: 1 },{ id:2001 ,count: 1 },{ id:2002 ,count: 1 },
{ id:2101 ,count: 1 },{ id:2102 ,count: 1 },{ id:2201 ,count: 1 },{ id:2202 ,count: 1 },{ id:3001 ,count: 1 },{ id:3002 ,count: 1 },{ id:3101 ,count: 1 },{ id:3102 ,count: 1 },
{ id:3201 ,count: 1 },{ id:3202 ,count: 1 },{ id:4001 ,count: 1 },{ id:4002 ,count: 1 },{ id:4101 ,count: 1 },{ id:4102 ,count: 1 },{ id:4201 ,count: 1 },{ id:4202 ,count: 1 },
{ id:5001 ,count: 1 },{ id:5002 ,count: 1 },{ id:5101 ,count: 1 },{ id:5102 ,count: 1 },{ id:5201 ,count: 1 },{ id:5202 ,count: 1 },{ id:6001 ,count: 1 },{ id:6002 ,count: 1 },
{ id:6101 ,count: 1 },{ id:6102 ,count: 1 },{ id:11001 ,count: 10000},{ id:11002 ,count: 10000 },{ id:11003,count: 10000 },{ id:11004 ,count: 100000 },{ id:11011 ,count: 100000 },
{ id:11012 ,count: 100000 },{ id:11013 ,count: 100000 },{ id:11014 ,count: 100000 },{ id:11015 ,count: 100000 },{ id:11016 ,count: 100000 },{ id:11017 ,count: 100000 },
{ id:17001 ,count: 100000 },{ id:17002 ,count: 100000 },{ id:17003 ,count: 100000 },{ id:17004 ,count: 100000 },{ id:17005 ,count: 100000 },{ id:17006 ,count: 100000 },
{ id:17007 ,count: 100000 },{ id:17008 ,count: 100000 },{ id:17009 ,count: 100000 },{ id:17010 ,count: 100000 },{ id:17011 ,count: 100000 },{ id:17012 ,count: 100000 },
{ id:17013 ,count: 100000 },{ id:17014 ,count: 100000 },{ id:17015 ,count: 100000 },{ id:17016 ,count: 100000 },{ id:17016 ,count: 100000 },{ id:17017 ,count: 100000 },
{ id:17018 ,count: 100000 },{ id:17019 ,count: 100000 },{ id:17020 ,count: 100000 },{ id:17021 ,count: 100000 },{ id:17022 ,count: 100000 },{ id:17023 ,count: 100000 },
{ id:17024 ,count: 100000 },{ id:17025 ,count: 100000 },{ id:17026 ,count: 100000 },{ id:17027 ,count: 100000 },{ id:17028 ,count: 100000 },{ id:17029 ,count: 100000 },
{ id:17030 ,count: 100000 },{ id:17031 ,count: 100000 },{ id:17032 ,count: 100000 },{ id:17033 ,count: 100000 },{ id:17034 ,count: 100000 },{ id:17035 ,count: 100000 },
{ id:17036 ,count: 100000 },{ id:17037 ,count: 100000 },{ id:17038 ,count: 100000 },{ id:17039 ,count: 100000 },{ id:17040 ,count: 100000 },{ id:17041 ,count: 100000 },
{ id:17042 ,count: 100000 },{ id:17043 ,count: 100000 },{ id:17044 ,count: 100000 },{ id:17045 ,count: 100000 },{ id:17046 ,count: 100000 },{ id:17047 ,count: 100000 },
{ id:21001 ,count: 100000 },{ id:21002 ,count: 100000 },{ id:31001 ,count: 100000 },{ id:31002 ,count: 100000 },{ id:31003 ,count: 100000 },{ id:33001 ,count: 100000 },
{ id:33002 ,count: 100000 },{ id:33003 ,count: 100000 },{ id:40001 ,count: 100000 },{ id:40002 ,count: 100000 },{ id:42001 ,count: 100000 },{ id:42002 ,count: 100000 },
{ id:50009 ,count: 100000 },{ id:50010 ,count: 100000 },{ id:60001 ,count: 100000 },{ id:60002 ,count: 100000 },{ id:4 ,count: 2 },{ id:2004 ,count: 2 },{ id:220 ,count: 2 },
{ id:2008 ,count: 2 },{ id:2012 ,count: 2 },{ id:2208 ,count: 2 },{ id:2016 ,count: 2 },{ id:2120 ,count: 2 },{ id:2220 ,count: 2 },{ id:50031, count: 1000}
]
return items;
}
// 头像/相框 获取条件
export enum FIGURE_UNLOCK_CONDITION {
GET_HERO = 1, // 获取武将
HERO_FAVOR = 2, // 武将好感度达到
GET_SKIN = 3, // 获得时装
}