Just did it! All working as intended, tested also in match.
File needed in
C:\Rules
Bloodweb
GetAll
CharsPrestige.txt
Create file in C:\Rules and call it CharsPrestige.txt (leave the extension) and inside of it there is this type of criteria:
{"
CharacterName":
Prestige.LegacyPrestige, ...} this is an example I generated with Python.
Code:
{"Nightmare": 49.2, "Hillbilly": 64.2, "Bear": 37.0, "Chuckles": 78.2, "Cannibal": 23.1, "Bob": 72.1, "Nurse": 69.2, "Shape": 63.2, "Witch": 26.0, "Killer07": 52.0, "Pig": 100.2, "Spirit": 35.2, "Clown": 31.1, "Legion": 10.0, "Plague": 80.0, "Ghostface": 14.1, "Demogorgon": 67.3, "Oni": 17.2, "Gunslinger": 19.2, "K20": 83.3, "Claudette": 88.1, "Bill": 25.3, "Dwight": 58.3, "Meg": 29.1, "Jake": 73.0, "Nea": 78.0, "Laurie": 57.1, "Ace": 91.0, "Feng": 17.0, "Smoke": 26.1, "Quentin": 39.3, "Eric": 38.1, "Adam": 88.2, "Kate": 9.0, "Jeff": 23.3, "Jane": 69.0, "Ash": 26.2, "Nancy": 30.0, "Steve": 40.1, "Yui": 47.3, "Zarina": 96.1, "S22": 69.2, "S23": 54.1, "S24": 64.0, "S25": 89.2, "S26": 48.2, "S27": 38.3, "S28": 55.3, "S29": 57.3, "S30": 30.3, "S31": 19.3, "S32": 100.3, "S33": 77.0, "S34": 26.3, "S35": 97.1, "S36": 45.0, "K21": 15.3, "K22": 21.1, "K23": 17.1, "K24": 78.1, "K25": 19.2, "K26": 64.2, "K27": 87.0, "K28": 74.2, "K29": 58.3, "K30": 20.1, "K31": 73.2}
This code at beginning of the FiddlerScript (after imports)
Code:
var Bloodweb = true;
var GetAll = true;
These codes
inside static function OnBeforeResponse(oSession: Session) { INSIDE BRACKETS } as we did in past methods
Code:
if (Bloodweb && oSession.uriContains("api/v1/dbd-character-data/bloodweb")) {
var filePath = "C:\\Rules\\CharsPrestige.txt";
var bloodwebPath = "C:\\Rules\\Bloodweb";
if (!System.IO.File.Exists(bloodwebPath)) return;
if (!System.IO.File.Exists(filePath)) {
oSession.LoadResponseFromFile(bloodwebPath);
return;
}
var charsPrestige = Fiddler.WebFormats.JSON.JsonDecode(System.IO.File.ReadAllText(filePath));
oSession.utilDecodeRequest();
var oJson = Fiddler.WebFormats.JSON.JsonDecode(oSession.GetRequestBodyAsString());
var characterSelected = oJson.JSONObject["characterName"];
if (!isNaN(charsPrestige.JSONObject[characterSelected.ToString()])) {
var bloodwebJson = Fiddler.WebFormats.JSON.JsonDecode(System.IO.File.ReadAllText(bloodwebPath));
bloodwebJson.JSONObject["bloodWebLevel"] = 50;
bloodwebJson.JSONObject["prestigeLevel"] = parseInt(charsPrestige.JSONObject[characterSelected.ToString()]);
bloodwebJson.JSONObject["legacyPrestigeLevel"] = Math.round((charsPrestige.JSONObject[characterSelected.ToString()] % 1) * 10);
oSession.utilSetResponseBody(Fiddler.WebFormats.JSON.JsonEncode(bloodwebJson.JSONObject));
}
}
Code:
if (GetAll && oSession.uriContains("api/v1/dbd-character-data/get-all")){
var filePath = "C:\\Rules\\CharsPrestige.txt";
var getallPath = "C:\\Rules\\GetAll";
if (!System.IO.File.Exists(getallPath)) return;
if (!System.IO.File.Exists(filePath)) {
oSession.LoadResponseFromFile(getallPath);
return;
}
var getallJson = Fiddler.WebFormats.JSON.JsonDecode(System.IO.File.ReadAllText(getallPath));
var characters = Fiddler.WebFormats.JSON.JsonDecode(System.IO.File.ReadAllText(filePath));
FiddlerObject.log(getallJson.JSONObject["list"].Count);
FiddlerObject.log(characters.JSONObjec*****unt);
for (var i=0; i<getallJson.JSONObject["list"].Count; i++){
for (var character in characters.JSONObject) {
if(getallJson.JSONObject["list"][i]["characterName"] == character.Key){
getallJson.JSONObject["list"][i]["bloodWebLevel"] = 50
if(isNaN(character.Value)) break;
getallJson.JSONObject["list"][i]["prestigeLevel"] = parseInt(character.Value);
getallJson.JSONObject["list"][i]["legacyPrestigeLevel"] = Math.round((character.Value % 1) * 10);
break;
}
}
}
oSession.utilSetResponseBody(Fiddler.WebFormats.JSON.JsonEncode(getallJson.JSONObject));
}
- - - Updated - - -
I do appreciate everything you have done for us
Please don't mind my low ass monkey brain but I've tried to figure out where to add these codes but I'm kinda confuse.
I added the first code in the Chars file.
Also the second code over here.
I'm note sure if it's in the right place, for the other code I have no clue where should I put them.