Core: Updated to 11.1.0
Port From (https://github.com/TrinityCore/TrinityCore/commit/23624ed75abc8cbb77bb2e24a08e0836e4c41db5)
This commit is contained in:
@@ -2945,7 +2945,7 @@ namespace Game.Entities
|
||||
int scalingLevelMin = m_unitData.ScalingLevelMin;
|
||||
int scalingLevelMax = m_unitData.ScalingLevelMax;
|
||||
int scalingLevelDelta = m_unitData.ScalingLevelDelta;
|
||||
int scalingFactionGroup = m_unitData.ScalingFactionGroup;
|
||||
byte scalingFactionGroup = m_unitData.ScalingFactionGroup;
|
||||
uint targetLevel = unitTarget.m_unitData.EffectiveLevel;
|
||||
if (targetLevel == 0)
|
||||
targetLevel = unitTarget.GetLevel();
|
||||
@@ -3804,7 +3804,12 @@ namespace Game.Entities
|
||||
m_unitData.WriteCreate(data, flags, this, target);
|
||||
|
||||
if (m_vendorData != null)
|
||||
{
|
||||
if (EntityFragmentsHolder.IsIndirectFragment(EntityFragment.FVendor_C))
|
||||
data.WriteUInt8(1); // IndirectFragmentActive: FVendor_C
|
||||
|
||||
m_vendorData.WriteCreate(data, flags, this, target);
|
||||
}
|
||||
}
|
||||
|
||||
public override void BuildValuesUpdate(WorldPacket data, UpdateFieldFlag flags, Player target)
|
||||
@@ -3869,9 +3874,7 @@ namespace Game.Entities
|
||||
|
||||
public override void ClearUpdateMask(bool remove)
|
||||
{
|
||||
if (m_vendorData != null)
|
||||
m_values.ClearChangesMask(m_vendorData);
|
||||
|
||||
m_values.ClearChangesMask(m_vendorData);
|
||||
base.ClearUpdateMask(remove);
|
||||
}
|
||||
|
||||
|
||||
@@ -167,9 +167,9 @@ namespace Game.Entities
|
||||
stats.Flags[0] = (uint)creatureDifficulty.TypeFlags;
|
||||
stats.Flags[1] = creatureDifficulty.TypeFlags2;
|
||||
|
||||
stats.CreatureType = (int)CreatureType;
|
||||
stats.CreatureType = (sbyte)CreatureType;
|
||||
stats.CreatureFamily = (int)Family;
|
||||
stats.Classification = (int)Classification;
|
||||
stats.Classification = (sbyte)Classification;
|
||||
|
||||
for (uint i = 0; i < SharedConst.MaxCreatureKillCredit; ++i)
|
||||
stats.ProxyCreatureID[i] = KillCredit[i];
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Game.Misc
|
||||
public class GossipMenu
|
||||
{
|
||||
public uint AddMenuItem(int gossipOptionId, int orderIndex, GossipOptionNpc optionNpc, string optionText, uint language,
|
||||
GossipOptionFlags flags, int? gossipNpcOptionId, uint actionMenuId, uint actionPoiId, bool boxCoded, uint boxMoney,
|
||||
GossipOptionFlags flags, int? gossipNpcOptionId, uint actionMenuId, uint actionPoiId, bool boxCoded, ulong boxMoney,
|
||||
string boxText, int? spellId, int? overrideIconId, uint sender, uint action)
|
||||
{
|
||||
Cypher.Assert(_menuItems.Count <= SharedConst.MaxGossipMenuItems);
|
||||
@@ -261,7 +261,7 @@ namespace Game.Misc
|
||||
opt.GossipOptionID = item.GossipOptionID;
|
||||
opt.OptionNPC = item.OptionNpc;
|
||||
opt.OptionFlags = (byte)(item.BoxCoded ? 1 : 0); // makes pop up box password
|
||||
opt.OptionCost = (int)item.BoxMoney; // money required to open menu, 2.0.3
|
||||
opt.OptionCost = item.BoxMoney; // money required to open menu, 2.0.3
|
||||
opt.OptionLanguage = item.Language;
|
||||
opt.Flags = item.Flags;
|
||||
opt.OrderIndex = (int)item.OrderIndex;
|
||||
@@ -757,7 +757,7 @@ namespace Game.Misc
|
||||
public GossipOptionFlags Flags;
|
||||
public int? GossipNpcOptionID;
|
||||
public bool BoxCoded;
|
||||
public uint BoxMoney;
|
||||
public ulong BoxMoney;
|
||||
public string BoxText;
|
||||
public int? SpellID;
|
||||
public int? OverrideIconID;
|
||||
@@ -801,7 +801,7 @@ namespace Game.Misc
|
||||
public uint ActionPoiID;
|
||||
public int? GossipNpcOptionID;
|
||||
public bool BoxCoded;
|
||||
public uint BoxMoney;
|
||||
public ulong BoxMoney;
|
||||
public string BoxText;
|
||||
public uint BoxBroadcastTextId;
|
||||
public int? SpellID;
|
||||
|
||||
@@ -2355,7 +2355,7 @@ namespace Game.Entities
|
||||
Player player = user.ToPlayer();
|
||||
|
||||
EnableBarberShop enableBarberShop = new();
|
||||
enableBarberShop.CustomizationScope = (byte)info.BarberChair.CustomizationScope;
|
||||
enableBarberShop.CustomizationFeatureMask = (byte)info.BarberChair.CustomizationFeatureMask;
|
||||
player.SendPacket(enableBarberShop);
|
||||
|
||||
// fallback, will always work
|
||||
|
||||
@@ -1298,7 +1298,7 @@ namespace Game.Entities
|
||||
public int HeightOffset; // 1 Height Offset (inches), int, Min value: -100, Max value: 100, Default value: 0
|
||||
public uint SitAnimKit; // 2 Sit Anim Kit, References: AnimKit, NoValue = 0
|
||||
public uint InteractRadiusOverride; // 3 Interact Radius Override (Yards * 100), int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
public uint CustomizationScope; // 4 Customization Scope, int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
public uint CustomizationFeatureMask; // 4 Customization Feature Mask, int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
public uint Preventteleportingtheplayeroutofthebarbershopchair;// 5 Prevent teleporting the player out of the barbershop chair, enum { false, true, }; Default: false
|
||||
}
|
||||
|
||||
@@ -1476,13 +1476,14 @@ namespace Game.Entities
|
||||
|
||||
public struct uilink
|
||||
{
|
||||
public uint UILinkType; // 0 UI Link Type, enum { Adventure Journal, Obliterum Forge, Scrapping Machine, Item Interaction }; Default: Adventure Journal
|
||||
public uint UILinkType; // 0 UI Link Type(Deprecated), enum { Adventure Journal, Obliterum Forge, Scrapping Machine, Item Interaction }; Default: Adventure Journal
|
||||
public uint allowMounted; // 1 allowMounted, enum { false, true, }; Default: false
|
||||
public uint GiganticAOI; // 2 Gigantic AOI, enum { false, true, }; Default: false
|
||||
public uint spellFocusType; // 3 spellFocusType, References: SpellFocusObject, NoValue = 0
|
||||
public uint radius; // 4 radius, int, Min value: 0, Max value: 50, Default value: 10
|
||||
public uint InteractRadiusOverride; // 5 Interact Radius Override (Yards * 100), int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
public uint ItemInteractionID; // 6 Item Interaction ID, References: UiItemInteraction, NoValue = 0
|
||||
public uint PlayerInteractionType; // 7 Player Interaction Type, enum { None, TradePartner, Item, Gossip, QuestGiver, Merchant, TaxiNode, Trainer, Banker, AlliedRaceDetailsGiver, GuildBanker, Registrar, Vendor, PetitionVendor, GuildTabardVendor, TalentMaster, SpecializationMaster, MailInfo, SpiritHealer, AreaSpiritHealer, Binder, Auctioneer, StableMaster, BattleMaster, Transmogrifier, LFGDungeon, VoidStorageBanker, BlackMarketAuctioneer, AdventureMap, WorldMap, GarrArchitect, GarrTradeskill, GarrMission, ShipmentCrafter, GarrRecruitment, GarrTalent, Trophy, PlayerChoice, ArtifactForge, ObliterumForge, ScrappingMachine, ContributionCollector, AzeriteRespec, IslandQueue, ItemInteraction, ChromieTime, CovenantPreview, AnimaDiversion, LegendaryCrafting, WeeklyRewards, Soulbind, CovenantSanctum, NewPlayerGuide, ItemUpgrade, AdventureJournal, Renown, AzeriteForge, PerksProgramVendor, ProfessionsCraftingOrder, Professions, ProfessionsCustomerOrder, TraitSystem, BarbersChoice, JailersTowerBuffs, MajorFactionRenown, PersonalTabardVendor, ForgeMaster, CharacterBanker, AccountBanker, ProfessionRespec, PlaceholderType71, PlaceholderType72, PlaceholderType73, PlaceholderType74, PlaceholderType75, PlaceholderType76, PlaceholderType77, }; Default: None
|
||||
}
|
||||
|
||||
public struct keystonereceptacle
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -33,7 +33,7 @@ namespace Game.Entities
|
||||
FEntityLocalMatrix = 113,
|
||||
FEntityWorldMatrix = 114,
|
||||
CActor = 115, // INDIRECT,
|
||||
FVendor_C = 117, // UPDATEABLE,
|
||||
FVendor_C = 117, // UPDATEABLE, INDIRECT,
|
||||
FMirroredObject_C = 119,
|
||||
End = 255,
|
||||
}
|
||||
@@ -84,7 +84,7 @@ namespace Game.Entities
|
||||
Array.Sort(arr);
|
||||
++count;
|
||||
return (whereIndex, true);
|
||||
};
|
||||
}
|
||||
|
||||
if (!insertSorted(ref Ids, ref Count, fragment).Item2)
|
||||
return;
|
||||
@@ -103,7 +103,8 @@ namespace Game.Entities
|
||||
if (IsIndirectFragment(UpdateableIds[i]))
|
||||
{
|
||||
ContentsChangedMask |= UpdateableMasks[i]; // set the first bit to true to activate fragment
|
||||
UpdateableMasks[i] |= (byte)(1 << maskIndex++);
|
||||
++maskIndex;
|
||||
UpdateableMasks[i] <<= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,7 +126,7 @@ namespace Game.Entities
|
||||
return (where, true);
|
||||
}
|
||||
return (where, false);
|
||||
};
|
||||
}
|
||||
|
||||
if (!removeSorted(ref Ids, ref Count, fragment).Item2)
|
||||
return;
|
||||
@@ -142,7 +143,10 @@ namespace Game.Entities
|
||||
{
|
||||
UpdateableMasks[i] = (byte)(1 << maskIndex++);
|
||||
if (IsIndirectFragment(UpdateableIds[i]))
|
||||
UpdateableMasks[i] |= (byte)(1 << maskIndex++);
|
||||
{
|
||||
++maskIndex;
|
||||
UpdateableMasks[i] <<= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -157,7 +161,7 @@ namespace Game.Entities
|
||||
|
||||
public static bool IsIndirectFragment(EntityFragment frag)
|
||||
{
|
||||
return frag == EntityFragment.CGObject || frag == EntityFragment.CActor;
|
||||
return frag == EntityFragment.CGObject || frag == EntityFragment.CActor || frag == EntityFragment.FVendor_C;
|
||||
}
|
||||
|
||||
public EntityFragment[] GetIds() { return Ids[..Count]; }
|
||||
|
||||
@@ -249,9 +249,14 @@ namespace Game.Entities
|
||||
|
||||
public void BuildEntityFragmentsForValuesUpdateForPlayerWithMask(WorldPacket data, UpdateFieldFlag flags)
|
||||
{
|
||||
byte contentsChangedMask = EntityDefinitionsConst.CGObjectChangedMask;
|
||||
foreach (var updateableFragmentId in m_entityFragments.GetUpdateableIds())
|
||||
if (EntityFragmentsHolder.IsIndirectFragment(updateableFragmentId))
|
||||
contentsChangedMask |= (byte)(m_entityFragments.GetUpdateMaskFor(updateableFragmentId) >> 1); // set the "fragment exists" bit
|
||||
|
||||
data.WriteUInt8((byte)(flags.HasFlag(UpdateFieldFlag.Owner) ? 1 : 0));
|
||||
data.WriteUInt8(0); // m_entityFragments.IdsChanged
|
||||
data.WriteUInt8(EntityDefinitionsConst.CGObjectUpdateMask);
|
||||
data.WriteUInt8(contentsChangedMask);
|
||||
}
|
||||
|
||||
public void BuildDestroyUpdateBlock(UpdateData data)
|
||||
@@ -319,6 +324,7 @@ namespace Game.Entities
|
||||
bool HasSpline = unit.IsSplineEnabled();
|
||||
bool HasInertia = unit.m_movementInfo.inertia.HasValue;
|
||||
bool HasAdvFlying = unit.m_movementInfo.advFlying.HasValue;
|
||||
bool HasDriveStatus = unit.m_movementInfo.driveStatus.HasValue;
|
||||
bool HasStandingOnGameObjectGUID = unit.m_movementInfo.standingOnGameObjectGUID.HasValue;
|
||||
|
||||
data.WritePackedGuid(GetGUID()); // MoverGUID
|
||||
@@ -349,6 +355,9 @@ namespace Game.Entities
|
||||
data.WriteBit(false); // HeightChangeFailed
|
||||
data.WriteBit(false); // RemoteTimeValid
|
||||
data.WriteBit(HasInertia); // HasInertia
|
||||
data.WriteBit(HasAdvFlying); // HasAdvFlying
|
||||
data.WriteBit(HasDriveStatus); // HasDriveStatus
|
||||
data.FlushBits();
|
||||
|
||||
if (!unit.m_movementInfo.transport.guid.IsEmpty())
|
||||
MovementExtensions.WriteTransportInfo(data, unit.m_movementInfo.transport);
|
||||
@@ -382,6 +391,14 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
if (HasDriveStatus)
|
||||
{
|
||||
data.WriteBit(unit.m_movementInfo.driveStatus.Value.accelerating);
|
||||
data.WriteBit(unit.m_movementInfo.driveStatus.Value.drifting);
|
||||
data.WriteFloat(unit.m_movementInfo.driveStatus.Value.speed);
|
||||
data.WriteFloat(unit.m_movementInfo.driveStatus.Value.movementAngle);
|
||||
}
|
||||
|
||||
data.WriteFloat(unit.GetSpeed(UnitMoveType.Walk));
|
||||
data.WriteFloat(unit.GetSpeed(UnitMoveType.Run));
|
||||
data.WriteFloat(unit.GetSpeed(UnitMoveType.RunBack));
|
||||
@@ -841,7 +858,6 @@ namespace Game.Entities
|
||||
{
|
||||
m_values.ClearChangesMask(m_objectData);
|
||||
m_entityFragments.IdsChanged = false;
|
||||
m_entityFragments.ContentsChangedMask = EntityDefinitionsConst.CGObjectActiveMask;
|
||||
|
||||
if (m_objectUpdated)
|
||||
{
|
||||
@@ -3963,6 +3979,7 @@ namespace Game.Entities
|
||||
public JumpInfo jump;
|
||||
public float stepUpStartElevation { get; set; }
|
||||
public AdvFlying? advFlying;
|
||||
public Drive? driveStatus;
|
||||
public ObjectGuid? standingOnGameObjectGUID;
|
||||
|
||||
public MovementInfo()
|
||||
@@ -4027,12 +4044,14 @@ namespace Game.Entities
|
||||
public uint prevTime;
|
||||
public uint vehicleId;
|
||||
}
|
||||
|
||||
public struct Inertia
|
||||
{
|
||||
public int id;
|
||||
public Position force;
|
||||
public uint lifetime;
|
||||
}
|
||||
|
||||
public struct JumpInfo
|
||||
{
|
||||
public void Reset()
|
||||
@@ -4047,12 +4066,21 @@ namespace Game.Entities
|
||||
public float cosAngle;
|
||||
public float xyspeed;
|
||||
}
|
||||
|
||||
// advflying
|
||||
public struct AdvFlying
|
||||
{
|
||||
public float forwardVelocity;
|
||||
public float upVelocity;
|
||||
}
|
||||
|
||||
public struct Drive
|
||||
{
|
||||
public float speed;
|
||||
public float movementAngle;
|
||||
public bool accelerating;
|
||||
public bool drifting;
|
||||
}
|
||||
}
|
||||
|
||||
public class MovementForce
|
||||
@@ -4064,6 +4092,9 @@ namespace Game.Entities
|
||||
public float Magnitude;
|
||||
public MovementForceType Type;
|
||||
public int MovementForceID;
|
||||
public int Unknown1110_1;
|
||||
public int Unused1110;
|
||||
public uint Flags;
|
||||
|
||||
public void Read(WorldPacket data)
|
||||
{
|
||||
@@ -4073,6 +4104,9 @@ namespace Game.Entities
|
||||
TransportID = data.ReadUInt32();
|
||||
Magnitude = data.ReadFloat();
|
||||
MovementForceID = data.ReadInt32();
|
||||
Unknown1110_1 = data.ReadInt32();
|
||||
Unused1110 = data.ReadInt32();
|
||||
Flags = data.ReadUInt32();
|
||||
Type = (MovementForceType)data.ReadBits<byte>(2);
|
||||
}
|
||||
|
||||
@@ -4264,7 +4298,13 @@ namespace Game.Entities
|
||||
{
|
||||
_owner.m_entityFragments.ContentsChangedMask &= (byte)~_owner.m_entityFragments.GetUpdateMaskFor((EntityFragment)updateData._blockBit);
|
||||
if ((EntityFragment)updateData._blockBit == EntityFragment.CGObject)
|
||||
{
|
||||
_changesMask.Reset(updateData.Bit);
|
||||
if (!_changesMask.IsAnySet())
|
||||
_owner.m_entityFragments.ContentsChangedMask &= (byte)~_owner.m_entityFragments.GetUpdateMaskFor((EntityFragment)updateData._blockBit);
|
||||
}
|
||||
else
|
||||
_owner.m_entityFragments.ContentsChangedMask &= (byte)~_owner.m_entityFragments.GetUpdateMaskFor((EntityFragment)updateData._blockBit);
|
||||
|
||||
updateData.ClearChangesMask();
|
||||
}
|
||||
@@ -4273,7 +4313,13 @@ namespace Game.Entities
|
||||
{
|
||||
_owner.m_entityFragments.ContentsChangedMask &= (byte)~_owner.m_entityFragments.GetUpdateMaskFor((EntityFragment)updateData._blockBit);
|
||||
if ((EntityFragment)updateData._blockBit == EntityFragment.CGObject)
|
||||
{
|
||||
_changesMask.Reset(updateData.Bit);
|
||||
if (!_changesMask.IsAnySet())
|
||||
_owner.m_entityFragments.ContentsChangedMask &= (byte)~_owner.m_entityFragments.GetUpdateMaskFor((EntityFragment)updateData._blockBit);
|
||||
}
|
||||
else
|
||||
_owner.m_entityFragments.ContentsChangedMask &= (byte)~_owner.m_entityFragments.GetUpdateMaskFor((EntityFragment)updateData._blockBit);
|
||||
|
||||
if (typeof(IHasChangesMask).IsAssignableFrom(typeof(U)))
|
||||
((IHasChangesMask)updateField._value).ClearChangesMask();
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace Game.Entities
|
||||
data.Honor = honor;
|
||||
data.OriginalHonor = honor;
|
||||
data.Target = victim_guid;
|
||||
data.Rank = victim_rank;
|
||||
data.Rank = (sbyte)victim_rank;
|
||||
|
||||
SendPacket(data);
|
||||
|
||||
|
||||
@@ -853,7 +853,7 @@ namespace Game.Entities
|
||||
Pet oldPet = GetPet();
|
||||
if (oldPet != null && !oldPet.IsAlive())
|
||||
{
|
||||
sess.SendPetStableResult(StableResult.InternalError);
|
||||
sess.SendPetStableResult(StableResult.NoPet);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -881,7 +881,7 @@ namespace Game.Entities
|
||||
Pet oldPet = GetPet();
|
||||
if (oldPet != null && !oldPet.IsAlive())
|
||||
{
|
||||
sess.SendPetStableResult(StableResult.InternalError);
|
||||
sess.SendPetStableResult(StableResult.NoPet);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2813,7 +2813,7 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
long cost = item.BoxMoney;
|
||||
long cost = (long)item.BoxMoney;
|
||||
if (!HasEnoughMoney(cost))
|
||||
{
|
||||
SendBuyError(BuyResult.NotEnoughtMoney, null, 0);
|
||||
@@ -2968,7 +2968,7 @@ namespace Game.Entities
|
||||
PlayerInteractionType.ProfessionsCraftingOrder, PlayerInteractionType.Professions, PlayerInteractionType.ProfessionsCustomerOrder,
|
||||
PlayerInteractionType.TraitSystem, PlayerInteractionType.BarbersChoice, PlayerInteractionType.MajorFactionRenown,
|
||||
PlayerInteractionType.PersonalTabardVendor, PlayerInteractionType.ForgeMaster, PlayerInteractionType.CharacterBanker,
|
||||
PlayerInteractionType.AccountBanker
|
||||
PlayerInteractionType.AccountBanker, PlayerInteractionType.ProfessionRespec
|
||||
};
|
||||
|
||||
PlayerInteractionType interactionType = GossipOptionNpcToInteractionType[(int)gossipOptionNpc];
|
||||
@@ -5938,8 +5938,8 @@ namespace Game.Entities
|
||||
|
||||
PlayerLevelInfo info = ObjectMgr.GetPlayerLevelInfo(GetRace(), GetClass(), GetLevel());
|
||||
|
||||
int exp_max_lvl = (int)ObjectMgr.GetMaxLevelForExpansion(GetSession().GetExpansion());
|
||||
int conf_max_lvl = WorldConfig.GetIntValue(WorldCfg.MaxPlayerLevel);
|
||||
uint exp_max_lvl = ObjectMgr.GetMaxLevelForExpansion(GetSession().GetExpansion());
|
||||
uint conf_max_lvl = WorldConfig.GetUIntValue(WorldCfg.MaxPlayerLevel);
|
||||
if (exp_max_lvl == SharedConst.DefaultMaxLevel || exp_max_lvl >= conf_max_lvl)
|
||||
SetUpdateFieldValue(m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.MaxLevel), conf_max_lvl);
|
||||
else
|
||||
@@ -8023,7 +8023,7 @@ namespace Game.Entities
|
||||
{
|
||||
PlayerTalkClass.GetGossipMenu().AddMenuItem(0, -1, optionNpc, text, 0, GossipOptionFlags.None, null, 0, 0, false, 0, "", null, null, sender, action);
|
||||
}
|
||||
public void AddGossipItem(GossipOptionNpc optionNpc, string text, uint sender, uint action, string popupText, uint popupMoney, bool coded)
|
||||
public void AddGossipItem(GossipOptionNpc optionNpc, string text, uint sender, uint action, string popupText, ulong popupMoney, bool coded)
|
||||
{
|
||||
PlayerTalkClass.GetGossipMenu().AddMenuItem(0, -1, optionNpc, text, 0, GossipOptionFlags.None, null, 0, 0, coded, popupMoney, popupText, null, null, sender, action);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user