RandomProperty, RandomSuffix and Stats menu

User Tag List

Results 1 to 2 of 2
  1. #1
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    RandomProperty, RandomSuffix and Stats

    So, I recently went from looking up items from their CGItem pointer to using the WoW cache to get ItemRec and ItemRecSparse. This lead me to a bit of a trouble when reading stats from items (such as itemlinks) with RandomProperty or RandomSuffix set. I don't fully understand how this works as I haven't found a function that reads random stats from the WoWDB2. I have been using https://github.com/mangos/mangos/blo.../game/Item.cpp as a reference. What I've made so far is this:
    Code:
    public Dictionary<ItemStatType, int> RandomStats
    {
        get
        {
            if (RandomProperty == 0 && RandomSuffix == 0)
                return null;
    
            var sieEntries = new List<SpellItemEnchantmentRec>();
            var sieStorage = WoWDB.GetTable(ClientDB.SpellItemEnchantment);
            if (RandomProperty > 0)
            { // ItemRandomProperty
                var irp = WoWDB.GetTable(ClientDB.ItemRandomProperties).GetRow(RandomProperty);
                for (uint i = 2; i < 6; i++)
                {
                    var sieRef = irp.GetField<int>(i);
                    if (sieRef == 0) continue;
                    sieEntries.Add(sieStorage.GetRow(sieRef).GetStruct<SpellItemEnchantmentRec>());
                }
            }
            else
            { // ItemRandomSuffix
                var irs = WoWDB.GetTable(ClientDB.ItemRandomSuffix).GetRow(RandomSuffix);
                for (uint i = 3; i < 7; i++)
                {
                    var sieRef = irs.GetField<int>(i);
                    if (sieRef == 0) continue;
                    sieEntries.Add(sieStorage.GetRow(sieRef).GetStruct<SpellItemEnchantmentRec>());
                }
            }
    
            var stats = new Dictionary<ItemStatType, int>();
            foreach (var sie in sieEntries)
            {
                for (var i = 0; i < 3; i++)
                {
                    if (sie.EffectID[i] == 0
                        || (sie.EffectValueMin[i] == 0 && sie.EffectValueMax[i] == 0))
                        continue;
    
                    var stat = (ItemStatType)sie.EffectID[i];
                    var value = (sie.EffectValueMin[i] + sie.EffectValueMax[i]) / 2; // get average
                    if (stats.ContainsKey(stat))
                        stats[stat] += value;
                    else
                        stats.Add(stat, value);
                }
            }
    
            return stats;
        }
    }
    I think the problem is that the ItemRandomSuffix is a bit different than ItemRandomProperty, but I'm treating them the same. The current method goes like this:
    Get RandomProperty/Suffix -> Look up entry in DBC -> Get the 5 SpellItemEffect rows -> Look up each in the DBCs -> Find average stat value -> Sum everything up and return

    Has anyone done any research on this? Any advice?

    RandomProperty, RandomSuffix and Stats
  2. #2
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lots of views for no replies Any ideas?

Similar Threads

  1. [CheatEngine] Swords and Sandals 2 - Money and Stats Hack
    By Laykith in forum Mobile & Flash Game Hacks
    Replies: 0
    Last Post: 11-01-2013, 02:28 PM
  2. Change Item name and stats in chat links
    By Rguy in forum Diablo 3 Exploits
    Replies: 4
    Last Post: 09-12-2012, 12:04 AM
  3. Editing Item Links and Stats
    By darkwarrior in forum World of Warcraft Exploits
    Replies: 171
    Last Post: 05-21-2008, 10:26 AM
  4. Equip 4 of the same item and get stats for all
    By Stinja1 in forum WoW EMU Guides & Tutorials
    Replies: 12
    Last Post: 10-24-2007, 07:40 PM
  5. TIER 4 stats and pictures!!
    By general_salsa in forum World of Warcraft Exploits
    Replies: 9
    Last Post: 11-14-2006, 09:04 PM
All times are GMT -5. The time now is 06:54 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search