diff --git a/bruno/neon-sprawl-server/perk-state/Post branch select deny branch already chosen.bru b/bruno/neon-sprawl-server/perk-state/Post branch select deny branch already chosen.bru index c64f45d..0503cb1 100644 --- a/bruno/neon-sprawl-server/perk-state/Post branch select deny branch already chosen.bru +++ b/bruno/neon-sprawl-server/perk-state/Post branch select deny branch already chosen.bru @@ -10,39 +10,40 @@ docs { } script:pre-request { - const baseUrl = bru.getVar("baseUrl"); - const grant = await bru.sendRequest({ - method: "POST", - url: `${baseUrl}/game/players/dev-local-1/skill-progression`, - headers: { "Content-Type": "application/json" }, - data: { + const axios = require("axios"); + const baseUrl = bru.getEnvVar("baseUrl") || bru.getVar("baseUrl"); + const playerId = bru.getEnvVar("playerId") || bru.getVar("playerId"); + const jsonHeaders = { headers: { "Content-Type": "application/json" } }; + const grant = await axios.post( + `${baseUrl}/game/players/${playerId}/skill-progression`, + { schemaVersion: 1, skillId: "salvage", amount: 100, sourceKind: "activity", }, - }); + jsonHeaders, + ); if (grant.status !== 200) { throw new Error(`salvage grant failed: ${grant.status}`); } - const firstPick = await bru.sendRequest({ - method: "POST", - url: `${baseUrl}/game/players/dev-local-1/perk-state`, - headers: { "Content-Type": "application/json" }, - data: { + const firstPick = await axios.post( + `${baseUrl}/game/players/${playerId}/perk-state`, + { schemaVersion: 1, skillId: "salvage", tierIndex: 1, branchId: "scrap_efficiency", }, - }); + jsonHeaders, + ); if (firstPick.status !== 200 || firstPick.data?.selected !== true) { throw new Error(`tier-1 pick failed: ${firstPick.status} ${JSON.stringify(firstPick.data)}`); } } post { - url: {{baseUrl}}/game/players/dev-local-1/perk-state + url: {{baseUrl}}/game/players/{{playerId}}/perk-state body: json auth: none }