Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Hyrule_Warriors_Legends_Save_Editor
- {
- class Program
- {
- static string currentFolder = Directory.GetCurrentDirectory();
- static string[] characterNames = new string[24]
- {
- "Link",
- "Zelda",
- "Sheik",
- "Impa",
- "Ganon",
- "Darunia",
- "Ruto",
- "Agitha",
- "Imp Midna",
- "Fi",
- "Ghirahim",
- "Zant",
- "Lana",
- "Cia",
- "Volga",
- "Wizzro",
- "Twili Midna",
- "Young Link",
- "Tingle",
- "Linkle",
- "Skull Kid",
- "Toon Link",
- "Tetra",
- "King Daphnes"
- };
- static int[] characterOffsets = new int[24]
- {
- 0x2EC0A,
- 0x2EC3A,
- 0x2EC6A,
- 0x2EC9A,
- 0x2ECCA,
- 0x2ECFA,
- 0x2ED2A,
- 0x2ED5A,
- 0x2ED8A,
- 0x2EDBA,
- 0x2EDEA,
- 0x2EE1A,
- 0x2EE4A,
- 0x2EE7A,
- 0x2EEAA,
- 0x2EEDA,
- 0x2EF0A,
- 0x2EF3A,
- 0x2EF6A,
- 0x2EFCA,
- 0x2EFFA,
- 0x2F02A,
- 0x2F05A,
- 0x2F08A
- };
- static string[] bronzeMaterials = new string[22]
- {
- "Metal Plate",
- "Monster Tooth",
- "Old Rag",
- "Soldier's Uniform",
- "Rock",
- "Aeralfos Leather",
- "Fiery Aeralfos Leather",
- "Gibdo Bandage",
- "Redead Bandage",
- "Lizalfos Scale",
- "Dinolfos Fang",
- "Moblin Flank",
- "Sheild-Moblin Helmet",
- "Piece of Darknut Armor",
- "Stalmaster Wrist Bone",
- "Big Poe Necklace",
- "Essence of Icy Big Poe",
- "Hylian Captain Gauntlet",
- "Goron Armor Breastplate",
- "Big Blin Hide",
- "Stone Blin Buckler",
- "Monster Horn"
- };
- static int[] bronzeOffsets = new int[22]
- {
- 0x1924,
- 0x1926,
- 0x1928,
- 0x192A,
- 0x192C,
- 0x192E,
- 0x1930,
- 0x1932,
- 0x1934,
- 0x1936,
- 0x1938,
- 0x193A,
- 0x193C,
- 0x193E,
- 0x1940,
- 0x1942,
- 0x1944,
- 0x1946,
- 0x1948,
- 0x19BE,
- 0x19C0,
- 0x19C2
- };
- static string[] silverMaterials = new string[48]
- {
- "Ganon's Mane",
- "King Dodongo's Claw",
- "Gohma's Acid",
- "Manhandla's Toxic Dust",
- "Argorok's Ember",
- "Imprisoned Scale",
- "Cia's Bracelet",
- "Volga's Helmet",
- "Wizzro's Robe",
- "Link's Boots",
- "Lana's Hair Clip",
- "Zelda's Brooch",
- "Impa's Hair Band",
- "Ganondorf's Gauntlet",
- "Sheik's Kunai",
- "Darunia's Spikes",
- "Ruto's Earrings",
- "Agitha's Basket",
- "Midna's Hair",
- "Fi's Heels",
- "Ghirahim's Sash",
- "Zant's Magic Gem",
- "Round Aeralfos Shield",
- "Fiery Aeralfos Wing",
- "Heavy Gibdo Sword",
- "ReDead Knight Ashes",
- "Lizalfos Gauntlet",
- "Dinolfos Arm Guard",
- "Moblin Spear",
- "Metal Moblin Shield",
- "Large Darknut Sword",
- "Stalmaster's Skull",
- "Big Poe's Lantern",
- "Icy Big Poe's Talisman",
- "Holy Hylian Shield",
- "Thick Goron Helmet",
- "Big Blin Club",
- "Stone Blin Helmet",
- "Helmaroc Plume",
- "Phantom Ganon's Cape",
- "Twili Midna's Hairpin",
- "Young Link's Belt",
- "Tingle's Map",
- "Linkle's Boots",
- "Skull Kid's Hat",
- "Pirate's Charm",
- "Tetra's Sandals",
- "King Daphnes's Robe"
- };
- static int[] silverOffsets = new int[48]
- {
- 0x194A,
- 0x194C,
- 0x194E,
- 0x1950,
- 0x1952,
- 0x1954,
- 0x1956,
- 0x1958,
- 0x195A,
- 0x195C,
- 0x195E,
- 0x1960,
- 0x1962,
- 0x1964,
- 0x1966,
- 0x1968,
- 0x196A,
- 0x196C,
- 0x196E,
- 0x1970,
- 0x1972,
- 0x1974,
- 0x1976,
- 0x1978,
- 0x197A,
- 0x197C,
- 0x197E,
- 0x1980,
- 0x1982,
- 0x1984,
- 0x1986,
- 0x1988,
- 0x198A,
- 0x198C,
- 0x198E,
- 0x1990,
- 0x19C4,
- 0x19C6,
- 0x19C8,
- 0x19CA,
- 0x19CC,
- 0x19CE,
- 0x19D0,
- 0x19D2,
- 0x19D4,
- 0x19D6,
- 0x19D8,
- 0x19DA
- };
- static string[] goldMaterials = new string[32]
- {
- "Ganon's Fang",
- "King Dodongo's Crystal",
- "Gohma's Lens",
- "Manhandla's Sapling",
- "Argorok's Stone",
- "The Imprisoned's Pillar",
- "Cia's Staff",
- "Volga's Dragon Spear",
- "Wizzro's Ring",
- "Link's Scarf",
- "Lana's Cloak",
- "Zelda's Tiara",
- "Impa's Breastplate",
- "Ganondorf's Jewel",
- "Sheik's Turban",
- "Darunia's Bracelet",
- "Ruto's Scale",
- "Agitha's Pendant",
- "Midna's Fused Shadow",
- "Fi's Crystal",
- "Ghirahim's Cape",
- "Zant's Helmet",
- "Helmaroc King's Mask",
- "Phantom Ganon's Sword",
- "Twili Midna's Robe",
- "Keaton Mask",
- "Tingle's Watch",
- "Linkle's Compass",
- "Majora's Mask",
- "Island Outfit",
- "Tetra's Bandana",
- "King Daphnes's Crown",
- };
- static int[] goldOffsets = new int[32]
- {
- 0x1992,
- 0x1994,
- 0x1996,
- 0x1998,
- 0x199A,
- 0x199C,
- 0x199E,
- 0x19A0,
- 0x19A2,
- 0x19A4,
- 0x19A6,
- 0x19A8,
- 0x19AA,
- 0x19AC,
- 0x19AE,
- 0x19B0,
- 0x19B2,
- 0x19B4,
- 0x19B6,
- 0x19B8,
- 0x19BA,
- 0x19BC,
- 0x19DC,
- 0x19DE,
- 0x19E0,
- 0x19E2,
- 0x19E4,
- 0x19E6,
- 0x19E8,
- 0x19EA,
- 0x19EC,
- 0x19EE
- };
- static string[] itemNames = new string[]
- {
- "Weird Egg",
- "Tasty Weird Egg",
- "Delicious Weird Egg",
- "Lon Lon Milk",
- "Tasty Lon Lon Milk",
- "Delicious Lon Lon Milk",
- "Odd Mushroom",
- "Tasty Odd Mushroom",
- "Delicious Odd Mushroom",
- "Deku Nut",
- "Tasty Deku Nut",
- "Delicious Deku Nut",
- "Magic Beans",
- "Tasty Magic Beans",
- "Delicious Magic Beans",
- "Pumpkin Soup",
- "Tasty Pumpkin Soup",
- "Delicious Pumpkin Soup",
- "Sacred Water",
- "Tasty Sacred Water",
- "Delicious Sacred Water",
- "Life Tree Fruit",
- "Tasty Life Tree Fruit",
- "Delicious Life Tree Fruit",
- "Light Fruit",
- "Tasty Light Fruit",
- "Delicious Light Fruit",
- "Stamina Fruit",
- "Tasty Stamina Fruit",
- "Delicious Stamina Fruit",
- "Water Fruit",
- "Tasty Water Fruit",
- "Delicious Water Fruit",
- "Mushroom Spores",
- "Tasty Mushroom Spores",
- "Delicious Mushroom Spores",
- "All-Purpose Bait",
- "Tasty All-Purpose Bait",
- "Delicious All-Purpose Bait",
- "Elixir Soup",
- "Tasty Elixir Soup",
- "Delicious Elixir Soup",
- "Hyoi Pear",
- "Tasty Hyoi Pear",
- "Delicious Hyoi Pear",
- "Ordon Goat Cheese",
- "Tasty Ordon Goat Cheese",
- "Delicious Ordon Goat Cheese",
- "Great Fairy's Tears",
- "Tasty Great Fairy's Tears",
- "Delicious Great Fairy's Tears",
- "Greengill",
- "Tasty Greengill",
- "Delicious Greengill",
- "Ordon Catfish",
- "Tasty Ordon Catfish",
- "Delicious Ordon Catfish",
- "Hyrule Bass",
- "Tasty Hyrule Bass",
- "Delicious Hyrule Bass",
- "Hylian Pike",
- "Tasty Hylian Pike",
- "Delicious Hylian Pike",
- "Reekfish",
- "Tasty Reekfish",
- "Delicious Reekfish",
- "Hylian Loach",
- "Tasty Hylian Loach",
- "Delicious Hylian Loach",
- "Skullfish",
- "Tasty Skullfish",
- "Delicious Skullfish",
- "Bombfish",
- "Tasty Bombfish",
- "Delicious Bombfish",
- "Chu Jelly",
- "Tasty Chu Jelly",
- "Delicious Chu Jelly",
- "Bee Larvae",
- "Tasty Bee Larvae",
- "Delicious Bee Larvae",
- "Chateau Romani",
- "Tasty Chateau Romani",
- "Delicious Chateau Romani",
- "Bottled Water",
- "Tasty Bottled Water",
- "Delicious Bottled Water",
- "Hot Spring Water",
- "Tasty Hot Spring Water",
- "Delicious Hot Spring Water",
- "Rock Sirloin",
- "Tasty Rock Sirloin",
- "Delicious Rock Sirloin",
- "Meat",
- "Tasty Meat",
- "Delicious Meat",
- "Carrot",
- "Tasty Carrot",
- "Delicious Carrot",
- "Ember Seeds",
- "Tasty Ember Seeds",
- "Delicious Ember Seeds",
- "Scent Seeds",
- "Tasty Scent Seeds",
- "Delicious Scent Seeds",
- "Pegasus Seeds",
- "Tasty Pegasus Seeds",
- "Delicious Pegasus Seeds",
- "Gale Seeds",
- "Tasty Gale Seeds",
- "Delicious Gale Seeds",
- "Mystery Seeds",
- "Tasty Mystery Seeds",
- "Delicious Mystery Seeds",
- "Gratitude Crystal Red S",
- "Gratitude Crystal Red M",
- "Gratitude Crystal Red L", // 0x23AE
- "Gratitude Crystal Blue S",
- "Gratitude Crystal Blue M",
- "Gratitude Crystal Blue L", // 0x23B1
- "Gratitude Crystal Orange S",
- "Gratitude Crystal Orange M",
- "Gratitude Crystal Orange L", // 0x23B4
- "Gratitude Crystal Pink S",
- "Gratitude Crystal Pink M",
- "Gratitude Crystal Pink L", // 0x23B7
- "Gratitude Crystal Purple S",
- "Gratitude Crystal Purple M",
- "Gratitude Crystal Purple L", // 0x23BA
- "Pumpkin",
- "Tasty Pumpkin",
- "Delicious Pumpkin"
- };
- static int[] itemOffsets = new int[]
- {
- 0x233A,
- 0x233B,
- 0x233C,
- 0x233D,
- 0x233E,
- 0x233F,
- 0x2340,
- 0x2341,
- 0x2342,
- 0x2343,
- 0x2344,
- 0x2345,
- 0x2346,
- 0x2347,
- 0x2348,
- 0x2349,
- 0x234A,
- 0x234B,
- 0x234C,
- 0x234D,
- 0x234E,
- 0x234F,
- 0x2350,
- 0x2351,
- 0x2352,
- 0x2353,
- 0x2354,
- 0x2355,
- 0x2356,
- 0x2357,
- 0x2358,
- 0x2359,
- 0x235A,
- 0x235B,
- 0x235C,
- 0x235D,
- 0x235E,
- 0x235F,
- 0x2360,
- 0x2361,
- 0x2362,
- 0x2363,
- 0x2364,
- 0x2365,
- 0x2366,
- 0x2367,
- 0x2368,
- 0x2369,
- 0x236A,
- 0x236B,
- 0x236C,
- 0x236D,
- 0x236E,
- 0x236F,
- 0x2370,
- 0x2371,
- 0x2372,
- 0x2373,
- 0x2374,
- 0x2375,
- 0x2376,
- 0x2377,
- 0x2378,
- 0x2379,
- 0x237A,
- 0x237B,
- 0x237C,
- 0x237D,
- 0x237E,
- 0x237F,
- 0x2380,
- 0x2381,
- 0x2382,
- 0x2383,
- 0x2384,
- 0x2385,
- 0x2386,
- 0x2387,
- 0x2388,
- 0x2389,
- 0x238A,
- 0x238B,
- 0x238C,
- 0x238D,
- 0x238E,
- 0x238F,
- 0x2390,
- 0x2391,
- 0x2392,
- 0x2393,
- 0x2394,
- 0x2395,
- 0x2396,
- 0x2397,
- 0x2398,
- 0x2399,
- 0x239A,
- 0x239B,
- 0x239C,
- 0x239D,
- 0x239E,
- 0x239F,
- 0x23A0,
- 0x23A1,
- 0x23A2,
- 0x23A3,
- 0x23A4,
- 0x23A5,
- 0x23A6,
- 0x23A7,
- 0x23A8,
- 0x23A9,
- 0x23AA,
- 0x23AB,
- 0x23AC,
- 0x23AD,
- 0x23AE,
- 0x23AF,
- 0x23B0,
- 0x23B1,
- 0x23B2,
- 0x23B3,
- 0x23B4,
- 0x23B5,
- 0x23B6,
- 0x23B7,
- 0x23B8,
- 0x23B9,
- 0x23BA,
- 0x23BB,
- 0x23BC,
- 0x23BD
- };
- static void Main(string[] args)
- {
- /*-------------------*/
- /* Start of Main */
- /*-------------------*/
- int userSelection;
- DirectoryInfo folderInfo = new DirectoryInfo(currentFolder);
- FileInfo[] fileList = folderInfo.GetFiles("zmha.bin");
- if (fileList.Length != 0)
- {
- do
- {
- Console.Clear();
- DrawMenu();
- bool isNumber = int.TryParse(Console.ReadLine(), out userSelection);
- while (!isNumber || userSelection < 1 || userSelection > 10)
- {
- DisplayTextSameLine("Please enter a valid number: ");
- isNumber = int.TryParse(Console.ReadLine(), out userSelection);
- }
- Console.Clear();
- switch (userSelection)
- {
- case 1:
- MaxExp();
- break;
- case 2:
- MaxRupees();
- break;
- case 3:
- MaterialEdit("bronze", bronzeMaterials, bronzeOffsets);
- break;
- case 4:
- MaterialEdit("silver", silverMaterials, silverOffsets);
- break;
- case 5:
- MaterialEdit("gold", goldMaterials, goldOffsets);
- break;
- case 6:
- FoodEdit();
- break;
- case 7:
- AdventureItems();
- break;
- case 8:
- GreatSeaItems();
- break;
- case 9:
- MasterItems();
- break;
- }
- } while (userSelection != 10);
- }
- else
- {
- DisplayTextNewLine("zmha.bin not found, please place it in the same folder as this application.");
- PressEnterToContinue();
- }
- /*-----------------*/
- /* End of Main */
- /*-----------------*/
- }
- static void DrawMenu()
- {
- /*-----------------------*/
- /* Start of DrawMenu */
- /*-----------------------*/
- DisplayTextNewLine("Mediocre Hyrule Warriors Save Editor.");
- DisplayTextNewLine("Choose something to edit <3");
- string[] menuOptions = new string[]
- {
- "1. Max Character Exp",
- "2. Max Your Rupees",
- "3. Bronze Materials",
- "4. Silver Materials",
- "5. Gold Materials",
- "6. Fairy Food",
- "7. Max Adventure Map Items",
- "8. Max Great Sea Map Items",
- "9. Max Master Quest Map Items",
- "10. Quit"
- };
- for (int i = 0; i < menuOptions.Length; i++)
- {
- DisplayTextNewLine(menuOptions[i]);
- }
- /*---------------------*/
- /* End of DrawMenu */
- /*---------------------*/
- }
- static void MaxExp()
- {
- /*---------------------*/
- /* Start of MaxExp */
- /*---------------------*/
- DisplayTextNewLine("Select a character with the appropriate number:");
- DisplayTextNewLine("0. Max All Character Exp");
- for (int i = 0; i < characterNames.Length; i++)
- {
- DisplayTextNewLine((i + 1) + ". " + characterNames[i]);
- }
- int userSelection;
- bool isNumber = int.TryParse(ReadTextInput(), out userSelection);
- while (!isNumber || userSelection < 0 || userSelection > characterNames.Length)
- {
- DisplayTextSameLine("Please enter a valid number: ");
- isNumber = int.TryParse(ReadTextInput(), out userSelection);
- }
- using (var fs = new FileStream(currentFolder + "\\zmha.bin", FileMode.Open, FileAccess.ReadWrite))
- {
- if (userSelection != 0)
- {
- fs.Position = characterOffsets[userSelection - 1];
- fs.WriteByte(Convert.ToByte(0x11));
- fs.Position = characterOffsets[userSelection - 1] + 1;
- fs.WriteByte(Convert.ToByte(0x7F));
- fs.Position = characterOffsets[userSelection - 1] + 2;
- fs.WriteByte(Convert.ToByte(0x30));
- fs.Position = characterOffsets[userSelection - 1] + 3;
- fs.WriteByte(Convert.ToByte(0x00));
- }
- else
- {
- for (int i = 0; i < characterOffsets.Length; i++)
- {
- fs.Position = characterOffsets[i];
- fs.WriteByte(Convert.ToByte(0x11));
- fs.Position = characterOffsets[i] + 1;
- fs.WriteByte(Convert.ToByte(0x7F));
- fs.Position = characterOffsets[i] + 2;
- fs.WriteByte(Convert.ToByte(0x30));
- fs.Position = characterOffsets[i] + 3;
- fs.WriteByte(Convert.ToByte(0x00));
- }
- }
- }
- Console.Clear();
- DisplayTextNewLine("All done!");
- DisplayTextNewLine("To apply the Exp, start a battle and KO a monster!");
- PressEnterToContinue();
- /*-------------------*/
- /* End of MaxExp */
- /*-------------------*/
- }
- static void MaxRupees()
- {
- /*------------------------*/
- /* Start of MaxRupees */
- /*------------------------*/
- using (var fs = new FileStream(currentFolder + "\\zmha.bin", FileMode.Open, FileAccess.ReadWrite))
- {
- fs.Position = 0xE0;
- fs.WriteByte(Convert.ToByte(0x98));
- fs.Position = 0xDF;
- fs.WriteByte(Convert.ToByte(0x96));
- fs.Position = 0xDE;
- fs.WriteByte(Convert.ToByte(0x7F));
- DisplayTextNewLine("You should now have 9,999,999 Rupees!");
- PressEnterToContinue();
- }
- /*----------------------*/
- /* End of MaxRupees */
- /*----------------------*/
- }
- static void MaterialEdit(string materialType, string[] materialNames, int[] materialOffsets)
- {
- /*---------------------------*/
- /* Start of MaterialEdit */
- /*---------------------------*/
- DisplayTextNewLine("Select a material with the appropriate number:");
- switch (materialType)
- {
- case "bronze":
- DisplayTextNewLine("0. Edit All Bronze Materials");
- break;
- case "silver":
- DisplayTextNewLine("0. Edit All Silver Materials");
- break;
- case "gold":
- DisplayTextNewLine("0. Edit All Gold Materials");
- break;
- }
- for (int i = 0; i < materialNames.Length; i++)
- {
- DisplayTextNewLine((i + 1) + ". " + materialNames[i]);
- }
- int userSelection;
- bool isNumber = int.TryParse(ReadTextInput(), out userSelection);
- while (!isNumber || userSelection < 0 || userSelection > materialNames.Length)
- {
- DisplayTextSameLine("Please enter a valid number: ");
- isNumber = int.TryParse(ReadTextInput(), out userSelection);
- }
- Console.Clear();
- using (var fs = new FileStream(currentFolder + "\\zmha.bin", FileMode.Open, FileAccess.ReadWrite))
- {
- if (userSelection != 0)
- {
- DisplayTextNewLine(materialNames[userSelection - 1]);
- DisplayTextSameLine("Current Amount: ");
- fs.Position = materialOffsets[userSelection - 1];
- string currentAmount2 = fs.ReadByte().ToString("X");
- fs.Position = materialOffsets[userSelection - 1] + 1;
- string currentAmount1 = fs.ReadByte().ToString("X");
- string currentAmountHex = currentAmount1 + currentAmount2;
- int currentAmountDec = int.Parse(currentAmountHex, System.Globalization.NumberStyles.HexNumber);
- DisplayTextSameLine(currentAmountDec.ToString());
- DisplayTextNewLine("");
- DisplayTextSameLine("Please enter a new value (between 0 and 999): ");
- int newValueDec;
- isNumber = int.TryParse(ReadTextInput(), out newValueDec);
- if (!isNumber || newValueDec < 0 || newValueDec > 999)
- {
- DisplayTextNewLine("Dude, if you don't want to follow the prompts, \nI don't want to help edit your save. BYE.");
- PressEnterToContinue();
- Environment.Exit(2);
- }
- string newValueHex = newValueDec.ToString("X");
- while (newValueHex.Length < 4)
- {
- newValueHex = "0" + newValueHex;
- }
- currentAmount1 = "" + newValueHex[0] + newValueHex[1];
- currentAmount2 = "" + newValueHex[2] + newValueHex[3];
- int amountInt1 = int.Parse(currentAmount1, System.Globalization.NumberStyles.HexNumber);
- int amountInt2 = int.Parse(currentAmount2, System.Globalization.NumberStyles.HexNumber);
- fs.Position = materialOffsets[userSelection - 1];
- fs.WriteByte(Convert.ToByte(amountInt2));
- fs.Position = materialOffsets[userSelection - 1] + 1;
- fs.WriteByte(Convert.ToByte(amountInt1));
- DisplayTextNewLine("Values updated! ^^");
- PressEnterToContinue();
- }
- else
- {
- string currentAmount1;
- string currentAmount2;
- DisplayTextSameLine("Please enter a new value (between 0 and 999): ");
- int newValueDec;
- isNumber = int.TryParse(ReadTextInput(), out newValueDec);
- if (!isNumber || newValueDec < 0 || newValueDec > 999)
- {
- DisplayTextNewLine("Dude, if you don't want to follow the prompts, \nI don't want to help edit your save. BYE.");
- PressEnterToContinue();
- Environment.Exit(2);
- }
- string newValueHex = newValueDec.ToString("X");
- while (newValueHex.Length < 4)
- {
- newValueHex = "0" + newValueHex;
- }
- currentAmount1 = "" + newValueHex[0] + newValueHex[1];
- currentAmount2 = "" + newValueHex[2] + newValueHex[3];
- int amountInt1 = int.Parse(currentAmount1, System.Globalization.NumberStyles.HexNumber);
- int amountInt2 = int.Parse(currentAmount2, System.Globalization.NumberStyles.HexNumber);
- for (int i = 0; i < materialOffsets.Length; i++)
- {
- fs.Position = materialOffsets[i];
- fs.WriteByte(Convert.ToByte(amountInt2));
- fs.Position = materialOffsets[i] + 1;
- fs.WriteByte(Convert.ToByte(amountInt1));
- }
- DisplayTextNewLine("Values updated! ^^");
- PressEnterToContinue();
- }
- }
- /*-------------------------*/
- /* End of MaterialEdit */
- /*-------------------------*/
- }
- static void FoodEdit()
- {
- /*-----------------------*/
- /* Start of FoodEdit */
- /*-----------------------*/
- DisplayTextNewLine("Select what you want to change with the appropriate number:");
- DisplayTextNewLine("Or if you just want Gratitude Crystals, enter \"Grat\"");
- DisplayTextNewLine("0. Max All Fairy Foods");
- for (int i = 0; i < itemNames.Length; i++)
- {
- DisplayTextNewLine((i + 1) + ". " + itemNames[i]);
- }
- string userInput = ReadTextInput();
- if (userInput == "grat")
- {
- using (var fs = new FileStream(currentFolder + "\\zmha.bin", FileMode.Open, FileAccess.ReadWrite))
- {
- for (int i = 0x23AE; i <= 0x23BA; i += 3)
- {// i starts on the offset of the first Gratitude crystal and adds 3 to get to the next
- fs.Position = i;
- fs.WriteByte(Convert.ToByte(0x63));
- }
- }
- Console.Clear();
- DisplayTextNewLine("All done! Be grateful! Geddit? :^)");
- PressEnterToContinue();
- return;
- }
- int userSelection;
- bool isNumber = int.TryParse(userInput, out userSelection);
- while (!isNumber || userSelection < 0 || userSelection > itemNames.Length)
- {
- DisplayTextSameLine("Please enter a valid number: ");
- isNumber = int.TryParse(ReadTextInput(), out userSelection);
- }
- using (var fs = new FileStream(currentFolder + "\\zmha.bin", FileMode.Open, FileAccess.ReadWrite))
- {
- if (userSelection != 0)
- {
- fs.Position = itemOffsets[userSelection - 1];
- fs.WriteByte(Convert.ToByte(0x63));
- }
- else
- {
- for (int i = 0; i < itemOffsets.Length; i++)
- {
- fs.Position = itemOffsets[i];
- fs.WriteByte(Convert.ToByte(0x63));
- }
- }
- }
- Console.Clear();
- DisplayTextNewLine("All done!");
- DisplayTextNewLine("You should now have food to feed an army!");
- PressEnterToContinue();
- /*---------------------*/
- /* End of FoodEdit */
- /*---------------------*/
- }
- static void AdventureItems()
- {
- /*-----------------------------*/
- /* Start of AdventureItems */
- /*-----------------------------*/
- using (var fs = new FileStream(currentFolder + "\\zmha.bin", FileMode.Open, FileAccess.ReadWrite))
- {
- for (int i = 0; i < 12; i++)
- {
- fs.Position = 0x2EFA + i;
- fs.WriteByte(Convert.ToByte(0x5));
- }
- }
- Console.Clear();
- DisplayTextNewLine("All done! Enjoy your items!");
- PressEnterToContinue();
- /*---------------------------*/
- /* End of AdventureItems */
- /*---------------------------*/
- }
- static void GreatSeaItems()
- {
- /*----------------------------*/
- /* Start of GreatSeaItems */
- /*----------------------------*/
- using (var fs = new FileStream(currentFolder + "\\zmha.bin", FileMode.Open, FileAccess.ReadWrite))
- {
- // Compass
- fs.Position = 0xEB56;
- fs.WriteByte(Convert.ToByte(0x5));
- // Hookshot
- fs.Position = 0xEB5F;
- fs.WriteByte(Convert.ToByte(0x5));
- for (int i = 0; i < 10; i++)
- {// Wind Waker / Cannon / Boomerang / Hero's Bow / Salvage Arm / Hyoi Pear / Deku Leaf / Sea Map / Power Bracelet / Hammer
- fs.Position = 0xEB73 + i;
- fs.WriteByte(Convert.ToByte(0x5));
- }
- }
- Console.Clear();
- DisplayTextNewLine("All done! Enjoy your items!");
- PressEnterToContinue();
- /*--------------------------*/
- /* End of GreatSeaItems */
- /*--------------------------*/
- }
- static void MasterItems()
- {
- /*--------------------------*/
- /* Start of MasterItems */
- /*--------------------------*/
- using (var fs = new FileStream(currentFolder + "\\zmha.bin", FileMode.Open, FileAccess.ReadWrite))
- {
- for (int i = 0; i < 12; i++)
- {
- fs.Position = 0x7A52 + i;
- fs.WriteByte(Convert.ToByte(0x5));
- }
- }
- Console.Clear();
- DisplayTextNewLine("All done! Enjoy your items!");
- PressEnterToContinue();
- /*------------------------*/
- /* End of MasterItems */
- /*------------------------*/
- }
- static string ReadTextInput()
- {
- string userText = Console.ReadLine().ToLower();
- return userText;
- }
- static void DisplayTextNewLine(string text)
- {
- Console.WriteLine("{0}", text);
- }
- static void DisplayTextSameLine(string text)
- {
- Console.Write("{0}", text);
- }
- static void PressEnterToContinue()
- {
- DisplayTextNewLine("\nPress Enter");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement