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 MaxMasterySpells = 2;
|
||||||
|
|
||||||
public const int ReqPrimaryTreeTalents = 31;
|
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 ulong MaxMoneyAmount = 99999999999UL;
|
||||||
public const int MaxActionButtons = 180;
|
public const int MaxActionButtons = 180;
|
||||||
public const int MaxActionButtonActionValue = 0x00FFFFFF + 1;
|
public const int MaxActionButtonActionValue = 0x00FFFFFF + 1;
|
||||||
@@ -900,4 +903,11 @@ namespace Framework.Constants
|
|||||||
Guild = 0,
|
Guild = 0,
|
||||||
Personal = 1,
|
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
|
IncreaseReputation = 18,// requires the player to gain X reputation with a faction
|
||||||
AreaTriggerEnter = 19,
|
AreaTriggerEnter = 19,
|
||||||
AreaTriggerExit = 20,
|
AreaTriggerExit = 20,
|
||||||
|
KillWithLabel = 21,
|
||||||
Max
|
Max
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1068,21 +1068,9 @@ namespace Game.Achievements
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
bool matchFound = false;
|
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 (referencePlayer.HasExploredZone(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))
|
|
||||||
{
|
{
|
||||||
matchFound = true;
|
matchFound = true;
|
||||||
break;
|
break;
|
||||||
@@ -1835,18 +1823,7 @@ namespace Game.Achievements
|
|||||||
}
|
}
|
||||||
case ModifierTreeType.PlayerHasExploredArea: // 113
|
case ModifierTreeType.PlayerHasExploredArea: // 113
|
||||||
{
|
{
|
||||||
AreaTableRecord areaTable = CliDB.AreaTableStorage.LookupByKey(reqValue);
|
if (!referencePlayer.HasExploredZone(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)
|
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -690,14 +690,9 @@ namespace Game.Chat
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint offset = (uint)(area.AreaBit / ActivePlayerData.ExploredZonesBits);
|
int offset = (area.AreaBit / PlayerConst.ExploredZonesBits);
|
||||||
if (offset >= PlayerConst.ExploredZonesSize)
|
|
||||||
{
|
|
||||||
handler.SendSysMessage(CypherStrings.BadValue);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint val = 1u << (area.AreaBit % ActivePlayerData.ExploredZonesBits);
|
uint val = 1u << (area.AreaBit % PlayerConst.ExploredZonesBits);
|
||||||
playerTarget.RemoveExploredZones(offset, val);
|
playerTarget.RemoveExploredZones(offset, val);
|
||||||
|
|
||||||
handler.SendSysMessage(CypherStrings.UnexploreArea);
|
handler.SendSysMessage(CypherStrings.UnexploreArea);
|
||||||
@@ -1670,14 +1665,9 @@ namespace Game.Chat
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint offset = (uint)(area.AreaBit / ActivePlayerData.ExploredZonesBits);
|
int offset = (area.AreaBit / PlayerConst.ExploredZonesBits);
|
||||||
if (offset >= PlayerConst.ExploredZonesSize)
|
|
||||||
{
|
|
||||||
handler.SendSysMessage(CypherStrings.BadValue);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ulong val = 1ul << (area.AreaBit % ActivePlayerData.ExploredZonesBits);
|
ulong val = 1ul << (area.AreaBit % PlayerConst.ExploredZonesBits);
|
||||||
playerTarget.AddExploredZones(offset, val);
|
playerTarget.AddExploredZones(offset, val);
|
||||||
|
|
||||||
handler.SendSysMessage(CypherStrings.ExploreArea);
|
handler.SendSysMessage(CypherStrings.ExploreArea);
|
||||||
|
|||||||
@@ -2192,9 +2192,8 @@ namespace Game
|
|||||||
for (var i = 0; i < condition.Explored.Length; ++i)
|
for (var i = 0; i < condition.Explored.Length; ++i)
|
||||||
{
|
{
|
||||||
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(condition.Explored[i]);
|
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(condition.Explored[i]);
|
||||||
if (area != null)
|
if (area != null && !player.HasExploredZone(area.Id))
|
||||||
if (area.AreaBit != -1 && !Convert.ToBoolean(player.m_activePlayerData.ExploredZones[area.AreaBit / ActivePlayerData.ExploredZonesBits] & (1ul << ((int)area.AreaBit % ActivePlayerData.ExploredZonesBits))))
|
return false;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -437,13 +437,13 @@ namespace Game.DataStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check loaded DB2 files proper version
|
// Check loaded DB2 files proper version
|
||||||
if (!AreaTableStorage.ContainsKey(14720) || // last area added in 10.0.7 (48520)
|
if (!AreaTableStorage.ContainsKey(15151) || // last area added in 10.2.5 (53007)
|
||||||
!CharTitlesStorage.ContainsKey(762) || // last char title added in 10.0.7 (48520)
|
!CharTitlesStorage.ContainsKey(805) || // last char title added in 10.2.5 (53007)
|
||||||
!GemPropertiesStorage.ContainsKey(4059) || // last gem property added in 10.0.7 (48520)
|
!GemPropertiesStorage.ContainsKey(4081) || // last gem property added in 10.2.5 (53007)
|
||||||
!ItemStorage.ContainsKey(205244) || // last item added in 10.0.7 (48520)
|
!ItemStorage.ContainsKey(215160) || // last item added in 10.2.5 (53007)
|
||||||
!ItemExtendedCostStorage.ContainsKey(8043) || // last item extended cost added in 10.0.7 (48520)
|
!ItemExtendedCostStorage.ContainsKey(8510) || // last item extended cost added in 10.2.5 (53007)
|
||||||
!MapStorage.ContainsKey(2616) || // last map added in 10.0.7 (48520)
|
!MapStorage.ContainsKey(2708) || // last map added in 10.2.5 (53007)
|
||||||
!SpellNameStorage.ContainsKey(409033)) // last spell added in 10.0.7 (48520)
|
!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.");
|
Log.outFatal(LogFilter.ServerLoading, "You have _outdated_ DB2 files. Please extract correct versions from current using client.");
|
||||||
Environment.Exit(1);
|
Environment.Exit(1);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace Game.DataStorage
|
|||||||
{
|
{
|
||||||
class DBReader
|
class DBReader
|
||||||
{
|
{
|
||||||
private const uint WDC3FmtSig = 0x34434457; // WDC3
|
private const uint WDC5FmtSig = 0x35434457; // WDC5
|
||||||
|
|
||||||
public WDCHeader Header;
|
public WDCHeader Header;
|
||||||
public FieldMetaData[] FieldMeta;
|
public FieldMetaData[] FieldMeta;
|
||||||
@@ -36,9 +36,14 @@ namespace Game.DataStorage
|
|||||||
{
|
{
|
||||||
Header = new WDCHeader();
|
Header = new WDCHeader();
|
||||||
Header.Signature = reader.ReadUInt32();
|
Header.Signature = reader.ReadUInt32();
|
||||||
if (Header.Signature != WDC3FmtSig)
|
if (Header.Signature != WDC5FmtSig)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Header.Version = reader.ReadUInt32();
|
||||||
|
if (Header.Version != 5)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Header.Schema = reader.ReadStringFromChars(128);
|
||||||
Header.RecordCount = reader.ReadUInt32();
|
Header.RecordCount = reader.ReadUInt32();
|
||||||
Header.FieldCount = reader.ReadUInt32();
|
Header.FieldCount = reader.ReadUInt32();
|
||||||
Header.RecordSize = reader.ReadUInt32();
|
Header.RecordSize = reader.ReadUInt32();
|
||||||
@@ -583,6 +588,8 @@ namespace Game.DataStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
public uint Signature;
|
public uint Signature;
|
||||||
|
public uint Version;
|
||||||
|
public string Schema;
|
||||||
public uint RecordCount;
|
public uint RecordCount;
|
||||||
public uint FieldCount;
|
public uint FieldCount;
|
||||||
public uint RecordSize;
|
public uint RecordSize;
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ namespace Game.DataStorage
|
|||||||
foreach (var areaGroupMember in AreaGroupMemberStorage.Values)
|
foreach (var areaGroupMember in AreaGroupMemberStorage.Values)
|
||||||
_areaGroupMembers.Add(areaGroupMember.AreaGroupID, areaGroupMember.AreaID);
|
_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)
|
foreach (ArtifactPowerRecord artifactPower in ArtifactPowerStorage.Values)
|
||||||
_artifactPowers.Add(artifactPower.ArtifactID, artifactPower);
|
_artifactPowers.Add(artifactPower.ArtifactID, artifactPower);
|
||||||
|
|
||||||
@@ -227,6 +230,9 @@ namespace Game.DataStorage
|
|||||||
_chrSpecializationsByIndex[storageIndex][chrSpec.OrderIndex] = chrSpec;
|
_chrSpecializationsByIndex[storageIndex][chrSpec.OrderIndex] = chrSpec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (ConditionalChrModelRecord conditionalChrModel in ConditionalChrModelStorage.Values)
|
||||||
|
_conditionalChrModelsByChrModelId[conditionalChrModel.ChrModelID] = conditionalChrModel;
|
||||||
|
|
||||||
foreach (ConditionalContentTuningRecord conditionalContentTuning in ConditionalContentTuningStorage.Values)
|
foreach (ConditionalContentTuningRecord conditionalContentTuning in ConditionalContentTuningStorage.Values)
|
||||||
_conditionalContentTuning.Add(conditionalContentTuning.ParentContentTuningID, conditionalContentTuning);
|
_conditionalContentTuning.Add(conditionalContentTuning.ParentContentTuningID, conditionalContentTuning);
|
||||||
|
|
||||||
@@ -1024,6 +1030,11 @@ namespace Game.DataStorage
|
|||||||
return _chrModelsByRaceAndGender.LookupByKey(Tuple.Create((byte)race, (byte)gender));
|
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)
|
public string GetChrRaceName(Race race, Locale locale = Locale.enUS)
|
||||||
{
|
{
|
||||||
ChrRacesRecord raceEntry = ChrRacesStorage.LookupByKey(race);
|
ChrRacesRecord raceEntry = ChrRacesStorage.LookupByKey(race);
|
||||||
@@ -2267,6 +2278,7 @@ namespace Game.DataStorage
|
|||||||
MultiMap<Tuple<byte, byte>, ChrCustomizationOptionRecord> _chrCustomizationOptionsByRaceAndGender = new();
|
MultiMap<Tuple<byte, byte>, ChrCustomizationOptionRecord> _chrCustomizationOptionsByRaceAndGender = new();
|
||||||
Dictionary<uint, MultiMap<uint, uint>> _chrCustomizationRequiredChoices = new();
|
Dictionary<uint, MultiMap<uint, uint>> _chrCustomizationRequiredChoices = new();
|
||||||
ChrSpecializationRecord[][] _chrSpecializationsByIndex = new ChrSpecializationRecord[(int)Class.Max + 1][];
|
ChrSpecializationRecord[][] _chrSpecializationsByIndex = new ChrSpecializationRecord[(int)Class.Max + 1][];
|
||||||
|
Dictionary<int, ConditionalChrModelRecord> _conditionalChrModelsByChrModelId = new();
|
||||||
MultiMap<uint, ConditionalContentTuningRecord> _conditionalContentTuning = new();
|
MultiMap<uint, ConditionalContentTuningRecord> _conditionalContentTuning = new();
|
||||||
List<(uint, int)> _contentTuningLabels = new();
|
List<(uint, int)> _contentTuningLabels = new();
|
||||||
MultiMap<uint, CurrencyContainerRecord> _currencyContainers = new();
|
MultiMap<uint, CurrencyContainerRecord> _currencyContainers = new();
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ namespace Game.DataStorage
|
|||||||
public sealed class ConditionalChrModelRecord
|
public sealed class ConditionalChrModelRecord
|
||||||
{
|
{
|
||||||
public uint Id;
|
public uint Id;
|
||||||
public uint ChrModelID; // This is the PK
|
public int ChrModelID;
|
||||||
public int ChrCustomizationReqID;
|
public int ChrCustomizationReqID;
|
||||||
public int PlayerConditionID;
|
public int PlayerConditionID;
|
||||||
public int Flags;
|
public int Flags;
|
||||||
|
|||||||
@@ -196,6 +196,10 @@ namespace Game.Entities
|
|||||||
if (items != null)
|
if (items != null)
|
||||||
stats.QuestItems.AddRange(items);
|
stats.QuestItems.AddRange(items);
|
||||||
|
|
||||||
|
var currencies = Global.ObjectMgr.GetCreatureQuestCurrencyList(Entry);
|
||||||
|
if (currencies != null)
|
||||||
|
stats.QuestCurrencies.AddRange(currencies);
|
||||||
|
|
||||||
if (locale != Locale.enUS)
|
if (locale != Locale.enUS)
|
||||||
{
|
{
|
||||||
CreatureLocale creatureLocale = Global.ObjectMgr.GetCreatureLocale(Entry);
|
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));
|
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()
|
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");
|
//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));
|
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()
|
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");
|
//static_assert(std::is_integral < T >::value, "RemoveUpdateFieldFlagValue must be used with integral types");
|
||||||
|
|||||||
@@ -2953,8 +2953,13 @@ namespace Game.Entities
|
|||||||
SetXP(xp);
|
SetXP(xp);
|
||||||
|
|
||||||
StringArray exploredZonesStrings = new(exploredZones, ' ');
|
StringArray exploredZonesStrings = new(exploredZones, ' ');
|
||||||
for (int i = 0; i < exploredZonesStrings.Length && i / 2 < ActivePlayerData.ExploredZonesSize; ++i)
|
for (int i = 0; i < exploredZonesStrings.Length && i / 2 < PlayerConst.ExploredZonesSize; ++i)
|
||||||
SetUpdateFieldFlagValue(ref m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.ExploredZones, i / 2), (ulong)((long.Parse(exploredZonesStrings[i])) << (32 * (i % 2))));
|
{
|
||||||
|
if (!ulong.TryParse(exploredZonesStrings[i], out ulong value))
|
||||||
|
value = 0;
|
||||||
|
|
||||||
|
AddExploredZones(i / 2, (value << (32 * (i % 2))));
|
||||||
|
}
|
||||||
|
|
||||||
StringArray knownTitlesStrings = new(knownTitles, ' ');
|
StringArray knownTitlesStrings = new(knownTitles, ' ');
|
||||||
if ((knownTitlesStrings.Length % 2) == 0)
|
if ((knownTitlesStrings.Length % 2) == 0)
|
||||||
@@ -3742,8 +3747,8 @@ namespace Game.Entities
|
|||||||
stmt.AddValue(index++, GetLootSpecId());
|
stmt.AddValue(index++, GetLootSpecId());
|
||||||
|
|
||||||
ss.Clear();
|
ss.Clear();
|
||||||
for (int i = 0; i < PlayerConst.ExploredZonesSize; ++i)
|
for (int i = 0; i < m_activePlayerData.DataFlags[(int)PlayerDataFlag.ExploredZonesIndex].Size(); ++i)
|
||||||
ss.Append($"{(uint)(m_activePlayerData.ExploredZones[i] & 0xFFFFFFFF)} {(uint)((m_activePlayerData.ExploredZones[i] >> 32) & 0xFFFFFFFF)} ");
|
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());
|
stmt.AddValue(index++, ss.ToString());
|
||||||
|
|
||||||
@@ -3877,8 +3882,8 @@ namespace Game.Entities
|
|||||||
stmt.AddValue(index++, GetLootSpecId());
|
stmt.AddValue(index++, GetLootSpecId());
|
||||||
|
|
||||||
ss.Clear();
|
ss.Clear();
|
||||||
for (int i = 0; i < PlayerConst.ExploredZonesSize; ++i)
|
for (int i = 0; i < m_activePlayerData.DataFlags[(int)PlayerDataFlag.ExploredZonesIndex].Size(); ++i)
|
||||||
ss.Append($"{(uint)(m_activePlayerData.ExploredZones[i] & 0xFFFFFFFF)} {(uint)((m_activePlayerData.ExploredZones[i] >> 32) & 0xFFFFFFFF)} ");
|
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());
|
stmt.AddValue(index++, ss.ToString());
|
||||||
|
|
||||||
|
|||||||
@@ -6301,8 +6301,6 @@ namespace Game.Entities
|
|||||||
SendPacket(new ResetWeeklyCurrency());
|
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()
|
void CheckAreaExploreAndOutdoor()
|
||||||
{
|
{
|
||||||
if (!IsAlive())
|
if (!IsAlive())
|
||||||
@@ -6326,20 +6324,13 @@ namespace Game.Entities
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int offset = areaEntry.AreaBit / ActivePlayerData.ExploredZonesBits;
|
int offset = (areaEntry.AreaBit / PlayerConst.ExploredZonesBits);
|
||||||
if (offset >= PlayerConst.ExploredZonesSize)
|
ulong val = 1ul << (areaEntry.AreaBit % PlayerConst.ExploredZonesBits);
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
ulong val = 1ul << (areaEntry.AreaBit % ActivePlayerData.ExploredZonesBits);
|
if (offset >= m_activePlayerData.DataFlags[(int)PlayerDataFlag.ExploredZonesIndex].Size()
|
||||||
ulong currFields = m_activePlayerData.ExploredZones[offset];
|
|| (m_activePlayerData.DataFlags[(int)PlayerDataFlag.ExploredZonesIndex][offset] & val) == 0)
|
||||||
|
|
||||||
if (!Convert.ToBoolean(currFields & val))
|
|
||||||
{
|
{
|
||||||
SetUpdateFieldFlagValue(ref m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.ExploredZones, (int)offset), val);
|
AddExploredZones(offset, val);
|
||||||
|
|
||||||
UpdateCriteria(CriteriaType.RevealWorldMapOverlay, GetAreaId());
|
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)
|
void SendExplorationExperience(uint Area, uint Experience)
|
||||||
{
|
{
|
||||||
SendPacket(new ExplorationExperience(Experience, Area));
|
SendPacket(new ExplorationExperience(Experience, Area));
|
||||||
|
|||||||
@@ -8226,6 +8226,11 @@ namespace Game
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<int> GetCreatureQuestCurrencyList(uint creatureId)
|
||||||
|
{
|
||||||
|
return creatureQuestCurrenciesStorage.LookupByKey(creatureId);
|
||||||
|
}
|
||||||
|
|
||||||
//Spells /Skills / Phases
|
//Spells /Skills / Phases
|
||||||
public void LoadPhases()
|
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");
|
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)
|
public void InitializeQueriesData(QueryDataGroup mask)
|
||||||
{
|
{
|
||||||
uint oldMSTime = Time.GetMSTime();
|
uint oldMSTime = Time.GetMSTime();
|
||||||
@@ -10827,6 +10872,7 @@ namespace Game
|
|||||||
Dictionary<ulong, CreatureData> creatureDataStorage = new();
|
Dictionary<ulong, CreatureData> creatureDataStorage = new();
|
||||||
Dictionary<ulong, CreatureAddon> creatureAddonStorage = new();
|
Dictionary<ulong, CreatureAddon> creatureAddonStorage = new();
|
||||||
MultiMap<(uint, Difficulty), uint> creatureQuestItemStorage = new();
|
MultiMap<(uint, Difficulty), uint> creatureQuestItemStorage = new();
|
||||||
|
MultiMap<uint, int> creatureQuestCurrenciesStorage = new();
|
||||||
Dictionary<uint, CreatureAddon> creatureTemplateAddonStorage = new();
|
Dictionary<uint, CreatureAddon> creatureTemplateAddonStorage = new();
|
||||||
MultiMap<uint, float> _creatureTemplateSparringStorage = new();
|
MultiMap<uint, float> _creatureTemplateSparringStorage = new();
|
||||||
Dictionary<ulong, CreatureMovementData> creatureMovementOverrides = new();
|
Dictionary<ulong, CreatureMovementData> creatureMovementOverrides = new();
|
||||||
|
|||||||
@@ -993,7 +993,7 @@ namespace Game
|
|||||||
// start with every map explored
|
// start with every map explored
|
||||||
if (WorldConfig.GetBoolValue(WorldCfg.StartAllExplored))
|
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);
|
pCurrChar.AddExploredZones(i, 0xFFFFFFFFFFFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1385,7 +1385,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
if (packet.CustomizedChrModelID != 0)
|
if (packet.CustomizedChrModelID != 0)
|
||||||
{
|
{
|
||||||
var conditionalChrModel = CliDB.ConditionalChrModelStorage.LookupByKey(packet.CustomizedChrModelID);
|
var conditionalChrModel = Global.DB2Mgr.GetConditionalChrModel(packet.CustomizedChrModelID);
|
||||||
if (conditionalChrModel == null)
|
if (conditionalChrModel == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ namespace Game.Networking.Packets
|
|||||||
if (SuccessInfo.NumPlayersAlliance.HasValue)
|
if (SuccessInfo.NumPlayersAlliance.HasValue)
|
||||||
_worldPacket.WriteUInt16(SuccessInfo.NumPlayersAlliance.Value);
|
_worldPacket.WriteUInt16(SuccessInfo.NumPlayersAlliance.Value);
|
||||||
|
|
||||||
if(SuccessInfo.ExpansionTrialExpiration.HasValue)
|
if (SuccessInfo.ExpansionTrialExpiration.HasValue)
|
||||||
_worldPacket.WriteInt64(SuccessInfo.ExpansionTrialExpiration.Value);
|
_worldPacket.WriteInt64(SuccessInfo.ExpansionTrialExpiration.Value);
|
||||||
|
|
||||||
if (SuccessInfo.NewBuildKeys != null)
|
if (SuccessInfo.NewBuildKeys != null)
|
||||||
@@ -412,13 +412,17 @@ namespace Game.Networking.Packets
|
|||||||
{
|
{
|
||||||
data.WriteUInt32(WaitCount);
|
data.WriteUInt32(WaitCount);
|
||||||
data.WriteUInt32(WaitTime);
|
data.WriteUInt32(WaitTime);
|
||||||
|
data.WriteUInt32(AllowedFactionGroupForCharacterCreate);
|
||||||
data.WriteBit(HasFCM);
|
data.WriteBit(HasFCM);
|
||||||
|
data.WriteBit(CanCreateOnlyIfExisting);
|
||||||
data.FlushBits();
|
data.FlushBits();
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint WaitCount; // position of the account in the login queue
|
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 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 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
|
struct VirtualRealmNameInfo
|
||||||
|
|||||||
@@ -398,7 +398,7 @@ namespace Game.Networking.Packets
|
|||||||
|
|
||||||
public override void Write()
|
public override void Write()
|
||||||
{
|
{
|
||||||
_worldPacket.WriteUInt8((byte)Reason);
|
_worldPacket.WriteInt32((int)Reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatRestrictionType Reason;
|
ChatRestrictionType Reason;
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ namespace Game.Networking.Packets
|
|||||||
public uint RollTime;
|
public uint RollTime;
|
||||||
public LootMethod Method;
|
public LootMethod Method;
|
||||||
public RollMask ValidRolls;
|
public RollMask ValidRolls;
|
||||||
public Array<LootRollIneligibilityReason> LootRollIneligibleReason = new Array<LootRollIneligibilityReason>(4);
|
public Array<LootRollIneligibilityReason> LootRollIneligibleReason = new Array<LootRollIneligibilityReason>(5);
|
||||||
public LootItemData Item = new();
|
public LootItemData Item = new();
|
||||||
public uint DungeonEncounterID;
|
public uint DungeonEncounterID;
|
||||||
|
|
||||||
|
|||||||
@@ -106,8 +106,8 @@ namespace Game.Networking.Packets
|
|||||||
|
|
||||||
_worldPacket.WriteFloat(Stats.HpMulti);
|
_worldPacket.WriteFloat(Stats.HpMulti);
|
||||||
_worldPacket.WriteFloat(Stats.EnergyMulti);
|
_worldPacket.WriteFloat(Stats.EnergyMulti);
|
||||||
|
|
||||||
_worldPacket.WriteInt32(Stats.QuestItems.Count);
|
_worldPacket.WriteInt32(Stats.QuestItems.Count);
|
||||||
|
_worldPacket.WriteInt32(Stats.QuestCurrencies.Count);
|
||||||
_worldPacket.WriteUInt32(Stats.CreatureMovementInfoID);
|
_worldPacket.WriteUInt32(Stats.CreatureMovementInfoID);
|
||||||
_worldPacket.WriteInt32(Stats.HealthScalingExpansion);
|
_worldPacket.WriteInt32(Stats.HealthScalingExpansion);
|
||||||
_worldPacket.WriteUInt32(Stats.RequiredExpansion);
|
_worldPacket.WriteUInt32(Stats.RequiredExpansion);
|
||||||
@@ -128,6 +128,9 @@ namespace Game.Networking.Packets
|
|||||||
|
|
||||||
foreach (var questItem in Stats.QuestItems)
|
foreach (var questItem in Stats.QuestItems)
|
||||||
_worldPacket.WriteUInt32(questItem);
|
_worldPacket.WriteUInt32(questItem);
|
||||||
|
|
||||||
|
foreach (var currencyItem in Stats.QuestCurrencies)
|
||||||
|
_worldPacket.WriteInt32(currencyItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -739,6 +742,7 @@ namespace Game.Networking.Packets
|
|||||||
public float EnergyMulti;
|
public float EnergyMulti;
|
||||||
public bool Leader;
|
public bool Leader;
|
||||||
public List<uint> QuestItems = new();
|
public List<uint> QuestItems = new();
|
||||||
|
public List<int> QuestCurrencies = new();
|
||||||
public uint CreatureMovementInfoID;
|
public uint CreatureMovementInfoID;
|
||||||
public int HealthScalingExpansion;
|
public int HealthScalingExpansion;
|
||||||
public uint RequiredExpansion;
|
public uint RequiredExpansion;
|
||||||
|
|||||||
@@ -1070,6 +1070,7 @@ namespace Game
|
|||||||
case QuestObjectiveType.HaveCurrency:
|
case QuestObjectiveType.HaveCurrency:
|
||||||
case QuestObjectiveType.ObtainCurrency:
|
case QuestObjectiveType.ObtainCurrency:
|
||||||
case QuestObjectiveType.IncreaseReputation:
|
case QuestObjectiveType.IncreaseReputation:
|
||||||
|
case QuestObjectiveType.KillWithLabel:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -673,6 +673,9 @@ namespace Game
|
|||||||
Log.outInfo(LogFilter.ServerLoading, "Loading Creature Quest Items...");
|
Log.outInfo(LogFilter.ServerLoading, "Loading Creature Quest Items...");
|
||||||
Global.ObjectMgr.LoadCreatureQuestItems();
|
Global.ObjectMgr.LoadCreatureQuestItems();
|
||||||
|
|
||||||
|
Log.outInfo(LogFilter.ServerLoading, "Loading Creature Quest Currencies...");
|
||||||
|
Global.ObjectMgr.LoadCreatureQuestCurrencies();
|
||||||
|
|
||||||
Log.outInfo(LogFilter.ServerLoading, "Loading Creature Linked Respawn...");
|
Log.outInfo(LogFilter.ServerLoading, "Loading Creature Linked Respawn...");
|
||||||
Global.ObjectMgr.LoadLinkedRespawn(); // must be after LoadCreatures(), LoadGameObjects()
|
Global.ObjectMgr.LoadLinkedRespawn(); // must be after LoadCreatures(), LoadGameObjects()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user