战力
This commit is contained in:
@@ -9,6 +9,7 @@ import { RoleModel } from '../../../db/Role';
|
||||
import { ItemModel } from '../../../db/Item';
|
||||
import { gameData, getHeroExpByLv, getHeroStarByQuality, getHeroWakeByQuality, getHeroLvByExp, getMaxGradeByjobClass, getJobByGradeAndClass, getFriendShipById } from '../../../pubUtils/data';
|
||||
import { RewardInter } from '../../../pubUtils/interface';
|
||||
import { getDropItems } from '../../../consts/constModules/itemConst'
|
||||
|
||||
export default function(app: Application) {
|
||||
return new HeroHandler(app);
|
||||
@@ -44,7 +45,14 @@ export class HeroHandler {
|
||||
let {id, count} = msg;
|
||||
|
||||
//let result = await handleCost(roleId, sid, [{id, count}] );
|
||||
let result = await addItems(roleId, roleName, sid, [{id, count}] );
|
||||
let items = [{id, count}];
|
||||
if (id == 999999) {
|
||||
items = getDropItems();
|
||||
let role = await RoleModel.findByRoleId(roleId);
|
||||
role.lv = 60;
|
||||
await RoleModel.updateRoleInfo(roleId, role);
|
||||
}
|
||||
let result = await addItems(roleId, roleName, sid, items );
|
||||
if(!result) {
|
||||
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
|
||||
}
|
||||
|
||||
@@ -92,6 +92,7 @@ export class RoleHandler {
|
||||
if (!result)
|
||||
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
|
||||
await RoleModel.updateRoleInfo(roleId, { title });
|
||||
await calAllHeroCe( sid, roleId, 2, [title]);
|
||||
return resResult(STATUS.SUCCESS, { roleId, title });
|
||||
}
|
||||
|
||||
@@ -284,7 +285,6 @@ export class RoleHandler {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 激活/升级名将谱
|
||||
async activeHeroScroll(msg: { hid: number }, session: BackendSession) {
|
||||
let roleId = session.get('roleId');
|
||||
|
||||
Reference in New Issue
Block a user