🐞 fix(广播): 装备升品广播修改

This commit is contained in:
luying
2023-07-25 16:41:51 +08:00
parent 2c61933640
commit 46dfdadea2
3 changed files with 16 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ import { pick } from 'lodash';
import { isString } from 'underscore';
import { BossInstanceType } from '../db/BossInstance';
import { GroupMessageType } from '../db/GroupMessage';
import { HERO } from '../pubUtils/dicParam';
async function pushNormalHeroInfoBySource(roleId: string, roleName: string, serverId: number | string, source: number, heroInfo: Partial<HeroType>) {
const hero = pick(heroInfo, ['hName', 'hid', 'seqId', 'quality', 'star', 'starStage', 'colorStar', 'colorStarStage']);
@@ -51,12 +52,20 @@ export async function pushEquipStarMax(roleId: string, roleName: string, serverI
// 装备升品到金色
export async function pushEquipQualityMax(roleId: string, roleName: string, serverId: number, hid: number, equip: EPlace, isUpQuality: boolean) {
const { id, equipId, star, quality, } = equip;
if(!isUpQuality || quality != HERO_GROW_MAX.EQUIP_QUALITY) return;
if(isUpQuality && quality == HERO_GROW_MAX.EQUIP_QUALITY) {
const content = JSON.stringify({ roleId, roleName, hid, eplaceId: id, equipId, star, quality });
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, MSG_SOURCE.EQUIP_QUALITY_UP, content, null, null);
await pushGroupMsgToRoom(msgData);
return msgData;
}
if(isUpQuality && quality == HERO_GROW_MAX.EQUIP_QUALITY_TO_6) {
const content = JSON.stringify({ roleId, roleName, hid, eplaceId: id, equipId, star, quality });
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, MSG_SOURCE.EQUIP_QUALITY_TO_6, content, null, null);
await pushGroupMsgToRoom(msgData);
return msgData;
}
const content = JSON.stringify({ roleId, roleName, hid, eplaceId: id, equipId, star, quality });
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, MSG_SOURCE.EQUIP_QUALITY_UP, content, null, null);
await pushGroupMsgToRoom(msgData);
return msgData;
}
export async function pushPresent(roleId: string, roleName: string, serverId: number | string, toRoleName: string, id: number) {

View File

@@ -99,6 +99,7 @@ export const MSG_SOURCE = {
GVG_TECH_UNLOCK: 33,
GVG_VESTIGE_ACCOUNT: 34,
GVG_OCCUPY_CITY: 35,
EQUIP_QUALITY_TO_6: 36,
}
export const DEFAULT_MSG_PER_PAGE = 10;

View File

@@ -51,6 +51,7 @@ export const HERO_GROW_MAX = {
QUALITY: 3,
EQUIP_STAR: 12,
EQUIP_QUALITY: 5,
EQUIP_QUALITY_TO_6: 6,
}
export const JOB_TYPE = {