道具:添加军团资金礼包
This commit is contained in:
@@ -33,6 +33,7 @@ export class ItemHandler {
|
||||
const serverId = session.get('serverId');
|
||||
const sid = session.get('sid');
|
||||
const roleName = session.get('roleName');
|
||||
const guildCode = session.get('guildCode');
|
||||
|
||||
|
||||
if (count > 0) {
|
||||
@@ -52,7 +53,7 @@ export class ItemHandler {
|
||||
if (!giftID) {
|
||||
return resResult(STATUS.NOT_GIFTPACKAGE);
|
||||
}
|
||||
let result = await useGiftPackage(roleId, roleName, sid, serverId, giftID, selected, count)
|
||||
let result = await useGiftPackage(roleId, roleName, sid, serverId, guildCode, giftID, selected, count)
|
||||
|
||||
return resResult(STATUS.SUCCESS, result);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import { DicGiftPackage } from '../../pubUtils/dictionary/DicGiftPackage';
|
||||
import { ItemInter, RewardInter } from '../../pubUtils/interface';
|
||||
import { decodeArrayListStr } from '../../pubUtils/util';
|
||||
import { createHeroes } from '../role/createHero';
|
||||
import { GuildModel } from '../../db/Guild';
|
||||
import { pushGuildInfoUpdate } from '../guildService';
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +20,7 @@ import { createHeroes } from '../role/createHero';
|
||||
* @param giftCount 一共消耗多少个礼包
|
||||
* @param sid
|
||||
*/
|
||||
export async function useGiftPackage(roleId: string, roleName: string, sid: string, serverId: number, giftID: number, selected: Array<number> = [], giftCount: number) {
|
||||
export async function useGiftPackage(roleId: string, roleName: string, sid: string, serverId: number, guildCode: string, giftID: number, selected: Array<number> = [], giftCount: number) {
|
||||
console.log("bbbbbbbb", giftID, selected)
|
||||
let result = { goods: [], addHeros: [] }
|
||||
let giftPackageData = gameData.giftPackage.get(giftID);
|
||||
@@ -73,6 +75,13 @@ export async function useGiftPackage(roleId: string, roleName: string, sid: stri
|
||||
result = await addReward(roleId, roleName, sid, serverId, allReward, ITEM_CHANGE_REASON.USE_GIFT_PACKAGE);
|
||||
break;
|
||||
}
|
||||
case GIFT_PACKAGE_TYPE.GUILD_FUND: // 军团资金
|
||||
{
|
||||
console.log('ccccc',guildCode, giftPackageData.count)
|
||||
const guild = await GuildModel.updateInfo(guildCode, {}, { fund: giftPackageData.count }, 'fund');
|
||||
await pushGuildInfoUpdate(guildCode, { fund: guild.fund });
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ export enum GIFT_PACKAGE_TYPE {
|
||||
ALL = 1, // 全部
|
||||
SELECTED_X = 2, // 多选*
|
||||
RANDOM_X = 3, // 多随*
|
||||
GUILD_FUND = 4, // 军团资金
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5327,24 +5327,6 @@
|
||||
"gift": 0,
|
||||
"info": "将魂商店兑换用货币"
|
||||
},
|
||||
{
|
||||
"good_id": 40012,
|
||||
"name": "军团资金",
|
||||
"quality": 1,
|
||||
"image_id": 40007,
|
||||
"itid": 34,
|
||||
"goodType": 8,
|
||||
"redPoint": 0,
|
||||
"decomposeItem": "&",
|
||||
"hid": 0,
|
||||
"getWays": "&",
|
||||
"useWays": "&",
|
||||
"value": 0,
|
||||
"condition": 0,
|
||||
"timelimit": 0,
|
||||
"gift": 0,
|
||||
"info": "军团公用资金,可用于军团建筑升级、军团演武台开启、军团研发等"
|
||||
},
|
||||
{
|
||||
"good_id": 41001,
|
||||
"name": "曹操-初始",
|
||||
@@ -8013,7 +7995,7 @@
|
||||
"good_id": 71008,
|
||||
"name": "一阶地玉任选礼包",
|
||||
"quality": 1,
|
||||
"image_id": "putongbaoxiang",
|
||||
"image_id": "dijibaoxiang",
|
||||
"itid": 24,
|
||||
"goodType": 1,
|
||||
"redPoint": 1,
|
||||
@@ -8031,7 +8013,7 @@
|
||||
"good_id": 71009,
|
||||
"name": "一阶地玉随机礼包",
|
||||
"quality": 1,
|
||||
"image_id": "putongbaoxiang",
|
||||
"image_id": "dijibaoxiang",
|
||||
"itid": 24,
|
||||
"goodType": 1,
|
||||
"redPoint": 1,
|
||||
@@ -8387,6 +8369,24 @@
|
||||
"gift": 28,
|
||||
"info": "自选ssr*160"
|
||||
},
|
||||
{
|
||||
"good_id": 71029,
|
||||
"name": "军团资金",
|
||||
"quality": 2,
|
||||
"image_id": "zhongjibaoxiang",
|
||||
"itid": 24,
|
||||
"goodType": 1,
|
||||
"redPoint": 0,
|
||||
"decomposeItem": "&",
|
||||
"hid": 0,
|
||||
"getWays": "&",
|
||||
"useWays": "&",
|
||||
"value": 0,
|
||||
"condition": 0,
|
||||
"timelimit": 0,
|
||||
"gift": 29,
|
||||
"info": "打开可获得军团公用资金,可用于军团建筑升级、军团演武台开启、军团研发等"
|
||||
},
|
||||
{
|
||||
"good_id": 72001,
|
||||
"name": "烧肉",
|
||||
|
||||
@@ -194,5 +194,12 @@
|
||||
"type": 2,
|
||||
"count": 1,
|
||||
"reward": "2&21001&160|2&21002&160|2&21003&160|2&21004&160|2&21005&160|2&21007&160|2&21017&160|2&21018&160|2&21019&160|2&21020&160|2&21021&160|2&21022&160|2&21024&160|2&21032&160|2&21033&160|2&21034&160|2&21035&160|2&21040&160|2&21041&160|2&21044&160|2&21045&160|2&21046&160|2&21047&160|2&21049&160|2&21056&160"
|
||||
},
|
||||
{
|
||||
"id": 29,
|
||||
"des": "军团资金",
|
||||
"type": 4,
|
||||
"count": 100,
|
||||
"reward": "&"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user