Hello,
Game version : 1.0.1686 (Build.12320008)
This code :
a) The tavern now sells all eggs
b) The "Random Crafting Recipe" (sell by Workshop) option is no longer limited to 1 per day but is unlimited (99999)
c) All items from all sellers are now $1
Code: Select all
if (i._objectType._jsPropName == "shopStockJSON") {
// console.log(i._objectType._jsPropName, i._sdkInst._data);
for (let profession in i._sdkInst._data) {
if (i._sdkInst._data.hasOwnProperty(profession)) {
if (profession == "Tavern") {
let eggs = ["eggFire", "eggWater", "eggIce", "eggElectric", "eggEarth", "eggPoison", "eggPsychic", "eggDark"];
for (let egg of eggs) {
i._sdkInst._data[profession][egg] = {
Quantity: 10,
Price: 1
};
}
}
for (let key in i._sdkInst._data[profession]) {
if (key === "randomCraftingRecipe") {
if (i._sdkInst._data[profession][key].Quantity == 1) { i._sdkInst._data[profession][key].Quantity = 99999; }
}
if (typeof i._sdkInst._data[profession][key] === 'object') {
if (i._sdkInst._data[profession][key].Price !== 1) { i._sdkInst._data[profession][key].Price = 1; }
}
}
}
}
//break;
} // fin shopStockJSON
[Link]
When you don't acquire eggs in the normal way, they are "unfertilized" and you end up with an earth spirit (default).
This code allows you to detect if an egg is “unfertilized” and “fertilize” it randomly.
Code: Select all
if (i._objectType._jsPropName == "inventoryArray" && i._sdkInst._arr && i._sdkInst._arr.length > 0) {
for (let j = 0; j <= 38; j++) {
if ( i._sdkInst._arr[j][1][0].includes("egg") && !/[a-zA-Z]/.test(i._sdkInst._arr[j][2][0]) ) {
let RandomSpirits;
if (i._sdkInst._arr[j][1][0] === "eggEarth") { RandomSpirits = ["Ankylo", "Brickhouse", "Coolslime", "Dusty", "Fluffox", "Gemlin", "Hopstraw", "Longlog", "Mumbleweed", "Oaken", "Pappus", "Punchypot", "Womr"]; }
if (i._sdkInst._arr[j][1][0] === "eggPoison") { RandomSpirits = ["Baebaeu", "Claudio", "Dropple", "Fishbo", "Flote", "Octopup", "Sandcrashle", "Snorcko", "Starsee", "Torble"]; }
if (i._sdkInst._arr[j][1][0] === "eggWater") { RandomSpirits = ["Birdbrain", "Emoshroom", "Marsha", "Radlad", "Ribbite", "Snaplant", "Taddle", "Trunkle"]; }
if (i._sdkInst._arr[j][1][0] === "eggElectric") { RandomSpirits = ["Armbot", "Bulbot", "Burgloon", "Capacibee", "Cumulo", "Sparky"]; }
if (i._sdkInst._arr[j][1][0] === "eggFire") { RandomSpirits = ["Bonefire", "Carkey", "Flamane", "Flambit", "Lucerna", "Prikli", "Sheemp", "Sinjin"]; }
if (i._sdkInst._arr[j][1][0] === "eggIce") { RandomSpirits = ["Bandicle", "Bonguin", "Sorbaton"]; }
if (i._sdkInst._arr[j][1][0] === "eggPsychic") { RandomSpirits = ["Beardini", "Lookachoo", "Loonylid", "Magicat", "Minoot", "Mystislime", "Posho", "Rablit", "Taro"]; }
if (i._sdkInst._arr[j][1][0] === "eggDark") { RandomSpirits = ["Arkeya", "Catsket", "Darkoffee", "Evileye", "Karyote", "Puppox", "Wolfbane"]; }
if (RandomSpirits) {
let randomIndex = Math.floor(Math.random() * RandomSpirits.length);
let randomSpirit = RandomSpirits[randomIndex];
// console.log("inventory test", randomSpirit);
// console.log(i._objectType._jsPropName, i._sdkInst._arr);
i._sdkInst._arr[j][2][0] = randomSpirit;
}
}
}
} // fin inventoryArray
This code, If your 1st spirit is at a level lower than 54, put all your spirits at level 55 + configure their stats
Code: Select all
if (i._objectType._jsPropName == "spiritsJSON") {
// console.log(i._objectType._jsPropName, i._sdkInst._data);
if (i._sdkInst._data.spirits[0].Level < 54) {
for (let spirit of i._sdkInst._data.spirits) {
spirit.Level = 55;
spirit.Vitality = 25;
spirit.CurVitality = 25;
spirit.Power = 25;
spirit.CurPower = 25;
spirit.Speed = 25;
spirit.CurSpeed = 25;
spirit.Armor = 25;
spirit.MaxArmor = 25;
spirit.CurArmor = 25;
spirit.HP = 334;
spirit.CurHP = 334;
spirit.Vulnerabilities = "";
spirit.XP = 174999.06199998225;
spirit.CardUpgradePoints = 0;
spirit.StatUpgradePoints = 0;
}
}
// break;
} // fin spiritsJSON
[Link]