活动:任务接口添加serverId接口
This commit is contained in:
@@ -58,7 +58,7 @@ export function checkMaterialEnough(consumes: Array<{ id: number, count: number
|
||||
* @param id 装备类型
|
||||
* @param seqId 要装上的装备的唯一id 装备B
|
||||
*/
|
||||
export async function changeEquip(roleId: string, sid: string, equipA: EquipType, hid: number, id: number, equipB: EquipType, funcs: number[]) {
|
||||
export async function changeEquip(serverId: number, roleId: string, sid: string, equipA: EquipType, hid: number, id: number, equipB: EquipType, funcs: number[]) {
|
||||
let heroB: HeroType;
|
||||
if (!!hid) //需要卸下或者替换的武将
|
||||
heroB = await HeroModel.findByHidAndRoleWithEquip(hid, roleId);//需要替换的武将
|
||||
@@ -77,7 +77,7 @@ export async function changeEquip(roleId: string, sid: string, equipA: EquipType
|
||||
let res = await takeOffEquipAndCalPlayerCe(roleId, sid, heroB, equipB, id, funcs);//卸下装备并重算战力
|
||||
return res;
|
||||
}
|
||||
let res = await dressEquip(roleId, sid, heroB, equipA, funcs);//替换给武将,并计算战力
|
||||
let res = await dressEquip(serverId, roleId, sid, heroB, equipA, funcs);//替换给武将,并计算战力
|
||||
return res;
|
||||
} else {
|
||||
let res = await takeOffEquipAndCalPlayerCe(roleId, sid, null, equipA, id, funcs);//卸下装备并重算战力
|
||||
@@ -119,7 +119,7 @@ export async function takeOffEquipAndCalPlayerCe(roleId: string, sid: string, he
|
||||
* @param hero
|
||||
* @param equip
|
||||
*/
|
||||
export async function dressEquip(roleId: string, sid: string, hero: HeroType, equip: EquipType, funcs: number[]) {
|
||||
export async function dressEquip(serverId: number, roleId: string, sid: string, hero: HeroType, equip: EquipType, funcs: number[]) {
|
||||
let args = calEquipSeids(hero);
|
||||
|
||||
hero = await HeroModel.addEquip(roleId, hero.hid, equip.ePlaceId, equip._id);
|
||||
@@ -129,7 +129,7 @@ export async function dressEquip(roleId: string, sid: string, hero: HeroType, eq
|
||||
await checkTask(roleId, sid, funcs, TASK_TYPE.EQUIP_SUM, 1, true, {});
|
||||
await checkTaskWithHero(roleId, sid, funcs, TASK_TYPE.EQUIP_BY_HERO, hero, [1]);
|
||||
await checkTaskWithEquip(roleId, sid, funcs, TASK_TYPE.EQUIP_QUALITY, equip, [1]);
|
||||
await accomplishTask(roleId, TASK_TYPE.EQUIP_QUALITY, 1, { quality: equip.quality })
|
||||
await accomplishTask(serverId, roleId, TASK_TYPE.EQUIP_QUALITY, 1, { quality: equip.quality })
|
||||
|
||||
return { seqId: equip.seqId, hid: hero.hid };
|
||||
}
|
||||
Reference in New Issue
Block a user