Beispiel #1
0
        public void LoadSpellDifficulty()
        {
            // Create Spelldifficulty searcher
            foreach (var spellDiff in DBCStorage.SpellDifficultyStorage.Values)
            {
                SpellDifficultyEntry newEntry = new SpellDifficultyEntry();
                newEntry.SpellID = new int[SharedConst.MaxDifficulty];
                for (int x = 0; x < SharedConst.MaxDifficulty; ++x)
                {
                    if (spellDiff.SpellID[x] <= 0 || DBCStorage.SpellStorage.LookupByKey((uint)spellDiff.SpellID[x]) == null)
                    {
                        if (spellDiff.SpellID[x] > 0)//don't show error if spell is <= 0, not all modes have spells and there are unknown negative values
                        {
                            Log.outError("spelldifficulty_dbc: spell {0} at field id:{1} at spellid{2} does not exist in SpellStorage (spell.dbc), loaded as 0", spellDiff.SpellID[x], spellDiff.ID, x);
                        }
                        newEntry.SpellID[x] = 0;//spell was <= 0 or invalid, set to 0
                    }
                    else
                    {
                        newEntry.SpellID[x] = spellDiff.SpellID[x];
                    }
                }
                if (newEntry.SpellID[0] <= 0 || newEntry.SpellID[1] <= 0)//id0-1 must be always set!
                {
                    continue;
                }

                for (int x = 0; x < SharedConst.MaxDifficulty; ++x)
                {
                    if (newEntry.SpellID[x] == 0)
                    {
                        continue;
                    }
                    SpellDifficultyDic.Add((uint)newEntry.SpellID[x], spellDiff.ID);
                }
            }
        }
Beispiel #2
0
 uint GetSpellDifficultyId(uint spellId)
 {
     return(SpellDifficultyDic.LookupByKey(spellId));
 }