Core: Updated to 11.0.2
Port From (https://github.com/TrinityCore/TrinityCore/commit/df1ec76d54db3a91759fc93f4d6b6828d4ec0f59)
This commit is contained in:
@@ -1270,7 +1270,7 @@ namespace Framework.Constants
|
||||
CantEquipRating = 81, // You Don'T Have The Personal, Team, Or Battleground Rating Required To Buy That Item
|
||||
EventAutoequipBindConfirm = 82,
|
||||
NotSameAccount = 83, // Account-Bound Items Can Only Be Given To Your Own Characters.
|
||||
EquipNone3 = 84,
|
||||
None = 84,
|
||||
ItemMaxLimitCategoryCountExceededIs = 85, // You Can Only Carry %D %S
|
||||
ItemMaxLimitCategorySocketedExceededIs = 86, // You Can Only Equip %D |4item:Items In The %S Category
|
||||
ScalingStatItemLevelExceeded = 87, // Your Level Is Too High To Use That Item
|
||||
@@ -1306,6 +1306,16 @@ namespace Framework.Constants
|
||||
ReagentBagItemType = 117,// Only Reagents can be placed in Reagent Bags.
|
||||
CantBulkSellItemWithRefund = 118,// Items that can be refunded can't be bulk sold.
|
||||
NoSoulboundItemInAccountBank = 119,// Soulbound items cannot be stored in the Warband Bank.
|
||||
CantDoThatRightNow3 = 120,// You Can't Do That Right Now.
|
||||
NoAccountInventoryLock = 121,// Your Character Cannot Complete This Action.
|
||||
TooManyAccountBankTabs = 122,// You Have Already Purchased The Maximum Amount Of Tabs.
|
||||
NoAccountBankHere = 123,// You Are Too Far Away From A Warband Bank.
|
||||
NoRefundableItemInAccountBank = 124,// Refundable Items Cannot Be Stored In The Warband Bank.
|
||||
NoImmediateContainerInAccountBank = 125,// You Cannot Place That In The Warband Bank.
|
||||
NoOpenImmediateContainerInAccountBank = 126,// You Cannot Open This While It Is In The Warband Bank.
|
||||
CantDeleteInAccountBank = 127,// Items Must Be Moved Out Of The Warband Bank To Be Deleted.
|
||||
BankNotAccessible = 128,// This Character Does Not Have Access To This Bank.
|
||||
CantTradeAccountItem = 129,// You Can't Trade An Item From The Warband Bank.
|
||||
}
|
||||
|
||||
public enum BankType
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+1005
-1001
File diff suppressed because it is too large
Load Diff
@@ -927,7 +927,7 @@ namespace Framework.Database
|
||||
|
||||
// MapDifficulty.db2
|
||||
PrepareStatement(HotfixStatements.SEL_MAP_DIFFICULTY, "SELECT ID, Message, DifficultyID, LockID, ResetInterval, MaxPlayers, ItemContext, " +
|
||||
"ItemContextPickerID, Flags, ContentTuningID, MapID FROM map_difficulty WHERE (`VerifiedBuild` > 0) = ?");
|
||||
"ItemContextPickerID, Flags, ContentTuningID, WorldStateExpressionID, MapID FROM map_difficulty WHERE (`VerifiedBuild` > 0) = ?");
|
||||
PrepareStatement(HotfixStatements.SEL_MAP_DIFFICULTY_LOCALE, "SELECT ID, Message_lang FROM map_difficulty_locale WHERE (`VerifiedBuild` > 0) = ? AND locale = ?");
|
||||
|
||||
// MapDifficultyXCondition.db2
|
||||
@@ -1098,7 +1098,7 @@ namespace Framework.Database
|
||||
" WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// QuestSort.db2
|
||||
PrepareStatement(HotfixStatements.SEL_QUEST_SORT, "SELECT ID, SortName, UiOrderIndex FROM quest_sort WHERE (`VerifiedBuild` > 0) = ?");
|
||||
PrepareStatement(HotfixStatements.SEL_QUEST_SORT, "SELECT ID, SortName, UiOrderIndex, Flags FROM quest_sort WHERE (`VerifiedBuild` > 0) = ?");
|
||||
PrepareStatement(HotfixStatements.SEL_QUEST_SORT_LOCALE, "SELECT ID, SortName_lang FROM quest_sort_locale WHERE (`VerifiedBuild` > 0) = ? AND locale = ?");
|
||||
|
||||
// QuestV2.db2
|
||||
@@ -1425,7 +1425,7 @@ namespace Framework.Database
|
||||
|
||||
// TraitCond.db2
|
||||
PrepareStatement(HotfixStatements.SEL_TRAIT_COND, "SELECT ID, CondType, TraitTreeID, GrantedRanks, QuestID, AchievementID, SpecSetID, TraitNodeGroupID, " +
|
||||
"TraitNodeID, TraitCurrencyID, SpentAmountRequired, Flags, RequiredLevel, FreeSharedStringID, SpendMoreSharedStringID, " +
|
||||
"TraitNodeID, TraitNodeEntryID, TraitCurrencyID, SpentAmountRequired, Flags, RequiredLevel, FreeSharedStringID, SpendMoreSharedStringID, " +
|
||||
"TraitCondAccountElementID FROM trait_cond WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// TraitCost.db2
|
||||
@@ -1552,7 +1552,7 @@ namespace Framework.Database
|
||||
// UiMap.db2
|
||||
PrepareStatement(HotfixStatements.SEL_UI_MAP, "SELECT Name, ID, ParentUiMapID, Flags, `System`, Type, BountySetID, BountyDisplayLocation, " +
|
||||
"VisibilityPlayerConditionID2, VisibilityPlayerConditionID, HelpTextPosition, BkgAtlasID, AlternateUiMapGroup, ContentTuningID, " +
|
||||
"AdventureMapTextureKitID FROM ui_map WHERE (`VerifiedBuild` > 0) = ?");
|
||||
"AdventureMapTextureKitID, MapArtZoneTextPosition FROM ui_map WHERE (`VerifiedBuild` > 0) = ?");
|
||||
PrepareStatement(HotfixStatements.SEL_UI_MAP_LOCALE, "SELECT ID, Name_lang FROM ui_map_locale WHERE (`VerifiedBuild` > 0) = ? AND locale = ?");
|
||||
|
||||
// UiMapAssignment.db2
|
||||
|
||||
@@ -282,7 +282,7 @@ namespace Game.DataStorage
|
||||
_factionTeams.Add(faction.ParentFactionID, faction.Id);
|
||||
|
||||
foreach (FriendshipRepReactionRecord friendshipRepReaction in FriendshipRepReactionStorage.Values)
|
||||
_friendshipRepReactions.Add(friendshipRepReaction.FriendshipRepID, friendshipRepReaction);
|
||||
_friendshipRepReactions.Add((uint)friendshipRepReaction.FriendshipRepID, friendshipRepReaction);
|
||||
|
||||
foreach (var key in _friendshipRepReactions.Keys)
|
||||
_friendshipRepReactions[key].Sort(new FriendshipRepReactionRecordComparer());
|
||||
@@ -892,9 +892,7 @@ namespace Game.DataStorage
|
||||
|
||||
public uint GetEmptyAnimStateID()
|
||||
{
|
||||
return 1778;
|
||||
// TEMP: well... AnimationData.db2 in 11.0.0 has more rows than max hardcoded anim id in client
|
||||
//return AnimationDataStorage.GetNumRows();
|
||||
return AnimationDataStorage.GetNumRows();
|
||||
}
|
||||
|
||||
public List<uint> GetAreasForGroup(uint areaGroupId)
|
||||
|
||||
@@ -96,8 +96,8 @@ namespace Game.DataStorage
|
||||
{
|
||||
public uint Id;
|
||||
public LocalizedString Reaction;
|
||||
public uint FriendshipRepID;
|
||||
public ushort ReactionThreshold;
|
||||
public int FriendshipRepID;
|
||||
public int ReactionThreshold;
|
||||
public int OverrideColor;
|
||||
}
|
||||
|
||||
|
||||
@@ -132,6 +132,7 @@ namespace Game.DataStorage
|
||||
public uint ItemContextPickerID;
|
||||
public int Flags;
|
||||
public int ContentTuningID;
|
||||
public int WorldStateExpressionID;
|
||||
public uint MapID;
|
||||
|
||||
public bool HasResetSchedule() { return ResetInterval != MapDifficultyResetInterval.Anytime; }
|
||||
|
||||
@@ -49,6 +49,7 @@ namespace Game.DataStorage
|
||||
public uint Id;
|
||||
public string SortName;
|
||||
public byte UiOrderIndex;
|
||||
public int Flags;
|
||||
}
|
||||
|
||||
public sealed class QuestV2Record
|
||||
|
||||
@@ -119,6 +119,7 @@ namespace Game.DataStorage
|
||||
public int SpecSetID;
|
||||
public int TraitNodeGroupID;
|
||||
public int TraitNodeID;
|
||||
public int TraitNodeEntryID;
|
||||
public int TraitCurrencyID;
|
||||
public int SpentAmountRequired;
|
||||
public int Flags;
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace Game.DataStorage
|
||||
public int AlternateUiMapGroup;
|
||||
public int ContentTuningID;
|
||||
public int AdventureMapTextureKitID;
|
||||
public sbyte MapArtZoneTextPosition;
|
||||
|
||||
public bool HasFlag(UiMapFlag uiMapFlag) { return (Flags & (int)uiMapFlag) != 0; }
|
||||
}
|
||||
|
||||
@@ -564,6 +564,7 @@ namespace Game.Misc
|
||||
|
||||
offer.QuestID = quest.Id;
|
||||
offer.AutoLaunched = autoLaunched;
|
||||
offer.ResetByScheduler = quest.IsResetByScheduler();
|
||||
offer.SuggestedPartyMembers = quest.SuggestedPlayers;
|
||||
offer.QuestInfoID = (int)quest.QuestInfoID;
|
||||
|
||||
@@ -670,6 +671,7 @@ namespace Game.Misc
|
||||
}
|
||||
|
||||
packet.AutoLaunched = autoLaunched;
|
||||
packet.ResetByScheduler = quest.IsResetByScheduler();
|
||||
|
||||
_session.SendPacket(packet);
|
||||
}
|
||||
|
||||
@@ -195,6 +195,16 @@ namespace Game.Entities
|
||||
|
||||
public int GetSize() { return _values.Length; }
|
||||
|
||||
public T First(Func<T, bool> predicate)
|
||||
{
|
||||
return _values.First(predicate);
|
||||
}
|
||||
|
||||
public int IndexOf(T value)
|
||||
{
|
||||
return Array.IndexOf(_values, value);
|
||||
}
|
||||
|
||||
public IEnumerator<T> GetEnumerator()
|
||||
{
|
||||
foreach (var obj in _values)
|
||||
|
||||
@@ -2657,6 +2657,49 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
public class ZonePlayerForcedReaction : HasChangesMask
|
||||
{
|
||||
public UpdateField<int> FactionID = new(0, 1);
|
||||
public UpdateField<int> Reaction = new(0, 2);
|
||||
|
||||
public ZonePlayerForcedReaction() : base(3) { }
|
||||
|
||||
public void WriteCreate(WorldPacket data, Player owner, Player receiver)
|
||||
{
|
||||
data.WriteInt32(FactionID);
|
||||
data.WriteInt32(Reaction);
|
||||
}
|
||||
|
||||
public void WriteUpdate(WorldPacket data, bool ignoreChangesMask, Player owner, Player receiver)
|
||||
{
|
||||
UpdateMask changesMask = _changesMask;
|
||||
if (ignoreChangesMask)
|
||||
changesMask.SetAll();
|
||||
|
||||
data.WriteBits(changesMask.GetBlock(0), 3);
|
||||
|
||||
data.FlushBits();
|
||||
if (changesMask[0])
|
||||
{
|
||||
if (changesMask[1])
|
||||
{
|
||||
data.WriteInt32(FactionID);
|
||||
}
|
||||
if (changesMask[2])
|
||||
{
|
||||
data.WriteInt32(Reaction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void ClearChangesMask()
|
||||
{
|
||||
ClearChangesMask(FactionID);
|
||||
ClearChangesMask(Reaction);
|
||||
_changesMask.ResetAll();
|
||||
}
|
||||
}
|
||||
|
||||
public class PetCreatureName : HasChangesMask
|
||||
{
|
||||
public UpdateField<uint> CreatureID = new(0, 1);
|
||||
@@ -2901,10 +2944,11 @@ namespace Game.Entities
|
||||
public UpdateFieldArray<QuestLog> QuestLog = new(175, 49, 50);
|
||||
public UpdateFieldArray<VisibleItem> VisibleItems = new(19, 225, 226);
|
||||
public UpdateFieldArray<float> AvgItemLevel = new(6, 245, 246);
|
||||
public UpdateFieldArray<ItemInstance> VisibleEquipableSpells = new(16, 252, 253);
|
||||
public UpdateFieldArray<uint> Field_3120 = new(19, 269, 270);
|
||||
public UpdateFieldArray<ZonePlayerForcedReaction> ForcedReactions = new(32, 252, 253);
|
||||
public UpdateFieldArray<ItemInstance> VisibleEquipableSpells = new(16, 285, 286);
|
||||
public UpdateFieldArray<uint> Field_3120 = new(19, 302, 303);
|
||||
|
||||
public PlayerData() : base(0, TypeId.Player, 289) { }
|
||||
public PlayerData() : base(0, TypeId.Player, 322) { }
|
||||
|
||||
public void WriteCreate(WorldPacket data, UpdateFieldFlag fieldVisibilityFlags, Player owner, Player receiver)
|
||||
{
|
||||
@@ -2954,6 +2998,10 @@ namespace Game.Entities
|
||||
data.WriteUInt32(HonorLevel);
|
||||
data.WriteInt64(LogoutTime);
|
||||
data.WriteInt32(ArenaCooldowns.Size());
|
||||
for (int i = 0; i < 32; ++i)
|
||||
{
|
||||
ForcedReactions[i].WriteCreate(data, owner, receiver);
|
||||
}
|
||||
data.WriteInt32(Field_1AC);
|
||||
data.WriteInt32(Field_1B0);
|
||||
data.WriteInt32(CurrentBattlePetSpeciesID);
|
||||
@@ -3019,7 +3067,7 @@ namespace Game.Entities
|
||||
|
||||
public void WriteUpdate(WorldPacket data, UpdateFieldFlag fieldVisibilityFlags, Player owner, Player receiver)
|
||||
{
|
||||
UpdateMask allowedMaskForTarget = new(289, [0xFFFFFFDDu, 0x0001FFFFu, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0xFFFFFFFEu, 0xFFFFFFFFu, 0x00000001u]);
|
||||
UpdateMask allowedMaskForTarget = new(322, [0xFFFFFFDDu, 0x0001FFFFu, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0xFFFFFFFEu, 0xFFFFFFFFu, 0xFFFFFFFFu, 0x00000003u]);
|
||||
AppendAllowedFieldsMaskForFlag(allowedMaskForTarget, fieldVisibilityFlags);
|
||||
WriteUpdate(data, _changesMask & allowedMaskForTarget, false, owner, receiver);
|
||||
}
|
||||
@@ -3027,20 +3075,20 @@ namespace Game.Entities
|
||||
public void AppendAllowedFieldsMaskForFlag(UpdateMask allowedMaskForTarget, UpdateFieldFlag fieldVisibilityFlags)
|
||||
{
|
||||
if (fieldVisibilityFlags.HasFlag(UpdateFieldFlag.PartyMember))
|
||||
allowedMaskForTarget.OR(new UpdateMask(289, [0x00000022u, 0xFFFE0000u, 0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu, 0x00000001u, 0x00000000u, 0x00000000u]));
|
||||
allowedMaskForTarget.OR(new UpdateMask(322, [0x00000022u, 0xFFFE0000u, 0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu, 0x00000001u, 0x00000000u, 0x00000000u, 0x00000000u]));
|
||||
}
|
||||
|
||||
public void FilterDisallowedFieldsMaskForFlag(UpdateMask changesMask, UpdateFieldFlag fieldVisibilityFlags)
|
||||
{
|
||||
UpdateMask allowedMaskForTarget = new(289, [0xFFFFFFDDu, 0x0001FFFFu, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0xFFFFFFFEu, 0xFFFFFFFFu, 0x00000001u]);
|
||||
UpdateMask allowedMaskForTarget = new(322, [0xFFFFFFDDu, 0x0001FFFFu, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0xFFFFFFFEu, 0xFFFFFFFFu, 0xFFFFFFFFu, 0x00000003u]);
|
||||
AppendAllowedFieldsMaskForFlag(allowedMaskForTarget, fieldVisibilityFlags);
|
||||
changesMask.AND(allowedMaskForTarget);
|
||||
}
|
||||
|
||||
public void WriteUpdate(WorldPacket data, UpdateMask changesMask, bool ignoreNestedChangesMask, Player owner, Player receiver)
|
||||
{
|
||||
data.WriteBits(changesMask.GetBlocksMask(0), 10);
|
||||
for (uint i = 0; i < 10; ++i)
|
||||
data.WriteBits(changesMask.GetBlocksMask(0), 11);
|
||||
for (uint i = 0; i < 11; ++i)
|
||||
if (changesMask.GetBlock(i) != 0)
|
||||
data.WriteBits(changesMask.GetBlock(i), 32);
|
||||
|
||||
@@ -3364,21 +3412,31 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changesMask[269])
|
||||
if (changesMask[252])
|
||||
{
|
||||
for (int i = 0; i < 32; ++i)
|
||||
{
|
||||
if (changesMask[253 + i])
|
||||
{
|
||||
ForcedReactions[i].WriteUpdate(data, ignoreNestedChangesMask, owner, receiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changesMask[302])
|
||||
{
|
||||
for (int i = 0; i < 19; ++i)
|
||||
{
|
||||
if (changesMask[270 + i])
|
||||
if (changesMask[303 + i])
|
||||
{
|
||||
data.WriteUInt32(Field_3120[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changesMask[252])
|
||||
if (changesMask[285])
|
||||
{
|
||||
for (int i = 0; i < 16; ++i)
|
||||
{
|
||||
if (changesMask[253 + i])
|
||||
if (changesMask[286 + i])
|
||||
{
|
||||
VisibleEquipableSpells[i].Write(data);
|
||||
}
|
||||
@@ -3437,6 +3495,7 @@ namespace Game.Entities
|
||||
ClearChangesMask(QuestLog);
|
||||
ClearChangesMask(VisibleItems);
|
||||
ClearChangesMask(AvgItemLevel);
|
||||
ClearChangesMask(ForcedReactions);
|
||||
ClearChangesMask(VisibleEquipableSpells);
|
||||
ClearChangesMask(Field_3120);
|
||||
_changesMask.ResetAll();
|
||||
@@ -5010,19 +5069,19 @@ namespace Game.Entities
|
||||
|
||||
public class NPCCraftingOrderInfo : HasChangesMask
|
||||
{
|
||||
public UpdateField<ulong> Field_0 = new(-1, 0);
|
||||
public UpdateField<int> Field_8 = new(-1, 1);
|
||||
public UpdateField<int> Field_C = new(-1, 2);
|
||||
public UpdateField<int> Field_10 = new(-1, 3);
|
||||
public UpdateField<ulong> OrderID = new(-1, 0);
|
||||
public UpdateField<int> NpcCraftingOrderSetID = new(-1, 1);
|
||||
public UpdateField<int> NpcTreasureID = new(-1, 2);
|
||||
public UpdateField<int> NpcCraftingOrderCustomerID = new(-1, 3);
|
||||
|
||||
public NPCCraftingOrderInfo() : base(4) { }
|
||||
|
||||
public void WriteCreate(WorldPacket data, Player owner, Player receiver)
|
||||
{
|
||||
data.WriteUInt64(Field_0);
|
||||
data.WriteInt32(Field_8);
|
||||
data.WriteInt32(Field_C);
|
||||
data.WriteInt32(Field_10);
|
||||
data.WriteUInt64(OrderID);
|
||||
data.WriteInt32(NpcCraftingOrderSetID);
|
||||
data.WriteInt32(NpcTreasureID);
|
||||
data.WriteInt32(NpcCraftingOrderCustomerID);
|
||||
}
|
||||
|
||||
public void WriteUpdate(WorldPacket data, bool ignoreChangesMask, Player owner, Player receiver)
|
||||
@@ -5036,28 +5095,28 @@ namespace Game.Entities
|
||||
data.FlushBits();
|
||||
if (changesMask[0])
|
||||
{
|
||||
data.WriteUInt64(Field_0);
|
||||
data.WriteUInt64(OrderID);
|
||||
}
|
||||
if (changesMask[1])
|
||||
{
|
||||
data.WriteInt32(Field_8);
|
||||
data.WriteInt32(NpcCraftingOrderSetID);
|
||||
}
|
||||
if (changesMask[2])
|
||||
{
|
||||
data.WriteInt32(Field_C);
|
||||
data.WriteInt32(NpcTreasureID);
|
||||
}
|
||||
if (changesMask[3])
|
||||
{
|
||||
data.WriteInt32(Field_10);
|
||||
data.WriteInt32(NpcCraftingOrderCustomerID);
|
||||
}
|
||||
}
|
||||
|
||||
public override void ClearChangesMask()
|
||||
{
|
||||
ClearChangesMask(Field_0);
|
||||
ClearChangesMask(Field_8);
|
||||
ClearChangesMask(Field_C);
|
||||
ClearChangesMask(Field_10);
|
||||
ClearChangesMask(OrderID);
|
||||
ClearChangesMask(NpcCraftingOrderSetID);
|
||||
ClearChangesMask(NpcTreasureID);
|
||||
ClearChangesMask(NpcCraftingOrderCustomerID);
|
||||
_changesMask.ResetAll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Game.Entities
|
||||
{
|
||||
get
|
||||
{
|
||||
return (_blocks[index / 32] & (1 << (index % 32))) != 0;
|
||||
return (_blocks[GetBlockIndex(index)] & GetBlockFlag(index)) != 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3257,15 +3257,10 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
public void SendQuestGiverStatusMultiple()
|
||||
{
|
||||
SendQuestGiverStatusMultiple(m_clientGUIDs);
|
||||
}
|
||||
|
||||
public void SendQuestGiverStatusMultiple(List<ObjectGuid> guids)
|
||||
{
|
||||
QuestGiverStatusMultiple response = new();
|
||||
|
||||
foreach (var itr in guids)
|
||||
foreach (var itr in m_clientGUIDs)
|
||||
{
|
||||
if (itr.IsAnyTypeCreature())
|
||||
{
|
||||
|
||||
@@ -1844,6 +1844,34 @@ namespace Game.Entities
|
||||
|
||||
return MathFunctions.CalculatePct(rep, percent);
|
||||
}
|
||||
|
||||
public void SetVisibleForcedReaction(uint factionId, ReputationRank rank)
|
||||
{
|
||||
var zonePlayerForcedReaction = m_playerData.ForcedReactions.First(p => p.FactionID == factionId);
|
||||
if (zonePlayerForcedReaction == null)
|
||||
zonePlayerForcedReaction = m_playerData.ForcedReactions.First(p => p.FactionID == 0);
|
||||
|
||||
if (zonePlayerForcedReaction == null)
|
||||
return; // no more free slots
|
||||
|
||||
var setter = m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.ForcedReactions, m_playerData.ForcedReactions.IndexOf(zonePlayerForcedReaction));
|
||||
|
||||
SetUpdateFieldValue(setter.ModifyValue(setter.FactionID), (int)factionId);
|
||||
SetUpdateFieldValue(setter.ModifyValue(setter.Reaction), (int)rank);
|
||||
}
|
||||
|
||||
public void RemoveVisibleForcedReaction(uint factionId)
|
||||
{
|
||||
var zonePlayerForcedReaction = m_playerData.ForcedReactions.First(p => p.FactionID == factionId);
|
||||
if (zonePlayerForcedReaction == null)
|
||||
return;
|
||||
|
||||
var setter = m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.ForcedReactions, m_playerData.ForcedReactions.IndexOf(zonePlayerForcedReaction));
|
||||
|
||||
SetUpdateFieldValue(setter.ModifyValue(setter.FactionID), 0);
|
||||
SetUpdateFieldValue(setter.ModifyValue(setter.Reaction), 0);
|
||||
}
|
||||
|
||||
// Calculates how many reputation points player gains in victim's enemy factions
|
||||
public void RewardReputation(Unit victim, float rate)
|
||||
{
|
||||
|
||||
@@ -1245,12 +1245,6 @@ namespace Game
|
||||
}));
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.RequestForcedReactions)]
|
||||
void HandleRequestForcedReactions(RequestForcedReactions requestForcedReactions)
|
||||
{
|
||||
GetPlayer().GetReputationMgr().SendForceReactions();
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.CharacterRenameRequest, Status = SessionStatus.Authed)]
|
||||
void HandleCharRename(CharacterRenameRequest request)
|
||||
{
|
||||
|
||||
@@ -697,6 +697,7 @@ namespace Game
|
||||
broadcastPingUnit.TargetGUID = pingUnit.TargetGUID;
|
||||
broadcastPingUnit.Type = pingUnit.Type;
|
||||
broadcastPingUnit.PinFrameID = pingUnit.PinFrameID;
|
||||
broadcastPingUnit.PingDuration = pingUnit.PingDuration;
|
||||
broadcastPingUnit.Write();
|
||||
|
||||
for (GroupReference itr = group.GetFirstMember(); itr != null; itr = itr.Next())
|
||||
@@ -726,6 +727,7 @@ namespace Game
|
||||
broadcastPingWorldPoint.Type = pingWorldPoint.Type;
|
||||
broadcastPingWorldPoint.PinFrameID = pingWorldPoint.PinFrameID;
|
||||
broadcastPingWorldPoint.Transport = pingWorldPoint.Transport;
|
||||
broadcastPingWorldPoint.PingDuration = pingWorldPoint.PingDuration;
|
||||
broadcastPingWorldPoint.Write();
|
||||
|
||||
for (GroupReference itr = group.GetFirstMember(); itr != null; itr = itr.Next())
|
||||
|
||||
@@ -721,12 +721,6 @@ namespace Game
|
||||
_player.SendQuestGiverStatusMultiple();
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.QuestGiverStatusTrackedQuery)]
|
||||
void HandleQuestgiverStatusTrackedQueryOpcode(QuestGiverStatusTrackedQuery questGiverStatusTrackedQuery)
|
||||
{
|
||||
_player.SendQuestGiverStatusMultiple(questGiverStatusTrackedQuery.QuestGiverGUIDs);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.RequestWorldQuestUpdate)]
|
||||
void HandleRequestWorldQuestUpdate(RequestWorldQuestUpdate packet)
|
||||
{
|
||||
|
||||
@@ -272,6 +272,7 @@ namespace Game.Networking.Packets
|
||||
data.WriteUInt8(Subclass);
|
||||
data.WriteUInt32(SecondaryItemModifiedAppearanceID);
|
||||
data.WriteUInt32(ItemID);
|
||||
data.WriteUInt32(TransmogrifiedItemID);
|
||||
}
|
||||
|
||||
public uint DisplayId;
|
||||
@@ -280,6 +281,7 @@ namespace Game.Networking.Packets
|
||||
public byte InvType;
|
||||
public byte Subclass;
|
||||
public uint ItemID;
|
||||
public uint TransmogrifiedItemID;
|
||||
}
|
||||
|
||||
public struct PetInfo
|
||||
|
||||
@@ -133,23 +133,6 @@ namespace Game.Networking.Packets
|
||||
public int GuildFlags;
|
||||
}
|
||||
|
||||
public class GuildRosterUpdate : ServerPacket
|
||||
{
|
||||
public GuildRosterUpdate() : base(ServerOpcodes.GuildRosterUpdate)
|
||||
{
|
||||
MemberData = new List<GuildRosterMemberData>();
|
||||
}
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteInt32(MemberData.Count);
|
||||
|
||||
MemberData.ForEach(p => p.Write(_worldPacket));
|
||||
}
|
||||
|
||||
public List<GuildRosterMemberData> MemberData;
|
||||
}
|
||||
|
||||
public class GuildUpdateMotdText : ClientPacket
|
||||
{
|
||||
public GuildUpdateMotdText(WorldPacket packet) : base(packet) { }
|
||||
@@ -195,9 +178,16 @@ namespace Game.Networking.Packets
|
||||
|
||||
public class GuildDeclineInvitation : ClientPacket
|
||||
{
|
||||
public ObjectGuid GuildGuid;
|
||||
public bool IsAuto;
|
||||
|
||||
public GuildDeclineInvitation(WorldPacket packet) : base(packet) { }
|
||||
|
||||
public override void Read() { }
|
||||
public override void Read()
|
||||
{
|
||||
GuildGuid = _worldPacket.ReadPackedGuid();
|
||||
IsAuto = _worldPacket.HasBit();
|
||||
}
|
||||
}
|
||||
|
||||
public class DeclineGuildInvites : ClientPacket
|
||||
|
||||
@@ -312,12 +312,14 @@ namespace Game.Networking.Packets
|
||||
public GossipOptionRewardType Type;
|
||||
public int ID;
|
||||
public int Quantity;
|
||||
public sbyte ItemContext;
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteBits((byte)Type, 1);
|
||||
data.WriteInt32(ID);
|
||||
data.WriteInt32(Quantity);
|
||||
data.WriteInt8(ItemContext);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -388,6 +390,7 @@ namespace Game.Networking.Packets
|
||||
public uint QuestID;
|
||||
public uint ContentTuningID;
|
||||
public int QuestType;
|
||||
public int Unused1102;
|
||||
public bool Repeatable;
|
||||
public bool ResetByScheduler;
|
||||
public bool Important;
|
||||
@@ -402,6 +405,7 @@ namespace Game.Networking.Packets
|
||||
data.WriteUInt32(QuestID);
|
||||
data.WriteUInt32(ContentTuningID);
|
||||
data.WriteInt32(QuestType);
|
||||
data.WriteInt32(Unused1102);
|
||||
data.WriteUInt32(QuestFlags);
|
||||
data.WriteUInt32(QuestFlagsEx);
|
||||
data.WriteUInt32(QuestFlagsEx2);
|
||||
|
||||
@@ -961,6 +961,7 @@ namespace Game.Networking.Packets
|
||||
public ObjectGuid TargetGUID;
|
||||
public PingSubjectType Type = PingSubjectType.Max;
|
||||
public uint PinFrameID;
|
||||
public TimeSpan PingDuration;
|
||||
|
||||
public SendPingUnit(WorldPacket packet) : base(packet) { }
|
||||
|
||||
@@ -970,6 +971,7 @@ namespace Game.Networking.Packets
|
||||
TargetGUID = _worldPacket.ReadPackedGuid();
|
||||
Type = (PingSubjectType)_worldPacket.ReadUInt8();
|
||||
PinFrameID = _worldPacket.ReadUInt32();
|
||||
PingDuration = TimeSpan.FromMilliseconds(_worldPacket.ReadInt32());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -979,6 +981,7 @@ namespace Game.Networking.Packets
|
||||
public ObjectGuid TargetGUID;
|
||||
public PingSubjectType Type = PingSubjectType.Max;
|
||||
public uint PinFrameID;
|
||||
public TimeSpan PingDuration;
|
||||
|
||||
public ReceivePingUnit() : base(ServerOpcodes.ReceivePingUnit) { }
|
||||
|
||||
@@ -988,6 +991,7 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WritePackedGuid(TargetGUID);
|
||||
_worldPacket.WriteUInt8((byte)Type);
|
||||
_worldPacket.WriteUInt32(PinFrameID);
|
||||
_worldPacket.WriteInt32((int)PingDuration.TotalMilliseconds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -999,6 +1003,7 @@ namespace Game.Networking.Packets
|
||||
public PingSubjectType Type = PingSubjectType.Max;
|
||||
public uint PinFrameID;
|
||||
public ObjectGuid Transport;
|
||||
public TimeSpan PingDuration;
|
||||
|
||||
public SendPingWorldPoint(WorldPacket packet) : base(packet) { }
|
||||
|
||||
@@ -1010,6 +1015,7 @@ namespace Game.Networking.Packets
|
||||
Type = (PingSubjectType)_worldPacket.ReadUInt32();
|
||||
PinFrameID = _worldPacket.ReadUInt32();
|
||||
Transport = _worldPacket.ReadPackedGuid();
|
||||
PingDuration = TimeSpan.FromMilliseconds(_worldPacket.ReadInt32());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1020,6 +1026,7 @@ namespace Game.Networking.Packets
|
||||
public Vector3 Point;
|
||||
public PingSubjectType Type = PingSubjectType.Max;
|
||||
public uint PinFrameID;
|
||||
public TimeSpan PingDuration;
|
||||
public ObjectGuid Transport;
|
||||
|
||||
public ReceivePingWorldPoint() : base(ServerOpcodes.ReceivePingWorldPoint) { }
|
||||
@@ -1032,6 +1039,7 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteUInt8((byte)Type);
|
||||
_worldPacket.WriteUInt32(PinFrameID);
|
||||
_worldPacket.WritePackedGuid(Transport);
|
||||
_worldPacket.WriteInt32((int)PingDuration.TotalMilliseconds);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,21 +29,6 @@ namespace Game.Networking.Packets
|
||||
public override void Read() { }
|
||||
}
|
||||
|
||||
class QuestGiverStatusTrackedQuery : ClientPacket
|
||||
{
|
||||
public List<ObjectGuid> QuestGiverGUIDs = new();
|
||||
|
||||
public QuestGiverStatusTrackedQuery(WorldPacket packet) : base(packet) { }
|
||||
|
||||
public override void Read()
|
||||
{
|
||||
uint guidCount = _worldPacket.ReadUInt32();
|
||||
|
||||
for (uint i = 0; i < guidCount; ++i)
|
||||
QuestGiverGUIDs.Add(_worldPacket.ReadPackedGuid());
|
||||
}
|
||||
}
|
||||
|
||||
public class QuestGiverStatusPkt : ServerPacket
|
||||
{
|
||||
public QuestGiverStatusPkt() : base(ServerOpcodes.QuestGiverStatus, ConnectionType.Instance)
|
||||
@@ -196,6 +181,7 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteInt32(Info.Objectives.Count);
|
||||
_worldPacket.WriteUInt64(Info.AllowableRaces.RawValue);
|
||||
_worldPacket.WriteInt32(Info.TreasurePickerID.Count);
|
||||
_worldPacket.WriteInt32(Info.TreasurePickerID2.Count);
|
||||
_worldPacket.WriteInt32(Info.Expansion);
|
||||
_worldPacket.WriteInt32(Info.ManagedWorldStateID);
|
||||
_worldPacket.WriteInt32(Info.QuestSessionBonus);
|
||||
@@ -211,6 +197,10 @@ namespace Game.Networking.Packets
|
||||
foreach (var id in Info.TreasurePickerID)
|
||||
_worldPacket.WriteInt32(id);
|
||||
|
||||
if (!Info.TreasurePickerID2.Empty())
|
||||
foreach (var id in Info.TreasurePickerID2)
|
||||
_worldPacket.WriteInt32(id);
|
||||
|
||||
_worldPacket.WriteBits(Info.LogTitle.GetByteCount(), 9);
|
||||
_worldPacket.WriteBits(Info.LogDescription.GetByteCount(), 12);
|
||||
_worldPacket.WriteBits(Info.QuestDescription.GetByteCount(), 12);
|
||||
@@ -556,6 +546,8 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteInt32(Collect.Count);
|
||||
_worldPacket.WriteInt32(Currency.Count);
|
||||
_worldPacket.WritePackedGuid(QuestGiverGUID);
|
||||
_worldPacket.WriteUInt32(QuestGiverCreatureID);
|
||||
_worldPacket.WriteUInt32(QuestID);
|
||||
@@ -566,8 +558,6 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteUInt32(QuestFlags[2]);
|
||||
_worldPacket.WriteUInt32(SuggestPartyMembers);
|
||||
_worldPacket.WriteInt32(MoneyToGet);
|
||||
_worldPacket.WriteInt32(Collect.Count);
|
||||
_worldPacket.WriteInt32(Currency.Count);
|
||||
_worldPacket.WriteInt32(StatusFlags);
|
||||
_worldPacket.WriteInt32(QuestInfoID);
|
||||
|
||||
@@ -584,6 +574,7 @@ namespace Game.Networking.Packets
|
||||
}
|
||||
|
||||
_worldPacket.WriteBit(AutoLaunched);
|
||||
_worldPacket.WriteBit(ResetByScheduler);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
_worldPacket.WriteUInt32(QuestGiverCreatureID);
|
||||
@@ -606,6 +597,7 @@ namespace Game.Networking.Packets
|
||||
public uint CompEmoteDelay;
|
||||
public uint CompEmoteType;
|
||||
public bool AutoLaunched;
|
||||
public bool ResetByScheduler;
|
||||
public uint SuggestPartyMembers;
|
||||
public int MoneyToGet;
|
||||
public List<QuestObjectiveCollect> Collect = new();
|
||||
@@ -1088,6 +1080,7 @@ namespace Game.Networking.Packets
|
||||
public uint AreaGroupID;
|
||||
public long TimeAllowed;
|
||||
public List<int> TreasurePickerID = new();
|
||||
public List<int> TreasurePickerID2 = new(); // unknown purpose, used only sometimes and only if TreasurePickerID is empty
|
||||
public int Expansion;
|
||||
public int ManagedWorldStateID;
|
||||
public int QuestSessionBonus;
|
||||
@@ -1262,6 +1255,8 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
Rewards.Write(data); // QuestRewards
|
||||
data.WriteInt32(Emotes.Count);
|
||||
data.WritePackedGuid(QuestGiverGUID);
|
||||
data.WriteUInt32(QuestGiverCreatureID);
|
||||
data.WriteUInt32(QuestID);
|
||||
@@ -1270,7 +1265,6 @@ namespace Game.Networking.Packets
|
||||
data.WriteUInt32(QuestFlags[2]); // FlagsEx2
|
||||
data.WriteUInt32(SuggestedPartyMembers);
|
||||
data.WriteInt32(QuestInfoID);
|
||||
data.WriteInt32(Emotes.Count);
|
||||
|
||||
foreach (QuestDescEmote emote in Emotes)
|
||||
{
|
||||
@@ -1280,16 +1274,16 @@ namespace Game.Networking.Packets
|
||||
|
||||
data.WriteBit(AutoLaunched);
|
||||
data.WriteBit(false); // Unused
|
||||
data.WriteBit(ResetByScheduler);
|
||||
data.FlushBits();
|
||||
|
||||
Rewards.Write(data);
|
||||
}
|
||||
|
||||
public ObjectGuid QuestGiverGUID;
|
||||
public uint QuestGiverCreatureID = 0;
|
||||
public uint QuestID = 0;
|
||||
public bool AutoLaunched = false;
|
||||
public uint SuggestedPartyMembers = 0;
|
||||
public uint QuestGiverCreatureID;
|
||||
public uint QuestID;
|
||||
public bool AutoLaunched;
|
||||
public bool ResetByScheduler;
|
||||
public uint SuggestedPartyMembers;
|
||||
public QuestRewards Rewards = new();
|
||||
public List<QuestDescEmote> Emotes = new();
|
||||
public uint[] QuestFlags = new uint[3]; // Flags and FlagsEx
|
||||
|
||||
@@ -26,27 +26,6 @@ namespace Game.Networking.Packets
|
||||
public List<FactionBonusData> Bonuses = new();
|
||||
}
|
||||
|
||||
class RequestForcedReactions : ClientPacket
|
||||
{
|
||||
public RequestForcedReactions(WorldPacket packet) : base(packet) { }
|
||||
|
||||
public override void Read() { }
|
||||
}
|
||||
|
||||
class SetForcedReactions : ServerPacket
|
||||
{
|
||||
public SetForcedReactions() : base(ServerOpcodes.SetForcedReactions, ConnectionType.Instance) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteInt32(Reactions.Count);
|
||||
foreach (ForcedReaction reaction in Reactions)
|
||||
reaction.Write(_worldPacket);
|
||||
}
|
||||
|
||||
public List<ForcedReaction> Reactions = new();
|
||||
}
|
||||
|
||||
class SetFactionStanding : ServerPacket
|
||||
{
|
||||
public SetFactionStanding() : base(ServerOpcodes.SetFactionStanding, ConnectionType.Instance) { }
|
||||
@@ -95,18 +74,6 @@ namespace Game.Networking.Packets
|
||||
}
|
||||
}
|
||||
|
||||
struct ForcedReaction
|
||||
{
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteInt32(Faction);
|
||||
data.WriteInt32(Reaction);
|
||||
}
|
||||
|
||||
public int Faction;
|
||||
public int Reaction;
|
||||
}
|
||||
|
||||
struct FactionStandingData
|
||||
{
|
||||
public FactionStandingData(int index, int standing)
|
||||
|
||||
@@ -254,9 +254,15 @@ namespace Game
|
||||
public void ApplyForceReaction(uint faction_id, ReputationRank rank, bool apply)
|
||||
{
|
||||
if (apply)
|
||||
{
|
||||
_forcedReactions[faction_id] = rank;
|
||||
_player.SetVisibleForcedReaction(faction_id, rank);
|
||||
}
|
||||
else
|
||||
{
|
||||
_forcedReactions.Remove(faction_id);
|
||||
_player.RemoveVisibleForcedReaction(faction_id);
|
||||
}
|
||||
}
|
||||
|
||||
ReputationFlags GetDefaultStateFlags(FactionRecord factionEntry)
|
||||
@@ -273,21 +279,6 @@ namespace Game
|
||||
return flags;
|
||||
}
|
||||
|
||||
public void SendForceReactions()
|
||||
{
|
||||
SetForcedReactions setForcedReactions = new();
|
||||
|
||||
foreach (var pair in _forcedReactions)
|
||||
{
|
||||
ForcedReaction forcedReaction;
|
||||
forcedReaction.Faction = (int)pair.Key;
|
||||
forcedReaction.Reaction = (int)pair.Value;
|
||||
|
||||
setForcedReactions.Reactions.Add(forcedReaction);
|
||||
}
|
||||
_player.SendPacket(setForcedReactions);
|
||||
}
|
||||
|
||||
public void SendState(FactionState faction)
|
||||
{
|
||||
SetFactionStanding setFactionStanding = new();
|
||||
|
||||
@@ -4624,7 +4624,6 @@ namespace Game.Spells
|
||||
ReputationRank factionRank = (ReputationRank)GetAmount();
|
||||
|
||||
player.GetReputationMgr().ApplyForceReaction(factionId, factionRank, apply);
|
||||
player.GetReputationMgr().SendForceReactions();
|
||||
|
||||
// stop fighting at apply (if forced rank friendly) or at remove (if real rank friendly)
|
||||
if ((apply && factionRank >= ReputationRank.Friendly) || (!apply && player.GetReputationRank(factionId) >= ReputationRank.Friendly))
|
||||
|
||||
@@ -591,13 +591,7 @@ namespace Game
|
||||
FillSpentCurrenciesMap(traitConfig, cachedCurrencies);
|
||||
}
|
||||
|
||||
if (condition.TraitNodeGroupID != 0)
|
||||
{
|
||||
cachedCurrencies.TryAdd(condition.TraitCurrencyID, 0);
|
||||
if (cachedCurrencies[condition.TraitCurrencyID] < condition.SpentAmountRequired)
|
||||
return false;
|
||||
}
|
||||
else if (condition.TraitNodeID != 0)
|
||||
if (condition.TraitNodeGroupID != 0 || condition.TraitNodeID != 0 || condition.TraitNodeEntryID != 0)
|
||||
{
|
||||
cachedCurrencies.TryAdd(condition.TraitCurrencyID, 0);
|
||||
if (cachedCurrencies[condition.TraitCurrencyID] < condition.SpentAmountRequired)
|
||||
|
||||
Reference in New Issue
Block a user