Core/Items: PvP item levels basic implementation

This commit is contained in:
hondacrx
2018-03-06 11:34:28 -05:00
parent a596b3f1ea
commit ba8d4661fd
16 changed files with 97 additions and 26 deletions
+4 -2
View File
@@ -181,7 +181,8 @@ namespace Game.DataStorage
PowerDisplayStorage = DBReader.Read<PowerDisplayRecord>("PowerDisplay.db2", HotfixStatements.SEL_POWER_DISPLAY);
PowerTypeStorage = DBReader.Read<PowerTypeRecord>("PowerType.db2", HotfixStatements.SEL_POWER_TYPE);
PrestigeLevelInfoStorage = DBReader.Read<PrestigeLevelInfoRecord>("PrestigeLevelInfo.db2", HotfixStatements.SEL_PRESTIGE_LEVEL_INFO, HotfixStatements.SEL_PRESTIGE_LEVEL_INFO_LOCALE);
PVPDifficultyStorage = DBReader.Read<PVPDifficultyRecord>("PVPDifficulty.db2", HotfixStatements.SEL_PVP_DIFFICULTY);
PvpDifficultyStorage = DBReader.Read<PvpDifficultyRecord>("PVPDifficulty.db2", HotfixStatements.SEL_PVP_DIFFICULTY);
PvpItemStorage = DBReader.Read<PvpItemRecord>("PVPItem.db2", HotfixStatements.SEL_PVP_ITEM);
PvpRewardStorage = DBReader.Read<PvpRewardRecord>("PvpReward.db2", HotfixStatements.SEL_PVP_REWARD);
PvpTalentStorage = DBReader.Read<PvpTalentRecord>("PvpTalent.db2", HotfixStatements.SEL_PVP_TALENT, HotfixStatements.SEL_PVP_TALENT_LOCALE);
PvpTalentUnlockStorage = DBReader.Read<PvpTalentUnlockRecord>("PvpTalentUnlock.db2", HotfixStatements.SEL_PVP_TALENT_UNLOCK);
@@ -512,7 +513,8 @@ namespace Game.DataStorage
public static DB6Storage<PowerDisplayRecord> PowerDisplayStorage;
public static DB6Storage<PowerTypeRecord> PowerTypeStorage;
public static DB6Storage<PrestigeLevelInfoRecord> PrestigeLevelInfoStorage;
public static DB6Storage<PVPDifficultyRecord> PVPDifficultyStorage;
public static DB6Storage<PvpDifficultyRecord> PvpDifficultyStorage;
public static DB6Storage<PvpItemRecord> PvpItemStorage;
public static DB6Storage<PvpRewardRecord> PvpRewardStorage;
public static DB6Storage<PvpTalentRecord> PvpTalentStorage;
public static DB6Storage<PvpTalentUnlockRecord> PvpTalentUnlockStorage;
+14 -5
View File
@@ -345,6 +345,9 @@ namespace Game.DataStorage
_powerTypes[powerType.PowerTypeEnum] = powerType;
}
foreach (PvpItemRecord pvpItem in CliDB.PvpItemStorage.Values)
_pvpItemBonus[pvpItem.ItemID] = pvpItem.ItemLevelBonus;
foreach (PvpRewardRecord pvpReward in CliDB.PvpRewardStorage.Values)
_pvpRewardPack[Tuple.Create((uint)pvpReward.Prestige, (uint)pvpReward.HonorLevel)] = pvpReward.RewardPackID;
@@ -1142,10 +1145,10 @@ namespace Game.DataStorage
return max;
}
public PVPDifficultyRecord GetBattlegroundBracketByLevel(uint mapid, uint level)
public PvpDifficultyRecord GetBattlegroundBracketByLevel(uint mapid, uint level)
{
PVPDifficultyRecord maxEntry = null; // used for level > max listed level case
foreach (var entry in CliDB.PVPDifficultyStorage.Values)
PvpDifficultyRecord maxEntry = null; // used for level > max listed level case
foreach (var entry in CliDB.PvpDifficultyStorage.Values)
{
// skip unrelated and too-high brackets
if (entry.MapID != mapid || entry.MinLevel > level)
@@ -1163,9 +1166,9 @@ namespace Game.DataStorage
return maxEntry;
}
public PVPDifficultyRecord GetBattlegroundBracketById(uint mapid, BattlegroundBracketId id)
public PvpDifficultyRecord GetBattlegroundBracketById(uint mapid, BattlegroundBracketId id)
{
foreach (var entry in CliDB.PVPDifficultyStorage.Values)
foreach (var entry in CliDB.PvpDifficultyStorage.Values)
if (entry.MapID == mapid && entry.GetBracketId() == id)
return entry;
@@ -1243,6 +1246,11 @@ namespace Game.DataStorage
return null;
}
public byte GetPvpItemLevelBonus(uint itemId)
{
return _pvpItemBonus.LookupByKey(itemId);
}
public List<RewardPackXItemRecord> GetRewardPackItemsByRewardID(uint rewardPackID)
{
return _rewardPackItems.LookupByKey(rewardPackID);
@@ -1513,6 +1521,7 @@ namespace Game.DataStorage
List<Regex>[] _nameValidators = new List<Regex>[(int)LocaleConstant.Total + 1];
MultiMap<uint, uint> _phasesByGroup = new MultiMap<uint, uint>();
Dictionary<PowerType, PowerTypeRecord> _powerTypes = new Dictionary<PowerType, PowerTypeRecord>();
Dictionary<uint, byte> _pvpItemBonus = new Dictionary<uint, byte>();
Dictionary<Tuple<uint /*prestige level*/, uint /*honor level*/>, uint> _pvpRewardPack = new Dictionary<Tuple<uint, uint>, uint>();
List<PvpTalentRecord>[][][] _pvpTalentsByPosition = new List<PvpTalentRecord>[(int)Class.Max][][];
uint[][] _pvpTalentUnlock = new uint[PlayerConst.MaxPvpTalentTiers][];
+8 -1
View File
@@ -156,7 +156,7 @@ namespace Game.DataStorage
public bool IsDisabled() { return Flags.HasAnyFlag(PrestigeLevelInfoFlags.Disabled); }
}
public sealed class PVPDifficultyRecord
public sealed class PvpDifficultyRecord
{
public uint Id;
public byte BracketID;
@@ -168,6 +168,13 @@ namespace Game.DataStorage
public BattlegroundBracketId GetBracketId() { return (BattlegroundBracketId)BracketID; }
}
public sealed class PvpItemRecord
{
public uint Id;
public uint ItemID;
public byte ItemLevelBonus;
}
public sealed class PvpRewardRecord
{
public uint Id;