装备:全服公告
This commit is contained in:
@@ -9,6 +9,7 @@ import { resResult } from '../pubUtils/util';
|
||||
import { BossInstanceType } from '../db/BossInstance';
|
||||
import { getSimpleRoleInfo } from './roleService';
|
||||
import { GroupMessageType } from '../db/GroupMessage';
|
||||
import { gameData } from '../pubUtils/data';
|
||||
|
||||
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']);
|
||||
@@ -39,6 +40,27 @@ export async function pushHeroWakeUp(roleId: string, roleName: string, serverId:
|
||||
await pushNormalHeroInfoBySource(roleId, roleName, serverId, MSG_SOURCE.HERO_WAKE_UP, heroInfo);
|
||||
}
|
||||
|
||||
// 装备升星到12星
|
||||
export async function pushEquipStarMax(roleId: string, roleName: string, serverId: number, hid: number, equip: EPlace, isUpStar: boolean) {
|
||||
const { id, equipId, star, } = equip;
|
||||
if(!isUpStar || star != HERO_GROW_MAX.EQUIP_STAR) return;
|
||||
|
||||
const content = JSON.stringify({ roleId, roleName, hid, eplaceId: id, equipId, star });
|
||||
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, MSG_SOURCE.EQUIP_STAR_UP, content, null, null);
|
||||
await pushGroupMsgToRoom(msgData);
|
||||
return msgData;
|
||||
}
|
||||
|
||||
// 装备升品到金色
|
||||
export async function pushEquipQualityMax(roleId: string, roleName: string, serverId: number, hid: number, equip: EPlace, isUpQuality: boolean) {
|
||||
const { id, equipId, quality, } = equip;
|
||||
if(!isUpQuality || quality != HERO_GROW_MAX.EQUIP_QUALITY) return;
|
||||
|
||||
const content = JSON.stringify({ roleId, roleName, hid, eplaceId: id, equipId, 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) {
|
||||
const content = JSON.stringify({ roleId, roleName, toRoleName, id });
|
||||
@@ -88,16 +110,6 @@ export async function pushGuildBossSucMsg(roleId: string, roleName: string, guil
|
||||
return msgData;
|
||||
}
|
||||
|
||||
export async function pushEquipRefineSucMsg(roleId: string, roleName: string, serverId: number, eplace: Partial<EPlace>, quality: number) {
|
||||
// const { id, lv, refineLv, equip } = eplace;
|
||||
// const { id: equipId } = equip as EquipType;
|
||||
// const data = { id, lv, refineLv, equipId, quality };
|
||||
// const content = JSON.stringify({ roleId, roleName, eplace: data, equip: pick(equip, ['id', 'name', 'eplaceId', 'quality', 'holes', 'randMain', 'randSe', 'grade', 'hid']) });
|
||||
// const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, MSG_SOURCE.EQUIP_REFINE_SUC, content, null, null);
|
||||
// await pushGroupMsgToRoom(msgData);
|
||||
// return msgData;
|
||||
}
|
||||
|
||||
export async function pushNormalEquipMsg(roleId: string, roleName: string, serverId: number, source: number, id: number, name: string, quality: number) {
|
||||
const content = JSON.stringify({ roleId, roleName, equip: { id, name, quality } });
|
||||
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, source, content, null, null);
|
||||
|
||||
Reference in New Issue
Block a user