Beispiel #1
0
        /*
         *  Player data that needs to be called by an external function and doesn't need to keep track of this data
         *  every second.
         */
        public GameStructs.Gear GetPlayerGear()
        {
            Int64 PlayerGearBase = Scanner.READ_MULTILEVEL_PTR(Address.BASE + Address.EQUIPMENT_OFFSET, Address.Offsets.PlayerGearOffsets);

            // Helm
            GameStructs.Armor Helm = new GameStructs.Armor()
            {
                ID          = Scanner.READ_INT(PlayerGearBase),
                Decorations = GetDecorationsFromGear(PlayerGearBase, 0)
            };

            // Chest
            GameStructs.Armor Chest = new GameStructs.Armor()
            {
                ID          = Scanner.READ_INT(PlayerGearBase + 0x4),
                Decorations = GetDecorationsFromGear(PlayerGearBase + 0x4, 1)
            };

            // Arms
            GameStructs.Armor Arms = new GameStructs.Armor()
            {
                ID          = Scanner.READ_INT(PlayerGearBase + 0x8),
                Decorations = GetDecorationsFromGear(PlayerGearBase + 0x8, 2)
            };

            // Waist
            GameStructs.Armor Waist = new GameStructs.Armor()
            {
                ID          = Scanner.READ_INT(PlayerGearBase + 0xC),
                Decorations = GetDecorationsFromGear(PlayerGearBase + 0xC, 3)
            };

            // Waist
            GameStructs.Armor Legs = new GameStructs.Armor()
            {
                ID          = Scanner.READ_INT(PlayerGearBase + 0x10),
                Decorations = GetDecorationsFromGear(PlayerGearBase + 0x10, 4)
            };

            // Gets player weapon info
            GameStructs.Weapon WeaponInfo = new GameStructs.Weapon()
            {
                ID = Scanner.READ_INT(PlayerGearBase)
            };

            GameStructs.Gear PlayerGear = new GameStructs.Gear();
            return(PlayerGear);
        }
Beispiel #2
0
        /*
         *  Player data that needs to be called by an external function and doesn't need to keep track of this data
         *  every second.
         */
        public GameStructs.Gear GetPlayerGear()
        {
            Int64 PlayerGearBase = Scanner.READ_MULTILEVEL_PTR(Address.BASE + Address.EQUIPMENT_OFFSET, Address.Offsets.PlayerGearOffsets);

            // Helm
            GameStructs.Armor Helm = new GameStructs.Armor()
            {
                ID          = Scanner.READ_INT(PlayerGearBase),
                Decorations = GetDecorationsFromGear(PlayerGearBase, 0)
            };

            // Chest
            GameStructs.Armor Chest = new GameStructs.Armor()
            {
                ID          = Scanner.READ_INT(PlayerGearBase + 0x4),
                Decorations = GetDecorationsFromGear(PlayerGearBase, 1)
            };

            // Arms
            GameStructs.Armor Arms = new GameStructs.Armor()
            {
                ID          = Scanner.READ_INT(PlayerGearBase + 0x8),
                Decorations = GetDecorationsFromGear(PlayerGearBase, 2)
            };

            // Waist
            GameStructs.Armor Waist = new GameStructs.Armor()
            {
                ID          = Scanner.READ_INT(PlayerGearBase + 0xC),
                Decorations = GetDecorationsFromGear(PlayerGearBase, 3)
            };

            // Waist
            GameStructs.Armor Legs = new GameStructs.Armor()
            {
                ID          = Scanner.READ_INT(PlayerGearBase + 0x10),
                Decorations = GetDecorationsFromGear(PlayerGearBase, 4)
            };

            // Charm
            GameStructs.Charm Charm = new GameStructs.Charm()
            {
                ID = Scanner.READ_INT(PlayerGearBase + 0x14)
            };

            // Weapon
            GameStructs.Weapon Weapon = new GameStructs.Weapon()
            {
                Type           = Scanner.READ_INT(PlayerGearBase + 0x124),
                ID             = Scanner.READ_INT(PlayerGearBase + 0x128),
                Decorations    = GetWeaponDecorations(PlayerGearBase + 0x128),
                NewAugments    = GetWeaponNewAugments(PlayerGearBase + 0x128),
                Awakenings     = GetWeaponAwakenedSkills(PlayerGearBase + 0x128),
                CustomAugments = GetCustomAugments(PlayerGearBase + 0x128),
                BowgunMods     = GetBowgunMods(PlayerGearBase + 0x128)
            };

            // Primary Tool
            GameStructs.SpecializedTool PrimaryTool = new GameStructs.SpecializedTool()
            {
                ID          = Scanner.READ_INT(PlayerGearBase + 0x158),
                Decorations = GetMantleDecorations(PlayerGearBase + 0x164)
            };

            // Secondary Tool
            GameStructs.SpecializedTool SecondaryTool = new GameStructs.SpecializedTool()
            {
                ID          = Scanner.READ_INT(PlayerGearBase + 0x15C),
                Decorations = GetMantleDecorations(PlayerGearBase + 0x170)
            };
            // Now we put all the data in the player gear struct
            GameStructs.Gear PlayerGear = new GameStructs.Gear()
            {
                Helmet           = Helm,
                Chest            = Chest,
                Hands            = Arms,
                Waist            = Waist,
                Legs             = Legs,
                Charm            = Charm,
                Weapon           = Weapon,
                SpecializedTools = new GameStructs.SpecializedTool[2] {
                    PrimaryTool, SecondaryTool
                }
            };
            return(PlayerGear);
        }
