forked from OpenWF/SpaceNinjaServer
		
	add hex conquest rewards
This commit is contained in:
		
							parent
							
								
									38112dcdf4
								
							
						
					
					
						commit
						cbfbb1e903
					
				
							
								
								
									
										8
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										8
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@ -18,7 +18,7 @@
 | 
			
		||||
        "morgan": "^1.10.0",
 | 
			
		||||
        "ncp": "^2.0.0",
 | 
			
		||||
        "typescript": "^5.5",
 | 
			
		||||
        "warframe-public-export-plus": "^0.5.56",
 | 
			
		||||
        "warframe-public-export-plus": "^0.5.57",
 | 
			
		||||
        "warframe-riven-info": "^0.1.2",
 | 
			
		||||
        "winston": "^3.17.0",
 | 
			
		||||
        "winston-daily-rotate-file": "^5.0.0"
 | 
			
		||||
@ -3789,9 +3789,9 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/warframe-public-export-plus": {
 | 
			
		||||
      "version": "0.5.56",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.56.tgz",
 | 
			
		||||
      "integrity": "sha512-px+J7tUm6fkSzwKkvL73ySQReDq9oM1UrHSLM3vbYGBvELM892iBgPYG45okIhScCSdwmmXTiWZTf4x/I4qiNQ=="
 | 
			
		||||
      "version": "0.5.57",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.57.tgz",
 | 
			
		||||
      "integrity": "sha512-CKbg7/2hSDH7I7yYSWwkrP4N2rEAEK1vNEuehj+RD9vMvl1c4u6klHLMwdh+ULxXiW4djWIlNIhs5bi/fm58Mg=="
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/warframe-riven-info": {
 | 
			
		||||
      "version": "0.1.2",
 | 
			
		||||
 | 
			
		||||
@ -25,7 +25,7 @@
 | 
			
		||||
    "morgan": "^1.10.0",
 | 
			
		||||
    "ncp": "^2.0.0",
 | 
			
		||||
    "typescript": "^5.5",
 | 
			
		||||
    "warframe-public-export-plus": "^0.5.56",
 | 
			
		||||
    "warframe-public-export-plus": "^0.5.57",
 | 
			
		||||
    "warframe-riven-info": "^0.1.2",
 | 
			
		||||
    "winston": "^3.17.0",
 | 
			
		||||
    "winston-daily-rotate-file": "^5.0.0"
 | 
			
		||||
 | 
			
		||||
@ -657,6 +657,69 @@ const labConquestRewards: IConquestReward[] = [
 | 
			
		||||
    }
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
const hexConquestRewards: IConquestReward[] = [
 | 
			
		||||
    {
 | 
			
		||||
        at: 5,
 | 
			
		||||
        pool: ExportRewards[
 | 
			
		||||
            "/Lotus/Types/Game/MissionDecks/1999ConquestRewards/1999ConquestSilverRewards"
 | 
			
		||||
        ][0] as IRngResult[]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        at: 10,
 | 
			
		||||
        pool: ExportRewards[
 | 
			
		||||
            "/Lotus/Types/Game/MissionDecks/1999ConquestRewards/1999ConquestSilverRewards"
 | 
			
		||||
        ][0] as IRngResult[]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        at: 15,
 | 
			
		||||
        pool: [
 | 
			
		||||
            {
 | 
			
		||||
                type: "/Lotus/StoreItems/Types/BoosterPacks/1999StickersPackEchoesArchimedea",
 | 
			
		||||
                itemCount: 1,
 | 
			
		||||
                probability: 1
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        at: 20,
 | 
			
		||||
        pool: ExportRewards[
 | 
			
		||||
            "/Lotus/Types/Game/MissionDecks/1999ConquestRewards/1999ConquestGoldRewards"
 | 
			
		||||
        ][0] as IRngResult[]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        at: 28,
 | 
			
		||||
        pool: [
 | 
			
		||||
            {
 | 
			
		||||
                type: "/Lotus/StoreItems/Types/Items/MiscItems/1999ConquestBucks",
 | 
			
		||||
                itemCount: 6,
 | 
			
		||||
                probability: 1
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        at: 31,
 | 
			
		||||
        pool: ExportRewards[
 | 
			
		||||
            "/Lotus/Types/Game/MissionDecks/1999ConquestRewards/1999ConquestGoldRewards"
 | 
			
		||||
        ][0] as IRngResult[]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        at: 34,
 | 
			
		||||
        pool: ExportRewards[
 | 
			
		||||
            "/Lotus/Types/Game/MissionDecks/1999ConquestRewards/1999ConquestArcaneRewards"
 | 
			
		||||
        ][0] as IRngResult[]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        at: 37,
 | 
			
		||||
        pool: [
 | 
			
		||||
            {
 | 
			
		||||
                type: "/Lotus/StoreItems/Types/Items/MiscItems/1999ConquestBucks",
 | 
			
		||||
                itemCount: 9,
 | 
			
		||||
                probability: 1
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    }
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
//TODO: return type of partial missioninventoryupdate response
 | 
			
		||||
export const addMissionRewards = async (
 | 
			
		||||
    inventory: TInventoryDatabaseDocument,
 | 
			
		||||
@ -784,9 +847,19 @@ export const addMissionRewards = async (
 | 
			
		||||
 | 
			
		||||
        if (conquestType == "HexConquest") {
 | 
			
		||||
            inventory.EchoesHexConquestCacheScoreMission ??= 0;
 | 
			
		||||
 | 
			
		||||
            if (score > inventory.EchoesHexConquestCacheScoreMission)
 | 
			
		||||
            if (score > inventory.EchoesHexConquestCacheScoreMission) {
 | 
			
		||||
                for (const reward of hexConquestRewards) {
 | 
			
		||||
                    if (score >= reward.at && inventory.EchoesHexConquestCacheScoreMission < reward.at) {
 | 
			
		||||
                        const rolled = getRandomReward(reward.pool)!;
 | 
			
		||||
                        logger.debug(`rolled hex conquest reward for reaching ${reward.at} points`, rolled);
 | 
			
		||||
                        MissionRewards.push({
 | 
			
		||||
                            StoreItem: rolled.type,
 | 
			
		||||
                            ItemCount: rolled.itemCount
 | 
			
		||||
                        });
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                inventory.EchoesHexConquestCacheScoreMission = score;
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            inventory.EntratiLabConquestCacheScoreMission ??= 0;
 | 
			
		||||
            if (score > inventory.EntratiLabConquestCacheScoreMission) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user