0
0
0

根据任务杀敌获取白鸡

Admin VIP
4小时前 3

傻瓜版:

1、statsService.ts文件替换掉服务端\src\services文件夹下的同名文件。

2、statTypes.ts文件替换掉服务端\src\types文件夹下的同名文件。

3、updateInventory.pluto文件放在客户端OpenWF\Scripts\samples文件夹下,并在http://localhost:6155/网站启用插件(启用插件需要再游戏开启后才可以进行)。

4、开游戏肝白鸡

进阶版:

1、在statsService.ts文件的末尾添加代码:

const applyPlatinumReward = async (payload: IStatsUpdate, accountOwnerId: string): Promise<void> =>
{
    const add = payload.add ?? {};
    
    const kills = Object.values(add.KILL_ENEMY || {}).reduce((a, b) => Number(a) + Number(b), 0);
    const eximusKills = Object.values(add.KILL_EXIMUS || {}).reduce((a, b) => Number(a) + Number(b), 0);
    const executions = Object.values(add.EXECUTE_ENEMY || {}).reduce((a, b) => Number(a) + Number(b), 0);
    const headshots = Object.values(add.HEADSHOT || {}).reduce((a, b) => Number(a) + Number(b), 0);
    const damageReceived = Object.values(add.TAKE_DAMAGE || {}).reduce((a, b) => Number(a) + Number(b), 0);
    const gsSuccess = (add.MISSION_COMPLETE?.GS_SUCCESS ?? 0);

    if(gsSuccess !== 1){logger.warn(`MISSION FAILED`); return;}
    
    const killValue = 0.10;
    const eximusKillBase = 0.40;
    const eximusKillBonus = 0.05;
    const executeValue = 0.2;
    const headshotValue = 0.30;
    const damagePenalty = 0.054;
    const maxDamagePenalty = 10;
    const scalingFactor = 1.1;
    
    const killScore = kills * killValue;
    const eximusKillScore = eximusKills * eximusKillBase + eximusKills * eximusKills * eximusKillBonus;
    const executeScore = executions * executeValue;
    const headshotScore = headshots * headshotValue;
    
    const rawPenalty = Math.sqrt(damageReceived) * damagePenalty;
    const nonLinearDamagePenaltyScore = rawPenalty < 1 ? 0 : Math.min(rawPenalty, maxDamagePenalty);
    
    const totalScore = ( killScore + eximusKillScore + executeScore + headshotScore - nonLinearDamagePenaltyScore ) * scalingFactor;
    
    const platinumReward = Math.max(0, Math.round(totalScore));
    
    const inventory = await getInventory(accountOwnerId);
    inventory.PremiumCredits += platinumReward;
    await inventory.save();
    logger.warn(`You earned ${platinumReward} platinums`);
};

2、同名文件

const playerStats = await getStats(accountOwnerId);

的下一行中添加代码:

await applyPlatinumReward(payload, accountOwnerId); 

3、statTypes.ts文件中,在114行KILL_ENEMY?: IUploadEntry;的下一行中添加代码:

KILL_EXIMUS?: IUploadEntry;

4、updateInventory.pluto文件放在客户端OpenWF\Scripts\samples文件夹下,并在http://localhost:6155/网站启用插件(启用插件需要再游戏开启后才可以进行)。

5、开游戏肝白鸡

最后于 4小时前 被Admin编辑 ,原因: 添加缺少的附件
客户端
上传的附件:
本站所有内容资源均来源于网络,仅供用户交流学习与研究使用,版权归属原版权方所有,版权争议与本站无关,用户本人下载后不能用作商业或非法用途,需在24个小时之内从您的电脑中彻底删除上述内容,否则后果均由用户承担责任;如果您访问和下载此文件,表示您同意只将此文件用于参考、学习而非其他用途,否则一切后果请您自行承担,如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。
最新回复 (0)

    暂无评论

请先登录后发表评论!

返回