Beispiel #3
0
        /// <summary>
        /// Function to create player build link based on the in-game gear
        /// </summary>
        /// <param name="Build">Player build structure</param>
        /// <param name="ShowErrors">If the function should print errors when they happen (optional)</param>
        /// <returns>Link to the build in Honey Hunters World</returns>
        public static string LinkStructureBuilder(GameStructs.Gear Build, bool ShowErrors = false)
        {
            if (HoneyGearData == null)
            {
                LoadHoneyGearData();
            }

            StringBuilder LinkBuilder = new StringBuilder();

            LinkBuilder.Append(HoneyLink);

            // Basic data
            LinkBuilder.Append(GetWeaponHoneyID(Build.Weapon.Type, Build.Weapon.ID, ShowErrors) + ",");
            LinkBuilder.Append(GetGearHoneyID("Helms", "Helm", Build.Helmet.ID) + ",");
            LinkBuilder.Append(GetGearHoneyID("Armors", "Armor", Build.Chest.ID) + ",");
            LinkBuilder.Append(GetGearHoneyID("Arms", "Arm", Build.Hands.ID) + ",");
            LinkBuilder.Append(GetGearHoneyID("Waists", "Waist", Build.Waist.ID) + ",");
            LinkBuilder.Append(GetGearHoneyID("Legs", "Leg", Build.Legs.ID) + ",");
            LinkBuilder.Append(GetGearHoneyID("Charms", "Charm", Build.Charm.ID) + ",");

            // Augments
            int AugmentsTotal = 0;

            for (int AugmentIndex = 0; AugmentIndex < Build.Weapon.NewAugments.Length; AugmentIndex++)
            {
                string AugId = GetNewAugment(Build.Weapon.NewAugments[AugmentIndex].ID);

                if (Build.Weapon.NewAugments[AugmentIndex].Level == 0)
                {
                    continue;
                }
                else
                {
                    AugmentsTotal++;
                }

                if (AugmentsTotal > 1)
                {
                    LinkBuilder.Append($";{AugId}:{Build.Weapon.NewAugments[AugmentIndex].Level}");
                }
                else
                {
                    LinkBuilder.Append($"{AugId}:{Build.Weapon.NewAugments[AugmentIndex].Level}");
                }
            }

            // Custom Augments
            LinkBuilder.Append("-");
            LinkBuilder.Append(BuildCustomPartsStructure(Build.Weapon.Type, Build.Weapon.CustomAugments, ShowErrors));

            // Awakening Skills
            LinkBuilder.Append("-");
            LinkBuilder.Append(BuildAwakeningSkillsStructure(Build.Weapon.Awakenings));

            LinkBuilder.Append(",0,0");

            // Decorations
            int[] ExtraSlotAwakening = new int[3] {
                38, 39, 40
            };
            bool HasExtraSlot = Build.Weapon.Awakenings.Where(deco => ExtraSlotAwakening.Contains(deco.ID)).ToArray().Length > 0;

            LinkBuilder.Append(BuildDecorationStringStructure(Build.Weapon.Decorations, isWeapon: true, HasDecorationExtraSlot: HasExtraSlot));
            LinkBuilder.Append(BuildDecorationStringStructure(Build.Helmet.Decorations));
            LinkBuilder.Append(BuildDecorationStringStructure(Build.Chest.Decorations));
            LinkBuilder.Append(BuildDecorationStringStructure(Build.Hands.Decorations));
            LinkBuilder.Append(BuildDecorationStringStructure(Build.Waist.Decorations));
            LinkBuilder.Append(BuildDecorationStringStructure(Build.Legs.Decorations));

            // The rest
            LinkBuilder.Append("," + GetCharmLevel(Build.Charm.ID));
            LinkBuilder.Append(":" + GetMantleHoneyID(Build.SpecializedTools[0].ID));
            LinkBuilder.Append(":" + GetMantleHoneyID(Build.SpecializedTools[1].ID));
            LinkBuilder.Append(BuildDecorationStringStructure(Build.SpecializedTools[0].Decorations, 2).Replace(',', ':'));
            LinkBuilder.Append(BuildDecorationStringStructure(Build.SpecializedTools[1].Decorations, 2).Replace(',', ':'));

            // Bowgun mods
            if (Build.Weapon.Type == 12 || Build.Weapon.Type == 13)
            {
                foreach (GameStructs.BowgunMod bowgunMod in Build.Weapon.BowgunMods)
                {
                    LinkBuilder.Append("," + (HoneyGearData.SelectSingleNode($"//Honey/Weapons/BowgunMods/Mod[@ID='{bowgunMod.ID}']/@HoneyID")?.Value ?? "none"));
                }
            }

            if (ShowErrors)
            {
                Debugger.Debug(LinkBuilder);
            }

            UnloadHoneyGearData();

            return(LinkBuilder.ToString());
        }