Core/Misc: Define and use ChrRacesFlag and CreatureModelDataFlags
Port From (https://github.com/TrinityCore/TrinityCore/commit/d30e4a20e52a5025c59bfc746570ff7ef06af6f4)
This commit is contained in:
@@ -1000,9 +1000,34 @@ namespace Framework.Constants
|
||||
Factional = 0x40
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum ChrRacesFlag
|
||||
{
|
||||
AlliedRace = 0x80000
|
||||
NPCOnly = 0x01,
|
||||
DoNotComponentFeet = 0x02,
|
||||
CanMount = 0x04,
|
||||
HasBald = 0x08,
|
||||
BindToStartingArea = 0x10,
|
||||
AlternateForm = 0x20,
|
||||
CanMountSelf = 0x40,
|
||||
ForceToHDModelIfAvailable = 0x80,
|
||||
ExaltedWithAllVendors = 0x100,
|
||||
NotSelectable = 0x200,
|
||||
ReputationBonus = 0x400,
|
||||
UseLoincloth = 0x800,
|
||||
RestBonus = 0x1000,
|
||||
NoStartKits = 0x2000,
|
||||
NoStartingWeapon = 0x4000,
|
||||
DontRedeemAccountLicenses = 0x8000,
|
||||
SkinVariationIsHairColor = 0x10000,
|
||||
UsePandarenRingForComponentingTexture = 0x20000,
|
||||
IgnoreForAssetManifestComponentInfoParsing = 0x40000,
|
||||
IsAlliedRace = 0x80000,
|
||||
VoidVendorDiscount = 0x100000,
|
||||
DAMMComponentNoMaleGeneration = 0x200000,
|
||||
DAMMComponentNoFemaleGeneration = 0x400000,
|
||||
NoAssociatedFactionReputationInRaceChange = 0x800000,
|
||||
InternalOnly = 0x100000,
|
||||
}
|
||||
|
||||
public enum ChrSpecializationFlag
|
||||
@@ -1618,9 +1643,9 @@ namespace Framework.Constants
|
||||
|
||||
public enum PhaseEntryFlags : ushort
|
||||
{
|
||||
ReadOnly = 0x001,
|
||||
InternalPhase = 0x002,
|
||||
Normal = 0x008,
|
||||
ReadOnly = 0x1,
|
||||
InternalPhase = 0x2,
|
||||
Normal = 0x8,
|
||||
Cosmetic = 0x010,
|
||||
Personal = 0x020,
|
||||
Expensive = 0x040,
|
||||
@@ -2189,6 +2214,29 @@ namespace Framework.Constants
|
||||
Disabled = 0x1
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum CreatureModelDataFlags
|
||||
{
|
||||
NoFootprintParticles = 0x01,
|
||||
NoBreathParticles = 0x02,
|
||||
IsPlayerModel = 0x04,
|
||||
NoAttachedWeapons = 0x10,
|
||||
NoFootprintTrailTextures = 0x20,
|
||||
DisableHighlight = 0x40,
|
||||
CanMountWhileTransformedAsThis = 0x80,
|
||||
DisableScaleInterpolation = 0x100,
|
||||
ForceProjectedTex = 0x200,
|
||||
CanJumpInPlaceAsMount = 0x400,
|
||||
AICannotUseWalkBackwardsAnim = 0x800,
|
||||
IgnoreSpineLowForSplitBody = 0x1000,
|
||||
IgnoreHeadForSplitBody = 0x2000,
|
||||
IgnoreSpineLowForSplitBodyWhenFlying = 0x4000,
|
||||
IgnoreHeadForSplitBodyWhenFlying = 0x8000,
|
||||
UseWheelAnimationOnUnitWheelBones = 0x10000,
|
||||
IsHDModel = 0x20000,
|
||||
SuppressEmittersOnLowSettings = 0x40000
|
||||
}
|
||||
|
||||
public enum FriendshipReputationFlags : int
|
||||
{
|
||||
NoFXOnReactionChange = 0x01,
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace Game.DataStorage
|
||||
public int Flags;
|
||||
public int FactionID;
|
||||
public uint CinematicSequenceID;
|
||||
public int ResSicknessSpellID;
|
||||
public uint ResSicknessSpellID;
|
||||
public int SplashSoundID;
|
||||
public int Alliance;
|
||||
public int RaceRelated;
|
||||
@@ -471,6 +471,8 @@ namespace Game.DataStorage
|
||||
public sbyte Unknown820_1; // scale related
|
||||
public float Unknown820_2; // scale related
|
||||
public float[] Unknown820_3 = new float[2]; // scale related
|
||||
|
||||
public CreatureModelDataFlags GetFlags() { return (CreatureModelDataFlags)Flags; }
|
||||
}
|
||||
|
||||
public sealed class CreatureTypeRecord
|
||||
|
||||
@@ -1883,7 +1883,7 @@ namespace Game.Entities
|
||||
public uint GetStartLevel(Race race, Class playerClass, Optional<uint> characterTemplateId = default)
|
||||
{
|
||||
uint startLevel = WorldConfig.GetUIntValue(WorldCfg.StartPlayerLevel);
|
||||
if (CliDB.ChrRacesStorage.LookupByKey(race).GetFlags().HasAnyFlag(ChrRacesFlag.AlliedRace))
|
||||
if (CliDB.ChrRacesStorage.LookupByKey(race).GetFlags().HasAnyFlag(ChrRacesFlag.IsAlliedRace))
|
||||
startLevel = WorldConfig.GetUIntValue(WorldCfg.StartAlliedRaceLevel);
|
||||
|
||||
if (playerClass == Class.Deathknight)
|
||||
|
||||
@@ -301,8 +301,8 @@ namespace Game.Entities
|
||||
CreatureModelDataRecord model = CliDB.CreatureModelDataStorage.LookupByKey(display.ModelID);
|
||||
ChrRacesRecord race = CliDB.ChrRacesStorage.LookupByKey(displayExtra.DisplayRaceID);
|
||||
|
||||
if (model != null && !Convert.ToBoolean(model.Flags & 0x80))
|
||||
if (race != null && !Convert.ToBoolean(race.Flags & 0x4))
|
||||
if (model != null && !model.GetFlags().HasFlag(CreatureModelDataFlags.CanMountWhileTransformedAsThis))
|
||||
if (race != null && !race.GetFlags().HasFlag(ChrRacesFlag.CanMount))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user