Core: Updated to 10.2.5
Port From (https://github.com/TrinityCore/TrinityCore/commit/a4a4d010a0e329d4dbd82c0be5feab1fc06c8834)
This commit is contained in:
@@ -19,7 +19,10 @@ namespace Framework.Constants
|
||||
public const int MaxMasterySpells = 2;
|
||||
|
||||
public const int ReqPrimaryTreeTalents = 31;
|
||||
public const int ExploredZonesSize = 192;
|
||||
|
||||
public const int ExploredZonesSize = 240;
|
||||
public const int ExploredZonesBits = sizeof(ulong) * 8;
|
||||
|
||||
public const ulong MaxMoneyAmount = 99999999999UL;
|
||||
public const int MaxActionButtons = 180;
|
||||
public const int MaxActionButtonActionValue = 0x00FFFFFF + 1;
|
||||
@@ -900,4 +903,11 @@ namespace Framework.Constants
|
||||
Guild = 0,
|
||||
Personal = 1,
|
||||
}
|
||||
|
||||
public enum PlayerDataFlag
|
||||
{
|
||||
ExploredZonesIndex = 1,
|
||||
CharacterIndex = 2,
|
||||
AccountIndex = 3
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Framework.Constants
|
||||
IncreaseReputation = 18,// requires the player to gain X reputation with a faction
|
||||
AreaTriggerEnter = 19,
|
||||
AreaTriggerExit = 20,
|
||||
KillWithLabel = 21,
|
||||
Max
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1068,21 +1068,9 @@ namespace Game.Achievements
|
||||
break;
|
||||
|
||||
bool matchFound = false;
|
||||
for (int j = 0; j < SharedConst.MaxWorldMapOverlayArea; ++j)
|
||||
for (uint j = 0; j < SharedConst.MaxWorldMapOverlayArea; ++j)
|
||||
{
|
||||
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(worldOverlayEntry.AreaID[j]);
|
||||
if (area == null)
|
||||
break;
|
||||
|
||||
if (area.AreaBit < 0)
|
||||
continue;
|
||||
|
||||
int playerIndexOffset = (int)area.AreaBit / ActivePlayerData.ExploredZonesBits;
|
||||
if (playerIndexOffset >= PlayerConst.ExploredZonesSize)
|
||||
continue;
|
||||
|
||||
ulong mask = 1ul << (int)((uint)area.AreaBit % ActivePlayerData.ExploredZonesBits);
|
||||
if (Convert.ToBoolean(referencePlayer.m_activePlayerData.ExploredZones[playerIndexOffset] & mask))
|
||||
if (referencePlayer.HasExploredZone(j))
|
||||
{
|
||||
matchFound = true;
|
||||
break;
|
||||
@@ -1835,18 +1823,7 @@ namespace Game.Achievements
|
||||
}
|
||||
case ModifierTreeType.PlayerHasExploredArea: // 113
|
||||
{
|
||||
AreaTableRecord areaTable = CliDB.AreaTableStorage.LookupByKey(reqValue);
|
||||
if (areaTable == null)
|
||||
return false;
|
||||
|
||||
if (areaTable.AreaBit <= 0)
|
||||
break; // success
|
||||
|
||||
int playerIndexOffset = areaTable.AreaBit / ActivePlayerData.ExploredZonesBits;
|
||||
if (playerIndexOffset >= PlayerConst.ExploredZonesSize)
|
||||
break;
|
||||
|
||||
if ((referencePlayer.m_activePlayerData.ExploredZones[playerIndexOffset] & (1ul << (areaTable.AreaBit % ActivePlayerData.ExploredZonesBits))) == 0)
|
||||
if (!referencePlayer.HasExploredZone(reqValue))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -690,14 +690,9 @@ namespace Game.Chat
|
||||
return false;
|
||||
}
|
||||
|
||||
uint offset = (uint)(area.AreaBit / ActivePlayerData.ExploredZonesBits);
|
||||
if (offset >= PlayerConst.ExploredZonesSize)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.BadValue);
|
||||
return false;
|
||||
}
|
||||
int offset = (area.AreaBit / PlayerConst.ExploredZonesBits);
|
||||
|
||||
uint val = 1u << (area.AreaBit % ActivePlayerData.ExploredZonesBits);
|
||||
uint val = 1u << (area.AreaBit % PlayerConst.ExploredZonesBits);
|
||||
playerTarget.RemoveExploredZones(offset, val);
|
||||
|
||||
handler.SendSysMessage(CypherStrings.UnexploreArea);
|
||||
@@ -1670,14 +1665,9 @@ namespace Game.Chat
|
||||
return false;
|
||||
}
|
||||
|
||||
uint offset = (uint)(area.AreaBit / ActivePlayerData.ExploredZonesBits);
|
||||
if (offset >= PlayerConst.ExploredZonesSize)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.BadValue);
|
||||
return false;
|
||||
}
|
||||
int offset = (area.AreaBit / PlayerConst.ExploredZonesBits);
|
||||
|
||||
ulong val = 1ul << (area.AreaBit % ActivePlayerData.ExploredZonesBits);
|
||||
ulong val = 1ul << (area.AreaBit % PlayerConst.ExploredZonesBits);
|
||||
playerTarget.AddExploredZones(offset, val);
|
||||
|
||||
handler.SendSysMessage(CypherStrings.ExploreArea);
|
||||
|
||||
@@ -2192,9 +2192,8 @@ namespace Game
|
||||
for (var i = 0; i < condition.Explored.Length; ++i)
|
||||
{
|
||||
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(condition.Explored[i]);
|
||||
if (area != null)
|
||||
if (area.AreaBit != -1 && !Convert.ToBoolean(player.m_activePlayerData.ExploredZones[area.AreaBit / ActivePlayerData.ExploredZonesBits] & (1ul << ((int)area.AreaBit % ActivePlayerData.ExploredZonesBits))))
|
||||
return false;
|
||||
if (area != null && !player.HasExploredZone(area.Id))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -437,13 +437,13 @@ namespace Game.DataStorage
|
||||
}
|
||||
|
||||
// Check loaded DB2 files proper version
|
||||
if (!AreaTableStorage.ContainsKey(14720) || // last area added in 10.0.7 (48520)
|
||||
!CharTitlesStorage.ContainsKey(762) || // last char title added in 10.0.7 (48520)
|
||||
!GemPropertiesStorage.ContainsKey(4059) || // last gem property added in 10.0.7 (48520)
|
||||
!ItemStorage.ContainsKey(205244) || // last item added in 10.0.7 (48520)
|
||||
!ItemExtendedCostStorage.ContainsKey(8043) || // last item extended cost added in 10.0.7 (48520)
|
||||
!MapStorage.ContainsKey(2616) || // last map added in 10.0.7 (48520)
|
||||
!SpellNameStorage.ContainsKey(409033)) // last spell added in 10.0.7 (48520)
|
||||
if (!AreaTableStorage.ContainsKey(15151) || // last area added in 10.2.5 (53007)
|
||||
!CharTitlesStorage.ContainsKey(805) || // last char title added in 10.2.5 (53007)
|
||||
!GemPropertiesStorage.ContainsKey(4081) || // last gem property added in 10.2.5 (53007)
|
||||
!ItemStorage.ContainsKey(215160) || // last item added in 10.2.5 (53007)
|
||||
!ItemExtendedCostStorage.ContainsKey(8510) || // last item extended cost added in 10.2.5 (53007)
|
||||
!MapStorage.ContainsKey(2708) || // last map added in 10.2.5 (53007)
|
||||
!SpellNameStorage.ContainsKey(438878)) // last spell added in 10.2.5 (53007)
|
||||
{
|
||||
Log.outFatal(LogFilter.ServerLoading, "You have _outdated_ DB2 files. Please extract correct versions from current using client.");
|
||||
Environment.Exit(1);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Game.DataStorage
|
||||
{
|
||||
class DBReader
|
||||
{
|
||||
private const uint WDC3FmtSig = 0x34434457; // WDC3
|
||||
private const uint WDC5FmtSig = 0x35434457; // WDC5
|
||||
|
||||
public WDCHeader Header;
|
||||
public FieldMetaData[] FieldMeta;
|
||||
@@ -36,9 +36,14 @@ namespace Game.DataStorage
|
||||
{
|
||||
Header = new WDCHeader();
|
||||
Header.Signature = reader.ReadUInt32();
|
||||
if (Header.Signature != WDC3FmtSig)
|
||||
if (Header.Signature != WDC5FmtSig)
|
||||
return false;
|
||||
|
||||
Header.Version = reader.ReadUInt32();
|
||||
if (Header.Version != 5)
|
||||
return false;
|
||||
|
||||
Header.Schema = reader.ReadStringFromChars(128);
|
||||
Header.RecordCount = reader.ReadUInt32();
|
||||
Header.FieldCount = reader.ReadUInt32();
|
||||
Header.RecordSize = reader.ReadUInt32();
|
||||
@@ -583,6 +588,8 @@ namespace Game.DataStorage
|
||||
}
|
||||
|
||||
public uint Signature;
|
||||
public uint Version;
|
||||
public string Schema;
|
||||
public uint RecordCount;
|
||||
public uint FieldCount;
|
||||
public uint RecordSize;
|
||||
|
||||
@@ -42,6 +42,9 @@ namespace Game.DataStorage
|
||||
foreach (var areaGroupMember in AreaGroupMemberStorage.Values)
|
||||
_areaGroupMembers.Add(areaGroupMember.AreaGroupID, areaGroupMember.AreaID);
|
||||
|
||||
foreach (AreaTableRecord areaTable in AreaTableStorage.Values)
|
||||
Cypher.Assert(areaTable.AreaBit <= 0 || (areaTable.AreaBit / 64) < PlayerConst.ExploredZonesSize, $"PLAYER_EXPLORED_ZONES_SIZE must be at least {((areaTable.AreaBit + 63) / 64)}");
|
||||
|
||||
foreach (ArtifactPowerRecord artifactPower in ArtifactPowerStorage.Values)
|
||||
_artifactPowers.Add(artifactPower.ArtifactID, artifactPower);
|
||||
|
||||
@@ -227,6 +230,9 @@ namespace Game.DataStorage
|
||||
_chrSpecializationsByIndex[storageIndex][chrSpec.OrderIndex] = chrSpec;
|
||||
}
|
||||
|
||||
foreach (ConditionalChrModelRecord conditionalChrModel in ConditionalChrModelStorage.Values)
|
||||
_conditionalChrModelsByChrModelId[conditionalChrModel.ChrModelID] = conditionalChrModel;
|
||||
|
||||
foreach (ConditionalContentTuningRecord conditionalContentTuning in ConditionalContentTuningStorage.Values)
|
||||
_conditionalContentTuning.Add(conditionalContentTuning.ParentContentTuningID, conditionalContentTuning);
|
||||
|
||||
@@ -1024,6 +1030,11 @@ namespace Game.DataStorage
|
||||
return _chrModelsByRaceAndGender.LookupByKey(Tuple.Create((byte)race, (byte)gender));
|
||||
}
|
||||
|
||||
public ConditionalChrModelRecord GetConditionalChrModel(int chrModelId)
|
||||
{
|
||||
return _conditionalChrModelsByChrModelId.LookupByKey(chrModelId);
|
||||
}
|
||||
|
||||
public string GetChrRaceName(Race race, Locale locale = Locale.enUS)
|
||||
{
|
||||
ChrRacesRecord raceEntry = ChrRacesStorage.LookupByKey(race);
|
||||
@@ -2267,6 +2278,7 @@ namespace Game.DataStorage
|
||||
MultiMap<Tuple<byte, byte>, ChrCustomizationOptionRecord> _chrCustomizationOptionsByRaceAndGender = new();
|
||||
Dictionary<uint, MultiMap<uint, uint>> _chrCustomizationRequiredChoices = new();
|
||||
ChrSpecializationRecord[][] _chrSpecializationsByIndex = new ChrSpecializationRecord[(int)Class.Max + 1][];
|
||||
Dictionary<int, ConditionalChrModelRecord> _conditionalChrModelsByChrModelId = new();
|
||||
MultiMap<uint, ConditionalContentTuningRecord> _conditionalContentTuning = new();
|
||||
List<(uint, int)> _contentTuningLabels = new();
|
||||
MultiMap<uint, CurrencyContainerRecord> _currencyContainers = new();
|
||||
|
||||
@@ -357,7 +357,7 @@ namespace Game.DataStorage
|
||||
public sealed class ConditionalChrModelRecord
|
||||
{
|
||||
public uint Id;
|
||||
public uint ChrModelID; // This is the PK
|
||||
public int ChrModelID;
|
||||
public int ChrCustomizationReqID;
|
||||
public int PlayerConditionID;
|
||||
public int Flags;
|
||||
|
||||
@@ -196,6 +196,10 @@ namespace Game.Entities
|
||||
if (items != null)
|
||||
stats.QuestItems.AddRange(items);
|
||||
|
||||
var currencies = Global.ObjectMgr.GetCreatureQuestCurrencyList(Entry);
|
||||
if (currencies != null)
|
||||
stats.QuestCurrencies.AddRange(currencies);
|
||||
|
||||
if (locale != Locale.enUS)
|
||||
{
|
||||
CreatureLocale creatureLocale = Global.ObjectMgr.GetCreatureLocale(Entry);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -855,6 +855,12 @@ namespace Game.Entities
|
||||
SetUpdateFieldValue(updateField, (T)(updateField.GetValue() | (dynamic)flag));
|
||||
}
|
||||
|
||||
public void SetUpdateFieldFlagValue<T>(DynamicUpdateField<T> updateField, int index, T flag) where T : new()
|
||||
{
|
||||
//static_assert(std::is_integral < T >::value, "SetUpdateFieldFlagValue must be used with integral types");
|
||||
InsertDynamicUpdateFieldValue(updateField, index, (T)(updateField[index] | (dynamic)flag));
|
||||
}
|
||||
|
||||
public void SetUpdateFieldFlagValue<T>(ref T value, T flag) where T : new()
|
||||
{
|
||||
//static_assert(std::is_integral < T >::value, "SetUpdateFieldFlagValue must be used with integral types");
|
||||
@@ -867,6 +873,12 @@ namespace Game.Entities
|
||||
SetUpdateFieldValue(updateField, (T)(updateField.GetValue() & ~(dynamic)flag));
|
||||
}
|
||||
|
||||
public void RemoveUpdateFieldFlagValue<T>(DynamicUpdateField<T> updateField, int index, T flag) where T : new()
|
||||
{
|
||||
//static_assert(std::is_integral < T >::value, "SetUpdateFieldFlagValue must be used with integral types");
|
||||
InsertDynamicUpdateFieldValue(updateField, index, (T)(updateField[index] & ~(dynamic)flag));
|
||||
}
|
||||
|
||||
public void RemoveUpdateFieldFlagValue<T>(ref T value, T flag) where T : new()
|
||||
{
|
||||
//static_assert(std::is_integral < T >::value, "RemoveUpdateFieldFlagValue must be used with integral types");
|
||||
|
||||
@@ -2953,8 +2953,13 @@ namespace Game.Entities
|
||||
SetXP(xp);
|
||||
|
||||
StringArray exploredZonesStrings = new(exploredZones, ' ');
|
||||
for (int i = 0; i < exploredZonesStrings.Length && i / 2 < ActivePlayerData.ExploredZonesSize; ++i)
|
||||
SetUpdateFieldFlagValue(ref m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.ExploredZones, i / 2), (ulong)((long.Parse(exploredZonesStrings[i])) << (32 * (i % 2))));
|
||||
for (int i = 0; i < exploredZonesStrings.Length && i / 2 < PlayerConst.ExploredZonesSize; ++i)
|
||||
{
|
||||
if (!ulong.TryParse(exploredZonesStrings[i], out ulong value))
|
||||
value = 0;
|
||||
|
||||
AddExploredZones(i / 2, (value << (32 * (i % 2))));
|
||||
}
|
||||
|
||||
StringArray knownTitlesStrings = new(knownTitles, ' ');
|
||||
if ((knownTitlesStrings.Length % 2) == 0)
|
||||
@@ -3742,8 +3747,8 @@ namespace Game.Entities
|
||||
stmt.AddValue(index++, GetLootSpecId());
|
||||
|
||||
ss.Clear();
|
||||
for (int i = 0; i < PlayerConst.ExploredZonesSize; ++i)
|
||||
ss.Append($"{(uint)(m_activePlayerData.ExploredZones[i] & 0xFFFFFFFF)} {(uint)((m_activePlayerData.ExploredZones[i] >> 32) & 0xFFFFFFFF)} ");
|
||||
for (int i = 0; i < m_activePlayerData.DataFlags[(int)PlayerDataFlag.ExploredZonesIndex].Size(); ++i)
|
||||
ss.Append($"{(uint)(m_activePlayerData.DataFlags[(int)PlayerDataFlag.ExploredZonesIndex][i] & 0xFFFFFFFF)} {(uint)((m_activePlayerData.DataFlags[(int)PlayerDataFlag.ExploredZonesIndex][i] >> 32) & 0xFFFFFFFF)} ");
|
||||
|
||||
stmt.AddValue(index++, ss.ToString());
|
||||
|
||||
@@ -3877,8 +3882,8 @@ namespace Game.Entities
|
||||
stmt.AddValue(index++, GetLootSpecId());
|
||||
|
||||
ss.Clear();
|
||||
for (int i = 0; i < PlayerConst.ExploredZonesSize; ++i)
|
||||
ss.Append($"{(uint)(m_activePlayerData.ExploredZones[i] & 0xFFFFFFFF)} {(uint)((m_activePlayerData.ExploredZones[i] >> 32) & 0xFFFFFFFF)} ");
|
||||
for (int i = 0; i < m_activePlayerData.DataFlags[(int)PlayerDataFlag.ExploredZonesIndex].Size(); ++i)
|
||||
ss.Append($"{(uint)(m_activePlayerData.DataFlags[(int)PlayerDataFlag.ExploredZonesIndex][i] & 0xFFFFFFFF)} {(uint)((m_activePlayerData.DataFlags[(int)PlayerDataFlag.ExploredZonesIndex][i] >> 32) & 0xFFFFFFFF)} ");
|
||||
|
||||
stmt.AddValue(index++, ss.ToString());
|
||||
|
||||
|
||||
@@ -6301,8 +6301,6 @@ namespace Game.Entities
|
||||
SendPacket(new ResetWeeklyCurrency());
|
||||
}
|
||||
|
||||
public void AddExploredZones(uint pos, ulong mask) { SetUpdateFieldFlagValue(ref m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.ExploredZones, (int)pos), mask); }
|
||||
public void RemoveExploredZones(uint pos, ulong mask) { RemoveUpdateFieldFlagValue(ref m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.ExploredZones, (int)pos), mask); }
|
||||
void CheckAreaExploreAndOutdoor()
|
||||
{
|
||||
if (!IsAlive())
|
||||
@@ -6326,20 +6324,13 @@ namespace Game.Entities
|
||||
return;
|
||||
}
|
||||
|
||||
int offset = areaEntry.AreaBit / ActivePlayerData.ExploredZonesBits;
|
||||
if (offset >= PlayerConst.ExploredZonesSize)
|
||||
{
|
||||
Log.outError(LogFilter.Player, "Wrong area flag {0} in map data for (X: {1} Y: {2}) point to field PLAYER_EXPLORED_ZONES_1 + {3} ( {4} must be < {5} ).",
|
||||
areaId, GetPositionX(), GetPositionY(), offset, offset, PlayerConst.ExploredZonesSize);
|
||||
return;
|
||||
}
|
||||
int offset = (areaEntry.AreaBit / PlayerConst.ExploredZonesBits);
|
||||
ulong val = 1ul << (areaEntry.AreaBit % PlayerConst.ExploredZonesBits);
|
||||
|
||||
ulong val = 1ul << (areaEntry.AreaBit % ActivePlayerData.ExploredZonesBits);
|
||||
ulong currFields = m_activePlayerData.ExploredZones[offset];
|
||||
|
||||
if (!Convert.ToBoolean(currFields & val))
|
||||
if (offset >= m_activePlayerData.DataFlags[(int)PlayerDataFlag.ExploredZonesIndex].Size()
|
||||
|| (m_activePlayerData.DataFlags[(int)PlayerDataFlag.ExploredZonesIndex][offset] & val) == 0)
|
||||
{
|
||||
SetUpdateFieldFlagValue(ref m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.ExploredZones, (int)offset), val);
|
||||
AddExploredZones(offset, val);
|
||||
|
||||
UpdateCriteria(CriteriaType.RevealWorldMapOverlay, GetAreaId());
|
||||
|
||||
@@ -6385,6 +6376,38 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AddExploredZones(int pos, ulong mask)
|
||||
{
|
||||
SetUpdateFieldFlagValue(m_values
|
||||
.ModifyValue(m_activePlayerData)
|
||||
.ModifyValue(m_activePlayerData.DataFlags, (int)PlayerDataFlag.ExploredZonesIndex), pos, mask);
|
||||
}
|
||||
|
||||
public void RemoveExploredZones(int pos, ulong mask)
|
||||
{
|
||||
RemoveUpdateFieldFlagValue(m_values
|
||||
.ModifyValue(m_activePlayerData)
|
||||
.ModifyValue(m_activePlayerData.DataFlags, (int)PlayerDataFlag.ExploredZonesIndex), pos, mask);
|
||||
}
|
||||
|
||||
public bool HasExploredZone(uint areaId)
|
||||
{
|
||||
var area = CliDB.AreaTableStorage.LookupByKey(areaId);
|
||||
if (area == null)
|
||||
return false;
|
||||
|
||||
if (area.AreaBit < 0)
|
||||
return false;
|
||||
|
||||
int playerIndexOffset = area.AreaBit / PlayerConst.ExploredZonesBits;
|
||||
if (playerIndexOffset >= m_activePlayerData.DataFlags[(int)PlayerDataFlag.ExploredZonesIndex].Size())
|
||||
return false;
|
||||
|
||||
ulong mask = 1ul << (area.AreaBit % PlayerConst.ExploredZonesBits);
|
||||
return (m_activePlayerData.DataFlags[(int)PlayerDataFlag.ExploredZonesIndex][playerIndexOffset] & mask) != 0;
|
||||
}
|
||||
|
||||
void SendExplorationExperience(uint Area, uint Experience)
|
||||
{
|
||||
SendPacket(new ExplorationExperience(Experience, Area));
|
||||
|
||||
@@ -2016,7 +2016,7 @@ namespace Game
|
||||
|
||||
Log.outInfo(LogFilter.ServerLoading, $"Loaded {count} creature template models in {Time.GetMSTimeDiffToNow(oldMSTime)} ms");
|
||||
}
|
||||
|
||||
|
||||
public void LoadCreatureSummonedData()
|
||||
{
|
||||
uint oldMSTime = Time.GetMSTime();
|
||||
@@ -8226,6 +8226,11 @@ namespace Game
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<int> GetCreatureQuestCurrencyList(uint creatureId)
|
||||
{
|
||||
return creatureQuestCurrenciesStorage.LookupByKey(creatureId);
|
||||
}
|
||||
|
||||
//Spells /Skills / Phases
|
||||
public void LoadPhases()
|
||||
{
|
||||
@@ -10005,6 +10010,46 @@ namespace Game
|
||||
Log.outInfo(LogFilter.ServerLoading, $"Loaded {count} Player Choice Response locale strings in {Time.GetMSTimeDiffToNow(oldMSTime)} ms");
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadCreatureQuestCurrencies()
|
||||
{
|
||||
uint oldMSTime = Time.GetMSTime();
|
||||
|
||||
// 0 1
|
||||
SQLResult result = DB.World.Query("SELECT CreatureId, CurrencyId FROM creature_quest_currency ORDER BY CreatureId, CurrencyId ASC");
|
||||
if (result.IsEmpty())
|
||||
{
|
||||
Log.outInfo(LogFilter.ServerLoading, ">> Loaded 0 creature quest currencies. DB table `creature_quest_currency` is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
uint count = 0;
|
||||
do
|
||||
{
|
||||
uint entry = result.Read<uint>(0);
|
||||
int currency = result.Read<int>(1);
|
||||
|
||||
if (GetCreatureTemplate(entry) == null)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Table `creature_quest_currency` has data for nonexistent creature (entry: {entry}, currency: {currency}), skipped");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!CliDB.CurrencyTypesStorage.HasRecord((uint)currency))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Table `creature_quest_currency` has nonexistent currency (ID: {currency}) in creature (entry: {entry}, currency: {currency}), skipped");
|
||||
continue;
|
||||
}
|
||||
|
||||
creatureQuestCurrenciesStorage.Add(entry, currency);
|
||||
|
||||
++count;
|
||||
}
|
||||
while (result.NextRow());
|
||||
|
||||
Log.outInfo(LogFilter.ServerLoading, $"Loaded {count} creature quest currencies in {Time.GetMSTimeDiffToNow(oldMSTime)} ms");
|
||||
}
|
||||
|
||||
public void InitializeQueriesData(QueryDataGroup mask)
|
||||
{
|
||||
uint oldMSTime = Time.GetMSTime();
|
||||
@@ -10827,6 +10872,7 @@ namespace Game
|
||||
Dictionary<ulong, CreatureData> creatureDataStorage = new();
|
||||
Dictionary<ulong, CreatureAddon> creatureAddonStorage = new();
|
||||
MultiMap<(uint, Difficulty), uint> creatureQuestItemStorage = new();
|
||||
MultiMap<uint, int> creatureQuestCurrenciesStorage = new();
|
||||
Dictionary<uint, CreatureAddon> creatureTemplateAddonStorage = new();
|
||||
MultiMap<uint, float> _creatureTemplateSparringStorage = new();
|
||||
Dictionary<ulong, CreatureMovementData> creatureMovementOverrides = new();
|
||||
|
||||
@@ -993,7 +993,7 @@ namespace Game
|
||||
// start with every map explored
|
||||
if (WorldConfig.GetBoolValue(WorldCfg.StartAllExplored))
|
||||
{
|
||||
for (uint i = 0; i < PlayerConst.ExploredZonesSize; i++)
|
||||
for (int i = 0; i < PlayerConst.ExploredZonesSize; i++)
|
||||
pCurrChar.AddExploredZones(i, 0xFFFFFFFFFFFFFFFF);
|
||||
}
|
||||
|
||||
@@ -1385,7 +1385,7 @@ namespace Game
|
||||
{
|
||||
if (packet.CustomizedChrModelID != 0)
|
||||
{
|
||||
var conditionalChrModel = CliDB.ConditionalChrModelStorage.LookupByKey(packet.CustomizedChrModelID);
|
||||
var conditionalChrModel = Global.DB2Mgr.GetConditionalChrModel(packet.CustomizedChrModelID);
|
||||
if (conditionalChrModel == null)
|
||||
return;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Game.Networking.Packets
|
||||
Serial = _worldPacket.ReadUInt32();
|
||||
Latency = _worldPacket.ReadUInt32();
|
||||
}
|
||||
|
||||
|
||||
public uint Serial;
|
||||
public uint Latency;
|
||||
}
|
||||
@@ -153,7 +153,7 @@ namespace Game.Networking.Packets
|
||||
if (SuccessInfo.NumPlayersAlliance.HasValue)
|
||||
_worldPacket.WriteUInt16(SuccessInfo.NumPlayersAlliance.Value);
|
||||
|
||||
if(SuccessInfo.ExpansionTrialExpiration.HasValue)
|
||||
if (SuccessInfo.ExpansionTrialExpiration.HasValue)
|
||||
_worldPacket.WriteInt64(SuccessInfo.ExpansionTrialExpiration.Value);
|
||||
|
||||
if (SuccessInfo.NewBuildKeys != null)
|
||||
@@ -188,7 +188,7 @@ namespace Game.Networking.Packets
|
||||
}
|
||||
|
||||
if (WaitInfo.HasValue)
|
||||
WaitInfo.Value.Write(_worldPacket);
|
||||
WaitInfo.Value.Write(_worldPacket);
|
||||
}
|
||||
|
||||
public AuthSuccessInfo SuccessInfo; // contains the packet data in case that it has account information (It is never set when WaitInfo is set), otherwise its contents are undefined.
|
||||
@@ -412,13 +412,17 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
data.WriteUInt32(WaitCount);
|
||||
data.WriteUInt32(WaitTime);
|
||||
data.WriteUInt32(AllowedFactionGroupForCharacterCreate);
|
||||
data.WriteBit(HasFCM);
|
||||
data.WriteBit(CanCreateOnlyIfExisting);
|
||||
data.FlushBits();
|
||||
}
|
||||
|
||||
public uint WaitCount; // position of the account in the login queue
|
||||
public uint WaitTime; // Wait time in login queue in minutes, if sent queued and this value is 0 client displays "unknown time"
|
||||
public uint AllowedFactionGroupForCharacterCreate;
|
||||
public bool HasFCM; // true if the account has a forced character migration pending. @todo implement
|
||||
public bool CanCreateOnlyIfExisting; ///< Can create characters on realm only if player has other existing characters there
|
||||
}
|
||||
|
||||
struct VirtualRealmNameInfo
|
||||
|
||||
@@ -398,7 +398,7 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt8((byte)Reason);
|
||||
_worldPacket.WriteInt32((int)Reason);
|
||||
}
|
||||
|
||||
ChatRestrictionType Reason;
|
||||
|
||||
@@ -264,7 +264,7 @@ namespace Game.Networking.Packets
|
||||
public uint RollTime;
|
||||
public LootMethod Method;
|
||||
public RollMask ValidRolls;
|
||||
public Array<LootRollIneligibilityReason> LootRollIneligibleReason = new Array<LootRollIneligibilityReason>(4);
|
||||
public Array<LootRollIneligibilityReason> LootRollIneligibleReason = new Array<LootRollIneligibilityReason>(5);
|
||||
public LootItemData Item = new();
|
||||
public uint DungeonEncounterID;
|
||||
|
||||
|
||||
@@ -106,8 +106,8 @@ namespace Game.Networking.Packets
|
||||
|
||||
_worldPacket.WriteFloat(Stats.HpMulti);
|
||||
_worldPacket.WriteFloat(Stats.EnergyMulti);
|
||||
|
||||
_worldPacket.WriteInt32(Stats.QuestItems.Count);
|
||||
_worldPacket.WriteInt32(Stats.QuestCurrencies.Count);
|
||||
_worldPacket.WriteUInt32(Stats.CreatureMovementInfoID);
|
||||
_worldPacket.WriteInt32(Stats.HealthScalingExpansion);
|
||||
_worldPacket.WriteUInt32(Stats.RequiredExpansion);
|
||||
@@ -128,6 +128,9 @@ namespace Game.Networking.Packets
|
||||
|
||||
foreach (var questItem in Stats.QuestItems)
|
||||
_worldPacket.WriteUInt32(questItem);
|
||||
|
||||
foreach (var currencyItem in Stats.QuestCurrencies)
|
||||
_worldPacket.WriteInt32(currencyItem);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -671,7 +674,7 @@ namespace Game.Networking.Packets
|
||||
public uint Unused1;
|
||||
public ObjectGuid Unused2;
|
||||
public string Unused3 = "";
|
||||
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteUInt32(Unused1);
|
||||
@@ -739,6 +742,7 @@ namespace Game.Networking.Packets
|
||||
public float EnergyMulti;
|
||||
public bool Leader;
|
||||
public List<uint> QuestItems = new();
|
||||
public List<int> QuestCurrencies = new();
|
||||
public uint CreatureMovementInfoID;
|
||||
public int HealthScalingExpansion;
|
||||
public uint RequiredExpansion;
|
||||
|
||||
@@ -1070,6 +1070,7 @@ namespace Game
|
||||
case QuestObjectiveType.HaveCurrency:
|
||||
case QuestObjectiveType.ObtainCurrency:
|
||||
case QuestObjectiveType.IncreaseReputation:
|
||||
case QuestObjectiveType.KillWithLabel:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -673,6 +673,9 @@ namespace Game
|
||||
Log.outInfo(LogFilter.ServerLoading, "Loading Creature Quest Items...");
|
||||
Global.ObjectMgr.LoadCreatureQuestItems();
|
||||
|
||||
Log.outInfo(LogFilter.ServerLoading, "Loading Creature Quest Currencies...");
|
||||
Global.ObjectMgr.LoadCreatureQuestCurrencies();
|
||||
|
||||
Log.outInfo(LogFilter.ServerLoading, "Loading Creature Linked Respawn...");
|
||||
Global.ObjectMgr.LoadLinkedRespawn(); // must be after LoadCreatures(), LoadGameObjects()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user