private static bool LoadGtCombatRatingsDBC(out Dictionary <CombatRating, float[]> combatRatings) { combatRatings = new Dictionary <CombatRating, float[]>(); string gtDbcPath = RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_COMBATRATINGS); if (!File.Exists(gtDbcPath)) { s_log.Error(string.Format(Resources.DBCFileDoesntExist, gtDbcPath)); return(false); } var dbcRdr = new ListDBCReader <float, GameTableConverter>(gtDbcPath); for (int rating = (int)CombatRating.WeaponSkill; rating < ((int)CombatRating.Expertise + 1); rating++) { combatRatings[(CombatRating)rating] = new float[100]; for (int i = (rating - 1) * 100; i < rating * 100; i++) { combatRatings[(CombatRating)rating][i - (rating - 1) * 100] = dbcRdr.EntryList[i]; } } return(true); }
private static bool LoadGtCombatRatingsDBC(out Dictionary <CombatRating, float[]> combatRatings) { combatRatings = new Dictionary <CombatRating, float[]>(); string dbcFile = RealmServerConfiguration.GetDBCFile("gtCombatRatings.dbc"); if (!File.Exists(dbcFile)) { s_log.Error(string.Format(WCell_RealmServer.DBCFileDoesntExist, dbcFile)); return(false); } ListDBCReader <float, GameTableConverter> listDbcReader = new ListDBCReader <float, GameTableConverter>(dbcFile); for (int index1 = 1; index1 < 25; ++index1) { combatRatings[(CombatRating)index1] = new float[100]; for (int index2 = (index1 - 1) * 100; index2 < index1 * 100; ++index2) { combatRatings[(CombatRating)index1][index2 - (index1 - 1) * 100] = listDbcReader.EntryList[index2]; } } return(true); }
private static void InitMisc() { // Read in the prices for Stable Slots from the dbc var stableSlotPriceReader = new ListDBCReader<uint, DBCStableSlotPriceConverter>( RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_STABLESLOTPRICES)); StableSlotPrices = stableSlotPriceReader.EntryList.ToArray(); MaxStableSlots = StableSlotPrices.Length; }
private static void InitRaces() { //ContentHandler.Load<BaseRace>(); var reader = new ListDBCReader <BaseRace, DBCRaceConverter>(RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_CHRRACES)); foreach (var race in reader.EntryList) { race.FinalizeAfterLoad(); } }
public static void Initialize() { ListDBCReader <DurabilityCost, DBCDurabilityCostsConverter> listDbcReader1 = new ListDBCReader <DurabilityCost, DBCDurabilityCostsConverter>( RealmServerConfiguration.GetDBCFile("DurabilityCosts.dbc")); ListDBCReader <DurabilityQuality, DBCDurabilityQualityConverter> listDbcReader2 = new ListDBCReader <DurabilityQuality, DBCDurabilityQualityConverter>( RealmServerConfiguration.GetDBCFile("DurabilityQuality.dbc")); itemClassRepairModifiers = listDbcReader1.EntryList.ToArray(); itemQualityRepairModifiers = listDbcReader2.EntryList.ToArray(); }
private static bool LoadGtBarberShopCostDBC(out float[] vals) { ListDBCReader <float, GameTableConverter> listDbcReader = new ListDBCReader <float, GameTableConverter>( RealmServerConfiguration.GetDBCFile("gtBarberShopCostBase.dbc")); vals = new float[listDbcReader.EntryList.Count]; for (int index = 0; index < vals.Length; ++index) { vals[index] = listDbcReader.EntryList[index]; } return(true); }
public static void Initialize() { var durabilityCostsReader = new ListDBCReader <DurabilityCost, DBCDurabilityCostsConverter>( RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_DURABILITYCOSTS)); var durabilityQualityReader = new ListDBCReader <DurabilityQuality, DBCDurabilityQualityConverter>( RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_DURABILITYQUALITY)); itemClassRepairModifiers = durabilityCostsReader.EntryList.ToArray(); itemQualityRepairModifiers = durabilityQualityReader.EntryList.ToArray(); }
private static bool LoadGtBarberShopCostDBC(out float[] vals) { string gtDbcPath = RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_BARBERSHOPCOST); var dbcRdr = new ListDBCReader <float, GameTableConverter>(gtDbcPath); vals = new float[dbcRdr.EntryList.Count]; for (int i = 0; i < vals.Length; i++) { vals[i] = dbcRdr.EntryList[i]; } return(true); }
private static bool LoadRatingChanceDBC(string file, out float[] vals) { vals = new float[0]; string dbcFile = RealmServerConfiguration.GetDBCFile(file); if (!File.Exists(dbcFile)) { s_log.Error(string.Format(WCell_RealmServer.DBCFileDoesntExist, file)); return(false); } ListDBCReader <float, GameTableConverter> listDbcReader = new ListDBCReader <float, GameTableConverter>(dbcFile); vals = new float[listDbcReader.EntryList.Count]; for (int index = 0; index < vals.Length; ++index) { vals[index] = listDbcReader.EntryList[index]; } return(true); }
private static bool LoadRatingChanceDBC(string file, out float[] vals) { vals = new float[0]; string ccDbcPath = RealmServerConfiguration.GetDBCFile(file); if (!File.Exists(ccDbcPath)) { s_log.Error(string.Format(Resources.DBCFileDoesntExist, file)); return(false); } var dbcRdr = new ListDBCReader <float, GameTableConverter>(ccDbcPath); vals = new float[dbcRdr.EntryList.Count]; for (int i = 0; i < vals.Length; i++) { vals[i] = dbcRdr.EntryList[i]; } return(true); }
private static bool LoadGtCombatRatingsDBC(out Dictionary<CombatRating, float[]> combatRatings) { combatRatings = new Dictionary<CombatRating, float[]>(); string gtDbcPath = RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_COMBATRATINGS); if (!File.Exists(gtDbcPath)) { s_log.Error(string.Format(Resources.DBCFileDoesntExist, gtDbcPath)); return false; } var dbcRdr = new ListDBCReader<float, GameTableConverter>(gtDbcPath); for (int rating = (int) CombatRating.WeaponSkill; rating < ((int) CombatRating.Expertise + 1); rating++) { combatRatings[(CombatRating) rating] = new float[100]; for (int i = (rating - 1)*100; i < rating*100; i++) { combatRatings[(CombatRating) rating][i - (rating - 1)*100] = dbcRdr.EntryList[i]; } } return true; }
private static bool LoadGtBarberShopCostDBC(out float[] vals) { string gtDbcPath = RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_BARBERSHOPCOST); var dbcRdr = new ListDBCReader<float, GameTableConverter>(gtDbcPath); vals = new float[dbcRdr.EntryList.Count]; for (int i = 0; i < vals.Length; i++) { vals[i] = dbcRdr.EntryList[i]; } return true; }
private static bool LoadRatingChanceDBC(string file, out float[] vals) { vals = new float[0]; string ccDbcPath = RealmServerConfiguration.GetDBCFile(file); if (!File.Exists(ccDbcPath)) { s_log.Error(string.Format(Resources.DBCFileDoesntExist, file)); return false; } var dbcRdr = new ListDBCReader<float, GameTableConverter>(ccDbcPath); vals = new float[dbcRdr.EntryList.Count]; for (int i = 0; i < vals.Length; i++) { vals[i] = dbcRdr.EntryList[i]; } return true; }
private static void InitRaces() { //ContentHandler.Load<BaseRace>(); var reader = new ListDBCReader<BaseRace, DBCRaceConverter>(RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_CHRRACES)); foreach (var race in reader.EntryList) { race.FinalizeAfterLoad(); } }
public static void Initialize() { var durabilityCostsReader = new ListDBCReader<DurabilityCost, DBCDurabilityCostsConverter>( RealmServerConfiguration.GetDBCFile("DurabilityCosts.dbc")); var durabilityQualityReader = new ListDBCReader<DurabilityQuality, DBCDurabilityQualityConverter>( RealmServerConfiguration.GetDBCFile("DurabilityQuality.dbc")); itemClassRepairModifiers = durabilityCostsReader.EntryList.ToArray(); itemQualityRepairModifiers = durabilityQualityReader.EntryList.ToArray(); }
/// <summary> /// Depends on SpellHandler /// </summary> internal static void Initialize() { var treeReader = new MappedDBCReader<TalentTree, TalentTreeConverter>( RealmServerConfiguration.GetDBCFile("TalentTab.dbc")); foreach (var tree in treeReader.Entries.Values) { ArrayUtil.Set(ref TalentTrees, (uint)tree.Id, tree); var trees = TreesByClass[(uint)tree.Class]; if (trees == null) { TreesByClass[(uint)tree.Class] = trees = new TalentTree[MaxTabCount]; } trees[tree.TabIndex] = tree; } var talentReader = new ListDBCReader<TalentEntry, TalentConverter>( RealmServerConfiguration.GetDBCFile("Talent.dbc")); foreach (var talent in talentReader.EntryList) { ArrayUtil.Set(ref Entries, (uint)talent.Id, talent); talent.Tree.Talents.Add(talent); var talentRow = talent.Tree.TalentTable[talent.Row]; if (talentRow == null) { talent.Tree.TalentTable[talent.Row] = talentRow = new TalentEntry[MaxTalentColCount]; } talentRow[talent.Col] = talent; foreach (var spell in talent.Spells) { if (spell != null) { //if (spell.Talent != null) //{ // log.Warn("Spell {0} has Talents: {1} + {2}", spell, spell.Talent, talent); //} spell.Talent = talent; spell.ClassId = talent.Tree.Class; } } } // calculate total count of Ranks per Tree and the index of each Talent foreach (var tree in treeReader.Entries.Values) { var rankCount = 0; foreach (var talent in tree.Talents) { rankCount += talent.MaxRank; } tree.TotalRankCount = rankCount; ArrayUtil.Prune(ref tree.TalentTable); uint talentIndex = 0; for (var rowNum = 0; rowNum < tree.TalentTable.Length; rowNum++) { if (tree.TalentTable[rowNum] != null) { ArrayUtil.Prune(ref tree.TalentTable[rowNum]); var row = tree.TalentTable[rowNum]; for (var colNum = 0; colNum < row.Length; colNum++) { var talent = row[colNum]; if (talent != null) { talent.Index = talentIndex; talentIndex += (uint)talent.MaxRank; } } } } } } // end initialize
public static void Initialize() { var durabilityCostsReader = new ListDBCReader<DurabilityCost, DBCDurabilityCostsConverter>( RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_DURABILITYCOSTS)); var durabilityQualityReader = new ListDBCReader<DurabilityQuality, DBCDurabilityQualityConverter>( RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_DURABILITYQUALITY)); itemClassRepairModifiers = durabilityCostsReader.EntryList.ToArray(); itemQualityRepairModifiers = durabilityQualityReader.EntryList.ToArray(); }
/// <summary> /// Depends on SpellHandler /// </summary> internal static void Initialize() { var treeReader = new MappedDBCReader <TalentTree, TalentTreeConverter>( RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_TALENTTREES)); //Init our GlyphInfoHolder GlyphInfoHolder.Init(); foreach (var tree in treeReader.Entries.Values) { ArrayUtil.Set(ref TalentTrees, (uint)tree.Id, tree); var trees = TreesByClass[(uint)tree.Class]; if (trees == null) { TreesByClass[(uint)tree.Class] = trees = new TalentTree[MaxTabCount]; } trees[tree.TabIndex] = tree; } var talentReader = new ListDBCReader <TalentEntry, TalentConverter>( RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_TALENTS)); foreach (var talent in talentReader.EntryList) { if (talent == null) { continue; } ArrayUtil.Set(ref Entries, (uint)talent.Id, talent); talent.Tree.Talents.Add(talent); var talentRow = talent.Tree.TalentTable[talent.Row]; if (talentRow == null) { talent.Tree.TalentTable[talent.Row] = talentRow = new TalentEntry[MaxTalentColCount]; } talentRow[talent.Col] = talent; for (var i = 0; i < talent.Spells.Length; i++) { var spell = talent.Spells[i]; if (spell != null) { //if (spell.Talent != null) //{ // log.Warn("Spell {0} has Talents: {1} + {2}", spell, spell.Talent, talent); //} spell.Talent = talent; spell.ClassId = talent.Tree.Class; spell.Rank = i + 1; } } } // calculate total count of Ranks per Tree and the index of each Talent foreach (var tree in treeReader.Entries.Values) { var rankCount = 0; foreach (var talent in tree.Talents) { rankCount += talent.MaxRank; } tree.TotalRankCount = rankCount; ArrayUtil.Prune(ref tree.TalentTable); uint talentIndex = 0; for (var rowNum = 0; rowNum < tree.TalentTable.Length; rowNum++) { if (tree.TalentTable[rowNum] != null) { ArrayUtil.Prune(ref tree.TalentTable[rowNum]); var row = tree.TalentTable[rowNum]; for (var colNum = 0; colNum < row.Length; colNum++) { var talent = row[colNum]; if (talent != null) { talent.Index = talentIndex; talentIndex += (uint)talent.MaxRank; } } } } } } // end initialize
/// <summary> /// Depends on SpellHandler /// </summary> internal static void Initialize() { var treeReader = new MappedDBCReader<TalentTree, TalentTreeConverter>( RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_TALENTTREES)); //Init our GlyphInfoHolder GlyphInfoHolder.Init(); foreach (var tree in treeReader.Entries.Values) { ArrayUtil.Set(ref TalentTrees, (uint)tree.Id, tree); if ((uint)tree.Class >= TreesByClass.Length) { log.Error("Talent Tree out of range {1}:{0} TreeByClass.Length {2}", tree.Class, (uint) tree.Class, TreesByClass.Length); continue; } var trees = TreesByClass[(uint)tree.Class]; if (trees == null) { TreesByClass[(uint)tree.Class] = trees = new TalentTree[MaxTabCount]; } trees[tree.TabIndex] = tree; } var talentReader = new ListDBCReader<TalentEntry, TalentConverter>( RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_TALENTS)); foreach (var talent in talentReader.EntryList) { if (talent == null) continue; ArrayUtil.Set(ref Entries, (uint)talent.Id, talent); talent.Tree.Talents.Add(talent); var talentRow = talent.Tree.TalentTable[talent.Row]; if (talentRow == null) { talent.Tree.TalentTable[talent.Row] = talentRow = new TalentEntry[MaxTalentColCount]; } talentRow[talent.Col] = talent; for (var i = 0; i < talent.Spells.Length; i++) { var spell = talent.Spells[i]; if (spell != null) { //if (spell.Talent != null) //{ // log.Warn("Spell {0} has Talents: {1} + {2}", spell, spell.Talent, talent); //} spell.Talent = talent; spell.ClassId = talent.Tree.Class; spell.Rank = i + 1; } } } // calculate total count of Ranks per Tree and the index of each Talent foreach (var tree in treeReader.Entries.Values) { var rankCount = 0; foreach (var talent in tree.Talents) { rankCount += talent.MaxRank; } tree.TotalRankCount = rankCount; ArrayUtil.Prune(ref tree.TalentTable); uint talentIndex = 0; for (var rowNum = 0; rowNum < tree.TalentTable.Length; rowNum++) { if (tree.TalentTable[rowNum] != null) { ArrayUtil.Prune(ref tree.TalentTable[rowNum]); var row = tree.TalentTable[rowNum]; for (var colNum = 0; colNum < row.Length; colNum++) { var talent = row[colNum]; if (talent != null) { talent.Index = talentIndex; talentIndex += (uint)talent.MaxRank; } } } } } } // end initialize